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
This commit is contained in:
Mike Blumenkrantz 2013-02-18 13:43:47 +00:00
parent 0e466612d6
commit f36ecd9d3d
39 changed files with 1072 additions and 1072 deletions

View File

@ -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

1
NEWS
View File

@ -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.

View File

@ -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;
}

View File

@ -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

View File

@ -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

View File

@ -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);
}

View File

@ -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;
};

View File

@ -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);
}

View File

@ -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);

View File

@ -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");

View File

@ -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 */

View File

@ -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);

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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)

View File

@ -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

View File

@ -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);
pop->comp_layer = E_COMP_CANVAS_LAYER_LAYOUT;
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->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)
{
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);
}
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);
}
}
EAPI void
e_popup_layer_set(E_Popup *pop, E_Layer layer)
e_popup_layer_set(E_Popup *pop, E_Comp_Canvas_Layer comp_layer, E_Layer layer)
{
E_OBJECT_CHECK(pop);
E_OBJECT_TYPE_CHECK(pop, E_POPUP_TYPE);
pop->comp_layer = comp_layer;
pop->layer = layer;
e_container_window_raise(pop->zone->container, pop->evas_win, pop->layer);
if (!pop->content) return;
if (comp_layer == E_COMP_CANVAS_LAYER_LAYOUT)
E_LAYER_LAYOUT_ADD(pop->content, layer);
else
E_LAYER_SET_ABOVE(pop->content, comp_layer);
}
EAPI void
e_popup_idler_before(void)
e_popup_name_set(E_Popup *pop, const char *name)
{
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);
}
E_OBJECT_CHECK(pop);
E_OBJECT_TYPE_CHECK(pop, E_POPUP_TYPE);
eina_stringshare_replace(&pop->name, name);
}
EAPI E_Popup *
e_popup_find_by_window(Ecore_X_Window win)
EAPI void
e_popup_object_add(E_Popup *pop, Evas_Object *obj)
{
E_Popup *pop;
E_OBJECT_CHECK(pop);
E_OBJECT_TYPE_CHECK(pop, E_POPUP_TYPE);
pop = eina_hash_find(_e_popup_hash, e_util_winid_str_get(win));
if ((pop) && (pop->evas_win != win))
return NULL;
return pop;
pop->objects = eina_list_append(pop->objects, obj);
}
/* local subsystem functions */
static void
_e_popup_free(E_Popup *pop)
EAPI void
e_popup_autoclose(E_Popup *pop, E_Popup_Key_Cb cb, const void *data)
{
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);
E_OBJECT_CHECK(pop);
E_OBJECT_TYPE_CHECK(pop, E_POPUP_TYPE);
pop->autoclose = 1;
pop->key_cb = cb;
pop->key_data = (void*)data;
if (!pop->visible) return;
_e_popup_autoclose_setup(pop);
}
static Eina_Bool
_e_popup_idle_enterer(void *data)
{
E_Popup *pop;
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;
}
static Eina_Bool
_e_popup_cb_window_shape(void *data __UNUSED__, int ev_type __UNUSED__, void *ev)
{
E_Popup *pop;
Ecore_X_Event_Window_Shape *e;
e = ev;
pop = e_popup_find_by_window(e->win);
if (pop) pop->need_shape_export = 1;
return ECORE_CALLBACK_PASS_ON;
}

View File

@ -1,6 +1,7 @@
#ifdef E_TYPEDEFS
typedef struct _E_Popup E_Popup;
typedef Eina_Bool (*E_Popup_Key_Cb)(void *, Ecore_Event_Key *);
#else
#ifndef E_POPUP_H
@ -13,37 +14,39 @@ struct _E_Popup
E_Object e_obj_inherit;
int x, y, w, h, zx, zy;
E_Layer layer;
unsigned char visible : 1;
unsigned char shaped : 1;
unsigned char need_shape_export : 1;
E_Comp_Canvas_Layer comp_layer;
E_Layer layer;
Ecore_Evas *ecore_evas;
Evas *evas;
Ecore_X_Window evas_win;
E_Container_Shape *shape;
E_Comp_Win *cw;
E_Zone *zone;
const char *name;
int shape_rects_num;
Ecore_X_Rectangle *shape_rects;
Ecore_Idle_Enterer *idle_enterer;
Ecore_Evas *ecore_evas;
E_Container_Shape *shape;
Evas_Object *content;
Eina_List *objects;
Eina_Stringshare *name;
E_Popup_Key_Cb key_cb;
void *key_data;
Eina_Bool visible : 1;
Eina_Bool ignore_events : 1;
Eina_Bool autoclose : 1;
};
EINTERN int e_popup_init(void);
EINTERN int e_popup_shutdown(void);
EAPI E_Popup *e_popup_new(E_Zone *zone, int x, int y, int w, int h);
EAPI void e_popup_name_set(E_Popup *pop, const char *name);
EAPI void e_popup_show(E_Popup *pop);
EAPI void e_popup_hide(E_Popup *pop);
EAPI void e_popup_move(E_Popup *pop, int x, int y);
EAPI void e_popup_resize(E_Popup *pop, int w, int h);
EAPI void e_popup_content_set(E_Popup *pop, Evas_Object *obj);
EAPI void e_popup_move_resize(E_Popup *pop, int x, int y, int w, int h);
EAPI void e_popup_ignore_events_set(E_Popup *pop, int ignore);
EAPI void e_popup_edje_bg_object_set(E_Popup *pop, Evas_Object *o);
EAPI void e_popup_layer_set(E_Popup *pop, E_Layer layer);
EAPI void e_popup_idler_before(void);
EAPI E_Popup *e_popup_find_by_window(Ecore_X_Window win);
EAPI void e_popup_layer_set(E_Popup *pop, E_Comp_Canvas_Layer comp_layer, E_Layer layer);
EAPI void e_popup_name_set(E_Popup *pop, const char *name);
EAPI void e_popup_object_add(E_Popup *pop, Evas_Object *obj);
EAPI void e_popup_autoclose(E_Popup *pop, E_Popup_Key_Cb cb, const void *data);
#endif
#endif

View File

