2005-04-23 06:13:57 -07:00
|
|
|
#include "e.h"
|
|
|
|
|
2005-05-10 12:35:12 -07:00
|
|
|
/* local subsystem functions */
|
2005-04-23 06:13:57 -07:00
|
|
|
|
2012-09-11 02:07:54 -07:00
|
|
|
static void _e_drag_move(E_Drag *drag, int x, int y);
|
|
|
|
static void _e_drag_coords_update(const E_Drop_Handler *h, int *dx, int *dy);
|
2015-08-04 15:47:30 -07:00
|
|
|
static Ecore_Window _e_drag_win_get(const E_Drop_Handler *h, int xdnd);
|
|
|
|
static int _e_drag_win_matches(E_Drop_Handler *h, Ecore_Window win, int xdnd);
|
2012-09-11 02:07:54 -07:00
|
|
|
static void _e_drag_win_show(E_Drop_Handler *h);
|
|
|
|
static void _e_drag_win_hide(E_Drop_Handler *h);
|
2015-08-04 15:47:30 -07:00
|
|
|
static int _e_drag_update(Ecore_Window root, int x, int y, Ecore_X_Atom action);
|
2013-02-21 04:55:22 -08:00
|
|
|
static void _e_drag_end(int x, int y);
|
2015-08-04 15:47:30 -07:00
|
|
|
static void _e_drag_xdnd_end(Ecore_Window root, int x, int y);
|
2012-09-11 02:07:54 -07:00
|
|
|
static void _e_drag_free(E_Drag *drag);
|
|
|
|
|
|
|
|
static Eina_Bool _e_dnd_cb_key_down(void *data, int type, void *event);
|
|
|
|
static Eina_Bool _e_dnd_cb_key_up(void *data, int type, void *event);
|
|
|
|
static Eina_Bool _e_dnd_cb_mouse_up(void *data, int type, void *event);
|
|
|
|
static Eina_Bool _e_dnd_cb_mouse_move(void *data, int type, void *event);
|
2014-03-11 04:24:41 -07:00
|
|
|
#ifndef HAVE_WAYLAND_ONLY
|
2012-09-11 02:07:54 -07:00
|
|
|
static Eina_Bool _e_dnd_cb_event_dnd_enter(void *data, int type, void *event);
|
|
|
|
static Eina_Bool _e_dnd_cb_event_dnd_leave(void *data, int type, void *event);
|
|
|
|
static Eina_Bool _e_dnd_cb_event_dnd_position(void *data, int type, void *event);
|
|
|
|
static Eina_Bool _e_dnd_cb_event_dnd_finished(void *data, int type, void *event);
|
|
|
|
static Eina_Bool _e_dnd_cb_event_dnd_drop(void *data, int type, void *event);
|
|
|
|
static Eina_Bool _e_dnd_cb_event_dnd_selection(void *data, int type, void *event);
|
2013-10-03 02:06:54 -07:00
|
|
|
static Eina_Bool _e_dnd_cb_event_hide(void *data, int type, Ecore_X_Event_Window_Hide *ev);
|
2014-03-11 04:24:41 -07:00
|
|
|
#endif
|
2005-04-23 06:13:57 -07:00
|
|
|
|
2005-05-10 12:35:12 -07:00
|
|
|
/* local subsystem globals */
|
|
|
|
|
2005-06-27 03:08:53 -07:00
|
|
|
typedef struct _XDnd XDnd;
|
|
|
|
|
|
|
|
struct _XDnd
|
|
|
|
{
|
2012-09-11 02:07:54 -07:00
|
|
|
int x, y;
|
2009-03-18 17:14:57 -07:00
|
|
|
const char *type;
|
2012-09-11 02:07:54 -07:00
|
|
|
void *data;
|
2005-06-27 03:08:53 -07:00
|
|
|
};
|
2005-06-10 14:26:50 -07:00
|
|
|
|
2008-10-22 04:49:33 -07:00
|
|
|
static Eina_List *_event_handlers = NULL;
|
|
|
|
static Eina_List *_drop_handlers = NULL;
|
2013-05-29 01:15:21 -07:00
|
|
|
static Eina_List *_active_handlers = NULL;
|
2008-12-17 07:33:43 -08:00
|
|
|
static Eina_Hash *_drop_win_hash = NULL;
|
2005-05-10 12:35:12 -07:00
|
|
|
|
2015-08-04 15:47:30 -07:00
|
|
|
static Ecore_Window _drag_win = 0;
|
|
|
|
static Ecore_Window _drag_win_root = 0;
|
2005-05-10 12:35:12 -07:00
|
|
|
|
2008-10-22 04:49:33 -07:00
|
|
|
static Eina_List *_drag_list = NULL;
|
2012-09-11 02:07:54 -07:00
|
|
|
static E_Drag *_drag_current = NULL;
|
2005-05-10 12:35:12 -07:00
|
|
|
|
2007-08-18 03:37:16 -07:00
|
|
|
static XDnd *_xdnd = NULL;
|
2012-09-11 09:17:24 -07:00
|
|
|
static Ecore_X_Atom _text_atom = 0;
|
2013-05-29 01:15:21 -07:00
|
|
|
|
|
|
|
static Eina_Stringshare *_type_text_uri_list = NULL;
|
|
|
|
static Eina_Stringshare *_type_xds = NULL;
|
|
|
|
static Eina_Stringshare *_type_text_x_moz_url = NULL;
|
|
|
|
static Eina_Stringshare *_type_enlightenment_x_file = NULL;
|
|
|
|
|
|
|
|
static Eina_Stringshare **_e_dnd_types[] =
|
|
|
|
{
|
|
|
|
&_type_text_uri_list,
|
|
|
|
&_type_xds,
|
2013-05-29 05:43:55 -07:00
|
|
|
&_type_text_x_moz_url,
|
2013-05-29 01:15:21 -07:00
|
|
|
//&_type_enlightenment_x_file,
|
|
|
|
NULL
|
|
|
|
};
|
2009-03-18 17:14:57 -07:00
|
|
|
|
2008-12-17 07:33:43 -08:00
|
|
|
static Eina_Hash *_drop_handlers_responsives;
|
2008-08-10 19:13:22 -07:00
|
|
|
static Ecore_X_Atom _action;
|
|
|
|
|
2013-06-11 23:40:43 -07:00
|
|
|
static void
|
|
|
|
_e_drop_handler_active_check(E_Drop_Handler *h, const E_Drag *drag, Eina_Stringshare *type)
|
|
|
|
{
|
|
|
|
unsigned int i, j;
|
|
|
|
|
|
|
|
if (h->hidden) return;
|
|
|
|
for (i = 0; i < h->num_types; i++)
|
|
|
|
{
|
|
|
|
if (drag)
|
|
|
|
{
|
|
|
|
for (j = 0; j < drag->num_types; j++)
|
|
|
|
{
|
|
|
|
if (h->types[i] != drag->types[j]) continue;
|
|
|
|
h->active = 1;
|
|
|
|
h->active_type = eina_stringshare_ref(h->types[i]);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (h->types[i] != type) continue;
|
|
|
|
h->active = 1;
|
|
|
|
h->active_type = eina_stringshare_ref(h->types[i]);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-08-04 15:45:36 -07:00
|
|
|
static int
|
2015-07-31 12:35:55 -07:00
|
|
|
_e_drag_finalize(E_Drag *drag, E_Drag_Type type, int x, int y)
|
|
|
|
{
|
|
|
|
const Eina_List *l;
|
|
|
|
E_Drop_Handler *h;
|
|
|
|
|
2015-08-04 15:45:36 -07:00
|
|
|
if (_drag_win) return 0;
|
|
|
|
#ifndef HAVE_WAYLAND_ONLY
|
|
|
|
if (e_comp->comp_type == E_PIXMAP_TYPE_X)
|
|
|
|
{
|
|
|
|
_drag_win = ecore_x_window_input_new(e_comp->win,
|
|
|
|
0, 0,
|
|
|
|
e_comp->w, e_comp->h);
|
|
|
|
ecore_event_window_register(_drag_win, e_comp->ee, e_comp->evas,
|
|
|
|
NULL, NULL, NULL, NULL);
|
|
|
|
ecore_x_window_show(_drag_win);
|
|
|
|
_drag_win_root = e_comp->root;
|
|
|
|
if (!e_grabinput_get(_drag_win, 0, _drag_win))
|
|
|
|
{
|
|
|
|
ecore_x_window_free(_drag_win);
|
|
|
|
_drag_win = _drag_win_root = 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
_drag_win = _drag_win_root = e_comp->ee_win;
|
|
|
|
if (!e_comp_grab_input(1, 1))
|
|
|
|
{
|
|
|
|
_drag_win = _drag_win_root = 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-07-31 12:35:55 -07:00
|
|
|
if (!drag->object)
|
|
|
|
{
|
|
|
|
e_drag_object_set(drag, evas_object_rectangle_add(drag->evas));
|
2015-08-06 16:15:18 -07:00
|
|
|
evas_object_color_set(drag->object, 0, 0, 0, 0);
|
|
|
|
//evas_object_color_set(drag->object, 255, 0, 0, 255);
|
2015-07-31 12:35:55 -07:00
|
|
|
}
|
|
|
|
evas_object_move(drag->comp_object, drag->x, drag->y);
|
|
|
|
evas_object_resize(drag->comp_object, drag->w, drag->h);
|
|
|
|
drag->visible = 1;
|
2015-08-04 11:14:27 -07:00
|
|
|
evas_object_show(drag->comp_object);
|
2015-07-31 12:35:55 -07:00
|
|
|
drag->type = type;
|
|
|
|
|
|
|
|
drag->dx = x - drag->x;
|
|
|
|
drag->dy = y - drag->y;
|
|
|
|
|
|
|
|
_active_handlers = eina_list_free(_active_handlers);
|
|
|
|
EINA_LIST_FOREACH(_drop_handlers, l, h)
|
|
|
|
{
|
|
|
|
Eina_Bool active = h->active;
|
|
|
|
|
|
|
|
h->active = 0;
|
|
|
|
eina_stringshare_replace(&h->active_type, NULL);
|
|
|
|
_e_drop_handler_active_check(h, drag, NULL);
|
|
|
|
if (h->active != active)
|
|
|
|
{
|
|
|
|
if (h->active)
|
|
|
|
_active_handlers = eina_list_append(_active_handlers, h);
|
|
|
|
else
|
|
|
|
_active_handlers = eina_list_remove(_active_handlers, h);
|
|
|
|
}
|
|
|
|
h->entered = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (type == E_DRAG_XDND)
|
|
|
|
{
|
|
|
|
#ifndef HAVE_WAYLAND_ONLY
|
|
|
|
if (e_comp->comp_type == E_PIXMAP_TYPE_X)
|
|
|
|
{
|
|
|
|
Ecore_X_Atom actions[] = {
|
|
|
|
ECORE_X_DND_ACTION_MOVE, ECORE_X_DND_ACTION_PRIVATE,
|
|
|
|
ECORE_X_DND_ACTION_COPY, ECORE_X_DND_ACTION_ASK,
|
|
|
|
ECORE_X_DND_ACTION_LINK
|
|
|
|
};
|
|
|
|
|
|
|
|
ecore_x_dnd_aware_set(_drag_win, 1);
|
|
|
|
ecore_x_dnd_types_set(_drag_win, drag->types, drag->num_types);
|
|
|
|
ecore_x_dnd_actions_set(_drag_win, actions, 5);
|
|
|
|
ecore_x_dnd_begin(_drag_win, drag->data, drag->data_size);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_WAYLAND
|
|
|
|
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
2016-01-22 09:55:32 -08:00
|
|
|
e_bindings_disabled_set(1);
|
2015-07-31 12:35:55 -07:00
|
|
|
_drag_current = drag;
|
2015-08-04 15:45:36 -07:00
|
|
|
return 1;
|
2015-07-31 12:35:55 -07:00
|
|
|
}
|
|
|
|
|
2005-05-10 12:35:12 -07:00
|
|
|
/* externally accessible functions */
|
|
|
|
|
2010-11-22 07:21:32 -08:00
|
|
|
EINTERN int
|
2005-04-23 06:13:57 -07:00
|
|
|
e_dnd_init(void)
|
|
|
|
{
|
2015-08-05 13:06:33 -07:00
|
|
|
if (!_event_handlers)
|
|
|
|
{
|
|
|
|
_type_text_uri_list = eina_stringshare_add("text/uri-list");
|
|
|
|
_type_xds = eina_stringshare_add("XdndDirectSave0");
|
|
|
|
_type_text_x_moz_url = eina_stringshare_add("text/x-moz-url");
|
|
|
|
_type_enlightenment_x_file = eina_stringshare_add("enlightenment/x-file");
|
|
|
|
|
|
|
|
_drop_win_hash = eina_hash_int32_new(NULL);
|
|
|
|
_drop_handlers_responsives = eina_hash_int32_new(NULL);
|
|
|
|
|
|
|
|
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_EVENT_MOUSE_BUTTON_UP, _e_dnd_cb_mouse_up, NULL);
|
|
|
|
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_EVENT_MOUSE_MOVE, _e_dnd_cb_mouse_move, NULL);
|
|
|
|
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_EVENT_KEY_DOWN, _e_dnd_cb_key_down, NULL);
|
|
|
|
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_EVENT_KEY_UP, _e_dnd_cb_key_up, NULL);
|
|
|
|
}
|
|
|
|
if (!e_comp_util_has_x()) return 1;
|
2014-03-11 04:24:41 -07:00
|
|
|
#ifndef HAVE_WAYLAND_ONLY
|
2015-08-05 13:06:33 -07:00
|
|
|
if (_text_atom) return 1;
|
|
|
|
_text_atom = ecore_x_atom_get("text/plain");
|
2012-12-06 01:04:18 -08:00
|
|
|
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_X_EVENT_XDND_ENTER, _e_dnd_cb_event_dnd_enter, NULL);
|
|
|
|
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_X_EVENT_XDND_LEAVE, _e_dnd_cb_event_dnd_leave, NULL);
|
|
|
|
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_X_EVENT_XDND_POSITION, _e_dnd_cb_event_dnd_position, NULL);
|
|
|
|
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_X_EVENT_XDND_FINISHED, _e_dnd_cb_event_dnd_finished, NULL);
|
|
|
|
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_X_EVENT_XDND_DROP, _e_dnd_cb_event_dnd_drop, NULL);
|
|
|
|
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_X_EVENT_SELECTION_NOTIFY, _e_dnd_cb_event_dnd_selection, NULL);
|
2013-10-03 02:06:54 -07:00
|
|
|
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_X_EVENT_WINDOW_HIDE, _e_dnd_cb_event_hide, NULL);
|
2008-08-10 19:13:22 -07:00
|
|
|
|
2015-08-05 13:06:33 -07:00
|
|
|
if (e_comp->comp_type == E_PIXMAP_TYPE_X)
|
|
|
|
e_drop_xdnd_register_set(e_comp->ee_win, 1);
|
2015-08-06 16:26:08 -07:00
|
|
|
else
|
|
|
|
e_drop_xdnd_register_set(e_comp->cm_selection, 1);
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
|
2008-08-10 19:13:22 -07:00
|
|
|
_action = ECORE_X_ATOM_XDND_ACTION_PRIVATE;
|
2014-03-11 04:24:41 -07:00
|
|
|
#endif
|
2005-04-23 06:13:57 -07:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2010-11-22 07:21:32 -08:00
|
|
|
EINTERN int
|
2005-04-23 06:13:57 -07:00
|
|
|
e_dnd_shutdown(void)
|
|
|
|
{
|
2009-08-21 08:08:49 -07:00
|
|
|
E_FREE_LIST(_drag_list, e_object_del);
|
|
|
|
|
2013-05-29 01:15:21 -07:00
|
|
|
_active_handlers = eina_list_free(_active_handlers);
|
2009-08-21 08:08:49 -07:00
|
|
|
E_FREE_LIST(_drop_handlers, e_drop_handler_del);
|
|
|
|
|
|
|
|
E_FREE_LIST(_event_handlers, ecore_event_handler_del);
|
2005-04-23 06:13:57 -07:00
|
|
|
|
2008-12-17 07:33:43 -08:00
|
|
|
eina_hash_free(_drop_win_hash);
|
2005-04-23 06:13:57 -07:00
|
|
|
|
2008-12-17 07:33:43 -08:00
|
|
|
eina_hash_free(_drop_handlers_responsives);
|
2008-08-10 19:13:22 -07:00
|
|
|
|
2009-03-18 17:14:57 -07:00
|
|
|
eina_stringshare_del(_type_text_uri_list);
|
2012-09-11 09:17:24 -07:00
|
|
|
eina_stringshare_del(_type_xds);
|
2009-03-18 17:14:57 -07:00
|
|
|
eina_stringshare_del(_type_text_x_moz_url);
|
|
|
|
eina_stringshare_del(_type_enlightenment_x_file);
|
|
|
|
_type_text_uri_list = NULL;
|
2012-09-11 09:17:24 -07:00
|
|
|
_type_xds = NULL;
|
2009-03-18 17:14:57 -07:00
|
|
|
_type_text_x_moz_url = NULL;
|
|
|
|
_type_enlightenment_x_file = NULL;
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
_text_atom = 0;
|
2009-03-18 17:14:57 -07:00
|
|
|
|
2005-04-23 06:13:57 -07:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API E_Drag *
|
2014-01-15 15:02:08 -08:00
|
|
|
e_drag_current_get(void)
|
|
|
|
{
|
|
|
|
return _drag_current;
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API E_Drag *
|
2015-03-13 13:14:48 -07:00
|
|
|
e_drag_new(int x, int y,
|
2012-09-11 02:07:54 -07:00
|
|
|
const char **types, unsigned int num_types,
|
|
|
|
void *data, int size,
|
|
|
|
void *(*convert_cb)(E_Drag * drag, const char *type),
|
|
|
|
void (*finished_cb)(E_Drag *drag, int dropped))
|
2005-05-04 05:16:16 -07:00
|
|
|
{
|
|
|
|
E_Drag *drag;
|
2010-06-24 09:19:12 -07:00
|
|
|
unsigned int i;
|
2005-05-04 05:16:16 -07:00
|
|
|
|
2009-03-18 17:14:57 -07:00
|
|
|
drag = e_object_alloc(sizeof(E_Drag) + num_types * sizeof(char *),
|
2012-09-11 02:07:54 -07:00
|
|
|
E_DRAG_TYPE, E_OBJECT_CLEANUP_FUNC(_e_drag_free));
|
2005-05-04 05:16:16 -07:00
|
|
|
if (!drag) return NULL;
|
|
|
|
|
2005-05-14 22:20:18 -07:00
|
|
|
drag->x = x;
|
|
|
|
drag->y = y;
|
2005-05-10 12:35:12 -07:00
|
|
|
drag->w = 24;
|
|
|
|
drag->h = 24;
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
drag->layer = E_LAYER_CLIENT_DRAG;
|
2005-05-10 12:35:12 -07:00
|
|
|
|
2015-03-13 13:14:48 -07:00
|
|
|
drag->evas = e_comp->evas;
|
2005-05-11 14:33:55 -07:00
|
|
|
|
2005-10-08 06:10:20 -07:00
|
|
|
drag->type = E_DRAG_NONE;
|
|
|
|
|
2005-10-07 11:36:54 -07:00
|
|
|
for (i = 0; i < num_types; i++)
|
2009-03-18 17:14:57 -07:00
|
|
|
drag->types[i] = eina_stringshare_add(types[i]);
|
2005-10-07 11:36:54 -07:00
|
|
|
drag->num_types = num_types;
|
2005-05-04 05:16:16 -07:00
|
|
|
drag->data = data;
|
2005-10-07 11:36:54 -07:00
|
|
|
drag->data_size = size;
|
2007-01-02 22:14:04 -08:00
|
|
|
drag->cb.convert = convert_cb;
|
2005-05-04 05:16:16 -07:00
|
|
|
drag->cb.finished = finished_cb;
|
|
|
|
|
2008-10-22 04:49:33 -07:00
|
|
|
_drag_list = eina_list_append(_drag_list, drag);
|
2005-05-11 14:33:55 -07:00
|
|
|
|
2014-03-11 04:24:41 -07:00
|
|
|
#ifndef HAVE_WAYLAND_ONLY
|
2015-08-04 15:48:33 -07:00
|
|
|
if (e_comp->comp_type == E_PIXMAP_TYPE_X)
|
2015-07-10 13:02:39 -07:00
|
|
|
ecore_x_window_shadow_tree_flush();
|
2014-03-11 04:24:41 -07:00
|
|
|
#endif
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2015-03-19 13:03:51 -07:00
|
|
|
_drag_win_root = e_comp->root;
|
2008-09-01 02:51:30 -07:00
|
|
|
|
|
|
|
drag->cb.key_down = NULL;
|
|
|
|
drag->cb.key_up = NULL;
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2005-05-04 05:16:16 -07:00
|
|
|
return drag;
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API Evas *
|
2009-03-18 16:39:03 -07:00
|
|
|
e_drag_evas_get(const E_Drag *drag)
|
2005-05-10 23:30:57 -07:00
|
|
|
{
|
|
|
|
return drag->evas;
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2005-05-10 23:30:57 -07:00
|
|
|
e_drag_object_set(E_Drag *drag, Evas_Object *object)
|
|
|
|
{
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN(object);
|
|
|
|
EINA_SAFETY_ON_TRUE_RETURN(!!drag->object);
|
|
|
|
if (drag->visible)
|
|
|
|
evas_object_show(object);
|
|
|
|
else
|
|
|
|
evas_object_hide(object);
|
2005-05-10 23:30:57 -07:00
|
|
|
drag->object = object;
|
2014-01-15 07:23:14 -08:00
|
|
|
drag->comp_object = e_comp_object_util_add(object, E_COMP_OBJECT_TYPE_NONE);
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
evas_object_layer_set(drag->comp_object, drag->layer);
|
|
|
|
evas_object_name_set(drag->comp_object, "E Drag");
|
|
|
|
evas_object_pass_events_set(drag->comp_object, 1);
|
2005-05-10 23:30:57 -07:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2006-12-29 08:53:36 -08:00
|
|
|
e_drag_move(E_Drag *drag, int x, int y)
|
|
|
|
{
|
|
|
|
if ((drag->x == x) && (drag->y == y)) return;
|
|
|
|
drag->x = x;
|
|
|
|
drag->y = y;
|
2013-02-21 04:55:22 -08:00
|
|
|
if (_drag_current == drag)
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
evas_object_move(drag->comp_object, x, y);
|
2006-12-29 08:53:36 -08:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2005-05-10 23:30:57 -07:00
|
|
|
e_drag_resize(E_Drag *drag, int w, int h)
|
2005-05-10 12:35:12 -07:00
|
|
|
{
|
|
|
|
if ((drag->w == w) && (drag->h == h)) return;
|
|
|
|
drag->h = h;
|
|
|
|
drag->w = w;
|
2013-02-21 04:55:22 -08:00
|
|
|
if (_drag_current == drag)
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
evas_object_resize(drag->comp_object, w, h);
|
2005-05-04 05:16:16 -07:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API int
|
2005-04-26 02:36:18 -07:00
|
|
|
e_dnd_active(void)
|
|
|
|
{
|
2012-09-11 02:07:54 -07:00
|
|
|
return _drag_win != 0;
|
2005-04-26 02:36:18 -07:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API int
|
2005-05-14 22:20:18 -07:00
|
|
|
e_drag_start(E_Drag *drag, int x, int y)
|
2005-04-23 06:13:57 -07:00
|
|
|
{
|
2015-08-04 15:45:36 -07:00
|
|
|
return _e_drag_finalize(drag, E_DRAG_INTERNAL, x, y);
|
2005-10-08 06:10:20 -07:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API int
|
2005-10-08 06:10:20 -07:00
|
|
|
e_drag_xdnd_start(E_Drag *drag, int x, int y)
|
|
|
|
{
|
2015-08-04 15:45:36 -07:00
|
|
|
return _e_drag_finalize(drag, E_DRAG_XDND, x, y);
|
2005-10-08 06:10:20 -07:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2012-10-18 01:04:03 -07:00
|
|
|
e_drop_handler_xds_set(E_Drop_Handler *handler, Eina_Bool (*cb)(void *data, const char *type))
|
2012-09-11 09:17:24 -07:00
|
|
|
{
|
|
|
|
handler->cb.xds = cb;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* should only be used for windows */
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2012-09-11 09:17:24 -07:00
|
|
|
e_drop_xds_update(Eina_Bool enable, const char *value)
|
|
|
|
{
|
2014-03-11 04:24:41 -07:00
|
|
|
#ifndef HAVE_WAYLAND_ONLY
|
2015-08-04 15:47:30 -07:00
|
|
|
Ecore_Window xwin;
|
2012-09-11 09:17:24 -07:00
|
|
|
char buf[PATH_MAX + 8];
|
|
|
|
char *file;
|
|
|
|
int size;
|
|
|
|
size_t len;
|
|
|
|
|
2015-07-10 13:02:39 -07:00
|
|
|
if (!e_comp_util_has_x()) return;
|
2012-09-11 09:17:24 -07:00
|
|
|
enable = !!enable;
|
2013-01-11 02:34:29 -08:00
|
|
|
|
2012-09-11 09:17:24 -07:00
|
|
|
xwin = ecore_x_selection_owner_get(ECORE_X_ATOM_SELECTION_XDND);
|
|
|
|
if (enable)
|
|
|
|
{
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
if (!ecore_x_window_prop_property_get(xwin, ECORE_X_ATOM_XDND_DIRECTSAVE0, _text_atom, 8, (unsigned char **)&file, &size))
|
2012-09-11 09:17:24 -07:00
|
|
|
return;
|
|
|
|
len = strlen(value);
|
|
|
|
if (size + len + 8 + 1 > sizeof(buf))
|
|
|
|
{
|
|
|
|
free(file);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
snprintf(buf, sizeof(buf), "file://%s/", value);
|
|
|
|
strncat(buf, file, size);
|
|
|
|
free(file);
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
ecore_x_window_prop_property_set(xwin, ECORE_X_ATOM_XDND_DIRECTSAVE0, _text_atom, 8, (void *)buf, size + len + 8);
|
2012-09-11 09:17:24 -07:00
|
|
|
}
|
|
|
|
else
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
ecore_x_window_prop_property_del(xwin, ECORE_X_ATOM_XDND_DIRECTSAVE0);
|
2014-10-03 10:35:34 -07:00
|
|
|
#else
|
|
|
|
(void)enable;
|
|
|
|
(void)value;
|
2014-03-11 04:24:41 -07:00
|
|
|
#endif
|
2012-09-11 09:17:24 -07:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API E_Drop_Handler *
|
2015-04-27 12:39:43 -07:00
|
|
|
e_drop_handler_add(E_Object *obj, Evas_Object *win,
|
2012-09-11 02:07:54 -07:00
|
|
|
void *data,
|
|
|
|
void (*enter_cb)(void *data, const char *type, void *event),
|
|
|
|
void (*move_cb)(void *data, const char *type, void *event),
|
|
|
|
void (*leave_cb)(void *data, const char *type, void *event),
|
|
|
|
void (*drop_cb)(void *data, const char *type, void *event),
|
|
|
|
const char **types, unsigned int num_types, int x, int y, int w, int h)
|
2005-10-08 06:10:20 -07:00
|
|
|
{
|
|
|
|
E_Drop_Handler *handler;
|
2010-06-24 09:19:12 -07:00
|
|
|
unsigned int i;
|
2005-10-08 06:10:20 -07:00
|
|
|
|
2009-03-18 17:14:57 -07:00
|
|
|
handler = calloc(1, sizeof(E_Drop_Handler) + num_types * sizeof(char *));
|
2005-10-08 06:10:20 -07:00
|
|
|
if (!handler) return NULL;
|
|
|
|
|
|
|
|
handler->cb.data = data;
|
|
|
|
handler->cb.enter = enter_cb;
|
|
|
|
handler->cb.move = move_cb;
|
|
|
|
handler->cb.leave = leave_cb;
|
|
|
|
handler->cb.drop = drop_cb;
|
|
|
|
handler->num_types = num_types;
|
2009-03-18 17:14:57 -07:00
|
|
|
for (i = 0; i < num_types; i++)
|
|
|
|
handler->types[i] = eina_stringshare_add(types[i]);
|
2005-10-08 06:10:20 -07:00
|
|
|
handler->x = x;
|
|
|
|
handler->y = y;
|
|
|
|
handler->w = w;
|
|
|
|
handler->h = h;
|
|
|
|
|
2006-09-16 23:12:48 -07:00
|
|
|
handler->obj = obj;
|
2015-04-27 12:39:43 -07:00
|
|
|
handler->win = win;
|
2007-08-18 03:37:16 -07:00
|
|
|
handler->entered = 0;
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2008-10-22 04:49:33 -07:00
|
|
|
_drop_handlers = eina_list_append(_drop_handlers, handler);
|
2005-10-08 06:10:20 -07:00
|
|
|
|
|
|
|
return handler;
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2005-10-08 06:10:20 -07:00
|
|
|
e_drop_handler_geometry_set(E_Drop_Handler *handler, int x, int y, int w, int h)
|
|
|
|
{
|
|
|
|
handler->x = x;
|
|
|
|
handler->y = y;
|
|
|
|
handler->w = w;
|
|
|
|
handler->h = h;
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API int
|
2009-03-18 16:39:03 -07:00
|
|
|
e_drop_inside(const E_Drop_Handler *handler, int x, int y)
|
2007-01-07 08:32:57 -08:00
|
|
|
{
|
2010-11-09 13:13:56 -08:00
|
|
|
int dx, dy;
|
2007-01-07 08:32:57 -08:00
|
|
|
|
2010-11-09 13:13:56 -08:00
|
|
|
_e_drag_coords_update(handler, &dx, &dy);
|
|
|
|
x -= dx;
|
|
|
|
y -= dy;
|
|
|
|
return E_INSIDE(x, y, handler->x, handler->y, handler->w, handler->h);
|
2007-01-07 08:32:57 -08:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2005-10-08 06:10:20 -07:00
|
|
|
e_drop_handler_del(E_Drop_Handler *handler)
|
|
|
|
{
|
2010-06-24 09:19:12 -07:00
|
|
|
unsigned int i;
|
2014-01-22 13:04:58 -08:00
|
|
|
Eina_List *l;
|
2015-08-04 15:47:30 -07:00
|
|
|
Ecore_Window hwin;
|
2005-10-08 06:10:20 -07:00
|
|
|
|
2012-06-28 06:47:45 -07:00
|
|
|
if (!handler)
|
|
|
|
return;
|
|
|
|
|
2014-01-22 13:04:58 -08:00
|
|
|
hwin = _e_drag_win_get(handler, 1);
|
|
|
|
if (hwin)
|
|
|
|
{
|
|
|
|
l = eina_hash_find(_drop_handlers_responsives, &hwin);
|
|
|
|
if (l)
|
|
|
|
eina_hash_set(_drop_handlers_responsives, &hwin, eina_list_remove(l, handler));
|
|
|
|
}
|
2008-10-22 04:49:33 -07:00
|
|
|
_drop_handlers = eina_list_remove(_drop_handlers, handler);
|
2013-05-29 01:15:21 -07:00
|
|
|
if (handler->active)
|
|
|
|
_active_handlers = eina_list_remove(_active_handlers, handler);
|
2009-03-18 17:14:57 -07:00
|
|
|
for (i = 0; i < handler->num_types; i++)
|
|
|
|
eina_stringshare_del(handler->types[i]);
|
|
|
|
eina_stringshare_del(handler->active_type);
|
2005-10-08 06:10:20 -07:00
|
|
|
free(handler);
|
2005-04-23 06:13:57 -07:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API int
|
2013-09-11 06:23:43 -07:00
|
|
|
e_drop_xdnd_register_set(Ecore_Window win, int reg)
|
2006-08-10 10:48:17 -07:00
|
|
|
{
|
2015-08-05 13:06:33 -07:00
|
|
|
if (!e_comp_util_has_x()) return 0;
|
2006-08-10 10:48:17 -07:00
|
|
|
if (reg)
|
|
|
|
{
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
if (!eina_hash_find(_drop_win_hash, &win))
|
2012-09-11 02:07:54 -07:00
|
|
|
{
|
2014-03-11 04:24:41 -07:00
|
|
|
#ifndef HAVE_WAYLAND_ONLY
|
2012-09-11 02:07:54 -07:00
|
|
|
ecore_x_dnd_aware_set(win, 1);
|
2014-03-11 04:24:41 -07:00
|
|
|
#endif
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
eina_hash_add(_drop_win_hash, &win, (void *)1);
|
2012-09-11 02:07:54 -07:00
|
|
|
}
|
2006-08-10 10:48:17 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-03-11 04:24:41 -07:00
|
|
|
#ifndef HAVE_WAYLAND_ONLY
|
2012-09-11 02:07:54 -07:00
|
|
|
ecore_x_dnd_aware_set(win, 0);
|
2014-03-11 04:24:41 -07:00
|
|
|
#endif
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
eina_hash_del(_drop_win_hash, &win, (void *)1);
|
2006-08-10 10:48:17 -07:00
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
2005-10-08 06:10:20 -07:00
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2008-08-10 19:13:22 -07:00
|
|
|
e_drop_handler_responsive_set(E_Drop_Handler *handler)
|
|
|
|
{
|
2015-08-04 15:47:30 -07:00
|
|
|
Ecore_Window hwin = _e_drag_win_get(handler, 1);
|
2014-01-22 10:40:24 -08:00
|
|
|
Eina_List *l;
|
2008-08-10 19:13:22 -07:00
|
|
|
|
2014-01-22 10:40:24 -08:00
|
|
|
l = eina_hash_find(_drop_handlers_responsives, &hwin);
|
|
|
|
eina_hash_set(_drop_handlers_responsives, &hwin, eina_list_append(l, handler));
|
2008-08-10 19:13:22 -07:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API int
|
2009-03-18 16:39:03 -07:00
|
|
|
e_drop_handler_responsive_get(const E_Drop_Handler *handler)
|
2008-08-10 19:13:22 -07:00
|
|
|
{
|
2015-08-04 15:47:30 -07:00
|
|
|
Ecore_Window hwin = _e_drag_win_get(handler, 1);
|
2014-01-22 10:40:24 -08:00
|
|
|
Eina_List *l;
|
2008-08-10 19:13:22 -07:00
|
|
|
|
2014-01-22 10:40:24 -08:00
|
|
|
l = eina_hash_find(_drop_handlers_responsives, &hwin);
|
|
|
|
return l && eina_list_data_find(l, handler);
|
2008-08-10 19:13:22 -07:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2013-09-11 06:23:43 -07:00
|
|
|
e_drop_handler_action_set(unsigned int action)
|
2008-08-10 19:13:22 -07:00
|
|
|
{
|
|
|
|
_action = action;
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API unsigned int
|
2009-05-26 07:44:19 -07:00
|
|
|
e_drop_handler_action_get(void)
|
2008-08-10 19:13:22 -07:00
|
|
|
{
|
|
|
|
return _action;
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2009-03-16 09:24:43 -07:00
|
|
|
e_drag_key_down_cb_set(E_Drag *drag, void (*func)(E_Drag *drag, Ecore_Event_Key *e))
|
2008-09-01 02:51:30 -07:00
|
|
|
{
|
|
|
|
drag->cb.key_down = func;
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2009-03-16 09:24:43 -07:00
|
|
|
e_drag_key_up_cb_set(E_Drag *drag, void (*func)(E_Drag *drag, Ecore_Event_Key *e))
|
2008-09-01 02:51:30 -07:00
|
|
|
{
|
|
|
|
drag->cb.key_up = func;
|
|
|
|
}
|
|
|
|
|
2013-02-07 05:20:07 -08:00
|
|
|
/* from ecore_x_selection.c */
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API Eina_List *
|
2013-02-07 05:20:07 -08:00
|
|
|
e_dnd_util_text_uri_list_convert(char *data, int size)
|
|
|
|
{
|
|
|
|
char *tmp;
|
|
|
|
int i, is;
|
|
|
|
Eina_List *ret = NULL;
|
|
|
|
|
2014-03-13 09:52:36 -07:00
|
|
|
if ((!data) || (!size)) return NULL;
|
2013-02-07 05:20:07 -08:00
|
|
|
tmp = malloc(size);
|
|
|
|
is = i = 0;
|
|
|
|
while ((is < size) && (data[is]))
|
|
|
|
{
|
|
|
|
if ((i == 0) && (data[is] == '#'))
|
|
|
|
for (; ((data[is]) && (data[is] != '\n')); is++) ;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ((data[is] != '\r') &&
|
|
|
|
(data[is] != '\n'))
|
|
|
|
tmp[i++] = data[is++];
|
|
|
|
else
|
|
|
|
{
|
|
|
|
while ((data[is] == '\r') || (data[is] == '\n'))
|
|
|
|
is++;
|
|
|
|
tmp[i] = 0;
|
|
|
|
ret = eina_list_append(ret, strdup(tmp));
|
|
|
|
tmp[0] = 0;
|
|
|
|
i = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (i > 0)
|
|
|
|
{
|
|
|
|
tmp[i] = 0;
|
|
|
|
ret = eina_list_append(ret, strdup(tmp));
|
|
|
|
}
|
|
|
|
|
|
|
|
free(tmp);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2005-10-08 06:10:20 -07:00
|
|
|
/* local subsystem functions */
|
|
|
|
|
2013-05-29 01:15:21 -07:00
|
|
|
static Eina_Stringshare *
|
|
|
|
_e_dnd_type_implemented(const char *type)
|
|
|
|
{
|
|
|
|
const char ***t;
|
|
|
|
|
|
|
|
for (t = _e_dnd_types; *t; t++)
|
|
|
|
{
|
|
|
|
if (!strcmp(type, **t))
|
|
|
|
return **t;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2005-10-08 06:10:20 -07:00
|
|
|
static void
|
|
|
|
_e_drag_move(E_Drag *drag, int x, int y)
|
|
|
|
{
|
2006-08-09 22:01:07 -07:00
|
|
|
E_Zone *zone;
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2005-10-08 06:10:20 -07:00
|
|
|
if (((drag->x + drag->dx) == x) && ((drag->y + drag->dy) == y)) return;
|
2006-08-09 22:01:07 -07:00
|
|
|
|
2015-03-13 12:54:51 -07:00
|
|
|
zone = e_comp_zone_xy_get(x, y);
|
2006-08-09 22:01:07 -07:00
|
|
|
if (zone) e_zone_flip_coords_handle(zone, x, y);
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2005-10-08 06:10:20 -07:00
|
|
|
drag->x = x - drag->dx;
|
|
|
|
drag->y = y - drag->dy;
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
evas_object_move(drag->comp_object, drag->x, drag->y);
|
2005-10-08 06:10:20 -07:00
|
|
|
}
|
|
|
|
|
2006-09-16 23:12:48 -07:00
|
|
|
static void
|
2010-11-09 13:13:56 -08:00
|
|
|
_e_drag_coords_update(const E_Drop_Handler *h, int *dx, int *dy)
|
2006-09-16 23:12:48 -07:00
|
|
|
{
|
|
|
|
int px = 0, py = 0;
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2010-11-09 13:13:56 -08:00
|
|
|
*dx = 0;
|
|
|
|
*dy = 0;
|
2015-04-27 12:39:43 -07:00
|
|
|
if (h->win)
|
2014-11-02 18:35:13 -08:00
|
|
|
{
|
|
|
|
E_Client *ec;
|
|
|
|
|
2015-04-27 12:39:43 -07:00
|
|
|
ec = e_win_client_get(h->win);
|
2014-11-02 18:35:13 -08:00
|
|
|
px = ec->x;
|
|
|
|
py = ec->y;
|
|
|
|
}
|
|
|
|
else if (h->obj)
|
2006-09-16 23:12:48 -07:00
|
|
|
{
|
2012-09-11 02:07:54 -07:00
|
|
|
switch (h->obj->type)
|
|
|
|
{
|
2013-01-11 02:34:29 -08:00
|
|
|
E_Gadcon *gc;
|
|
|
|
|
2012-09-11 02:07:54 -07:00
|
|
|
case E_GADCON_TYPE:
|
2013-01-11 02:34:29 -08:00
|
|
|
gc = (E_Gadcon *)h->obj;
|
2013-02-21 04:55:22 -08:00
|
|
|
if (!gc->toolbar) return;
|
2014-11-02 18:35:13 -08:00
|
|
|
evas_object_geometry_get(gc->toolbar->fwin, &px, &py, NULL, NULL);
|
2012-09-11 02:07:54 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
case E_GADCON_CLIENT_TYPE:
|
2012-10-11 04:53:04 -07:00
|
|
|
gc = ((E_Gadcon_Client *)(h->obj))->gadcon;
|
|
|
|
e_gadcon_canvas_zone_geometry_get(gc, &px, &py, NULL, NULL);
|
|
|
|
if (!gc->toolbar) break;
|
2014-11-02 18:35:13 -08:00
|
|
|
{
|
|
|
|
int x, y;
|
2012-09-11 02:07:54 -07:00
|
|
|
|
2014-11-02 18:35:13 -08:00
|
|
|
evas_object_geometry_get(gc->toolbar->fwin, &x, &y, NULL, NULL);
|
|
|
|
px += x, py += y;
|
|
|
|
}
|
2012-09-11 02:07:54 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
case E_ZONE_TYPE:
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
// zone based drag targets are in a comp thus their coords should be
|
2008-09-19 16:59:29 -07:00
|
|
|
// screen-relative as containers just cover the screen
|
2008-09-19 16:58:07 -07:00
|
|
|
// px = ((E_Zone *)(h->obj))->x;
|
|
|
|
// py = ((E_Zone *)(h->obj))->y;
|
2012-09-11 02:07:54 -07:00
|
|
|
break;
|
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
case E_CLIENT_TYPE:
|
|
|
|
px = ((E_Client *)(h->obj))->x;
|
|
|
|
py = ((E_Client *)(h->obj))->y;
|
2012-09-11 02:07:54 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* FIXME: add more types as needed */
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2006-09-16 23:12:48 -07:00
|
|
|
}
|
|
|
|
*dx += px;
|
|
|
|
*dy += py;
|
|
|
|
}
|
|
|
|
|
2015-08-04 15:47:30 -07:00
|
|
|
static Ecore_Window
|
2009-03-18 16:39:03 -07:00
|
|
|
_e_drag_win_get(const E_Drop_Handler *h, int xdnd)
|
2006-09-16 23:12:48 -07:00
|
|
|
{
|
2015-08-04 15:47:30 -07:00
|
|
|
Ecore_Window hwin = 0;
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2015-04-27 12:39:43 -07:00
|
|
|
if (h->win)
|
|
|
|
return elm_win_window_id_get(h->win);
|
2006-09-16 23:12:48 -07:00
|
|
|
if (h->obj)
|
|
|
|
{
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
E_Gadcon *gc = NULL;
|
|
|
|
|
2012-09-11 02:07:54 -07:00
|
|
|
switch (h->obj->type)
|
|
|
|
{
|
|
|
|
case E_GADCON_CLIENT_TYPE:
|
2013-02-21 04:55:22 -08:00
|
|
|
gc = ((E_Gadcon_Client *)(h->obj))->gadcon;
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
if (!gc) return 0;
|
2014-03-13 09:18:21 -07:00
|
|
|
/* no break */
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
case E_GADCON_TYPE:
|
|
|
|
if (!gc) gc = (E_Gadcon *)h->obj;
|
2013-02-21 04:55:22 -08:00
|
|
|
|
2014-11-02 18:35:13 -08:00
|
|
|
if (gc->toolbar) hwin = e_client_util_pwin_get(e_win_client_get(gc->toolbar->fwin)); //double check for xdnd...
|
2013-02-21 04:55:22 -08:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if (xdnd) hwin = e_gadcon_xdnd_window_get(gc);
|
|
|
|
else hwin = e_gadcon_dnd_window_get(gc);
|
|
|
|
}
|
2012-09-11 02:07:54 -07:00
|
|
|
break;
|
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
case E_CLIENT_TYPE:
|
2013-02-19 06:18:58 -08:00
|
|
|
case E_ZONE_TYPE:
|
2015-01-22 11:58:57 -08:00
|
|
|
hwin = e_comp->ee_win;
|
2012-09-11 02:07:54 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* FIXME: add more types as needed */
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2006-09-16 23:12:48 -07:00
|
|
|
}
|
2008-08-10 19:13:22 -07:00
|
|
|
|
|
|
|
return hwin;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2015-08-04 15:47:30 -07:00
|
|
|
_e_drag_win_matches(E_Drop_Handler *h, Ecore_Window win, int xdnd)
|
2008-08-10 19:13:22 -07:00
|
|
|
{
|
2015-08-04 15:47:30 -07:00
|
|
|
Ecore_Window hwin = _e_drag_win_get(h, xdnd);
|
2008-08-10 19:13:22 -07:00
|
|
|
|
2006-09-16 23:12:48 -07:00
|
|
|
if (win == hwin) return 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2007-05-07 12:54:12 -07:00
|
|
|
static void
|
|
|
|
_e_drag_win_show(E_Drop_Handler *h)
|
|
|
|
{
|
2008-03-24 05:48:33 -07:00
|
|
|
E_Shelf *shelf;
|
|
|
|
|
2015-04-27 12:39:43 -07:00
|
|
|
if (h->win) return;
|
2007-05-07 12:54:12 -07:00
|
|
|
if (h->obj)
|
|
|
|
{
|
2012-09-11 02:07:54 -07:00
|
|
|
switch (h->obj->type)
|
|
|
|
{
|
|
|
|
case E_GADCON_TYPE:
|
|
|
|
shelf = e_gadcon_shelf_get((E_Gadcon *)(h->obj));
|
|
|
|
if (shelf) e_shelf_toggle(shelf, 1);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case E_GADCON_CLIENT_TYPE:
|
|
|
|
shelf = e_gadcon_shelf_get(((E_Gadcon_Client *)(h->obj))->gadcon);
|
|
|
|
if (shelf) e_shelf_toggle(shelf, 1);
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* FIXME: add more types as needed */
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2007-05-07 12:54:12 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_drag_win_hide(E_Drop_Handler *h)
|
|
|
|
{
|
2008-06-13 02:14:20 -07:00
|
|
|
E_Shelf *shelf;
|
|
|
|
|
2015-04-27 12:39:43 -07:00
|
|
|
if (h->win) return;
|
2007-05-07 12:54:12 -07:00
|
|
|
if (h->obj)
|
|
|
|
{
|
2012-09-11 02:07:54 -07:00
|
|
|
switch (h->obj->type)
|
|
|
|
{
|
|
|
|
case E_GADCON_TYPE:
|
|
|
|
shelf = e_gadcon_shelf_get((E_Gadcon *)(h->obj));
|
|
|
|
if (shelf) e_shelf_toggle(shelf, 0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case E_GADCON_CLIENT_TYPE:
|
|
|
|
shelf = e_gadcon_shelf_get(((E_Gadcon_Client *)(h->obj))->gadcon);
|
|
|
|
if (shelf) e_shelf_toggle(shelf, 0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* FIXME: add more types as needed */
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2007-05-07 12:54:12 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-02-21 04:55:22 -08:00
|
|
|
static unsigned int
|
2013-06-11 23:13:19 -07:00
|
|
|
_e_dnd_object_layer_get(E_Drop_Handler *h)
|
2013-02-21 04:55:22 -08:00
|
|
|
{
|
|
|
|
unsigned int adjust = 0;
|
2013-06-11 23:13:19 -07:00
|
|
|
E_Object *obj = h->obj;
|
|
|
|
|
|
|
|
if (h->base) return evas_object_layer_get(h->base);
|
2013-02-21 04:55:22 -08:00
|
|
|
if (!obj) return 0;
|
2015-04-27 12:39:43 -07:00
|
|
|
if (h->win)
|
|
|
|
obj = (E_Object*)e_win_client_get(h->win);
|
2013-02-21 04:55:22 -08:00
|
|
|
switch (obj->type)
|
|
|
|
{
|
|
|
|
case E_GADCON_CLIENT_TYPE:
|
|
|
|
/* add 1 to ensure we're above a potential receiving gadcon */
|
|
|
|
adjust = 1;
|
2014-03-13 10:09:43 -07:00
|
|
|
/* no break */
|
2013-02-21 04:55:22 -08:00
|
|
|
default:
|
|
|
|
adjust += e_comp_e_object_layer_get(obj);
|
|
|
|
}
|
|
|
|
return adjust;
|
|
|
|
}
|
|
|
|
|
2008-08-10 19:13:22 -07:00
|
|
|
static int
|
2015-08-04 15:47:30 -07:00
|
|
|
_e_drag_update(Ecore_Window root, int x, int y, unsigned int action)
|
2005-04-23 06:13:57 -07:00
|
|
|
{
|
2009-03-18 16:34:29 -07:00
|
|
|
const Eina_List *l;
|
2013-02-21 04:55:22 -08:00
|
|
|
Eina_List *entered = NULL;
|
2006-09-17 20:49:45 -07:00
|
|
|
E_Event_Dnd_Enter enter_ev;
|
|
|
|
E_Event_Dnd_Move move_ev;
|
|
|
|
E_Event_Dnd_Leave leave_ev;
|
2013-02-21 04:55:22 -08:00
|
|
|
E_Drop_Handler *h, *top = NULL;
|
|
|
|
unsigned int top_layer = 0;
|
2010-11-09 13:13:56 -08:00
|
|
|
int dx, dy;
|
2015-08-04 15:47:30 -07:00
|
|
|
Ecore_Window win;
|
2008-08-10 19:13:22 -07:00
|
|
|
int responsive = 0;
|
2005-04-23 06:13:57 -07:00
|
|
|
|
2007-11-14 20:48:53 -08:00
|
|
|
// double t1 = ecore_time_get(); ////
|
2008-09-17 04:16:01 -07:00
|
|
|
if (_drag_current && !_xdnd)
|
2015-03-13 13:48:29 -07:00
|
|
|
win = e_comp_top_window_at_xy_get(x, y);
|
2006-09-16 23:12:48 -07:00
|
|
|
else
|
2008-06-15 05:28:16 -07:00
|
|
|
win = root;
|
|
|
|
|
2005-06-10 14:26:50 -07:00
|
|
|
if (_drag_current)
|
|
|
|
{
|
2014-02-03 08:05:15 -08:00
|
|
|
if (_drag_current->ended) return 0;
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
if (_drag_current->visible) evas_object_show(_drag_current->comp_object);
|
|
|
|
else evas_object_hide(_drag_current->comp_object);
|
2012-09-11 02:07:54 -07:00
|
|
|
_e_drag_move(_drag_current, x, y);
|
2005-06-10 14:26:50 -07:00
|
|
|
}
|
2013-05-29 01:15:21 -07:00
|
|
|
EINA_LIST_FOREACH(_active_handlers, l, h)
|
2013-02-21 04:55:22 -08:00
|
|
|
{
|
|
|
|
_e_drag_coords_update(h, &dx, &dy);
|
|
|
|
enter_ev.x = x - dx;
|
|
|
|
enter_ev.y = y - dy;
|
|
|
|
enter_ev.data = NULL;
|
|
|
|
enter_ev.action = action;
|
|
|
|
move_ev.x = x - dx;
|
|
|
|
move_ev.y = y - dy;
|
|
|
|
move_ev.action = action;
|
|
|
|
leave_ev.x = x - dx;
|
|
|
|
leave_ev.y = y - dy;
|
|
|
|
|
|
|
|
if (E_INSIDE(enter_ev.x, enter_ev.y, h->x, h->y, h->w, h->h) &&
|
|
|
|
((!_drag_current) || _e_drag_win_matches(h, win, 0)))
|
|
|
|
entered = eina_list_append(entered, h);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (h->entered)
|
|
|
|
{
|
|
|
|
if (h->cb.leave)
|
|
|
|
h->cb.leave(h->cb.data, h->active_type, &leave_ev);
|
|
|
|
if (_drag_current)
|
|
|
|
_e_drag_win_hide(h);
|
|
|
|
h->entered = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!entered) return 0;
|
2005-05-01 11:34:56 -07:00
|
|
|
|
2013-02-21 04:55:22 -08:00
|
|
|
EINA_LIST_FREE(entered, h)
|
2005-05-01 11:34:56 -07:00
|
|
|
{
|
2013-02-21 04:55:22 -08:00
|
|
|
unsigned int layer;
|
|
|
|
E_Drop_Handler *h2;
|
2012-09-11 02:07:54 -07:00
|
|
|
|
2013-02-21 04:55:22 -08:00
|
|
|
_e_drag_coords_update(h, &dx, &dy);
|
|
|
|
leave_ev.x = x - dx;
|
|
|
|
leave_ev.y = y - dy;
|
|
|
|
|
2013-06-11 23:13:19 -07:00
|
|
|
layer = _e_dnd_object_layer_get(h);
|
2013-02-21 04:55:22 -08:00
|
|
|
if (!top)
|
2012-09-11 02:07:54 -07:00
|
|
|
{
|
2013-02-21 04:55:22 -08:00
|
|
|
top = h;
|
|
|
|
top_layer = layer;
|
2012-09-11 02:07:54 -07:00
|
|
|
enter_ev.x = x - dx;
|
|
|
|
enter_ev.y = y - dy;
|
|
|
|
enter_ev.data = NULL;
|
|
|
|
enter_ev.action = action;
|
|
|
|
move_ev.x = x - dx;
|
|
|
|
move_ev.y = y - dy;
|
|
|
|
move_ev.action = action;
|
2013-02-21 04:55:22 -08:00
|
|
|
continue;
|
2012-09-11 02:07:54 -07:00
|
|
|
}
|
2013-02-21 04:55:22 -08:00
|
|
|
if (layer > top_layer)
|
2012-09-11 02:07:54 -07:00
|
|
|
{
|
2013-02-21 04:55:22 -08:00
|
|
|
h2 = top, top = h, h = h2;
|
2012-09-11 02:07:54 -07:00
|
|
|
enter_ev.x = x - dx;
|
|
|
|
enter_ev.y = y - dy;
|
2013-02-21 04:55:22 -08:00
|
|
|
enter_ev.data = NULL;
|
2012-09-11 02:07:54 -07:00
|
|
|
enter_ev.action = action;
|
|
|
|
move_ev.x = x - dx;
|
|
|
|
move_ev.y = y - dy;
|
|
|
|
move_ev.action = action;
|
2013-02-21 04:55:22 -08:00
|
|
|
}
|
|
|
|
if (h == top) continue;
|
|
|
|
if (h->entered)
|
|
|
|
{
|
|
|
|
if (h->cb.leave)
|
|
|
|
h->cb.leave(h->cb.data, h->active_type, &leave_ev);
|
|
|
|
if (_drag_current)
|
|
|
|
_e_drag_win_hide(h);
|
|
|
|
h->entered = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
responsive = !!e_drop_handler_responsive_get(top);
|
|
|
|
if (!top->entered)
|
|
|
|
{
|
|
|
|
_e_drag_win_show(top);
|
|
|
|
if (top->cb.enter)
|
|
|
|
{
|
|
|
|
if (_drag_current)
|
2012-09-11 02:07:54 -07:00
|
|
|
{
|
2013-02-21 04:55:22 -08:00
|
|
|
if (_drag_current->cb.convert)
|
2012-09-11 02:07:54 -07:00
|
|
|
{
|
2013-02-21 04:55:22 -08:00
|
|
|
enter_ev.data = _drag_current->cb.convert(_drag_current,
|
|
|
|
top->active_type);
|
2012-09-11 02:07:54 -07:00
|
|
|
}
|
2013-02-21 04:55:22 -08:00
|
|
|
else
|
|
|
|
enter_ev.data = _drag_current->data;
|
2012-09-11 02:07:54 -07:00
|
|
|
}
|
2013-02-21 04:55:22 -08:00
|
|
|
top->cb.enter(top->cb.data, top->active_type, &enter_ev);
|
2012-09-11 02:07:54 -07:00
|
|
|
}
|
2013-02-21 04:55:22 -08:00
|
|
|
top->entered = 1;
|
2006-08-10 10:48:17 -07:00
|
|
|
}
|
2013-02-21 04:55:22 -08:00
|
|
|
if (top->cb.move)
|
|
|
|
top->cb.move(top->cb.data, top->active_type, &move_ev);
|
2008-08-10 19:13:22 -07:00
|
|
|
return responsive;
|
2007-11-14 20:48:53 -08:00
|
|
|
// double t2 = ecore_time_get() - t1; ////
|
|
|
|
// printf("DND UPDATE %3.7f\n", t2); ////
|
2005-04-23 06:13:57 -07:00
|
|
|
}
|
|
|
|
|
2005-10-08 06:10:20 -07:00
|
|
|
static void
|
2013-02-21 04:55:22 -08:00
|
|
|
_e_drag_end(int x, int y)
|
2005-04-23 06:13:57 -07:00
|
|
|
{
|
2006-08-10 04:04:13 -07:00
|
|
|
E_Zone *zone;
|
2009-03-18 16:34:29 -07:00
|
|
|
const Eina_List *l;
|
2006-09-17 20:49:45 -07:00
|
|
|
E_Event_Dnd_Drop ev;
|
2010-11-09 13:13:56 -08:00
|
|
|
int dx, dy;
|
2015-08-04 15:47:30 -07:00
|
|
|
Ecore_Window win;
|
2013-02-21 04:55:22 -08:00
|
|
|
E_Drop_Handler *h;
|
2014-10-03 10:35:34 -07:00
|
|
|
int dropped = 0;
|
2005-04-23 06:13:57 -07:00
|
|
|
|
2005-10-08 06:10:20 -07:00
|
|
|
if (!_drag_current) return;
|
2015-03-13 13:48:29 -07:00
|
|
|
win = e_comp_top_window_at_xy_get(x, y);
|
2015-03-13 12:54:51 -07:00
|
|
|
zone = e_comp_zone_xy_get(x, y);
|
2006-08-10 04:04:13 -07:00
|
|
|
/* Pass -1, -1, so that it is possible to drop at the edge. */
|
|
|
|
if (zone) e_zone_flip_coords_handle(zone, -1, -1);
|
2005-04-27 01:42:36 -07:00
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
evas_object_hide(_drag_current->comp_object);
|
2005-04-23 06:13:57 -07:00
|
|
|
|
2015-08-04 15:48:33 -07:00
|
|
|
if (e_comp->comp_type == E_PIXMAP_TYPE_X)
|
|
|
|
e_grabinput_release(_drag_win, _drag_win);
|
|
|
|
|
2013-02-07 05:20:07 -08:00
|
|
|
while (_drag_current->type == E_DRAG_XDND)
|
2005-10-05 10:56:35 -07:00
|
|
|
{
|
2015-08-04 15:48:33 -07:00
|
|
|
#ifndef HAVE_WAYLAND_ONLY
|
|
|
|
if (e_comp->comp_type == E_PIXMAP_TYPE_X)
|
2012-09-11 02:07:54 -07:00
|
|
|
{
|
2015-08-04 15:48:33 -07:00
|
|
|
if (!(dropped = ecore_x_dnd_drop()))
|
|
|
|
{
|
|
|
|
if (win == e_comp->ee_win) break;
|
|
|
|
}
|
2012-09-11 02:07:54 -07:00
|
|
|
}
|
2015-08-19 11:17:12 -07:00
|
|
|
else
|
2015-08-04 15:48:33 -07:00
|
|
|
#endif
|
2015-08-19 11:17:12 -07:00
|
|
|
if ((e_comp->comp_type == E_PIXMAP_TYPE_WL) && (win == e_comp->ee_win))
|
|
|
|
break;
|
2012-09-11 02:07:54 -07:00
|
|
|
if (_drag_current->cb.finished)
|
|
|
|
_drag_current->cb.finished(_drag_current, dropped);
|
2013-05-30 00:23:19 -07:00
|
|
|
_drag_current->cb.finished = NULL;
|
2014-02-03 08:05:15 -08:00
|
|
|
_drag_current->ended = 1;
|
2012-09-11 02:07:54 -07:00
|
|
|
return;
|
2005-10-05 10:56:35 -07:00
|
|
|
}
|
2005-10-08 06:10:20 -07:00
|
|
|
|
2013-02-21 04:55:22 -08:00
|
|
|
dropped = 0;
|
|
|
|
if (!_drag_current->data)
|
2005-06-10 14:26:50 -07:00
|
|
|
{
|
2012-09-11 02:07:54 -07:00
|
|
|
/* Just leave */
|
|
|
|
E_Event_Dnd_Leave leave_ev;
|
|
|
|
|
2013-05-30 03:28:42 -07:00
|
|
|
leave_ev.x = x;
|
|
|
|
leave_ev.y = y;
|
2012-09-11 02:07:54 -07:00
|
|
|
|
2013-05-29 01:15:21 -07:00
|
|
|
EINA_LIST_FOREACH(_active_handlers, l, h)
|
2012-09-11 02:07:54 -07:00
|
|
|
{
|
|
|
|
if (h->entered)
|
|
|
|
{
|
|
|
|
if (h->cb.leave)
|
|
|
|
h->cb.leave(h->cb.data, h->active_type, &leave_ev);
|
|
|
|
h->entered = 0;
|
|
|
|
}
|
|
|
|
}
|
2005-06-10 14:26:50 -07:00
|
|
|
}
|
2013-02-21 04:55:22 -08:00
|
|
|
|
2013-05-29 01:15:21 -07:00
|
|
|
EINA_LIST_FOREACH(_active_handlers, l, h)
|
2013-02-21 04:55:22 -08:00
|
|
|
{
|
2013-06-11 23:40:30 -07:00
|
|
|
if (!h->entered) continue;
|
2013-02-21 04:55:22 -08:00
|
|
|
_e_drag_coords_update(h, &dx, &dy);
|
|
|
|
ev.x = x - dx;
|
|
|
|
ev.y = y - dy;
|
|
|
|
if ((_e_drag_win_matches(h, win, 0)) &&
|
|
|
|
((h->cb.drop) && (E_INSIDE(ev.x, ev.y, h->x, h->y, h->w, h->h))))
|
|
|
|
{
|
|
|
|
Eina_Bool need_free = EINA_FALSE;
|
|
|
|
|
|
|
|
if (_drag_current->cb.convert)
|
|
|
|
{
|
|
|
|
ev.data = _drag_current->cb.convert(_drag_current,
|
|
|
|
h->active_type);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
for (i = 0; i < _drag_current->num_types; i++)
|
|
|
|
if (_drag_current->types[i] == _type_text_uri_list)
|
|
|
|
{
|
2013-04-26 02:37:54 -07:00
|
|
|
char *data = _drag_current->data;
|
|
|
|
int size = _drag_current->data_size;
|
|
|
|
|
|
|
|
if (data && data[size - 1])
|
|
|
|
{
|
|
|
|
/* Isn't nul terminated */
|
|
|
|
size++;
|
|
|
|
data = realloc(data, size);
|
|
|
|
data[size - 1] = 0;
|
|
|
|
}
|
|
|
|
_drag_current->data = data;
|
|
|
|
_drag_current->data_size = size;
|
2013-02-21 04:55:22 -08:00
|
|
|
ev.data = e_dnd_util_text_uri_list_convert(_drag_current->data, _drag_current->data_size);
|
|
|
|
need_free = EINA_TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (!need_free)
|
|
|
|
ev.data = _drag_current->data;
|
|
|
|
}
|
|
|
|
h->cb.drop(h->cb.data, h->active_type, &ev);
|
|
|
|
if (need_free) E_FREE_LIST(ev.data, free);
|
|
|
|
dropped = 1;
|
|
|
|
}
|
|
|
|
h->entered = 0;
|
|
|
|
if (dropped) break;
|
|
|
|
}
|
|
|
|
if (_drag_current->cb.finished)
|
|
|
|
_drag_current->cb.finished(_drag_current, dropped);
|
2013-05-30 00:23:19 -07:00
|
|
|
_drag_current->cb.finished = NULL;
|
2013-02-21 04:55:22 -08:00
|
|
|
|
2013-05-30 00:23:19 -07:00
|
|
|
e_object_del(E_OBJECT(_drag_current));
|
2015-08-04 15:48:33 -07:00
|
|
|
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
|
|
|
e_comp_ungrab_input(1, 1);
|
2005-04-23 06:13:57 -07:00
|
|
|
}
|
|
|
|
|
2005-10-08 06:10:20 -07:00
|
|
|
static void
|
2015-08-04 15:47:30 -07:00
|
|
|
_e_drag_xdnd_end(Ecore_Window win, int x, int y)
|
2005-04-23 06:13:57 -07:00
|
|
|
{
|
2009-03-18 16:34:29 -07:00
|
|
|
const Eina_List *l;
|
2006-09-17 20:49:45 -07:00
|
|
|
E_Event_Dnd_Drop ev;
|
2010-11-09 13:13:56 -08:00
|
|
|
int dx, dy;
|
2005-04-23 06:13:57 -07:00
|
|
|
|
2005-10-08 06:10:20 -07:00
|
|
|
if (!_xdnd) return;
|
2005-04-23 06:13:57 -07:00
|
|
|
|
2006-09-17 20:49:45 -07:00
|
|
|
ev.data = _xdnd->data;
|
2005-04-23 06:13:57 -07:00
|
|
|
|
2006-09-17 20:49:45 -07:00
|
|
|
if (ev.data)
|
2005-10-08 06:10:20 -07:00
|
|
|
{
|
2012-09-11 02:07:54 -07:00
|
|
|
E_Drop_Handler *h;
|
|
|
|
|
2013-05-29 01:15:21 -07:00
|
|
|
EINA_LIST_FOREACH(_active_handlers, l, h)
|
2012-09-11 02:07:54 -07:00
|
|
|
{
|
|
|
|
_e_drag_coords_update(h, &dx, &dy);
|
|
|
|
ev.x = x - dx;
|
|
|
|
ev.y = y - dy;
|
|
|
|
if (_e_drag_win_matches(h, win, 1) && h->cb.drop
|
|
|
|
&& E_INSIDE(ev.x, ev.y, h->x, h->y, h->w, h->h))
|
|
|
|
{
|
|
|
|
h->cb.drop(h->cb.data, h->active_type, &ev);
|
|
|
|
}
|
|
|
|
}
|
2005-10-05 10:56:35 -07:00
|
|
|
}
|
2013-05-30 00:23:19 -07:00
|
|
|
if (_drag_current) e_object_del(E_OBJECT(_drag_current));
|
2005-10-08 06:10:20 -07:00
|
|
|
}
|
2005-05-10 12:35:12 -07:00
|
|
|
|
|
|
|
static void
|
|
|
|
_e_drag_free(E_Drag *drag)
|
|
|
|
{
|
2010-06-24 09:19:12 -07:00
|
|
|
unsigned int i;
|
2005-10-07 11:36:54 -07:00
|
|
|
|
2008-10-27 07:14:42 -07:00
|
|
|
if (drag == _drag_current)
|
|
|
|
{
|
2012-09-11 02:07:54 -07:00
|
|
|
E_Event_Dnd_Leave leave_ev;
|
|
|
|
E_Drop_Handler *h;
|
|
|
|
|
|
|
|
e_grabinput_release(_drag_win, _drag_win);
|
|
|
|
_drag_win_root = 0;
|
|
|
|
|
|
|
|
leave_ev.x = 0;
|
|
|
|
leave_ev.y = 0;
|
2013-05-30 00:23:19 -07:00
|
|
|
EINA_LIST_FREE(_active_handlers, h)
|
2012-09-11 02:07:54 -07:00
|
|
|
{
|
2013-05-29 01:15:21 -07:00
|
|
|
if (h->entered)
|
2012-09-11 02:07:54 -07:00
|
|
|
{
|
|
|
|
if (h->cb.leave)
|
|
|
|
h->cb.leave(h->cb.data, h->active_type, &leave_ev);
|
|
|
|
_e_drag_win_hide(h);
|
|
|
|
}
|
2013-05-30 00:23:19 -07:00
|
|
|
h->active = 0;
|
2012-09-11 02:07:54 -07:00
|
|
|
}
|
|
|
|
if (drag->cb.finished)
|
|
|
|
drag->cb.finished(drag, 0);
|
2013-05-30 00:23:19 -07:00
|
|
|
drag->cb.finished = NULL;
|
2008-10-27 07:14:42 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
_drag_current = NULL;
|
|
|
|
|
2008-10-22 04:49:33 -07:00
|
|
|
_drag_list = eina_list_remove(_drag_list, drag);
|
2005-05-10 12:35:12 -07:00
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
evas_object_hide(drag->comp_object);
|
|
|
|
E_FREE_FUNC(drag->comp_object, evas_object_del);
|
2009-03-18 17:14:57 -07:00
|
|
|
for (i = 0; i < drag->num_types; i++)
|
|
|
|
eina_stringshare_del(drag->types[i]);
|
2005-05-10 12:35:12 -07:00
|
|
|
free(drag);
|
2014-03-11 04:24:41 -07:00
|
|
|
#ifndef HAVE_WAYLAND_ONLY
|
2015-08-04 15:48:33 -07:00
|
|
|
if (e_comp->comp_type == E_PIXMAP_TYPE_X)
|
2015-07-10 13:02:39 -07:00
|
|
|
{
|
2015-08-04 15:48:33 -07:00
|
|
|
ecore_event_window_unregister(_drag_win);
|
2015-07-16 09:50:54 -07:00
|
|
|
if (_drag_win != e_comp->ee_win)
|
|
|
|
ecore_x_window_free(_drag_win);
|
2015-07-10 13:02:39 -07:00
|
|
|
ecore_x_window_shadow_tree_flush();
|
|
|
|
}
|
2014-03-11 04:24:41 -07:00
|
|
|
#endif
|
2015-08-04 15:48:33 -07:00
|
|
|
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
2015-07-16 09:59:04 -07:00
|
|
|
e_comp_ungrab_input(1, 1);
|
2016-01-22 09:55:32 -08:00
|
|
|
e_bindings_disabled_set(0);
|
2014-03-11 04:24:41 -07:00
|
|
|
_drag_win = 0;
|
2005-05-10 12:35:12 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_dnd_cb_key_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2008-09-01 02:51:30 -07:00
|
|
|
{
|
2013-05-29 01:15:21 -07:00
|
|
|
Ecore_Event_Key *ev = event;
|
2008-09-01 02:51:30 -07:00
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
if (ev->window != _drag_win) return ECORE_CALLBACK_PASS_ON;
|
2008-09-01 02:51:30 -07:00
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
if (!_drag_current) return ECORE_CALLBACK_PASS_ON;
|
2008-09-01 02:51:30 -07:00
|
|
|
|
|
|
|
if (_drag_current->cb.key_down)
|
|
|
|
_drag_current->cb.key_down(_drag_current, ev);
|
2010-06-24 09:19:12 -07:00
|
|
|
|
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2008-09-01 02:51:30 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_dnd_cb_key_up(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2008-09-01 02:51:30 -07:00
|
|
|
{
|
2013-05-29 01:15:21 -07:00
|
|
|
Ecore_Event_Key *ev = event;
|
2008-09-01 02:51:30 -07:00
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
if (ev->window != _drag_win) return ECORE_CALLBACK_PASS_ON;
|
2008-09-01 02:51:30 -07:00
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
if (!_drag_current) return ECORE_CALLBACK_PASS_ON;
|
2008-09-01 02:51:30 -07:00
|
|
|
|
|
|
|
if (_drag_current->cb.key_up)
|
|
|
|
_drag_current->cb.key_up(_drag_current, ev);
|
2010-06-24 09:19:12 -07:00
|
|
|
|
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2008-09-01 02:51:30 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_dnd_cb_mouse_up(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2005-04-23 06:13:57 -07:00
|
|
|
{
|
2013-05-29 01:15:21 -07:00
|
|
|
Ecore_Event_Mouse_Button *ev = event;
|
2005-04-23 06:13:57 -07:00
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
if (ev->window != _drag_win) return ECORE_CALLBACK_PASS_ON;
|
2005-04-23 06:13:57 -07:00
|
|
|
|
2015-08-12 12:39:42 -07:00
|
|
|
if (_drag_current && _drag_current->button_mask)
|
|
|
|
{
|
|
|
|
_drag_current->button_mask &= ~(1 << (ev->buttons - 1));
|
|
|
|
if (_drag_current->button_mask) return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
2013-02-21 04:55:22 -08:00
|
|
|
_e_drag_end(ev->x, ev->y);
|
2005-04-23 06:13:57 -07:00
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2005-04-29 08:04:45 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_dnd_cb_mouse_move(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2005-04-29 08:04:45 -07:00
|
|
|
{
|
2013-05-29 01:15:21 -07:00
|
|
|
Ecore_Event_Mouse_Move *ev = event;
|
2005-04-29 08:04:45 -07:00
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
if (ev->window != _drag_win) return ECORE_CALLBACK_PASS_ON;
|
2005-04-29 08:04:45 -07:00
|
|
|
|
2014-03-11 04:24:41 -07:00
|
|
|
#ifndef HAVE_WAYLAND_ONLY
|
2012-06-20 23:19:43 -07:00
|
|
|
if (!_xdnd)
|
|
|
|
_e_drag_update(_drag_win_root, ev->x, ev->y,
|
2013-02-07 05:20:07 -08:00
|
|
|
_action ?: ECORE_X_ATOM_XDND_ACTION_PRIVATE);
|
2015-08-06 16:26:08 -07:00
|
|
|
# ifdef HAVE_WAYLAND
|
2015-08-13 07:33:48 -07:00
|
|
|
if (e_comp_util_has_xwayland())
|
2015-08-06 16:26:08 -07:00
|
|
|
{
|
2015-08-13 13:05:57 -07:00
|
|
|
if (e_comp_wl->drag != _drag_current) return ECORE_CALLBACK_RENEW;
|
|
|
|
if (!e_comp_wl->ptr.ec) return ECORE_CALLBACK_RENEW;
|
|
|
|
if (!e_client_has_xwindow(e_comp_wl->ptr.ec)) return ECORE_CALLBACK_RENEW;
|
|
|
|
if (e_client_has_xwindow(e_comp_wl->drag_client)) return ECORE_CALLBACK_RENEW;
|
|
|
|
ecore_x_client_message32_send(e_client_util_win_get(e_comp_wl->ptr.ec),
|
2015-08-06 16:26:08 -07:00
|
|
|
ECORE_X_ATOM_XDND_POSITION, ECORE_X_EVENT_MASK_NONE,
|
|
|
|
e_comp->cm_selection, 0, ((ev->x << 16) & 0xffff0000) | (ev->y & 0xffff),
|
|
|
|
ev->timestamp, ECORE_X_ATOM_XDND_ACTION_COPY);
|
|
|
|
}
|
|
|
|
# endif
|
2014-03-11 04:24:41 -07:00
|
|
|
#endif
|
2010-06-24 09:19:12 -07:00
|
|
|
|
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2005-04-29 08:04:45 -07:00
|
|
|
}
|
|
|
|
|
2014-03-11 04:24:41 -07:00
|
|
|
#ifndef HAVE_WAYLAND_ONLY
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_dnd_cb_event_dnd_enter(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2005-04-29 08:04:45 -07:00
|
|
|
{
|
2013-05-29 01:15:21 -07:00
|
|
|
Ecore_X_Event_Xdnd_Enter *ev = event;
|
2009-03-18 16:34:29 -07:00
|
|
|
E_Drop_Handler *h;
|
|
|
|
const Eina_List *l;
|
2010-06-24 09:19:12 -07:00
|
|
|
int i;
|
2005-04-29 08:04:45 -07:00
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
if (!eina_hash_find(_drop_win_hash, &ev->win)) return ECORE_CALLBACK_PASS_ON;
|
2005-06-15 18:55:19 -07:00
|
|
|
|
2013-05-29 01:15:21 -07:00
|
|
|
EINA_LIST_FREE(_active_handlers, h)
|
2009-03-18 16:34:29 -07:00
|
|
|
{
|
2012-09-11 02:07:54 -07:00
|
|
|
h->active = 0;
|
2013-05-29 01:15:21 -07:00
|
|
|
eina_stringshare_replace(&h->active_type, NULL);
|
2012-09-11 02:07:54 -07:00
|
|
|
h->entered = 0;
|
2005-06-15 18:55:19 -07:00
|
|
|
}
|
2005-06-10 14:26:50 -07:00
|
|
|
for (i = 0; i < ev->num_types; i++)
|
|
|
|
{
|
2013-05-29 01:15:21 -07:00
|
|
|
Eina_Stringshare *t;
|
|
|
|
|
|
|
|
t = eina_stringshare_ref(_e_dnd_type_implemented(ev->types[i]));
|
|
|
|
if (!t) continue;
|
|
|
|
_xdnd = E_NEW(XDnd, 1);
|
|
|
|
_xdnd->type = t;
|
|
|
|
EINA_LIST_FOREACH(_drop_handlers, l, h)
|
2012-09-11 02:07:54 -07:00
|
|
|
{
|
2013-06-11 23:40:43 -07:00
|
|
|
_e_drop_handler_active_check(h, NULL, _xdnd->type);
|
|
|
|
if (h->active)
|
|
|
|
_active_handlers = eina_list_append(_active_handlers, h);
|
2013-05-29 01:15:21 -07:00
|
|
|
h->entered = 0;
|
2012-09-11 02:07:54 -07:00
|
|
|
}
|
2013-05-29 01:15:21 -07:00
|
|
|
break;
|
2005-06-10 14:26:50 -07:00
|
|
|
}
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2005-04-29 08:04:45 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_dnd_cb_event_dnd_leave(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2005-04-29 08:04:45 -07:00
|
|
|
{
|
2013-05-29 01:15:21 -07:00
|
|
|
Ecore_X_Event_Xdnd_Leave *ev = event;
|
2008-06-13 03:21:43 -07:00
|
|
|
E_Event_Dnd_Leave leave_ev;
|
2009-03-18 16:34:29 -07:00
|
|
|
const Eina_List *l;
|
2005-04-29 08:04:45 -07:00
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
if (!eina_hash_find(_drop_win_hash, &ev->win)) return ECORE_CALLBACK_PASS_ON;
|
2005-06-15 18:55:19 -07:00
|
|
|
|
2008-06-13 03:21:43 -07:00
|
|
|
leave_ev.x = 0;
|
|
|
|
leave_ev.y = 0;
|
2005-06-15 18:55:19 -07:00
|
|
|
|
2005-10-05 10:56:35 -07:00
|
|
|
if (_xdnd)
|
2005-06-15 18:55:19 -07:00
|
|
|
{
|
2012-09-11 02:07:54 -07:00
|
|
|
E_Drop_Handler *h;
|
2009-05-26 07:44:19 -07:00
|
|
|
|
2013-05-29 01:15:21 -07:00
|
|
|
EINA_LIST_FOREACH(_active_handlers, l, h)
|
2012-09-11 02:07:54 -07:00
|
|
|
{
|
|
|
|
if (h->entered)
|
|
|
|
{
|
|
|
|
if (h->cb.leave)
|
|
|
|
h->cb.leave(h->cb.data, h->active_type, &leave_ev);
|
|
|
|
h->entered = 0;
|
|
|
|
}
|
|
|
|
}
|
2005-06-15 18:55:19 -07:00
|
|
|
|
2012-09-11 02:07:54 -07:00
|
|
|
eina_stringshare_del(_xdnd->type);
|
2009-05-26 09:02:49 -07:00
|
|
|
E_FREE(_xdnd);
|
2005-06-15 18:55:19 -07:00
|
|
|
}
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2005-04-29 08:04:45 -07:00
|
|
|
}
|
|
|
|
|
2013-10-03 02:06:54 -07:00
|
|
|
static Eina_Bool
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_dnd_cb_event_hide(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_Event_Window_Hide *ev)
|
2013-10-03 02:06:54 -07:00
|
|
|
{
|
|
|
|
E_Event_Dnd_Leave leave_ev;
|
|
|
|
const char *id;
|
|
|
|
const Eina_List *l;
|
|
|
|
|
|
|
|
id = e_util_winid_str_get(ev->win);
|
|
|
|
if (!eina_hash_find(_drop_win_hash, id)) return ECORE_CALLBACK_PASS_ON;
|
|
|
|
leave_ev.x = 0;
|
|
|
|
leave_ev.y = 0;
|
|
|
|
|
|
|
|
if (_xdnd)
|
|
|
|
{
|
|
|
|
unsigned int entered = 0;
|
|
|
|
E_Drop_Handler *h;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(_active_handlers, l, h)
|
|
|
|
{
|
|
|
|
if (h->entered && (_e_drag_win_get(h, 1) == ev->win))
|
|
|
|
{
|
|
|
|
if (h->cb.leave)
|
|
|
|
h->cb.leave(h->cb.data, h->active_type, &leave_ev);
|
|
|
|
h->entered = 0;
|
|
|
|
}
|
|
|
|
entered += h->entered;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!entered)
|
|
|
|
{
|
|
|
|
eina_stringshare_del(_xdnd->type);
|
|
|
|
E_FREE(_xdnd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_dnd_cb_event_dnd_position(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2005-04-29 08:04:45 -07:00
|
|
|
{
|
2013-05-29 01:15:21 -07:00
|
|
|
Ecore_X_Event_Xdnd_Position *ev = event;
|
2005-06-10 14:26:50 -07:00
|
|
|
Ecore_X_Rectangle rect;
|
2008-08-10 19:13:22 -07:00
|
|
|
int responsive;
|
2005-04-29 08:04:45 -07:00
|
|
|
|
2007-11-14 20:48:53 -08:00
|
|
|
// double t1 = ecore_time_get(); ////
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
if (!eina_hash_find(_drop_win_hash, &ev->win))
|
2007-11-14 20:48:53 -08:00
|
|
|
{
|
|
|
|
// double t2 = ecore_time_get() - t1; ////
|
|
|
|
// printf("DND POS EV 1 %3.7f\n", t2); ////
|
2012-09-11 02:07:54 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2007-11-14 20:48:53 -08:00
|
|
|
}
|
2005-04-29 08:04:45 -07:00
|
|
|
|
2005-06-10 14:26:50 -07:00
|
|
|
rect.x = 0;
|
|
|
|
rect.y = 0;
|
|
|
|
rect.width = 0;
|
|
|
|
rect.height = 0;
|
|
|
|
|
2013-05-29 01:15:21 -07:00
|
|
|
if (!_active_handlers)
|
2009-05-26 07:44:19 -07:00
|
|
|
ecore_x_dnd_send_status(0, 0, rect, ECORE_X_DND_ACTION_PRIVATE);
|
2005-06-10 14:26:50 -07:00
|
|
|
else
|
|
|
|
{
|
2012-09-11 02:07:54 -07:00
|
|
|
responsive = _e_drag_update(ev->win, ev->position.x, ev->position.y, ev->action);
|
|
|
|
if (responsive)
|
2009-05-26 07:44:19 -07:00
|
|
|
ecore_x_dnd_send_status(1, 0, rect, _action);
|
2012-09-11 02:07:54 -07:00
|
|
|
else
|
2009-05-26 07:44:19 -07:00
|
|
|
ecore_x_dnd_send_status(1, 0, rect, ECORE_X_ATOM_XDND_ACTION_PRIVATE);
|
2005-06-10 14:26:50 -07:00
|
|
|
}
|
2007-11-14 20:48:53 -08:00
|
|
|
// double t2 = ecore_time_get() - t1; ////
|
|
|
|
// printf("DND POS EV 2 %3.7f\n", t2); ////
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2005-04-23 06:13:57 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_dnd_cb_event_dnd_finished(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
|
2005-10-08 06:10:20 -07:00
|
|
|
{
|
2012-09-18 06:20:11 -07:00
|
|
|
/*
|
|
|
|
* this is broken since the completed flag doesn't tell us anything with current
|
|
|
|
* ecore-x and results in never-ending dnd operation which breaks the window
|
|
|
|
* 18 September 2012
|
|
|
|
* BORKER CERTIFICATION: BRONZE
|
|
|
|
* -discomfitor
|
2005-10-08 06:10:20 -07:00
|
|
|
Ecore_X_Event_Xdnd_Finished *ev;
|
|
|
|
|
|
|
|
ev = event;
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
if (!ev->completed) return ECORE_CALLBACK_PASS_ON;
|
2013-01-11 02:34:29 -08:00
|
|
|
*/
|
2007-08-18 03:37:16 -07:00
|
|
|
|
2014-01-22 12:59:30 -08:00
|
|
|
if (_drag_current && (!_xdnd))
|
|
|
|
e_object_del(E_OBJECT(_drag_current));
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2005-10-08 06:10:20 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_dnd_cb_event_dnd_drop(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2005-04-23 06:13:57 -07:00
|
|
|
{
|
2013-05-29 01:15:21 -07:00
|
|
|
Ecore_X_Event_Xdnd_Drop *ev = event;
|
2005-04-23 06:13:57 -07:00
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
if (!eina_hash_find(_drop_win_hash, &ev->win)) return ECORE_CALLBACK_PASS_ON;
|
2005-06-10 14:26:50 -07:00
|
|
|
|
2010-11-05 11:46:13 -07:00
|
|
|
if (_xdnd)
|
|
|
|
{
|
2012-09-11 09:17:24 -07:00
|
|
|
E_Drop_Handler *h;
|
|
|
|
Eina_Bool req = EINA_TRUE;
|
|
|
|
Eina_List *l;
|
|
|
|
|
2013-05-29 01:15:21 -07:00
|
|
|
EINA_LIST_FOREACH(_active_handlers, l, h)
|
2012-09-11 09:17:24 -07:00
|
|
|
{
|
|
|
|
if (_e_drag_win_matches(h, ev->win, 1) && h->entered && h->cb.xds)
|
|
|
|
{
|
2012-10-18 01:04:03 -07:00
|
|
|
req = h->cb.xds(h->cb.data, _xdnd->type);
|
2012-09-11 09:17:24 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (req) ecore_x_selection_xdnd_request(ev->win, _xdnd->type);
|
2005-06-10 14:26:50 -07:00
|
|
|
|
2010-11-05 11:46:13 -07:00
|
|
|
_xdnd->x = ev->position.x;
|
|
|
|
_xdnd->y = ev->position.y;
|
2012-09-16 21:01:30 -07:00
|
|
|
if (!req)
|
|
|
|
{
|
|
|
|
_e_drag_xdnd_end(ev->win, _xdnd->x, _xdnd->y);
|
|
|
|
ecore_x_dnd_send_finished();
|
|
|
|
eina_stringshare_del(_xdnd->type);
|
|
|
|
E_FREE(_xdnd);
|
|
|
|
}
|
2010-11-05 11:46:13 -07:00
|
|
|
}
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2005-04-23 06:13:57 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_dnd_cb_event_dnd_selection(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2005-04-29 08:04:45 -07:00
|
|
|
{
|
2013-05-29 01:15:21 -07:00
|
|
|
Ecore_X_Event_Selection_Notify *ev = event;
|
2005-06-10 14:26:50 -07:00
|
|
|
int i;
|
2005-04-29 08:04:45 -07:00
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
if (!eina_hash_find(_drop_win_hash, &ev->win)) return ECORE_CALLBACK_PASS_ON;
|
2010-06-24 09:19:12 -07:00
|
|
|
if (ev->selection != ECORE_X_SELECTION_XDND) return ECORE_CALLBACK_PASS_ON;
|
2015-08-06 16:26:08 -07:00
|
|
|
if (e_comp->comp_type != E_PIXMAP_TYPE_X) return ECORE_CALLBACK_RENEW;
|
2005-06-10 14:26:50 -07:00
|
|
|
|
2012-12-06 01:01:32 -08:00
|
|
|
if (!_xdnd)
|
|
|
|
{
|
|
|
|
/* something crazy happened */
|
|
|
|
ecore_x_dnd_send_finished();
|
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
|
|
|
|
2009-03-18 17:14:57 -07:00
|
|
|
if (_type_text_uri_list == _xdnd->type)
|
2005-06-10 14:26:50 -07:00
|
|
|
{
|
2012-09-11 02:07:54 -07:00
|
|
|
Ecore_X_Selection_Data_Files *files;
|
|
|
|
Eina_List *l = NULL;
|
|
|
|
|
|
|
|
files = ev->data;
|
|
|
|
for (i = 0; i < files->num_files; i++)
|
|
|
|
{
|
|
|
|
/* TODO: Check if hostname is in file:// uri */
|
2015-01-12 09:12:52 -08:00
|
|
|
/* if (!strncmp(files->files[i], "file://", 7)) */
|
|
|
|
/* l = eina_list_append(l, files->files[i]); */
|
2012-09-11 02:07:54 -07:00
|
|
|
/* TODO: download files
|
|
|
|
else if (!strncmp(files->files[i], "http://", 7))
|
|
|
|
else if (!strncmp(files->files[i], "ftp://", 6))
|
|
|
|
*/
|
2015-01-12 09:12:52 -08:00
|
|
|
/* else */
|
|
|
|
l = eina_list_append(l, files->files[i]);
|
2012-09-11 02:07:54 -07:00
|
|
|
}
|
|
|
|
_xdnd->data = l;
|
|
|
|
_e_drag_xdnd_end(ev->win, _xdnd->x, _xdnd->y);
|
|
|
|
eina_list_free(l);
|
2005-06-10 14:26:50 -07:00
|
|
|
}
|
2009-03-18 17:14:57 -07:00
|
|
|
else if (_type_text_x_moz_url == _xdnd->type)
|
2005-06-15 18:55:19 -07:00
|
|
|
{
|
2013-05-29 05:43:55 -07:00
|
|
|
Ecore_X_Selection_Data_X_Moz_Url *sel;
|
|
|
|
E_Dnd_X_Moz_Url moz;
|
|
|
|
|
|
|
|
sel = ev->data;
|
|
|
|
moz.links = sel->links;
|
|
|
|
moz.link_names = sel->link_names;
|
|
|
|
_xdnd->data = &moz;
|
2012-09-11 02:07:54 -07:00
|
|
|
_e_drag_xdnd_end(ev->win, _xdnd->x, _xdnd->y);
|
2005-06-15 18:55:19 -07:00
|
|
|
}
|
|
|
|
else
|
2009-05-26 07:44:19 -07:00
|
|
|
_e_drag_xdnd_end(ev->win, _xdnd->x, _xdnd->y);
|
2005-06-15 18:55:19 -07:00
|
|
|
/* FIXME: When to execute this? It could be executed in ecore_x after getting
|
|
|
|
* the drop property... */
|
2005-06-10 14:26:50 -07:00
|
|
|
ecore_x_dnd_send_finished();
|
2009-03-18 17:14:57 -07:00
|
|
|
eina_stringshare_del(_xdnd->type);
|
2009-05-26 09:02:49 -07:00
|
|
|
E_FREE(_xdnd);
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2005-04-29 08:04:45 -07:00
|
|
|
}
|
2014-03-11 04:24:41 -07:00
|
|
|
#endif
|
2012-09-11 02:07:54 -07:00
|
|
|
|