From: Enlightenment S. <no-...@en...> - 2010-10-15 19:13:16
|
Log: uncrustify itask.. formattingwise Author: jeffdameth Date: 2010-10-15 12:13:04 -0700 (Fri, 15 Oct 2010) New Revision: 53469 Modified: trunk/E-MODULES-EXTRA/itask-ng/src/e_mod_main.c trunk/E-MODULES-EXTRA/itask-ng/src/ng_border_menu.c trunk/E-MODULES-EXTRA/itask-ng/src/ng_box.c trunk/E-MODULES-EXTRA/itask-ng/src/ng_config.c trunk/E-MODULES-EXTRA/itask-ng/src/ng_config_instances.c trunk/E-MODULES-EXTRA/itask-ng/src/ng_gadcon.c trunk/E-MODULES-EXTRA/itask-ng/src/ng_item.c trunk/E-MODULES-EXTRA/itask-ng/src/ng_launcher.c trunk/E-MODULES-EXTRA/itask-ng/src/ng_taskbar.c Modified: trunk/E-MODULES-EXTRA/itask-ng/src/e_mod_main.c =================================================================== --- trunk/E-MODULES-EXTRA/itask-ng/src/e_mod_main.c 2010-10-15 19:09:58 UTC (rev 53468) +++ trunk/E-MODULES-EXTRA/itask-ng/src/e_mod_main.c 2010-10-15 19:13:04 UTC (rev 53469) @@ -4,43 +4,42 @@ #define WINDOW_HEIGHT 200 -static int _ngi_win_free(Ngi_Win *win); -static Ngi_Win *_ngi_win_new(Ng *ng); +static int _ngi_win_free(Ngi_Win *win); +static Ngi_Win * _ngi_win_new(Ng *ng); -static Eina_Bool _ngi_cb_container_resize(void *data, int type, void *event); +static Eina_Bool _ngi_cb_container_resize(void *data, int type, void *event); /* static int _ngi_cb_desk_change(void *data, int type, void *event); */ -static void _ngi_win_cb_drop_enter(void *data, const char *type, void *event_info); -static void _ngi_win_cb_drop_move(void *data, const char *type, void *event_info); -static void _ngi_win_cb_drop_end(void *data, const char *type, void *event_info); -static void _ngi_win_cb_drop_leave(void *data, const char *type, void *event_info); +static void _ngi_win_cb_drop_enter(void *data, const char *type, void *event_info); +static void _ngi_win_cb_drop_move(void *data, const char *type, void *event_info); +static void _ngi_win_cb_drop_end(void *data, const char *type, void *event_info); +static void _ngi_win_cb_drop_leave(void *data, const char *type, void *event_info); -static Eina_Bool _ngi_win_cb_mouse_in(void *data, int type, void *event); -static Eina_Bool _ngi_win_cb_mouse_out(void *data, int type, void *event); -static Eina_Bool _ngi_win_cb_mouse_down(void *data, int type, void *event); -static Eina_Bool _ngi_win_cb_mouse_up(void *data, int type, void *event); -static Eina_Bool _ngi_win_cb_mouse_move(void *data, int type, void *event); -static Eina_Bool _ngi_win_cb_mouse_wheel(void *data, int type, void *event); +static Eina_Bool _ngi_win_cb_mouse_in(void *data, int type, void *event); +static Eina_Bool _ngi_win_cb_mouse_out(void *data, int type, void *event); +static Eina_Bool _ngi_win_cb_mouse_down(void *data, int type, void *event); +static Eina_Bool _ngi_win_cb_mouse_up(void *data, int type, void *event); +static Eina_Bool _ngi_win_cb_mouse_move(void *data, int type, void *event); +static Eina_Bool _ngi_win_cb_mouse_wheel(void *data, int type, void *event); -static Eina_Bool _ngi_win_cb_desk_show(void *data, int type, void *event); -static Eina_Bool _ngi_win_cb_border_event(void *data, int type, void *event); +static Eina_Bool _ngi_win_cb_desk_show(void *data, int type, void *event); +static Eina_Bool _ngi_win_cb_border_event(void *data, int type, void *event); -static void _ngi_zoom_in(Ng *ng); -static void _ngi_zoom_out(Ng *ng); -static void _ngi_item_appear(Ng *ng, Ngi_Item *it); -static void _ngi_item_disappear(Ng *ng, Ngi_Item *it); -static void _ngi_zoom_function(Ng *ng, double d, double *zoom, double *disp); -static Eina_Bool _ngi_animator(void *data); -static void _ngi_redraw(Ng *ng); -static int _ngi_autohide(Ng *ng, int hide); +static void _ngi_zoom_in(Ng *ng); +static void _ngi_zoom_out(Ng *ng); +static void _ngi_item_appear(Ng *ng, Ngi_Item *it); +static void _ngi_item_disappear(Ng *ng, Ngi_Item *it); +static void _ngi_zoom_function(Ng *ng, double d, double *zoom, double *disp); +static Eina_Bool _ngi_animator(void *data); +static void _ngi_redraw(Ng *ng); +static int _ngi_autohide(Ng *ng, int hide); /* static int _ngi_mouse_out_timer_cb(void *data); */ -static void _ngi_item_activate(Ng *ng); -static Ngi_Item *_ngi_item_at_position_get(Ng *ng); +static void _ngi_item_activate(Ng *ng); +static Ngi_Item * _ngi_item_at_position_get(Ng *ng); +void ngi_hide_clip(Ng *ng); -void ngi_hide_clip(Ng *ng); - static int initialized = 0; E_Config_DD *ngi_conf_edd = NULL; @@ -48,87 +47,87 @@ E_Config_DD *ngi_conf_box_edd = NULL; E_Config_DD *ngi_conf_gadcon_edd = NULL; -Config *ngi_config = NULL; +Config *ngi_config = NULL; E_Int_Menu_Augmentation *maug = NULL; -#define TEXT_DIST 15 +#define TEXT_DIST 15 #define SEPARATOR_WIDTH 1 static int _ngi_check_fullscreen(E_Desk *desk) { - Eina_List *l; - E_Border *bd; + Eina_List *l; + E_Border *bd; - EINA_LIST_FOREACH(e_border_client_list(), l, bd) - { - if (bd->desk != desk) continue; + EINA_LIST_FOREACH(e_border_client_list(), l, bd) + { + if (bd->desk != desk) + continue; if (bd->fullscreen) - return 1; - } + return 1; + } - return 0; -} + return 0; +} /* _ngi_check_fullscreen */ - static Eina_Bool _ngi_win_cb_desk_show(void *data, int type, void *event) { - E_Event_Desk_Show *ev = event; - Ng *ng = data; + E_Event_Desk_Show *ev = event; + Ng *ng = data; - int fullscreen = _ngi_check_fullscreen(ev->desk); + int fullscreen = _ngi_check_fullscreen(ev->desk); - if (ng->hide_fullscreen != fullscreen) - ngi_animate(ng); + if (ng->hide_fullscreen != fullscreen) + ngi_animate(ng); - ng->hide_fullscreen = fullscreen; + ng->hide_fullscreen = fullscreen; - return EINA_TRUE; -} + return EINA_TRUE; +} /* _ngi_win_cb_desk_show */ static Eina_Bool _ngi_win_cb_border_event(void *data, int type, void *event) { - E_Event_Border_Property *ev = event; - Ng *ng = data; + E_Event_Border_Property *ev = event; + Ng *ng = data; - E_Desk *desk = e_desk_current_get(e_util_zone_current_get(e_manager_current_get())); + E_Desk *desk = e_desk_current_get(e_util_zone_current_get(e_manager_current_get())); - if (ev->border->desk != desk) return EINA_TRUE; + if (ev->border->desk != desk) + return EINA_TRUE; - int fullscreen = _ngi_check_fullscreen(desk); + int fullscreen = _ngi_check_fullscreen(desk); - if (ng->hide_fullscreen != fullscreen) - ngi_animate(ng); + if (ng->hide_fullscreen != fullscreen) + ngi_animate(ng); - ng->hide_fullscreen = fullscreen; + ng->hide_fullscreen = fullscreen; - return EINA_TRUE; -} + return EINA_TRUE; +} /* _ngi_win_cb_border_event */ - - Ng * ngi_new(Config_Item *cfg) { Ng *ng; E_Zone *zone; - Config_Box * cfg_box; + Config_Box *cfg_box; Eina_List *l; - zone = (E_Zone*) e_util_container_zone_number_get(cfg->container, cfg->zone); + zone = (E_Zone *)e_util_container_zone_number_get(cfg->container, cfg->zone); - if (!zone) return NULL; + if (!zone) + return NULL; ng = E_NEW(Ng, 1); cfg->ng = ng; ng->cfg = cfg; ng->cfg->mouse_over_anim = 0; - ng->zone = zone; + ng->zone = zone; ng->win = _ngi_win_new(ng); @@ -171,130 +170,132 @@ evas_object_move(ng->bg_clip, -100004, -100004); evas_object_resize(ng->bg_clip, 200008, 200008); evas_object_color_set(ng->bg_clip, cfg->alpha, cfg->alpha, - cfg->alpha, cfg->alpha); + cfg->alpha, cfg->alpha); evas_object_show(ng->bg_clip); ng->o_bg = edje_object_add(ng->win->evas); if (!e_theme_edje_object_set(ng->o_bg, - "base/theme/modules/itask-ng", - "e/modules/itask-ng/bg")) + "base/theme/modules/itask-ng", + "e/modules/itask-ng/bg")) + edje_object_file_set(ng->o_bg, ngi_config->theme_path, + "e/modules/itask-ng/bg"); - edje_object_file_set(ng->o_bg, ngi_config->theme_path, - "e/modules/itask-ng/bg"); - evas_object_show(ng->o_bg); evas_object_clip_set(ng->o_bg, ng->bg_clip); ng->o_frame = edje_object_add(ng->win->evas); if (!e_theme_edje_object_set(ng->o_frame, - "base/theme/modules/itask-ng", - "e/modules/itask-ng/bg_frame")) + "base/theme/modules/itask-ng", + "e/modules/itask-ng/bg_frame")) + edje_object_file_set(ng->o_frame, ngi_config->theme_path, + "e/modules/itask-ng/bg_frame"); - edje_object_file_set(ng->o_frame, ngi_config->theme_path, - "e/modules/itask-ng/bg_frame"); - evas_object_show(ng->o_frame); ng->label = edje_object_add(ng->win->evas); if (ng->horizontal) { - if (!e_theme_edje_object_set(ng->label, - "base/theme/modules/itask-ng", - "e/modules/itask-ng/label")) + if (!e_theme_edje_object_set(ng->label, + "base/theme/modules/itask-ng", + "e/modules/itask-ng/label")) + edje_object_file_set(ng->label, ngi_config->theme_path, + "e/modules/itask-ng/label"); - edje_object_file_set(ng->label, ngi_config->theme_path, - "e/modules/itask-ng/label"); - - ng->pos = ng->win->w/2; + ng->pos = ng->win->w / 2; } else { - ng->pos = ng->win->h/2; + ng->pos = ng->win->h / 2; } if (cfg->show_label) - evas_object_show(ng->label); + evas_object_show(ng->label); - if (cfg->show_background) evas_object_show(ng->bg_clip); + if (cfg->show_background) + evas_object_show(ng->bg_clip); switch(cfg->orient) { case E_GADCON_ORIENT_LEFT: - edje_object_signal_emit(ng->o_bg, "e,state,bg_left", "e"); - edje_object_signal_emit(ng->o_frame, "e,state,bg_left", "e"); - break; + edje_object_signal_emit(ng->o_bg, "e,state,bg_left", "e"); + edje_object_signal_emit(ng->o_frame, "e,state,bg_left", "e"); + break; + case E_GADCON_ORIENT_RIGHT: - edje_object_signal_emit(ng->o_bg, "e,state,bg_right", "e"); - edje_object_signal_emit(ng->o_frame, "e,state,bg_right", "e"); - break; + edje_object_signal_emit(ng->o_bg, "e,state,bg_right", "e"); + edje_object_signal_emit(ng->o_frame, "e,state,bg_right", "e"); + break; + case E_GADCON_ORIENT_TOP: - edje_object_signal_emit(ng->o_bg, "e,state,bg_top", "e"); - edje_object_signal_emit(ng->o_frame, "e,state,bg_top", "e"); - break; + edje_object_signal_emit(ng->o_bg, "e,state,bg_top", "e"); + edje_object_signal_emit(ng->o_frame, "e,state,bg_top", "e"); + break; + case E_GADCON_ORIENT_BOTTOM: - edje_object_signal_emit(ng->o_bg, "e,state,bg_bottom", "e"); - edje_object_signal_emit(ng->o_frame, "e,state,bg_bottom", "e"); - } + edje_object_signal_emit(ng->o_bg, "e,state,bg_bottom", "e"); + edje_object_signal_emit(ng->o_frame, "e,state,bg_bottom", "e"); + } /* switch */ ng->boxes = NULL; ngi_freeze(ng); EINA_LIST_FOREACH (cfg->boxes, l, cfg_box) - { - switch (cfg_box->type) - { - case launcher: - ngi_launcher_new(ng, cfg_box); - break; + { + switch (cfg_box->type) + { + case launcher: + ngi_launcher_new(ng, cfg_box); + break; - case taskbar: - ngi_taskbar_new(ng, cfg_box); - break; + case taskbar: + ngi_taskbar_new(ng, cfg_box); + break; - case gadcon: - ngi_gadcon_new(ng, cfg_box); - break; - } - } + case gadcon: + ngi_gadcon_new(ng, cfg_box); + break; + } /* switch */ + } if (cfg->autohide == AUTOHIDE_NORMAL) { - ng->hide_step = ng->size + 15; - ng->hide_state = hidden; + ng->hide_step = ng->size + 15; + ng->hide_state = hidden; } ng->handlers = eina_list_append - (ng->handlers, ecore_event_handler_add - (ECORE_X_EVENT_MOUSE_IN, _ngi_win_cb_mouse_in, ng)); + (ng->handlers, ecore_event_handler_add + (ECORE_X_EVENT_MOUSE_IN, _ngi_win_cb_mouse_in, ng)); ng->handlers = eina_list_append - (ng->handlers, ecore_event_handler_add - (ECORE_X_EVENT_MOUSE_OUT, _ngi_win_cb_mouse_out, ng)); + (ng->handlers, ecore_event_handler_add + (ECORE_X_EVENT_MOUSE_OUT, _ngi_win_cb_mouse_out, ng)); ng->handlers = eina_list_append - (ng->handlers, ecore_event_handler_add - (ECORE_EVENT_MOUSE_BUTTON_DOWN, _ngi_win_cb_mouse_down, ng)); + (ng->handlers, ecore_event_handler_add + (ECORE_EVENT_MOUSE_BUTTON_DOWN, _ngi_win_cb_mouse_down, ng)); ng->handlers = eina_list_append - (ng->handlers, ecore_event_handler_add - (ECORE_EVENT_MOUSE_BUTTON_UP, _ngi_win_cb_mouse_up, ng)); + (ng->handlers, ecore_event_handler_add + (ECORE_EVENT_MOUSE_BUTTON_UP, _ngi_win_cb_mouse_up, ng)); ng->handlers = eina_list_append - (ng->handlers, ecore_event_handler_add - (ECORE_EVENT_MOUSE_WHEEL, _ngi_win_cb_mouse_wheel, ng)); + (ng->handlers, ecore_event_handler_add + (ECORE_EVENT_MOUSE_WHEEL, _ngi_win_cb_mouse_wheel, ng)); ng->handlers = eina_list_append - (ng->handlers, ecore_event_handler_add - (ECORE_EVENT_MOUSE_MOVE, _ngi_win_cb_mouse_move, ng)); + (ng->handlers, ecore_event_handler_add + (ECORE_EVENT_MOUSE_MOVE, _ngi_win_cb_mouse_move, ng)); if (cfg->autohide == AUTOHIDE_FULLSCREEN) { - /* ng->show_bar = 1; */ + /* ng->show_bar = 1; */ - ng->handlers = eina_list_append - (ng->handlers, ecore_event_handler_add - (E_EVENT_DESK_SHOW, _ngi_win_cb_desk_show, ng)); - ng->handlers = eina_list_append - (ng->handlers, ecore_event_handler_add - (E_EVENT_BORDER_PROPERTY, _ngi_win_cb_border_event, ng)); + ng->handlers = eina_list_append + (ng->handlers, ecore_event_handler_add + (E_EVENT_DESK_SHOW, _ngi_win_cb_desk_show, ng)); + ng->handlers = eina_list_append + (ng->handlers, ecore_event_handler_add + (E_EVENT_BORDER_PROPERTY, _ngi_win_cb_border_event, ng)); } + /* else */ ng->show_bar = 0; @@ -305,7 +306,7 @@ ngi_config->instances = eina_list_append(ngi_config->instances, ng); return ng; -} +} /* ngi_new */ void ngi_free(Ng *ng) @@ -317,35 +318,51 @@ while(ng->boxes) { - box = ng->boxes->data; - if (box->cfg->type == taskbar) - ngi_taskbar_remove(box); - else if (box->cfg->type == launcher) - ngi_launcher_remove(box); - else if (box->cfg->type == gadcon) - ngi_gadcon_remove(box); + box = ng->boxes->data; + if (box->cfg->type == taskbar) + ngi_taskbar_remove(box); + else if (box->cfg->type == launcher) + ngi_launcher_remove(box); + else if (box->cfg->type == gadcon) + ngi_gadcon_remove(box); } - if (ng->animator) ecore_timer_del(ng->animator); - if (ng->menu_wait_timer) ecore_timer_del(ng->menu_wait_timer); - if (ng->mouse_out_timer) ecore_timer_del(ng->mouse_out_timer); - if (ng->mouse_in_timer) ecore_timer_del(ng->mouse_in_timer); - if (ng->effect_timer) ecore_timer_del(ng->effect_timer); + if (ng->animator) + ecore_timer_del(ng->animator); - if (ng->o_bg) evas_object_del(ng->o_bg); - if (ng->o_frame) evas_object_del(ng->o_frame); - if (ng->clip) evas_object_del(ng->clip); - if (ng->bg_clip) evas_object_del(ng->bg_clip); + if (ng->menu_wait_timer) + ecore_timer_del(ng->menu_wait_timer); - if (ng->win) _ngi_win_free(ng->win); + if (ng->mouse_out_timer) + ecore_timer_del(ng->mouse_out_timer); + if (ng->mouse_in_timer) + ecore_timer_del(ng->mouse_in_timer); + + if (ng->effect_timer) + ecore_timer_del(ng->effect_timer); + + if (ng->o_bg) + evas_object_del(ng->o_bg); + + if (ng->o_frame) + evas_object_del(ng->o_frame); + + if (ng->clip) + evas_object_del(ng->clip); + + if (ng->bg_clip) + evas_object_del(ng->bg_clip); + + if (ng->win) + _ngi_win_free(ng->win); + EINA_LIST_FREE(ng->handlers, h) - ecore_event_handler_del(h); + ecore_event_handler_del(h); free(ng); -} +} /* ngi_free */ - /***************************************************************************/ EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "itask-ng" }; @@ -357,20 +374,19 @@ Config_Item *ci; EINA_LIST_FOREACH (ngi_config->items, l, ci) - ngi_new(ci); + ngi_new(ci); initialized = 1; return 0; +} /* _ngi_init_timer_cb */ -} - /* menu item callback(s) */ static void _e_mod_run_cb(void *data, E_Menu *m, E_Menu_Item *mi) { ngi_instances_config(e_util_zone_current_get(e_manager_current_get())->container, ""); -} +} /* _e_mod_run_cb */ /* menu item add hook */ static void @@ -382,9 +398,8 @@ e_menu_item_label_set(mi, D_("Itask-NG")); e_util_menu_item_edje_icon_set(mi, "preferences-desktop-shelf"); e_menu_item_callback_set(mi, _e_mod_run_cb, NULL); -} +} /* _e_mod_menu_add */ - EAPI void * e_modapi_init(E_Module *m) { @@ -437,9 +452,10 @@ ngi_conf_edd = E_CONFIG_DD_NEW("Ngi_Config", Config); E_CONFIG_LIST(ngi_conf_edd, Config, items, ngi_conf_item_edd); - ngi_config = (Config*) e_config_domain_load("module.itask-ng", ngi_conf_edd); + ngi_config = (Config *)e_config_domain_load("module.itask-ng", ngi_conf_edd); - if (!ngi_config) ngi_config = E_NEW(Config, 1); + if (!ngi_config) + ngi_config = E_NEW(Config, 1); ngi_config->cfd = NULL; ngi_config->module = m; @@ -450,38 +466,38 @@ snprintf(buf, sizeof(buf), "%s/.e/e/applications/bar/", e_user_homedir_get()); if (!ecore_file_mkdir(buf) && !ecore_file_is_dir(buf)) { - e_error_message_show("Error creating directory:\n %s\n",buf); - return m; + e_error_message_show("Error creating directory:\n %s\n",buf); + return m; } /* HACK - as long as we dont have an e_initialisation_finished_cb ... */ /* ecore_timer_add(2.0, */ e_configure_registry_item_add("extensions/itask_ng", 40, - D_("Itask NG"), NULL, - "preferences-desktop-shelf", - ngi_instances_config); + D_("Itask NG"), NULL, + "preferences-desktop-shelf", + ngi_instances_config); ngi_config->handlers = eina_list_append - (ngi_config->handlers, ecore_event_handler_add - (E_EVENT_CONTAINER_RESIZE, _ngi_cb_container_resize, NULL)); + (ngi_config->handlers, ecore_event_handler_add + (E_EVENT_CONTAINER_RESIZE, _ngi_cb_container_resize, NULL)); ngi_taskbar_init(); ngi_gadcon_init(); if (ecore_x_screen_is_composited(0) || e_config->use_composite) - ngi_config->use_composite = 1; + ngi_config->use_composite = 1; else - ngi_config->use_composite = 0; + ngi_config->use_composite = 0; e_module_delayed_set(m, 1); _ngi_init_timer_cb(NULL); maug = e_int_menus_menu_augmentation_add - ("config/1", _e_mod_menu_add, NULL, NULL, NULL); + ("config/1", _e_mod_menu_add, NULL, NULL, NULL); return m; -} +} /* e_modapi_init */ EAPI int e_modapi_shutdown(E_Module *m) @@ -492,45 +508,46 @@ if (maug) { - e_int_menus_menu_augmentation_del("config/1", maug); - maug = NULL; + e_int_menus_menu_augmentation_del("config/1", maug); + maug = NULL; } ngi_gadcon_shutdown(); EINA_LIST_FOREACH_SAFE(ngi_config->instances, l, ll, ng) - { - if (ng->cfg->config_dialog) - e_object_del(E_OBJECT(ng->cfg->config_dialog)); - ngi_free(ng); - } + { + if (ng->cfg->config_dialog) + e_object_del(E_OBJECT(ng->cfg->config_dialog)); + ngi_free(ng); + } + EINA_LIST_FREE(ngi_config->handlers, h) - ecore_event_handler_del(h); + ecore_event_handler_del(h); while (ngi_config->items) { - Config_Item *ci; - Config_Box *cfg_box; - Eina_List *l, *ll; - Config_Gadcon *cg; + Config_Item *ci; + Config_Box *cfg_box; + Eina_List *l, *ll; + Config_Gadcon *cg; - ci = (Config_Item*) ngi_config->items->data; - ngi_config->items = eina_list_remove_list(ngi_config->items, - ngi_config->items); + ci = (Config_Item *)ngi_config->items->data; + ngi_config->items = eina_list_remove_list(ngi_config->items, + ngi_config->items); - EINA_LIST_FOREACH (ci->boxes, l, cfg_box) - { - if (cfg_box->type == launcher && cfg_box->launcher_app_dir) - eina_stringshare_del(cfg_box->launcher_app_dir); + EINA_LIST_FOREACH (ci->boxes, l, cfg_box) + { + if (cfg_box->type == launcher && cfg_box->launcher_app_dir) + eina_stringshare_del(cfg_box->launcher_app_dir); - if (cfg_box->type == gadcon) - { - EINA_LIST_FOREACH (cfg_box->gadcon_items, ll, cg) - eina_stringshare_del(cg->name); - } - } - free(ci); + if (cfg_box->type == gadcon) + { + EINA_LIST_FOREACH (cfg_box->gadcon_items, ll, cg) + eina_stringshare_del(cg->name); + } + } + free(ci); } free(ngi_config->theme_path); @@ -545,30 +562,31 @@ e_configure_registry_item_del("extensions/itask_ng"); return 1; -} +} /* e_modapi_shutdown */ EAPI int e_modapi_save(E_Module *m) { e_config_domain_save("module.itask-ng", ngi_conf_edd, ngi_config); return 1; -} +} /* e_modapi_save */ static Ngi_Win * _ngi_win_new(Ng *ng) { Ngi_Win *win; const char *drop[] = - { - "text/uri-list", - "text/x-moz-url", - "enlightenment/x-file", - "enlightenment/desktop", - "enlightenment/border" - }; + { + "text/uri-list", + "text/x-moz-url", + "enlightenment/x-file", + "enlightenment/desktop", + "enlightenment/border" + }; win = E_NEW(Ngi_Win, 1); - if (!win) return NULL; + if (!win) + return NULL; win->ng = ng; win->edge = 0; @@ -578,29 +596,29 @@ win->evas_win = 0; win->ee = e_canvas_new(e_config->evas_engine_popups, - ng->zone->container->win, - 0, 0, 0, 0, 1, 1, &(win->evas_win)); + ng->zone->container->win, + 0, 0, 0, 0, 1, 1, &(win->evas_win)); if (ngi_config->use_composite) { - ecore_evas_alpha_set(win->ee, 1); - win->evas_win = ecore_evas_software_x11_window_get(win->ee); + ecore_evas_alpha_set(win->ee, 1); + win->evas_win = ecore_evas_software_x11_window_get(win->ee); - XRectangle rect; - rect.x = 0; - rect.y = 0; - rect.width = 0; - rect.height = 0; - XShapeCombineRectangles - ((Display*)ecore_x_display_get(), - win->evas_win, ShapeInput, 0, 0, - &rect, 1, ShapeSet, Unsorted); - ecore_x_netwm_window_type_set - (win->evas_win, ECORE_X_WINDOW_TYPE_DOCK); + XRectangle rect; + rect.x = 0; + rect.y = 0; + rect.width = 0; + rect.height = 0; + XShapeCombineRectangles + ((Display *)ecore_x_display_get(), + win->evas_win, ShapeInput, 0, 0, + &rect, 1, ShapeSet, Unsorted); + ecore_x_netwm_window_type_set + (win->evas_win, ECORE_X_WINDOW_TYPE_DOCK); } else { - ecore_evas_shaped_set(win->ee, 1); + ecore_evas_shaped_set(win->ee, 1); } ecore_evas_avoid_damage_set(win->ee, 1); @@ -620,51 +638,53 @@ if (ng->cfg->stacking != above_all) { - win->edge = ecore_x_window_input_new(ng->zone->container->win, 0, 0, 1, 1); - ecore_x_window_show(win->edge); - e_drop_xdnd_register_set(win->edge, 1); + win->edge = ecore_x_window_input_new(ng->zone->container->win, 0, 0, 1, 1); + ecore_x_window_show(win->edge); + e_drop_xdnd_register_set(win->edge, 1); - win->fake_ewin = E_OBJECT_ALLOC(E_Win, E_WIN_TYPE, NULL); - win->fake_ewin->x = 0; - win->fake_ewin->y = 0; - win->fake_ewin->w = 1; - win->fake_ewin->h = 1; - win->fake_ewin->evas_win = win->edge; + win->fake_ewin = E_OBJECT_ALLOC(E_Win, E_WIN_TYPE, NULL); + win->fake_ewin->x = 0; + win->fake_ewin->y = 0; + win->fake_ewin->w = 1; + win->fake_ewin->h = 1; + win->fake_ewin->evas_win = win->edge; - win->drop_handler = e_drop_handler_add - (E_OBJECT(win->fake_ewin), ng, - _ngi_win_cb_drop_enter, _ngi_win_cb_drop_move, - _ngi_win_cb_drop_leave, _ngi_win_cb_drop_end, - drop, 5, 0, 0, 0, 0); + win->drop_handler = e_drop_handler_add + (E_OBJECT(win->fake_ewin), ng, + _ngi_win_cb_drop_enter, _ngi_win_cb_drop_move, + _ngi_win_cb_drop_leave, _ngi_win_cb_drop_end, + drop, 5, 0, 0, 0, 0); } switch (ng->cfg->stacking) { case below_fullscreen: - e_container_window_raise(ng->zone->container, win->evas_win, 150); - if (ng->cfg->lock_deskswitch) - e_container_window_raise(ng->zone->container, win->edge, 999); - else - e_container_window_raise(ng->zone->container, win->edge, 150); - e_container_window_raise(ng->zone->container, win->input, 150); - break; + e_container_window_raise(ng->zone->container, win->evas_win, 150); + if (ng->cfg->lock_deskswitch) + e_container_window_raise(ng->zone->container, win->edge, 999); + else + e_container_window_raise(ng->zone->container, win->edge, 150); + + e_container_window_raise(ng->zone->container, win->input, 150); + break; + case above_all: - e_container_window_raise(ng->zone->container, win->evas_win, 250); - e_container_window_raise(ng->zone->container, win->input, 999); - } + e_container_window_raise(ng->zone->container, win->evas_win, 250); + e_container_window_raise(ng->zone->container, win->input, 999); + } /* switch */ ngi_win_position_calc(win); return win; -} +} /* _ngi_win_new */ static int _ngi_win_free(Ngi_Win *win) { if (win->ee) { - e_canvas_del(win->ee); - ecore_evas_free(win->ee); + e_canvas_del(win->ee); + ecore_evas_free(win->ee); } e_drop_xdnd_register_set(win->input, 0); @@ -674,18 +694,18 @@ if (win->edge) { - e_drop_handler_del(win->drop_handler); + e_drop_handler_del(win->drop_handler); - e_drop_xdnd_register_set(win->edge, 0); - ecore_x_window_hide(win->edge); - ecore_x_window_free(win->edge); - free(win->fake_ewin); + e_drop_xdnd_register_set(win->edge, 0); + ecore_x_window_hide(win->edge); + ecore_x_window_free(win->edge); + free(win->fake_ewin); } free(win); return 1; -} +} /* _ngi_win_free */ static Eina_Bool _ngi_cb_container_resize(void *data, int ev_type, void *event_info) @@ -695,108 +715,116 @@ Eina_List *l; Ng *ng; - if (!initialized) return EINA_TRUE; + if (!initialized) + return EINA_TRUE; EINA_LIST_FOREACH (ngi_config->items, l, ci) - { - if (!ci->ng) - { - ngi_new(ci); - continue; - } + { + if (!ci->ng) + { + ngi_new(ci); + continue; + } - ng = ci->ng; - zone = e_util_container_zone_number_get(ci->container, ci->zone); - if (!zone) - { - ngi_free(ng); - continue; - } + ng = ci->ng; + zone = e_util_container_zone_number_get(ci->container, ci->zone); + if (!zone) + { + ngi_free(ng); + continue; + } - ngi_win_position_calc(ng->win); - ngi_reposition(ng); - ngi_input_extents_calc(ng, 1); - ngi_thaw(ng); - } + ngi_win_position_calc(ng->win); + ngi_reposition(ng); + ngi_input_extents_calc(ng, 1); + ngi_thaw(ng); + } return EINA_TRUE; -} +} /* _ngi_cb_container_resize */ void ngi_win_show(Ngi_Win *win) { - if (win->ee) ecore_evas_show(win->ee); -} + if (win->ee) + ecore_evas_show(win->ee); +} /* ngi_win_show */ void ngi_win_hide(Ngi_Win *win) { - if (win->ee) ecore_evas_hide(win->ee); -} + if (win->ee) + ecore_evas_hide(win->ee); +} /* ngi_win_hide */ void ngi_win_position_calc(Ngi_Win *win) { Ng *ng = win->ng; - E_Gadcon_Orient orient = (E_Gadcon_Orient) ng->cfg->orient; + E_Gadcon_Orient orient = (E_Gadcon_Orient)ng->cfg->orient; int size = WINDOW_HEIGHT; switch (orient) { case E_GADCON_ORIENT_LEFT: - win->w = size; - win->h = ng->zone->h; - win->x = 0; - win->y = 0; - ng->horizontal = 0; - break; + win->w = size; + win->h = ng->zone->h; + win->x = 0; + win->y = 0; + ng->horizontal = 0; + break; + case E_GADCON_ORIENT_RIGHT: - win->w = size; - win->h = ng->zone->h; - win->x = ng->zone->w - size; - win->y = 0; - ng->horizontal = 0; - break; + win->w = size; + win->h = ng->zone->h; + win->x = ng->zone->w - size; + win->y = 0; + ng->horizontal = 0; + break; + case E_GADCON_ORIENT_TOP: - win->w = ng->zone->w; - win->h = size; - win->x = 0; - win->y = 0; - ng->horizontal = 1; - break; + win->w = ng->zone->w; + win->h = size; + win->x = 0; + win->y = 0; + ng->horizontal = 1; + break; + case E_GADCON_ORIENT_BOTTOM: - win->w = ng->zone->w; - win->h = size; - win->x = 0; - win->y = ng->zone->h - win->h; - ng->horizontal = 1; - break; + win->w = ng->zone->w; + win->h = size; + win->x = 0; + win->y = ng->zone->h - win->h; + ng->horizontal = 1; + break; + default: - break; - } + break; + } /* switch */ if (win->ee) { - ecore_evas_move_resize - (win->ee, win->ng->zone->x + win->x, - win->ng->zone->y + win->y, win->w, win->h); + ecore_evas_move_resize + (win->ee, win->ng->zone->x + win->x, + win->ng->zone->y + win->y, win->w, win->h); } -} +} /* ngi_win_position_calc */ static Eina_Bool _ngi_mouse_in_timer(void *data) { Ng *ng = data; - if (!ng->mouse_in) return EINA_FALSE; + if (!ng->mouse_in) + return EINA_FALSE; if (ng->cfg->autohide && ng->hide_state != show) - _ngi_autohide(ng, 0); + _ngi_autohide(ng, 0); if (!ng->dnd) { - evas_event_feed_mouse_in(ng->win->evas, 0, NULL); - _ngi_item_activate(ng); + evas_event_feed_mouse_in(ng->win->evas, 0, NULL); + _ngi_item_activate(ng); } ng->mouse_in_timer = NULL; @@ -805,7 +833,7 @@ ngi_animate(ng); return EINA_FALSE; -} +} /* _ngi_mouse_in_timer */ void ngi_mouse_in(Ng *ng) @@ -815,27 +843,28 @@ if (ng->mouse_out_timer) { - ecore_timer_del(ng->mouse_out_timer); - ng->mouse_out_timer = NULL; + ecore_timer_del(ng->mouse_out_timer); + ng->mouse_out_timer = NULL; } if (ng->cfg->stacking != above_all) { - if (!ng->mouse_in_timer) - ng->mouse_in_timer = ecore_timer_add(0.1, _ngi_mouse_in_timer, ng); + if (!ng->mouse_in_timer) + ng->mouse_in_timer = ecore_timer_add(0.1, _ngi_mouse_in_timer, ng); } else { - _ngi_mouse_in_timer(ng); + _ngi_mouse_in_timer(ng); } -} +} /* ngi_mouse_in */ static Eina_Bool _ngi_mouse_out_timer(void *data) { Ng *ng = data; - if (ng->mouse_in) return EINA_FALSE; + if (ng->mouse_in) + return EINA_FALSE; ng->mouse_out_timer = NULL; @@ -848,7 +877,7 @@ ngi_animate(ng); return EINA_FALSE; -} +} /* _ngi_mouse_out_timer */ static Eina_Bool _ngi_mouse_out_wait(void *data) @@ -858,10 +887,10 @@ ng->zoom_out = 1; ng->mouse_out_timer = ecore_timer_add - (ng->cfg->hide_timeout, _ngi_mouse_out_timer, ng); + (ng->cfg->hide_timeout, _ngi_mouse_out_timer, ng); return EINA_FALSE; -} +} /* _ngi_mouse_out_wait */ void ngi_mouse_out(Ng *ng) @@ -869,11 +898,11 @@ ng->mouse_in = 0; if (ng->mouse_out_timer) - ecore_timer_del(ng->mouse_out_timer); + ecore_timer_del(ng->mouse_out_timer); ng->mouse_out_timer = ecore_timer_add - (0.01, _ngi_mouse_out_wait, ng); -} + (0.01, _ngi_mouse_out_wait, ng); +} /* ngi_mouse_out */ static Eina_Bool _ngi_win_cb_mouse_in(void *data, int type, void *event) @@ -882,11 +911,11 @@ Ng *ng = data; if (ev->win != ng->win->input && ev->win != ng->win->edge) - return EINA_TRUE; + return EINA_TRUE; ng->pos = ng->horizontal ? - (ev->root.x - ng->zone->x): - (ev->root.y - ng->zone->y); + (ev->root.x - ng->zone->x) : + (ev->root.y - ng->zone->y); ngi_mouse_in(ng); @@ -894,7 +923,7 @@ evas_object_focus_set(ng->bg_clip, 1); return EINA_TRUE; -} +} /* _ngi_win_cb_mouse_in */ static Eina_Bool _ngi_win_cb_mouse_out(void *data, int type, void *event) @@ -903,14 +932,14 @@ Ng *ng = data; if (ev->win != ng->win->input && ev->win != ng->win->edge) - return EINA_TRUE; + return EINA_TRUE; ngi_mouse_out(ng); evas_event_feed_mouse_out(ng->win->evas, 0, NULL); return EINA_TRUE; -} +} /* _ngi_win_cb_mouse_out */ static Eina_Bool _ngi_menu_wait_after_timer_cb(void *data) @@ -921,7 +950,7 @@ ngi_animate(ng); return EINA_FALSE; -} +} /* _ngi_menu_wait_after_timer_cb */ static Eina_Bool _ngi_menu_wait_timer_cb(void *data) @@ -929,13 +958,13 @@ Ng *ng = data; if (e_menu_grab_window_get()) - return EINA_TRUE; + return EINA_TRUE; ng->menu_wait_timer = - ecore_timer_add(1.0, _ngi_menu_wait_after_timer_cb, ng); + ecore_timer_add(1.0, _ngi_menu_wait_after_timer_cb, ng); return EINA_FALSE; -} +} /* _ngi_menu_wait_timer_cb */ static Eina_Bool _ngi_win_cb_mouse_down(void *data, int type, void *event) @@ -945,42 +974,42 @@ if ((ev->event_window != ng->win->input) && (ev->event_window != ng->win->edge)) - return EINA_TRUE; + return EINA_TRUE; Ngi_Item *it = ng->item_active; if (ev->buttons == 2) { - ngi_configure_module(ng->cfg); - return EINA_TRUE; + ngi_configure_module(ng->cfg); + return EINA_TRUE; } else if (ng->item_active && ev->buttons == 1) { - it->drag.x = ev->root.x; - it->drag.y = ev->root.y; - it->drag.start = 1; - it->drag.dnd = 0; - ng->item_drag = it; + it->drag.x = ev->root.x; + it->drag.y = ev->root.y; + it->drag.start = 1; + it->drag.dnd = 0; + ng->item_drag = it; } else if (ev->buttons == 3) { - edje_object_signal_emit(ng->label, "e,state,label_hide", "e"); + edje_object_signal_emit(ng->label, "e,state,label_hide", "e"); } ITEM_MOUSE_DOWN(it, ev); evas_event_feed_mouse_down - (ng->win->evas, ev->buttons, 0, ev->timestamp, NULL); + (ng->win->evas, ev->buttons, 0, ev->timestamp, NULL); if (ng->menu_wait_timer) - ecore_timer_del(ng->menu_wait_timer); + ecore_timer_del(ng->menu_wait_timer); + ng->menu_wait_timer = - ecore_timer_add(0.1, _ngi_menu_wait_timer_cb, ng); + ecore_timer_add(0.1, _ngi_menu_wait_timer_cb, ng); return EINA_TRUE; -} +} /* _ngi_win_cb_mouse_down */ - static Eina_Bool _ngi_win_cb_mouse_up(void *data, int type, void *event) { @@ -989,24 +1018,24 @@ if ((ev->event_window != ng->win->input) && (ev->event_window != ng->win->edge)) - return EINA_TRUE; + return EINA_TRUE; if (ng->item_active) { - ITEM_MOUSE_UP(ng->item_active, ev); + ITEM_MOUSE_UP(ng->item_active, ev); - evas_event_feed_mouse_up - (ng->win->evas, ev->buttons, 0, ev->timestamp, NULL); + evas_event_feed_mouse_up + (ng->win->evas, ev->buttons, 0, ev->timestamp, NULL); - if (ng->item_drag) - { - ng->item_drag->drag.start = 0; - ng->item_drag = NULL; - } + if (ng->item_drag) + { + ng->item_drag->drag.start = 0; + ng->item_drag = NULL; + } } return EINA_TRUE; -} +} /* _ngi_win_cb_mouse_up */ static Eina_Bool _ngi_win_cb_mouse_wheel(void *data, int type, void *event) @@ -1016,15 +1045,14 @@ if ((ev->event_window != ng->win->input) && (ev->event_window != ng->win->edge)) - return EINA_TRUE; + return EINA_TRUE; - evas_event_feed_mouse_wheel - (ng->win->evas, 0, ev->z, ev->timestamp, NULL); + evas_event_feed_mouse_wheel + (ng->win->evas, 0, ev->z, ev->timestamp, NULL); return EINA_TRUE; -} +} /* _ngi_win_cb_mouse_wheel */ - static Eina_Bool _ngi_win_cb_mouse_move(void *data, int type, void *event) { @@ -1033,7 +1061,7 @@ if ((ev->event_window != ng->win->input) && (ev->event_window != ng->win->edge)) - return EINA_TRUE; + return EINA_TRUE; int pos = ng->horizontal ? ev->root.x : ev->root.y; @@ -1041,21 +1069,21 @@ if (ng->pos != pos) { - if (pos >= ng->start && pos < ng->start + ng->w) - { - evas_event_feed_mouse_move - (ng->win->evas, - ev->root.x - ng->win->x, - ev->root.y - ng->win->y, - 0, NULL); + if (pos >= ng->start && pos < ng->start + ng->w) + { + evas_event_feed_mouse_move + (ng->win->evas, + ev->root.x - ng->win->x, + ev->root.y - ng->win->y, + 0, NULL); - ng->pos = pos; - ng->zoom_out = 0; - } - else - { - ng->zoom_out = 1; - } + ng->pos = pos; + ng->zoom_out = 0; + } + else + { + ng->zoom_out = 1; + } } ng->changed = 1; @@ -1064,26 +1092,26 @@ if (ng->item_drag) { - int dx = ev->root.x - ng->item_drag->drag.x; - int dy = ev->root.y - ng->item_drag->drag.y; + int dx = ev->root.x - ng->item_drag->drag.x; + int dy = ev->root.y - ng->item_drag->drag.y; - if (((dx * dx) + (dy * dy)) > (e_config->drag_resist * e_config->drag_resist)) - { - ng->item_drag->drag.dnd = 1; - ng->item_drag->drag.start = 0; + if (((dx * dx) + (dy * dy)) > (e_config->drag_resist * e_config->drag_resist)) + { + ng->item_drag->drag.dnd = 1; + ng->item_drag->drag.start = 0; - ITEM_DRAG_START(ng->item_drag); - ITEM_MOUSE_OUT(ng->item_active); + ITEM_DRAG_START(ng->item_drag); + ITEM_MOUSE_OUT(ng->item_active); - ng->item_active = NULL; - ng->item_drag = NULL; - } + ng->item_active = NULL; + ng->item_drag = NULL; + } } ngi_animate(ng); return EINA_TRUE; -} +} /* _ngi_win_cb_mouse_move */ static void _ngi_win_cb_drop_enter(void *data, const char *type, void *event_info) @@ -1091,7 +1119,7 @@ Ng *ng = data; ng->dnd = 1; ngi_mouse_in(ng); -} +} /* _ngi_win_cb_drop_enter */ static void _ngi_win_cb_drop_leave(void *data, const char *type, void *event_info) @@ -1099,13 +1127,13 @@ Ng *ng = data; ng->dnd = 0; ngi_mouse_out(ng); -} +} /* _ngi_win_cb_drop_leave */ static void _ngi_win_cb_drop_move(void *data, const char *type, void *event_info) { /* Ng *ng; */ -} +} /* _ngi_win_cb_drop_move */ static void _ngi_win_cb_drop_end(void *data, const char *type, void *event_info) @@ -1113,12 +1141,10 @@ Ng *ng = data; ng->dnd = 0; ngi_mouse_out(ng); -} +} /* _ngi_win_cb_drop_end */ - /**************************************************************************/ - static void _ngi_netwm_icon_geometry_set(E_Border *bd, int x, int y, int w, int h) { @@ -1128,8 +1154,8 @@ sizes[2] = w; sizes[3] = h; ecore_x_window_prop_card32_set - (bd->win, ECORE_X_ATOM_NET_WM_ICON_GEOMETRY, sizes, 4); -} + (bd->win, ECORE_X_ATOM_NET_WM_ICON_GEOMETRY, sizes, 4); +} /* _ngi_netwm_icon_geometry_set */ void ngi_input_extents_calc(Ng *ng, int resize) @@ -1145,16 +1171,16 @@ int hidden = 0; if (ng->hide_state == hiding || ng->hide_state == hidden) - hidden = ng->size + 15; + hidden = ng->size + 15; if (ng->state != unzoomed && !ng->zoom_out) { - item_zoomed = ng->cfg->size * (1 + ng->cfg->zoomfactor/2.0); + item_zoomed = ng->cfg->size * (1 + ng->cfg->zoomfactor / 2.0); } else { - /* eeeek FIXME calc with edge distances + hidestep*/ - item_zoomed = ng->size + (ng->cfg->autohide ? 18 : 10); + /* eeeek FIXME calc with edge distances + hidestep*/ + item_zoomed = ng->size + (ng->cfg->autohide ? 18 : 10); } int extra = ng->size; @@ -1162,120 +1188,128 @@ switch (ng->cfg->orient) { case E_GADCON_ORIENT_BOTTOM: - x = ng->start - extra; - y = (ng->win->h + hidden) - item_zoomed; - ww = w = ng->w + 2*extra; - h = item_zoomed; + x = ng->start - extra; + y = (ng->win->h + hidden) - item_zoomed; + ww = w = ng->w + 2 * extra; + h = item_zoomed; - wx = zone->x + x; - wy = zone->y + (zone->h - 4); - wh = 4; - break; + wx = zone->x + x; + wy = zone->y + (zone->h - 4); + wh = 4; + break; + case E_GADCON_ORIENT_TOP: - x = ng->start; - y = - hidden; - ww = w = ng->w; - h = item_zoomed; + x = ng->start; + y = -hidden; + ww = w = ng->w; + h = item_zoomed; - wx = zone->x + x; - wy = zone->y; - wh = 4; - break; + wx = zone->x + x; + wy = zone->y; + wh = 4; + break; + case E_GADCON_ORIENT_LEFT: - x = - hidden; - y = ng->start; - w = item_zoomed; - wh = h = ng->w; + x = -hidden; + y = ng->start; + w = item_zoomed; + wh = h = ng->w; - wx = zone->x; - wy = zone->y + y; - ww = 4; - break; + wx = zone->x; + wy = zone->y + y; + ww = 4; + break; + case E_GADCON_ORIENT_RIGHT: - x = (ng->win->w + hidden) - item_zoomed; - y = ng->start; - w = item_zoomed; - wh = h = ng->w; + x = (ng->win->w + hidden) - item_zoomed; + y = ng->start; + w = item_zoomed; + wh = h = ng->w; - wx = zone->x + (ng->zone->w - 4); - wy = zone->y + y; - ww = 4; - break; - } + wx = zone->x + (ng->zone->w - 4); + wy = zone->y + y; + ww = 4; + break; + } /* switch */ if (win->edge && resize) { - ecore_x_window_move_resize(win->edge, wx, wy, ww, wh); - e_drop_handler_geometry_set(win->drop_handler, wx, wy, ww, wh); - + ecore_x_window_move_resize(win->edge, wx, wy, ww, wh); + e_drop_handler_geometry_set(win->drop_handler, wx, wy, ww, wh); } ecore_x_window_move_resize(win->input, - ng->zone->x + win->x + x, - ng->zone->y + win->y + y, - w, h); + ng->zone->x + win->x + x, + ng->zone->y + win->y + y, + w, h); if (ngi_config->use_composite && win->ee) { - XRectangle rect; - rect.x = rect.y = 0; - rect.width = rect.height = 0; - XShapeCombineRectangles((Display*)ecore_x_display_get(), - win->evas_win, ShapeInput, 0, 0, - &rect, 1, ShapeSet, Unsorted); + XRectangle rect; + rect.x = rect.y = 0; + rect.width = rect.height = 0; + XShapeCombineRectangles((Display *)ecore_x_display_get(), + win->evas_win, ShapeInput, 0, 0, + &rect, 1, ShapeSet, Unsorted); } switch (ng->cfg->stacking) { case below_fullscreen: - e_container_window_raise(ng->zone->container, ng->win->evas_win, 150); - if (ng->cfg->lock_deskswitch) - e_container_window_raise(ng->zone->container, ng->win->edge, 999); - else - e_container_window_raise(ng->zone->container, ng->win->edge, 150); - e_container_window_raise(ng->zone->container, ng->win->input, 150); - break; + e_container_window_raise(ng->zone->container, ng->win->evas_win, 150); + if (ng->cfg->lock_deskswitch) + e_container_window_raise(ng->zone->container, ng->win->edge, 999); + else + e_container_window_raise(ng->zone->container, ng->win->edge, 150); + + e_container_window_raise(ng->zone->container, ng->win->input, 150); + break; + case above_all: - e_container_window_raise(ng->zone->container, ng->win->input, 999); - } + e_container_window_raise(ng->zone->container, ng->win->input, 999); + } /* switch */ EINA_LIST_FOREACH (ng->boxes, l, box) - { - if (!box->drop_handler) continue; + { + if (!box->drop_handler) + continue; - int w = box->w; - if (w < 10) w = 10; + int w = box->w; + if (w < 10) + w = 10; - switch (ng->cfg->orient) - { - case E_GADCON_ORIENT_BOTTOM: - e_drop_handler_geometry_set(box->drop_handler, - ng->zone->x + box->pos, - ng->zone->y + win->y, - w, win->h); - break; - case E_GADCON_ORIENT_TOP: - e_drop_handler_geometry_set(box->drop_handler, - ng->zone->x + box->pos, - ng->zone->y, - w, item_zoomed); - break; - case E_GADCON_ORIENT_LEFT: - e_drop_handler_geometry_set(box->drop_handler, - ng->zone->x, - ng->zone->y + box->pos, - item_zoomed, w); - break; - case E_GADCON_ORIENT_RIGHT: - e_drop_handler_geometry_set(box->drop_handler, - ng->zone->x + (ng->zone->w + hidden) - item_zoomed, - ng->zone->y + box->pos, - item_zoomed, w); - } - } -} + switch (ng->cfg->orient) + { + case E_GADCON_ORIENT_BOTTOM: + e_drop_handler_geometry_set(box->drop_handler, + ng->zone->x + box->pos, + ng->zone->y + win->y, + w, win->h); + break; + case E_GADCON_ORIENT_TOP: + e_drop_handler_geometry_set(box->drop_handler, + ng->zone->x + box->pos, + ng->zone->y, + w, item_zoomed); + break; + case E_GADCON_ORIENT_LEFT: + e_drop_handler_geometry_set(box->drop_handler, + ng->zone->x, + ng->zone->y + box->pos, + item_zoomed, w); + break; + + case E_GADCON_ORIENT_RIGHT: + e_drop_handler_geometry_set(box->drop_handler, + ng->zone->x + (ng->zone->w + hidden) - item_zoomed, + ng->zone->y + box->pos, + item_zoomed, w); + } /* switch */ + } +} /* ngi_input_extents_calc */ + /**************************************************************************/ static Ngi_Item * @@ -1284,87 +1318,89 @@ Eina_List *l, *ll; Ngi_Item *it; Ngi_Box *box; - int size = ng->size/2; + int size = ng->size / 2; int pos = ng->pos; EINA_LIST_FOREACH (ng->boxes, ll, box) - { - if (pos < box->pos) continue; + { + if (pos < box->pos) + continue; - EINA_LIST_FOREACH (box->items, l, it) - { - if (it->scale == 0.0) continue; + EINA_LIST_FOREACH (box->items, l, it) + { + if (it->scale == 0.0) + continue; - if (pos <= it->pos + size + ng->item_spacing) - { - if (pos + ng->item_spacing < it->pos - size) - return NULL; - else - return it; - } - } - } + if (pos <= it->pos + size + ng->item_spacing) + { + if (pos + ng->item_spacing < it->pos - size) + return NULL; + else + return it; + } + } + } return NULL; -} +} /* _ngi_item_at_position_get */ - static void _ngi_item_activate(Ng *ng) { Ngi_Item *it = _ngi_item_at_position_get(ng); - if (it && ng->cfg->zoom_one) ng->pos = it->pos; + if (it && ng->cfg->zoom_one) + ng->pos = it->pos; if (ng->mouse_in && it && it != ng->item_active) { - ITEM_MOUSE_OUT(ng->item_active); - ITEM_MOUSE_IN(it); - ng->item_active = it; + ITEM_MOUSE_OUT(ng->item_active); + ITEM_MOUSE_IN(it); + ng->item_active = it; } else if (!it || ng->zoom_out) { - ITEM_MOUSE_OUT(ng->item_active); - ng->item_active = NULL; /*XXX TEST*/ + ITEM_MOUSE_OUT(ng->item_active); + ng->item_active = NULL; /*XXX TEST*/ } if (ng->item_active && ng->cfg->show_label) { - /* XXX this duplicates code from ngi_redraw */ - int h, size; - double zoom = 1.0, disp; + /* XXX this duplicates code from ngi_redraw */ + int h, size; + double zoom = 1.0, disp; - if (ng->win->ee) - h = ng->win->h; - else - h = ng->zone->h; + if (ng->win->ee) + h = ng->win->h; + else + h = ng->zone->h; - if (ng->zoom > 1.0) - _ngi_zoom_function(ng, 0, &zoom, &disp); + if (ng->zoom > 1.0) + _ngi_zoom_function(ng, 0, &zoom, &disp); - size = zoom * ng->size; - switch (ng->cfg->orient) - { - case E_GADCON_ORIENT_BOTTOM: - evas_object_move(ng->label, ng->item_active->pos, - (h + ng->hide_step) - (size + 12 + TEXT_DIST)); /*XXX 12?*/ - break; - case E_GADCON_ORIENT_TOP: - evas_object_move(ng->label, ng->item_active->pos, - (size + 12 + TEXT_DIST) - ng->hide_step); - } + size = zoom * ng->size; + switch (ng->cfg->orient) + { + case E_GADCON_ORIENT_BOTTOM: + evas_object_move(ng->label, ng->item_active->pos, + (h + ng->hide_step) - (size + 12 + TEXT_DIST)); /*XXX 12?*/ + break; - if (ng->item_active->label && ng->item_active->label[0]) - { - evas_object_show(ng->label); - edje_object_signal_emit(ng->label, "e,state,label_show", "e"); - edje_object_part_text_set(ng->label, "e.text.label", ng->item_active->label); - } - else - evas_object_hide(ng->label); + case E_GADCON_ORIENT_TOP: + evas_object_move(ng->label, ng->item_active->pos, + (size + 12 + TEXT_DIST) - ng->hide_step); + } /* switch */ + + if (ng->item_active->label && ng->item_active->label[0]) + { + evas_object_show(ng->label); + edje_object_signal_emit(ng->label, "e,state,label_show", "e"); + edje_object_part_text_set(ng->label, "e.text.label", ng->item_active->label); + } + else + evas_object_hide(ng->label); } -} +} /* _ngi_item_activate */ - /**************************************************************************/ static void @@ -1376,21 +1412,21 @@ if (it->scale < 1.0) { - ngi_reposition(ng); + ngi_reposition(ng); } else { - it->scale = 1.0; - it->state = normal; + it->scale = 1.0; + it->state = normal; - ng->items_scaling = eina_list_remove(ng->items_scaling, it); + ng->items_scaling = eina_list_remove(ng->items_scaling, it); - ngi_reposition(ng); - ngi_input_extents_calc(ng, 1); + ngi_reposition(ng); + ngi_input_extents_calc(ng, 1); } _ngi_item_activate(ng); -} +} /* _ngi_item_appear */ static void _ngi_item_disappear(Ng *ng, Ngi_Item *it) @@ -1403,33 +1439,34 @@ if (it->scale > 0.0) { - ngi_reposition(ng); + ngi_reposition(ng); } else { - ng->items_scaling = eina_list_remove(ng->items_scaling, it); + ng->items_scaling = eina_list_remove(ng->items_scaling, it); - evas_object_clip_unset(it->obj); - evas_object_clip_unset(it->over); + evas_object_clip_unset(it->obj); + evas_object_clip_unset(it->over); - it->scale = 0.0; + it->scale = 0.0; - if (ng->item_active == it) ng->item_active = NULL; + if (ng->item_active == it) + ng->item_active = NULL; - it->box->items = eina_list_remove(it->box->items, it); - ngi_item_free(it); + it->box->items = eina_list_remove(it->box->items, it); + ngi_item_free(it); - ng->size = ng->cfg->size; + ng->size = ng->cfg->size; - ngi_reposition(ng); - ngi_input_extents_calc(ng, 1); - ngi_animate(ng); + ngi_reposition(ng); + ngi_input_extents_calc(ng, 1); + ngi_animate(ng); - ngi_hide_clip(ng); + ngi_hide_clip(ng); } _ngi_item_activate(ng); -} +} /* _ngi_item_disappear */ static void _ngi_zoom_in(Ng *ng) @@ -1437,23 +1474,23 @@ Config_Item *cfg = ng->cfg; ng->zoom = ng->zoom + - (cfg->zoomfactor / (double)e_config->framerate) / (cfg->zoom_duration/2.0); + (cfg->zoomfactor / (double)e_config->framerate) / (cfg->zoom_duration / 2.0); if (ng->zoom < cfg->zoomfactor) { - if (ng->state != zooming) - { - ng->state = zooming; + if (ng->state != zooming) + { + ng->state = zooming; - ngi_input_extents_calc(ng, 0); - } + ngi_input_extents_calc(ng, 0); + } } else { - ng->zoom = cfg->zoomfactor; - ng->state = zoomed; + ng->zoom = cfg->zoomfactor; + ng->state = zoomed; } -} +} /* _ngi_zoom_in */ static void _ngi_zoom_out(Ng *ng) @@ -1461,25 +1498,26 @@ Config_Item *cfg = ng->cfg; ng->zoom = ng->zoom - - (cfg->zoomfactor / (double)e_config->framerate) / cfg->zoom_duration; + (cfg->zoomfactor / (double)e_config->framerate) / cfg->zoom_duration; if (ng->zoom > 1.0) { - ng->state = unzooming; + ng->state = unzooming; } else { - ng->zoom = 1.0; - ng->state = unzoomed; - ngi_input_extents_calc(ng, 0); - if (ng->item_active) - { - ITEM_MOUSE_OUT(ng->item_active); - ng->item_active = NULL; - } - edje_object_signal_emit(ng->label, "e,state,label_hide", "e"); + ng->zoom = 1.0; + ng->state = unzoomed; + ngi_input_extents_calc(ng, 0); + if (ng->item_active) + { + ITEM_MOUSE_OUT(ng->item_active); + ng->item_active = NULL; + } + + edje_object_signal_emit(ng->label, "e,state,label_hide", "e"); } -} +} /* _ngi_zoom_out */ static int _ngi_autohide(Ng *ng, int hide) @@ -1490,142 +1528,147 @@ if (hide) { - if (ng->hide_state == hiding) - edje_object_signal_emit(ng->label, "e,state,label_hide", "e"); - ng->hide_state = hiding; + if (ng->hide_state == hiding) + edje_object_signal_emit(ng->label, "e,state,label_hide", "e"); + + ng->hide_state = hiding; } else if (ng->hide_state != showing) { - ngi_bar_show(ng); - //evas_object_show(ng->clip); - ng->hide_state = showing; + ngi_bar_show(ng); + //evas_object_show(ng->clip); + ng->hide_state = showing; } size = ng->size + 15; step = ((double)(size * 2) / (double)e_config->framerate) / cfg->zoom_duration; - if (step < 1) step = 1; + if (step < 1) + step = 1; if (ng->hide_state == hiding) { - ng->hide_step += step; - if (ng->hide_step > size) - { - ng->hide_step = size; - goto end; - } + ng->hide_step += step; + if (ng->hide_step > size) + { + ng->hide_step = size; + goto end; + } } else { - ng->hide_step -= step; - if (ng->hide_step < 0) - { - ng->hide_step = 0; - goto end; - } + ng->hide_step -= step; + if (ng->hide_step < 0) + { + ng->hide_step = 0; + goto end; + } } return 1; - end: +end: if (hide) { - if (ngi_config->use_composite) ngi_bar_hide(ng); - ng->hide_state = hidden; - ng->zoom = 1.0; - ng->state = unzoomed; - ng->item_active = NULL; + if (ngi_config->use_composite) + ngi_bar_hide(ng); + + ng->hide_state = hidden; + ng->zoom = 1.0; + ng->state = unzoomed; + ng->item_active = NULL; } else - ng->hide_state = show; + ng->hide_state = show; ngi_input_extents_calc(ng, 0); return 0; -} +} /* _ngi_autohide */ void ngi_animate(Ng *ng) { ng->changed = 1; - if (ng->animator) return; - ng->animator = ecore_timer_add(1.0/(double)e_config->framerate*2, _ngi_animator, ng); -} + if (ng->animator) + return; + ng->animator = ecore_timer_add(1.0 / (double)e_config->framerate * 2, _ngi_animator, ng); +} /* ngi_animate */ + static Eina_Bool _ngi_animator(void *data) { - Ng *ng = (Ng*) data; + Ng *ng = (Ng *)data; Eina_Bool cont = 0; /* continue */ Eina_List *l; Ngi_Item *it; - for(l = ng->items_scaling; l;) + for(l = ng->items_scaling; l; ) { - it = (Ngi_Item*) l->data; - l = l->next; + it = (Ngi_Item *)l->data; + l = l->next; - if (it->state == appearing) - _ngi_item_appear(ng, it); - else if (it->state == disappearing) - _ngi_item_disappear(ng, it); + if (it->state == appearing) + _ngi_item_appear(ng, it); + else if (it->state == disappearing) + _ngi_item_disappear(ng, it); - cont++; + cont++; } if (ng->cfg->zoomfactor > 1.0) { - if (!ng->zoom_out) - { - if (ng->state != zoomed) - { - _ngi_zoom_in(ng); - cont++; - } - } - else - { - if (ng->state != unzoomed) - { - _ngi_zoom_out(ng); - cont++; - } - } + if (!ng->zoom_out) + { + if (ng->state != zoomed) + { + _ngi_zoom_in(ng); + cont++; + } + } + else + { + if (ng->state != unzoomed) + { + _ngi_zoom_out(ng); + cont++; + } + } } if (ng->cfg->autohide) { - if (ng->mouse_in || ng->show_bar || ng->menu_wait_timer || - (ng->cfg->autohide == AUTOHIDE_FULLSCREEN && !ng->hide_fullscreen)) - { - if (ng->hide_state != show) - { - _ngi_autohide(ng, 0); - cont++; - } - } - else if ((ng->cfg->autohide == AUTOHIDE_NORMAL) || - (ng->hide_fullscreen)) - { - if (ng->hide_state != hidden) - { - _ngi_autohide(ng, 1); - cont++; - } - } + if (ng->mouse_in || ng->show_bar || ng->menu_wait_timer || + (ng->cfg->autohide == AUTOHIDE_FULLSCREEN && !ng->hide_fullscreen)) + { + if (ng->hide_state != show) + { + _ngi_autohide(ng, 0); + cont++; + } + } + else if ((ng->cfg->autohide == AUTOHIDE_NORMAL) || + (ng->hide_fullscreen)) + { + if (ng->hide_state != hidden) + { + _ngi_autohide(ng, 1); + cont++; + } + } } cont += ng->changed; if (cont) - _ngi_redraw(ng); + _ngi_redraw(ng); else - ng->animator = NULL; + ng->animator = NULL; return cont; -} +} /* _ngi_animator */ - void ngi_reposition(Ng *ng) { @@ -1639,25 +1682,27 @@ ng->w = 0; EINA_LIST_FOREACH (ng->boxes, l, box) - { - box->w = 0; + { + box->w = 0; - EINA_LIST_FOREACH (box->items, ll, it) - { - if (it->scale == 0.0) continue; + EINA_LIST_FOREACH (box->items, ll, it) + { + if (it->scale == 0.0) + continue; - box->w += size * it->scale + ng->item_spacing; - } + box->w += size * it->scale + ng->item_spacing; + } - ng->w += box->w; - if (cnt++ > 0) ng->w += ng->separator_width * 2 + ng->item_spacing*6; - } + ng->w += box->w; + if (cnt++ > 0) + ng->w += ng->separator_width * 2 + ng->item_spacing * 6; + } - ng->start = 0.5 * ((ng->horizontal ? ng->win->w : ng->win->h) - ng->w); + ng->start = 0.5 * ((ng->horizontal ? ng->win->w : ng->win->h) - ng->w); double zoom, disp; - int middle = (ng->horizontal ? ng->win->w : ng->win->h)/2; + int middle = (ng->horizontal ? ng->win->w : ng->win->h) / 2; double distance = (double)(ng->start - middle) / (ng->size + ng->item_spacing); ... [truncated message content] |