@ -36,12 +36,10 @@ static Eina_Bool _e_shelf_on_current_desk(E_Shelf *es, E_Event_Zone_Edge *ev)
static void _e_shelf_cb_dummy_del(E_Shelf *, Evas *e, Evas_Object *obj, void *event_info);
static void _e_shelf_cb_dummy_moveresize(E_Shelf *, Evas *e, Evas_Object *obj, void *event_info);
static Eina_Bool _e_shelf_gadcon_populate_handler_cb(void *, int, void *);
static Eina_Bool _e_shelf_module_init_end_handler_cb(void *, int, void *);
static void _e_shelf_event_rename_end_cb(void *data, E_Event_Shelf *ev);
static Eina_List *shelves = NULL;
static Eina_List *dummies = NULL;
static Eina_Hash *winid_shelves = NULL;
static int orientations[] =
{
@ -96,7 +94,6 @@ e_shelf_init(void)
E_EVENT_SHELF_ADD = ecore_event_type_new();
E_EVENT_SHELF_DEL = ecore_event_type_new();
_e_shelf_gadcon_populate_handler = ecore_event_handler_add(E_EVENT_GADCON_POPULATE, _e_shelf_gadcon_populate_handler_cb, NULL);
_e_shelf_module_init_end_handler = ecore_event_handler_add(E_EVENT_MODULE_INIT_END, _e_shelf_module_init_end_handler_cb, NULL);
return 1;
}
@ -217,29 +214,24 @@ e_shelf_zone_new(E_Zone *zone, const char *name, const char *style, int popup, E
{
es->popup = e_popup_new(zone, es->x, es->y, es->w, es->h);
e_popup_name_set(es->popup, "shelf");
e_popup_layer_set(es->popup, layer);
es->ee = es->popup->ecore_evas;
es->evas = es->popup->evas;
}
else
{
es->ee = zone->container->bg_ecore_evas;
es->evas = zone->container->bg_evas;
if (layer)
e_popup_layer_set(es->popup, E_COMP_CANVAS_LAYER_LAYOUT, E_LAYER_ABOVE);
else
e_popup_layer_set(es->popup, E_COMP_CANVAS_LAYER_DESKTOP_TOP, 0);
}
es->ee = zone->container->bg_ecore_evas;
es->evas = zone->container->bg_evas;
es->fit_along = 1;
es->layer = layer;
es->o_event = evas_object_rectangle_add(es->evas);
evas_object_color_set(es->o_event, 0, 0, 0, 0);
evas_object_resize(es->o_event, es->w, es->h);
evas_object_event_callback_add(es->o_event, EVAS_CALLBACK_MOUSE_DOWN,
_e_shelf_cb_mouse_down, es);
es->handlers =
eina_list_append(es->handlers,
ecore_event_handler_add(E_EVENT_ZONE_EDGE_MOVE,
_e_shelf_cb_mouse_in, es));
es->o_base = edje_object_add(es->evas);
evas_object_event_callback_add(es->o_base, EVAS_CALLBACK_MOUSE_DOWN,
_e_shelf_cb_mouse_down, es);
evas_object_name_set(es->o_base, name);
es->name = eina_stringshare_add(name);
evas_object_resize(es->o_base, es->w, es->h);
@ -247,16 +239,11 @@ e_shelf_zone_new(E_Zone *zone, const char *name, const char *style, int popup, E
if (es->popup)
{
evas_object_show(es->o_event);
evas_object_show(es->o_base);
ecore_x_netwm_window_type_set(es->popup->evas_win,
ECORE_X_WINDOW_TYPE_DOCK);
e_popup_show(es->popup);
}
else
{
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);
E_LAYER_SET(es->o_event, layer);
E_LAYER_SET(es->o_base, layer);
}
@ -288,23 +275,9 @@ e_shelf_zone_new(E_Zone *zone, const char *name, const char *style, int popup, E
e_gadcon_zone_set(es->gadcon, zone);
e_gadcon_ecore_evas_set(es->gadcon, es->ee);
e_gadcon_shelf_set(es->gadcon, es);
if (popup)
{
if (!winid_shelves)
winid_shelves = eina_hash_string_superfast_new(NULL);
eina_hash_add(winid_shelves,
e_util_winid_str_get(es->popup->evas_win), es);
e_drop_xdnd_register_set(es->popup->evas_win, 1);
e_gadcon_xdnd_window_set(es->gadcon, es->popup->evas_win);
e_gadcon_dnd_window_set(es->gadcon, es->popup->evas_win);
}
else
{
e_drop_xdnd_register_set(es->zone->container->bg_win, 1);
e_gadcon_xdnd_window_set(es->gadcon, es->zone->container->bg_win);
e_gadcon_dnd_window_set(es->gadcon, es->zone->container->event_win);
evas_object_clip_set(es->o_base, es->zone->bg_clip_object);
}
e_gadcon_xdnd_window_set(es->gadcon, e_comp_get(es)->win);
e_gadcon_dnd_window_set(es->gadcon, e_comp_get(es)->win);
evas_object_clip_set(es->o_base, es->zone->bg_clip_object);
e_gadcon_util_menu_attach_func_set(es->gadcon,
_e_shelf_cb_menu_items_append, es);
@ -387,10 +360,7 @@ e_shelf_show(E_Shelf *es)
if (es->popup)
e_popup_show(es->popup);
else
{
evas_object_show(es->o_event);
evas_object_show(es->o_base);
}
evas_object_show(es->o_base);
}
EAPI void
@ -401,10 +371,7 @@ e_shelf_hide(E_Shelf *es)
if (es->popup)
e_popup_hide(es->popup);
else
{
evas_object_hide(es->o_event);
evas_object_hide(es->o_base);
}
evas_object_hide(es->o_base);
}
EAPI void
@ -527,10 +494,7 @@ e_shelf_move(E_Shelf *es, int x, int y)
if (es->popup)
e_popup_move(es->popup, es->x, es->y);
else
{
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_move(es->o_base, es->zone->x + es->x, es->zone->y + es->y);
}
EAPI void
@ -540,9 +504,10 @@ e_shelf_resize(E_Shelf *es, int w, int h)
E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE);
es->w = w;
es->h = h;
if (es->popup) e_popup_resize(es->popup, es->w, es->h);
evas_object_resize(es->o_event, es->w, es->h);
evas_object_resize(es->o_base, es->w, es->h);
if (es->popup)
e_popup_resize(es->popup, es->w, es->h);
else
evas_object_resize(es->o_base, es->w, es->h);
}
EAPI void
@ -558,26 +523,8 @@ e_shelf_move_resize(E_Shelf *es, int x, int y, int w, int h)
e_popup_move_resize(es->popup, es->x, es->y, es->w, es->h);
else
{
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_resize(es->o_event, es->w, es->h);
evas_object_resize(es->o_base, es->w, es->h);
}
EAPI void
e_shelf_layer_set(E_Shelf *es, E_Layer layer)
{
E_OBJECT_CHECK(es);
E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE);
es->layer = layer;
if (es->popup)
e_popup_layer_set(es->popup, es->layer);
else
{
E_LAYER_SET(es->o_event, layer);
E_LAYER_SET(es->o_base, layer);
evas_object_resize(es->o_base, es->w, es->h);
}
}
@ -900,7 +847,7 @@ e_shelf_position_calc(E_Shelf *es)
}
EAPI Eina_Bool
e_shelf_desk_visible(E_Shelf *es, E_Desk *desk)
e_shelf_desk_visible(const E_Shelf *es, const E_Desk *desk)
{
Eina_List *ll;
E_Config_Shelf *cf_es;
@ -966,57 +913,7 @@ e_shelf_style_set(E_Shelf *es, const char *style)
else
es->instant_delay = -1.0;
if (es->popup) e_popup_edje_bg_object_set(es->popup, es->o_base);
}
EAPI void
e_shelf_popup_set(E_Shelf *es, int popup)
{
/* FIXME: Needs to recreate the evas objects. */
E_OBJECT_CHECK(es);
E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE);
if (!es->cfg) return;
if (((popup) && (es->popup)) || ((!popup) && (!es->popup))) return;
if (popup)
{
evas_object_clip_unset(es->o_base);
es->popup = e_popup_new(es->zone, es->x, es->y, es->w, es->h);
e_popup_name_set(es->popup, "shelf");
e_popup_layer_set(es->popup, es->cfg->layer);
es->ee = es->popup->ecore_evas;
es->evas = es->popup->evas;
evas_object_show(es->o_event);
evas_object_show(es->o_base);
e_popup_edje_bg_object_set(es->popup, es->o_base);
ecore_x_netwm_window_type_set(es->popup->evas_win,
ECORE_X_WINDOW_TYPE_DOCK);
e_drop_xdnd_register_set(es->popup->evas_win, 1);
e_gadcon_xdnd_window_set(es->gadcon, es->popup->evas_win);
e_gadcon_dnd_window_set(es->gadcon, es->popup->evas_win);
}
else
{
e_drop_xdnd_register_set(es->popup->evas_win, 0);
e_object_del(E_OBJECT(es->popup));
es->popup = NULL;
es->ee = es->zone->container->bg_ecore_evas;
es->evas = es->zone->container->bg_evas;
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);
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);
e_gadcon_dnd_window_set(es->gadcon, es->zone->container->event_win);
evas_object_clip_set(es->o_base, es->zone->bg_clip_object);
}
if (es->popup && (es->popup->content != es->o_base)) e_popup_content_set(es->popup, es->o_base);
}
EAPI void
@ -1066,7 +963,6 @@ EAPI E_Shelf *
e_shelf_config_new(E_Zone *zone, E_Config_Shelf *cf_es)
{
E_Shelf *es;
Eina_Bool can_show = EINA_FALSE;
es = e_shelf_zone_new(zone, cf_es->name, cf_es->style,
cf_es->popup, cf_es->layer, cf_es->id);
@ -1080,37 +976,15 @@ e_shelf_config_new(E_Zone *zone, E_Config_Shelf *cf_es)
e_shelf_autohide_set(es, cf_es->autohide + (cf_es->autohide * cf_es->autohide_show_action));
e_shelf_orient(es, cf_es->orient);
e_shelf_position_calc(es);
e_shelf_populate(es);
e_shelf_position_calc(es);
if (cf_es->desk_show_mode)
{
E_Desk *desk;
Eina_List *ll;
E_Config_Shelf_Desk *sd;
desk = e_desk_current_get(zone);
EINA_LIST_FOREACH(cf_es->desk_list, ll, sd)
{
if ((desk->x == sd->x) && (desk->y == sd->y))
{
can_show = EINA_TRUE;
break;
}
}
if (e_shelf_desk_visible(es, NULL)) e_shelf_show(es);
}
else
can_show = EINA_TRUE;
if (can_show)
{
/* at this point, we cleverly avoid showing the shelf
* if its gadcon has not populated; instead we show it in
* the E_EVENT_GADCON_POPULATE handler
*/
if ((es->gadcon->populated_classes && es->gadcon->clients) || (!es->gadcon->cf->clients))
if (e_shelf_desk_visible(es, NULL)) e_shelf_show(es);
}
e_shelf_show(es);
e_shelf_toggle(es, 0);
return es;
@ -1286,21 +1160,9 @@ _e_shelf_free(E_Shelf *es)
}
if (es->config_dialog) e_object_del(E_OBJECT(es->config_dialog));
es->config_dialog = NULL;
evas_object_del(es->o_event);
evas_object_del(es->o_base);
es->o_base = es->o_event = NULL;
if (es->popup)
{
e_drop_xdnd_register_set(es->popup->evas_win, 0);
eina_hash_del(winid_shelves,
e_util_winid_str_get(es->popup->evas_win), es);
if (!eina_hash_population(winid_shelves))
{
eina_hash_free(winid_shelves);
winid_shelves = NULL;
}
e_object_del(E_OBJECT(es->popup));
}
es->o_base = NULL;
if (es->popup) e_object_del(E_OBJECT(es->popup));
if (es->autohide_timer) ecore_timer_del(es->autohide_timer);
es->autohide_timer = NULL;
es->popup = NULL;
@ -1827,6 +1689,7 @@ _e_shelf_cb_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNU
break;
case 3:
if (es->menu) return;
mn = e_menu_new();
e_menu_post_deactivate_callback_set(mn, _e_shelf_cb_menu_post, es);
es->menu = mn;
@ -1968,7 +1831,7 @@ _e_shelf_cb_mouse_in(void *data, int type, void *event)
* mouse in/out events. in the future, when we remove systray, we should go
* back to mouse in/out events
*/
inside = (es->popup && ((ev->event_window == es->popup->evas_win)));
inside = (es->popup && ((ev->event_window == e_comp_get(es)->win)));
if (!inside)
{
inside = E_INSIDE(ev->root.x, ev->root.y, es->zone->x, es->zone->y, es->zone->w + 4, es->zone->h + 4);
@ -2287,34 +2150,6 @@ _e_shelf_cb_instant_hide_timer(void *data)
return ECORE_CALLBACK_CANCEL;
}
static Eina_Bool
_e_shelf_module_init_end_timer_cb(void *data)
{
E_Shelf *es = data;
if (e_shelf_desk_visible(es, NULL)) e_shelf_show(es);
es->module_init_end_timer = NULL;
return EINA_FALSE;
}
static Eina_Bool
_e_shelf_module_init_end_handler_cb(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
{
Eina_List *l;
E_Shelf *es;
EINA_LIST_FOREACH(shelves, l, es)
{
if ((!es->gadcon->populate_requests) || (!es->gadcon->cf->clients))
{
if (e_shelf_desk_visible(es, NULL))
e_shelf_show(es);
}
else if (!es->module_init_end_timer)
es->module_init_end_timer = ecore_timer_add(3.0, _e_shelf_module_init_end_timer_cb, es);
}
return ECORE_CALLBACK_RENEW;
}
static Eina_Bool
_e_shelf_gadcon_populate_handler_cb(void *data __UNUSED__, int type __UNUSED__, void *event)
{

View File

@ -18,7 +18,6 @@ struct _E_Shelf
E_Popup *popup; /* NULL if its within an existing canvas */
E_Zone *zone;
Evas_Object *o_base;
Evas_Object *o_event;
Ecore_Evas *ee;
Evas *evas;
E_Gadcon *gadcon;
@ -83,18 +82,16 @@ EAPI void e_shelf_urgent_show(E_Shelf *es);
EAPI void e_shelf_move(E_Shelf *es, int x, int y);
EAPI void e_shelf_resize(E_Shelf *es, int w, int h);
EAPI void e_shelf_move_resize(E_Shelf *es, int x, int y, int w, int h);
EAPI void e_shelf_layer_set(E_Shelf *es, E_Layer layer);
EAPI void e_shelf_save(E_Shelf *es);
EAPI void e_shelf_unsave(E_Shelf *es);
EAPI void e_shelf_orient(E_Shelf *es, E_Gadcon_Orient orient);
EAPI const char *e_shelf_orient_string_get(E_Shelf *es);
EAPI void e_shelf_position_calc(E_Shelf *es);
EAPI void e_shelf_style_set(E_Shelf *es, const char *style);
EAPI void e_shelf_popup_set(E_Shelf *es, int popup);
EAPI E_Shelf *e_shelf_config_new(E_Zone *zone, E_Config_Shelf *cf_es);
EAPI void e_shelf_name_set(E_Shelf *es, const char *name);
EAPI void e_shelf_rename_dialog(E_Shelf *es);
EAPI void e_shelf_autohide_set(E_Shelf *es, int autohide_type);
EAPI Eina_Bool e_shelf_desk_visible(E_Shelf *es, E_Desk *desk);
EAPI Eina_Bool e_shelf_desk_visible(const E_Shelf *es, const E_Desk *desk);
#endif
#endif

View File

@ -39,9 +39,6 @@ struct _Instance
Evas_Object *o_backlight, *o_table, *o_slider;
E_Gadcon_Popup *popup;
double val;
Ecore_X_Window input_win;
Ecore_Event_Handler *hand_mouse_down;
Ecore_Event_Handler *hand_key_down;
};
static Eina_List *backlight_instances = NULL;
@ -63,39 +60,12 @@ _backlight_gadget_update(Instance *inst)
edje_object_message_send(inst->o_backlight, EDJE_MESSAGE_FLOAT, 0, &msg);
}
static void
_backlight_input_win_del(Instance *inst)
{
if (!inst->input_win) return;
e_grabinput_release(0, inst->input_win);
ecore_x_window_free(inst->input_win);
inst->input_win = 0;
ecore_event_handler_del(inst->hand_mouse_down);
inst->hand_mouse_down = NULL;
ecore_event_handler_del(inst->hand_key_down);
inst->hand_key_down = NULL;
}
static Eina_Bool
_backlight_input_win_mouse_down_cb(void *data, int type __UNUSED__, void *event)
_backlight_win_key_down_cb(void *data, Ecore_Event_Key *ev)
{
Ecore_Event_Mouse_Button *ev = event;
Instance *inst = data;
if (ev->window != inst->input_win) return ECORE_CALLBACK_PASS_ON;
_backlight_popup_free(inst);
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
_backlight_input_win_key_down_cb(void *data, int type __UNUSED__, void *event)
{
Ecore_Event_Key *ev = event;
Instance *inst = data;
const char *keysym;
if (ev->window != inst->input_win) return ECORE_CALLBACK_PASS_ON;
keysym = ev->key;
if (!strcmp(keysym, "Escape"))
_backlight_popup_free(inst);
@ -183,33 +153,6 @@ _backlight_input_win_key_down_cb(void *data, int type __UNUSED__, void *event)
return ECORE_CALLBACK_PASS_ON;
}
static void
_backlight_input_win_new(Instance *inst)
{
Ecore_X_Window_Configure_Mask mask;
Ecore_X_Window w, popup_w;
E_Manager *man;
man = inst->gcc->gadcon->zone->container->manager;
w = ecore_x_window_input_new(man->root, 0, 0, man->w, man->h);
mask = (ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE |
ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING);
popup_w = inst->popup->win->evas_win;
ecore_x_window_configure(w, mask, 0, 0, 0, 0, 0, popup_w,
ECORE_X_WINDOW_STACK_BELOW);
ecore_x_window_show(w);
inst->hand_mouse_down =
ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN,
_backlight_input_win_mouse_down_cb, inst);
inst->hand_key_down =
ecore_event_handler_add(ECORE_EVENT_KEY_DOWN,
_backlight_input_win_key_down_cb, inst);
inst->input_win = w;
e_grabinput_get(0, 0, inst->input_win);
}
static void
_backlight_settings_cb(void *d1, void *d2 __UNUSED__)
{
@ -227,6 +170,12 @@ _slider_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
e_backlight_level_set(inst->gcc->gadcon->zone, inst->val, 0.0);
}
static void
_backlight_popup_del_cb(void *obj)
{
_backlight_popup_free(e_object_data_get(obj));
}
static void
_backlight_popup_new(Instance *inst)
{
@ -257,20 +206,16 @@ _backlight_popup_new(Instance *inst)
0, 1, 1, 1, 0, 0, 0, 0, 0.5, 1.0);
e_gadcon_popup_content_set(inst->popup, inst->o_table);
e_popup_autoclose(inst->popup->win, _backlight_win_key_down_cb, inst);
e_gadcon_popup_show(inst->popup);
_backlight_input_win_new(inst);
e_object_data_set(E_OBJECT(inst->popup), inst);
E_OBJECT_DEL_SET(inst->popup, _backlight_popup_del_cb);
}
static void
_backlight_popup_free(Instance *inst)
{
if (!inst->popup) return;
if (inst->popup)
{
_backlight_input_win_del(inst);
e_object_del(E_OBJECT(inst->popup));
inst->popup = NULL;
}
E_FN_DEL(e_object_del, inst->popup);
}
static void
@ -392,7 +337,6 @@ _gc_shutdown(E_Gadcon_Client *gcc)
Instance *inst;
inst = gcc->data;
_backlight_input_win_del(inst);
_backlight_popup_free(inst);
backlight_instances = eina_list_remove(backlight_instances, inst);
evas_object_del(inst->o_backlight);

