giant comp rejiggering commit because anything smaller would have broken something:
* remove xwin for container canvas: now drawn directly on the compositor canvas * added SHAPE_DEBUG define for bored developers * bindings now use new e struct for mouse/wheel events * container+zone now get mouse events from smart callbacks instead of x events * rename comp api namespace * change comp underlay theme to have a swallow for the wallpaper * add names to all zone/container/comp objects to make debugging much easier * some minor related updates to go along with this SVN revision: 83752
This commit is contained in:
parent
f49dd52cd3
commit
aa6a2d173d
|
@ -7,6 +7,10 @@
|
|||
* keyboard mapping change now also disables for window class "vmware"
|
||||
* added option for remembering filemanager windows globally
|
||||
* added edit functionality to window remembers dialog
|
||||
* added function for getting children of e_layout
|
||||
* container now uses compositor window
|
||||
* bindings now use new E_Binding_Event structs for mouse events
|
||||
* added utility function for printing all objects above a given object
|
||||
|
||||
2013-02-07 Carsten Haitzler
|
||||
|
||||
|
@ -69,7 +73,6 @@
|
|||
2013-01-29 Mike Blumenkrantz
|
||||
|
||||
* fixed bug where dragging files into sidebar would move them instead of creating links
|
||||
* added function for getting children of e_layout
|
||||
|
||||
2013-01-23 Chris Michael
|
||||
|
||||
|
|
3
NEWS
3
NEWS
|
@ -27,6 +27,7 @@ Additions:
|
|||
* e_widget_on_disable_hook_set
|
||||
* e_int_border_remember_edit
|
||||
* Added function for getting children of e_layout
|
||||
* added utility function for printing all objects above a given object
|
||||
Config:
|
||||
* Added option for disabling icons in menus
|
||||
* Added option for disabling pointer warping when performing directional focus changes using winlist
|
||||
|
@ -50,6 +51,7 @@ Changes:
|
|||
* e_xkb_layout API now deals directly with E_Config_XKB_Layout structs
|
||||
Config:
|
||||
* move winlist_warp_speed option to pointer_warp_speed
|
||||
* bindings now use new E_Binding_Event structs for mouse events
|
||||
|
||||
Deprecations:
|
||||
*
|
||||
|
@ -100,6 +102,7 @@ Improvements:
|
|||
* clock listens to /etc/timezone changes now too
|
||||
* enable image preloading for all e_widget_preview using edje
|
||||
* window remember dialog now allows editing of remembers
|
||||
* container now uses compositor window
|
||||
|
||||
Fixes:
|
||||
* IBar menu didn't allow to configure different icon sources, show contents menu even on empty IBar.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
group { name: "e/modules/comp/preview";
|
||||
group { name: "e/comp/preview";
|
||||
parts {
|
||||
part { name: "e.swallow.preview"; type: SWALLOW; mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
|
@ -21,17 +21,17 @@ group { name: "e/modules/comp/preview";
|
|||
}
|
||||
}
|
||||
|
||||
group { name: "e/modules/comp/screen/base/default";
|
||||
group { name: "e/comp/screen/base/default";
|
||||
alias: "e/comp/screen/base/noeffects";
|
||||
parts {
|
||||
part { name: "black"; type: RECT; mouse_events: 0;
|
||||
part { name: "e.swallow.background"; type: SWALLOW; mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
color: 0 0 0 255;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "e/modules/comp/screen/overlay/default";
|
||||
group { name: "e/comp/screen/overlay/default";
|
||||
images.image: "screen_circular_shadow.png" COMP;
|
||||
parts {
|
||||
part { name: "clip"; type: RECT; mouse_events: 0;
|
||||
|
@ -174,8 +174,8 @@ group { name: "e/modules/comp/screen/overlay/default";
|
|||
}
|
||||
|
||||
|
||||
group { name: "e/modules/comp/screen/overlay/noeffects";
|
||||
inherit: "e/modules/comp/screen/overlay/default";
|
||||
group { name: "e/comp/screen/overlay/noeffects";
|
||||
inherit: "e/comp/screen/overlay/default";
|
||||
programs {
|
||||
program {
|
||||
name: "screensaver_on";
|
||||
|
|
|
@ -58,7 +58,7 @@ e_color_dialog.h \
|
|||
e_color.h \
|
||||
e_comp.h \
|
||||
e_comp_cfdata.h \
|
||||
e_comp_update.h \
|
||||
e_comp_render_update.h \
|
||||
e_config_data.h \
|
||||
e_config_dialog.h \
|
||||
e_config.h \
|
||||
|
@ -233,7 +233,7 @@ e_color_class.c \
|
|||
e_color_dialog.c \
|
||||
e_comp.c \
|
||||
e_comp_cfdata.c \
|
||||
e_comp_update.c \
|
||||
e_comp_render_update.c \
|
||||
e_config.c \
|
||||
e_config_data.c \
|
||||
e_config_dialog.c \
|
||||
|
|
|
@ -174,7 +174,7 @@ typedef struct _E_Rect E_Rect;
|
|||
#ifndef MAX
|
||||
# define MAX(x, y) (((x) > (y)) ? (x) : (y))
|
||||
#endif
|
||||
# define E_FN_DEL(_fn, _h) if (_h) { _fn((void*)_h); _h = NULL; }
|
||||
# define E_FN_DEL(_fn, _h) do { if (_h) { _fn((void*)_h); _h = NULL; } } while (0)
|
||||
# define E_INTERSECTS(x, y, w, h, xx, yy, ww, hh) \
|
||||
(((x) < ((xx) + (ww))) && ((y) < ((yy) + (hh))) && (((x) + (w)) > (xx)) && (((y) + (h)) > (yy)))
|
||||
# define E_INSIDE(x, y, xx, yy, ww, hh) \
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
if (act) act->func.go_mouse = _e_actions_act_##name##_go_mouse; \
|
||||
}
|
||||
#define ACT_FN_GO_MOUSE(act, use) \
|
||||
static void _e_actions_act_##act##_go_mouse(E_Object * obj __UNUSED__, const char *params use, Ecore_Event_Mouse_Button * ev __UNUSED__)
|
||||
static void _e_actions_act_##act##_go_mouse(E_Object * obj __UNUSED__, const char *params use, E_Binding_Event_Mouse_Button * ev __UNUSED__)
|
||||
|
||||
#define ACT_GO_WHEEL(name) \
|
||||
{ \
|
||||
|
@ -23,7 +23,7 @@
|
|||
if (act) act->func.go_wheel = _e_actions_act_##name##_go_wheel; \
|
||||
}
|
||||
#define ACT_FN_GO_WHEEL(act, use) \
|
||||
static void _e_actions_act_##act##_go_wheel(E_Object * obj __UNUSED__, const char *params use, Ecore_Event_Mouse_Wheel * ev __UNUSED__)
|
||||
static void _e_actions_act_##act##_go_wheel(E_Object * obj __UNUSED__, const char *params use, E_Binding_Event_Wheel * ev __UNUSED__)
|
||||
|
||||
#define ACT_GO_EDGE(name) \
|
||||
{ \
|
||||
|
@ -63,7 +63,7 @@
|
|||
if (act) act->func.end_mouse = _e_actions_act_##name##_end_mouse; \
|
||||
}
|
||||
#define ACT_FN_END_MOUSE(act, use) \
|
||||
static void _e_actions_act_##act##_end_mouse(E_Object * obj __UNUSED__, const char *params use, Ecore_Event_Mouse_Button * ev __UNUSED__)
|
||||
static void _e_actions_act_##act##_end_mouse(E_Object * obj __UNUSED__, const char *params use, E_Binding_Event_Mouse_Button * ev __UNUSED__)
|
||||
|
||||
#define ACT_END_KEY(name) \
|
||||
{ \
|
||||
|
@ -1925,8 +1925,8 @@ ACT_FN_GO_MOUSE(menu_show, )
|
|||
|
||||
/* FIXME: this is a bit of a hack... setting m->con - bad hack */
|
||||
m->zone = zone;
|
||||
x = ev->root.x;
|
||||
y = ev->root.y;
|
||||
x = ev->canvas.x;
|
||||
y = ev->canvas.y;
|
||||
x -= zone->container->x;
|
||||
y -= zone->container->y;
|
||||
e_menu_post_deactivate_callback_set(m, _e_actions_cb_menu_end, NULL);
|
||||
|
@ -2775,7 +2775,7 @@ _delayed_action_key_del(E_Object *obj, const char *params __UNUSED__, Ecore_Even
|
|||
}
|
||||
|
||||
static void
|
||||
_delayed_action_mouse_add(E_Object *obj, const char *params, Ecore_Event_Mouse_Button *ev)
|
||||
_delayed_action_mouse_add(E_Object *obj, const char *params, E_Binding_Event_Mouse_Button *ev)
|
||||
{
|
||||
Delayed_Action *da;
|
||||
|
||||
|
@ -2787,13 +2787,13 @@ _delayed_action_mouse_add(E_Object *obj, const char *params, Ecore_Event_Mouse_B
|
|||
e_object_ref(da->obj);
|
||||
}
|
||||
da->mouse = 1;
|
||||
da->button = ev->buttons;
|
||||
da->button = ev->button;
|
||||
if (params) _delayed_action_list_parse(da, params);
|
||||
_delayed_actions = eina_list_append(_delayed_actions, da);
|
||||
}
|
||||
|
||||
static void
|
||||
_delayed_action_mouse_del(E_Object *obj, const char *params __UNUSED__, Ecore_Event_Mouse_Button *ev)
|
||||
_delayed_action_mouse_del(E_Object *obj, const char *params __UNUSED__, E_Binding_Event_Mouse_Button *ev)
|
||||
{
|
||||
Eina_List *l;
|
||||
Delayed_Action *da;
|
||||
|
@ -2801,7 +2801,7 @@ _delayed_action_mouse_del(E_Object *obj, const char *params __UNUSED__, Ecore_Ev
|
|||
EINA_LIST_FOREACH(_delayed_actions, l, da)
|
||||
{
|
||||
if ((da->obj == obj) && (da->mouse) &&
|
||||
((int)ev->buttons == da->button))
|
||||
((int)ev->button == da->button))
|
||||
{
|
||||
_delayed_action_do(da);
|
||||
_delayed_action_free(da);
|
||||
|
|
|
@ -18,14 +18,14 @@ struct _E_Action
|
|||
struct
|
||||
{
|
||||
void (*go)(E_Object *obj, const char *params);
|
||||
void (*go_mouse)(E_Object *obj, const char *params, Ecore_Event_Mouse_Button *ev);
|
||||
void (*go_wheel)(E_Object *obj, const char *params, Ecore_Event_Mouse_Wheel *ev);
|
||||
void (*go_mouse)(E_Object *obj, const char *params, E_Binding_Event_Mouse_Button *ev);
|
||||
void (*go_wheel)(E_Object *obj, const char *params, E_Binding_Event_Wheel *ev);
|
||||
void (*go_edge)(E_Object *obj, const char *params, E_Event_Zone_Edge *ev);
|
||||
void (*go_key)(E_Object *obj, const char *params, Ecore_Event_Key *ev);
|
||||
void (*go_signal)(E_Object *obj, const char *params, const char *sig, const char *src);
|
||||
void (*go_acpi)(E_Object *obj, const char *params, E_Event_Acpi *ev);
|
||||
void (*end)(E_Object *obj, const char *params);
|
||||
void (*end_mouse)(E_Object *obj, const char *params, Ecore_Event_Mouse_Button *ev);
|
||||
void (*end_mouse)(E_Object *obj, const char *params, E_Binding_Event_Mouse_Button *ev);
|
||||
void (*end_key)(E_Object *obj, const char *params, Ecore_Event_Key *ev);
|
||||
} func;
|
||||
};
|
||||
|
|
|
@ -221,28 +221,20 @@ e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition)
|
|||
}
|
||||
|
||||
if (transition == E_BG_TRANSITION_NONE)
|
||||
{
|
||||
if (zone->bg_object)
|
||||
{
|
||||
evas_object_del(zone->bg_object);
|
||||
zone->bg_object = NULL;
|
||||
}
|
||||
}
|
||||
E_FN_DEL(evas_object_del, zone->bg_object);
|
||||
else
|
||||
{
|
||||
char buf[4096];
|
||||
|
||||
if (zone->bg_object)
|
||||
{
|
||||
if (zone->prev_bg_object)
|
||||
evas_object_del(zone->prev_bg_object);
|
||||
E_FN_DEL(evas_object_del, zone->prev_bg_object);
|
||||
zone->prev_bg_object = zone->bg_object;
|
||||
if (zone->transition_object)
|
||||
evas_object_del(zone->transition_object);
|
||||
zone->transition_object = NULL;
|
||||
zone->bg_object = NULL;
|
||||
E_FN_DEL(evas_object_del, zone->transition_object);
|
||||
}
|
||||
o = edje_object_add(zone->container->bg_evas);
|
||||
evas_object_repeat_events_set(o, 1);
|
||||
zone->transition_object = o;
|
||||
/* FIXME: segv if zone is deleted while up??? */
|
||||
evas_object_data_set(o, "e_zone", zone);
|
||||
|
@ -251,14 +243,13 @@ e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition)
|
|||
edje_object_signal_callback_add(o, "e,state,done", "*", _e_bg_signal, zone);
|
||||
evas_object_move(o, zone->x, zone->y);
|
||||
evas_object_resize(o, zone->w, zone->h);
|
||||
evas_object_layer_set(o, -1);
|
||||
E_LAYER_SET(o, E_COMP_CANVAS_LAYER_BG);
|
||||
evas_object_clip_set(o, zone->bg_clip_object);
|
||||
evas_object_show(o);
|
||||
}
|
||||
if (eina_str_has_extension(bgfile, ".edj"))
|
||||
{
|
||||
o = edje_object_add(zone->container->bg_evas);
|
||||
evas_object_data_set(o, "e_zone", zone);
|
||||
edje_object_file_set(o, bgfile, "e/desktop/background");
|
||||
if (edje_object_data_get(o, "noanimation"))
|
||||
edje_object_animation_set(o, EINA_FALSE);
|
||||
|
@ -266,16 +257,17 @@ e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition)
|
|||
else
|
||||
{
|
||||
o = e_icon_add(zone->container->bg_evas);
|
||||
evas_object_data_set(o, "e_zone", zone);
|
||||
e_icon_file_key_set(o, bgfile, NULL);
|
||||
e_icon_fill_inside_set(o, 0);
|
||||
}
|
||||
evas_object_data_set(o, "e_zone", zone);
|
||||
evas_object_repeat_events_set(o, 1);
|
||||
zone->bg_object = o;
|
||||
if (transition == E_BG_TRANSITION_NONE)
|
||||
{
|
||||
evas_object_move(o, zone->x, zone->y);
|
||||
evas_object_resize(o, zone->w, zone->h);
|
||||
evas_object_layer_set(o, -1);
|
||||
E_LAYER_SET(o, E_COMP_CANVAS_LAYER_BG);
|
||||
}
|
||||
evas_object_clip_set(o, zone->bg_clip_object);
|
||||
evas_object_show(o);
|
||||
|
@ -292,6 +284,10 @@ e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition)
|
|||
zone->bg_object);
|
||||
edje_object_signal_emit(zone->transition_object, "e,action,start", "e");
|
||||
}
|
||||
if (zone->bg_object) evas_object_name_set(zone->bg_object, "zone->bg_object");
|
||||
if (zone->prev_bg_object) evas_object_name_set(zone->prev_bg_object, "zone->prev_bg_object");
|
||||
if (zone->transition_object) evas_object_name_set(zone->transition_object, "zone->transition_object");
|
||||
if (zone->comp_zone) e_comp_zone_update(zone->comp_zone);
|
||||
end:
|
||||
eina_stringshare_del(bgfile);
|
||||
}
|
||||
|
@ -523,7 +519,7 @@ _e_bg_signal(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNU
|
|||
}
|
||||
evas_object_move(zone->bg_object, zone->x, zone->y);
|
||||
evas_object_resize(zone->bg_object, zone->w, zone->h);
|
||||
evas_object_layer_set(zone->bg_object, -1);
|
||||
E_LAYER_SET(zone->bg_object, E_COMP_CANVAS_LAYER_BG);
|
||||
evas_object_clip_set(zone->bg_object, zone->bg_clip_object);
|
||||
evas_object_show(zone->bg_object);
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ static void _e_bindings_wheel_free(E_Binding_Wheel *bind);
|
|||
static void _e_bindings_acpi_free(E_Binding_Acpi *bind);
|
||||
static int _e_bindings_context_match(E_Binding_Context bctxt, E_Binding_Context ctxt);
|
||||
static E_Binding_Modifier _e_bindings_modifiers(unsigned int modifiers);
|
||||
static int _e_ecore_modifiers(E_Binding_Modifier modifiers);
|
||||
static Eina_Bool _e_bindings_edge_cb_timer(void *data);
|
||||
|
||||
/* local subsystem globals */
|
||||
|
@ -115,6 +114,121 @@ e_bindings_shutdown(void)
|
|||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_bindings_modifiers_to_ecore_convert(E_Binding_Modifier modifiers)
|
||||
{
|
||||
int mod = 0;
|
||||
|
||||
if (modifiers & E_BINDING_MODIFIER_SHIFT) mod |= ECORE_EVENT_MODIFIER_SHIFT;
|
||||
if (modifiers & E_BINDING_MODIFIER_CTRL) mod |= ECORE_EVENT_MODIFIER_CTRL;
|
||||
if (modifiers & E_BINDING_MODIFIER_ALT) mod |= ECORE_EVENT_MODIFIER_ALT;
|
||||
if (modifiers & E_BINDING_MODIFIER_WIN) mod |= ECORE_EVENT_MODIFIER_WIN;
|
||||
/* see comment in e_bindings on numlock
|
||||
if (modifiers & ECORE_X_LOCK_NUM) mod |= ECORE_X_LOCK_NUM;
|
||||
*/
|
||||
|
||||
return mod;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_bindings_ecore_event_mouse_wheel_convert(const Ecore_Event_Mouse_Wheel *ev, E_Binding_Event_Wheel *event)
|
||||
{
|
||||
memset(event, 0, sizeof(E_Binding_Event_Wheel));
|
||||
event->direction = ev->direction;
|
||||
event->z = ev->z;
|
||||
event->canvas.x = ev->root.x, event->canvas.y = ev->root.y;
|
||||
event->timestamp = ev->timestamp;
|
||||
event->modifiers = _e_bindings_modifiers(ev->modifiers);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_bindings_ecore_event_mouse_button_convert(const Ecore_Event_Mouse_Button *ev, E_Binding_Event_Mouse_Button *event)
|
||||
{
|
||||
memset(event, 0, sizeof(E_Binding_Event_Mouse_Button));
|
||||
event->button = ev->buttons;
|
||||
event->canvas.x = ev->root.x, event->canvas.y = ev->root.y;
|
||||
event->timestamp = ev->timestamp;
|
||||
event->modifiers = _e_bindings_modifiers(ev->modifiers);
|
||||
|
||||
event->double_click = !!ev->double_click;
|
||||
event->triple_click = !!ev->triple_click;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_bindings_evas_event_mouse_wheel_convert(const Evas_Event_Mouse_Wheel *ev, E_Binding_Event_Wheel *event)
|
||||
{
|
||||
memset(event, 0, sizeof(E_Binding_Event_Wheel));
|
||||
event->direction = ev->direction;
|
||||
event->z = ev->z;
|
||||
event->canvas.x = ev->output.x, event->canvas.y = ev->output.y;
|
||||
event->timestamp = ev->timestamp;
|
||||
|
||||
event->modifiers |= (E_BINDING_MODIFIER_SHIFT * evas_key_modifier_is_set(ev->modifiers, "Shift"));
|
||||
event->modifiers |= (E_BINDING_MODIFIER_CTRL * evas_key_modifier_is_set(ev->modifiers, "Control"));
|
||||
event->modifiers |= (E_BINDING_MODIFIER_ALT * evas_key_modifier_is_set(ev->modifiers, "Alt"));
|
||||
event->modifiers |= (E_BINDING_MODIFIER_WIN * evas_key_modifier_is_set(ev->modifiers, "Super"));
|
||||
event->modifiers |= (E_BINDING_MODIFIER_WIN * evas_key_modifier_is_set(ev->modifiers, "Hyper"));
|
||||
event->modifiers |= (E_BINDING_MODIFIER_ALTGR * evas_key_modifier_is_set(ev->modifiers, "AltGr"));
|
||||
|
||||
/* TODO
|
||||
if (modifiers & ECORE_EVENT_LOCK_SCROLL)
|
||||
evas_key_lock_on(e, "Scroll_Lock");
|
||||
else evas_key_lock_off(e, "Scroll_Lock");
|
||||
|
||||
if (modifiers & ECORE_EVENT_LOCK_NUM)
|
||||
evas_key_lock_on(e, "Num_Lock");
|
||||
else evas_key_lock_off(e, "Num_Lock");
|
||||
|
||||
if (modifiers & ECORE_EVENT_LOCK_CAPS)
|
||||
evas_key_lock_on(e, "Caps_Lock");
|
||||
else evas_key_lock_off(e, "Caps_Lock");
|
||||
|
||||
if (modifiers & ECORE_EVENT_LOCK_SHIFT)
|
||||
evas_key_lock_on(e, "Shift_Lock");
|
||||
else evas_key_lock_off(e, "Shift_Lock");
|
||||
*/
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_bindings_evas_event_mouse_button_convert(const Evas_Event_Mouse_Down *ev, E_Binding_Event_Mouse_Button *event)
|
||||
{
|
||||
memset(event, 0, sizeof(E_Binding_Event_Mouse_Button));
|
||||
event->button = ev->button;
|
||||
event->canvas.x = ev->output.x, event->canvas.y = ev->output.y;
|
||||
event->timestamp = ev->timestamp;
|
||||
|
||||
event->modifiers |= (E_BINDING_MODIFIER_SHIFT * evas_key_modifier_is_set(ev->modifiers, "Shift"));
|
||||
event->modifiers |= (E_BINDING_MODIFIER_CTRL * evas_key_modifier_is_set(ev->modifiers, "Control"));
|
||||
event->modifiers |= (E_BINDING_MODIFIER_ALT * evas_key_modifier_is_set(ev->modifiers, "Alt"));
|
||||
event->modifiers |= (E_BINDING_MODIFIER_WIN * evas_key_modifier_is_set(ev->modifiers, "Super"));
|
||||
event->modifiers |= (E_BINDING_MODIFIER_WIN * evas_key_modifier_is_set(ev->modifiers, "Hyper"));
|
||||
event->modifiers |= (E_BINDING_MODIFIER_ALTGR * evas_key_modifier_is_set(ev->modifiers, "AltGr"));
|
||||
|
||||
event->hold = (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD);
|
||||
event->scroll = (ev->event_flags & EVAS_EVENT_FLAG_ON_SCROLL);
|
||||
|
||||
event->double_click = (ev->flags & EVAS_BUTTON_DOUBLE_CLICK);
|
||||
event->triple_click = (ev->flags & EVAS_BUTTON_TRIPLE_CLICK);
|
||||
|
||||
/* TODO
|
||||
if (modifiers & ECORE_EVENT_LOCK_SCROLL)
|
||||
evas_key_lock_on(e, "Scroll_Lock");
|
||||
else evas_key_lock_off(e, "Scroll_Lock");
|
||||
|
||||
if (modifiers & ECORE_EVENT_LOCK_NUM)
|
||||
evas_key_lock_on(e, "Num_Lock");
|
||||
else evas_key_lock_off(e, "Num_Lock");
|
||||
|
||||
if (modifiers & ECORE_EVENT_LOCK_CAPS)
|
||||
evas_key_lock_on(e, "Caps_Lock");
|
||||
else evas_key_lock_off(e, "Caps_Lock");
|
||||
|
||||
if (modifiers & ECORE_EVENT_LOCK_SHIFT)
|
||||
evas_key_lock_on(e, "Shift_Lock");
|
||||
else evas_key_lock_off(e, "Shift_Lock");
|
||||
*/
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_bindings_signal_reset(void)
|
||||
{
|
||||
|
@ -274,7 +388,7 @@ e_bindings_mouse_grab(E_Binding_Context ctxt, Ecore_X_Window win)
|
|||
ECORE_X_EVENT_MASK_MOUSE_DOWN |
|
||||
ECORE_X_EVENT_MASK_MOUSE_UP |
|
||||
ECORE_X_EVENT_MASK_MOUSE_MOVE,
|
||||
_e_ecore_modifiers(binding->mod),
|
||||
e_bindings_modifiers_to_ecore_convert(binding->mod),
|
||||
binding->any_mod);
|
||||
}
|
||||
}
|
||||
|
@ -291,23 +405,21 @@ e_bindings_mouse_ungrab(E_Binding_Context ctxt, Ecore_X_Window win)
|
|||
if (_e_bindings_context_match(binding->ctxt, ctxt))
|
||||
{
|
||||
ecore_x_window_button_ungrab(win, binding->button,
|
||||
_e_ecore_modifiers(binding->mod), binding->any_mod);
|
||||
e_bindings_modifiers_to_ecore_convert(binding->mod), binding->any_mod);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EAPI E_Action *
|
||||
e_bindings_mouse_down_find(E_Binding_Context ctxt, E_Object *obj __UNUSED__, Ecore_Event_Mouse_Button *ev, E_Binding_Mouse **bind_ret)
|
||||
e_bindings_mouse_button_find(E_Binding_Context ctxt, E_Binding_Event_Mouse_Button *ev, E_Binding_Mouse **bind_ret)
|
||||
{
|
||||
E_Binding_Modifier mod = 0;
|
||||
E_Binding_Mouse *binding;
|
||||
Eina_List *l;
|
||||
|
||||
mod = _e_bindings_modifiers(ev->modifiers);
|
||||
EINA_LIST_FOREACH(mouse_bindings, l, binding)
|
||||
{
|
||||
if ((binding->button == (int)ev->buttons) &&
|
||||
((binding->any_mod) || (binding->mod == mod)))
|
||||
if ((binding->button == (int)ev->button) &&
|
||||
((binding->any_mod) || (binding->mod == ev->modifiers)))
|
||||
{
|
||||
if (_e_bindings_context_match(binding->ctxt, ctxt))
|
||||
{
|
||||
|
@ -323,12 +435,12 @@ e_bindings_mouse_down_find(E_Binding_Context ctxt, E_Object *obj __UNUSED__, Eco
|
|||
}
|
||||
|
||||
EAPI E_Action *
|
||||
e_bindings_mouse_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Button *ev)
|
||||
e_bindings_mouse_down_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Binding_Event_Mouse_Button *ev)
|
||||
{
|
||||
E_Action *act;
|
||||
E_Binding_Mouse *binding;
|
||||
|
||||
act = e_bindings_mouse_down_find(ctxt, obj, ev, &binding);
|
||||
act = e_bindings_mouse_button_find(ctxt, ev, &binding);
|
||||
if (act)
|
||||
{
|
||||
if (act->func.go_mouse)
|
||||
|
@ -341,38 +453,32 @@ e_bindings_mouse_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_
|
|||
}
|
||||
|
||||
EAPI E_Action *
|
||||
e_bindings_mouse_up_find(E_Binding_Context ctxt, E_Object *obj __UNUSED__, Ecore_Event_Mouse_Button *ev, E_Binding_Mouse **bind_ret)
|
||||
e_bindings_mouse_down_evas_event_handle(E_Binding_Context ctxt, E_Object *obj, Evas_Event_Mouse_Down *ev)
|
||||
{
|
||||
E_Binding_Modifier mod = 0;
|
||||
E_Binding_Mouse *binding;
|
||||
Eina_List *l;
|
||||
E_Binding_Event_Mouse_Button event;
|
||||
|
||||
mod = _e_bindings_modifiers(ev->modifiers);
|
||||
EINA_LIST_FOREACH(mouse_bindings, l, binding)
|
||||
{
|
||||
if ((binding->button == (int)ev->buttons) &&
|
||||
((binding->any_mod) || (binding->mod == mod)))
|
||||
{
|
||||
if (_e_bindings_context_match(binding->ctxt, ctxt))
|
||||
{
|
||||
E_Action *act;
|
||||
e_bindings_evas_event_mouse_button_convert(ev, &event);
|
||||
|
||||
act = e_action_find(binding->action);
|
||||
if (bind_ret) *bind_ret = binding;
|
||||
return act;
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return e_bindings_mouse_down_event_handle(ctxt, obj, &event);
|
||||
}
|
||||
|
||||
EAPI E_Action *
|
||||
e_bindings_mouse_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Button *ev)
|
||||
e_bindings_mouse_down_ecore_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Button *ev)
|
||||
{
|
||||
E_Binding_Event_Mouse_Button event;
|
||||
|
||||
e_bindings_ecore_event_mouse_button_convert(ev, &event);
|
||||
|
||||
return e_bindings_mouse_down_event_handle(ctxt, obj, &event);
|
||||
}
|
||||
|
||||
EAPI E_Action *
|
||||
e_bindings_mouse_up_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Binding_Event_Mouse_Button *ev)
|
||||
{
|
||||
E_Action *act;
|
||||
E_Binding_Mouse *binding;
|
||||
|
||||
act = e_bindings_mouse_up_find(ctxt, obj, ev, &binding);
|
||||
act = e_bindings_mouse_button_find(ctxt, ev, &binding);
|
||||
if (act)
|
||||
{
|
||||
if (act->func.end_mouse)
|
||||
|
@ -384,6 +490,26 @@ e_bindings_mouse_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Ev
|
|||
return act;
|
||||
}
|
||||
|
||||
EAPI E_Action *
|
||||
e_bindings_mouse_up_evas_event_handle(E_Binding_Context ctxt, E_Object *obj, Evas_Event_Mouse_Up *ev)
|
||||
{
|
||||
E_Binding_Event_Mouse_Button event;
|
||||
|
||||
e_bindings_evas_event_mouse_button_convert((Evas_Event_Mouse_Down*)ev, &event);
|
||||
|
||||
return e_bindings_mouse_up_event_handle(ctxt, obj, &event);
|
||||
}
|
||||
|
||||
EAPI E_Action *
|
||||
e_bindings_mouse_up_ecore_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Button *ev)
|
||||
{
|
||||
E_Binding_Event_Mouse_Button event;
|
||||
|
||||
e_bindings_ecore_event_mouse_button_convert(ev, &event);
|
||||
|
||||
return e_bindings_mouse_up_event_handle(ctxt, obj, &event);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_bindings_key_add(E_Binding_Context ctxt, const char *key, E_Binding_Modifier mod, int any_mod, const char *action, const char *params)
|
||||
{
|
||||
|
@ -466,7 +592,7 @@ e_bindings_key_grab(E_Binding_Context ctxt, Ecore_X_Window win)
|
|||
if (_e_bindings_context_match(binding->ctxt, ctxt))
|
||||
{
|
||||
ecore_x_window_key_grab(win, binding->key,
|
||||
_e_ecore_modifiers(binding->mod), binding->any_mod);
|
||||
e_bindings_modifiers_to_ecore_convert(binding->mod), binding->any_mod);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -482,7 +608,7 @@ e_bindings_key_ungrab(E_Binding_Context ctxt, Ecore_X_Window win)
|
|||
if (_e_bindings_context_match(binding->ctxt, ctxt))
|
||||
{
|
||||
ecore_x_window_key_ungrab(win, binding->key,
|
||||
_e_ecore_modifiers(binding->mod), binding->any_mod);
|
||||
e_bindings_modifiers_to_ecore_convert(binding->mod), binding->any_mod);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -910,7 +1036,7 @@ e_bindings_signal_del(E_Binding_Context ctxt, const char *sig, const char *src,
|
|||
}
|
||||
|
||||
EAPI E_Action *
|
||||
e_bindings_signal_find(E_Binding_Context ctxt, E_Object *obj __UNUSED__, const char *sig, const char *src, E_Binding_Signal **bind_ret)
|
||||
e_bindings_signal_find(E_Binding_Context ctxt, const char *sig, const char *src, E_Binding_Signal **bind_ret)
|
||||
{
|
||||
E_Binding_Modifier mod = 0;
|
||||
E_Binding_Signal *binding;
|
||||
|
@ -947,7 +1073,7 @@ e_bindings_signal_handle(E_Binding_Context ctxt, E_Object *obj, const char *sig,
|
|||
|
||||
if (sig && (sig[0] == 0)) sig = NULL;
|
||||
if (src && (src[0] == 0)) src = NULL;
|
||||
act = e_bindings_signal_find(ctxt, obj, sig, src, &binding);
|
||||
act = e_bindings_signal_find(ctxt, sig, src, &binding);
|
||||
if (act)
|
||||
{
|
||||
if (act->func.go_signal)
|
||||
|
@ -1027,7 +1153,7 @@ e_bindings_wheel_grab(E_Binding_Context ctxt, Ecore_X_Window win)
|
|||
if (button != 0)
|
||||
ecore_x_window_button_grab(win, button,
|
||||
ECORE_X_EVENT_MASK_MOUSE_DOWN,
|
||||
_e_ecore_modifiers(binding->mod), binding->any_mod);
|
||||
e_bindings_modifiers_to_ecore_convert(binding->mod), binding->any_mod);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1058,24 +1184,22 @@ e_bindings_wheel_ungrab(E_Binding_Context ctxt, Ecore_X_Window win)
|
|||
}
|
||||
if (button != 0)
|
||||
ecore_x_window_button_ungrab(win, button,
|
||||
_e_ecore_modifiers(binding->mod), binding->any_mod);
|
||||
e_bindings_modifiers_to_ecore_convert(binding->mod), binding->any_mod);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EAPI E_Action *
|
||||
e_bindings_wheel_find(E_Binding_Context ctxt, E_Object *obj __UNUSED__, Ecore_Event_Mouse_Wheel *ev, E_Binding_Wheel **bind_ret)
|
||||
e_bindings_wheel_find(E_Binding_Context ctxt, E_Binding_Event_Wheel *ev, E_Binding_Wheel **bind_ret)
|
||||
{
|
||||
E_Binding_Modifier mod = 0;
|
||||
E_Binding_Wheel *binding;
|
||||
Eina_List *l;
|
||||
|
||||
mod = _e_bindings_modifiers(ev->modifiers);
|
||||
EINA_LIST_FOREACH(wheel_bindings, l, binding)
|
||||
{
|
||||
if ((binding->direction == ev->direction) &&
|
||||
(((binding->z < 0) && (ev->z < 0)) || ((binding->z > 0) && (ev->z > 0))) &&
|
||||
((binding->any_mod) || (binding->mod == mod)))
|
||||
((binding->any_mod) || (binding->mod == ev->modifiers)))
|
||||
{
|
||||
if (_e_bindings_context_match(binding->ctxt, ctxt))
|
||||
{
|
||||
|
@ -1091,12 +1215,12 @@ e_bindings_wheel_find(E_Binding_Context ctxt, E_Object *obj __UNUSED__, Ecore_Ev
|
|||
}
|
||||
|
||||
EAPI E_Action *
|
||||
e_bindings_wheel_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Wheel *ev)
|
||||
e_bindings_wheel_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Binding_Event_Wheel *ev)
|
||||
{
|
||||
E_Action *act;
|
||||
E_Binding_Wheel *binding;
|
||||
|
||||
act = e_bindings_wheel_find(ctxt, obj, ev, &binding);
|
||||
act = e_bindings_wheel_find(ctxt, ev, &binding);
|
||||
if (act)
|
||||
{
|
||||
if (act->func.go_wheel)
|
||||
|
@ -1108,6 +1232,26 @@ e_bindings_wheel_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event
|
|||
return act;
|
||||
}
|
||||
|
||||
EAPI E_Action *
|
||||
e_bindings_wheel_evas_event_handle(E_Binding_Context ctxt, E_Object *obj, Evas_Event_Mouse_Wheel *ev)
|
||||
{
|
||||
E_Binding_Event_Wheel event;
|
||||
|
||||
e_bindings_evas_event_mouse_wheel_convert(ev, &event);
|
||||
|
||||
return e_bindings_wheel_event_handle(ctxt, obj, &event);
|
||||
}
|
||||
|
||||
EAPI E_Action *
|
||||
e_bindings_wheel_ecore_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Wheel *ev)
|
||||
{
|
||||
E_Binding_Event_Wheel event;
|
||||
|
||||
e_bindings_ecore_event_mouse_wheel_convert(ev, &event);
|
||||
|
||||
return e_bindings_wheel_event_handle(ctxt, obj, &event);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_bindings_acpi_add(E_Binding_Context ctxt, int type, int status, const char *action, const char *params)
|
||||
{
|
||||
|
@ -1145,7 +1289,7 @@ e_bindings_acpi_del(E_Binding_Context ctxt, int type, int status, const char *ac
|
|||
}
|
||||
|
||||
EAPI E_Action *
|
||||
e_bindings_acpi_find(E_Binding_Context ctxt, E_Object *obj __UNUSED__, E_Event_Acpi *ev, E_Binding_Acpi **bind_ret)
|
||||
e_bindings_acpi_find(E_Binding_Context ctxt, E_Event_Acpi *ev, E_Binding_Acpi **bind_ret)
|
||||
{
|
||||
E_Binding_Acpi *binding;
|
||||
Eina_List *l;
|
||||
|
@ -1179,7 +1323,7 @@ e_bindings_acpi_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Event_Acpi
|
|||
E_Action *act;
|
||||
E_Binding_Acpi *binding;
|
||||
|
||||
act = e_bindings_acpi_find(ctxt, obj, ev, &binding);
|
||||
act = e_bindings_acpi_find(ctxt, ev, &binding);
|
||||
if (act)
|
||||
{
|
||||
if (act->func.go_acpi)
|
||||
|
@ -1287,10 +1431,12 @@ _e_bindings_modifiers(unsigned int modifiers)
|
|||
{
|
||||
E_Binding_Modifier mod = 0;
|
||||
|
||||
if (modifiers & ECORE_EVENT_MODIFIER_SHIFT) mod |= E_BINDING_MODIFIER_SHIFT;
|
||||
if (modifiers & ECORE_EVENT_MODIFIER_CTRL) mod |= E_BINDING_MODIFIER_CTRL;
|
||||
if (modifiers & ECORE_EVENT_MODIFIER_ALT) mod |= E_BINDING_MODIFIER_ALT;
|
||||
if (modifiers & ECORE_EVENT_MODIFIER_WIN) mod |= E_BINDING_MODIFIER_WIN;
|
||||
|
||||
mod |= (E_BINDING_MODIFIER_SHIFT * !!(modifiers & ECORE_EVENT_MODIFIER_SHIFT));
|
||||
mod |= (E_BINDING_MODIFIER_CTRL * !!(modifiers & ECORE_EVENT_MODIFIER_CTRL));
|
||||
mod |= (E_BINDING_MODIFIER_ALT * !!(modifiers & ECORE_EVENT_MODIFIER_ALT));
|
||||
mod |= (E_BINDING_MODIFIER_WIN * !!(modifiers & ECORE_EVENT_MODIFIER_WIN));
|
||||
mod |= (E_BINDING_MODIFIER_ALTGR * !!(modifiers & ECORE_EVENT_MODIFIER_ALTGR));
|
||||
/* FIXME: there is a good reason numlock was ignored. sometimes people
|
||||
* have it on, sometimes they don't, and often they have no idea. waaaay
|
||||
* back in E 0.1->0.13 or so days this caused issues thus numlock,
|
||||
|
@ -1311,22 +1457,6 @@ _e_bindings_modifiers(unsigned int modifiers)
|
|||
return mod;
|
||||
}
|
||||
|
||||
static int
|
||||
_e_ecore_modifiers(E_Binding_Modifier modifiers)
|
||||
{
|
||||
int mod = 0;
|
||||
|
||||
if (modifiers & E_BINDING_MODIFIER_SHIFT) mod |= ECORE_EVENT_MODIFIER_SHIFT;
|
||||
if (modifiers & E_BINDING_MODIFIER_CTRL) mod |= ECORE_EVENT_MODIFIER_CTRL;
|
||||
if (modifiers & E_BINDING_MODIFIER_ALT) mod |= ECORE_EVENT_MODIFIER_ALT;
|
||||
if (modifiers & E_BINDING_MODIFIER_WIN) mod |= ECORE_EVENT_MODIFIER_WIN;
|
||||
/* see comment in e_bindings on numlock
|
||||
if (modifiers & ECORE_X_LOCK_NUM) mod |= ECORE_X_LOCK_NUM;
|
||||
*/
|
||||
|
||||
return mod;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_bindings_edge_cb_timer(void *data)
|
||||
{
|
||||
|
|
|
@ -24,7 +24,8 @@ typedef enum _E_Binding_Modifier
|
|||
E_BINDING_MODIFIER_SHIFT = (1 << 0),
|
||||
E_BINDING_MODIFIER_CTRL = (1 << 1),
|
||||
E_BINDING_MODIFIER_ALT = (1 << 2),
|
||||
E_BINDING_MODIFIER_WIN = (1 << 3)
|
||||
E_BINDING_MODIFIER_WIN = (1 << 3),
|
||||
E_BINDING_MODIFIER_ALTGR = (1 << 4)
|
||||
} E_Binding_Modifier;
|
||||
|
||||
typedef struct _E_Binding_Mouse E_Binding_Mouse;
|
||||
|
@ -34,10 +35,38 @@ typedef struct _E_Binding_Signal E_Binding_Signal;
|
|||
typedef struct _E_Binding_Wheel E_Binding_Wheel;
|
||||
typedef struct _E_Binding_Acpi E_Binding_Acpi;
|
||||
|
||||
typedef struct E_Binding_Event_Mouse_Button E_Binding_Event_Mouse_Button;
|
||||
typedef struct E_Binding_Event_Wheel E_Binding_Event_Wheel;
|
||||
|
||||
#else
|
||||
#ifndef E_BINDINGS_H
|
||||
#define E_BINDINGS_H
|
||||
|
||||
struct E_Binding_Event_Mouse_Button
|
||||
{
|
||||
int button; /**< Mouse button number that was raised (1 - 32) */
|
||||
|
||||
Evas_Coord_Point canvas; /**< The X/Y location of the cursor */
|
||||
|
||||
unsigned int modifiers; /**< modifier keys pressed during the event */
|
||||
unsigned int timestamp;
|
||||
Eina_Bool double_click : 1;
|
||||
Eina_Bool triple_click : 1;
|
||||
Eina_Bool hold : 1;
|
||||
Eina_Bool scroll : 1;
|
||||
};
|
||||
|
||||
struct E_Binding_Event_Wheel
|
||||
{
|
||||
int direction;
|
||||
int z;
|
||||
|
||||
Evas_Coord_Point canvas; /**< The X/Y location of the cursor */
|
||||
|
||||
unsigned int modifiers; /**< modifier keys pressed during the event */
|
||||
unsigned int timestamp;
|
||||
};
|
||||
|
||||
struct _E_Binding_Mouse
|
||||
{
|
||||
E_Binding_Context ctxt;
|
||||
|
@ -115,10 +144,13 @@ EAPI void e_bindings_mouse_add(E_Binding_Context ctxt, int button, E_Bind
|
|||
EAPI void e_bindings_mouse_del(E_Binding_Context ctxt, int button, E_Binding_Modifier mod, int any_mod, const char *action, const char *params);
|
||||
EAPI void e_bindings_mouse_grab(E_Binding_Context ctxt, Ecore_X_Window win);
|
||||
EAPI void e_bindings_mouse_ungrab(E_Binding_Context ctxt, Ecore_X_Window win);
|
||||
EAPI E_Action *e_bindings_mouse_down_find(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Button *ev, E_Binding_Mouse **bind_ret);
|
||||
EAPI E_Action *e_bindings_mouse_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Button *ev);
|
||||
EAPI E_Action *e_bindings_mouse_up_find(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Button *ev, E_Binding_Mouse **bind_ret);
|
||||
EAPI E_Action *e_bindings_mouse_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Button *ev);
|
||||
EAPI E_Action *e_bindings_mouse_button_find(E_Binding_Context ctxt, E_Binding_Event_Mouse_Button *ev, E_Binding_Mouse **bind_ret);
|
||||
EAPI E_Action *e_bindings_mouse_down_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Binding_Event_Mouse_Button *ev);
|
||||
EAPI E_Action *e_bindings_mouse_down_evas_event_handle(E_Binding_Context ctxt, E_Object *obj, Evas_Event_Mouse_Down *ev);
|
||||
EAPI E_Action *e_bindings_mouse_down_ecore_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Button *ev);
|
||||
EAPI E_Action *e_bindings_mouse_up_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Binding_Event_Mouse_Button *ev);
|
||||
EAPI E_Action *e_bindings_mouse_up_evas_event_handle(E_Binding_Context ctxt, E_Object *obj, Evas_Event_Mouse_Up *ev);
|
||||
EAPI E_Action *e_bindings_mouse_up_ecore_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Button *ev);
|
||||
|
||||
EAPI void e_bindings_key_add(E_Binding_Context ctxt, const char *key, E_Binding_Modifier mod, int any_mod, const char *action, const char *params);
|
||||
EAPI void e_bindings_key_del(E_Binding_Context ctxt, const char *key, E_Binding_Modifier mod, int any_mod, const char *action, const char *params);
|
||||
|
@ -143,21 +175,29 @@ EAPI E_Action *e_bindings_edge_up_event_handle(E_Binding_Context ctxt, E_Objec
|
|||
|
||||
EAPI void e_bindings_signal_add(E_Binding_Context ctxt, const char *sig, const char *src, E_Binding_Modifier mod, int any_mod, const char *action, const char *params);
|
||||
EAPI void e_bindings_signal_del(E_Binding_Context ctxt, const char *sig, const char *src, E_Binding_Modifier mod, int any_mod, const char *action, const char *params);
|
||||
EAPI E_Action *e_bindings_signal_find(E_Binding_Context ctxt, E_Object *obj, const char *sig, const char *src, E_Binding_Signal **bind_ret);
|
||||
EAPI E_Action *e_bindings_signal_find(E_Binding_Context ctxt, const char *sig, const char *src, E_Binding_Signal **bind_ret);
|
||||
EAPI E_Action *e_bindings_signal_handle(E_Binding_Context ctxt, E_Object *obj, const char *sig, const char *src);
|
||||
|
||||
EAPI void e_bindings_wheel_add(E_Binding_Context ctxt, int direction, int z, E_Binding_Modifier mod, int any_mod, const char *action, const char *params);
|
||||
EAPI void e_bindings_wheel_del(E_Binding_Context ctxt, int direction, int z, E_Binding_Modifier mod, int any_mod, const char *action, const char *params);
|
||||
EAPI void e_bindings_wheel_grab(E_Binding_Context ctxt, Ecore_X_Window win);
|
||||
EAPI void e_bindings_wheel_ungrab(E_Binding_Context ctxt, Ecore_X_Window win);
|
||||
EAPI E_Action *e_bindings_wheel_find(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Wheel *ev, E_Binding_Wheel **bind_ret);
|
||||
EAPI E_Action *e_bindings_wheel_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Wheel *ev);
|
||||
EAPI E_Action *e_bindings_wheel_find(E_Binding_Context ctxt, E_Binding_Event_Wheel *ev, E_Binding_Wheel **bind_ret);
|
||||
EAPI E_Action *e_bindings_wheel_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Binding_Event_Wheel *ev);
|
||||
EAPI E_Action *e_bindings_wheel_evas_event_handle(E_Binding_Context ctxt, E_Object *obj, Evas_Event_Mouse_Wheel *ev);
|
||||
EAPI E_Action *e_bindings_wheel_ecore_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Wheel *ev);
|
||||
|
||||
EAPI void e_bindings_acpi_add(E_Binding_Context ctxt, int type, int status, const char *action, const char *params);
|
||||
EAPI void e_bindings_acpi_del(E_Binding_Context ctxt, int type, int status, const char *action, const char *params);
|
||||
EAPI E_Action *e_bindings_acpi_find(E_Binding_Context ctxt, E_Object *obj, E_Event_Acpi *ev, E_Binding_Acpi **bind_ret);
|
||||
EAPI E_Action *e_bindings_acpi_find(E_Binding_Context ctxt, E_Event_Acpi *ev, E_Binding_Acpi **bind_ret);
|
||||
EAPI E_Action *e_bindings_acpi_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Event_Acpi *ev);
|
||||
EAPI void e_bindings_mapping_change_enable(Eina_Bool enable);
|
||||
|
||||
EAPI int e_bindings_modifiers_to_ecore_convert(E_Binding_Modifier modifiers);
|
||||
EAPI void e_bindings_evas_event_mouse_button_convert(const Evas_Event_Mouse_Down *ev, E_Binding_Event_Mouse_Button *event);
|
||||
EAPI void e_bindings_evas_event_mouse_wheel_convert(const Evas_Event_Mouse_Wheel *ev, E_Binding_Event_Wheel *event);
|
||||
EAPI void e_bindings_ecore_event_mouse_button_convert(const Ecore_Event_Mouse_Button *ev, E_Binding_Event_Mouse_Button *event);
|
||||
EAPI void e_bindings_ecore_event_mouse_wheel_convert(const Ecore_Event_Mouse_Wheel *ev, E_Binding_Event_Wheel *event);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -4026,7 +4026,7 @@ e_border_act_resize_keyboard(E_Border *bd)
|
|||
|
||||
EAPI void
|
||||
e_border_act_move_begin(E_Border *bd,
|
||||
Ecore_Event_Mouse_Button *ev)
|
||||
E_Binding_Event_Mouse_Button *ev)
|
||||
{
|
||||
E_OBJECT_CHECK(bd);
|
||||
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
|
||||
|
@ -4041,14 +4041,14 @@ e_border_act_move_begin(E_Border *bd,
|
|||
{
|
||||
char source[256];
|
||||
|
||||
snprintf(source, sizeof(source) - 1, "mouse,down,%i", ev->buttons);
|
||||
snprintf(source, sizeof(source) - 1, "mouse,down,%i", ev->button);
|
||||
_e_border_moveinfo_gather(bd, source);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_border_act_move_end(E_Border *bd,
|
||||
Ecore_Event_Mouse_Button *ev __UNUSED__)
|
||||
E_Binding_Event_Mouse_Button *ev __UNUSED__)
|
||||
{
|
||||
E_OBJECT_CHECK(bd);
|
||||
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
|
||||
|
@ -4062,7 +4062,7 @@ e_border_act_move_end(E_Border *bd,
|
|||
|
||||
EAPI void
|
||||
e_border_act_resize_begin(E_Border *bd,
|
||||
Ecore_Event_Mouse_Button *ev)
|
||||
E_Binding_Event_Mouse_Button *ev)
|
||||
{
|
||||
E_OBJECT_CHECK(bd);
|
||||
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
|
||||
|
@ -4101,14 +4101,14 @@ e_border_act_resize_begin(E_Border *bd,
|
|||
{
|
||||
char source[256];
|
||||
|
||||
snprintf(source, sizeof(source) - 1, "mouse,down,%i", ev->buttons);
|
||||
snprintf(source, sizeof(source) - 1, "mouse,down,%i", ev->button);
|
||||
_e_border_moveinfo_gather(bd, source);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_border_act_resize_end(E_Border *bd,
|
||||
Ecore_Event_Mouse_Button *ev __UNUSED__)
|
||||
E_Binding_Event_Mouse_Button *ev __UNUSED__)
|
||||
{
|
||||
E_OBJECT_CHECK(bd);
|
||||
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
|
||||
|
@ -4124,18 +4124,13 @@ e_border_act_resize_end(E_Border *bd,
|
|||
|
||||
EAPI void
|
||||
e_border_act_menu_begin(E_Border *bd,
|
||||
Ecore_Event_Mouse_Button *ev,
|
||||
E_Binding_Event_Mouse_Button *ev,
|
||||
int key)
|
||||
{
|
||||
E_OBJECT_CHECK(bd);
|
||||
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
|
||||
if (ev)
|
||||
{
|
||||
e_int_border_menu_show(bd,
|
||||
bd->x + bd->fx.x + ev->x - bd->zone->container->x,
|
||||
bd->y + bd->fx.y + ev->y - bd->zone->container->y, key,
|
||||
ev->timestamp);
|
||||
}
|
||||
e_int_border_menu_show(bd, ev->canvas.x, ev->canvas.y, key, ev->timestamp);
|
||||
else
|
||||
{
|
||||
int x, y;
|
||||
|
@ -6718,8 +6713,13 @@ _e_border_cb_mouse_wheel(void *data,
|
|||
bd->mouse.current.mx = ev->root.x;
|
||||
bd->mouse.current.my = ev->root.y;
|
||||
if (!bd->cur_mouse_action)
|
||||
e_bindings_wheel_event_handle(E_BINDING_CONTEXT_WINDOW,
|
||||
E_OBJECT(bd), ev);
|
||||
{
|
||||
E_Binding_Event_Wheel ev2;
|
||||
|
||||
e_bindings_ecore_event_mouse_wheel_convert(ev, &ev2);
|
||||
e_bindings_wheel_event_handle(E_BINDING_CONTEXT_WINDOW,
|
||||
E_OBJECT(bd), &ev2);
|
||||
}
|
||||
}
|
||||
evas_event_feed_mouse_wheel(bd->bg_evas, ev->direction, ev->z, ev->timestamp, NULL);
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
|
@ -6758,9 +6758,12 @@ _e_border_cb_mouse_down(void *data,
|
|||
bd->mouse.current.my = ev->root.y;
|
||||
if (!bd->cur_mouse_action)
|
||||
{
|
||||
E_Binding_Event_Mouse_Button ev2;
|
||||
|
||||
e_bindings_ecore_event_mouse_button_convert(ev, &ev2);
|
||||
bd->cur_mouse_action =
|
||||
e_bindings_mouse_down_event_handle(E_BINDING_CONTEXT_WINDOW,
|
||||
E_OBJECT(bd), ev);
|
||||
E_OBJECT(bd), &ev2);
|
||||
if (bd->cur_mouse_action)
|
||||
{
|
||||
if ((!bd->cur_mouse_action->func.end_mouse) &&
|
||||
|
@ -6843,8 +6846,11 @@ _e_border_cb_mouse_up(void *data,
|
|||
/* should be ok as we are just ending the action if it has an end */
|
||||
if (bd->cur_mouse_action)
|
||||
{
|
||||
E_Binding_Event_Mouse_Button ev2;
|
||||
|
||||
e_bindings_ecore_event_mouse_button_convert(ev, &ev2);
|
||||
if (bd->cur_mouse_action->func.end_mouse)
|
||||
bd->cur_mouse_action->func.end_mouse(E_OBJECT(bd), "", ev);
|
||||
bd->cur_mouse_action->func.end_mouse(E_OBJECT(bd), "", &ev2);
|
||||
else if (bd->cur_mouse_action->func.end)
|
||||
bd->cur_mouse_action->func.end(E_OBJECT(bd), "");
|
||||
e_object_unref(E_OBJECT(bd->cur_mouse_action));
|
||||
|
@ -6852,7 +6858,10 @@ _e_border_cb_mouse_up(void *data,
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_WINDOW, E_OBJECT(bd), ev))
|
||||
E_Binding_Event_Mouse_Button ev2;
|
||||
|
||||
e_bindings_ecore_event_mouse_button_convert(ev, &ev2);
|
||||
if (!e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_WINDOW, E_OBJECT(bd), &ev2))
|
||||
e_focus_event_mouse_up(bd);
|
||||
}
|
||||
}
|
||||
|
@ -7095,8 +7104,11 @@ _e_border_cb_grab_replay(void *data __UNUSED__,
|
|||
return ECORE_CALLBACK_DONE;
|
||||
if (ev->event_window == bd->win)
|
||||
{
|
||||
if (!e_bindings_mouse_down_find(E_BINDING_CONTEXT_WINDOW,
|
||||
E_OBJECT(bd), ev, NULL))
|
||||
E_Binding_Event_Mouse_Button ev2;
|
||||
|
||||
e_bindings_ecore_event_mouse_button_convert(ev, &ev2);
|
||||
if (!e_bindings_mouse_button_find(E_BINDING_CONTEXT_WINDOW,
|
||||
&ev2, NULL))
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -770,11 +770,11 @@ EAPI Eina_List *e_border_client_list(void);
|
|||
EAPI void e_border_act_move_keyboard(E_Border *bd);
|
||||
EAPI void e_border_act_resize_keyboard(E_Border *bd);
|
||||
|
||||
EAPI void e_border_act_move_begin(E_Border *bd, Ecore_Event_Mouse_Button *ev);
|
||||
EAPI void e_border_act_move_end(E_Border *bd, Ecore_Event_Mouse_Button *ev);
|
||||
EAPI void e_border_act_resize_begin(E_Border *bd, Ecore_Event_Mouse_Button *ev);
|
||||
EAPI void e_border_act_resize_end(E_Border *bd, Ecore_Event_Mouse_Button *ev);
|
||||
EAPI void e_border_act_menu_begin(E_Border *bd, Ecore_Event_Mouse_Button *ev, int key);
|
||||
EAPI void e_border_act_move_begin(E_Border *bd, E_Binding_Event_Mouse_Button *ev);
|
||||
EAPI void e_border_act_move_end(E_Border *bd, E_Binding_Event_Mouse_Button *ev);
|
||||
EAPI void e_border_act_resize_begin(E_Border *bd, E_Binding_Event_Mouse_Button *ev);
|
||||
EAPI void e_border_act_resize_end(E_Border *bd, E_Binding_Event_Mouse_Button *ev);
|
||||
EAPI void e_border_act_menu_begin(E_Border *bd, E_Binding_Event_Mouse_Button *ev, int key);
|
||||
EAPI void e_border_act_close_begin(E_Border *bd);
|
||||
EAPI void e_border_act_kill_begin(E_Border *bd);
|
||||
|
||||
|
|
546
src/bin/e_comp.c
546
src/bin/e_comp.c
|
@ -5,6 +5,7 @@
|
|||
|
||||
#define ACTION_TIMEOUT 30.0
|
||||
#define OVER_FLOW 1
|
||||
//#define SHAPE_DEBUG
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
@ -52,6 +53,20 @@ static int _e_comp_log_dom = -1;
|
|||
#undef CRI
|
||||
|
||||
#if 1
|
||||
# ifdef SHAPE_DEBUG
|
||||
# define SHAPE_DBG(...) EINA_LOG_DOM_DBG(_e_comp_log_dom, __VA_ARGS__)
|
||||
# define SHAPE_INF(...) EINA_LOG_DOM_INFO(_e_comp_log_dom, __VA_ARGS__)
|
||||
# define SHAPE_WRN(...) EINA_LOG_DOM_WARN(_e_comp_log_dom, __VA_ARGS__)
|
||||
# define SHAPE_ERR(...) EINA_LOG_DOM_ERR(_e_comp_log_dom, __VA_ARGS__)
|
||||
# define SHAPE_CRI(...) EINA_LOG_DOM_CRIT(_e_comp_log_dom, __VA_ARGS__)
|
||||
# else
|
||||
# define SHAPE_DBG(f, x ...)
|
||||
# define SHAPE_INF(f, x ...)
|
||||
# define SHAPE_WRN(f, x ...)
|
||||
# define SHAPE_ERR(f, x ...)
|
||||
# define SHAPE_CRI(f, x ...)
|
||||
# endif
|
||||
|
||||
#define DBG(...) EINA_LOG_DOM_DBG(_e_comp_log_dom, __VA_ARGS__)
|
||||
#define INF(...) EINA_LOG_DOM_INFO(_e_comp_log_dom, __VA_ARGS__)
|
||||
#define WRN(...) EINA_LOG_DOM_WARN(_e_comp_log_dom, __VA_ARGS__)
|
||||
|
@ -76,6 +91,7 @@ static void _e_comp_win_show(E_Comp_Win *cw);
|
|||
static void _e_comp_win_real_hide(E_Comp_Win *cw);
|
||||
static void _e_comp_win_hide(E_Comp_Win *cw);
|
||||
static void _e_comp_win_configure(E_Comp_Win *cw, int x, int y, int w, int h, int border);
|
||||
static void _e_comp_shapes_update(void *data, E_Container_Shape *es, E_Container_Shape_Change ch);
|
||||
|
||||
static void
|
||||
_e_comp_event_end(void *d EINA_UNUSED, E_Event_Comp *ev)
|
||||
|
@ -405,9 +421,17 @@ _e_comp_win_restack(E_Comp_Win *cw)
|
|||
if (prev) cwp = EINA_INLIST_CONTAINER_GET(prev, E_Comp_Win);
|
||||
|
||||
if (cwp)
|
||||
e_layout_child_raise_above(cw->shobj, cwp->shobj);
|
||||
{
|
||||
e_layout_child_raise_above(cw->shobj, cwp->shobj);
|
||||
cw->c->wins = eina_inlist_remove(cw->c->wins, EINA_INLIST_GET(cw));
|
||||
cw->c->wins = eina_inlist_append_relative(cw->c->wins, EINA_INLIST_GET(cw), EINA_INLIST_GET(cwp));
|
||||
}
|
||||
else if (cwn)
|
||||
e_layout_child_raise_above(cw->shobj, cwn->shobj);
|
||||
{
|
||||
e_layout_child_raise_above(cw->shobj, cwn->shobj);
|
||||
cw->c->wins = eina_inlist_remove(cw->c->wins, EINA_INLIST_GET(cw));
|
||||
cw->c->wins = eina_inlist_append_relative(cw->c->wins, EINA_INLIST_GET(cw), EINA_INLIST_GET(cwn));
|
||||
}
|
||||
if (cw->bd)
|
||||
{
|
||||
E_Border *tmp;
|
||||
|
@ -419,6 +443,8 @@ _e_comp_win_restack(E_Comp_Win *cw)
|
|||
tcw = eina_hash_find(borders, e_util_winid_str_get(tmp->client.win));
|
||||
if (!tcw) continue;
|
||||
e_layout_child_lower_below(tcw->shobj, cw->shobj);
|
||||
cw->c->wins = eina_inlist_remove(cw->c->wins, EINA_INLIST_GET(tcw));
|
||||
cw->c->wins = eina_inlist_prepend_relative(cw->c->wins, EINA_INLIST_GET(tcw), EINA_INLIST_GET(cw));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -435,7 +461,7 @@ _e_comp_win_update(E_Comp_Win *cw)
|
|||
{
|
||||
Eina_List *l;
|
||||
Evas_Object *o;
|
||||
E_Update_Rect *r;
|
||||
E_Comp_Render_Update_Rect *r;
|
||||
int i;
|
||||
int pshaped = cw->shaped;
|
||||
|
||||
|
@ -544,8 +570,8 @@ _e_comp_win_update(E_Comp_Win *cw)
|
|||
ecore_x_e_comp_pixmap_set(cw->win, cw->pixmap);
|
||||
cw->native = 0;
|
||||
DBG(" [0x%x] up resize %ix%i", cw->win, cw->pw, cw->ph);
|
||||
e_comp_update_resize(cw->up, cw->pw, cw->ph);
|
||||
e_comp_update_add(cw->up, 0, 0, cw->pw, cw->ph);
|
||||
e_comp_render_update_resize(cw->up, cw->pw, cw->ph);
|
||||
e_comp_render_update_add(cw->up, 0, 0, cw->pw, cw->ph);
|
||||
if (oldpm)
|
||||
{
|
||||
DBG(" [0x%x] free pm %x", cw->win, oldpm);
|
||||
|
@ -607,10 +633,10 @@ _e_comp_win_update(E_Comp_Win *cw)
|
|||
evas_object_image_native_surface_set(o, &ns);
|
||||
}
|
||||
}
|
||||
r = e_comp_update_rects_get(cw->up);
|
||||
r = e_comp_render_update_rects_get(cw->up);
|
||||
if (r)
|
||||
{
|
||||
e_comp_update_clear(cw->up);
|
||||
e_comp_render_update_clear(cw->up);
|
||||
for (i = 0; r[i].w > 0; i++)
|
||||
{
|
||||
int x, y, w, h;
|
||||
|
@ -663,9 +689,9 @@ _e_comp_win_update(E_Comp_Win *cw)
|
|||
if (!cw->xim)
|
||||
{
|
||||
if ((cw->xim = ecore_x_image_new(cw->pw, cw->ph, cw->vis, cw->depth)))
|
||||
e_comp_update_add(cw->up, 0, 0, cw->pw, cw->ph);
|
||||
e_comp_render_update_add(cw->up, 0, 0, cw->pw, cw->ph);
|
||||
}
|
||||
r = e_comp_update_rects_get(cw->up);
|
||||
r = e_comp_render_update_rects_get(cw->up);
|
||||
if (r)
|
||||
{
|
||||
if (cw->xim)
|
||||
|
@ -683,7 +709,7 @@ _e_comp_win_update(E_Comp_Win *cw)
|
|||
evas_object_image_size_set(o, cw->pw, cw->ph);
|
||||
}
|
||||
|
||||
e_comp_update_clear(cw->up);
|
||||
e_comp_render_update_clear(cw->up);
|
||||
for (i = 0; r[i].w > 0; i++)
|
||||
{
|
||||
int x, y, w, h;
|
||||
|
@ -693,7 +719,7 @@ _e_comp_win_update(E_Comp_Win *cw)
|
|||
if (!ecore_x_image_get(cw->xim, cw->pixmap, x, y, x, y, w, h))
|
||||
{
|
||||
WRN("UPDATE [0x%x] %i %i %ix%i FAIL!!!!!!!!!!!!!!!!!", cw->win, x, y, w, h);
|
||||
e_comp_update_add(cw->up, x, y, w, h);
|
||||
e_comp_render_update_add(cw->up, x, y, w, h);
|
||||
cw->update = 1;
|
||||
}
|
||||
else
|
||||
|
@ -725,7 +751,7 @@ _e_comp_win_update(E_Comp_Win *cw)
|
|||
evas_object_image_size_set(o, cw->pw, cw->ph);
|
||||
}
|
||||
|
||||
e_comp_update_clear(cw->up);
|
||||
e_comp_render_update_clear(cw->up);
|
||||
for (i = 0; r[i].w > 0; i++)
|
||||
{
|
||||
int x, y, w, h;
|
||||
|
@ -735,7 +761,7 @@ _e_comp_win_update(E_Comp_Win *cw)
|
|||
if (!ecore_x_image_get(cw->xim, cw->pixmap, x, y, x, y, w, h))
|
||||
{
|
||||
WRN("UPDATE [0x%x] %i %i %ix%i FAIL!!!!!!!!!!!!!!!!!", cw->win, x, y, w, h);
|
||||
e_comp_update_add(cw->up, x, y, w, h);
|
||||
e_comp_render_update_add(cw->up, x, y, w, h);
|
||||
cw->update = 1;
|
||||
}
|
||||
else
|
||||
|
@ -852,14 +878,14 @@ _e_comp_fps_update(E_Comp *c)
|
|||
{
|
||||
c->fps_bg = evas_object_rectangle_add(c->evas);
|
||||
evas_object_color_set(c->fps_bg, 0, 0, 0, 128);
|
||||
evas_object_layer_set(c->fps_bg, EVAS_LAYER_MAX);
|
||||
E_LAYER_SET_ABOVE(c->fps_bg, E_COMP_CANVAS_LAYER_MAX);
|
||||
evas_object_show(c->fps_bg);
|
||||
|
||||
c->fps_fg = evas_object_text_add(c->evas);
|
||||
evas_object_text_font_set(c->fps_fg, "Sans", 10);
|
||||
evas_object_text_text_set(c->fps_fg, "???");
|
||||
evas_object_color_set(c->fps_fg, 255, 255, 255, 255);
|
||||
evas_object_layer_set(c->fps_fg, EVAS_LAYER_MAX);
|
||||
E_LAYER_SET_ABOVE(c->fps_fg, E_COMP_CANVAS_LAYER_MAX);
|
||||
evas_object_show(c->fps_fg);
|
||||
}
|
||||
}
|
||||
|
@ -945,8 +971,8 @@ _e_comp_win_adopt(E_Comp_Win *cw)
|
|||
cw->c->updates = eina_list_append(cw->c->updates, cw);
|
||||
}
|
||||
cw->redirected = 1;
|
||||
e_comp_update_resize(cw->up, cw->pw, cw->ph);
|
||||
e_comp_update_add(cw->up, 0, 0, cw->pw, cw->ph);
|
||||
e_comp_render_update_resize(cw->up, cw->pw, cw->ph);
|
||||
e_comp_render_update_add(cw->up, 0, 0, cw->pw, cw->ph);
|
||||
_e_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0);
|
||||
_e_comp_win_render_queue(cw);
|
||||
}
|
||||
|
@ -1044,8 +1070,8 @@ _e_comp_cb_nocomp_end(E_Comp *c)
|
|||
{
|
||||
cw->nocomp_need_update = EINA_FALSE;
|
||||
|
||||
e_comp_update_resize(cw->up, cw->pw, cw->ph);
|
||||
e_comp_update_add(cw->up, 0, 0, cw->pw, cw->ph);
|
||||
e_comp_render_update_resize(cw->up, cw->pw, cw->ph);
|
||||
e_comp_render_update_add(cw->up, 0, 0, cw->pw, cw->ph);
|
||||
}
|
||||
_e_comp_win_adopt(cw);
|
||||
continue;
|
||||
|
@ -1831,7 +1857,7 @@ _e_comp_win_add(E_Comp *c, Ecore_X_Window win)
|
|||
{
|
||||
eina_hash_add(borders, e_util_winid_str_get(cw->bd->client.win), cw);
|
||||
cw->dfn = e_object_delfn_add(E_OBJECT(cw->bd), _e_comp_object_del, cw);
|
||||
|
||||
cw->shape = cw->bd->shape;
|
||||
// setup on show
|
||||
// _e_comp_win_sync_setup(cw, cw->bd->client.win);
|
||||
}
|
||||
|
@ -1839,11 +1865,13 @@ _e_comp_win_add(E_Comp *c, Ecore_X_Window win)
|
|||
{
|
||||
cw->dfn = e_object_delfn_add(E_OBJECT(cw->pop), _e_comp_object_del, cw);
|
||||
cw->show_ready = 1;
|
||||
cw->shape = cw->pop->shape;
|
||||
}
|
||||
else if ((cw->menu = e_menu_find_by_window(cw->win)))
|
||||
{
|
||||
cw->dfn = e_object_delfn_add(E_OBJECT(cw->menu), _e_comp_object_del, cw);
|
||||
cw->show_ready = 1;
|
||||
cw->shape = cw->menu->shape;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1865,6 +1893,7 @@ _e_comp_win_add(E_Comp *c, Ecore_X_Window win)
|
|||
con = e_util_container_current_get();
|
||||
cw->bg_win = (con && (cw->win == con->bg_win));
|
||||
}
|
||||
cw->free_shape = 1;
|
||||
// setup on show
|
||||
// _e_comp_win_sync_setup(cw, cw->win);
|
||||
}
|
||||
|
@ -1961,15 +1990,15 @@ _e_comp_win_add(E_Comp *c, Ecore_X_Window win)
|
|||
}
|
||||
evas_object_pass_events_set(cw->shobj, 1);
|
||||
evas_object_data_set(cw->shobj, "win", (void *)((unsigned long)cw->win));
|
||||
evas_object_data_set(cw->shobj, "src", cw);
|
||||
evas_object_data_set(cw->shobj, "comp_win", cw);
|
||||
|
||||
c->wins_invalid = 1;
|
||||
c->wins = eina_inlist_append(c->wins, EINA_INLIST_GET(cw));
|
||||
cw->up = e_comp_update_new();
|
||||
e_comp_update_tile_size_set(cw->up, 32, 32);
|
||||
cw->up = e_comp_render_update_new();
|
||||
e_comp_render_update_tile_size_set(cw->up, 32, 32);
|
||||
// for software:
|
||||
e_comp_update_policy_set
|
||||
(cw->up, E_UPDATE_POLICY_HALF_WIDTH_OR_MORE_ROUND_UP_TO_FULL_WIDTH);
|
||||
e_comp_render_update_policy_set
|
||||
(cw->up, E_COMP_RENDER_UPDATE_POLICY_HALF_WIDTH_OR_MORE_ROUND_UP_TO_FULL_WIDTH);
|
||||
if (((!cw->input_only) && (!cw->invalid)) && (cw->override))
|
||||
{
|
||||
cw->redirected = 1;
|
||||
|
@ -1999,7 +2028,7 @@ _e_comp_win_del(E_Comp_Win *cw)
|
|||
_e_comp_event_source_del(cw);
|
||||
}
|
||||
|
||||
e_comp_update_free(cw->up);
|
||||
e_comp_render_update_free(cw->up);
|
||||
DBG(" [0x%x] del", cw->win);
|
||||
E_FREE(cw->rects);
|
||||
if (cw->update_timeout)
|
||||
|
@ -2060,6 +2089,8 @@ _e_comp_win_del(E_Comp_Win *cw)
|
|||
cw->shobj = NULL;
|
||||
}
|
||||
|
||||
if (cw->free_shape) E_FN_DEL(e_object_del, cw->shape);
|
||||
|
||||
if (cw->inhash)
|
||||
eina_hash_del(windows, e_util_winid_str_get(cw->win), cw);
|
||||
|
||||
|
@ -2176,8 +2207,8 @@ _e_comp_win_show(E_Comp_Win *cw)
|
|||
}
|
||||
cw->redirected = 1;
|
||||
DBG(" [0x%x] up resize %ix%i", cw->win, cw->pw, cw->ph);
|
||||
e_comp_update_resize(cw->up, cw->pw, cw->ph);
|
||||
e_comp_update_add(cw->up, 0, 0, cw->pw, cw->ph);
|
||||
e_comp_render_update_resize(cw->up, cw->pw, cw->ph);
|
||||
e_comp_render_update_add(cw->up, 0, 0, cw->pw, cw->ph);
|
||||
evas_object_image_size_set(cw->obj, cw->pw, cw->ph);
|
||||
EINA_LIST_FOREACH(cw->obj_mirror, l, o)
|
||||
{
|
||||
|
@ -2201,6 +2232,9 @@ _e_comp_win_show(E_Comp_Win *cw)
|
|||
_e_comp_event_source_visibility(cw);
|
||||
}
|
||||
_e_comp_win_render_queue(cw);
|
||||
if (!cw->shape) return;
|
||||
cw->shape->visible = 0;
|
||||
e_container_shape_show(cw->shape);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2238,6 +2272,7 @@ _e_comp_win_hide(E_Comp_Win *cw)
|
|||
|
||||
cw->pending_count++;
|
||||
_e_comp_event_source_visibility(cw);
|
||||
if (cw->shape) e_container_shape_hide(cw->shape);
|
||||
return;
|
||||
}
|
||||
cw->defer_hide = 0;
|
||||
|
@ -2480,7 +2515,7 @@ _e_comp_win_damage(E_Comp_Win *cw, int x, int y, int w, int h, Eina_Bool dmg)
|
|||
cw->nocomp_need_update = EINA_TRUE;
|
||||
return;
|
||||
}
|
||||
e_comp_update_add(cw->up, x, y, w, h);
|
||||
e_comp_render_update_add(cw->up, x, y, w, h);
|
||||
if (dmg)
|
||||
{
|
||||
if (cw->counter)
|
||||
|
@ -2514,12 +2549,11 @@ _e_comp_win_reshape(E_Comp_Win *cw)
|
|||
cw->update = 1;
|
||||
cw->c->updates = eina_list_append(cw->c->updates, cw);
|
||||
}
|
||||
e_comp_update_add(cw->up, 0, 0, cw->w, cw->h);
|
||||
e_comp_render_update_add(cw->up, 0, 0, cw->w, cw->h);
|
||||
_e_comp_win_render_queue(cw);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static Eina_Bool
|
||||
_e_comp_create(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
|
@ -2531,7 +2565,23 @@ _e_comp_create(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
|||
if (c->win == ev->win) return ECORE_CALLBACK_PASS_ON;
|
||||
if (c->ee_win == ev->win) return ECORE_CALLBACK_PASS_ON;
|
||||
cw = _e_comp_win_add(c, ev->win);
|
||||
if (cw) _e_comp_win_configure(cw, ev->x, ev->y, ev->w, ev->h, ev->border);
|
||||
if (!cw) return ECORE_CALLBACK_RENEW;
|
||||
_e_comp_win_configure(cw, ev->x, ev->y, ev->w, ev->h, ev->border);
|
||||
|
||||
if (cw->free_shape)
|
||||
{
|
||||
Eina_List *l;
|
||||
E_Container *con;
|
||||
|
||||
EINA_LIST_FOREACH(c->man->containers, l, con)
|
||||
{
|
||||
if (!E_INSIDE(ev->x, ev->y, con->x, con->y, con->w, con->h)) continue;
|
||||
cw->shape = e_container_shape_add(con);
|
||||
break;
|
||||
}
|
||||
if (!cw->shape) cw->shape = e_container_shape_add(eina_list_data_get(c->man->containers));
|
||||
}
|
||||
cw->shape->comp_win = cw;
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
|
@ -2566,6 +2616,7 @@ _e_comp_hide(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
|||
if (!cw) return ECORE_CALLBACK_PASS_ON;
|
||||
if (!cw->visible) return ECORE_CALLBACK_PASS_ON;
|
||||
_e_comp_win_real_hide(cw);
|
||||
if (cw->free_shape) e_container_shape_hide(cw->shape);
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
|
@ -2609,6 +2660,14 @@ _e_comp_configure(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
|||
(cw->border == ev->border)))
|
||||
{
|
||||
_e_comp_win_configure(cw, ev->x, ev->y, ev->w, ev->h, ev->border);
|
||||
if (cw->free_shape)
|
||||
{
|
||||
if (cw->visible)
|
||||
e_container_shape_move(cw->shape, cw->x, cw->y);
|
||||
else
|
||||
e_container_shape_move(cw->shape, cw->hidden.x, cw->hidden.y);
|
||||
e_container_shape_resize(cw->shape, cw->w, cw->h);
|
||||
}
|
||||
}
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
@ -2930,39 +2989,6 @@ _e_comp_screensaver_off(void *data EINA_UNUSED, int type EINA_UNUSED, void *even
|
|||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_comp_zone_fill(E_Comp *c, E_Comp_Zone *cz)
|
||||
{
|
||||
Evas_Object *o;
|
||||
const char *const styles[] =
|
||||
{
|
||||
"e/modules/comp/screen/overlay/default",
|
||||
"e/modules/comp/screen/overlay/noeffects"
|
||||
};
|
||||
|
||||
if (cz->over)
|
||||
{
|
||||
e_theme_edje_object_set(cz->over, "base/theme/modules/comp",
|
||||
styles[conf->disable_screen_effects]);
|
||||
return;
|
||||
}
|
||||
cz->base = o = edje_object_add(c->evas);
|
||||
e_theme_edje_object_set(o, "base/theme/modules/comp",
|
||||
"e/modules/comp/screen/base/default");
|
||||
evas_object_move(o, cz->zone->x, cz->zone->y);
|
||||
evas_object_resize(o, cz->zone->w, cz->zone->h);
|
||||
evas_object_lower(o);
|
||||
evas_object_show(o);
|
||||
|
||||
cz->over = o = edje_object_add(c->evas);
|
||||
e_theme_edje_object_set(o, "base/theme/modules/comp",
|
||||
styles[conf->disable_screen_effects]);
|
||||
evas_object_move(o, cz->zone->x, cz->zone->y);
|
||||
evas_object_resize(o, cz->zone->w, cz->zone->h);
|
||||
evas_object_raise(o);
|
||||
evas_object_show(o);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_comp_screens_eval(E_Comp *c)
|
||||
{
|
||||
|
@ -2970,7 +2996,6 @@ _e_comp_screens_eval(E_Comp *c)
|
|||
E_Container *con;
|
||||
E_Zone *zone;
|
||||
E_Comp_Zone *cz;
|
||||
int zn, cn;
|
||||
|
||||
EINA_LIST_FREE(c->zones, cz)
|
||||
{
|
||||
|
@ -2982,30 +3007,26 @@ _e_comp_screens_eval(E_Comp *c)
|
|||
e_backlight_mode_set(cz->zone, E_BACKLIGHT_MODE_NORMAL);
|
||||
e_backlight_level_set(cz->zone, e_config->backlight.normal, 0.0);
|
||||
}
|
||||
if (cz->zone) cz->zone->comp_zone = NULL;
|
||||
free(cz);
|
||||
}
|
||||
cn = 0;
|
||||
EINA_LIST_FOREACH(c->man->containers, l, con)
|
||||
{
|
||||
zn = 0;
|
||||
EINA_LIST_FOREACH(con->zones, ll, zone)
|
||||
{
|
||||
cz = calloc(1, sizeof(E_Comp_Zone));
|
||||
if (cz)
|
||||
{
|
||||
cz->zone = zone;
|
||||
cz->container_num = cn;
|
||||
cz->zone_num = zn;
|
||||
cz->x = zone->x;
|
||||
cz->y = zone->y;
|
||||
cz->w = zone->w;
|
||||
cz->h = zone->h;
|
||||
_e_comp_zone_fill(c, cz);
|
||||
c->zones = eina_list_append(c->zones, cz);
|
||||
}
|
||||
zn++;
|
||||
cz = E_NEW(E_Comp_Zone, 1);
|
||||
cz->zone = zone;
|
||||
cz->comp = c;
|
||||
zone->comp_zone = cz;
|
||||
cz->container_num = zone->container->num;
|
||||
cz->zone_num = zone->num;
|
||||
cz->x = zone->x;
|
||||
cz->y = zone->y;
|
||||
cz->w = zone->w;
|
||||
cz->h = zone->h;
|
||||
e_comp_zone_update(cz);
|
||||
c->zones = eina_list_append(c->zones, cz);
|
||||
}
|
||||
cn++;
|
||||
}
|
||||
e_layout_freeze(c->layout);
|
||||
evas_object_move(c->layout, 0, 0);
|
||||
|
@ -3223,6 +3244,219 @@ _e_comp_bd_unfullscreen(void *data EINA_UNUSED, int type EINA_UNUSED, void *even
|
|||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
#ifdef SHAPE_DEBUG
|
||||
static void
|
||||
_e_comp_shape_debug_rect(E_Comp *c, Ecore_X_Rectangle *rect, E_Color *color)
|
||||
{
|
||||
Evas_Object *o;
|
||||
|
||||
#define COLOR_INCREMENT 30
|
||||
o = evas_object_rectangle_add(c->evas);
|
||||
if (color->r < 256 - COLOR_INCREMENT)
|
||||
evas_object_color_set(o, (color->r += COLOR_INCREMENT), 0, 0, 255);
|
||||
else if (color->g < 256 - COLOR_INCREMENT)
|
||||
evas_object_color_set(o, 0, (color->g += COLOR_INCREMENT), 0, 255);
|
||||
else
|
||||
evas_object_color_set(o, 0, 0, (color->b += COLOR_INCREMENT), 255);
|
||||
evas_object_repeat_events_set(o, 1);
|
||||
evas_object_raise(o);
|
||||
e_layout_pack(c->layout, o);
|
||||
e_layout_child_move(o, rect->x, rect->y);
|
||||
e_layout_child_resize(o, rect->width, rect->height);
|
||||
e_layout_child_raise(o);
|
||||
c->debug_rects = eina_list_append(c->debug_rects, o);
|
||||
evas_object_show(o);
|
||||
}
|
||||
#endif
|
||||
|
||||
static Eina_Bool
|
||||
_e_comp_shapes_update_object_checker_function_thingy(E_Comp *c, Evas_Object *o)
|
||||
{
|
||||
Eina_List *l, *ll;
|
||||
E_Container *con;
|
||||
E_Zone *zone;
|
||||
E_Comp_Zone *cz;
|
||||
|
||||
EINA_LIST_FOREACH(c->zones, l, cz)
|
||||
if ((o == cz->over) || (o == cz->base)) return EINA_TRUE;
|
||||
EINA_LIST_FOREACH(c->man->containers, l, con)
|
||||
{
|
||||
if (o == con->bg_blank_object) return EINA_TRUE;
|
||||
EINA_LIST_FOREACH(con->zones, ll, zone)
|
||||
if ((o == zone->bg_object) || (o == zone->bg_event_object) ||
|
||||
(o == zone->bg_clip_object) || (o == zone->prev_bg_object) ||
|
||||
(o == zone->transition_object))
|
||||
return EINA_TRUE;
|
||||
}
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_comp_shapes_update_job(E_Comp *c)
|
||||
{
|
||||
Eina_Tiler *tb;
|
||||
Evas_Object *o;
|
||||
Eina_Rectangle *tr;
|
||||
Eina_Iterator *ti;
|
||||
Ecore_X_Rectangle *exr;
|
||||
unsigned int i, tile_count;
|
||||
int x, y, w, h;
|
||||
Eina_Bool layout = EINA_FALSE;
|
||||
#ifdef SHAPE_DEBUG
|
||||
Eina_Rectangle *r;
|
||||
Eina_List *rl = NULL;
|
||||
E_Color color = {0};
|
||||
#endif
|
||||
|
||||
E_FREE_LIST(c->debug_rects, evas_object_del);
|
||||
tb = eina_tiler_new(c->man->w, c->man->h);
|
||||
eina_tiler_tile_size_set(tb, 1, 1);
|
||||
eina_tiler_rect_add(tb, &(Eina_Rectangle){c->man->x, c->man->y, c->man->w, c->man->h});
|
||||
o = evas_object_bottom_get(c->evas);
|
||||
for (; o; o = evas_object_above_get(o))
|
||||
{
|
||||
if (o == c->layout)
|
||||
{
|
||||
Evas_Object *ch;
|
||||
Eina_List *l;
|
||||
|
||||
layout = EINA_TRUE; //ignore all objects under layout
|
||||
l = e_layout_children_get(o);
|
||||
EINA_LIST_FREE(l, ch)
|
||||
{
|
||||
E_Comp_Win *cw;
|
||||
|
||||
cw = evas_object_data_get(ch, "comp_win");
|
||||
if (cw)
|
||||
{
|
||||
/* ignore deleted shapes */
|
||||
if (!cw->shape)
|
||||
{
|
||||
SHAPE_INF("IGNORING DELETED: %u", cw->win);
|
||||
continue;
|
||||
}
|
||||
if (cw->invalid || cw->real_hid || (!cw->visible) || (!cw->shape->visible)) continue;
|
||||
#ifdef SHAPE_DEBUG
|
||||
if (cw->bd)
|
||||
INF("COMP BD: %u", cw->win);
|
||||
else if (cw->pop)
|
||||
INF("COMP POP: %u", cw->win);
|
||||
else if (cw->menu)
|
||||
INF("COMP MENU: %u", cw->win);
|
||||
#endif
|
||||
/* borders and popups sometimes call shape changes before the changes have
|
||||
* propagated to the comp_win :/
|
||||
*/
|
||||
if (cw->bd)
|
||||
x = cw->bd->x, y = cw->bd->y, w = cw->bd->w, h = cw->bd->h;
|
||||
else if (cw->pop)
|
||||
x = cw->pop->x + cw->pop->zone->x, y = cw->pop->y + cw->pop->zone->y, w = cw->pop->w, h = cw->pop->h;
|
||||
/*
|
||||
else if (cw->menu)
|
||||
x = cw->menu->cur.x, y = cw->menu->cur.y, w = cw->menu->cur.w, h = cw->menu->cur.h;
|
||||
*/
|
||||
else
|
||||
x = cw->x, y = cw->y, w = cw->w, h = cw->h;
|
||||
#ifdef SHAPE_DEBUG
|
||||
r = E_NEW(Eina_Rectangle, 1);
|
||||
EINA_RECTANGLE_SET(r, x, y, w, h);
|
||||
rl = eina_list_append(rl, r);
|
||||
#endif
|
||||
eina_tiler_rect_del(tb, &(Eina_Rectangle){x, y, w, h});
|
||||
SHAPE_INF("DEL: %d,%d@%dx%d", x, y, w, h);
|
||||
}
|
||||
else if (evas_object_visible_get(ch))
|
||||
{
|
||||
evas_object_geometry_get(o, &x, &y, &w, &h);
|
||||
eina_tiler_rect_add(tb, &(Eina_Rectangle){x, y, w, h});
|
||||
SHAPE_INF("ADD: %d,%d@%dx%d", x, y, w, h);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else if (layout && evas_object_visible_get(o))
|
||||
{
|
||||
if (_e_comp_shapes_update_object_checker_function_thingy(c, o)) continue;
|
||||
SHAPE_INF("OBJ: %p:%s", o, evas_object_name_get(o));
|
||||
evas_object_geometry_get(o, &x, &y, &w, &h);
|
||||
eina_tiler_rect_add(tb, &(Eina_Rectangle){x, y, w, h});
|
||||
SHAPE_INF("ADD: %d,%d@%dx%d", x, y, w, h);
|
||||
}
|
||||
}
|
||||
|
||||
ti = eina_tiler_iterator_new(tb);
|
||||
tile_count = 128;
|
||||
exr = malloc(sizeof(Ecore_X_Rectangle) * tile_count);
|
||||
i = 0;
|
||||
EINA_ITERATOR_FOREACH(ti, tr)
|
||||
{
|
||||
exr[i++] = *(Ecore_X_Rectangle*)((char*)tr);
|
||||
if (i == tile_count - 1)
|
||||
exr = realloc(exr, sizeof(Ecore_X_Rectangle) * (tile_count *= 2));
|
||||
#ifdef SHAPE_DEBUG
|
||||
Eina_List *l;
|
||||
|
||||
_e_comp_shape_debug_rect(c, &exr[i - 1], &color);
|
||||
INF("%d,%d @ %dx%d", exr[i - 1].x, exr[i - 1].y, exr[i - 1].width, exr[i - 1].height);
|
||||
EINA_LIST_FOREACH(rl, l, r)
|
||||
{
|
||||
if (E_INTERSECTS(r->x, r->y, r->w, r->h, tr->x, tr->y, tr->w, tr->h))
|
||||
ERR("RECT FAIL!!!!");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
ecore_x_window_shape_input_rectangles_set(c->win, exr, i);
|
||||
#ifdef SHAPE_DEBUG
|
||||
E_FREE_LIST(rl, free);
|
||||
printf("\n");
|
||||
#endif
|
||||
free(exr);
|
||||
eina_iterator_free(ti);
|
||||
eina_tiler_free(tb);
|
||||
c->shape_job = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_comp_shapes_update(void *data, E_Container_Shape *es, E_Container_Shape_Change change)
|
||||
{
|
||||
E_Comp *c = data;
|
||||
#ifdef SHAPE_DEBUG
|
||||
const char const *change_text[] =
|
||||
{
|
||||
"ADD",
|
||||
"DEL",
|
||||
"SHOW",
|
||||
"HIDE",
|
||||
"MOVE",
|
||||
"RESIZE",
|
||||
"RECTS"
|
||||
};
|
||||
#endif
|
||||
|
||||
if (change == E_CONTAINER_SHAPE_ADD) return;
|
||||
if (es)
|
||||
{
|
||||
if (!es->comp_win) return;
|
||||
switch (change)
|
||||
{
|
||||
/* these need to always get through since
|
||||
* it's guaranteed input shape will change when they occur
|
||||
*/
|
||||
case E_CONTAINER_SHAPE_SHOW:
|
||||
case E_CONTAINER_SHAPE_HIDE:
|
||||
case E_CONTAINER_SHAPE_DEL:
|
||||
break;
|
||||
default:
|
||||
/* any other changes only matter if the
|
||||
* object is visible
|
||||
*/
|
||||
if (!es->visible) return;
|
||||
}
|
||||
}
|
||||
SHAPE_INF("RESHAPE %u: %s", es->comp_win->win, change_text[change]);
|
||||
if (!c->shape_job) c->shape_job = ecore_job_add((Ecore_Cb)_e_comp_shapes_update_job, c);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static void
|
||||
_e_comp_fps_toggle(void)
|
||||
|
@ -3280,8 +3514,22 @@ static void
|
|||
_e_comp_populate(E_Comp *c)
|
||||
{
|
||||
Ecore_X_Window *wins;
|
||||
Eina_List *l;
|
||||
E_Container *con;
|
||||
int i, num;
|
||||
|
||||
c->layout = e_layout_add(c->evas);
|
||||
evas_object_name_set(c->layout, "c->layout");
|
||||
E_LAYER_SET_ABOVE(c->layout, E_COMP_CANVAS_LAYER_LAYOUT);
|
||||
evas_object_show(c->layout);
|
||||
|
||||
EINA_LIST_FOREACH(c->man->containers, l, con)
|
||||
{
|
||||
e_container_shape_change_callback_add(con, _e_comp_shapes_update, c);
|
||||
ecore_x_window_configure(c->ee_win,
|
||||
ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE,
|
||||
0, 0, 0, 0, 0, con->layers[0].win, ECORE_X_WINDOW_STACK_BELOW);
|
||||
}
|
||||
wins = ecore_x_window_children_get(c->man->root, &num);
|
||||
if (!wins) return;
|
||||
for (i = 0; i < num; i++)
|
||||
|
@ -3312,6 +3560,17 @@ _e_comp_populate(E_Comp *c)
|
|||
_e_comp_win_configure(cw, x, y, w, h, border);
|
||||
if (ecore_x_window_visible_get(wins[i]))
|
||||
_e_comp_win_show(cw);
|
||||
if (cw->free_shape)
|
||||
{
|
||||
EINA_LIST_FOREACH(c->man->containers, l, con)
|
||||
{
|
||||
if (!E_INSIDE(x, y, con->x, con->y, con->w, con->h)) continue;
|
||||
cw->shape = e_container_shape_add(con);
|
||||
break;
|
||||
}
|
||||
if (!cw->shape) cw->shape = e_container_shape_add(eina_list_data_get(c->man->containers));
|
||||
}
|
||||
cw->shape->comp_win = cw;
|
||||
}
|
||||
free(wins);
|
||||
}
|
||||
|
@ -3433,16 +3692,18 @@ _e_comp_add(E_Manager *man)
|
|||
c->ee = ecore_evas_software_x11_new(NULL, c->win, 0, 0, man->w, man->h);
|
||||
}
|
||||
|
||||
{
|
||||
Ecore_X_Rectangle rect[1] = {{0}};
|
||||
|
||||
rect[0].width = man->w, rect[0].height = man->h;
|
||||
ecore_x_window_shape_input_rectangles_set(c->win, rect, 1);
|
||||
}
|
||||
ecore_evas_comp_sync_set(c->ee, 0);
|
||||
ecore_evas_name_class_set(c->ee, "E", "Comp_EE");
|
||||
// ecore_evas_manual_render_set(c->ee, conf->lock_fps);
|
||||
c->evas = ecore_evas_get(c->ee);
|
||||
ecore_evas_show(c->ee);
|
||||
|
||||
c->layout = e_layout_add(c->evas);
|
||||
evas_object_show(c->layout);
|
||||
|
||||
_e_comp_screens_eval(c);
|
||||
|
||||
c->ee_win = ecore_evas_window_get(c->ee);
|
||||
ecore_x_composite_redirect_subwindows
|
||||
(c->man->root, ECORE_X_COMPOSITE_UPDATE_MANUAL);
|
||||
|
@ -3467,24 +3728,20 @@ _e_comp_del(E_Comp *c)
|
|||
E_Comp_Zone *cz;
|
||||
Eina_List *l, *hide_bd = NULL;
|
||||
E_Border *bd;
|
||||
E_Container *con;
|
||||
|
||||
c->man->comp = NULL;
|
||||
EINA_LIST_FOREACH(c->man->containers, l, con)
|
||||
e_container_shape_change_callback_del(con, _e_comp_shapes_update, c);
|
||||
EINA_LIST_FOREACH(e_border_client_list(), l, bd)
|
||||
{
|
||||
if (!bd->visible)
|
||||
hide_bd = eina_list_append(hide_bd, bd);
|
||||
}
|
||||
|
||||
if (c->fps_fg)
|
||||
{
|
||||
evas_object_del(c->fps_fg);
|
||||
c->fps_fg = NULL;
|
||||
}
|
||||
if (c->fps_bg)
|
||||
{
|
||||
evas_object_del(c->fps_bg);
|
||||
c->fps_bg = NULL;
|
||||
}
|
||||
E_FN_DEL(evas_object_del, c->fps_fg);
|
||||
E_FN_DEL(evas_object_del, c->fps_bg);
|
||||
E_FN_DEL(ecore_job_del, c->shape_job);
|
||||
|
||||
ecore_x_window_key_ungrab(c->man->root, "F", ECORE_EVENT_MODIFIER_SHIFT |
|
||||
ECORE_EVENT_MODIFIER_CTRL |
|
||||
|
@ -3513,6 +3770,7 @@ _e_comp_del(E_Comp *c)
|
|||
|
||||
EINA_LIST_FREE(c->zones, cz)
|
||||
{
|
||||
if (cz->zone) cz->zone->comp_zone = NULL;
|
||||
evas_object_del(cz->base);
|
||||
evas_object_del(cz->over);
|
||||
if (cz->bloff)
|
||||
|
@ -3616,8 +3874,7 @@ _e_comp_sys_emit_cb_wait(E_Sys_Action a, const char *sig, const char *rep, Eina_
|
|||
else _e_comp_override_timed_pop(c);
|
||||
EINA_LIST_FOREACH(c->zones, ll, cz)
|
||||
{
|
||||
if (nocomp_push) _e_comp_fade_handle(cz, 1, 0.5);
|
||||
else _e_comp_fade_handle(cz, 0, 0.5);
|
||||
_e_comp_fade_handle(cz, nocomp_push, 0.5);
|
||||
edje_object_signal_emit(cz->base, sig, "e");
|
||||
edje_object_signal_emit(cz->over, sig, "e");
|
||||
if ((rep) && (first))
|
||||
|
@ -3760,7 +4017,7 @@ _e_comp_config_style_thumb_cb(E_Configure_Option_Info *oi, Evas *evas)
|
|||
|
||||
ofr = edje_object_add(evas);
|
||||
e_theme_edje_object_set
|
||||
(ofr, "base/theme/modules/comp", "e/modules/comp/preview");
|
||||
(ofr, "base/theme/comp", "e/comp/preview");
|
||||
edje_object_part_swallow(ofr, "e.swallow.preview", ob);
|
||||
evas_object_show(ofr);
|
||||
|
||||
|
@ -4100,18 +4357,16 @@ e_comp_config_get(void)
|
|||
EAPI void
|
||||
e_comp_shadows_reset(void)
|
||||
{
|
||||
Eina_List *l, *ll;
|
||||
Eina_List *l;
|
||||
E_Comp *c;
|
||||
|
||||
EINA_LIST_FOREACH(compositors, l, c)
|
||||
{
|
||||
E_Comp_Win *cw;
|
||||
E_Comp_Zone *cz;
|
||||
|
||||
// ecore_evas_manual_render_set(c->ee, conf->lock_fps);
|
||||
_e_comp_fps_update(c);
|
||||
EINA_LIST_FOREACH(c->zones, ll, cz)
|
||||
_e_comp_zone_fill(c, cz);
|
||||
E_LIST_FOREACH(c->zones, e_comp_zone_update);
|
||||
EINA_INLIST_FOREACH(c->wins, cw)
|
||||
{
|
||||
if ((cw->shobj) && (cw->obj))
|
||||
|
@ -4137,7 +4392,7 @@ e_comp_shadows_reset(void)
|
|||
}
|
||||
|
||||
EAPI void
|
||||
e_comp_update(E_Comp *c)
|
||||
e_comp_render_update(E_Comp *c)
|
||||
{
|
||||
_e_comp_render_queue(c);
|
||||
}
|
||||
|
@ -4210,7 +4465,7 @@ e_comp_get(void *o)
|
|||
E_Container *con = NULL;
|
||||
E_Manager *man = NULL;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
|
||||
if (!o) obj = (E_Object*)e_manager_current_get();
|
||||
switch (obj->type)
|
||||
{
|
||||
case E_BORDER_TYPE:
|
||||
|
@ -4232,3 +4487,80 @@ e_comp_get(void *o)
|
|||
CRI("UNIMPLEMENTED TYPE PASSED! FIXME!");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_comp_zone_update(E_Comp_Zone *cz)
|
||||
{
|
||||
Evas_Object *o;
|
||||
const char *const over_styles[] =
|
||||
{
|
||||
"e/comp/screen/overlay/default",
|
||||
"e/comp/screen/overlay/noeffects"
|
||||
};
|
||||
const char *const under_styles[] =
|
||||
{
|
||||
"e/comp/screen/base/default",
|
||||
"e/comp/screen/base/noeffects"
|
||||
};
|
||||
|
||||
if (cz->over && cz->base)
|
||||
{
|
||||
e_theme_edje_object_set(cz->base, "base/theme/comp",
|
||||
under_styles[conf->disable_screen_effects]);
|
||||
edje_object_part_swallow(cz->base, "e.swallow.background",
|
||||
cz->zone->transition_object ?: cz->zone->bg_object);
|
||||
e_theme_edje_object_set(cz->over, "base/theme/comp",
|
||||
over_styles[conf->disable_screen_effects]);
|
||||
return;
|
||||
}
|
||||
E_FN_DEL(evas_object_del, cz->base);
|
||||
E_FN_DEL(evas_object_del, cz->over);
|
||||
cz->base = o = edje_object_add(cz->comp->evas);
|
||||
evas_object_repeat_events_set(o, 1);
|
||||
evas_object_name_set(cz->base, "cz->base");
|
||||
e_theme_edje_object_set(o, "base/theme/comp", under_styles[conf->disable_screen_effects]);
|
||||
edje_object_part_swallow(cz->base, "e.swallow.background", cz->zone->transition_object ?: cz->zone->bg_object);
|
||||
evas_object_move(o, cz->zone->x, cz->zone->y);
|
||||
evas_object_resize(o, cz->zone->w, cz->zone->h);
|
||||
E_LAYER_SET(o, E_COMP_CANVAS_LAYER_BG);
|
||||
evas_object_show(o);
|
||||
|
||||
cz->over = o = edje_object_add(cz->comp->evas);
|
||||
E_LAYER_SET_ABOVE(o, E_COMP_CANVAS_LAYER_MAX);
|
||||
evas_object_name_set(cz->over, "cz->over");
|
||||
evas_object_pass_events_set(o, 1);
|
||||
e_theme_edje_object_set(o, "base/theme/comp", over_styles[conf->disable_screen_effects]);
|
||||
evas_object_move(o, cz->zone->x, cz->zone->y);
|
||||
evas_object_resize(o, cz->zone->w, cz->zone->h);
|
||||
evas_object_raise(o);
|
||||
evas_object_show(o);
|
||||
}
|
||||
|
||||
EAPI Ecore_X_Window
|
||||
e_comp_top_window_at_xy_get(E_Comp *c, Evas_Coord x, Evas_Coord y, Ecore_X_Window *ignore, unsigned int ignore_num)
|
||||
{
|
||||
E_Comp_Win *cw;
|
||||
Evas_Object *o;
|
||||
Eina_List *ignore_list = NULL;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(c, 0);
|
||||
o = evas_object_top_at_xy_get(c->evas, x, y, 0, 0);
|
||||
if (!o) return c->ee_win;
|
||||
if (o != c->layout) return c->ee_win;
|
||||
if (ignore && ignore_num)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < ignore_num; i++)
|
||||
{
|
||||
cw = e_comp_win_find(ignore[i]);
|
||||
if (cw)
|
||||
ignore_list = eina_list_append(ignore_list, cw->shobj);
|
||||
}
|
||||
}
|
||||
o = e_layout_top_child_at_xy_get(c->layout, x, y, ignore_list);
|
||||
eina_list_free(ignore_list);
|
||||
cw = evas_object_data_get(o, "comp_win");
|
||||
if (!cw) return c->ee_win;
|
||||
return cw->win;
|
||||
}
|
||||
|
|
|
@ -4,26 +4,63 @@ typedef struct _E_Comp_Win E_Comp_Win;
|
|||
typedef struct _E_Comp_Zone E_Comp_Zone;
|
||||
typedef struct E_Event_Comp E_Event_Comp;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
E_COMP_CANVAS_LAYER_BOTTOM = -100,
|
||||
E_COMP_CANVAS_LAYER_BG = -1, // zone bg stuff
|
||||
E_COMP_CANVAS_LAYER_DESKTOP = 0, // desktop objects: fileman, gadgets, shelves
|
||||
E_COMP_CANVAS_LAYER_LAYOUT = 100, // should be nothing else on this layer
|
||||
E_COMP_CANVAS_LAYER_ABOVE = 999,
|
||||
E_COMP_CANVAS_LAYER_MAX = 32767 // EVAS_LAYER_MAX
|
||||
} E_Comp_Canvas_Layer;
|
||||
|
||||
typedef enum _E_Layer
|
||||
{
|
||||
E_LAYER_DESKTOP = 0,
|
||||
E_LAYER_BELOW = 50,
|
||||
E_LAYER_NORMAL = 100,
|
||||
E_LAYER_ABOVE = 150,
|
||||
E_LAYER_EDGE = 200,
|
||||
E_LAYER_FULLSCREEN = 250,
|
||||
E_LAYER_EDGE_FULLSCREEN = 300,
|
||||
E_LAYER_POPUP = 300,
|
||||
E_LAYER_TOP = 350,
|
||||
E_LAYER_DRAG = 400,
|
||||
E_LAYER_PRIO = 450
|
||||
} E_Layer;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
E_COMP_CANVAS_STACK_UNDER = -1,
|
||||
E_COMP_CANVAS_STACK_NONE = 0,
|
||||
E_COMP_CANVAS_STACK_ABOVE = 1
|
||||
} E_Comp_Canvas_Stack;
|
||||
|
||||
#else
|
||||
#ifndef E_MOD_COMP_H
|
||||
#define E_MOD_COMP_H
|
||||
|
||||
# include "e_comp_cfdata.h"
|
||||
# include "e_comp_update.h"
|
||||
# include "e_comp_render_update.h"
|
||||
|
||||
|
||||
struct _E_Comp
|
||||
{
|
||||
Ecore_X_Window win; // input overlay
|
||||
Ecore_Evas *ee;
|
||||
Ecore_X_Window ee_win;
|
||||
Evas *evas;
|
||||
Evas_Object *layout;
|
||||
Eina_List *zones;
|
||||
E_Manager *man;
|
||||
|
||||
Eina_List *debug_rects;
|
||||
|
||||
Eina_Inlist *wins;
|
||||
Eina_List *wins_list;
|
||||
Eina_List *updates;
|
||||
Ecore_Animator *render_animator;
|
||||
Ecore_Job *shape_job;
|
||||
Ecore_Job *update_job;
|
||||
Ecore_Timer *new_up_timer;
|
||||
Evas_Object *fps_bg;
|
||||
|
@ -31,7 +68,6 @@ struct _E_Comp
|
|||
Ecore_Job *screen_job;
|
||||
Ecore_Timer *nocomp_delay_timer;
|
||||
Ecore_Timer *nocomp_override_timer;
|
||||
Ecore_X_Window ee_win;
|
||||
int animating;
|
||||
int render_overflow;
|
||||
double frametimes[122];
|
||||
|
@ -51,6 +87,7 @@ struct _E_Comp
|
|||
|
||||
struct _E_Comp_Zone
|
||||
{
|
||||
E_Comp *comp;
|
||||
E_Zone *zone; // never deref - just use for handle cmp's
|
||||
Evas_Object *base;
|
||||
Evas_Object *over;
|
||||
|
@ -67,14 +104,12 @@ struct _E_Comp_Win
|
|||
|
||||
E_Comp *c; // parent compositor
|
||||
Ecore_X_Window win; // raw window - for menus etc.
|
||||
E_Container_Shape *shape;
|
||||
E_Border *bd; // if its a border - later
|
||||
E_Popup *pop; // if its a popup - later
|
||||
E_Menu *menu; // if it is a menu - later
|
||||
int x, y, w, h; // geometry
|
||||
struct
|
||||
{
|
||||
int x, y, w, h; // hidden geometry (used when its unmapped and re-instated on map)
|
||||
} hidden;
|
||||
Eina_Rectangle hidden; // hidden geometry (used when its unmapped and re-instated on map)
|
||||
int pw, ph; // pixmap w/h
|
||||
int border; // border width
|
||||
Ecore_X_Pixmap pixmap; // the compositing pixmap
|
||||
|
@ -86,7 +121,7 @@ struct _E_Comp_Win
|
|||
Evas_Object *shobj; // shadow object
|
||||
Eina_List *obj_mirror; // extra mirror objects
|
||||
Ecore_X_Image *xim; // x image - software fallback
|
||||
E_Update *up; // update handler
|
||||
E_Comp_Render_Update *up; // update handler
|
||||
E_Object_Delfn *dfn; // delete function handle for objects being tracked
|
||||
Ecore_X_Sync_Counter counter; // sync counter for syncronised drawing
|
||||
Ecore_Timer *update_timeout; // max time between damage and "done" event
|
||||
|
@ -140,6 +175,7 @@ struct _E_Comp_Win
|
|||
Eina_Bool show_anim : 1; // ran show animation
|
||||
|
||||
Eina_Bool bg_win : 1; // window is the bg win for a container
|
||||
Eina_Bool free_shape : 1; // container shape needs to be freed
|
||||
};
|
||||
|
||||
struct E_Event_Comp
|
||||
|
@ -167,7 +203,8 @@ EAPI int e_comp_internal_save(void);
|
|||
EAPI E_Comp_Config *e_comp_config_get(void);
|
||||
EAPI void e_comp_shadows_reset(void);
|
||||
|
||||
EAPI void e_comp_update(E_Comp *c);
|
||||
EAPI void e_comp_render_update(E_Comp *c);
|
||||
EAPI void e_comp_zone_update(E_Comp_Zone *cz);
|
||||
|
||||
EAPI E_Comp_Win *e_comp_win_find_border_win(Ecore_X_Window win);
|
||||
EAPI E_Comp_Win *e_comp_win_find(Ecore_X_Window win);
|
||||
|
@ -178,6 +215,21 @@ EAPI void e_comp_win_hidden_set(E_Comp_Win *cw, Eina_Bool hidden);
|
|||
|
||||
EAPI E_Comp *e_comp_get(void *o);
|
||||
|
||||
EAPI Ecore_X_Window e_comp_top_window_at_xy_get(E_Comp *c, Evas_Coord x, Evas_Coord y, Ecore_X_Window *ignore, unsigned int ignore_num);
|
||||
|
||||
#define E_LAYER_SET(obj, layer) e_comp_canvas_layer_set(obj, layer, E_COMP_CANVAS_STACK_NONE)
|
||||
#define E_LAYER_SET_UNDER(obj, layer) e_comp_canvas_layer_set(obj, layer, E_COMP_CANVAS_STACK_UNDER)
|
||||
#define E_LAYER_SET_ABOVE(obj, layer) e_comp_canvas_layer_set(obj, layer, E_COMP_CANVAS_STACK_ABOVE)
|
||||
|
||||
static inline void
|
||||
e_comp_canvas_layer_set(Evas_Object *obj, E_Comp_Canvas_Layer layer, E_Comp_Canvas_Stack stack)
|
||||
{
|
||||
evas_object_layer_set(obj, layer);
|
||||
if (stack == E_COMP_CANVAS_STACK_ABOVE)
|
||||
evas_object_raise(obj);
|
||||
else if (stack == E_COMP_CANVAS_STACK_UNDER)
|
||||
evas_object_lower(obj);
|
||||
}
|
||||
|
||||
static inline Eina_Bool
|
||||
e_comp_evas_exists(void *o)
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#include "e.h"
|
||||
#include "e_comp_update.h"
|
||||
#include "e_comp_render_update.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void
|
||||
_e_comp_tiles_alloc(E_Update *up)
|
||||
_e_comp_tiles_alloc(E_Comp_Render_Update *up)
|
||||
{
|
||||
if (up->tiles) return;
|
||||
up->tiles = calloc(up->tw * up->th, sizeof(unsigned char));
|
||||
|
@ -12,45 +12,45 @@ _e_comp_tiles_alloc(E_Update *up)
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
E_Update *
|
||||
e_comp_update_new(void)
|
||||
E_Comp_Render_Update *
|
||||
e_comp_render_update_new(void)
|
||||
{
|
||||
E_Update *up;
|
||||
E_Comp_Render_Update *up;
|
||||
|
||||
up = calloc(1, sizeof(E_Update));
|
||||
up = calloc(1, sizeof(E_Comp_Render_Update));
|
||||
up->tsw = 32;
|
||||
up->tsh = 32;
|
||||
up->pol = E_UPDATE_POLICY_RAW;
|
||||
up->pol = E_COMP_RENDER_UPDATE_POLICY_RAW;
|
||||
return up;
|
||||
}
|
||||
|
||||
void
|
||||
e_comp_update_free(E_Update *up)
|
||||
e_comp_render_update_free(E_Comp_Render_Update *up)
|
||||
{
|
||||
free(up->tiles);
|
||||
free(up);
|
||||
}
|
||||
|
||||
void
|
||||
e_comp_update_policy_set(E_Update *up,
|
||||
E_Update_Policy pol)
|
||||
e_comp_render_update_policy_set(E_Comp_Render_Update *up,
|
||||
E_Comp_Render_Update_Policy pol)
|
||||
{
|
||||
up->pol = pol;
|
||||
}
|
||||
|
||||
void
|
||||
e_comp_update_tile_size_set(E_Update *up,
|
||||
e_comp_render_update_tile_size_set(E_Comp_Render_Update *up,
|
||||
int tsw,
|
||||
int tsh)
|
||||
{
|
||||
if ((up->tsw == tsw) && (up->tsh == tsh)) return;
|
||||
up->tsw = tsw;
|
||||
up->tsh = tsh;
|
||||
e_comp_update_clear(up);
|
||||
e_comp_render_update_clear(up);
|
||||
}
|
||||
|
||||
void
|
||||
e_comp_update_resize(E_Update *up,
|
||||
e_comp_render_update_resize(E_Comp_Render_Update *up,
|
||||
int w,
|
||||
int h)
|
||||
{
|
||||
|
@ -104,7 +104,7 @@ e_comp_update_resize(E_Update *up,
|
|||
}
|
||||
|
||||
void
|
||||
e_comp_update_add(E_Update *up,
|
||||
e_comp_render_update_add(E_Comp_Render_Update *up,
|
||||
int x,
|
||||
int y,
|
||||
int w,
|
||||
|
@ -123,10 +123,10 @@ e_comp_update_add(E_Update *up,
|
|||
|
||||
switch (up->pol)
|
||||
{
|
||||
case E_UPDATE_POLICY_RAW:
|
||||
case E_COMP_RENDER_UPDATE_POLICY_RAW:
|
||||
break;
|
||||
|
||||
case E_UPDATE_POLICY_HALF_WIDTH_OR_MORE_ROUND_UP_TO_FULL_WIDTH:
|
||||
case E_COMP_RENDER_UPDATE_POLICY_HALF_WIDTH_OR_MORE_ROUND_UP_TO_FULL_WIDTH:
|
||||
if (w > (up->w / 2))
|
||||
{
|
||||
x = 0;
|
||||
|
@ -155,16 +155,16 @@ e_comp_update_add(E_Update *up,
|
|||
}
|
||||
}
|
||||
|
||||
E_Update_Rect *
|
||||
e_comp_update_rects_get(E_Update *up)
|
||||
E_Comp_Render_Update_Rect *
|
||||
e_comp_render_update_rects_get(E_Comp_Render_Update *up)
|
||||
{
|
||||
E_Update_Rect *r;
|
||||
E_Comp_Render_Update_Rect *r;
|
||||
int ri = 0;
|
||||
int x, y;
|
||||
unsigned char *t, *t2, *t3;
|
||||
|
||||
if (!up->tiles) return NULL;
|
||||
r = calloc((up->tw * up->th) + 1, sizeof(E_Update_Rect));
|
||||
r = calloc((up->tw * up->th) + 1, sizeof(E_Comp_Render_Update_Rect));
|
||||
if (!r) return NULL;
|
||||
t = up->tiles;
|
||||
for (y = 0; y < up->th; y++)
|
||||
|
@ -236,7 +236,7 @@ e_comp_update_rects_get(E_Update *up)
|
|||
}
|
||||
|
||||
void
|
||||
e_comp_update_clear(E_Update *up)
|
||||
e_comp_render_update_clear(E_Comp_Render_Update *up)
|
||||
{
|
||||
if (up->tiles)
|
||||
{
|
|
@ -0,0 +1,46 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
typedef struct _E_Comp_Render_Update E_Comp_Render_Update;
|
||||
typedef struct _E_Comp_Render_Update_Rect E_Comp_Render_Update_Rect;
|
||||
typedef enum _E_Comp_Render_Update_Policy
|
||||
{
|
||||
E_COMP_RENDER_UPDATE_POLICY_RAW,
|
||||
E_COMP_RENDER_UPDATE_POLICY_HALF_WIDTH_OR_MORE_ROUND_UP_TO_FULL_WIDTH,
|
||||
} E_Comp_Render_Update_Policy;
|
||||
#else
|
||||
#ifndef E_COMP_RENDER_UPDATE_H
|
||||
#define E_COMP_RENDER_UPDATE_H
|
||||
|
||||
struct _E_Comp_Render_Update_Rect
|
||||
{
|
||||
int x, y, w, h;
|
||||
};
|
||||
|
||||
struct _E_Comp_Render_Update
|
||||
{
|
||||
int w, h;
|
||||
int tw, th;
|
||||
int tsw, tsh;
|
||||
unsigned char *tiles;
|
||||
E_Comp_Render_Update_Policy pol;
|
||||
};
|
||||
|
||||
E_Comp_Render_Update *e_comp_render_update_new(void);
|
||||
void e_comp_render_update_free(E_Comp_Render_Update *up);
|
||||
void e_comp_render_update_policy_set(E_Comp_Render_Update *up,
|
||||
E_Comp_Render_Update_Policy pol);
|
||||
void e_comp_render_update_tile_size_set(E_Comp_Render_Update *up,
|
||||
int tsw,
|
||||
int tsh);
|
||||
void e_comp_render_update_resize(E_Comp_Render_Update *up,
|
||||
int w,
|
||||
int h);
|
||||
void e_comp_render_update_add(E_Comp_Render_Update *up,
|
||||
int x,
|
||||
int y,
|
||||
int w,
|
||||
int h);
|
||||
E_Comp_Render_Update_Rect *e_comp_render_update_rects_get(E_Comp_Render_Update *up);
|
||||
void e_comp_render_update_clear(E_Comp_Render_Update *up);
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -1,46 +0,0 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
typedef struct _E_Update E_Update;
|
||||
typedef struct _E_Update_Rect E_Update_Rect;
|
||||
typedef enum _E_Update_Policy
|
||||
{
|
||||
E_UPDATE_POLICY_RAW,
|
||||
E_UPDATE_POLICY_HALF_WIDTH_OR_MORE_ROUND_UP_TO_FULL_WIDTH,
|
||||
} E_Update_Policy;
|
||||
#else
|
||||
#ifndef E_COMP_UPDATE_H
|
||||
#define E_COMP_UPDATE_H
|
||||
|
||||
struct _E_Update_Rect
|
||||
{
|
||||
int x, y, w, h;
|
||||
};
|
||||
|
||||
struct _E_Update
|
||||
{
|
||||
int w, h;
|
||||
int tw, th;
|
||||
int tsw, tsh;
|
||||
unsigned char *tiles;
|
||||
E_Update_Policy pol;
|
||||
};
|
||||
|
||||
E_Update *e_comp_update_new(void);
|
||||
void e_comp_update_free(E_Update *up);
|
||||
void e_comp_update_policy_set(E_Update *up,
|
||||
E_Update_Policy pol);
|
||||
void e_comp_update_tile_size_set(E_Update *up,
|
||||
int tsw,
|
||||
int tsh);
|
||||
void e_comp_update_resize(E_Update *up,
|
||||
int w,
|
||||
int h);
|
||||
void e_comp_update_add(E_Update *up,
|
||||
int x,
|
||||
int y,
|
||||
int w,
|
||||
int h);
|
||||
E_Update_Rect *e_comp_update_rects_get(E_Update *up);
|
||||
void e_comp_update_clear(E_Update *up);
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -10,14 +10,10 @@
|
|||
/* local subsystem functions */
|
||||
static void _e_container_free(E_Container *con);
|
||||
|
||||
static E_Container *_e_container_find_by_event_window(Ecore_X_Window win);
|
||||
|
||||
static Eina_Bool _e_container_cb_mouse_in(void *data, int type, void *event);
|
||||
static Eina_Bool _e_container_cb_mouse_out(void *data, int type, void *event);
|
||||
static Eina_Bool _e_container_cb_mouse_down(void *data, int type, void *event);
|
||||
static Eina_Bool _e_container_cb_mouse_up(void *data, int type, void *event);
|
||||
static Eina_Bool _e_container_cb_mouse_move(void *data, int type, void *event);
|
||||
static Eina_Bool _e_container_cb_mouse_wheel(void *data, int type, void *event);
|
||||
static void _e_container_cb_mouse_in(E_Container *con, Evas *e, Evas_Object *obj, void *event_info);
|
||||
static void _e_container_cb_mouse_down(E_Container *con, Evas *e, Evas_Object *obj, void *event_info);
|
||||
static void _e_container_cb_mouse_up(E_Container *con, Evas *e, Evas_Object *obj, void *event_info);
|
||||
static void _e_container_cb_mouse_wheel(E_Container *con, Evas *e, Evas_Object *obj, void *event_info);
|
||||
|
||||
static void _e_container_shape_del(E_Container_Shape *es);
|
||||
static void _e_container_shape_free(E_Container_Shape *es);
|
||||
|
@ -33,13 +29,6 @@ EINTERN int
|
|||
e_container_init(void)
|
||||
{
|
||||
E_EVENT_CONTAINER_RESIZE = ecore_event_type_new();
|
||||
|
||||
handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_MOUSE_IN, _e_container_cb_mouse_in, NULL));
|
||||
handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_MOUSE_OUT, _e_container_cb_mouse_out, NULL));
|
||||
handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, _e_container_cb_mouse_down, NULL));
|
||||
handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP, _e_container_cb_mouse_up, NULL));
|
||||
handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE, _e_container_cb_mouse_move, NULL));
|
||||
handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_EVENT_MOUSE_WHEEL, _e_container_cb_mouse_wheel, NULL));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -59,6 +48,7 @@ e_container_new(E_Manager *man)
|
|||
Eina_List *l, *screens;
|
||||
int i;
|
||||
Ecore_X_Window mwin;
|
||||
E_Comp *c;
|
||||
static int container_num = 0;
|
||||
|
||||
con = E_OBJECT_ALLOC(E_Container, E_CONTAINER_TYPE, _e_container_free);
|
||||
|
@ -69,31 +59,24 @@ e_container_new(E_Manager *man)
|
|||
con->h = con->manager->h;
|
||||
con->win = con->manager->win;
|
||||
|
||||
if (!e_config->null_container_win)
|
||||
con->bg_ecore_evas = e_canvas_new(con->win,
|
||||
0, 0, con->w, con->h, 1, 1,
|
||||
&(con->bg_win));
|
||||
else
|
||||
con->bg_ecore_evas = e_canvas_new(con->win,
|
||||
0, 0, 1, 1, 1, 1,
|
||||
&(con->bg_win));
|
||||
e_canvas_add(con->bg_ecore_evas);
|
||||
con->event_win = ecore_x_window_input_new(con->win, 0, 0, con->w, con->h);
|
||||
ecore_x_window_show(con->event_win);
|
||||
con->bg_evas = ecore_evas_get(con->bg_ecore_evas);
|
||||
ecore_evas_name_class_set(con->bg_ecore_evas, "E", "Background_Window");
|
||||
ecore_evas_title_set(con->bg_ecore_evas, "Enlightenment Background");
|
||||
|
||||
ecore_x_window_lower(con->bg_win);
|
||||
c = e_comp_get(man);
|
||||
con->bg_win = c->ee_win;
|
||||
con->bg_ecore_evas = c->ee;
|
||||
con->event_win = c->ee_win;
|
||||
con->bg_evas = c->evas;
|
||||
|
||||
o = evas_object_rectangle_add(con->bg_evas);
|
||||
con->bg_blank_object = o;
|
||||
evas_object_layer_set(o, -100);
|
||||
E_LAYER_SET(o, E_COMP_CANVAS_LAYER_BOTTOM);
|
||||
evas_object_move(o, 0, 0);
|
||||
evas_object_resize(o, con->w, con->h);
|
||||
evas_object_color_set(o, 255, 255, 255, 255);
|
||||
evas_object_name_set(o, "e/desktop/background");
|
||||
evas_object_name_set(o, "container->bg_blank_object");
|
||||
evas_object_data_set(o, "e_container", con);
|
||||
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, (Evas_Object_Event_Cb)_e_container_cb_mouse_down, con);
|
||||
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, (Evas_Object_Event_Cb)_e_container_cb_mouse_up, con);
|
||||
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_IN, (Evas_Object_Event_Cb)_e_container_cb_mouse_in, con);
|
||||
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_WHEEL, (Evas_Object_Event_Cb)_e_container_cb_mouse_wheel, con);
|
||||
evas_object_show(o);
|
||||
|
||||
con->num = container_num;
|
||||
|
@ -135,13 +118,6 @@ e_container_new(E_Manager *man)
|
|||
0, 0, 0, 0, 0,
|
||||
con->layers[11].win, ECORE_X_WINDOW_STACK_ABOVE);
|
||||
|
||||
/* Put background win at the bottom */
|
||||
ecore_x_window_configure(con->bg_win,
|
||||
ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING |
|
||||
ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE,
|
||||
0, 0, 0, 0, 0,
|
||||
con->layers[0].win, ECORE_X_WINDOW_STACK_BELOW);
|
||||
|
||||
screens = (Eina_List *)e_xinerama_screens_get();
|
||||
if (screens)
|
||||
{
|
||||
|
@ -163,21 +139,8 @@ e_container_show(E_Container *con)
|
|||
E_OBJECT_TYPE_CHECK(con, E_CONTAINER_TYPE);
|
||||
|
||||
if (con->visible) return;
|
||||
if (!e_config->null_container_win)
|
||||
ecore_evas_show(con->bg_ecore_evas);
|
||||
ecore_x_window_configure(con->bg_win,
|
||||
ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING |
|
||||
ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE,
|
||||
0, 0, 0, 0, 0,
|
||||
con->layers[0].win, ECORE_X_WINDOW_STACK_BELOW);
|
||||
ecore_x_window_configure(con->event_win,
|
||||
ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING |
|
||||
ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE,
|
||||
0, 0, 0, 0, 0,
|
||||
con->layers[0].win, ECORE_X_WINDOW_STACK_BELOW);
|
||||
if (con->win != con->manager->win)
|
||||
ecore_x_window_show(con->win);
|
||||
ecore_x_icccm_state_set(con->bg_win, ECORE_X_WINDOW_STATE_HINT_NORMAL);
|
||||
con->visible = 1;
|
||||
}
|
||||
|
||||
|
@ -188,7 +151,6 @@ e_container_hide(E_Container *con)
|
|||
E_OBJECT_TYPE_CHECK(con, E_CONTAINER_TYPE);
|
||||
|
||||
if (!con->visible) return;
|
||||
ecore_evas_hide(con->bg_ecore_evas);
|
||||
if (con->win != con->manager->win)
|
||||
ecore_x_window_hide(con->win);
|
||||
con->visible = 0;
|
||||
|
@ -455,7 +417,7 @@ e_container_shape_container_get(E_Container_Shape *es)
|
|||
}
|
||||
|
||||
EAPI void
|
||||
e_container_shape_change_callback_add(E_Container *con, void (*func)(void *data, E_Container_Shape *es, E_Container_Shape_Change ch), void *data)
|
||||
e_container_shape_change_callback_add(E_Container *con, E_Container_Shape_Cb func, void *data)
|
||||
{
|
||||
E_Container_Shape_Callback *cb;
|
||||
|
||||
|
@ -469,7 +431,7 @@ e_container_shape_change_callback_add(E_Container *con, void (*func)(void *data,
|
|||
}
|
||||
|
||||
EAPI void
|
||||
e_container_shape_change_callback_del(E_Container *con, void (*func)(void *data, E_Container_Shape *es, E_Container_Shape_Change ch), void *data)
|
||||
e_container_shape_change_callback_del(E_Container *con, E_Container_Shape_Cb func, void *data)
|
||||
{
|
||||
Eina_List *l = NULL;
|
||||
E_Container_Shape_Callback *cb = NULL;
|
||||
|
@ -896,7 +858,7 @@ e_container_evas_object_container_get(Evas_Object *obj)
|
|||
|
||||
if (!obj) return NULL;
|
||||
evas = evas_object_evas_get(obj);
|
||||
wobj = evas_object_name_find(evas, "e/desktop/background");
|
||||
wobj = evas_object_name_find(evas, "container->bg_blank_object");
|
||||
if (!wobj) return NULL;
|
||||
con = evas_object_data_get(wobj, "e_container");
|
||||
return con;
|
||||
|
@ -910,7 +872,6 @@ _e_container_free(E_Container *con)
|
|||
int i;
|
||||
|
||||
ecore_x_window_free(con->scratch_win);
|
||||
ecore_x_window_free(con->event_win);
|
||||
/* We can't use e_object_del here, because border adds a ref to itself
|
||||
* when it is removed, and the ref is never unref'ed */
|
||||
for (i = 0; i < 11; i++)
|
||||
|
@ -940,139 +901,37 @@ _e_container_free(E_Container *con)
|
|||
free(con);
|
||||
}
|
||||
|
||||
static E_Container *
|
||||
_e_container_find_by_event_window(Ecore_X_Window win)
|
||||
static void
|
||||
_e_container_cb_mouse_in(E_Container *con EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Eina_List *l, *ll;
|
||||
E_Manager *man;
|
||||
E_Container *con;
|
||||
|
||||
EINA_LIST_FOREACH(e_manager_list(), l, man)
|
||||
{
|
||||
EINA_LIST_FOREACH(man->containers, ll, con)
|
||||
{
|
||||
if (con->event_win == win) return con;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_container_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||
{
|
||||
Ecore_X_Event_Mouse_In *ev;
|
||||
E_Border *bd;
|
||||
E_Container *con;
|
||||
|
||||
ev = event;
|
||||
con = _e_container_find_by_event_window(ev->event_win);
|
||||
if (con)
|
||||
{
|
||||
bd = e_border_focused_get();
|
||||
if (bd) e_focus_event_mouse_out(bd);
|
||||
ecore_event_evas_modifier_lock_update(con->bg_evas, ev->modifiers);
|
||||
evas_event_feed_mouse_in(con->bg_evas, ev->time, NULL);
|
||||
}
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
bd = e_border_focused_get();
|
||||
if (bd) e_focus_event_mouse_out(bd);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_container_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||
static void
|
||||
_e_container_cb_mouse_down(E_Container *con, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||
{
|
||||
Ecore_X_Event_Mouse_Out *ev;
|
||||
E_Container *con;
|
||||
|
||||
ev = event;
|
||||
con = _e_container_find_by_event_window(ev->event_win);
|
||||
if (con)
|
||||
{
|
||||
ecore_event_evas_modifier_lock_update(con->bg_evas, ev->modifiers);
|
||||
if (ev->mode == ECORE_X_EVENT_MODE_GRAB)
|
||||
evas_event_feed_mouse_cancel(con->bg_evas, ev->time, NULL);
|
||||
evas_event_feed_mouse_out(con->bg_evas, ev->time, NULL);
|
||||
}
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
e_bindings_mouse_down_evas_event_handle(E_BINDING_CONTEXT_CONTAINER, E_OBJECT(con), event_info);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_container_cb_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||
static void
|
||||
_e_container_cb_mouse_up(E_Container *con, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||
{
|
||||
Ecore_Event_Mouse_Button *ev;
|
||||
E_Container *con;
|
||||
|
||||
ev = event;
|
||||
con = _e_container_find_by_event_window(ev->event_window);
|
||||
if (con)
|
||||
{
|
||||
Evas_Button_Flags flags = EVAS_BUTTON_NONE;
|
||||
|
||||
e_bindings_mouse_down_event_handle(E_BINDING_CONTEXT_CONTAINER,
|
||||
E_OBJECT(con), ev);
|
||||
if (ev->double_click) flags |= EVAS_BUTTON_DOUBLE_CLICK;
|
||||
if (ev->triple_click) flags |= EVAS_BUTTON_TRIPLE_CLICK;
|
||||
ecore_event_evas_modifier_lock_update(con->bg_evas, ev->modifiers);
|
||||
evas_event_feed_mouse_down(con->bg_evas, ev->buttons, flags, ev->timestamp, NULL);
|
||||
}
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
e_bindings_mouse_up_evas_event_handle(E_BINDING_CONTEXT_CONTAINER, E_OBJECT(con), event_info);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_container_cb_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||
static void
|
||||
_e_container_cb_mouse_wheel(E_Container *con, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||
{
|
||||
Ecore_Event_Mouse_Button *ev;
|
||||
E_Container *con;
|
||||
|
||||
ev = event;
|
||||
con = _e_container_find_by_event_window(ev->event_window);
|
||||
if (con)
|
||||
{
|
||||
evas_event_feed_mouse_up(con->bg_evas, ev->buttons, EVAS_BUTTON_NONE, ev->timestamp, NULL);
|
||||
ecore_event_evas_modifier_lock_update(con->bg_evas, ev->modifiers);
|
||||
e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_CONTAINER,
|
||||
E_OBJECT(con), ev);
|
||||
}
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_container_cb_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||
{
|
||||
Ecore_Event_Mouse_Move *ev;
|
||||
E_Container *con;
|
||||
|
||||
ev = event;
|
||||
con = _e_container_find_by_event_window(ev->event_window);
|
||||
if (con)
|
||||
{
|
||||
ecore_event_evas_modifier_lock_update(con->bg_evas, ev->modifiers);
|
||||
evas_event_feed_mouse_move(con->bg_evas, ev->x, ev->y, ev->timestamp, NULL);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_container_cb_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||
{
|
||||
Ecore_Event_Mouse_Wheel *ev;
|
||||
E_Container *con;
|
||||
|
||||
ev = event;
|
||||
con = _e_container_find_by_event_window(ev->event_window);
|
||||
if (con)
|
||||
{
|
||||
if (!e_bindings_wheel_event_handle(E_BINDING_CONTEXT_CONTAINER,
|
||||
E_OBJECT(con), ev))
|
||||
{
|
||||
ecore_event_evas_modifier_lock_update(con->bg_evas, ev->modifiers);
|
||||
evas_event_feed_mouse_wheel(con->bg_evas, ev->direction, ev->z, ev->timestamp, NULL);
|
||||
}
|
||||
}
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
e_bindings_wheel_evas_event_handle(E_BINDING_CONTEXT_CONTAINER, E_OBJECT(con), event_info);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_container_shape_del(E_Container_Shape *es)
|
||||
{
|
||||
if (es->comp_win) es->comp_win->shape = NULL;
|
||||
_e_container_shape_change_call(es, E_CONTAINER_SHAPE_DEL);
|
||||
}
|
||||
|
||||
|
|
|
@ -11,27 +11,14 @@ typedef enum _E_Container_Shape_Change
|
|||
E_CONTAINER_SHAPE_RECTS
|
||||
} E_Container_Shape_Change;
|
||||
|
||||
typedef enum _E_Layer
|
||||
{
|
||||
E_LAYER_DESKTOP = 0,
|
||||
E_LAYER_BELOW = 50,
|
||||
E_LAYER_NORMAL = 100,
|
||||
E_LAYER_ABOVE = 150,
|
||||
E_LAYER_EDGE = 200,
|
||||
E_LAYER_FULLSCREEN = 250,
|
||||
E_LAYER_EDGE_FULLSCREEN = 300,
|
||||
E_LAYER_POPUP = 300,
|
||||
E_LAYER_TOP = 350,
|
||||
E_LAYER_DRAG = 400,
|
||||
E_LAYER_PRIO = 450
|
||||
} E_Layer;
|
||||
|
||||
typedef struct _E_Container E_Container;
|
||||
typedef struct _E_Border_List E_Border_List;
|
||||
typedef struct _E_Container_Shape E_Container_Shape;
|
||||
typedef struct _E_Container_Shape_Callback E_Container_Shape_Callback;
|
||||
typedef struct _E_Event_Container_Resize E_Event_Container_Resize;
|
||||
|
||||
typedef void (*E_Container_Shape_Cb)(void *data, E_Container_Shape *es, E_Container_Shape_Change ch);
|
||||
|
||||
#else
|
||||
#ifndef E_CONTAINER_H
|
||||
#define E_CONTAINER_H
|
||||
|
@ -64,7 +51,7 @@ struct _E_Container
|
|||
unsigned int clients;
|
||||
struct {
|
||||
Ecore_X_Window win;
|
||||
Eina_List *clients;
|
||||
Eina_List *clients; /* E_Border */
|
||||
} layers[12];
|
||||
|
||||
Ecore_X_Window scratch_win;
|
||||
|
@ -82,6 +69,7 @@ struct _E_Container_Shape
|
|||
E_Object e_obj_inherit;
|
||||
|
||||
E_Container *con;
|
||||
E_Comp_Win *comp_win;
|
||||
int x, y, w, h;
|
||||
unsigned char visible : 1;
|
||||
struct {
|
||||
|
@ -92,7 +80,7 @@ struct _E_Container_Shape
|
|||
|
||||
struct _E_Container_Shape_Callback
|
||||
{
|
||||
void (*func) (void *data, E_Container_Shape *es, E_Container_Shape_Change ch);
|
||||
E_Container_Shape_Cb func;
|
||||
void *data;
|
||||
};
|
||||
|
||||
|
@ -135,8 +123,8 @@ EAPI void e_container_shape_resize(E_Container_Shape *es, int w, i
|
|||
EAPI Eina_List *e_container_shape_list_get(E_Container *con);
|
||||
EAPI void e_container_shape_geometry_get(E_Container_Shape *es, int *x, int *y, int *w, int *h);
|
||||
EAPI E_Container *e_container_shape_container_get(E_Container_Shape *es);
|
||||
EAPI void e_container_shape_change_callback_add(E_Container *con, void (*func) (void *data, E_Container_Shape *es, E_Container_Shape_Change ch), void *data);
|
||||
EAPI void e_container_shape_change_callback_del(E_Container *con, void (*func) (void *data, E_Container_Shape *es, E_Container_Shape_Change ch), void *data);
|
||||
EAPI void e_container_shape_change_callback_add(E_Container *con, E_Container_Shape_Cb func, void *data);
|
||||
EAPI void e_container_shape_change_callback_del(E_Container *con, E_Container_Shape_Cb func, void *data);
|
||||
EAPI Eina_List *e_container_shape_rects_get(E_Container_Shape *es);
|
||||
EAPI void e_container_shape_rects_set(E_Container_Shape *es, Ecore_X_Rectangle *rects, int num);
|
||||
EAPI void e_container_shape_solid_rect_set(E_Container_Shape *es, int x, int y, int w, int h);
|
||||
|
|
117
src/bin/e_dnd.c
117
src/bin/e_dnd.c
|
@ -306,6 +306,9 @@ e_drag_xdnd_start(E_Drag *drag, int x, int y)
|
|||
ECORE_X_DND_ACTION_COPY, ECORE_X_DND_ACTION_ASK,
|
||||
ECORE_X_DND_ACTION_LINK
|
||||
};
|
||||
const Eina_List *l;
|
||||
E_Drop_Handler *h;
|
||||
|
||||
if (_drag_win) return 0;
|
||||
_drag_win = ecore_x_window_input_new(drag->container->win,
|
||||
drag->container->x, drag->container->y,
|
||||
|
@ -323,6 +326,29 @@ e_drag_xdnd_start(E_Drag *drag, int x, int y)
|
|||
drag->dx = x - drag->x;
|
||||
drag->dy = y - drag->y;
|
||||
|
||||
EINA_LIST_FOREACH(_drop_handlers, l, h)
|
||||
{
|
||||
unsigned int i, j;
|
||||
|
||||
h->active = 0;
|
||||
eina_stringshare_del(h->active_type);
|
||||
h->active_type = NULL;
|
||||
for (i = 0; i < h->num_types; i++)
|
||||
{
|
||||
for (j = 0; j < drag->num_types; j++)
|
||||
{
|
||||
if (h->types[i] == drag->types[j])
|
||||
{
|
||||
h->active = 1;
|
||||
h->active_type = eina_stringshare_ref(h->types[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (h->active) break;
|
||||
}
|
||||
h->entered = 0;
|
||||
}
|
||||
|
||||
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);
|
||||
|
@ -573,6 +599,55 @@ e_drag_key_up_cb_set(E_Drag *drag, void (*func)(E_Drag *drag, Ecore_Event_Key *e
|
|||
drag->cb.key_up = func;
|
||||
}
|
||||
|
||||
/* from ecore_x_selection.c */
|
||||
EAPI Eina_List *
|
||||
e_dnd_util_text_uri_list_convert(char *data, int size)
|
||||
{
|
||||
char *tmp;
|
||||
int i, is;
|
||||
Eina_List *ret = NULL;
|
||||
|
||||
if (data && data[size - 1])
|
||||
{
|
||||
/* Isn't nul terminated */
|
||||
size++;
|
||||
data = realloc(data, size);
|
||||
data[size - 1] = 0;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/* local subsystem functions */
|
||||
|
||||
static void
|
||||
|
@ -786,19 +861,14 @@ _e_drag_update(Ecore_X_Window root, int x, int y, Ecore_X_Atom action)
|
|||
E_Event_Dnd_Move move_ev;
|
||||
E_Event_Dnd_Leave leave_ev;
|
||||
int dx, dy;
|
||||
Ecore_X_Window win, ignore_win[2];
|
||||
Ecore_X_Window win;
|
||||
int responsive = 0;
|
||||
|
||||
// double t1 = ecore_time_get(); ////
|
||||
if (_drag_current && !_xdnd)
|
||||
{
|
||||
ignore_win[0] = _drag_current->evas_win;
|
||||
ignore_win[1] = _drag_win;
|
||||
/* FIXME: this is nasty. every x mouse event we go back to x and do
|
||||
* a whole bunch of round-trips narrowing down the toplevel window
|
||||
* which contains the mouse */
|
||||
win = ecore_x_window_shadow_tree_at_xy_with_skip_get(root, x, y, ignore_win, 2);
|
||||
// win = ecore_x_window_at_xy_with_skip_get(x, y, ignore_win, 2);
|
||||
win = ecore_evas_window_get(_drag_current->ecore_evas);
|
||||
win = e_comp_top_window_at_xy_get(e_comp_get(e_manager_find_by_root(root)), x, y, &win, 1);
|
||||
}
|
||||
else
|
||||
win = root;
|
||||
|
@ -916,15 +986,12 @@ _e_drag_end(Ecore_X_Window root, int x, int y)
|
|||
const Eina_List *l;
|
||||
E_Event_Dnd_Drop ev;
|
||||
int dx, dy;
|
||||
Ecore_X_Window win, ignore_win[2];
|
||||
Ecore_X_Window win;
|
||||
E_Drag *tmp;
|
||||
|
||||
if (!_drag_current) return;
|
||||
ignore_win[0] = _drag_current->evas_win;
|
||||
ignore_win[1] = _drag_win;
|
||||
/* this is nasty - but necessary to get the window stacking */
|
||||
win = ecore_x_window_shadow_tree_at_xy_with_skip_get(root, x, y, ignore_win, 2);
|
||||
// win = ecore_x_window_at_xy_with_skip_get(x, y, ignore_win, 2);
|
||||
win = ecore_evas_window_get(_drag_current->ecore_evas);
|
||||
win = e_comp_top_window_at_xy_get(e_comp_get(e_manager_find_by_root(root)), x, y, &win, 1);
|
||||
zone = e_container_zone_at_point_get(_drag_current->container, x, y);
|
||||
/* Pass -1, -1, so that it is possible to drop at the edge. */
|
||||
if (zone) e_zone_flip_coords_handle(zone, -1, -1);
|
||||
|
@ -932,12 +999,13 @@ _e_drag_end(Ecore_X_Window root, int x, int y)
|
|||
_e_drag_hide(_drag_current);
|
||||
|
||||
e_grabinput_release(_drag_win, _drag_win);
|
||||
if (_drag_current->type == E_DRAG_XDND)
|
||||
while (_drag_current->type == E_DRAG_XDND)
|
||||
{
|
||||
int dropped;
|
||||
|
||||
if (!(dropped = ecore_x_dnd_drop()))
|
||||
{
|
||||
if (win == e_comp_get(NULL)->ee_win) break;
|
||||
ecore_x_window_free(_drag_win);
|
||||
_drag_win = 0;
|
||||
}
|
||||
|
@ -972,14 +1040,29 @@ _e_drag_end(Ecore_X_Window root, int x, int y)
|
|||
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
|
||||
ev.data = _drag_current->data;
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < _drag_current->num_types; i++)
|
||||
if (_drag_current->types[i] == _type_text_uri_list)
|
||||
{
|
||||
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;
|
||||
|
@ -1187,7 +1270,7 @@ _e_dnd_cb_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event)
|
|||
|
||||
if (!_xdnd)
|
||||
_e_drag_update(_drag_win_root, ev->x, ev->y,
|
||||
ECORE_X_ATOM_XDND_ACTION_PRIVATE);
|
||||
_action ?: ECORE_X_ATOM_XDND_ACTION_PRIVATE);
|
||||
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
|
|
@ -147,6 +147,7 @@ EAPI int e_drop_handler_responsive_get(const E_Drop_Handler *handler);
|
|||
EAPI void e_drop_handler_action_set(Ecore_X_Atom action);
|
||||
EAPI Ecore_X_Atom e_drop_handler_action_get(void);
|
||||
|
||||
EAPI Eina_List *e_dnd_util_text_uri_list_convert(char *data, int size);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
@ -843,6 +843,8 @@ e_fm2_init(void)
|
|||
EINTERN int
|
||||
e_fm2_shutdown(void)
|
||||
{
|
||||
E_FREE_LIST(_e_fm2_list, evas_object_del);
|
||||
|
||||
eina_stringshare_replace(&_e_fm2_icon_desktop_str, NULL);
|
||||
eina_stringshare_replace(&_e_fm2_icon_thumb_str, NULL);
|
||||
eina_stringshare_replace(&_e_fm2_mime_inode_directory, NULL);
|
||||
|
@ -7338,6 +7340,7 @@ _e_fm_drag_key_down_cb(E_Drag *drag, Ecore_Event_Key *e)
|
|||
if (!strncmp(e->keyname, "Alt", 3))
|
||||
{
|
||||
ecore_x_dnd_source_action_set(ECORE_X_ATOM_XDND_ACTION_ASK);
|
||||
e_drop_handler_action_set(ECORE_X_ATOM_XDND_ACTION_ASK);
|
||||
edje_object_signal_emit(drag->object, "e,state,ask", "e");
|
||||
}
|
||||
else if (!strncmp(e->keyname, "Shift", 5))
|
||||
|
@ -7345,11 +7348,13 @@ _e_fm_drag_key_down_cb(E_Drag *drag, Ecore_Event_Key *e)
|
|||
if (e->modifiers == ECORE_EVENT_MODIFIER_CTRL)
|
||||
{
|
||||
ecore_x_dnd_source_action_set(ECORE_X_ATOM_XDND_ACTION_ASK);
|
||||
e_drop_handler_action_set(ECORE_X_ATOM_XDND_ACTION_ASK);
|
||||
edje_object_signal_emit(drag->object, "e,state,ask", "e");
|
||||
}
|
||||
else
|
||||
{
|
||||
ecore_x_dnd_source_action_set(ECORE_X_ATOM_XDND_ACTION_MOVE);
|
||||
e_drop_handler_action_set(ECORE_X_ATOM_XDND_ACTION_MOVE);
|
||||
edje_object_signal_emit(drag->object, "e,state,move", "e");
|
||||
}
|
||||
}
|
||||
|
@ -7358,11 +7363,13 @@ _e_fm_drag_key_down_cb(E_Drag *drag, Ecore_Event_Key *e)
|
|||
if (e->modifiers == ECORE_EVENT_MODIFIER_SHIFT)
|
||||
{
|
||||
ecore_x_dnd_source_action_set(ECORE_X_ATOM_XDND_ACTION_ASK);
|
||||
e_drop_handler_action_set(ECORE_X_ATOM_XDND_ACTION_ASK);
|
||||
edje_object_signal_emit(drag->object, "e,state,ask", "e");
|
||||
}
|
||||
else
|
||||
{
|
||||
ecore_x_dnd_source_action_set(ECORE_X_ATOM_XDND_ACTION_COPY);
|
||||
e_drop_handler_action_set(ECORE_X_ATOM_XDND_ACTION_COPY);
|
||||
edje_object_signal_emit(drag->object, "e,state,copy", "e");
|
||||
}
|
||||
}
|
||||
|
@ -7371,14 +7378,18 @@ _e_fm_drag_key_down_cb(E_Drag *drag, Ecore_Event_Key *e)
|
|||
static void
|
||||
_e_fm_drag_key_up_cb(E_Drag *drag, Ecore_Event_Key *e)
|
||||
{
|
||||
Ecore_X_Atom act;
|
||||
/* Default action would be move. ;) */
|
||||
|
||||
if (!strncmp(e->keyname, "Alt", 3))
|
||||
ecore_x_dnd_source_action_set(ECORE_X_ATOM_XDND_ACTION_MOVE);
|
||||
act = ECORE_X_ATOM_XDND_ACTION_MOVE;
|
||||
else if (!strncmp(e->keyname, "Shift", 5))
|
||||
ecore_x_dnd_source_action_set(ECORE_X_ATOM_XDND_ACTION_MOVE);
|
||||
act = ECORE_X_ATOM_XDND_ACTION_MOVE;
|
||||
else if (!strncmp(e->keyname, "Control", 7))
|
||||
ecore_x_dnd_source_action_set(ECORE_X_ATOM_XDND_ACTION_MOVE);
|
||||
act = ECORE_X_ATOM_XDND_ACTION_MOVE;
|
||||
|
||||
ecore_x_dnd_source_action_set(act);
|
||||
e_drop_handler_action_set(act);
|
||||
|
||||
edje_object_signal_emit(drag->object, "e,state,move", "e");
|
||||
}
|
||||
|
@ -7527,6 +7538,7 @@ _e_fm2_cb_icon_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNU
|
|||
|
||||
d = e_drag_new(con, x, y, drag_types, 1,
|
||||
sel, sel_length, NULL, _e_fm2_cb_drag_finished);
|
||||
e_drop_handler_action_set(ECORE_X_ATOM_XDND_ACTION_MOVE);
|
||||
o = edje_object_add(e_drag_evas_get(d));
|
||||
if (_e_fm2_view_mode_get(ic->sd) == E_FM2_VIEW_MODE_LIST)
|
||||
{
|
||||
|
|
|
@ -1129,7 +1129,7 @@ e_gadcon_client_edit_begin(E_Gadcon_Client *gcc)
|
|||
else return; /* make clang happy */
|
||||
|
||||
gcc->o_control = edje_object_add(gcc->gadcon->evas);
|
||||
evas_object_layer_set(gcc->o_control, 100);
|
||||
//evas_object_layer_set(gcc->o_control, 100); FIXME: COMP
|
||||
e_gadcon_locked_set(gcc->gadcon, 1);
|
||||
gcc->gadcon->editing = 1;
|
||||
|
||||
|
@ -1155,7 +1155,7 @@ e_gadcon_client_edit_begin(E_Gadcon_Client *gcc)
|
|||
gcc->o_event = evas_object_rectangle_add(gcc->gadcon->evas);
|
||||
evas_object_color_set(gcc->o_event, 0, 0, 0, 0);
|
||||
evas_object_repeat_events_set(gcc->o_event, 1);
|
||||
evas_object_layer_set(gcc->o_event, 100);
|
||||
//evas_object_layer_set(gcc->o_event, 100); FIXME: COMP
|
||||
evas_object_move(gcc->o_event, x, y);
|
||||
evas_object_resize(gcc->o_event, w, h);
|
||||
|
||||
|
|
|
@ -152,4 +152,4 @@
|
|||
#include "e_notification.h"
|
||||
#include "e_comp.h"
|
||||
#include "e_comp_cfdata.h"
|
||||
#include "e_comp_update.h"
|
||||
#include "e_comp_render_update.h"
|
||||
|
|
|
@ -48,5 +48,17 @@ EAPI E_Manager *e_manager_number_get(int num);
|
|||
|
||||
EAPI void e_managers_keys_grab(void);
|
||||
EAPI void e_managers_keys_ungrab(void);
|
||||
|
||||
static inline E_Manager *
|
||||
e_manager_find_by_root(Ecore_X_Window root)
|
||||
{
|
||||
Eina_List *l;
|
||||
E_Manager *man;
|
||||
|
||||
EINA_LIST_FOREACH(e_manager_list(), l, man)
|
||||
if (root == man->root) return man;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -1692,7 +1692,7 @@ no_submenu_item:
|
|||
|
||||
o = evas_object_rectangle_add(mi->menu->evas);
|
||||
evas_object_color_set(o, 0, 0, 0, 0);
|
||||
evas_object_layer_set(o, 1);
|
||||
//evas_object_layer_set(o, 1); FIXME: COMP
|
||||
evas_object_repeat_events_set(o, 1);
|
||||
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_IN,
|
||||
_e_menu_cb_item_in, mi);
|
||||
|
|
|
@ -256,8 +256,8 @@ e_shelf_zone_new(E_Zone *zone, const char *name, const char *style, int popup, E
|
|||
{
|
||||
evas_object_move(es->o_event, es->zone->x + es->x, es->zone->y + es->y);
|
||||
evas_object_move(es->o_base, es->zone->x + es->x, es->zone->y + es->y);
|
||||
evas_object_layer_set(es->o_event, layer);
|
||||
evas_object_layer_set(es->o_base, layer);
|
||||
E_LAYER_SET(es->o_event, layer);
|
||||
E_LAYER_SET(es->o_base, layer);
|
||||
}
|
||||
|
||||
es->gadcon =
|
||||
|
@ -576,8 +576,8 @@ e_shelf_layer_set(E_Shelf *es, E_Layer layer)
|
|||
e_popup_layer_set(es->popup, es->layer);
|
||||
else
|
||||
{
|
||||
evas_object_layer_set(es->o_event, es->layer);
|
||||
evas_object_layer_set(es->o_base, es->layer);
|
||||
E_LAYER_SET(es->o_event, layer);
|
||||
E_LAYER_SET(es->o_base, layer);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1009,8 +1009,8 @@ e_shelf_popup_set(E_Shelf *es, int popup)
|
|||
|
||||
evas_object_move(es->o_event, es->zone->x + es->x, es->zone->y + es->y);
|
||||
evas_object_move(es->o_base, es->zone->x + es->x, es->zone->y + es->y);
|
||||
evas_object_layer_set(es->o_event, es->cfg->layer);
|
||||
evas_object_layer_set(es->o_base, es->cfg->layer);
|
||||
E_LAYER_SET(es->o_event, es->cfg->layer);
|
||||
E_LAYER_SET(es->o_base, es->cfg->layer);
|
||||
|
||||
e_drop_xdnd_register_set(es->zone->container->bg_win, 1);
|
||||
e_gadcon_xdnd_window_set(es->gadcon, es->zone->container->bg_win);
|
||||
|
|
|
@ -1656,11 +1656,11 @@ e_util_evas_objects_above_print(Evas_Object *o)
|
|||
l = evas_object_clipees_get(a);
|
||||
if (l)
|
||||
{
|
||||
fprintf(stderr, "[%p] - %s :: CLIPPEES: ", a, evas_object_type_get(a));
|
||||
fprintf(stderr, "[%p] - %s(%s) %s :: CLIPPEES: ", a, evas_object_type_get(a), evas_object_name_get(a), evas_object_visible_get(a) ? "VISIBLE" : "HIDDEN");
|
||||
EINA_LIST_FOREACH(l, ll, oo)
|
||||
fprintf(stderr, "[%p] - %s %s", oo, evas_object_type_get(oo), ll->next ? "| " : "");
|
||||
fprintf(stderr, "[%p] - %s(%s) %s", oo, evas_object_type_get(oo), evas_object_name_get(oo), ll->next ? "| " : "");
|
||||
}
|
||||
else
|
||||
fprintf(stderr, "[%p] - %s\n", a, evas_object_type_get(a));
|
||||
fprintf(stderr, "[%p] - %s(%s) %s\n", a, evas_object_type_get(a), evas_object_name_get(a), evas_object_visible_get(a) ? "VISIBLE" : "HIDDEN");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -222,6 +222,8 @@ e_zone_new(E_Container *con,
|
|||
|
||||
o = evas_object_rectangle_add(con->bg_evas);
|
||||
zone->bg_clip_object = o;
|
||||
evas_object_repeat_events_set(o, 1);
|
||||
evas_object_name_set(o, "zone->bg_clip_object");
|
||||
evas_object_move(o, x, y);
|
||||
evas_object_resize(o, w, h);
|
||||
evas_object_color_set(o, 255, 255, 255, 255);
|
||||
|
@ -229,7 +231,9 @@ e_zone_new(E_Container *con,
|
|||
|
||||
o = evas_object_rectangle_add(con->bg_evas);
|
||||
zone->bg_event_object = o;
|
||||
evas_object_name_set(o, "zone->bg_event_object");
|
||||
evas_object_clip_set(o, zone->bg_clip_object);
|
||||
evas_object_repeat_events_set(o, 1);
|
||||
evas_object_move(o, x, y);
|
||||
evas_object_resize(o, w, h);
|
||||
evas_object_color_set(o, 0, 0, 0, 0);
|
||||
|
@ -1461,7 +1465,7 @@ static void
|
|||
_e_zone_cb_bg_mouse_down(void *data,
|
||||
Evas *evas __UNUSED__,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
void *event_info)
|
||||
{
|
||||
E_Zone *zone;
|
||||
|
||||
|
@ -1470,22 +1474,16 @@ _e_zone_cb_bg_mouse_down(void *data,
|
|||
|
||||
if (!zone->cur_mouse_action)
|
||||
{
|
||||
if (ecore_event_current_type_get() == ECORE_EVENT_MOUSE_BUTTON_DOWN)
|
||||
zone->cur_mouse_action =
|
||||
e_bindings_mouse_down_evas_event_handle(E_BINDING_CONTEXT_ZONE,
|
||||
E_OBJECT(zone), event_info);
|
||||
if (zone->cur_mouse_action)
|
||||
{
|
||||
Ecore_Event_Mouse_Button *ev2;
|
||||
|
||||
ev2 = ecore_event_current_event_get();
|
||||
zone->cur_mouse_action =
|
||||
e_bindings_mouse_down_event_handle(E_BINDING_CONTEXT_ZONE,
|
||||
E_OBJECT(zone), ev2);
|
||||
if ((!zone->cur_mouse_action->func.end_mouse) &&
|
||||
(!zone->cur_mouse_action->func.end))
|
||||
zone->cur_mouse_action = NULL;
|
||||
if (zone->cur_mouse_action)
|
||||
{
|
||||
if ((!zone->cur_mouse_action->func.end_mouse) &&
|
||||
(!zone->cur_mouse_action->func.end))
|
||||
zone->cur_mouse_action = NULL;
|
||||
if (zone->cur_mouse_action)
|
||||
e_object_ref(E_OBJECT(zone->cur_mouse_action));
|
||||
}
|
||||
e_object_ref(E_OBJECT(zone->cur_mouse_action));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1494,36 +1492,31 @@ static void
|
|||
_e_zone_cb_bg_mouse_up(void *data,
|
||||
Evas *evas __UNUSED__,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
void *event_info)
|
||||
{
|
||||
E_Zone *zone;
|
||||
|
||||
zone = data;
|
||||
if (zone->cur_mouse_action)
|
||||
{
|
||||
if (ecore_event_current_type_get() == ECORE_EVENT_MOUSE_BUTTON_UP)
|
||||
{
|
||||
Ecore_Event_Mouse_Button *ev2;
|
||||
E_Binding_Event_Mouse_Button event;
|
||||
|
||||
e_bindings_evas_event_mouse_button_convert(event_info, &event);
|
||||
if (zone->cur_mouse_action->func.end_mouse)
|
||||
zone->cur_mouse_action->func.end_mouse(E_OBJECT(zone), "", &event);
|
||||
else if (zone->cur_mouse_action->func.end)
|
||||
zone->cur_mouse_action->func.end(E_OBJECT(zone), "");
|
||||
|
||||
ev2 = ecore_event_current_event_get();
|
||||
if (zone->cur_mouse_action->func.end_mouse)
|
||||
zone->cur_mouse_action->func.end_mouse(E_OBJECT(zone), "", ev2);
|
||||
else if (zone->cur_mouse_action->func.end)
|
||||
zone->cur_mouse_action->func.end(E_OBJECT(zone), "");
|
||||
}
|
||||
e_object_unref(E_OBJECT(zone->cur_mouse_action));
|
||||
zone->cur_mouse_action = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ecore_event_current_type_get() == ECORE_EVENT_MOUSE_BUTTON_UP)
|
||||
{
|
||||
Ecore_Event_Mouse_Button *ev2;
|
||||
E_Binding_Event_Mouse_Button event;
|
||||
|
||||
ev2 = ecore_event_current_event_get();
|
||||
e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_ZONE,
|
||||
E_OBJECT(zone), ev2);
|
||||
}
|
||||
e_bindings_ecore_event_mouse_button_convert(event_info, &event);
|
||||
e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_ZONE,
|
||||
E_OBJECT(zone), &event);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ struct _E_Zone
|
|||
* this zone belongs to. */
|
||||
unsigned int num;
|
||||
E_Container *container;
|
||||
E_Comp_Zone *comp_zone;
|
||||
int fullscreen;
|
||||
|
||||
Evas_Object *bg_object;
|
||||
|
|
|
@ -789,7 +789,7 @@ _e_mod_action_cb_key(E_Object *obj __UNUSED__, const char *params, Ecore_Event_K
|
|||
}
|
||||
|
||||
static void
|
||||
_e_mod_action_cb_mouse(E_Object *obj __UNUSED__, const char *params, Ecore_Event_Mouse_Button *ev __UNUSED__)
|
||||
_e_mod_action_cb_mouse(E_Object *obj __UNUSED__, const char *params, E_Binding_Event_Mouse_Button *ev __UNUSED__)
|
||||
{
|
||||
_e_mod_action(params);
|
||||
}
|
||||
|
|
|
@ -165,7 +165,7 @@ _style_selector(Evas *evas, const char **source)
|
|||
|
||||
ds_it->frame = edje_object_add(evas);
|
||||
e_theme_edje_object_set
|
||||
(ds_it->frame, "base/theme/modules/comp", "e/modules/comp/preview");
|
||||
(ds_it->frame, "base/theme/comp", "e/comp/preview");
|
||||
edje_object_part_swallow(ds_it->frame, "e.swallow.preview", ob);
|
||||
evas_object_show(ds_it->frame);
|
||||
style_shadows = eina_list_append(style_shadows, ds_it);
|
||||
|
|
|
@ -201,13 +201,6 @@ static void _e_fwin_zone_cb_mouse_down(void *data,
|
|||
Evas *evas,
|
||||
Evas_Object *obj,
|
||||
void *event_info);
|
||||
static void _e_fwin_zone_focus_out(void *data,
|
||||
Evas *evas,
|
||||
Evas_Object *obj,
|
||||
void *event_info);
|
||||
static void _e_fwin_zone_focus_in(void *data,
|
||||
Evas *evas,
|
||||
void *event_info);
|
||||
static Eina_Bool _e_fwin_zone_move_resize(void *data,
|
||||
int type,
|
||||
void *event);
|
||||
|
@ -388,6 +381,19 @@ _e_fwin_dnd_begin_cb(E_Fwin *fwin __UNUSED__, Evas_Object *obj __UNUSED__, void
|
|||
drag_fwin = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_fwin_zone_shutdown(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
E_Fwin *fwin = data;
|
||||
const char *dev, *path;
|
||||
|
||||
fwin->path->desktop_mode = e_fm2_view_mode_get(obj);
|
||||
e_fm2_path_get(obj, &dev, &path);
|
||||
eina_stringshare_replace(&fwin->path->dev, dev);
|
||||
eina_stringshare_replace(&fwin->path->path, path);
|
||||
e_object_del(E_OBJECT(fwin));
|
||||
}
|
||||
|
||||
void
|
||||
e_fwin_zone_new(E_Zone *zone, void *p)
|
||||
{
|
||||
|
@ -421,9 +427,8 @@ e_fwin_zone_new(E_Zone *zone, void *p)
|
|||
fwins = eina_list_append(fwins, fwin);
|
||||
|
||||
o = e_fm2_add(zone->container->bg_evas);
|
||||
evas_object_event_callback_add(o, EVAS_CALLBACK_DEL, _e_fwin_zone_shutdown, fwin);
|
||||
page->fm_obj = o;
|
||||
evas_event_callback_add(zone->container->bg_evas, EVAS_CALLBACK_CANVAS_FOCUS_IN, _e_fwin_zone_focus_in, fwin);
|
||||
evas_object_event_callback_add(o, EVAS_CALLBACK_FOCUS_OUT, _e_fwin_zone_focus_out, fwin);
|
||||
_e_fwin_config_set(page);
|
||||
|
||||
e_fm2_custom_theme_content_set(o, "desktop");
|
||||
|
@ -452,7 +457,6 @@ e_fwin_zone_new(E_Zone *zone, void *p)
|
|||
evas_object_show(o);
|
||||
|
||||
o = e_scrollframe_add(zone->container->bg_evas);
|
||||
ecore_x_icccm_state_set(zone->container->bg_win, ECORE_X_WINDOW_STATE_HINT_NORMAL);
|
||||
e_drop_xdnd_register_set(zone->container->event_win, 1);
|
||||
e_scrollframe_custom_theme_set(o, "base/theme/fileman",
|
||||
"e/fileman/desktop/scrollframe");
|
||||
|
@ -480,6 +484,7 @@ e_fwin_zone_new(E_Zone *zone, void *p)
|
|||
_e_fwin_pan_child_size_get);
|
||||
evas_object_propagate_events_set(page->fm_obj, 0);
|
||||
e_widget_can_focus_set(o, 0);
|
||||
E_LAYER_SET(o, E_COMP_CANVAS_LAYER_DESKTOP);
|
||||
page->scrollframe_obj = page->scr = o;
|
||||
|
||||
e_zone_useful_geometry_get(zone, &x, &y, &w, &h);
|
||||
|
@ -512,17 +517,12 @@ e_fwin_zone_shutdown(E_Zone *zone)
|
|||
{
|
||||
Eina_List *f, *fn;
|
||||
E_Fwin *win;
|
||||
const char *dev, *path;
|
||||
|
||||
|
||||
EINA_LIST_FOREACH_SAFE(fwins, f, fn, win)
|
||||
{
|
||||
if (win->zone != zone) continue;
|
||||
win->path->desktop_mode = e_fm2_view_mode_get(win->cur_page->fm_obj);
|
||||
e_fm2_path_get(win->cur_page->fm_obj, &dev, &path);
|
||||
eina_stringshare_replace(&win->path->dev, dev);
|
||||
eina_stringshare_replace(&win->path->path, path);
|
||||
evas_event_callback_del_full(zone->container->bg_evas, EVAS_CALLBACK_CANVAS_FOCUS_IN, _e_fwin_zone_focus_in, win);
|
||||
e_object_del(E_OBJECT(win));
|
||||
_e_fwin_zone_shutdown(win, NULL, win->cur_page->fm_obj, NULL);
|
||||
win = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -1926,27 +1926,6 @@ _e_fwin_zone_cb_mouse_down(void *data,
|
|||
e_fm2_typebuf_clear(fwin->cur_page->fm_obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_fwin_zone_focus_out(void *data __UNUSED__,
|
||||
Evas *evas __UNUSED__,
|
||||
Evas_Object *obj,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
evas_object_focus_set(obj, EINA_TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_fwin_zone_focus_in(void *data,
|
||||
Evas *evas __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
E_Fwin *fwin;
|
||||
|
||||
fwin = data;
|
||||
if ((!fwin) || (!fwin->cur_page) || (!fwin->cur_page->fm_obj)) return;
|
||||
evas_object_focus_set(fwin->cur_page->fm_obj, EINA_TRUE);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_fwin_zone_move_resize(void *data, int type __UNUSED__, void *event)
|
||||
{
|
||||
|
|
|
@ -298,6 +298,11 @@ gadman_gadget_place(E_Gadcon_Client *gcc, const E_Gadcon_Client_Class *cc, E_Con
|
|||
|
||||
if (gcc->gadcon->id == ID_GADMAN_LAYER_TOP)
|
||||
edje_object_signal_emit(gcc->o_frame, "e,state,visibility,hide", "e");
|
||||
else
|
||||
{
|
||||
E_LAYER_SET(gcc->o_base, E_COMP_CANVAS_LAYER_DESKTOP);
|
||||
E_LAYER_SET(gcc->o_frame, E_COMP_CANVAS_LAYER_DESKTOP);
|
||||
}
|
||||
if (cc->name)
|
||||
{
|
||||
l = eina_hash_find(_gadman_gadgets, cc->name);
|
||||
|
@ -839,6 +844,19 @@ _gadman_gadcon_new(const char *name, Gadman_Layer_Type layer, E_Zone *zone, E_Ga
|
|||
return gc;
|
||||
}
|
||||
|
||||
static void
|
||||
_mover_del(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
unsigned int layer;
|
||||
|
||||
for (layer = 0; layer < GADMAN_LAYER_COUNT; layer++)
|
||||
{
|
||||
if (Man->movers[layer] != obj) continue;
|
||||
Man->movers[layer] = NULL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_create_mover(E_Gadcon *gc)
|
||||
{
|
||||
|
@ -846,6 +864,11 @@ _create_mover(E_Gadcon *gc)
|
|||
|
||||
/* create mover object */
|
||||
mover = edje_object_add(gc->evas);
|
||||
if (gc->id == ID_GADMAN_LAYER_BG)
|
||||
{
|
||||
E_LAYER_SET_ABOVE(mover, E_COMP_CANVAS_LAYER_DESKTOP);
|
||||
evas_object_event_callback_add(mover, EVAS_CALLBACK_DEL, _mover_del, NULL);
|
||||
}
|
||||
e_theme_edje_object_set(mover, "base/theme/gadman", "e/gadman/control");
|
||||
|
||||
edje_object_signal_callback_add(mover, "e,action,move,start", "",
|
||||
|
@ -992,7 +1015,7 @@ _attach_menu(void *data __UNUSED__, E_Gadcon_Client *gcc, E_Menu *menu)
|
|||
e_menu_item_callback_set(mi, on_menu_edit, gcc);
|
||||
|
||||
/* plain / inset */
|
||||
if (!gcc->cf->style)
|
||||
if (gcc->cf && (!gcc->cf->style))
|
||||
gcc->cf->style = eina_stringshare_add(E_GADCON_CLIENT_STYLE_INSET);
|
||||
|
||||
mn = e_menu_new();
|
||||
|
|
|
@ -24,7 +24,7 @@ e_busycover_new(E_Win *win)
|
|||
edje_object_part_text_set(cover->o_base, "e.text.title", _("LOADING"));
|
||||
evas_object_move(cover->o_base, win->x, win->y);
|
||||
evas_object_resize(cover->o_base, win->w, win->h);
|
||||
evas_object_layer_set(cover->o_base, 999);
|
||||
evas_object_layer_set(cover->o_base, 999); //FIXME: COMP
|
||||
return cover;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
/* actual module specifics */
|
||||
static void _e_mod_action_winlist_cb(E_Object *obj, const char *params);
|
||||
static void _e_mod_action_winlist_mouse_cb(E_Object *obj, const char *params, Ecore_Event_Mouse_Button *ev);
|
||||
static void _e_mod_action_winlist_mouse_cb(E_Object *obj, const char *params, E_Binding_Event_Mouse_Button *ev);
|
||||
static void _e_mod_action_winlist_key_cb(E_Object *obj, const char *params, Ecore_Event_Key *ev);
|
||||
static void _e_mod_action_winlist_edge_cb(E_Object *obj, const char *params, E_Event_Zone_Edge *ev);
|
||||
static void _e_mod_action_winlist_signal_cb(E_Object *obj, const char *params, const char *sig, const char *src);
|
||||
|
@ -192,9 +192,9 @@ _e_mod_action_winlist_cb(E_Object *obj, const char *params)
|
|||
}
|
||||
|
||||
static void
|
||||
_e_mod_action_winlist_mouse_cb(E_Object *obj, const char *params, Ecore_Event_Mouse_Button *ev)
|
||||
_e_mod_action_winlist_mouse_cb(E_Object *obj, const char *params, E_Binding_Event_Mouse_Button *ev)
|
||||
{
|
||||
_e_mod_action_winlist_cb_helper(obj, params, ev->modifiers, E_WINLIST_ACTIVATE_TYPE_MOUSE);
|
||||
_e_mod_action_winlist_cb_helper(obj, params, e_bindings_modifiers_to_ecore_convert(ev->modifiers), E_WINLIST_ACTIVATE_TYPE_MOUSE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -1299,7 +1299,7 @@ _e_winlist_cb_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *event
|
|||
|
||||
ev = event;
|
||||
if (ev->window != _input_window) return ECORE_CALLBACK_PASS_ON;
|
||||
e_bindings_mouse_down_event_handle(E_BINDING_CONTEXT_WINLIST,
|
||||
e_bindings_mouse_down_ecore_event_handle(E_BINDING_CONTEXT_WINLIST,
|
||||
E_OBJECT(_winlist->zone), ev);
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
@ -1311,7 +1311,7 @@ _e_winlist_cb_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *event)
|
|||
|
||||
ev = event;
|
||||
if (ev->window != _input_window) return ECORE_CALLBACK_PASS_ON;
|
||||
if (e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_WINLIST, E_OBJECT(_winlist->zone), ev))
|
||||
if (e_bindings_mouse_up_ecore_event_handle(E_BINDING_CONTEXT_WINLIST, E_OBJECT(_winlist->zone), ev))
|
||||
return ECORE_CALLBACK_RENEW;
|
||||
if (_activate_type != E_WINLIST_ACTIVATE_TYPE_MOUSE) return ECORE_CALLBACK_RENEW;
|
||||
if (!--_hold_count) e_winlist_hide();
|
||||
|
@ -1326,7 +1326,7 @@ _e_winlist_cb_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void *even
|
|||
|
||||
ev = event;
|
||||
if (ev->window != _input_window) return ECORE_CALLBACK_PASS_ON;
|
||||
e_bindings_wheel_event_handle(E_BINDING_CONTEXT_WINLIST,
|
||||
e_bindings_wheel_ecore_event_handle(E_BINDING_CONTEXT_WINLIST,
|
||||
E_OBJECT(_winlist->zone), ev);
|
||||
if (ev->z < 0) /* up */
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue