Lots of work... Add an entry widget (semi-broken), image burning now works, xdnd stuff.

This commit is contained in:
Jaime Thomas
2008-12-09 01:12:16 +00:00
parent cefb0a7a76
commit 32640312d9
19 changed files with 913 additions and 45 deletions

View File

@@ -26,7 +26,7 @@ ecdb_project_init(Ecdb_Project *proj)
void
ecdb_project_destroy(Ecdb_Project *proj)
{
free(proj);
printf("Destroying base project\n");
}
void
@@ -155,4 +155,96 @@ ecdb_button_icon_swallow(Evas *e, Evas_Object *b, const char *iname)
evas_object_show(icon);
}
int
ecdb_dnd_position(void *data, int type, void *event)
{
Ecore_X_Event_Xdnd_Position *ev;
Evas_Object *o;
Ecore_X_Rectangle rect;
Evas_Coord window_x, window_y, window_w, window_h, x, y, w, h;
ev = event;
if (ev->win != ecore_evas_software_x11_window_get(em->main_win_ee))
return 1;
ecore_evas_geometry_get(em->main_win_ee, &window_x,
&window_y, &window_w, &window_h);
ecore_list_first_goto(em->dnd_candidates);
while ((o = ecore_list_next(em->dnd_candidates)))
{
if (evas_object_visible_get(o))
{
evas_object_geometry_get(o, &x, &y, &w, &h);
x += window_x;
y += window_y;
if ((ev->position.x >= x) && (ev->position.x <= (x+w))
&& (ev->position.y >= y)
&& (ev->position.y <= (y + h)))
{
rect.x = x;
rect.y = y;
rect.width = w;
rect.height = h;
em->drop_object = o;
ecore_x_dnd_send_status(1, 1, rect,
ECORE_X_DND_ACTION_PRIVATE);
return 1;
}
}
}
rect.x = window_x;
rect.y = window_y;
rect.width = window_w;
rect.height = window_h;
ecore_x_dnd_send_status(0, 1, rect, ECORE_X_DND_ACTION_PRIVATE);
return 1;
}
int
ecdb_dnd_drop(void *data, int type, void *event)
{
if (em->drop_object)
{
ecore_x_selection_xdnd_request
(ecore_evas_software_x11_window_get(em->main_win_ee),
"text/uri-list");
}
return 1;
}
int
ecdb_dnd_selection(void *data, int type, void *event)
{
Ecore_X_Event_Selection_Notify *ev;
Ecore_X_Selection_Data_Files *files;
void (*call_func)(Evas_Object *, Ecore_X_Selection_Data_Files *) =
NULL;
ev = event;
if ((!em->drop_object) || (ev->selection != ECORE_X_SELECTION_XDND)
|| (!(files = ev->data)) || (files->num_files <= 0))
{
ecore_x_dnd_send_finished();
return 1;
}
call_func = evas_object_data_get(em->drop_object, "dnd_call_func");
if (call_func != NULL)
call_func(em->drop_object, files);
em->drop_object = NULL;
ecore_x_dnd_send_finished();
return 1;
}
// For use with the entry group, where only one file is valid. We take the
// first one and ignore the rest (if any)
void
ecdb_dnd_entry_dnd_set(Evas_Object *o, Ecore_X_Selection_Data_Files *files)
{
edje_object_part_text_set(o, "label", files->files[0]);
}