View File

@ -22,6 +22,7 @@ struct _E_Config_Dialog_Data
int disable_borders;
int disable_overrides;
int disable_menus;
int disable_objects;
int disable_all;
int toggle_changed : 1;
} match;
@ -46,6 +47,7 @@ struct _E_Config_Dialog_Data
int fast_borders;
int fast_menus;
int fast_overrides;
int fast_objects;
int fast;
Evas_Object *fast_ob;
int fast_changed : 1;
@ -106,10 +108,12 @@ _create_data(E_Config_Dialog *cfd EINA_UNUSED)
cfdata->fast_borders = _comp_mod->conf->fast_borders;
cfdata->fast_overrides = _comp_mod->conf->fast_overrides;
cfdata->fast_menus = _comp_mod->conf->fast_menus;
cfdata->fast_objects = _comp_mod->conf->fast_objects;
cfdata->match.disable_popups = _comp_mod->conf->match.disable_popups;
cfdata->match.disable_borders = _comp_mod->conf->match.disable_borders;
cfdata->match.disable_overrides = _comp_mod->conf->match.disable_overrides;
cfdata->match.disable_menus = _comp_mod->conf->match.disable_menus;
cfdata->match.disable_objects = _comp_mod->conf->match.disable_objects;
cfdata->disable_screen_effects = _comp_mod->conf->disable_screen_effects;
cfdata->indirect = _comp_mod->conf->indirect;
@ -210,6 +214,9 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
p = ob = e_widget_check_add(evas, _("Enable fast composite effects for popups"), &(cfdata->fast_popups));
e_widget_disabled_set(ob, cfdata->match.disable_popups);
e_widget_framelist_object_append(of, ob);
p = ob = e_widget_check_add(evas, _("Enable fast composite effects for objects"), &(cfdata->fast_objects));
e_widget_disabled_set(ob, cfdata->match.disable_objects);
e_widget_framelist_object_append(of, ob);
o = ob = e_widget_check_add(evas, _("Enable fast composite effects for overrides"), &(cfdata->fast_overrides));
e_widget_disabled_set(ob, cfdata->match.disable_overrides);
e_widget_framelist_object_append(of, ob);
@ -225,6 +232,9 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
ob = e_widget_check_add(evas, _("Disable composite effects for popups"), &(cfdata->match.disable_popups));
e_widget_on_change_hook_set(ob, _advanced_comp_style_toggle, p);
e_widget_framelist_object_append(of, ob);
ob = e_widget_check_add(evas, _("Disable composite effects for objects"), &(cfdata->match.disable_objects));
e_widget_on_change_hook_set(ob, _advanced_comp_style_toggle, p);
e_widget_framelist_object_append(of, ob);
ob = e_widget_check_add(evas, _("Disable composite effects for overrides"), &(cfdata->match.disable_overrides));
e_widget_on_change_hook_set(ob, _advanced_comp_style_toggle, o);
e_widget_framelist_object_append(of, ob);
@ -432,21 +442,25 @@ _advanced_apply_data(E_Config_Dialog *cfd __UNUSED__,
(_comp_mod->conf->match.disable_borders != cfdata->match.disable_borders) ||
(_comp_mod->conf->match.disable_overrides != cfdata->match.disable_overrides) ||
(_comp_mod->conf->match.disable_menus != cfdata->match.disable_menus) ||
(_comp_mod->conf->match.disable_objects != cfdata->match.disable_objects) ||
(_comp_mod->conf->disable_screen_effects != cfdata->disable_screen_effects) ||
(_comp_mod->conf->fast_popups != cfdata->fast_popups) ||
(_comp_mod->conf->fast_borders != cfdata->fast_borders) ||
(_comp_mod->conf->fast_overrides != cfdata->fast_overrides) ||
(_comp_mod->conf->fast_menus != cfdata->fast_menus)
(_comp_mod->conf->fast_menus != cfdata->fast_menus) ||
(_comp_mod->conf->fast_objects != cfdata->fast_objects)
)
{
_comp_mod->conf->fast_popups = cfdata->fast_popups;
_comp_mod->conf->fast_borders = cfdata->fast_borders;
_comp_mod->conf->fast_overrides = cfdata->fast_overrides;
_comp_mod->conf->fast_menus = cfdata->fast_menus;
_comp_mod->conf->fast_objects = cfdata->fast_objects;
_comp_mod->conf->match.disable_popups = cfdata->match.disable_popups;
_comp_mod->conf->match.disable_borders = cfdata->match.disable_borders;
_comp_mod->conf->match.disable_overrides = cfdata->match.disable_overrides;
_comp_mod->conf->match.disable_menus = cfdata->match.disable_menus;
_comp_mod->conf->match.disable_objects = cfdata->match.disable_objects;
_comp_mod->conf->disable_screen_effects = cfdata->disable_screen_effects;
_comp_mod->conf->lock_fps = cfdata->lock_fps;
_comp_mod->conf->smooth_windows = cfdata->smooth_windows;
@ -536,7 +550,7 @@ _basic_create_widgets(E_Config_Dialog *cfd EINA_UNUSED,
e_widget_list_object_append(ol, ob, 1, 0, 0.5);
cfdata->fast =
(cfdata->fast_menus && cfdata->fast_menus && cfdata->fast_borders && cfdata->fast_popups);
(cfdata->fast_menus && cfdata->fast_menus && cfdata->fast_borders && cfdata->fast_popups && cfdata->fast_objects);
cfdata->fast_ob = ob = e_widget_check_add(evas, _("Enable \"fast\" composite effects"), &(cfdata->fast));
evas_object_data_set(ob, "cfdata", cfdata);
e_widget_list_object_append(ol, ob, 1, 0, 0.5);
@ -544,7 +558,7 @@ _basic_create_widgets(E_Config_Dialog *cfd EINA_UNUSED,
cfdata->match.disable_all =
(cfdata->match.disable_menus && cfdata->match.disable_menus && cfdata->match.disable_borders &&
cfdata->match.disable_popups && cfdata->disable_screen_effects);
cfdata->match.disable_popups && cfdata->match.disable_objects && cfdata->disable_screen_effects);
e_widget_disabled_set(ob, cfdata->match.disable_all);
ob = e_widget_check_add(evas, _("Disable composite effects"), &(cfdata->match.disable_all));
evas_object_data_set(ob, "cfdata", cfdata);
@ -615,6 +629,7 @@ _basic_apply_data(E_Config_Dialog *cfd __UNUSED__,
_comp_mod->conf->match.disable_borders = cfdata->match.disable_borders = cfdata->match.disable_all;
_comp_mod->conf->match.disable_overrides = cfdata->match.disable_overrides = cfdata->match.disable_all;
_comp_mod->conf->match.disable_menus = cfdata->match.disable_menus = cfdata->match.disable_all;
_comp_mod->conf->match.disable_objects = cfdata->match.disable_objects = cfdata->match.disable_all;
_comp_mod->conf->disable_screen_effects = cfdata->disable_screen_effects = cfdata->match.disable_all;
}
if (cfdata->fast_changed)
@ -622,6 +637,7 @@ _basic_apply_data(E_Config_Dialog *cfd __UNUSED__,
_comp_mod->conf->fast_borders = cfdata->fast_borders = cfdata->fast;
_comp_mod->conf->fast_popups = cfdata->fast_popups = cfdata->fast;
_comp_mod->conf->fast_menus = cfdata->fast_menus = cfdata->fast;
_comp_mod->conf->fast_objects = cfdata->fast_objects = cfdata->fast;
_comp_mod->conf->fast_overrides = cfdata->fast_overrides = cfdata->fast;
}
_comp_mod->conf->lock_fps = cfdata->lock_fps;

View File

@ -177,54 +177,6 @@ econnman_mod_services_changed(struct Connman_Manager *cm)
}
}
static Eina_Bool
_econnman_popup_input_window_mouse_up_cb(void *data, int type, void *event)
{
Ecore_Event_Mouse_Button *ev = event;
E_Connman_Instance *inst = data;
if (ev->window != inst->ui.popup.input_win)
return ECORE_CALLBACK_PASS_ON;
econnman_popup_del(inst);
return ECORE_CALLBACK_PASS_ON;
}
static void
_econnman_popup_input_window_destroy(E_Connman_Instance *inst)
{
ecore_x_window_free(inst->ui.popup.input_win);
inst->ui.popup.input_win = 0;
ecore_event_handler_del(inst->ui.popup.input_mouse_up);
inst->ui.popup.input_mouse_up = NULL;
}
static void
_econnman_popup_input_window_create(E_Connman_Instance *inst)
{
Ecore_X_Window_Configure_Mask mask;
Ecore_X_Window w, popup_w;
E_Manager *man;
man = e_manager_current_get();
w = ecore_x_window_input_new(man->root, 0, 0, man->w, man->h);
mask = (ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE |
ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING);
popup_w = inst->popup->win->evas_win;
ecore_x_window_configure(w, mask, 0, 0, 0, 0, 0, popup_w,
ECORE_X_WINDOW_STACK_BELOW);
ecore_x_window_show(w);
inst->ui.popup.input_mouse_up =
ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP,
_econnman_popup_input_window_mouse_up_cb, inst);
inst->ui.popup.input_win = w;
}
static void
_econnman_app_launch(E_Connman_Instance *inst)
{
@ -292,6 +244,12 @@ _e_connman_widget_size_set(E_Connman_Instance *inst, Evas_Object *widget, Evas_C
e_widget_size_min_set(widget, w, h);
}
static void
_econnman_popup_del_cb(void *obj)
{
econnman_popup_del(e_object_data_get(obj));
}
static void
_econnman_popup_new(E_Connman_Instance *inst)
{
@ -327,17 +285,16 @@ _econnman_popup_new(E_Connman_Instance *inst)
/* 30,40 % -- min vga, max uvga */
_e_connman_widget_size_set(inst, list, 30, 40, 192, 192, 384, 384);
e_gadcon_popup_content_set(inst->popup, list);
e_popup_autoclose(inst->popup->win, NULL, NULL);
e_gadcon_popup_show(inst->popup);
_econnman_popup_input_window_create(inst);
e_object_data_set(E_OBJECT(inst->popup), inst);
E_OBJECT_DEL_SET(inst->popup, _econnman_popup_del_cb);
}
void
econnman_popup_del(E_Connman_Instance *inst)
{
if (!inst->popup) return;
_econnman_popup_input_window_destroy(inst);
e_object_del(E_OBJECT(inst->popup));
inst->popup = NULL;
E_FN_DEL(e_object_del, inst->popup);
}
static void

View File

@ -30,9 +30,6 @@ struct E_Connman_Instance
{
Evas_Object *list;
Evas_Object *powered;
Ecore_X_Window input_win;
Ecore_Event_Handler *input_mouse_up;
} popup;
} ui;
};

