Data burn actually burns the cd now. Woot! Now just for gui cleanups, etc.

This commit is contained in:
Jaime Thomas
2008-12-23 22:42:15 +00:00
parent 21bcd8dfa1
commit fd9c83c719
9 changed files with 83 additions and 48 deletions

View File

@@ -45,9 +45,13 @@ ecdb_shutdown(void *data, int type, void *event)
{
ecdb_drive_info_list_free(em->drives);
}
if (em->dnd_candidates)
if (em->evas_dnd_candidates)
{
eina_list_free(em->dnd_candidates);
eina_list_free(em->evas_dnd_candidates);
}
if (em->ewl_dnd_candidates)
{
eina_list_free(em->ewl_dnd_candidates);
}
FREE(em);
@@ -169,6 +173,7 @@ ecdb_dnd_position(void *data, int type, void *event)
Eina_List *l;
Ecore_X_Event_Xdnd_Position *ev;
Evas_Object *o;
Ewl_Widget *ew;
Ecore_X_Rectangle rect;
Evas_Coord window_x, window_y, window_w, window_h, x, y, w, h;
@@ -180,8 +185,8 @@ ecdb_dnd_position(void *data, int type, void *event)
ecore_evas_geometry_get(em->main_win_ee, &window_x, &window_y, &window_w,
&window_h);
em->dnd_candidates = eina_list_nth_list(em->dnd_candidates, 0);
EINA_LIST_FOREACH(em->dnd_candidates, l, o)
em->evas_dnd_candidates = eina_list_nth_list(em->evas_dnd_candidates, 0);
EINA_LIST_FOREACH(em->evas_dnd_candidates, l, o)
{
if (evas_object_visible_get(o))
{
@@ -189,20 +194,42 @@ ecdb_dnd_position(void *data, int type, void *event)
x += window_x;
y += window_y;
if ((ev->position.x >= x) && (ev->position.x <= (x+w))
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;
em->evas_drop_object = o;
em->ewl_drop_object = NULL;
ecore_x_dnd_send_status(1, 1, rect, ECORE_X_DND_ACTION_PRIVATE);
return 1;
}
}
}
em->ewl_dnd_candidates = eina_list_nth_list(em->ewl_dnd_candidates, 0);
EINA_LIST_FOREACH(em->ewl_dnd_candidates, l, ew)
{
ewl_object_current_geometry_get(EWL_OBJECT(ew), &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->ewl_drop_object = ew;
em->evas_drop_object = NULL;
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;
@@ -215,7 +242,7 @@ ecdb_dnd_position(void *data, int type, void *event)
int
ecdb_dnd_drop(void *data, int type, void *event)
{
if (em->drop_object)
if ((em->evas_drop_object) || (em->ewl_drop_object))
{
ecore_x_selection_xdnd_request
(ecore_evas_software_x11_window_get(em->main_win_ee),
@@ -228,24 +255,41 @@ int
ecdb_dnd_selection(void *data, int type, void *event)
{
Ecore_X_Event_Selection_Notify *ev;
Ecore_X_Selection_Data *d;
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))
if (((!em->evas_drop_object) && (!em->ewl_drop_object)) ||
(ev->selection != ECORE_X_SELECTION_XDND) || (!(files = ev->data)) ||
(!(d = 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)
if (em->evas_drop_object)
{
call_func(em->drop_object, files);
call_func = evas_object_data_get(em->evas_drop_object, "dnd_call_func");
if (call_func != NULL)
{
call_func(em->evas_drop_object, files);
}
}
else
{
Ewl_Event_Dnd_Data_Received ewl_ev;
ewl_ev.type = ev->target;
ewl_ev.data = files->files;
ewl_ev.len = files->num_files;
ewl_ev.format = d->format;
ewl_callback_call_with_event_data(em->ewl_drop_object,
EWL_CALLBACK_DND_DATA_RECEIVED, &ewl_ev);
}
em->drop_object = NULL;
em->evas_drop_object = NULL;
em->ewl_drop_object = NULL;
ecore_x_dnd_send_finished();
return 1;
}