giant comp rejiggering commit #2: popups are now objects drawn directly onto the compositor canvas with no xwindows of their own

* added a number of new e_comp functions and macros

* options for disabling effects on objects: this option does not currently have any effect

* all modules which used gadcon popups have been adjusted

* all modules which used input windows to detect close events for gadcon popups have been adjusted to use new popup autoclose functionality

* shelves are now always drawn on the compositor canvas, meaning objects will never get clipped by the shelf (ticket #1810)

* shelves no longer have an event object

SVN revision: 84060
devs/asdfuser/comp-sounds
Mike Blumenkrantz 10 years ago
parent 0e466612d6
commit f36ecd9d3d
  1. 1
      ChangeLog
  2. 1
      NEWS
  3. 8
      data/themes/edc/shelf.edc
  4. 6
      src/bin/e_bg.c
  5. 705
      src/bin/e_comp.c
  6. 49
      src/bin/e_comp.h
  7. 3
      src/bin/e_comp_cfdata.c
  8. 3
      src/bin/e_comp_cfdata.h
  9. 1
      src/bin/e_comp_render_update.c
  10. 2
      src/bin/e_container.c
  11. 3
      src/bin/e_desklock.c
  12. 2
      src/bin/e_dnd.c
  13. 100
      src/bin/e_gadcon_popup.c
  14. 2
      src/bin/e_gadcon_popup.h
  15. 2
      src/bin/e_int_shelf_config.c
  16. 13
      src/bin/e_main.c
  17. 68
      src/bin/e_moveresize.c
  18. 413
      src/bin/e_popup.c
  19. 37
      src/bin/e_popup.h
  20. 225
      src/bin/e_shelf.c
  21. 5
      src/bin/e_shelf.h
  22. 78
      src/modules/backlight/e_mod_main.c
  23. 22
      src/modules/conf_comp/e_mod_config.c
  24. 63
      src/modules/connman/e_mod_main.c
  25. 3
      src/modules/connman/e_mod_main.h
  26. 14
      src/modules/fileman/e_fwin.c
  27. 11
      src/modules/gadman/e_mod_gadman.c
  28. 14
      src/modules/illume-keyboard/e_kbd_int.c
  29. 76
      src/modules/mixer/e_mod_main.c
  30. 6
      src/modules/mixer/e_mod_main.h
  31. 3
      src/modules/music-control/private.h
  32. 60
      src/modules/music-control/ui.c
  33. 3
      src/modules/notification/e_mod_popup.c
  34. 19
      src/modules/pager/e_mod_main.c
  35. 3
      src/modules/syscon/e_syscon.c
  36. 2
      src/modules/systray/e_mod_xembed.c
  37. 32
      src/modules/tiling/e_mod_tiling.c
  38. 3
      src/modules/winlist/e_winlist.c
  39. 75
      src/modules/wizard/e_wizard.c

@ -6,6 +6,7 @@
* e_shelf_desk_visible_get now takes const params
* e_util_size_debug_set now also prints for object show/hide events
* e_gadcon_unpopulate now correctly freezes the container while deleting gadgets
* e_popup is now a wrapper for drawing objects onto the compositor canvas
2013-02-13 Deon Thomas

@ -108,6 +108,7 @@ Improvements:
* Menu->Applications now only list valid .desktop files
* desklock now uses compositor canvas
* e_gadcon_unpopulate now correctly freezes the container while deleting gadgets
* e_popup is now a wrapper for drawing objects onto the compositor canvas
Fixes:
* IBar menu didn't allow to configure different icon sources, show contents menu even on empty IBar.

@ -19,7 +19,7 @@ group { name: "e/shelf/default/base";
images.image: "holes_horiz.png" COMP;
images.image: "shine.png" COMP;
parts {
part { name: "bg"; mouse_events: 0;
part { name: "bg";
description { state: "default" 0.0;
image.normal: "vgrad_med.png";
fill.smooth: 0;
@ -136,7 +136,7 @@ group { name: "e/shelf/default/inset";
color: 0 0 0 0;
}
}
part { name: "clip"; type: RECT;
part { name: "clip"; type: RECT; mouse_events: 0;
description { state: "default" 0.0;
rel1.offset: 3 1;
rel2.offset: -4 -2;
@ -227,7 +227,7 @@ group { name: "e/shelf/invisible/base";
visible: 0;
}
}
part { name: "dots_start";
part { name: "dots_start"; mouse_events: 1;
description { state: "default" 0.0;
rel1.offset: 0 0;
rel2.offset: -1 -1;
@ -271,7 +271,7 @@ group { name: "e/shelf/default/plain";
color: 0 0 0 0;
}
}
part { name: "clip"; type: RECT;
part { name: "clip"; type: RECT; mouse_events: 0;
description { state: "default" 0.0;
color: 255 255 255 255;
}

@ -243,7 +243,7 @@ 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);
E_LAYER_SET(o, E_COMP_CANVAS_LAYER_BG);
evas_object_layer_set(o, E_COMP_CANVAS_LAYER_BG);
evas_object_clip_set(o, zone->bg_clip_object);
evas_object_show(o);
}
@ -267,7 +267,7 @@ e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition)
{
evas_object_move(o, zone->x, zone->y);
evas_object_resize(o, zone->w, zone->h);
E_LAYER_SET(o, E_COMP_CANVAS_LAYER_BG);
evas_object_layer_set(o, E_COMP_CANVAS_LAYER_BG);
}
evas_object_clip_set(o, zone->bg_clip_object);
evas_object_show(o);
@ -519,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);
E_LAYER_SET(zone->bg_object, E_COMP_CANVAS_LAYER_BG);
evas_object_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);
}

File diff suppressed because it is too large Load Diff

@ -9,6 +9,7 @@ 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_DESKTOP_TOP = 10, // raised desktop objects: gadgets, shelves
E_COMP_CANVAS_LAYER_LAYOUT = 100, // should be nothing else on this layer
E_COMP_CANVAS_LAYER_POPUP = 999, // popups
E_COMP_CANVAS_LAYER_DESKLOCK = 9999, // desklock
@ -56,6 +57,7 @@ struct _E_Comp
E_Manager *man;
Eina_List *debug_rects;
Eina_List *ignore_wins;
Eina_Inlist *wins;
Eina_List *wins_list;
@ -177,6 +179,8 @@ struct _E_Comp_Win
Eina_Bool bg_win : 1; // window is the bg win for a container
Eina_Bool free_shape : 1; // container shape needs to be freed
Eina_Bool real_obj : 1; // real object (for dummy comp wins)
Eina_Bool not_in_layout : 1; // object is a dummy not in comp layout
};
struct E_Event_Comp
@ -218,20 +222,33 @@ 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);
EAPI void e_comp_object_inject(E_Comp *c, Evas_Object *obj, E_Layer layer);
/* for injecting objects into the comp layout */
EAPI E_Comp_Win *e_comp_object_inject(E_Comp *c, Evas_Object *obj, E_Object *eobj, E_Layer layer);
/* for giving objects the comp theme and such without injecting into layout */
EAPI E_Comp_Win *e_comp_object_add(E_Comp *c, Evas_Object *obj, E_Object *eobj);
#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)
EAPI void e_comp_win_move(E_Comp_Win *cw, Evas_Coord x, Evas_Coord y);
EAPI void e_comp_win_resize(E_Comp_Win *cw, int w, int h);
EAPI void e_comp_win_moveresize(E_Comp_Win *cw, Evas_Coord x, Evas_Coord y, int w, int h);
EAPI void e_comp_win_hide(E_Comp_Win *cw);
EAPI void e_comp_win_show(E_Comp_Win *cw);
EAPI void e_comp_win_del(E_Comp_Win *cw);
static inline void
e_comp_canvas_layer_set(Evas_Object *obj, E_Comp_Canvas_Layer layer, E_Comp_Canvas_Stack stack)
EAPI void e_comp_ignore_win_add(Ecore_X_Window win);
#define E_LAYER_SET(obj, layer) e_comp_canvas_layer_set(obj, layer, 0, E_COMP_CANVAS_STACK_NONE)
#define E_LAYER_SET_UNDER(obj, layer) e_comp_canvas_layer_set(obj, layer, 0, E_COMP_CANVAS_STACK_UNDER)
#define E_LAYER_SET_ABOVE(obj, layer) e_comp_canvas_layer_set(obj, layer, 0, E_COMP_CANVAS_STACK_ABOVE)
#define E_LAYER_LAYOUT_ADD(obj, layer) e_comp_canvas_layer_set(obj, E_COMP_CANVAS_LAYER_LAYOUT, layer, E_COMP_CANVAS_STACK_NONE)
#define E_LAYER_LAYOUT_ADD_UNDER(obj, layer) e_comp_canvas_layer_set(obj, E_COMP_CANVAS_LAYER_LAYOUT, layer, E_COMP_CANVAS_STACK_UNDER)
#define E_LAYER_LAYOUT_ADD_ABOVE(obj, layer) e_comp_canvas_layer_set(obj, E_COMP_CANVAS_LAYER_LAYOUT, layer, E_COMP_CANVAS_STACK_ABOVE)
EAPI void e_comp_canvas_layer_set(Evas_Object *obj, E_Comp_Canvas_Layer comp_layer, E_Layer layer, E_Comp_Canvas_Stack stack);
static inline E_Comp *
e_comp_util_evas_object_comp_get(Evas_Object *obj)
{
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);
return ecore_evas_data_get(ecore_evas_ecore_evas_get(evas_object_evas_get(obj)), "comp");
}
static inline Eina_Bool
@ -244,5 +261,15 @@ e_comp_evas_exists(void *o)
return c ? !!c->evas : EINA_FALSE;
}
static inline void
e_comp_win_ignore_events_set(E_Comp_Win *cw, Eina_Bool ignore)
{
EINA_SAFETY_ON_NULL_RETURN(cw);
ignore = !!ignore;
evas_object_pass_events_set(cw->shobj, ignore);
}
EAPI void e_comp_util_wins_print(const E_Comp *c);
#endif
#endif

@ -62,10 +62,12 @@ e_comp_cfdata_edd_init(E_Config_DD **conf_edd, E_Config_DD **match_edd)
E_CONFIG_VAL(D, T, match.disable_borders, UCHAR);
E_CONFIG_VAL(D, T, match.disable_overrides, UCHAR);
E_CONFIG_VAL(D, T, match.disable_menus, UCHAR);
E_CONFIG_VAL(D, T, match.disable_objects, UCHAR);
E_CONFIG_LIST(D, T, match.popups, *match_edd);
E_CONFIG_LIST(D, T, match.borders, *match_edd);
E_CONFIG_LIST(D, T, match.overrides, *match_edd);
E_CONFIG_LIST(D, T, match.menus, *match_edd);
E_CONFIG_LIST(D, T, match.objects, *match_edd);
}
EAPI E_Comp_Config *
@ -205,6 +207,7 @@ e_comp_cfdata_config_free(E_Comp_Config *cfg)
E_FREE_LIST(cfg->match.borders, e_comp_cfdata_match_free);
E_FREE_LIST(cfg->match.overrides, e_comp_cfdata_match_free);
E_FREE_LIST(cfg->match.menus, e_comp_cfdata_match_free);
E_FREE_LIST(cfg->match.objects, e_comp_cfdata_match_free);
free(cfg);
}