View File

@ -484,13 +484,13 @@ 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;
evas_object_name_set(o, "zone_fwin");
e_zone_useful_geometry_get(zone, &x, &y, &w, &h);
evas_object_move(o, x, y);
evas_object_resize(o, w, h);
E_LAYER_SET_UNDER(o, E_COMP_CANVAS_LAYER_DESKTOP);
evas_object_show(o);
page->scrollframe_obj = page->scr = o;
e_fm2_window_object_set(page->fm_obj, E_OBJECT(fwin->zone));
@ -799,12 +799,10 @@ _e_fwin_icon_popup(void *data)
fx = fwin->win->x, fy = fwin->win->y;
fwin->popup = e_popup_new(zone, 0, 0, 1, 1);
e_popup_ignore_events_set(fwin->popup, 1);
ecore_x_window_shape_input_rectangle_set(fwin->popup->evas_win, 0, 0, 0, 0);
bg = edje_object_add(fwin->popup->evas);
e_theme_edje_object_set(bg, "base/theme/fileman",
"e/fileman/popup/default");
e_popup_edje_bg_object_set(fwin->popup, bg);
mw = zone->w * fileman_config->tooltip.size / 100.0;
mh = zone->h * fileman_config->tooltip.size / 100.0;
@ -822,9 +820,7 @@ _e_fwin_icon_popup(void *data)
edje_object_part_swallow(bg, "e.swallow.content", list);
edje_object_size_min_calc(bg, &mw, &mh);
evas_object_show(o);
evas_object_show(list);
evas_object_show(bg);
e_popup_object_add(fwin->popup, list);
/* prefer tooltip left of icon */
px = (fx + x) - mw - 3;
@ -846,7 +842,7 @@ _e_fwin_icon_popup(void *data)
/* give up */
if (py < 0) py = 0;
e_popup_move_resize(fwin->popup, px, py, mw, mh);
evas_object_resize(bg, mw, mh);
e_popup_content_set(fwin->popup, bg);
if (!fwin->popup_handlers)
{
E_LIST_HANDLER_APPEND(fwin->popup_handlers, ECORE_X_EVENT_XDND_ENTER, _e_fwin_icon_popup_handler, fwin);

View File

@ -300,8 +300,9 @@ gadman_gadget_place(E_Gadcon_Client *gcc, const E_Gadcon_Client_Class *cc, E_Con
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);
/* FIXME: comp */
evas_object_layer_set(gcc->o_base, E_COMP_CANVAS_LAYER_DESKTOP);
evas_object_layer_set(gcc->o_frame, E_COMP_CANVAS_LAYER_DESKTOP);
}
if (cc->name)
{
@ -866,7 +867,7 @@ _create_mover(E_Gadcon *gc)
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_layer_set(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");
@ -901,10 +902,6 @@ _create_mover(E_Gadcon *gc)
edje_object_signal_callback_add(mover, "e,action,resize,up,go", "",
on_top, (void *)DRAG_MOVE);
evas_object_move(mover, 20, 30);
evas_object_resize(mover, 100, 100);
evas_object_hide(mover);
return mover;
}

View File

@ -529,7 +529,7 @@ _e_kbd_int_zoomkey_up(E_Kbd_Int *ki)
if (ki->zoomkey.popup) return;
ki->zoomkey.popup = e_popup_new(ki->win->border->zone, -1, -1, 1, 1);
e_popup_layer_set(ki->zoomkey.popup, 190);
e_popup_layer_set(ki->zoomkey.popup, E_COMP_CANVAS_LAYER_LAYOUT, 190);
o = _theme_obj_new(ki->zoomkey.popup->evas, ki->themedir,
"e/modules/kbd/zoom/default");
@ -625,9 +625,9 @@ _e_kbd_int_zoomkey_up(E_Kbd_Int *ki)
evas_object_resize(ki->zoomkey.base_obj,
ki->zoomkey.popup->w, ki->zoomkey.popup->h);
evas_object_show(ki->zoomkey.base_obj);
e_popup_edje_bg_object_set(ki->zoomkey.popup, ki->zoomkey.base_obj);
e_popup_content_set(ki->zoomkey.popup, ki->zoomkey.base_obj);
e_popup_show(ki->zoomkey.popup);
e_popup_layer_set(ki->zoomkey.popup, 190);
e_popup_layer_set(ki->zoomkey.popup, E_COMP_CANVAS_LAYER_LAYOUT, 190);
}
static void
@ -1453,7 +1453,7 @@ _e_kbd_int_dictlist_up(E_Kbd_Int *ki)
if (ki->dictlist.popup) return;
ki->dictlist.popup = e_popup_new(ki->win->border->zone, -1, -1, 1, 1);
e_popup_layer_set(ki->dictlist.popup, 190);
e_popup_layer_set(ki->dictlist.popup, E_COMP_CANVAS_LAYER_LAYOUT, 190);
o = _theme_obj_new(ki->dictlist.popup->evas, ki->themedir,
"e/modules/kbd/match/default");
@ -1553,7 +1553,7 @@ _e_kbd_int_dictlist_up(E_Kbd_Int *ki)
evas_object_resize(ki->dictlist.base_obj,
ki->dictlist.popup->w, ki->dictlist.popup->h);
evas_object_show(ki->dictlist.base_obj);
e_popup_edje_bg_object_set(ki->dictlist.popup, ki->dictlist.base_obj);
e_popup_content_set(ki->dictlist.popup, ki->dictlist.base_obj);
e_popup_show(ki->dictlist.popup);
_e_kbd_int_matchlist_down(ki);
}
@ -1600,7 +1600,7 @@ _e_kbd_int_matchlist_up(E_Kbd_Int *ki)
if (!e_kbd_buf_string_matches_get(ki->kbuf)) return;
if (ki->matchlist.popup) return;
ki->matchlist.popup = e_popup_new(ki->win->border->zone, -1, -1, 1, 1);
e_popup_layer_set(ki->matchlist.popup, 190);
e_popup_layer_set(ki->matchlist.popup, E_COMP_CANVAS_LAYER_LAYOUT, 190);
o = _theme_obj_new(ki->matchlist.popup->evas, ki->themedir,
"e/modules/kbd/match/default");
@ -1657,7 +1657,7 @@ _e_kbd_int_matchlist_up(E_Kbd_Int *ki)
evas_object_resize(ki->matchlist.base_obj,
ki->matchlist.popup->w, ki->matchlist.popup->h);
evas_object_show(ki->matchlist.base_obj);
e_popup_edje_bg_object_set(ki->matchlist.popup, ki->matchlist.base_obj);
e_popup_content_set(ki->matchlist.popup, ki->matchlist.base_obj);
e_popup_show(ki->matchlist.popup);
_e_kbd_int_dictlist_down(ki);

View File

@ -484,29 +484,11 @@ _mixer_app_cb_del(E_Dialog *dialog __UNUSED__, void *data)
static void _mixer_popup_del(E_Mixer_Instance *inst);
static Eina_Bool
_mixer_popup_input_window_mouse_up_cb(void *data, int type __UNUSED__, void *event)
_mixer_popup_key_down_cb(void *data, Ecore_Event_Key *ev)
{
Ecore_Event_Mouse_Button *ev = event;
E_Mixer_Instance *inst = data;
if (ev->window != inst->ui.input.win)
return ECORE_CALLBACK_PASS_ON;
_mixer_popup_del(inst);
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
_mixer_popup_input_window_key_down_cb(void *data, int type __UNUSED__, void *event)
{
Ecore_Event_Key *ev = event;
E_Mixer_Instance *inst = data;
const char *keysym;
if (ev->window != inst->ui.input.win)
return ECORE_CALLBACK_PASS_ON;
keysym = ev->key;
if (strcmp(keysym, "Escape") == 0)
_mixer_popup_del(inst);
@ -561,53 +543,9 @@ _mixer_popup_input_window_key_down_cb(void *data, int type __UNUSED__, void *eve
return ECORE_CALLBACK_PASS_ON;
}
static void
_mixer_popup_input_window_destroy(E_Mixer_Instance *inst)
{
e_grabinput_release(0, inst->ui.input.win);
ecore_x_window_free(inst->ui.input.win);
inst->ui.input.win = 0;
ecore_event_handler_del(inst->ui.input.mouse_up);
inst->ui.input.mouse_up = NULL;
ecore_event_handler_del(inst->ui.input.key_down);
inst->ui.input.key_down = NULL;
}
static void
_mixer_popup_input_window_create(E_Mixer_Instance *inst)
{
Ecore_X_Window_Configure_Mask mask;
Ecore_X_Window w, popup_w;
E_Manager *man;
man = e_manager_current_get();
w = ecore_x_window_input_new(man->root, 0, 0, man->w, man->h);
mask = (ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE |
ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING);
popup_w = inst->popup->win->evas_win;
ecore_x_window_configure(w, mask, 0, 0, 0, 0, 0, popup_w,
ECORE_X_WINDOW_STACK_BELOW);
ecore_x_window_show(w);
inst->ui.input.mouse_up =
ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP,
_mixer_popup_input_window_mouse_up_cb, inst);
inst->ui.input.key_down =
ecore_event_handler_add(ECORE_EVENT_KEY_DOWN,
_mixer_popup_input_window_key_down_cb, inst);
inst->ui.input.win = w;
e_grabinput_get(0, 0, inst->ui.input.win);
}
static void
_mixer_popup_del(E_Mixer_Instance *inst)
{
_mixer_popup_input_window_destroy(inst);
e_object_del(E_OBJECT(inst->popup));
inst->ui.label = NULL;
inst->ui.left = NULL;
@ -621,6 +559,12 @@ _mixer_popup_del(E_Mixer_Instance *inst)
inst->popup_timer = NULL;
}
static void
_mixer_popup_del_cb(void *obj)
{
_mixer_popup_del(e_object_data_get(obj));
}
static void
_mixer_app_select_current(E_Dialog *dialog, E_Mixer_Instance *inst)
{
@ -724,8 +668,10 @@ _mixer_popup_new(E_Mixer_Instance *inst)
e_widget_size_min_set(inst->ui.table, mw, mh);
e_gadcon_popup_content_set(inst->popup, inst->ui.table);
e_popup_autoclose(inst->popup->win, _mixer_popup_key_down_cb, inst);
e_gadcon_popup_show(inst->popup);
_mixer_popup_input_window_create(inst);
e_object_data_set(E_OBJECT(inst->popup), inst);
E_OBJECT_DEL_SET(inst->popup, _mixer_popup_del_cb);
}
static void
@ -806,8 +752,6 @@ _mixer_cb_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSE
{
if (!inst->popup)
_mixer_popup_new(inst);
else
_mixer_popup_del(inst);
}
else if (ev->button == 2)
_mixer_toggle_mute(inst, EINA_FALSE);

View File

@ -47,12 +47,6 @@ typedef struct E_Mixer_Instance
Evas_Object *mute;
Evas_Object *table;
Evas_Object *button;
struct
{
Ecore_X_Window win;
Ecore_Event_Handler *mouse_up;
Ecore_Event_Handler *key_down;
} input;
} ui;
E_Mixer_System *sys;