@ -34,6 +34,7 @@ struct _E_Comp_Config
Eina_Bool fast_borders;
Eina_Bool fast_menus;
Eina_Bool fast_overrides;
Eina_Bool fast_objects;
struct
{
@ -45,6 +46,8 @@ struct _E_Comp_Config
Eina_List *overrides; // used for client menus, tooltips etc.
Eina_Bool disable_menus;
Eina_List *menus; // used for e menus
Eina_Bool disable_objects;
Eina_List *objects; // used for e objects which are not popups or menus
} match;
};

@ -27,6 +27,7 @@ e_comp_render_update_new(void)
void
e_comp_render_update_free(E_Comp_Render_Update *up)
{
if (!up) return;
free(up->tiles);
free(up);
}

@ -67,7 +67,7 @@ e_container_new(E_Manager *man)
o = evas_object_rectangle_add(con->bg_evas);
con->bg_blank_object = o;
E_LAYER_SET(o, E_COMP_CANVAS_LAYER_BOTTOM);
evas_object_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);

@ -308,6 +308,7 @@ e_desklock_show(Eina_Bool suspend)
return 0;
}
works:
e_comp_ignore_win_add(edd->elock_wnd);
if (e_config->desklock_language)
e_intl_language_set(e_config->desklock_language);
@ -425,6 +426,7 @@ _e_desklock_popup_add(E_Zone *zone)
evas = e_comp_get(zone)->evas;
evas_event_freeze(evas);
edp->bg_object = edje_object_add(evas);
evas_object_name_set(edp->bg_object, "desklock->bg_object");
if ((!bg) || (!strcmp(bg, "theme_desklock_background")))
{
@ -497,6 +499,7 @@ _e_desklock_login_box_add(E_Desklock_Popup_Data *edp)
evas = evas_object_evas_get(edp->bg_object);
edp->login_box = edje_object_add(evas);
evas_object_name_set(edp->login_box, "desklock->login_box");
e_theme_edje_object_set(edp->login_box,
"base/theme/desklock",
"e/desklock/login_box");

@ -780,7 +780,7 @@ _e_drag_win_get(const E_Drop_Handler *h, int xdnd)
break;
case E_POPUP_TYPE:
hwin = ((E_Popup *)(h->obj))->evas_win;
hwin = e_comp_get(h->obj)->win;
break;
/* FIXME: add more types as needed */

@ -2,14 +2,30 @@
/* local subsystem functions */
static void
_e_gadcon_popup_free(E_Gadcon_Popup *pop)
static Eina_Bool
_e_popup_autoclose_deskafter_show_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
{
if (pop->gadcon_was_locked)
_e_gadcon_popup_locked_set(pop, 0);
pop->gcc = NULL;
e_object_del(E_OBJECT(pop->win));
free(pop);
E_Event_Desk_After_Show *ev = event;
E_Gadcon_Popup *pop = data;
if (!pop->win->visible) return ECORE_CALLBACK_RENEW;
if (!e_gadcon_client_visible_get(pop->gcc, ev->desk))
e_object_del(E_OBJECT(pop));
return ECORE_CALLBACK_RENEW;
}
static Eina_Bool
_e_popup_autoclose_border_fullscreen_cb(void *data, int type EINA_UNUSED, void *event)
{
E_Event_Border_Fullscreen *ev = event;
E_Gadcon_Popup *pop = data;
if (!pop->win->visible) return ECORE_CALLBACK_RENEW;
if (!ev->border->fullscreen) return ECORE_CALLBACK_RENEW;
if (e_gadcon_client_visible_get(pop->gcc, ev->border->desk))
e_object_del(E_OBJECT(pop));
return ECORE_CALLBACK_RENEW;
}
static void
@ -23,23 +39,29 @@ _e_gadcon_popup_locked_set(E_Gadcon_Popup *pop, Eina_Bool locked)
}
static void
_e_gadcon_popup_size_recalc(E_Gadcon_Popup *pop, Evas_Object *obj)
_e_gadcon_popup_free(E_Gadcon_Popup *pop)
{
Evas_Coord w = 0, h = 0;
E_FN_DEL(ecore_event_handler_del, pop->autoclose_handlers[0]);
E_FN_DEL(ecore_event_handler_del, pop->autoclose_handlers[1]);
e_widget_size_min_get(obj, &w, &h);
if ((!w) || (!h)) evas_object_size_hint_min_get(obj, &w, &h);
if ((!w) || (!h))
{
edje_object_size_min_get(obj, &w, &h);
edje_object_size_min_restricted_calc(obj, &w, &h, w, h);
}
edje_extern_object_min_size_set(obj, w, h);
edje_object_size_min_calc(pop->o_bg, &pop->w, &pop->h);
evas_object_resize(pop->o_bg, pop->w, pop->h);
if (pop->gadcon_was_locked)
_e_gadcon_popup_locked_set(pop, 0);
pop->gcc = NULL;
evas_object_del(pop->content);
if (pop->win)
E_OBJECT_DEL_SET(pop->win, NULL);
E_FN_DEL(e_object_del, pop->win);
free(pop);
}
if (pop->win->visible)
_e_gadcon_popup_position(pop);
static void
_e_gadcon_popup_del_cb(void *obj)
{
E_Gadcon_Popup *pop;
pop = e_object_data_get(obj);
pop->win = NULL;
e_object_del(E_OBJECT(pop));
}
static void
@ -125,6 +147,27 @@ _e_gadcon_popup_position(E_Gadcon_Popup *pop)
_e_gadcon_popup_locked_set(pop, 1);
}
static void
_e_gadcon_popup_size_recalc(E_Gadcon_Popup *pop, Evas_Object *obj)
{
Evas_Coord w = 0, h = 0;
e_widget_size_min_get(obj, &w, &h);
if ((!w) || (!h)) evas_object_size_hint_min_get(obj, &w, &h);
if ((!w) || (!h))
{
edje_object_size_min_get(obj, &w, &h);
edje_object_size_min_restricted_calc(obj, &w, &h, w, h);
}
edje_extern_object_min_size_set(obj, w, h);
edje_object_size_min_calc(pop->o_bg, &pop->w, &pop->h);
evas_object_resize(pop->o_bg, pop->w, pop->h);
e_popup_resize(pop->win, pop->w, pop->h);
if (pop->win->visible)
_e_gadcon_popup_position(pop);
}
static void
_e_gadcon_popup_changed_size_hints_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
{
@ -147,13 +190,12 @@ e_gadcon_popup_new(E_Gadcon_Client *gcc)
if (!pop) return NULL;
zone = e_gadcon_client_zone_get(gcc);
pop->win = e_popup_new(zone, 0, 0, 0, 0);
e_popup_layer_set(pop->win, E_LAYER_POPUP);
e_object_data_set(E_OBJECT(pop->win), pop);
E_OBJECT_DEL_SET(pop->win, _e_gadcon_popup_del_cb);
o = edje_object_add(pop->win->evas);
e_theme_edje_object_set(o, "base/theme/gadman", "e/gadman/popup");
evas_object_show(o);
evas_object_move(o, 0, 0);
e_popup_edje_bg_object_set(pop->win, o);
e_popup_content_set(pop->win, o);
pop->o_bg = o;
pop->gcc = gcc;
@ -184,7 +226,7 @@ e_gadcon_popup_content_set(E_Gadcon_Popup *pop, Evas_Object *o)
evas_object_event_callback_add(o, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_e_gadcon_popup_changed_size_hints_cb, pop);
}
pop->content = o;
_e_gadcon_popup_size_recalc(pop, o);
}
@ -197,9 +239,10 @@ e_gadcon_popup_show(E_Gadcon_Popup *pop)
if (pop->win->visible) return;
e_popup_show(pop->win);
_e_gadcon_popup_position(pop);
pop->autoclose_handlers[0] = ecore_event_handler_add(E_EVENT_DESK_AFTER_SHOW, _e_popup_autoclose_deskafter_show_cb, NULL);
pop->autoclose_handlers[1] = ecore_event_handler_add(E_EVENT_BORDER_FULLSCREEN, _e_popup_autoclose_border_fullscreen_cb, NULL);
e_popup_show(pop->win);
}
EAPI void
@ -236,7 +279,6 @@ e_gadcon_popup_toggle_pinned(E_Gadcon_Popup *pop)
EAPI void
e_gadcon_popup_lock_set(E_Gadcon_Popup *pop, Eina_Bool setting)
{
if (!pop) return;
E_OBJECT_CHECK(pop);
E_OBJECT_TYPE_CHECK(pop, E_GADCON_POPUP_TYPE);

@ -16,6 +16,8 @@ struct _E_Gadcon_Popup
E_Gadcon_Client *gcc;
Evas_Coord w, h;
Evas_Object *o_bg;
Evas_Object *content;
Ecore_Event_Handler *autoclose_handlers[2];
Eina_Bool pinned : 1;
Eina_Bool gadcon_lock : 1;

@ -304,7 +304,7 @@ _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
if ((cfdata->escfg->popup != 0) || (cfdata->escfg->layer != 1))
{
cfdata->escfg->popup = 0;
cfdata->escfg->layer = 1;
cfdata->escfg->layer = E_COMP_CANVAS_LAYER_DESKTOP_TOP;
recreate = 1;
}
}