View File

@ -29,9 +29,6 @@ typedef struct _E_Music_Control_Instance
Evas_Object *gadget;
E_Gadcon_Popup *popup;
Evas_Object *content_popup;
Ecore_X_Window win;
Ecore_Event_Handler *mouse_up;
Ecore_Event_Handler *key_down;
} E_Music_Control_Instance;
void music_control_mouse_down_cb(void *data, Evas *evas, Evas_Object *obj, void *event);

View File

@ -56,57 +56,10 @@ _player_name_update(E_Music_Control_Instance *inst)
edje_object_message_send(inst->content_popup, EDJE_MESSAGE_STRING, 0, &msg);
}
static Eina_Bool
_popup_input_window_mouse_up_cb(void *data, int type __UNUSED__, void *event)
{
Ecore_Event_Mouse_Button *ev = event;
E_Music_Control_Instance *inst = data;
if (ev->window == inst->win)
music_control_popup_del(inst);
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
_popup_input_window_key_down_cb(void *data, int type __UNUSED__, void *event)
{
Ecore_Event_Key *ev = event;
E_Music_Control_Instance *inst = data;
if (ev->window == inst->win)
music_control_popup_del(inst);
return ECORE_CALLBACK_PASS_ON;
}
static void
_popup_input_window_create(E_Music_Control_Instance *inst)
_popup_del_cb(void *obj)
{
Ecore_X_Window_Configure_Mask mask;
Ecore_X_Window popup_w;
E_Manager *man = e_manager_current_get();
inst->win = ecore_x_window_input_new(man->root, 0, 0, man->w, man->h);
mask = (ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE |
ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING);
popup_w = inst->popup->win->evas_win;
ecore_x_window_configure(inst->win, mask, 0, 0, 0, 0, 0, popup_w,
ECORE_X_WINDOW_STACK_BELOW);
ecore_x_window_show(inst->win);
inst->mouse_up =
ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP,
_popup_input_window_mouse_up_cb, inst);
inst->key_down =
ecore_event_handler_add(ECORE_EVENT_KEY_DOWN,
_popup_input_window_key_down_cb, inst);
e_grabinput_get(0, 0, inst->win);
}
static void
_popup_input_window_destroy(E_Music_Control_Instance *inst)
{
e_grabinput_release(0, inst->win);
ecore_x_window_free(inst->win);
ecore_event_handler_del(inst->mouse_up);
ecore_event_handler_del(inst->key_down);
music_control_popup_del(e_object_data_get(obj));
}
static void
@ -126,17 +79,16 @@ _popup_new(E_Music_Control_Instance *inst)
_player_name_update(inst);
_play_state_update(inst, EINA_TRUE);
e_popup_autoclose(inst->popup->win, NULL, NULL);
e_gadcon_popup_show(inst->popup);
_popup_input_window_create(inst);
e_object_data_set(E_OBJECT(inst->popup), inst);
E_OBJECT_DEL_SET(inst->popup, _popup_del_cb);
}
void
music_control_popup_del(E_Music_Control_Instance *inst)
{
e_gadcon_popup_hide(inst->popup);
_popup_input_window_destroy(inst);
e_object_del(E_OBJECT(inst->popup));
inst->popup = NULL;
E_FN_DEL(e_object_del, inst->popup);
}
struct _E_Config_Dialog_Data

View File

@ -211,7 +211,7 @@ _notification_popup_new(E_Notification_Notify *n, unsigned id)
"modules/notification/main"))
edje_object_file_set(popup->theme, buf, "modules/notification/main");
e_popup_edje_bg_object_set(popup->win, popup->theme);
e_popup_content_set(popup->win, popup->theme);
evas_object_show(popup->theme);
edje_object_signal_callback_add
@ -227,7 +227,6 @@ _notification_popup_new(E_Notification_Notify *n, unsigned id)
_notification_popup_refresh(popup);
next_pos = _notification_popup_place(popup, next_pos);
e_popup_show(popup->win);
e_popup_layer_set(popup->win, E_LAYER_POPUP);
popups_displayed++;
return popup;

View File