@ -161,6 +161,12 @@ _fix_user_default_edj(void)
if (ecore_file_exists(buff)) ecore_file_unlink(buff);
}
static void
_e_main_shelf_init_job(void *d EINA_UNUSED)
{
e_shelf_config_update();
}
/* externally accessible functions */
int
main(int argc, char **argv)
@ -1043,11 +1049,7 @@ main(int argc, char **argv)
TS("E_Shelf Init Done");
_e_main_shutdown_push(e_shelf_shutdown);
if (e_config->show_splash)
e_init_status_set(_("Configure Shelves"));
TS("E_Shelf Config Update");
e_shelf_config_update();
TS("E_Shelf Config Update Done");
ecore_job_add(_e_main_shelf_init_job, NULL);
TS("Manage all windows");
_e_main_manage_all();
@ -1887,7 +1889,6 @@ _e_main_cb_idle_before(void *data __UNUSED__)
e_menu_idler_before();
e_focus_idler_before();
e_border_idler_before();
e_popup_idler_before();
e_drag_idler_before();
e_pointer_idler_before();
EINA_LIST_FOREACH(_idle_before_list, l, eb)

@ -10,7 +10,6 @@ static void _e_move_end(void *data, void *bd);
static void _e_move_resize_object_coords_set(int x, int y, int w, int h);
static E_Popup *_disp_pop = NULL;
static Evas_Object *_obj = NULL;
static Eina_List *hooks = NULL;
static int visible = 0;
static int obj_x = 0;
@ -54,13 +53,13 @@ static void
_e_resize_begin(void *data __UNUSED__, void *border)
{
E_Border *bd = border;
Evas_Object *o;
Evas_Coord ew, eh;
char buf[40];
int w, h;
if (_disp_pop) e_object_del(E_OBJECT(_disp_pop));
_disp_pop = NULL;
_obj = NULL;
if (!e_config->resize_info_visible)
return;
@ -74,27 +73,15 @@ _e_resize_begin(void *data __UNUSED__, void *border)
_disp_pop = e_popup_new(bd->zone, 0, 0, 1, 1);
if (!_disp_pop) return;
e_popup_layer_set(_disp_pop, E_LAYER_POPUP);
_obj = edje_object_add(_disp_pop->evas);
e_theme_edje_object_set(_obj, "base/theme/borders",
o = edje_object_add(_disp_pop->evas);
e_theme_edje_object_set(o, "base/theme/borders",
"e/widgets/border/default/resize");
snprintf(buf, sizeof(buf), "9999x9999");
edje_object_part_text_set(_obj, "e.text.label", buf);
edje_object_part_text_set(o, "e.text.label", buf);
edje_object_size_min_calc(_obj, &ew, &eh);
evas_object_move(_obj, 0, 0);
evas_object_resize(_obj, ew, eh);
evas_object_show(_obj);
e_popup_edje_bg_object_set(_disp_pop, _obj);
if (!visible)
{
evas_object_show(_obj);
e_popup_show(_disp_pop);
visible = 1;
}
edje_object_size_min_calc(o, &ew, &eh);
snprintf(buf, sizeof(buf), _("%i×%i"), w, h);
edje_object_part_text_set(_obj, "e.text.label", buf);
edje_object_part_text_set(_disp_pop->content, "e.text.label", buf);
e_popup_move_resize(_disp_pop,
(obj_x - _disp_pop->zone->x) +
@ -102,10 +89,10 @@ _e_resize_begin(void *data __UNUSED__, void *border)
(obj_y - _disp_pop->zone->y) +
((obj_h - eh) / 2),
ew, eh);
e_popup_content_set(_disp_pop, o);
e_popup_show(_disp_pop);
visible = 1;
snprintf(buf, sizeof(buf), _("%i×%i"), w, h);
edje_object_part_text_set(o, "e.text.label", buf);
}
static void
@ -113,11 +100,6 @@ _e_resize_end(void *data __UNUSED__, void *border __UNUSED__)
{
if (e_config->resize_info_visible)
{
if (_obj)
{
evas_object_del(_obj);
_obj = NULL;
}
if (_disp_pop)
{
e_object_del(E_OBJECT(_disp_pop));
@ -139,19 +121,16 @@ _e_resize_update(void *data __UNUSED__, void *border)
if (e_config->resize_info_follows)
_e_move_resize_object_coords_set(bd->x + bd->fx.x, bd->y + bd->fx.y, bd->w, bd->h);
else
_e_move_resize_object_coords_set(bd->zone->x, bd->zone->y, bd->zone->w, bd->zone->h);
_e_resize_border_extents(bd, &w, &h);
if (!visible)
{
evas_object_show(_obj);
e_popup_show(_disp_pop);
visible = 1;
}
snprintf(buf, sizeof(buf), _("%i×%i"), w, h);
edje_object_part_text_set(_obj, "e.text.label", buf);
edje_object_part_text_set(_disp_pop->content, "e.text.label", buf);
}
static void
@ -186,12 +165,12 @@ static void
_e_move_begin(void *data __UNUSED__, void *border)
{
E_Border *bd = border;
Evas_Object *o;
Evas_Coord ew, eh;
char buf[40];
if (_disp_pop) e_object_del(E_OBJECT(_disp_pop));
_disp_pop = NULL;
_obj = NULL;
if (!e_config->move_info_visible)
return;
@ -202,17 +181,15 @@ _e_move_begin(void *data __UNUSED__, void *border)
_e_move_resize_object_coords_set(bd->zone->x, bd->zone->y, bd->zone->w, bd->zone->h);
_disp_pop = e_popup_new(bd->zone, 0, 0, 1, 1);
_obj = edje_object_add(_disp_pop->evas);
e_theme_edje_object_set(_obj, "base/theme/borders",
o = edje_object_add(_disp_pop->evas);
e_theme_edje_object_set(o, "base/theme/borders",
"e/widgets/border/default/move");
snprintf(buf, sizeof(buf), "9999 9999");
edje_object_part_text_set(_obj, "e.text.label", buf);
edje_object_part_text_set(o, "e.text.label", buf);
edje_object_size_min_calc(_obj, &ew, &eh);
evas_object_move(_obj, 0, 0);
evas_object_resize(_obj, ew, eh);
evas_object_show(_obj);
e_popup_edje_bg_object_set(_disp_pop, _obj);
edje_object_size_min_calc(o, &ew, &eh);
snprintf(buf, sizeof(buf), "%i %i", bd->x, bd->y);
edje_object_part_text_set(o, "e.text.label", buf);
e_popup_move_resize(_disp_pop,
(obj_x - _disp_pop->zone->x) +
@ -220,6 +197,7 @@ _e_move_begin(void *data __UNUSED__, void *border)
(obj_y - _disp_pop->zone->y) +
((obj_h - eh) / 2),
ew, eh);
e_popup_content_set(_disp_pop, o);
}
static void
@ -227,11 +205,6 @@ _e_move_end(void *data __UNUSED__, void *border __UNUSED__)
{
if (e_config->move_info_visible)
{
if (_obj)
{
evas_object_del(_obj);
_obj = NULL;
}
if (_disp_pop)
{
e_object_del(E_OBJECT(_disp_pop));
@ -252,17 +225,14 @@ _e_move_update(void *data __UNUSED__, void *border)
if (e_config->move_info_follows)
_e_move_resize_object_coords_set(bd->x + bd->fx.x, bd->y + bd->fx.y, bd->w, bd->h);
else
_e_move_resize_object_coords_set(bd->zone->x, bd->zone->y, bd->zone->w, bd->zone->h);
if (!visible)
{
evas_object_show(_obj);
e_popup_show(_disp_pop);
visible = 1;
}
snprintf(buf, sizeof(buf), "%i %i", bd->x, bd->y);
edje_object_part_text_set(_obj, "e.text.label", buf);
edje_object_part_text_set(_disp_pop->content, "e.text.label", buf);
}
static void

@ -1,36 +1,127 @@
#include "e.h"
/* local subsystem functions */
static void _e_popup_free(E_Popup *pop);
static Eina_Bool _e_popup_idle_enterer(void *data);
static Eina_Bool _e_popup_cb_window_shape(void *data, int ev_type, void *ev);
/* local subsystem globals */
static Ecore_Event_Handler *_e_popup_window_shape_handler = NULL;
static Eina_List *_e_popup_list = NULL;
static Eina_Hash *_e_popup_hash = NULL;
static E_Popup *autoclose_popup = NULL;
static Ecore_Event_Handler *autoclose_handlers[4] = {NULL};
static Eina_Bool autoclose_down_obj = EINA_FALSE;
static unsigned int autoclose_event = 0;
/* local subsystem functions */
static void
_e_popup_autoclose_cleanup(void)
{
if (autoclose_popup)
e_grabinput_release(0, e_comp_get(autoclose_popup)->ee_win);
E_FN_DEL(e_object_del, autoclose_popup);
E_FN_DEL(ecore_event_handler_del, autoclose_handlers[0]);
E_FN_DEL(ecore_event_handler_del, autoclose_handlers[1]);
E_FN_DEL(ecore_event_handler_del, autoclose_handlers[2]);
E_FN_DEL(ecore_event_handler_del, autoclose_handlers[3]);
autoclose_down_obj = 0;
}
static void
_e_popup_free(E_Popup *pop)
{
e_object_unref(E_OBJECT(pop->zone));
if (pop->autoclose)
_e_popup_autoclose_cleanup();
E_FN_DEL(e_object_del, pop->shape);
E_FREE_LIST(pop->objects, evas_object_del);
pop->zone->popups = eina_list_remove(pop->zone->popups, pop);
eina_stringshare_del(pop->name);
_e_popup_list = eina_list_remove(_e_popup_list, pop);
free(pop);
}
static void
_e_popup_obj_autoclose_mouse_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
autoclose_down_obj = 1;
}
static Eina_Bool
_e_popup_autoclose_focus_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
{
_e_popup_autoclose_cleanup();
return ECORE_CALLBACK_RENEW;
}
static Eina_Bool
_e_popup_autoclose_key_down_cb(void *data, int type EINA_UNUSED, void *event)
{
Ecore_Event_Key *ev = event;
Eina_Bool del = EINA_TRUE;
if (autoclose_popup->key_cb)
del = !autoclose_popup->key_cb(data, ev);
if (del) _e_popup_autoclose_cleanup();
return ECORE_CALLBACK_RENEW;
}
static Eina_Bool
_e_popup_autoclose_mouse_up_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
{
Ecore_Event_Mouse_Button *ev = event;
if (autoclose_event && ((!autoclose_down_obj) || (ev->event_window != e_comp_get(autoclose_popup)->ee_win)))
_e_popup_autoclose_cleanup();
else
autoclose_event++;
autoclose_down_obj = 0;
return ECORE_CALLBACK_RENEW;
}
static Eina_Bool
_e_popup_autoclose_mouse_down_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
{
Ecore_Event_Mouse_Button *ev = event;
if (ev->event_window != e_comp_get(autoclose_popup)->ee_win)
_e_popup_autoclose_cleanup();
autoclose_event++;
return ECORE_CALLBACK_RENEW;
}
static void
_e_popup_autoclose_setup(E_Popup *pop)
{
E_FN_DEL(e_object_del, autoclose_popup);
autoclose_event = 0;
evas_object_event_callback_add(pop->content, EVAS_CALLBACK_MOUSE_DOWN, _e_popup_obj_autoclose_mouse_down_cb, NULL);
autoclose_popup = pop;
if (autoclose_handlers[0])
ecore_event_handler_data_set(autoclose_handlers[0], pop->key_data);
else
autoclose_handlers[0] = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, _e_popup_autoclose_mouse_down_cb, pop->key_data);
if (autoclose_handlers[1])
ecore_event_handler_data_set(autoclose_handlers[1], pop->key_data);
else
autoclose_handlers[1] = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP, _e_popup_autoclose_mouse_up_cb, pop->key_data);
if (autoclose_handlers[2])
ecore_event_handler_data_set(autoclose_handlers[2], pop->key_data);
else
autoclose_handlers[2] = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _e_popup_autoclose_key_down_cb, pop->key_data);
if (autoclose_handlers[3])
ecore_event_handler_data_set(autoclose_handlers[3], pop->key_data);
else
autoclose_handlers[3] = ecore_event_handler_add(E_EVENT_BORDER_FOCUS_IN, _e_popup_autoclose_focus_cb, pop->key_data);
e_grabinput_get(0, 0, e_comp_get(pop)->ee_win);
}
/* externally accessible functions */
EINTERN int
e_popup_init(void)
{
_e_popup_window_shape_handler =
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHAPE,
_e_popup_cb_window_shape, NULL);
if (!_e_popup_hash) _e_popup_hash = eina_hash_string_superfast_new(NULL);
return 1;
}
EINTERN int
e_popup_shutdown(void)
{
if (_e_popup_hash)
{
eina_hash_free(_e_popup_hash);
_e_popup_hash = NULL;
}
E_FN_DEL(ecore_event_handler_del, _e_popup_window_shape_handler);
_e_popup_autoclose_cleanup();
return 1;
}
@ -43,6 +134,7 @@ e_popup_new(E_Zone *zone, int x, int y, int w, int h)
if (!pop) return NULL;
e_object_delay_del_set(E_OBJECT(pop), e_popup_hide);
pop->zone = zone;
pop->ecore_evas = zone->container->bg_ecore_evas;
pop->zx = pop->zone->x;
pop->zy = pop->zone->y;
pop->x = x;
@ -50,38 +142,34 @@ e_popup_new(E_Zone *zone, int x, int y, int w, int h)
pop->w = w;
pop->h = h;
pop->layer = E_LAYER_POPUP;
pop->ecore_evas = e_canvas_new(pop->zone->container->win,
pop->zone->x + pop->x, pop->zone->y + pop->y, pop->w, pop->h, 1, 1,
&(pop->evas_win));
if (!pop->ecore_evas)
{
free(pop);
return NULL;
}
/* avoid excess exposes when shaped - set damage avoid to 1 */
// ecore_evas_avoid_damage_set(pop->ecore_evas, 1);
e_canvas_add(pop->ecore_evas);
pop->shape = e_container_shape_add(pop->zone->container);
e_container_shape_move(pop->shape, pop->zone->x + pop->x, pop->zone->y + pop->y);
e_container_shape_resize(pop->shape, pop->w, pop->h);
pop->evas = ecore_evas_get(pop->ecore_evas);
e_container_window_raise(pop->zone->container, pop->evas_win, pop->layer);
ecore_x_window_shape_events_select(pop->evas_win, 1);
ecore_evas_name_class_set(pop->ecore_evas, "E", "_e_popup_window");
ecore_evas_title_set(pop->ecore_evas, "E Popup");
pop->comp_layer = E_COMP_CANVAS_LAYER_LAYOUT;
pop->evas = e_comp_get(zone)->evas;
pop->shape = e_container_shape_add(zone->container);
e_object_ref(E_OBJECT(pop->zone));
pop->zone->popups = eina_list_append(pop->zone->popups, pop);
_e_popup_list = eina_list_append(_e_popup_list, pop);
eina_hash_add(_e_popup_hash, e_util_winid_str_get(pop->evas_win), pop);
return pop;
}
EAPI void
e_popup_name_set(E_Popup *pop, const char *name)
e_popup_content_set(E_Popup *pop, Evas_Object *obj)
{
if (eina_stringshare_replace(&pop->name, name))
ecore_evas_name_class_set(pop->ecore_evas, "E", pop->name);
E_OBJECT_CHECK(pop);
E_OBJECT_TYPE_CHECK(pop, E_POPUP_TYPE);
if (pop->content) evas_object_del(pop->content);
pop->content = obj;
evas_object_data_set(obj, "eobj", pop);
evas_object_move(obj, pop->zone->x + pop->x, pop->zone->y + pop->y);
evas_object_resize(obj, pop->w, pop->h);
e_popup_layer_set(pop, pop->comp_layer, pop->layer);
e_popup_ignore_events_set(pop, pop->ignore_events);
if (pop->visible)
{
e_comp_win_moveresize(pop->cw, pop->zone->x + pop->x, pop->zone->y + pop->y, pop->w, pop->h);
evas_object_show(obj);
}
}
EAPI void
@ -89,23 +177,13 @@ e_popup_show(E_Popup *pop)
{
E_OBJECT_CHECK(pop);
E_OBJECT_TYPE_CHECK(pop, E_POPUP_TYPE);
if (pop->visible) return;
pop->visible = 1;
if (pop->shaped && e_config->use_shaped_win)
{
ecore_evas_move(pop->ecore_evas,
pop->zone->container->manager->w,
pop->zone->container->manager->h);
ecore_evas_show(pop->ecore_evas);
if (pop->idle_enterer) ecore_idle_enterer_del(pop->idle_enterer);
pop->idle_enterer = ecore_idle_enterer_add(_e_popup_idle_enterer, pop);
}
else
{
ecore_evas_show(pop->ecore_evas);
if (!pop->shaped || e_config->use_shaped_win)
e_container_shape_show(pop->shape);
}
e_comp_win_moveresize(pop->cw, pop->zone->x + pop->x, pop->zone->y + pop->y, pop->w, pop->h);
e_comp_win_show(pop->cw);
if (pop->autoclose) _e_popup_autoclose_setup(pop);
}
EAPI void
@ -114,11 +192,12 @@ e_popup_hide(E_Popup *pop)
E_OBJECT_CHECK(pop);
E_OBJECT_TYPE_CHECK(pop, E_POPUP_TYPE);
if (!pop->visible) return;
if (pop->idle_enterer) ecore_idle_enterer_del(pop->idle_enterer);
pop->idle_enterer = NULL;
pop->visible = 0;
ecore_evas_hide(pop->ecore_evas);
e_container_shape_hide(pop->shape);
e_comp_win_hide(pop->cw);
if (!pop->autoclose) return;
if (e_object_is_del(E_OBJECT(pop))) return;
autoclose_popup = NULL;
_e_popup_autoclose_cleanup();
}
EAPI void
@ -132,12 +211,8 @@ e_popup_move(E_Popup *pop, int x, int y)
pop->zy = pop->zone->y;
pop->x = x;
pop->y = y;
ecore_evas_move(pop->ecore_evas,
pop->zone->x + pop->x,
pop->zone->y + pop->y);
e_container_shape_move(pop->shape,
pop->zone->x + pop->x,
pop->zone->y + pop->y);
if (!pop->cw) return;
e_comp_win_move(pop->cw, pop->zone->x + pop->x, pop->zone->y + pop->y);
}
EAPI void
@ -148,8 +223,8 @@ e_popup_resize(E_Popup *pop, int w, int h)
if ((pop->w == w) && (pop->h == h)) return;
pop->w = w;
pop->h = h;
ecore_evas_resize(pop->ecore_evas, pop->w, pop->h);
e_container_shape_resize(pop->shape, pop->w, pop->h);
if (!pop->cw) return;
e_comp_win_resize(pop->cw, pop->w, pop->h);
}
EAPI void
@ -160,206 +235,66 @@ e_popup_move_resize(E_Popup *pop, int x, int y, int w, int h)
if ((pop->x == x) && (pop->y == y) &&
(pop->w == w) && (pop->h == h) &&
(pop->zone->x == pop->zx) && (pop->zone->y == pop->zy)) return;
pop->zx = pop->zone->x;
pop->zy = pop->zone->y;
pop->x = x;
pop->y = y;
pop->w = w;
pop->h = h;
ecore_evas_move_resize(pop->ecore_evas,
pop->zone->x + pop->x,
pop->zone->y + pop->y,
pop->w, pop->h);
e_container_shape_move(pop->shape,
pop->zone->x + pop->x,
pop->zone->y + pop->y);
e_container_shape_resize(pop->shape, pop->w, pop->h);
if (!pop->cw) return;
e_comp_win_moveresize(pop->cw, pop->zone->x + x, pop->zone->y + y, w, h);
}
EAPI void
e_popup_ignore_events_set(E_Popup *pop, int ignore)
{
ecore_evas_ignore_events_set(pop->ecore_evas, ignore);
E_OBJECT_CHECK(pop);
E_OBJECT_TYPE_CHECK(pop, E_POPUP_TYPE);
ignore = !!ignore;
pop->ignore_events = ignore;
if (pop->cw)
e_comp_win_ignore_events_set(pop->cw, ignore);
}
EAPI void
e_popup_edje_bg_object_set(E_Popup *pop, Evas_Object *o)
e_popup_layer_set(E_Popup *pop, E_Comp_Canvas_Layer comp_layer, E_Layer layer)
{
const char *shape_option;
E_OBJECT_CHECK(pop);
E_OBJECT_TYPE_CHECK(pop, E_POPUP_TYPE);
shape_option = edje_object_data_get(o, "shaped");
if (shape_option)
{
if (!strcmp(shape_option, "1"))
pop->shaped = 1;
else
pop->shaped = 0;
if (!e_config->use_shaped_win)
{
ecore_evas_alpha_set(pop->ecore_evas, pop->shaped);
eina_hash_del(_e_popup_hash, e_util_winid_str_get(pop->evas_win), pop);
pop->evas_win = ecore_evas_software_x11_window_get(pop->ecore_evas);
eina_hash_add(_e_popup_hash, e_util_winid_str_get(pop->evas_win), pop);
e_container_window_raise(pop->zone->container, pop->evas_win, pop->layer);
}
else
ecore_evas_shaped_set(pop->ecore_evas, pop->shaped);
}
pop->comp_layer = comp_layer;
pop->layer = layer;
if (!pop->content) return;
if (comp_layer == E_COMP_CANVAS_LAYER_LAYOUT)
E_LAYER_LAYOUT_ADD(pop->content, layer);
else
{
pop->shaped = 0;
ecore_evas_alpha_set(pop->ecore_evas, pop->shaped);
eina_hash_del(_e_popup_hash, e_util_winid_str_get(pop->evas_win), pop);
pop->evas_win = ecore_evas_software_x11_window_get(pop->ecore_evas);
eina_hash_add(_e_popup_hash, e_util_winid_str_get(pop->evas_win), pop);
e_container_window_raise(pop->zone->container, pop->evas_win, pop->layer);
ecore_evas_shaped_set(pop->ecore_evas, pop->shaped);
}
E_LAYER_SET_ABOVE(pop->content, comp_layer);
}
EAPI void
e_popup_layer_set(E_Popup *pop, E_Layer layer)
e_popup_name_set(E_Popup *pop, const char *name)
{
E_OBJECT_CHECK(pop);
E_OBJECT_TYPE_CHECK(pop, E_POPUP_TYPE);
pop->layer = layer;
e_container_window_raise(pop->zone->container, pop->evas_win, pop->layer);
eina_stringshare_replace(&pop->name, name);
}
EAPI void
e_popup_idler_before(void)
{
Eina_List *l;
E_Popup *pop;
EINA_LIST_FOREACH(_e_popup_list, l, pop)
{
if (pop->need_shape_export)
{
Ecore_X_Rectangle *rects, *orects;
int num;
rects = ecore_x_window_shape_rectangles_get(pop->evas_win, &num);
if (rects)
{
int changed;
changed = 1;
if ((num == pop->shape_rects_num) && (pop->shape_rects))
{
int i;
orects = pop->shape_rects;
changed = 0;
for (i = 0; i < num; i++)
{
if (rects[i].x < 0)
{
rects[i].width -= rects[i].x;
rects[i].x = 0;
}
if ((rects[i].x + (int)rects[i].width) > pop->w)
rects[i].width = rects[i].width - rects[i].x;
if (rects[i].y < 0)
{
rects[i].height -= rects[i].y;
rects[i].y = 0;
}
if ((rects[i].y + (int)rects[i].height) > pop->h)
rects[i].height = rects[i].height - rects[i].y;
if ((orects[i].x != rects[i].x) ||
(orects[i].y != rects[i].y) ||
(orects[i].width != rects[i].width) ||
(orects[i].height != rects[i].height))
{
changed = 1;
break;
}
}
}
if (changed)
{
E_FREE(pop->shape_rects);
pop->shape_rects = rects;
pop->shape_rects_num = num;
e_container_shape_rects_set(pop->shape, rects, num);
}
else
free(rects);
}
else
{
E_FREE(pop->shape_rects);
pop->shape_rects = NULL;
pop->shape_rects_num = 0;
e_container_shape_rects_set(pop->shape, NULL, 0);
}
pop->need_shape_export = 0;
}
if ((pop->visible) && (!pop->idle_enterer) &&
(!pop->shaped && !e_config->use_shaped_win))
e_container_shape_show(pop->shape);
}
}
EAPI E_Popup *
e_popup_find_by_window(Ecore_X_Window win)
e_popup_object_add(E_Popup *pop, Evas_Object *obj)
{
E_Popup *pop;
pop = eina_hash_find(_e_popup_hash, e_util_winid_str_get(win));
if ((pop) && (pop->evas_win != win))
return NULL;
return pop;
}
/* local subsystem functions */
static void
_e_popup_free(E_Popup *pop)
{
if (pop->idle_enterer) ecore_idle_enterer_del(pop->idle_enterer);
pop->idle_enterer = NULL;
E_FREE(pop->shape_rects);
pop->shape_rects_num = 0;
e_container_shape_hide(pop->shape);
e_object_del(E_OBJECT(pop->shape));
e_canvas_del(pop->ecore_evas);
ecore_evas_free(pop->ecore_evas);
e_object_unref(E_OBJECT(pop->zone));
pop->zone->popups = eina_list_remove(pop->zone->popups, pop);
_e_popup_list = eina_list_remove(_e_popup_list, pop);
eina_hash_del(_e_popup_hash, e_util_winid_str_get(pop->evas_win), pop);
if (pop->name) eina_stringshare_del(pop->name);
free(pop);
}
static Eina_Bool
_e_popup_idle_enterer(void *data)
{
E_Popup *pop;
E_OBJECT_CHECK(pop);
E_OBJECT_TYPE_CHECK(pop, E_POPUP_TYPE);
if (!(pop = data)) return ECORE_CALLBACK_CANCEL;
ecore_evas_move(pop->ecore_evas,
pop->zone->x + pop->x,
pop->zone->y + pop->y);
e_container_shape_show(pop->shape);
pop->idle_enterer = NULL;
return ECORE_CALLBACK_CANCEL;
pop->objects = eina_list_append(pop->objects, obj);
}
static Eina_Bool
_e_popup_cb_window_shape(void *data __UNUSED__, int ev_type __UNUSED__, void *ev)
EAPI void
e_popup_autoclose(E_Popup *pop, E_Popup_Key_Cb cb, const void *data)
{
E_Popup *pop;
Ecore_X_Event_Window_Shape *e;
E_OBJECT_CHECK(pop);
E_OBJECT_TYPE_CHECK(pop, E_POPUP_TYPE);
e = ev;
pop = e_popup_find_by_window(e->win);
if (pop) pop->need_shape_export = 1;
return ECORE_CALLBACK_PASS_ON;
pop->autoclose = 1;
pop->key_cb = cb;
pop->key_data = (void*)data;
if (!pop->visible) return;
_e_popup_autoclose_setup(pop);
}