@ -775,7 +775,6 @@ _pager_popup_new(E_Zone *zone, int keyaction)
free(pp);
return NULL;
}
e_popup_layer_set(pp->popup, E_LAYER_POPUP);
pp->pager = _pager_new(pp->popup->evas, zone, NULL);
pp->pager->popup = pp;
@ -807,15 +806,16 @@ _pager_popup_new(E_Zone *zone, int keyaction)
evas_object_move(pp->o_bg, 0, 0);
evas_object_resize(pp->o_bg, w, h);
e_popup_edje_bg_object_set(pp->popup, pp->o_bg);
e_popup_content_set(pp->popup, pp->o_bg);
//e_popup_ignore_events_set(pp->popup, 1);
e_zone_useful_geometry_get(zone, &zx, &zy, &zw, &zh);
zx -= zone->x;
zy -= zone->y;
e_popup_move_resize(pp->popup,
zx + ((zw - w) / 2), zy + ((zh - h) / 2), w, h);
e_bindings_mouse_grab(E_BINDING_CONTEXT_POPUP, pp->popup->evas_win);
e_bindings_wheel_grab(E_BINDING_CONTEXT_POPUP, pp->popup->evas_win);
/* FIXME: COMP */
//e_bindings_mouse_grab(E_BINDING_CONTEXT_POPUP, pp->popup->evas_win);
//e_bindings_wheel_grab(E_BINDING_CONTEXT_POPUP, pp->popup->evas_win);
e_popup_show(pp->popup);
@ -830,8 +830,9 @@ _pager_popup_free(Pager_Popup *pp)
if (pp->timer) ecore_timer_del(pp->timer);
evas_object_del(pp->o_bg);
_pager_free(pp->pager);
e_bindings_mouse_ungrab(E_BINDING_CONTEXT_POPUP, pp->popup->evas_win);
e_bindings_wheel_ungrab(E_BINDING_CONTEXT_POPUP, pp->popup->evas_win);
/* FIXME: COMP */
//e_bindings_mouse_ungrab(E_BINDING_CONTEXT_POPUP, pp->popup->evas_win);
//e_bindings_wheel_ungrab(E_BINDING_CONTEXT_POPUP, pp->popup->evas_win);
e_object_del(E_OBJECT(pp->popup));
free(pp);
}
@ -2476,7 +2477,8 @@ _pager_popup_show(void)
_pager_drop_cb_leave, _pager_drop_cb_drop,
drop, 3, x, y, w, h);
e_bindings_key_grab(E_BINDING_CONTEXT_POPUP, act_popup->popup->evas_win);
/* FIXME: COMP */
//e_bindings_key_grab(E_BINDING_CONTEXT_POPUP, act_popup->popup->evas_win);
evas_event_freeze(act_popup->popup->evas);
evas_event_feed_mouse_in(act_popup->popup->evas,
@ -2493,7 +2495,8 @@ _pager_popup_show(void)
static void
_pager_popup_hide(int switch_desk)
{
e_bindings_key_ungrab(E_BINDING_CONTEXT_POPUP, act_popup->popup->evas_win);
/* FIXME: COMP */
//e_bindings_key_ungrab(E_BINDING_CONTEXT_POPUP, act_popup->popup->evas_win);
hold_count = 0;
hold_mod = 0;
while (handlers)

View File

@ -97,7 +97,6 @@ e_syscon_show(E_Zone *zone, const char *defact)
return 0;
}
evas_event_freeze(popup->evas);
e_popup_layer_set(popup, E_LAYER_POPUP);
handlers = eina_list_append
(handlers, ecore_event_handler_add
@ -296,7 +295,7 @@ e_syscon_show(E_Zone *zone, const char *defact)
evas_object_move(o_bg, 0, 0);
evas_object_resize(o_bg, w, h);
evas_object_show(o_bg);
e_popup_edje_bg_object_set(popup, o_bg);
e_popup_content_set(popup, o_bg);
if (e_config->syscon.do_input)
{

View File

@ -830,7 +830,7 @@ systray_xembed_new(Instance *inst)
xembed->inst = inst;
if ((gc->shelf) && (gc->shelf->popup))
xembed->win.parent = gc->shelf->popup->evas_win;
xembed->win.parent = e_comp_get(gc->shelf)->win;
else
xembed->win.parent = (Ecore_X_Window)ecore_evas_window_get(gc->ecore_evas);

View File

@ -627,7 +627,7 @@ _do_overlay(E_Border *focused_bd,
if (!extra->overlay.popup)
continue;
e_popup_layer_set(extra->overlay.popup, E_LAYER_NORMAL);
e_popup_layer_set(extra->overlay.popup, E_COMP_CANVAS_LAYER_LAYOUT, E_LAYER_NORMAL);
extra->overlay.obj =
edje_object_add(extra->overlay.popup->evas);
e_theme_edje_object_set(extra->overlay.obj,
@ -661,7 +661,7 @@ _do_overlay(E_Border *focused_bd,
evas_object_move(extra->overlay.obj, 0, 0);
evas_object_resize(extra->overlay.obj, ew, eh);
evas_object_show(extra->overlay.obj);
e_popup_edje_bg_object_set(extra->overlay.popup,
e_popup_content_set(extra->overlay.popup,
extra->overlay.obj);
evas_object_show(extra->overlay.obj);
@ -1810,12 +1810,12 @@ _check_moving_anims(const E_Border *bd, const Border_Extra *extra, int stack)
if (!overlay->popup)
return;
e_popup_layer_set(overlay->popup, E_LAYER_NORMAL);
e_popup_layer_set(overlay->popup, E_COMP_CANVAS_LAYER_LAYOUT, E_LAYER_NORMAL);
overlay->obj = edje_object_add(overlay->popup->evas);
_theme_edje_object_set(overlay->obj,
"modules/tiling/move/left");
edje_object_size_min_calc(overlay->obj, &ew, &eh);
e_popup_edje_bg_object_set(overlay->popup,
e_popup_content_set(overlay->popup,
overlay->obj);
evas_object_show(overlay->obj);
e_popup_move_resize(overlay->popup,
@ -1862,12 +1862,12 @@ _check_moving_anims(const E_Border *bd, const Border_Extra *extra, int stack)
if (!overlay->popup)
return;
e_popup_layer_set(overlay->popup, E_LAYER_NORMAL);
e_popup_layer_set(overlay->popup, E_COMP_CANVAS_LAYER_LAYOUT, E_LAYER_NORMAL);
overlay->obj = edje_object_add(overlay->popup->evas);
_theme_edje_object_set(overlay->obj,
"modules/tiling/move/right");
edje_object_size_min_calc(overlay->obj, &ew, &eh);
e_popup_edje_bg_object_set(overlay->popup,
e_popup_content_set(overlay->popup,
overlay->obj);
evas_object_show(overlay->obj);
e_popup_move_resize(overlay->popup,
@ -1913,11 +1913,11 @@ _check_moving_anims(const E_Border *bd, const Border_Extra *extra, int stack)
if (!overlay->popup)
return;
e_popup_layer_set(overlay->popup, E_LAYER_NORMAL);
e_popup_layer_set(overlay->popup, E_COMP_CANVAS_LAYER_LAYOUT, E_LAYER_NORMAL);
overlay->obj = edje_object_add(overlay->popup->evas);
_theme_edje_object_set(overlay->obj, "modules/tiling/move/up");
edje_object_size_min_calc(overlay->obj, &ew, &eh);
e_popup_edje_bg_object_set(overlay->popup,
e_popup_content_set(overlay->popup,
overlay->obj);
evas_object_show(overlay->obj);
e_popup_move_resize(overlay->popup,
@ -1964,12 +1964,12 @@ _check_moving_anims(const E_Border *bd, const Border_Extra *extra, int stack)
if (!overlay->popup)
return;
e_popup_layer_set(overlay->popup, E_LAYER_NORMAL);
e_popup_layer_set(overlay->popup, E_COMP_CANVAS_LAYER_LAYOUT, E_LAYER_NORMAL);
overlay->obj = edje_object_add(overlay->popup->evas);
_theme_edje_object_set(overlay->obj,
"modules/tiling/move/down");
edje_object_size_min_calc(overlay->obj, &ew, &eh);
e_popup_edje_bg_object_set(overlay->popup,
e_popup_content_set(overlay->popup,
overlay->obj);
evas_object_show(overlay->obj);
e_popup_move_resize(overlay->popup,
@ -2840,7 +2840,7 @@ _transition_overlay_key_down(void *data __UNUSED__,
if (!trov->overlay.popup) {
trov->overlay.popup = e_popup_new(_G.tinfo->desk->zone,
0, 0, 1, 1);
e_popup_layer_set(trov->overlay.popup, E_LAYER_NORMAL);
e_popup_layer_set(trov->overlay.popup, E_COMP_CANVAS_LAYER_LAYOUT, E_LAYER_NORMAL);
}
if (!trov->overlay.obj) {
trov->overlay.obj =
@ -2856,7 +2856,7 @@ _transition_overlay_key_down(void *data __UNUSED__,
}
edje_object_size_min_calc(trov->overlay.obj, &ew, &eh);
e_popup_edje_bg_object_set(trov->overlay.popup,
e_popup_content_set(trov->overlay.popup,
trov->overlay.obj);
evas_object_show(trov->overlay.obj);
if (bd) {
@ -2965,7 +2965,7 @@ _do_transition_overlay(void)
continue;
}
e_popup_layer_set(trov->overlay.popup, E_LAYER_NORMAL);
e_popup_layer_set(trov->overlay.popup, E_COMP_CANVAS_LAYER_LAYOUT, E_LAYER_NORMAL);
trov->overlay.obj = edje_object_add(trov->overlay.popup->evas);
e_theme_edje_object_set(trov->overlay.obj,
"base/theme/borders",
@ -3000,7 +3000,7 @@ _do_transition_overlay(void)
evas_object_move(trov->overlay.obj, 0, 0);
evas_object_resize(trov->overlay.obj, ew, eh);
evas_object_show(trov->overlay.obj);
e_popup_edje_bg_object_set(trov->overlay.popup,
e_popup_content_set(trov->overlay.popup,
trov->overlay.obj);
evas_object_show(trov->overlay.obj);
@ -3038,7 +3038,7 @@ _do_transition_overlay(void)
if (!trov->overlay.popup)
continue;
e_popup_layer_set(trov->overlay.popup, E_LAYER_NORMAL);
e_popup_layer_set(trov->overlay.popup, E_COMP_CANVAS_LAYER_LAYOUT, E_LAYER_NORMAL);
trov->overlay.obj = edje_object_add(trov->overlay.popup->evas);
e_theme_edje_object_set(trov->overlay.obj,
"base/theme/borders",
@ -3073,7 +3073,7 @@ _do_transition_overlay(void)
evas_object_move(trov->overlay.obj, 0, 0);
evas_object_resize(trov->overlay.obj, ew, eh);
evas_object_show(trov->overlay.obj);
e_popup_edje_bg_object_set(trov->overlay.popup,
e_popup_content_set(trov->overlay.popup,
trov->overlay.obj);
evas_object_show(trov->overlay.obj);

View File

@ -141,7 +141,6 @@ e_winlist_show(E_Zone *zone, E_Winlist_Filter filter)
evas_event_feed_mouse_move(_winlist->evas, -1000000, -1000000,
ecore_x_current_time_get(), NULL);
e_popup_layer_set(_winlist, E_LAYER_POPUP);
evas_event_freeze(_winlist->evas);
o = edje_object_add(_winlist->evas);
_bg_object = o;
@ -150,7 +149,7 @@ e_winlist_show(E_Zone *zone, E_Winlist_Filter filter)
evas_object_move(o, 0, 0);
evas_object_resize(o, w, h);
evas_object_show(o);
e_popup_edje_bg_object_set(_winlist, o);
e_popup_content_set(_winlist, o);
o = e_box_add(_winlist->evas);
_list_object = o;

View File

@ -3,7 +3,7 @@
static void _e_wizard_next_eval(void);
static E_Popup *_e_wizard_main_new(E_Zone *zone);
static E_Popup *_e_wizard_extra_new(E_Zone *zone);
static void _e_wizard_cb_key_down(void *data, Evas *e, Evas_Object *obj, void *event);
static Eina_Bool _e_wizard_cb_key_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
static void _e_wizard_cb_next(void *data, Evas_Object *obj, const char *emission, const char *source);
static Eina_Bool _e_wizard_check_xdg(void);
@ -64,6 +64,7 @@ e_wizard_init(void)
E_LIST_HANDLER_APPEND(handlers, EFREET_EVENT_ICON_CACHE_UPDATE,
_e_wizard_cb_icons_update, NULL);
E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_KEY_DOWN, _e_wizard_cb_key_down, NULL);
return 1;
}
@ -274,55 +275,24 @@ static E_Popup *
_e_wizard_main_new(E_Zone *zone)
{
E_Popup *popup;
Evas_Object *o;
Evas_Modifier_Mask mask;
Eina_Bool kg;
popup = e_popup_new(zone, 0, 0, zone->w, zone->h);
e_popup_layer_set(popup, E_LAYER_TOP);
o = edje_object_add(popup->evas);
o_bg = edje_object_add(popup->evas);
e_theme_edje_object_set(o, "base/theme/wizard", "e/wizard/main");
evas_object_move(o, 0, 0);
evas_object_resize(o, zone->w, zone->h);
evas_object_show(o);
edje_object_signal_callback_add(o, "e,action,next", "",
e_theme_edje_object_set(o_bg, "base/theme/wizard", "e/wizard/main");
edje_object_part_text_set(o_bg, "e.text.title", _("Welcome to Enlightenment"));
edje_object_signal_callback_add(o_bg, "e,action,next", "",
_e_wizard_cb_next, popup);
o_bg = o;
o = evas_object_rectangle_add(popup->evas);
mask = 0;
kg = evas_object_key_grab(o, "Tab", mask, ~mask, 0);
if (!kg)
fprintf(stderr, "ERROR: unable to redirect \"Tab\" key events to object %p.\n", o);
mask = evas_key_modifier_mask_get(popup->evas, "Shift");
kg = evas_object_key_grab(o, "Tab", mask, ~mask, 0);
if (!kg)
fprintf(stderr, "ERROR: unable to redirect \"Tab\" key events to object %p.\n", o);
mask = 0;
kg = evas_object_key_grab(o, "Return", mask, ~mask, 0);
if (!kg)
fprintf(stderr, "ERROR: unable to redirect \"Return\" key events to object %p.\n", o);
mask = 0;
kg = evas_object_key_grab(o, "KP_Enter", mask, ~mask, 0);
if (!kg)
fprintf(stderr, "ERROR: unable to redirect \"KP_Enter\" key events to object %p.\n", o);
evas_object_event_callback_add(o, EVAS_CALLBACK_KEY_DOWN,
_e_wizard_cb_key_down, popup);
o_bg = o_bg;
e_popup_move_resize(popup, 0, 0, zone->w, zone->h);
e_popup_layer_set(popup, E_COMP_CANVAS_LAYER_POPUP, 0);
e_popup_content_set(popup, o_bg);
/* set up next/prev buttons */
edje_object_part_text_set(o_bg, "e.text.title", _("Welcome to Enlightenment"));
// edje_object_signal_emit(o_bg, "e,state,next,disable", "e");
e_wizard_labels_update();
e_popup_edje_bg_object_set(popup, o_bg);
e_popup_show(popup);
if (!e_grabinput_get(ecore_evas_software_x11_window_get(popup->ecore_evas),
1, ecore_evas_software_x11_window_get(popup->ecore_evas)))
{
e_object_del(E_OBJECT(popup));
popup = NULL;
}
return popup;
}
@ -333,40 +303,43 @@ _e_wizard_extra_new(E_Zone *zone)
Evas_Object *o;
popup = e_popup_new(zone, 0, 0, zone->w, zone->h);
e_popup_layer_set(popup, E_LAYER_TOP);
e_popup_layer_set(popup, E_COMP_CANVAS_LAYER_POPUP, 0);
o = edje_object_add(popup->evas);
e_theme_edje_object_set(o, "base/theme/wizard", "e/wizard/extra");
evas_object_move(o, 0, 0);
evas_object_resize(o, zone->w, zone->h);
evas_object_show(o);
e_popup_edje_bg_object_set(popup, o);
e_popup_content_set(popup, o);
e_popup_show(popup);
return popup;
}
static void
_e_wizard_cb_key_down(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event)
static Eina_Bool
_e_wizard_cb_key_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
{
Evas_Event_Key_Down *ev;
Ecore_Event_Key *ev = event;
ev = event;
if (!o_content) return;
if (!o_content) return ECORE_CALLBACK_RENEW;
if (!strcmp(ev->keyname, "Tab"))
{
if (evas_key_modifier_is_set(ev->modifiers, "Shift"))
if (ev->modifiers & ECORE_EVENT_MODIFIER_SHIFT)
e_widget_focus_jump(o_content, 0);
else
e_widget_focus_jump(o_content, 1);
}
else if (((!strcmp(ev->keyname, "Return")) ||
(!strcmp(ev->keyname, "KP_Enter")) ||
(!strcmp(ev->keyname, "space"))))
else if ((!strcmp(ev->keyname, "Return")) || (!strcmp(ev->keyname, "KP_Enter")))
{
if (next_can)
e_wizard_next();
}
else if (!strcmp(ev->keyname, "space"))
{
Evas_Object *o;
o = e_widget_focused_object_get(o_content);
if (o) e_widget_activate(o);
}
return ECORE_CALLBACK_RENEW;
}
static void