diff options
author | Seunghun Lee <shiin.lee@samsung.com> | 2012-08-21 21:12:51 +0900 |
---|---|---|
committer | Seunghun Lee <shiin.lee@samsung.com> | 2012-08-21 21:12:51 +0900 |
commit | da657a5ef0c9d2b780cbd7e26880058fe09acf4a (patch) | |
tree | 39b7302e6e055d8db14158031f6fc7e2b68f4d34 /src | |
parent | ac8fa492451a1268eec649ea98e67184842f11a0 (diff) | |
download | e17-master.tar.gz e17-master.tar.bz2 e17-master.zip |
Migrating source code to RSA from private.HEADsubmit/master/20120920.1511192.0_alphamaster2.0alpha
Diffstat (limited to 'src')
68 files changed, 732 insertions, 1264 deletions
diff --git a/src/bin/e_border.c b/src/bin/e_border.c index 10128ce..4d8b2a0 100644 --- a/src/bin/e_border.c +++ b/src/bin/e_border.c @@ -124,6 +124,9 @@ static Eina_Bool _e_border_cb_grab_replay(void *data, void *event); static void _e_border_cb_drag_finished(E_Drag *drag, int dropped); +static Eina_Bool _e_border_cb_desk_window_profile_change(void *data, + int ev_type, + void *ev); static void _e_border_eval(E_Border *bd); static void _e_border_eval0(E_Border *bd); @@ -299,6 +302,7 @@ e_border_init(void) handlers = eina_list_append(handlers, ecore_event_handler_add(EFREET_EVENT_DESKTOP_CACHE_UPDATE, _e_border_cb_efreet_cache_update, NULL)); handlers = eina_list_append(handlers, ecore_event_handler_add(EFREET_EVENT_ICON_CACHE_UPDATE, _e_border_cb_efreet_cache_update, NULL)); handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_CONFIG_ICON_THEME, _e_border_cb_config_icon_theme, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_DESK_WINDOW_PROFILE_CHANGE, _e_border_cb_desk_window_profile_change, NULL)); if (!borders_hash) borders_hash = eina_hash_string_superfast_new(NULL); @@ -600,6 +604,9 @@ e_border_new(E_Container *con, video_parent = EINA_TRUE; else if (atoms[i] == ECORE_X_ATOM_E_VIDEO_POSITION) video_position = EINA_TRUE; + /* loop to check for window profile list atom */ + else if (atoms[i] == ECORE_X_ATOM_E_PROFILE_LIST) + bd->client.e.fetch.profile_list = 1; } if (video_position && video_parent) { @@ -675,6 +682,12 @@ e_border_new(E_Container *con, desk[0] = deskx; desk[1] = desky; ecore_x_window_prop_card32_set(win, E_ATOM_DESK, desk, 2); + if (strcmp(bd->desk->window_profile, + e_config->desktop_default_window_profile) != 0) + { + ecore_x_e_window_profile_set(bd->client.win, + bd->desk->window_profile); + } focus_stack = eina_list_append(focus_stack, bd); @@ -4371,6 +4384,7 @@ e_border_resize_limit(E_Border *bd, static void _e_border_free(E_Border *bd) { + const char *str; if (bd->client.e.state.video_parent) { Eina_List *l; @@ -4533,6 +4547,14 @@ _e_border_free(E_Border *bd) if (bd->internal_icon) eina_stringshare_del(bd->internal_icon); if (bd->internal_icon_key) eina_stringshare_del(bd->internal_icon_key); if (bd->icon_object) evas_object_del(bd->icon_object); + EINA_LIST_FREE(bd->client.e.state.profiles, str) + { + if (str) eina_stringshare_del(str); + } + bd->client.e.state.profiles = NULL; + if (bd->client.e.state.profile) + eina_stringshare_del(bd->client.e.state.profile); + bd->client.e.state.profile = NULL; evas_object_del(bd->bg_object); e_canvas_del(bd->bg_ecore_evas); ecore_evas_free(bd->bg_ecore_evas); @@ -5366,6 +5388,11 @@ _e_border_cb_window_property(void *data __UNUSED__, bd->client.e.fetch.video_parent = 1; bd->changed = 1; } + else if (e->atom == ECORE_X_ATOM_E_PROFILE_LIST) + { + bd->client.e.fetch.profile_list = 1; + bd->changed = 1; + } return ECORE_CALLBACK_PASS_ON; } @@ -6407,6 +6434,27 @@ _e_border_cb_drag_finished(E_Drag *drag, } static Eina_Bool +_e_border_cb_desk_window_profile_change(void *data __UNUSED__, + int ev_type __UNUSED__, + void *ev) +{ + E_Event_Desk_Window_Profile_Change *e; + Eina_List *l; + E_Border *bd; + + e = ev; + EINA_LIST_FOREACH(borders, l, bd) + { + if ((bd) && (!e_object_is_del(E_OBJECT(bd)))) + { + bd->client.e.fetch.profile_list = 1; + bd->changed = 1; + } + } + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool _e_border_post_move_resize_job(void *data) { E_Border *bd; @@ -6500,6 +6548,7 @@ _e_border_eval0(E_Border *bd) { int change_urgent = 0; int rem_change = 0; + Eina_Bool need_desk_set = EINA_FALSE; if (e_object_is_del(E_OBJECT(bd))) { @@ -6626,6 +6675,52 @@ _e_border_eval0(E_Border *bd) bd->client.e.fetch.state = 0; rem_change = 1; } + if (bd->client.e.fetch.profile_list) + { + const char **profiles = NULL; + const char *str; + int num, i; + + if (bd->client.e.state.profile) + eina_stringshare_del(bd->client.e.state.profile); + EINA_LIST_FREE(bd->client.e.state.profiles, str) + { + if (str) eina_stringshare_del(str); + } + bd->client.e.state.profile = NULL; + bd->client.e.state.profiles = NULL; + bd->client.e.state.profile_list = 0; + + if (ecore_x_e_window_profile_list_get(bd->client.win, + &profiles, &num)) + { + bd->client.e.state.profile_list = 1; + for (i = 0; i < num; i++) + { + str = eina_stringshare_add(profiles[i]); + bd->client.e.state.profiles = eina_list_append(bd->client.e.state.profiles, str); + } + + /* We should set desk to contain given border after creating E_BORDER_ADD event. + * If not, e will have an E_BORDER_SHOW event before E_BORDER_ADD event. + */ + need_desk_set = EINA_TRUE; + } + else + { + if (strcmp(bd->desk->window_profile, + e_config->desktop_default_window_profile) != 0) + { + ecore_x_e_window_profile_set(bd->client.win, + bd->desk->window_profile); + } + } + + if (profiles) + free(profiles); + + bd->client.e.fetch.profile_list = 0; + } if (bd->client.netwm.fetch.type) { e_hints_window_type_get(bd); @@ -7236,6 +7331,29 @@ _e_border_eval0(E_Border *bd) bd->client.border.changed = 1; } + if (need_desk_set) + { + E_Container *con = bd->zone->container; + E_Desk *desk = NULL; + Eina_List *l; + const char *str; + EINA_LIST_FOREACH(bd->client.e.state.profiles, l, str) + { + desk = e_container_desk_window_profile_get(con, str); + if (desk) + { + if (bd->desk != desk) + { + bd->client.e.state.profile = eina_stringshare_add(str); + if (bd->zone != desk->zone) + e_border_zone_set(bd, desk->zone); + e_border_desk_set(bd, desk); + } + break; + } + } + } + /* PRE_POST_FETCH calls e_remember apply for new client */ _e_border_hook_call(E_BORDER_HOOK_EVAL_PRE_POST_FETCH, bd); _e_border_hook_call(E_BORDER_HOOK_EVAL_POST_FETCH, bd); @@ -7460,7 +7578,6 @@ _e_border_eval0(E_Border *bd) static void _e_border_latest_stacked_focus (E_Border* bd) { - Eina_List *l = NULL; E_Border *temp_bd; int root_w, root_h; @@ -7473,6 +7590,7 @@ _e_border_latest_stacked_focus (E_Border* bd) { if ((temp_bd->x >= root_w) || (temp_bd->y >= root_h)) continue; if (((temp_bd->x + temp_bd->w) <= 0) || ((temp_bd->y + temp_bd->h) <= 0)) continue; + if (temp_bd->client.illume.win_state.state == ECORE_X_ILLUME_WINDOW_STATE_FLOATING) continue; if ((!temp_bd->iconic) && (temp_bd->visible) && (temp_bd->desk == bd->desk) && (temp_bd->client.icccm.accepts_focus || temp_bd->client.icccm.take_focus) && @@ -7501,7 +7619,6 @@ _e_border_latest_stacked_focus (E_Border* bd) static void _e_border_check_stack (E_Border *bd) { - Eina_List* l = NULL; E_Border* temp_bd = NULL;; E_Border* top_bd = NULL; int passed_focus = 0; @@ -7515,6 +7632,7 @@ _e_border_check_stack (E_Border *bd) { if ((temp_bd->x >= root_w) || (temp_bd->y >= root_h)) continue; if (((temp_bd->x + temp_bd->w) <= 0) || ((temp_bd->y + temp_bd->h) <= 0)) continue; + if (temp_bd->client.illume.win_state.state == ECORE_X_ILLUME_WINDOW_STATE_FLOATING) continue; if ((!temp_bd->iconic) && (temp_bd->visible) && (temp_bd->desk == bd->desk) && (temp_bd->client.icccm.accepts_focus || temp_bd->client.icccm.take_focus) && @@ -7570,9 +7688,8 @@ _e_border_check_stack (E_Border *bd) } static void -_e_border_focus_top_stack_set (E_Border* bd) +_e_border_focus_top_stack_set(E_Border* bd) { - Eina_List *l = NULL; E_Border *temp_bd; int root_w, root_h; @@ -7585,6 +7702,7 @@ _e_border_focus_top_stack_set (E_Border* bd) { if ((temp_bd->x >= root_w) || (temp_bd->y >= root_h)) continue; if (((temp_bd->x + temp_bd->w) <= 0) || ((temp_bd->y + temp_bd->h) <= 0)) continue; + if (temp_bd->client.illume.win_state.state == ECORE_X_ILLUME_WINDOW_STATE_FLOATING) continue; if ((!temp_bd->iconic) && (temp_bd->visible) && (temp_bd->desk == bd->desk) && (temp_bd->client.icccm.accepts_focus || temp_bd->client.icccm.take_focus) && diff --git a/src/bin/e_border.h b/src/bin/e_border.h index ab1bd3d..86f0843 100644 --- a/src/bin/e_border.h +++ b/src/bin/e_border.h @@ -355,15 +355,19 @@ struct _E_Border Ecore_X_Window video_parent; E_Border *video_parent_border; Eina_List *video_child; + const char *profile; + Eina_List *profiles; unsigned char centered : 1; unsigned char video : 1; + unsigned char profile_list : 1; } state; struct { unsigned char state : 1; unsigned char video_parent : 1; unsigned char video_position : 1; + unsigned char profile_list : 1; } fetch; } e; diff --git a/src/bin/e_config.c b/src/bin/e_config.c index 7f9cfe5..ffc2d46 100644 --- a/src/bin/e_config.c +++ b/src/bin/e_config.c @@ -40,6 +40,7 @@ static E_Config_DD *_e_config_bindings_acpi_edd = NULL; static E_Config_DD *_e_config_path_append_edd = NULL; static E_Config_DD *_e_config_desktop_bg_edd = NULL; static E_Config_DD *_e_config_desktop_name_edd = NULL; +static E_Config_DD *_e_config_desktop_window_profile_edd = NULL; static E_Config_DD *_e_config_remember_edd = NULL; static E_Config_DD *_e_config_color_class_edd = NULL; static E_Config_DD *_e_config_gadcon_edd = NULL; @@ -276,6 +277,17 @@ e_config_init(void) E_CONFIG_VAL(D, T, desk_y, INT); E_CONFIG_VAL(D, T, name, STR); + _e_config_desktop_window_profile_edd = E_CONFIG_DD_NEW("E_Config_Desktop_Window_Profile", E_Config_Desktop_Window_Profile); +#undef T +#undef D +#define T E_Config_Desktop_Window_Profile +#define D _e_config_desktop_window_profile_edd + E_CONFIG_VAL(D, T, container, INT); + E_CONFIG_VAL(D, T, zone, INT); + E_CONFIG_VAL(D, T, desk_x, INT); + E_CONFIG_VAL(D, T, desk_y, INT); + E_CONFIG_VAL(D, T, profile, STR); + _e_config_path_append_edd = E_CONFIG_DD_NEW("E_Path_Dir", E_Path_Dir); #undef T #undef D @@ -625,8 +637,10 @@ e_config_init(void) E_CONFIG_VAL(D, T, init_default_theme, STR); /**/ E_CONFIG_VAL(D, T, desktop_default_background, STR); /**/ E_CONFIG_VAL(D, T, desktop_default_name, STR); /**/ + E_CONFIG_VAL(D, T, desktop_default_window_profile, STR); /**/ E_CONFIG_LIST(D, T, desktop_backgrounds, _e_config_desktop_bg_edd); /**/ E_CONFIG_LIST(D, T, desktop_names, _e_config_desktop_name_edd); /**/ + E_CONFIG_LIST(D, T, desktop_window_profiles, _e_config_desktop_window_profile_edd); /**/ E_CONFIG_VAL(D, T, menus_scroll_speed, DOUBLE); /**/ E_CONFIG_VAL(D, T, menus_fast_mouse_move_threshhold, DOUBLE); /**/ E_CONFIG_VAL(D, T, menus_click_drag_timeout, DOUBLE); /**/ @@ -925,6 +939,7 @@ e_config_shutdown(void) E_CONFIG_DD_FREE(_e_config_path_append_edd); E_CONFIG_DD_FREE(_e_config_desktop_bg_edd); E_CONFIG_DD_FREE(_e_config_desktop_name_edd); + E_CONFIG_DD_FREE(_e_config_desktop_window_profile_edd); E_CONFIG_DD_FREE(_e_config_remember_edd); E_CONFIG_DD_FREE(_e_config_gadcon_edd); E_CONFIG_DD_FREE(_e_config_gadcon_client_edd); @@ -1559,6 +1574,20 @@ e_config_domain_system_load(const char *domain, E_Config_DD *edd) static void _e_config_mv_error(const char *from, const char *to) { +#if _F_USE_EXTN_DIALOG_ + char buf[8192]; + snprintf(buf, sizeof(buf), + _("Enlightenment has had an error while moving config files<br>" + "from:<br>" + "%s<br>" + "<br>" + "to:<br>" + "%s<br>" + "<br>" + "The rest of the write has been aborted for safety.<br>"), + from, to); + e_util_extn_dialog_show(_("Enlightenment Settings Write Problems"), buf); +#else if (!_e_config_error_dialog) { E_Dialog *dia; @@ -1591,6 +1620,7 @@ _e_config_mv_error(const char *from, const char *to) _e_config_error_dialog = dia; } } +#endif } EAPI int @@ -2010,6 +2040,7 @@ _e_config_free(E_Config *ecf) if (ecf->init_default_theme) eina_stringshare_del(ecf->init_default_theme); if (ecf->desktop_default_background) eina_stringshare_del(ecf->desktop_default_background); if (ecf->desktop_default_name) eina_stringshare_del(ecf->desktop_default_name); + if (ecf->desktop_default_window_profile) eina_stringshare_del(ecf->desktop_default_window_profile); if (ecf->language) eina_stringshare_del(ecf->language); if (ecf->transition_start) eina_stringshare_del(ecf->transition_start); if (ecf->transition_desk) eina_stringshare_del(ecf->transition_desk); @@ -2132,6 +2163,20 @@ _e_config_eet_close_handle(Eet_File *ef, char *file) { /* delete any partially-written file */ ecore_file_unlink(file); +#if _F_USE_EXTN_DIALOG_ + char buf[8192]; + snprintf(buf, sizeof(buf), + _("Enlightenment has had an error while writing<br>" + "its config file.<br>" + "%s<br>" + "<br>" + "The file where the error occurred was:<br>" + "%s<br>" + "<br>" + "This file has been deleted to avoid corrupt data.<br>"), + erstr, file); + e_util_extn_dialog_show(_("Enlightenment Settings Write Problems"), buf); +#else /* only show dialog for first error - further ones are likely */ /* more of the same error */ if (!_e_config_error_dialog) @@ -2166,6 +2211,7 @@ _e_config_eet_close_handle(Eet_File *ef, char *file) _e_config_error_dialog = dia; } } +#endif return 0; } return 1; diff --git a/src/bin/e_config.h b/src/bin/e_config.h index 86e278f..5f7bc27 100644 --- a/src/bin/e_config.h +++ b/src/bin/e_config.h @@ -2,25 +2,26 @@ #define E_CONFIG_LIMIT(v, min, max) {if (v > max) v = max; else if (v < min) v = min;} -typedef struct _E_Config E_Config; -typedef struct _E_Config_Module E_Config_Module; -typedef struct _E_Config_Theme E_Config_Theme; -typedef struct _E_Config_Binding_Mouse E_Config_Binding_Mouse; -typedef struct _E_Config_Binding_Key E_Config_Binding_Key; -typedef struct _E_Config_Binding_Edge E_Config_Binding_Edge; -typedef struct _E_Config_Binding_Signal E_Config_Binding_Signal; -typedef struct _E_Config_Binding_Wheel E_Config_Binding_Wheel; -typedef struct _E_Config_Binding_Acpi E_Config_Binding_Acpi; -typedef struct _E_Config_Desktop_Background E_Config_Desktop_Background; -typedef struct _E_Config_Desktop_Name E_Config_Desktop_Name; -typedef struct _E_Config_Gadcon E_Config_Gadcon; -typedef struct _E_Config_Gadcon_Client E_Config_Gadcon_Client; -typedef struct _E_Config_Shelf E_Config_Shelf; -typedef struct _E_Config_Shelf_Desk E_Config_Shelf_Desk; -typedef struct _E_Config_Mime_Icon E_Config_Mime_Icon; -typedef struct _E_Config_Syscon_Action E_Config_Syscon_Action; -typedef struct _E_Config_Env_Var E_Config_Env_Var; -typedef struct _E_Event_Config_Icon_Theme E_Event_Config_Icon_Theme; +typedef struct _E_Config E_Config; +typedef struct _E_Config_Module E_Config_Module; +typedef struct _E_Config_Theme E_Config_Theme; +typedef struct _E_Config_Binding_Mouse E_Config_Binding_Mouse; +typedef struct _E_Config_Binding_Key E_Config_Binding_Key; +typedef struct _E_Config_Binding_Edge E_Config_Binding_Edge; +typedef struct _E_Config_Binding_Signal E_Config_Binding_Signal; +typedef struct _E_Config_Binding_Wheel E_Config_Binding_Wheel; +typedef struct _E_Config_Binding_Acpi E_Config_Binding_Acpi; +typedef struct _E_Config_Desktop_Background E_Config_Desktop_Background; +typedef struct _E_Config_Desktop_Name E_Config_Desktop_Name; +typedef struct _E_Config_Desktop_Window_Profile E_Config_Desktop_Window_Profile; +typedef struct _E_Config_Gadcon E_Config_Gadcon; +typedef struct _E_Config_Gadcon_Client E_Config_Gadcon_Client; +typedef struct _E_Config_Shelf E_Config_Shelf; +typedef struct _E_Config_Shelf_Desk E_Config_Shelf_Desk; +typedef struct _E_Config_Mime_Icon E_Config_Mime_Icon; +typedef struct _E_Config_Syscon_Action E_Config_Syscon_Action; +typedef struct _E_Config_Env_Var E_Config_Env_Var; +typedef struct _E_Event_Config_Icon_Theme E_Event_Config_Icon_Theme; #else #ifndef E_CONFIG_H @@ -44,7 +45,9 @@ struct _E_Config const char *desktop_default_background; // GUI Eina_List *desktop_backgrounds; // GUI const char *desktop_default_name; + const char *desktop_default_window_profile; Eina_List *desktop_names; // GUI + Eina_List *desktop_window_profiles; // GUI double menus_scroll_speed; // GUI double menus_fast_mouse_move_threshhold; // GUI double menus_click_drag_timeout; // GUI @@ -449,6 +452,15 @@ struct _E_Config_Desktop_Name const char *name; }; +struct _E_Config_Desktop_Window_Profile +{ + int container; + int zone; + int desk_x; + int desk_y; + const char *profile; +}; + struct _E_Config_Gadcon { const char *name; diff --git a/src/bin/e_container.c b/src/bin/e_container.c index 3f71fe8..46d422a 100644 --- a/src/bin/e_container.c +++ b/src/bin/e_container.c @@ -86,12 +86,12 @@ e_container_new(E_Manager *man) if (!getenv("EVAS_RENDER_MODE")) { int have_comp = 0; - Eina_List *l; + Eina_List *ll; E_Config_Module *em; // FIXME: major hack. checking in advance for comp. eventully comp // will be rolled into e17 core and this won't be needed - EINA_LIST_FOREACH(e_config->modules, l, em) + EINA_LIST_FOREACH(e_config->modules, ll, em) { if (!strcmp(em->name, "comp")) { @@ -363,6 +363,36 @@ e_container_zone_id_get(E_Container *con, int id) return NULL; } +EAPI E_Desk * +e_container_desk_window_profile_get(E_Container *con, + const char *profile) +{ + Eina_List *l = NULL; + E_Zone *zone = NULL; + int x, y; + + E_OBJECT_CHECK_RETURN(con, NULL); + E_OBJECT_TYPE_CHECK_RETURN(con, E_CONTAINER_TYPE, NULL); + + EINA_LIST_FOREACH(con->zones, l, zone) + { + for (x = 0; x < zone->desk_x_count; x++) + { + for (y = 0; y < zone->desk_y_count; y++) + { + E_Desk *desk = e_desk_at_xy_get(zone, x, y); + if ((desk->window_profile) && + strcmp(desk->window_profile, profile) == 0) + { + return desk; + } + } + } + } + + return NULL; +} + EAPI E_Container_Shape * e_container_shape_add(E_Container *con) { @@ -1116,7 +1146,7 @@ static void _e_container_resize_handle(E_Container *con) { E_Event_Container_Resize *ev; - Eina_List *l, *screens, *zones = NULL; + Eina_List *l, *screens, *zones = NULL, *ll; E_Zone *zone; E_Screen *scr; int i; @@ -1135,8 +1165,14 @@ _e_container_resize_handle(E_Container *con) con->zones = NULL; EINA_LIST_FOREACH(screens, l, scr) { + zone = NULL; + printf("@@@ SCREENS: %i %i | %i %i %ix%i\n", scr->screen, scr->escreen, scr->x, scr->y, scr->w, scr->h); - zone = e_container_zone_id_get(con, scr->escreen); + EINA_LIST_FOREACH(zones, ll, zone) + { + if (zone->id == scr->escreen) break; + zone = NULL; + } if (zone) { printf("@@@ FOUND ZONE %i %i\n", zone->num, zone->id); @@ -1151,7 +1187,7 @@ _e_container_resize_handle(E_Container *con) Eina_List *ll; E_Config_Shelf *cf_es; - printf("@@@ container resize handle\n"); + printf("@@@ container resize handle - new zone\n"); zone = e_zone_new(con, scr->screen, scr->escreen, scr->x, scr->y, scr->w, scr->h); /* find any shelves configured for this zone and add them in */ EINA_LIST_FOREACH(e_config->shelves, ll, cf_es) @@ -1164,17 +1200,12 @@ _e_container_resize_handle(E_Container *con) if (zones) { E_Zone *spare_zone = NULL; - Eina_List *ll; - EINA_LIST_FOREACH(con->zones, ll, spare_zone) - { - if (eina_list_data_find(zones, spare_zone)) - spare_zone = NULL; - else break; - } + if (con->zones) spare_zone = con->zones->data; + EINA_LIST_FREE(zones, zone) { - Eina_List *shelves, *ll, *del_shelves; + Eina_List *shelves, *ll2, *del_shelves; E_Shelf *es; E_Border_List *bl; E_Border *bd; @@ -1182,7 +1213,7 @@ _e_container_resize_handle(E_Container *con) /* delete any shelves on this zone */ shelves = e_shelf_list(); del_shelves = NULL; - EINA_LIST_FOREACH(shelves, ll, es) + EINA_LIST_FOREACH(shelves, ll2, es) { if (es->zone == zone) del_shelves = eina_list_append(del_shelves, es); @@ -1207,11 +1238,14 @@ _e_container_resize_handle(E_Container *con) } else { - E_Zone *zone; + E_Zone *z; - zone = e_container_zone_number_get(con, 0); - e_zone_move_resize(zone, 0, 0, con->w, con->h); - e_shelf_zone_move_resize_handle(zone); + z = e_container_zone_number_get(con, 0); + if (z) + { + e_zone_move_resize(z, 0, 0, con->w, con->h); + e_shelf_zone_move_resize_handle(z); + } } ecore_event_add(E_EVENT_CONTAINER_RESIZE, ev, _e_container_event_container_resize_free, NULL); diff --git a/src/bin/e_container.h b/src/bin/e_container.h index 2c6dbaf..58fa91d 100644 --- a/src/bin/e_container.h +++ b/src/bin/e_container.h @@ -110,6 +110,8 @@ EAPI E_Zone *e_container_zone_at_point_get(E_Container *con, int x, int y); EAPI E_Zone *e_container_zone_number_get(E_Container *con, int num); EAPI E_Zone *e_container_zone_id_get(E_Container *con, int id); +EAPI E_Desk *e_container_desk_window_profile_get(E_Container *con, const char *profile); + EAPI E_Container_Shape *e_container_shape_add(E_Container *con); EAPI void e_container_shape_show(E_Container_Shape *es); EAPI void e_container_shape_hide(E_Container_Shape *es); diff --git a/src/bin/e_desk.c b/src/bin/e_desk.c index 70ae582..6006e71 100644 --- a/src/bin/e_desk.c +++ b/src/bin/e_desk.c @@ -11,6 +11,7 @@ static void _e_desk_event_desk_before_show_free(void *data, void *ev); static void _e_desk_event_desk_after_show_free(void *data, void *ev); static void _e_desk_event_desk_deskshow_free(void *data, void *ev); static void _e_desk_event_desk_name_change_free(void *data, void *ev); +static void _e_desk_event_desk_window_profile_change_free(void *data, void *ev); static void _e_desk_show_begin(E_Desk *desk, int mode, int x, int dy); static void _e_desk_show_end(E_Desk *desk); static Eina_Bool _e_desk_show_animator(void *data); @@ -23,6 +24,7 @@ EAPI int E_EVENT_DESK_BEFORE_SHOW = 0; EAPI int E_EVENT_DESK_AFTER_SHOW = 0; EAPI int E_EVENT_DESK_DESKSHOW = 0; EAPI int E_EVENT_DESK_NAME_CHANGE = 0; +EAPI int E_EVENT_DESK_WINDOW_PROFILE_CHANGE = 0; EINTERN int e_desk_init(void) @@ -32,6 +34,7 @@ e_desk_init(void) E_EVENT_DESK_AFTER_SHOW = ecore_event_type_new(); E_EVENT_DESK_DESKSHOW = ecore_event_type_new(); E_EVENT_DESK_NAME_CHANGE = ecore_event_type_new(); + E_EVENT_DESK_WINDOW_PROFILE_CHANGE = ecore_event_type_new(); return 1; } @@ -47,6 +50,7 @@ e_desk_new(E_Zone *zone, int x, int y) E_Desk *desk; Eina_List *l; E_Config_Desktop_Name *cfname; + E_Config_Desktop_Window_Profile *cfprof; char name[40]; int ok = 0; @@ -80,6 +84,27 @@ e_desk_new(E_Zone *zone, int x, int y) desk->name = eina_stringshare_add(name); } + /* Get window profile name for current desktop */ + ok = 0; + EINA_LIST_FOREACH(e_config->desktop_window_profiles, l, cfprof) + { + if ((cfprof->container >= 0) && + ((int)zone->container->num != cfprof->container)) continue; + if ((cfprof->zone >= 0) && + ((int)zone->num != cfprof->zone)) continue; + if ((cfprof->desk_x != desk->x) || (cfprof->desk_y != desk->y)) + continue; + desk->window_profile = eina_stringshare_add(cfprof->profile); + ok = 1; + break; + } + + if (!ok) + { + desk->window_profile = eina_stringshare_add + (e_config->desktop_default_window_profile); + } + return desk; } @@ -517,6 +542,119 @@ e_desk_prev(E_Zone *zone) e_desk_show(e_desk_at_xy_get(zone, x, y)); } +EAPI void +e_desk_window_profile_set(E_Desk *desk, + const char *profile) +{ + E_Event_Desk_Window_Profile_Change *ev; + + E_OBJECT_CHECK(desk); + E_OBJECT_TYPE_CHECK(desk, E_DESK_TYPE); + + eina_stringshare_replace(&desk->window_profile, profile); + + ev = E_NEW(E_Event_Desk_Window_Profile_Change, 1); + ev->desk = desk; + e_object_ref(E_OBJECT(desk)); + ecore_event_add(E_EVENT_DESK_WINDOW_PROFILE_CHANGE, ev, + _e_desk_event_desk_window_profile_change_free, NULL); +} + +EAPI void +e_desk_window_profile_add(int container, + int zone, + int desk_x, + int desk_y, + const char *profile) +{ + E_Config_Desktop_Window_Profile *cfprof; + + e_desk_window_profile_del(container, zone, desk_x, desk_y); + + cfprof = E_NEW(E_Config_Desktop_Window_Profile, 1); + cfprof->container = container; + cfprof->zone = zone; + cfprof->desk_x = desk_x; + cfprof->desk_y = desk_y; + if (profile) cfprof->profile = eina_stringshare_add(profile); + else cfprof->profile = NULL; + e_config->desktop_window_profiles = eina_list_append(e_config->desktop_window_profiles, cfprof); +} + +EAPI void +e_desk_window_profile_del(int container, + int zone, + int desk_x, + int desk_y) +{ + Eina_List *l = NULL; + E_Config_Desktop_Window_Profile *cfprof = NULL; + + EINA_LIST_FOREACH(e_config->desktop_window_profiles, l, cfprof) + { + if (!((cfprof->container == container) && + (cfprof->zone == zone) && + (cfprof->desk_x == desk_x) && + (cfprof->desk_y == desk_y))) + continue; + + e_config->desktop_window_profiles = + eina_list_remove_list(e_config->desktop_window_profiles, l); + if (cfprof->profile) eina_stringshare_del(cfprof->profile); + E_FREE(cfprof); + break; + } +} + +EAPI void +e_desk_window_profile_update(void) +{ + Eina_List *m, *c, *z, *l; + E_Manager *man; + E_Container *con; + E_Zone *zone; + E_Desk *desk; + E_Config_Desktop_Window_Profile *cfprof; + int d_x, d_y, ok; + + EINA_LIST_FOREACH(e_manager_list(), m, man) + { + EINA_LIST_FOREACH(man->containers, c, con) + { + EINA_LIST_FOREACH(con->zones, z, zone) + { + for (d_x = 0; d_x < zone->desk_x_count; d_x++) + { + for (d_y = 0; d_y < zone->desk_y_count; d_y++) + { + desk = zone->desks[d_x + zone->desk_x_count * d_y]; + ok = 0; + + EINA_LIST_FOREACH(e_config->desktop_window_profiles, l, cfprof) + { + if ((cfprof->container >= 0) && + ((int)con->num != cfprof->container)) continue; + if ((cfprof->zone >= 0) && + ((int)zone->num != cfprof->zone)) continue; + if ((cfprof->desk_x != d_x) || + (cfprof->desk_y != d_y)) continue; + e_desk_window_profile_set(desk, cfprof->profile); + ok = 1; + break; + } + + if (!ok) + { + e_desk_window_profile_set + (desk, e_config->desktop_default_window_profile); + } + } + } + } + } + } +} + static void _e_desk_free(E_Desk *desk) { @@ -578,6 +716,16 @@ _e_desk_event_desk_name_change_free(void *data __UNUSED__, void *event) } static void +_e_desk_event_desk_window_profile_change_free(void *data __UNUSED__, + void *event) +{ + E_Event_Desk_Window_Profile_Change *ev; + ev = event; + e_object_unref(E_OBJECT(ev->desk)); + E_FREE(ev); +} + +static void _e_desk_show_begin(E_Desk *desk, int mode, int dx, int dy) { E_Border_List *bl; diff --git a/src/bin/e_desk.h b/src/bin/e_desk.h index 9ee9547..bbe4355 100644 --- a/src/bin/e_desk.h +++ b/src/bin/e_desk.h @@ -6,6 +6,7 @@ typedef struct _E_Event_Desk_Before_Show E_Event_Desk_Before_Show; typedef struct _E_Event_Desk_After_Show E_Event_Desk_After_Show; typedef struct _E_Event_Desk_DeskShow E_Event_Desk_DeskShow; typedef struct _E_Event_Desk_Name_Change E_Event_Desk_Name_Change; +typedef struct _E_Event_Desk_Window_Profile_Change E_Event_Desk_Window_Profile_Change; #else #ifndef E_DESK_H @@ -19,6 +20,7 @@ struct _E_Desk E_Zone *zone; const char *name; + const char *window_profile; int x, y; unsigned char visible : 1; unsigned int deskshow_toggle : 1; @@ -50,6 +52,11 @@ struct _E_Event_Desk_Name_Change E_Desk *desk; }; +struct _E_Event_Desk_Window_Profile_Change +{ + E_Desk *desk; +}; + EINTERN int e_desk_init(void); EINTERN int e_desk_shutdown(void); EAPI E_Desk *e_desk_new(E_Zone *zone, int x, int y); @@ -70,12 +77,17 @@ EAPI void e_desk_row_add(E_Zone *zone); EAPI void e_desk_row_remove(E_Zone *zone); EAPI void e_desk_col_add(E_Zone *zone); EAPI void e_desk_col_remove(E_Zone *zone); +EAPI void e_desk_window_profile_set(E_Desk *desk, const char *profile); +EAPI void e_desk_window_profile_add(int container, int zone, int desk_x, int desk_y, const char *profile); +EAPI void e_desk_window_profile_del(int container, int zone, int desk_x, int desk_y); +EAPI void e_desk_window_profile_update(void); extern EAPI int E_EVENT_DESK_SHOW; extern EAPI int E_EVENT_DESK_BEFORE_SHOW; extern EAPI int E_EVENT_DESK_AFTER_SHOW; extern EAPI int E_EVENT_DESK_DESKSHOW; extern EAPI int E_EVENT_DESK_NAME_CHANGE; +extern EAPI int E_EVENT_DESK_WINDOW_PROFILE_CHANGE; #endif #endif diff --git a/src/bin/e_fm/e_fm_ipc.h b/src/bin/e_fm/e_fm_ipc.h index 404e666..404e666 100755..100644 --- a/src/bin/e_fm/e_fm_ipc.h +++ b/src/bin/e_fm/e_fm_ipc.h diff --git a/src/bin/e_fm/e_fm_main_hal.h b/src/bin/e_fm/e_fm_main_hal.h index 9ce1c12..9ce1c12 100755..100644 --- a/src/bin/e_fm/e_fm_main_hal.h +++ b/src/bin/e_fm/e_fm_main_hal.h diff --git a/src/bin/e_fm/e_fm_main_udisks.h b/src/bin/e_fm/e_fm_main_udisks.h index f9bc659..f9bc659 100755..100644 --- a/src/bin/e_fm/e_fm_main_udisks.h +++ b/src/bin/e_fm/e_fm_main_udisks.h diff --git a/src/bin/e_gadcon.c b/src/bin/e_gadcon.c index a76d6ba..a05c52f 100644 --- a/src/bin/e_gadcon.c +++ b/src/bin/e_gadcon.c @@ -279,6 +279,10 @@ e_gadcon_custom_del(E_Gadcon *gc) { E_OBJECT_CHECK(gc); E_OBJECT_TYPE_CHECK(gc, E_GADCON_TYPE); + + if (eina_list_data_find(custom_populate_requests, gc)) + custom_populate_requests = eina_list_remove(custom_populate_requests, gc); + gadcons = eina_list_remove(gadcons, gc); } diff --git a/src/bin/e_hints.c b/src/bin/e_hints.c index 30ebb35..d88f11b 100644 --- a/src/bin/e_hints.c +++ b/src/bin/e_hints.c @@ -1421,6 +1421,13 @@ e_hints_window_desktop_set(E_Border *bd) deskpos[1] = bd->desk->y; ecore_x_window_prop_card32_set(bd->client.win, E_ATOM_DESK, deskpos, 2); + if (strcmp(bd->desk->window_profile, + e_config->desktop_default_window_profile) != 0) + { + ecore_x_e_window_profile_set(bd->client.win, + bd->desk->window_profile); + } + #if 0 ecore_x_netwm_desktop_set(bd->client.win, current); #endif diff --git a/src/bin/e_main.c b/src/bin/e_main.c index 5ec0880..76b3452 100644 --- a/src/bin/e_main.c +++ b/src/bin/e_main.c @@ -134,7 +134,9 @@ main(int argc, char **argv) Eina_Bool after_restart = EINA_FALSE; double t = 0.0, tstart = 0.0; char *s = NULL, buff[32]; +#ifndef _F_DO_NOT_USE_SIG_HANDLER_ struct sigaction action; +#endif #ifdef TS_DO t0 = t1 = t2 = ecore_time_unix_get(); #endif diff --git a/src/bin/e_manager.c b/src/bin/e_manager.c index 8451fcf..917dc7e 100644 --- a/src/bin/e_manager.c +++ b/src/bin/e_manager.c @@ -673,6 +673,30 @@ e_manager_comp_src_move_unlock(E_Manager *man, E_Manager_Comp_Source *src) } #endif +#ifdef _F_COMP_COMPOSITE_MODE_ +EAPI void +e_manager_comp_composite_mode_set(E_Manager *man, E_Zone *zone, Eina_Bool set) +{ + E_OBJECT_CHECK(man); + E_OBJECT_CHECK(zone); + E_OBJECT_TYPE_CHECK(man, E_MANAGER_TYPE); + E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE); + if (!man->comp) return; + man->comp->func.composite_mode_set(man->comp->data, man, zone, set); +} + +EAPI Eina_Bool +e_manager_comp_composite_mode_get(E_Manager *man, E_Zone *zone) +{ + E_OBJECT_CHECK_RETURN(man, EINA_FALSE); + E_OBJECT_CHECK_RETURN(zone, EINA_FALSE); + E_OBJECT_TYPE_CHECK_RETURN(man, E_MANAGER_TYPE, EINA_FALSE); + E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, EINA_FALSE); + if (!man->comp) return EINA_FALSE; + return man->comp->func.composite_mode_get(man->comp->data, man, zone); +} +#endif /* _F_COMP_COMPOSITE_MODE_ */ + EAPI void e_manager_comp_event_resize_send(E_Manager *man) { @@ -1039,9 +1063,7 @@ _e_manager_windows_group_raise (E_Border* bd) leader_win = bd->client.icccm.client_leader; if (leader_win) { - Eina_List* border_list; Eina_List* restack_list; - Eina_List *l; E_Border *temp_bd; E_Border *top_bd; E_Border_List *bl; @@ -1199,13 +1221,16 @@ _e_manager_cb_client_message(void *data __UNUSED__, int ev_type __UNUSED__, void e_border_focus_set(bd, 1, 1); else { - Eina_List* l = NULL; E_Border* temp_bd = NULL; E_Border_List *bl; bl = e_container_border_list_last(bd->zone->container); while ((temp_bd = e_container_border_list_prev(bl))) { + if ((temp_bd->x >= bd->zone->w) || (temp_bd->y >= bd->zone->h)) continue; + if (((temp_bd->x + temp_bd->w) <= 0) || ((temp_bd->y + temp_bd->h) <= 0)) continue; + if (temp_bd->client.illume.win_state.state == ECORE_X_ILLUME_WINDOW_STATE_FLOATING) continue; + if ((!temp_bd->iconic) && (temp_bd->visible) && (temp_bd->desk == bd->desk) && (temp_bd->client.icccm.accepts_focus || temp_bd->client.icccm.take_focus) && (temp_bd->client.netwm.type != ECORE_X_WINDOW_TYPE_DOCK) && diff --git a/src/bin/e_manager.h b/src/bin/e_manager.h index 916c6cd..83b3d87 100644 --- a/src/bin/e_manager.h +++ b/src/bin/e_manager.h @@ -56,6 +56,10 @@ struct _E_Manager_Comp Eina_Bool (*src_move_lock) (void *data, E_Manager *man, E_Manager_Comp_Source *src); Eina_Bool (*src_move_unlock) (void *data, E_Manager *man, E_Manager_Comp_Source *src); #endif +#ifdef _F_COMP_COMPOSITE_MODE_ + void (*composite_mode_set) (void *data, E_Manager *man, E_Zone *zone, Eina_Bool set); + Eina_Bool (*composite_mode_get) (void *data, E_Manager *man, E_Zone *zone); +#endif } func; void *data; }; @@ -151,5 +155,14 @@ EAPI Eina_Bool e_manager_comp_src_input_region_set(E_Manager *man, E_Mana EAPI Eina_Bool e_manager_comp_src_move_lock(E_Manager *man, E_Manager_Comp_Source *src); EAPI Eina_Bool e_manager_comp_src_move_unlock(E_Manager *man, E_Manager_Comp_Source *src); #endif +#ifdef _F_COMP_COMPOSITE_MODE_ +// set the composite rendering state of a zone. +// if set is EINA_TRUE, then composite module will be running with composite rendering mode. +// if set is EINA_FALSE, then composite module may be running with nocomposite mode on given zone. +EAPI void e_manager_comp_composite_mode_set(E_Manager *man, E_Zone *zone, Eina_Bool set); +// get the composite rendering state of a zone. +// if return value is EINA_TRUE, zone is rendered with composite mode. +EAPI Eina_Bool e_manager_comp_composite_mode_get(E_Manager *man, E_Zone *zone); +#endif #endif #endif diff --git a/src/bin/e_module.c b/src/bin/e_module.c index 633f96d..fc9a404 100644 --- a/src/bin/e_module.c +++ b/src/bin/e_module.c @@ -501,6 +501,16 @@ _e_module_free(E_Module *m) free(m); } +#if _F_USE_EXTN_DIALOG_ +static void +_e_module_dialog_disable_show(const char *title, + const char *body, + E_Module *m __UNUSED__) +{ + printf("MODULE ERR:\n%s\n", body); + e_util_extn_dialog_show(title, body); +} +#else static void _e_module_dialog_disable_show(const char *title, const char *body, E_Module *m) { @@ -523,6 +533,7 @@ _e_module_dialog_disable_show(const char *title, const char *body, E_Module *m) e_win_centered_set(dia->win, 1); e_dialog_show(dia); } +#endif static void _e_module_cb_dialog_disable(void *data, E_Dialog *dia) diff --git a/src/bin/e_utils.c b/src/bin/e_utils.c index b5128b9..ba357a4 100644 --- a/src/bin/e_utils.c +++ b/src/bin/e_utils.c @@ -1637,3 +1637,24 @@ e_util_fullscreen_any(void) } return EINA_FALSE; } + +#if _F_USE_EXTN_DIALOG_ +/** + * Using external elementary dialog util instead of e_dialog to display error or warning + * messages. It is a temporary solution for supporting consistent UX theme. The external + * dialog is a simple EFL application which is based on elementary. Thus window manager + * can display message using elementary UX theme, along with other system popup. + */ +EAPI void +e_util_extn_dialog_show(const char *title, + const char *txt) +{ + Ecore_Exe *exe; + char cmd[4096]; + + /* external_dialog_name, icccm_name, icccm_class, popup_title, popup_contents */ + snprintf(cmd, sizeof(cmd), "/usr/bin/extndialog E _extn_dialog \'%s\' \'%s\'", title, txt); + exe = ecore_exe_run(cmd, NULL); + if (exe) ecore_exe_free(exe); +} +#endif diff --git a/src/bin/e_utils.h b/src/bin/e_utils.h index 835f0d0..9070315 100644 --- a/src/bin/e_utils.h +++ b/src/bin/e_utils.h @@ -103,5 +103,9 @@ EAPI int e_util_container_desk_count_get(E_Container *con); EAPI Eina_Bool e_util_fullscreen_curreny_any(void); EAPI Eina_Bool e_util_fullscreen_any(void); +#if _F_USE_EXTN_DIALOG_ +EAPI void e_util_extn_dialog_show(const char *title, const char *txt); +#endif + #endif #endif diff --git a/src/modules/bluez/module.desktop.in b/src/modules/bluez/module.desktop.in index 2f84a42..2f84a42 100755..100644 --- a/src/modules/bluez/module.desktop.in +++ b/src/modules/bluez/module.desktop.in diff --git a/src/modules/clock/module.desktop.in b/src/modules/clock/module.desktop.in index 6804d3c..6804d3c 100755..100644 --- a/src/modules/clock/module.desktop.in +++ b/src/modules/clock/module.desktop.in diff --git a/src/modules/conf/module.desktop.in b/src/modules/conf/module.desktop.in index 0f64555..0f64555 100755..100644 --- a/src/modules/conf/module.desktop.in +++ b/src/modules/conf/module.desktop.in diff --git a/src/modules/conf_applications/module.desktop.in b/src/modules/conf_applications/module.desktop.in index 73b6820..73b6820 100755..100644 --- a/src/modules/conf_applications/module.desktop.in +++ b/src/modules/conf_applications/module.desktop.in diff --git a/src/modules/conf_dialogs/module.desktop.in b/src/modules/conf_dialogs/module.desktop.in index c2ae949..c2ae949 100755..100644 --- a/src/modules/conf_dialogs/module.desktop.in +++ b/src/modules/conf_dialogs/module.desktop.in diff --git a/src/modules/conf_display/e_int_config_desk.c b/src/modules/conf_display/e_int_config_desk.c index cb2f457..d546ee6 100644 --- a/src/modules/conf_display/e_int_config_desk.c +++ b/src/modules/conf_display/e_int_config_desk.c @@ -15,6 +15,7 @@ struct _E_Config_Dialog_Data int desk_y; char *bg; char *name; + char *profile; Evas_Object *preview; Ecore_Event_Handler *hdl; @@ -61,6 +62,7 @@ _fill_data(E_Config_Dialog_Data *cfdata) const char *bg; char name[40]; int ok = 0; + E_Config_Desktop_Window_Profile *prof; bg = e_bg_file_get(cfdata->con_num, cfdata->zone_num, cfdata->desk_x, cfdata->desk_y); if (!bg) @@ -88,6 +90,23 @@ _fill_data(E_Config_Dialog_Data *cfdata) snprintf(name, sizeof(name), _(e_config->desktop_default_name), cfdata->desk_x, cfdata->desk_y); cfdata->name = strdup(name); } + + EINA_LIST_FOREACH(e_config->desktop_window_profiles, l, prof) + { + if (!((prof->container == cfdata->con_num) && + (prof->zone == cfdata->zone_num) && + (prof->desk_x == cfdata->desk_x) && + (prof->desk_y == cfdata->desk_y))) + continue; + + if (prof->profile) + cfdata->profile = strdup(prof->profile); + ok = 1; + break; + } + + if (!ok) + cfdata->profile = strdup(e_config->desktop_default_window_profile); } static void * @@ -110,6 +129,8 @@ _free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata) E_FREE(cfdata->bg); if (cfdata->name) E_FREE(cfdata->name); + if (cfdata->profile) + E_FREE(cfdata->profile); E_FREE(cfdata); } @@ -125,11 +146,20 @@ _basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata) cfdata->name = strdup(name); } + if (!cfdata->profile[0]) + cfdata->profile = strdup(e_config->desktop_default_window_profile); + e_desk_name_del(cfdata->con_num, cfdata->zone_num, cfdata->desk_x, cfdata->desk_y); e_desk_name_add(cfdata->con_num, cfdata->zone_num, cfdata->desk_x, cfdata->desk_y, cfdata->name); e_desk_name_update(); + + e_desk_window_profile_del(cfdata->con_num, cfdata->zone_num, + cfdata->desk_x, cfdata->desk_y); + e_desk_window_profile_add(cfdata->con_num, cfdata->zone_num, + cfdata->desk_x, cfdata->desk_y, cfdata->profile); + e_desk_window_profile_update(); e_bg_del(cfdata->con_num, cfdata->zone_num, cfdata->desk_x, cfdata->desk_y); e_bg_add(cfdata->con_num, cfdata->zone_num, @@ -156,6 +186,13 @@ _basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata) ob = e_widget_entry_add(evas, &(cfdata->name), NULL, NULL, NULL); e_widget_frametable_object_append(of, ob, 1, 0, 2, 1, 1, 1, 1, 0); e_widget_list_object_append(o, of, 1, 1, 0.5); + + of = e_widget_frametable_add(evas, _("Desktop Window Profile"), 0); + ob = e_widget_label_add(evas, _("Profile Name:")); + e_widget_frametable_object_append(of, ob, 0, 0, 1, 1, 1, 1, 1, 0); + ob = e_widget_entry_add(evas, &(cfdata->profile), NULL, NULL, NULL); + e_widget_frametable_object_append(of, ob, 1, 0, 2, 1, 1, 1, 1, 0); + e_widget_list_object_append(o, of, 1, 1, 0.5); of = e_widget_frametable_add(evas, _("Desktop Wallpaper"), 0); ob = e_widget_preview_add(evas, 240, (240 * zone->h) / zone->w); diff --git a/src/modules/conf_edgebindings/module.desktop.in b/src/modules/conf_edgebindings/module.desktop.in index 6536105..6536105 100755..100644 --- a/src/modules/conf_edgebindings/module.desktop.in +++ b/src/modules/conf_edgebindings/module.desktop.in diff --git a/src/modules/conf_interaction/module.desktop.in b/src/modules/conf_interaction/module.desktop.in index 0a50196..0a50196 100755..100644 --- a/src/modules/conf_interaction/module.desktop.in +++ b/src/modules/conf_interaction/module.desktop.in diff --git a/src/modules/conf_intl/module.desktop.in b/src/modules/conf_intl/module.desktop.in index f58e3e7..f58e3e7 100755..100644 --- a/src/modules/conf_intl/module.desktop.in +++ b/src/modules/conf_intl/module.desktop.in diff --git a/src/modules/conf_keybindings/module.desktop.in b/src/modules/conf_keybindings/module.desktop.in index 1211ebe..1211ebe 100755..100644 --- a/src/modules/conf_keybindings/module.desktop.in +++ b/src/modules/conf_keybindings/module.desktop.in diff --git a/src/modules/conf_menus/module.desktop.in b/src/modules/conf_menus/module.desktop.in index 9895c78..9895c78 100755..100644 --- a/src/modules/conf_menus/module.desktop.in +++ b/src/modules/conf_menus/module.desktop.in diff --git a/src/modules/conf_paths/module.desktop.in b/src/modules/conf_paths/module.desktop.in index 71285fe..71285fe 100755..100644 --- a/src/modules/conf_paths/module.desktop.in +++ b/src/modules/conf_paths/module.desktop.in diff --git a/src/modules/conf_performance/module.desktop.in b/src/modules/conf_performance/module.desktop.in index cb0edbd..cb0edbd 100755..100644 --- a/src/modules/conf_performance/module.desktop.in +++ b/src/modules/conf_performance/module.desktop.in diff --git a/src/modules/conf_shelves/module.desktop.in b/src/modules/conf_shelves/module.desktop.in index de3d974..de3d974 100755..100644 --- a/src/modules/conf_shelves/module.desktop.in +++ b/src/modules/conf_shelves/module.desktop.in diff --git a/src/modules/conf_wallpaper2/module.desktop.in b/src/modules/conf_wallpaper2/module.desktop.in index a6d119b..a6d119b 100755..100644 --- a/src/modules/conf_wallpaper2/module.desktop.in +++ b/src/modules/conf_wallpaper2/module.desktop.in diff --git a/src/modules/conf_window_manipulation/module.desktop.in b/src/modules/conf_window_manipulation/module.desktop.in index a7332e8..a7332e8 100755..100644 --- a/src/modules/conf_window_manipulation/module.desktop.in +++ b/src/modules/conf_window_manipulation/module.desktop.in diff --git a/src/modules/conf_window_remembers/module.desktop.in b/src/modules/conf_window_remembers/module.desktop.in index 40aeb94..40aeb94 100755..100644 --- a/src/modules/conf_window_remembers/module.desktop.in +++ b/src/modules/conf_window_remembers/module.desktop.in diff --git a/src/modules/connman/module.desktop.in b/src/modules/connman/module.desktop.in index 3b9f422..3b9f422 100755..100644 --- a/src/modules/connman/module.desktop.in +++ b/src/modules/connman/module.desktop.in diff --git a/src/modules/cpufreq/module.desktop.in b/src/modules/cpufreq/module.desktop.in index fbdbdd0..fbdbdd0 100755..100644 --- a/src/modules/cpufreq/module.desktop.in +++ b/src/modules/cpufreq/module.desktop.in diff --git a/src/modules/dropshadow/module.desktop.in b/src/modules/dropshadow/module.desktop.in index 2dd46c2..2dd46c2 100755..100644 --- a/src/modules/dropshadow/module.desktop.in +++ b/src/modules/dropshadow/module.desktop.in diff --git a/src/modules/everything/module.desktop.in b/src/modules/everything/module.desktop.in index d9406aa..d9406aa 100755..100644 --- a/src/modules/everything/module.desktop.in +++ b/src/modules/everything/module.desktop.in diff --git a/src/modules/fileman/module.desktop.in b/src/modules/fileman/module.desktop.in index 794b182..794b182 100755..100644 --- a/src/modules/fileman/module.desktop.in +++ b/src/modules/fileman/module.desktop.in diff --git a/src/modules/fileman_opinfo/module.desktop.in b/src/modules/fileman_opinfo/module.desktop.in index 6c35b4e..6c35b4e 100755..100644 --- a/src/modules/fileman_opinfo/module.desktop.in +++ b/src/modules/fileman_opinfo/module.desktop.in diff --git a/src/modules/gadman/e_mod_gadman.c b/src/modules/gadman/e_mod_gadman.c index 80cddb8..cdef849 100644 --- a/src/modules/gadman/e_mod_gadman.c +++ b/src/modules/gadman/e_mod_gadman.c @@ -42,9 +42,15 @@ static void on_menu_add(void *data, E_Menu *m, E_Menu_Item *mi); static int _e_gadman_client_add (void *data __UNUSED__, const E_Gadcon_Client_Class *cc); static void _e_gadman_client_remove (void *data __UNUSED__, E_Gadcon_Client *gcc); +static void _e_gadman_handlers_add(void); +static void _e_gadman_handler_del(void); +static Eina_Bool _e_gadman_cb_zone_add(void *data __UNUSED__, int type __UNUSED__, void *event); +static Eina_Bool _e_gadman_cb_zone_del(void *data __UNUSED__, int type __UNUSED__, void *event); + E_Gadcon_Client *current = NULL; Manager *Man = NULL; static E_Gadcon_Location *location = NULL; +static Eina_List *_gadman_hdls = NULL; /* Implementation */ void @@ -90,6 +96,8 @@ gadman_init(E_Module *m) Man->gadcons[layer] = eina_list_append(Man->gadcons[layer], gc); } } + + _e_gadman_handlers_add(); } void @@ -98,6 +106,8 @@ gadman_shutdown(void) E_Gadcon *gc; unsigned int layer; + _e_gadman_handler_del(); + e_gadcon_location_unregister(location); e_container_shape_change_callback_del(Man->container, on_shape_change, NULL); @@ -667,14 +677,14 @@ _apply_widget_position(E_Gadcon_Client *gcc) int x, y, w, h; E_Zone *zone; - x = gcc->cf->geom.pos_x * Man->width; - y = gcc->cf->geom.pos_y * Man->height; - w = gcc->cf->geom.size_w * Man->width; - h = gcc->cf->geom.size_h * Man->height; - /* Obtain zone from parent gadcon */ zone = gcc->gadcon->zone; + x = (gcc->cf->geom.pos_x * zone->w) + zone->x; + y = (gcc->cf->geom.pos_y * zone->h) + zone->y; + w = gcc->cf->geom.size_w * zone->w; + h = gcc->cf->geom.size_h * zone->h; + /* Respect min sizes */ if (h < gcc->min.h) h = gcc->min.h; if (w < gcc->min.w) w = gcc->min.w; @@ -873,10 +883,11 @@ _get_bind_text(const char* action) static void on_shape_change(void *data __UNUSED__, E_Container_Shape *es, E_Container_Shape_Change ch __UNUSED__) { - const Eina_List *l, *g; + const Eina_List *l, *g, *ll; E_Gadcon *gc; E_Config_Gadcon_Client *cf_gcc; E_Container *con; + E_Gadcon_Client *gcc; unsigned int layer; con = e_container_shape_container_get(es); @@ -890,12 +901,18 @@ on_shape_change(void *data __UNUSED__, E_Container_Shape *es, E_Container_Shape_ for (layer = 0; layer < GADMAN_LAYER_COUNT; layer++) { - EINA_LIST_FOREACH(Man->gadcons[layer], g, gc) - { - e_gadcon_unpopulate(gc); - EINA_LIST_FOREACH(gc->cf->clients, l, cf_gcc) - gadman_gadget_place(cf_gcc, layer, gc->zone); - } + EINA_LIST_FOREACH(Man->gadcons[layer], g, gc) + { + EINA_LIST_FOREACH(gc->clients, ll, gcc) + { + Man->gadgets[layer] = eina_list_remove(Man->gadgets[layer], gcc); + if (gcc->gadcon->editing) gadman_gadget_edit_end(NULL, NULL, NULL, NULL); + } + + e_gadcon_unpopulate(gc); + EINA_LIST_FOREACH(gc->cf->clients, l, cf_gcc) + gadman_gadget_place(cf_gcc, layer, gc->zone); + } } } @@ -1365,3 +1382,102 @@ _e_gadman_client_remove(void *data __UNUSED__, E_Gadcon_Client *gcc) { gadman_gadget_del(gcc); } + +static void +_e_gadman_handlers_add(void) +{ + _gadman_hdls = + eina_list_append(_gadman_hdls, + ecore_event_handler_add(E_EVENT_ZONE_ADD, + _e_gadman_cb_zone_add, + NULL)); + _gadman_hdls = + eina_list_append(_gadman_hdls, + ecore_event_handler_add(E_EVENT_ZONE_DEL, + _e_gadman_cb_zone_del, + NULL)); +} + +static void +_e_gadman_handler_del(void) +{ + Ecore_Event_Handler *hdl; + + /* remove the ecore event handlers */ + EINA_LIST_FREE(_gadman_hdls, hdl) + ecore_event_handler_del(hdl); +} + +static Eina_Bool +_e_gadman_cb_zone_add(void *data __UNUSED__, int type __UNUSED__, void *event) +{ + E_Event_Zone_Add *ev; + E_Zone* zone; + E_Gadcon *gc; + Eina_List *l; + unsigned int layer; + + ev = event; + zone = ev->zone; + + for (layer = 0; layer < GADMAN_LAYER_COUNT; layer++) + { + EINA_LIST_FOREACH(Man->gadcons[layer], l, gc) + if (gc->zone == zone) return ECORE_CALLBACK_PASS_ON; + } + + // Not exist, then add + /* iterating through zones - and making gadmans on each */ + const char *layer_name[] = {"gadman", "gadman_top"}; + + for (layer = 0; layer < GADMAN_LAYER_COUNT; layer++) + { + E_Gadcon *gc; + + gc = _gadman_gadcon_new(layer_name[layer], layer, zone, location); + Man->gadcons[layer] = eina_list_append(Man->gadcons[layer], gc); + } + + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_gadman_cb_zone_del(void *data __UNUSED__, int type __UNUSED__, void *event) +{ + E_Event_Zone_Del *ev; + E_Zone* zone; + Eina_List *l, *ll; + E_Gadcon *gc; + E_Gadcon_Client *gcc; + unsigned int layer; + + ev = event; + zone = ev->zone; + + for (layer = 0; layer < GADMAN_LAYER_COUNT; layer++) + { + EINA_LIST_FOREACH(Man->gadcons[layer], l, gc) + { + if (gc->zone != zone) continue; + + Man->gadcons[layer] = eina_list_remove(Man->gadcons[layer], gc); + + EINA_LIST_FOREACH(gc->clients, ll, gcc) + { + Man->gadgets[layer] = eina_list_remove(Man->gadgets[layer], gcc); + if (gcc->gadcon->editing) gadman_gadget_edit_end(NULL, NULL, NULL, NULL); + } + + e_gadcon_unpopulate(gc); + e_gadcon_custom_del(gc); + + eina_stringshare_del(gc->name); + if (gc->config_dialog) e_object_del(E_OBJECT(gc->config_dialog)); + + E_FREE(gc); + } + } + + return ECORE_CALLBACK_PASS_ON; +} + diff --git a/src/modules/ibar/e_mod_config.c b/src/modules/ibar/e_mod_config.c index 8e4264a..cf3cec6 100644 --- a/src/modules/ibar/e_mod_config.c +++ b/src/modules/ibar/e_mod_config.c @@ -5,6 +5,7 @@ struct _E_Config_Dialog_Data { const char *dir; int show_label, eap_label; + int lock_move; Evas_Object *tlist; Evas_Object *radio_name; @@ -26,6 +27,7 @@ static void _cb_confirm_dialog_yes(void *data); static void _cb_confirm_dialog_destroy(void *data); static void _load_tlist(E_Config_Dialog_Data *cfdata); static void _show_label_cb_change(void *data, Evas_Object *obj); +static void _lock_move_cb_change(void *data, Evas_Object *obj); void _config_ibar_module(Config_Item *ci) @@ -64,6 +66,7 @@ _fill_data(Config_Item *ci, E_Config_Dialog_Data *cfdata) cfdata->dir = eina_stringshare_add(""); cfdata->show_label = ci->show_label; cfdata->eap_label = ci->eap_label; + cfdata->lock_move = ci->lock_move; } static void * @@ -136,6 +139,14 @@ _basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dial if (!cfdata->show_label) e_widget_disabled_set(cfdata->radio_generic, 1); e_widget_list_object_append(o, of, 1, 1, 0.5); + + of = e_widget_framelist_add(evas, _("Icon Movement"), 0); + ob = e_widget_check_add(evas, _("Lock Icon Move"), &(cfdata->lock_move)); + e_widget_on_change_hook_set(ob, _lock_move_cb_change, cfdata); + e_widget_framelist_object_append(of, ob); + + e_widget_list_object_append(o, of, 1, 1, 0.5); + return o; } @@ -148,8 +159,10 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) if (ci->dir) eina_stringshare_del(ci->dir); ci->dir = NULL; if (cfdata->dir) ci->dir = eina_stringshare_ref(cfdata->dir); + ci->show_label = cfdata->show_label; ci->eap_label = cfdata->eap_label; + ci->lock_move = cfdata->lock_move; _ibar_config_update(ci); e_config_save_queue(); return 1; @@ -305,3 +318,13 @@ _show_label_cb_change(void *data, Evas_Object *obj __UNUSED__) e_widget_disabled_set(cfdata->radio_comment, !cfdata->show_label); e_widget_disabled_set(cfdata->radio_generic, !cfdata->show_label); } + +static void +_lock_move_cb_change(void *data, Evas_Object *obj __UNUSED__) +{ + E_Config_Dialog_Data *cfdata; + + cfdata = data; + if (!cfdata) return; +} + diff --git a/src/modules/ibar/e_mod_main.c b/src/modules/ibar/e_mod_main.c index 7d4ddd9..322cce0 100644 --- a/src/modules/ibar/e_mod_main.c +++ b/src/modules/ibar/e_mod_main.c @@ -442,6 +442,8 @@ _ibar_config_item_get(const char *id) ci->dir = eina_stringshare_add("default"); ci->show_label = 1; ci->eap_label = 0; + ci->lock_move= 0; + ibar_config->items = eina_list_append(ibar_config->items, ci); return ci; } @@ -746,11 +748,11 @@ _ibar_cb_icon_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS ic = data; if (ev->button == 1) { - ic->drag.x = ev->output.x; - ic->drag.y = ev->output.y; - ic->drag.start = 1; - ic->drag.dnd = 0; - ic->mouse_down = 1; + ic->drag.x = ev->output.x; + ic->drag.y = ev->output.y; + ic->drag.start = 1; + ic->drag.dnd = 0; + ic->mouse_down = 1; } else if ((ev->button == 3) && (!ibar_config->menu)) { @@ -827,28 +829,31 @@ _ibar_cb_icon_mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *e ev = event_info; ic = data; - if ((ev->button == 1) && (!ic->drag.dnd) && (ic->mouse_down == 1)) - { - if (ic->app->type == EFREET_DESKTOP_TYPE_APPLICATION) - e_exec(ic->ibar->inst->gcc->gadcon->zone, ic->app, NULL, NULL, "ibar"); - else if (ic->app->type == EFREET_DESKTOP_TYPE_LINK) - { - if (!strncasecmp(ic->app->url, "file:", 5)) - { - E_Action *act; - - act = e_action_find("fileman"); - if (act) act->func.go(E_OBJECT(obj), ic->app->url + 5); - } - } - ic->drag.start = 0; - ic->drag.dnd = 0; - ic->mouse_down = 0; - /* TODO: bring back "e,action,start|stop" for the startup_notify apps - * when startup_notify is used again - */ - _ibar_icon_signal_emit(ic, "e,action,exec", "e"); + if ((ev->button == 1) && (ic->mouse_down == 1)) + { + if (!ic->drag.dnd) + { + if (ic->app->type == EFREET_DESKTOP_TYPE_APPLICATION) + e_exec(ic->ibar->inst->gcc->gadcon->zone, ic->app, NULL, NULL, "ibar"); + else if (ic->app->type == EFREET_DESKTOP_TYPE_LINK) + { + if (!strncasecmp(ic->app->url, "file:", 5)) + { + E_Action *act; + + act = e_action_find("fileman"); + if (act) act->func.go(E_OBJECT(obj), ic->app->url + 5); + } + } + /* TODO: bring back "e,action,start|stop" for the startup_notify apps + * when startup_notify is used again + */ + _ibar_icon_signal_emit(ic, "e,action,exec", "e"); + } + ic->drag.start = 0; + ic->drag.dnd = 0; + ic->mouse_down = 0; } } @@ -879,6 +884,8 @@ _ibar_cb_icon_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS ic->drag.dnd = 1; ic->drag.start = 0; + if (ic->ibar->inst->ci->lock_move) return; + evas_object_geometry_get(ic->o_icon, &x, &y, &w, &h); d = e_drag_new(ic->ibar->inst->gcc->gadcon->zone->container, x, y, drag_types, 1, @@ -1162,6 +1169,7 @@ e_modapi_init(E_Module *m) E_CONFIG_VAL(D, T, dir, STR); E_CONFIG_VAL(D, T, show_label, INT); E_CONFIG_VAL(D, T, eap_label, INT); + E_CONFIG_VAL(D, T, lock_move, INT); conf_edd = E_CONFIG_DD_NEW("IBar_Config", Config); #undef T @@ -1183,6 +1191,8 @@ e_modapi_init(E_Module *m) ci->dir = eina_stringshare_add("default"); ci->show_label = 1; ci->eap_label = 0; + ci->lock_move= 0; + ibar_config->items = eina_list_append(ibar_config->items, ci); } diff --git a/src/modules/ibar/e_mod_main.h b/src/modules/ibar/e_mod_main.h index 0811876..dd32910 100644 --- a/src/modules/ibar/e_mod_main.h +++ b/src/modules/ibar/e_mod_main.h @@ -22,6 +22,7 @@ struct _Config_Item const char *dir; int show_label; int eap_label; + int lock_move; }; EAPI extern E_Module_Api e_modapi; diff --git a/src/modules/illume-keyboard/module.desktop.in b/src/modules/illume-keyboard/module.desktop.in index 232d60f..232d60f 100755..100644 --- a/src/modules/illume-keyboard/module.desktop.in +++ b/src/modules/illume-keyboard/module.desktop.in diff --git a/src/modules/illume-mode-toggle/module.desktop.in b/src/modules/illume-mode-toggle/module.desktop.in index d808f3f..d808f3f 100755..100644 --- a/src/modules/illume-mode-toggle/module.desktop.in +++ b/src/modules/illume-mode-toggle/module.desktop.in diff --git a/src/modules/illume-softkey/module.desktop.in b/src/modules/illume-softkey/module.desktop.in index dd92124..dd92124 100755..100644 --- a/src/modules/illume-softkey/module.desktop.in +++ b/src/modules/illume-softkey/module.desktop.in diff --git a/src/modules/layout/module.desktop.in b/src/modules/layout/module.desktop.in index 5099de2..5099de2 100755..100644 --- a/src/modules/layout/module.desktop.in +++ b/src/modules/layout/module.desktop.in diff --git a/src/modules/msgbus/module.desktop.in b/src/modules/msgbus/module.desktop.in index dabcd7b..dabcd7b 100755..100644 --- a/src/modules/msgbus/module.desktop.in +++ b/src/modules/msgbus/module.desktop.in diff --git a/src/modules/ofono/module.desktop.in b/src/modules/ofono/module.desktop.in index 8be6c81..8be6c81 100755..100644 --- a/src/modules/ofono/module.desktop.in +++ b/src/modules/ofono/module.desktop.in diff --git a/src/modules/pager/module.desktop.in b/src/modules/pager/module.desktop.in index 3c928cc..3c928cc 100755..100644 --- a/src/modules/pager/module.desktop.in +++ b/src/modules/pager/module.desktop.in diff --git a/src/modules/shot/.svn/all-wcprops b/src/modules/shot/.svn/all-wcprops deleted file mode 100755 index 997dc22..0000000 --- a/src/modules/shot/.svn/all-wcprops +++ /dev/null @@ -1,41 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 46 -/svn/e/!svn/ver/59941/trunk/e/src/modules/shot -END -module.desktop.in -K 25 -svn:wc:ra_dav:version-url -V 64 -/svn/e/!svn/ver/59829/trunk/e/src/modules/shot/module.desktop.in -END -e-module-shot.edj -K 25 -svn:wc:ra_dav:version-url -V 64 -/svn/e/!svn/ver/59797/trunk/e/src/modules/shot/e-module-shot.edj -END -e_mod_main.c -K 25 -svn:wc:ra_dav:version-url -V 59 -/svn/e/!svn/ver/59792/trunk/e/src/modules/shot/e_mod_main.c -END -Makefile.am -K 25 -svn:wc:ra_dav:version-url -V 58 -/svn/e/!svn/ver/59766/trunk/e/src/modules/shot/Makefile.am -END -.cvsignore -K 25 -svn:wc:ra_dav:version-url -V 57 -/svn/e/!svn/ver/59766/trunk/e/src/modules/shot/.cvsignore -END -e_mod_main.h -K 25 -svn:wc:ra_dav:version-url -V 59 -/svn/e/!svn/ver/59766/trunk/e/src/modules/shot/e_mod_main.h -END diff --git a/src/modules/shot/.svn/dir-prop-base b/src/modules/shot/.svn/dir-prop-base deleted file mode 100755 index feed959..0000000 --- a/src/modules/shot/.svn/dir-prop-base +++ /dev/null @@ -1,9 +0,0 @@ -K 10 -svn:ignore -V 42 -Makefile -Makefile.in -.deps -module.desktop - -END diff --git a/src/modules/shot/.svn/entries b/src/modules/shot/.svn/entries deleted file mode 100755 index 83c070f..0000000 --- a/src/modules/shot/.svn/entries +++ /dev/null @@ -1,232 +0,0 @@ -10 - -dir -60234 -https://svn.enlightenment.org/svn/e/trunk/e/src/modules/shot -https://svn.enlightenment.org/svn/e - - - -2011-06-04T01:21:47.218159Z -59941 -raster -has-props - - - - - - - - - - - - - -7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 - -module.desktop.in -file - - - - -2011-06-12T06:33:50.000000Z -2576a4fa15a98341d07ed5eae5f1c276 -2011-05-31T00:55:25.015330Z -59829 -seoz - - - - - - - - - - - - - - - - - - - - - -382 - -e-module-shot.edj -file - - - - -2011-06-12T06:33:50.000000Z -a3ebb37b918859a4ee1a960092700b3c -2011-05-30T05:35:45.697661Z -59797 -raster -has-props - - - - - - - - - - - - - - - - - - - - -9475 - -e_mod_main.c -file - - - - -2011-06-12T06:33:50.000000Z -cb66237d4e2373a5dd7fd8405a58cc33 -2011-05-29T23:45:40.227255Z -59792 -raster - - - - - - - - - - - - - - - - - - - - - -23589 - -Makefile.am -file - - - - -2011-05-29T06:47:52.000000Z -da54f69937931d923395364370e0e776 -2011-05-28T06:53:44.881572Z -59766 -raster - - - - - - - - - - - - - - - - - - - - - -982 - -.cvsignore -file - - - - -2011-05-29T06:47:52.000000Z -30ebe381b2db35c06ea554373a095af7 -2011-05-28T06:53:44.881572Z -59766 -raster - - - - - - - - - - - - - - - - - - - - - -63 - -e_mod_main.h -file - - - - -2011-05-29T06:47:52.000000Z -b027d70ec5e628a1b3c5e7891c153218 -2011-05-28T06:53:44.881572Z -59766 -raster - - - - - - - - - - - - - - - - - - - - - -219 - diff --git a/src/modules/shot/.svn/prop-base/e-module-shot.edj.svn-base b/src/modules/shot/.svn/prop-base/e-module-shot.edj.svn-base deleted file mode 100755 index 5e9587e..0000000 --- a/src/modules/shot/.svn/prop-base/e-module-shot.edj.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/src/modules/shot/.svn/text-base/.cvsignore.svn-base b/src/modules/shot/.svn/text-base/.cvsignore.svn-base deleted file mode 100755 index 06d064a..0000000 --- a/src/modules/shot/.svn/text-base/.cvsignore.svn-base +++ /dev/null @@ -1,7 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -*.lo -module.la -module.desktop diff --git a/src/modules/shot/.svn/text-base/Makefile.am.svn-base b/src/modules/shot/.svn/text-base/Makefile.am.svn-base deleted file mode 100755 index 3bf6d94..0000000 --- a/src/modules/shot/.svn/text-base/Makefile.am.svn-base +++ /dev/null @@ -1,28 +0,0 @@ -MAINTAINERCLEANFILES = Makefile.in -MODULE = shot - -# data files for the module -filesdir = $(libdir)/enlightenment/modules/$(MODULE) -files_DATA = \ -e-module-$(MODULE).edj module.desktop - -EXTRA_DIST = $(files_DATA) - -# the module .so file -INCLUDES = -I. \ - -I$(top_srcdir) \ - -I$(top_srcdir)/src/modules/$(MODULE) \ - -I$(top_srcdir)/src/bin \ - -I$(top_builddir)/src/bin \ - -I$(top_srcdir)/src/modules \ - @e_cflags@ -pkgdir = $(libdir)/enlightenment/modules/$(MODULE)/$(MODULE_ARCH) -pkg_LTLIBRARIES = module.la -module_la_SOURCES = e_mod_main.c \ - e_mod_main.h -module_la_LIBADD = @e_libs@ @dlopen_libs@ -module_la_LDFLAGS = -module -avoid-version -module_la_DEPENDENCIES = $(top_builddir)/config.h - -uninstall: - rm -rf $(DESTDIR)$(libdir)/enlightenment/modules/$(MODULE) diff --git a/src/modules/shot/.svn/text-base/e-module-shot.edj.svn-base b/src/modules/shot/.svn/text-base/e-module-shot.edj.svn-base Binary files differdeleted file mode 100755 index a507906..0000000 --- a/src/modules/shot/.svn/text-base/e-module-shot.edj.svn-base +++ /dev/null diff --git a/src/modules/shot/.svn/text-base/e_mod_main.c.svn-base b/src/modules/shot/.svn/text-base/e_mod_main.c.svn-base deleted file mode 100755 index f4a85c7..0000000 --- a/src/modules/shot/.svn/text-base/e_mod_main.c.svn-base +++ /dev/null @@ -1,839 +0,0 @@ -#include "e.h" -#include "e_mod_main.h" - -static E_Module *shot_module = NULL; - -static E_Action *act = NULL; -static E_Int_Menu_Augmentation *maug = NULL; -static Ecore_Timer *timer = NULL; -static E_Win *win = NULL; -static Evas_Object *o_bg = NULL, *o_box = NULL, *o_content = NULL; -static Evas_Object *o_event = NULL, *o_img = NULL, *o_hlist = NULL; -static E_Manager *sman = NULL; -static E_Container *scon = NULL; -static int quality = 90; -static int screen = -1; -#define MAXZONES 64 -static Evas_Object *o_rectdim[MAXZONES] = { NULL }; -static Evas_Object *o_radio_all = NULL; -static Evas_Object *o_radio[MAXZONES] = { NULL }; -static Evas_Object *o_fsel = NULL; -static Evas_Object *o_label = NULL; -static Evas_Object *o_entry = NULL; -static unsigned char *fdata = NULL; -static int fsize = 0; -static Ecore_Con_Url *url_up = NULL; -static Eina_List *handlers = NULL; -static char *url_ret = NULL; - -static void -_win_delete_cb(E_Win *w __UNUSED__) -{ - if (win) - { - e_object_del(E_OBJECT(win)); - win = NULL; - } -} - -static void -_win_resize_cb(E_Win *w __UNUSED__) -{ - evas_object_resize(o_bg, win->w, win->h); -} - -static void -_on_focus_cb(void *data __UNUSED__, Evas_Object *obj) -{ - if (obj == o_content) e_widget_focused_object_clear(o_box); - else if (o_content) e_widget_focused_object_clear(o_content); -} - -static void -_key_down_cb(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event) -{ - Evas_Event_Key_Down *ev = event; - - if (!strcmp(ev->keyname, "Tab")) - { - if (evas_key_modifier_is_set(evas_key_modifier_get(e_win_evas_get(win)), "Shift")) - { - if (e_widget_focus_get(o_box)) - { - if (!e_widget_focus_jump(o_box, 0)) - { - e_widget_focus_set(o_content, 0); - if (!e_widget_focus_get(o_content)) - e_widget_focus_set(o_box, 0); - } - } - else - { - if (!e_widget_focus_jump(o_content, 0)) - e_widget_focus_set(o_box, 0); - } - } - else - { - if (e_widget_focus_get(o_box)) - { - if (!e_widget_focus_jump(o_box, 1)) - { - e_widget_focus_set(o_content, 1); - if (!e_widget_focus_get(o_content)) - e_widget_focus_set(o_box, 1); - } - } - else - { - if (!e_widget_focus_jump(o_content, 1)) - e_widget_focus_set(o_box, 1); - } - } - } - else if (((!strcmp(ev->keyname, "Return")) || - (!strcmp(ev->keyname, "KP_Enter")) || - (!strcmp(ev->keyname, "space")))) - { - Evas_Object *o = NULL; - - if ((o_content) && (e_widget_focus_get(o_content))) - o = e_widget_focused_object_get(o_content); - else - o = e_widget_focused_object_get(o_box); - if (o) e_widget_activate(o); - } -} - -static void -_screen_change_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - Eina_List *l; - E_Zone *z; - - EINA_LIST_FOREACH(scon->zones, l, z) - { - if (screen == -1) - evas_object_color_set(o_rectdim[z->num], 0, 0, 0, 0); - else if (screen == (int)z->num) - evas_object_color_set(o_rectdim[z->num], 0, 0, 0, 0); - else - evas_object_color_set(o_rectdim[z->num], 0, 0, 0, 200); - } -} - -static void -_save_to(const char *file) -{ - char *extn = strrchr(file, '.'); - char opts[256]; - - if (!extn) - { - e_util_dialog_show - (_("Error - Unknown format"), - _("File has an unspecified extension.<br>" - "Please use '.jpg' or '.png' extensions<br>" - "only as other formats are not<br>" - "supported currently.")); - return; - } - if (!((!strcasecmp(extn, ".png")) || - (!strcasecmp(extn, ".jpg")) || - (!strcasecmp(extn, ".jpeg")))) - { - e_util_dialog_show - (_("Error - Unknown format"), - _("File has an unrecognized extension.<br>" - "Please use '.jpg' or '.png' extensions<br>" - "only as other formats are not<br>" - "supported currently.")); - return; - } - if (!strcasecmp(extn, ".png")) - snprintf(opts, sizeof(opts), "compress=%i", 9); - else - snprintf(opts, sizeof(opts), "quality=%i", quality); - if (screen == -1) - { - evas_object_image_save(o_img, file, NULL, opts); - } - else - { - Evas_Object *o; - Eina_List *l; - E_Zone *z = NULL; - - EINA_LIST_FOREACH(scon->zones, l, z) - { - if (screen == (int)z->num) break; - z = NULL; - } - if (z) - { - unsigned char *src, *dst, *s, *d; - int sstd, dstd, y; - - o = evas_object_image_add(evas_object_evas_get(o_img)); - evas_object_image_colorspace_set(o, EVAS_COLORSPACE_ARGB8888); - evas_object_image_alpha_set(o, EINA_FALSE); - evas_object_image_size_set(o, z->w, z->h); - src = evas_object_image_data_get(o_img, EINA_FALSE); - sstd = evas_object_image_stride_get(o_img); - dst = evas_object_image_data_get(o, EINA_TRUE); - dstd = evas_object_image_stride_get(o); - d = dst; - for (y = 0; y < z->h; y++) - { - s = src + (sstd * y) + (z->x * 4); - memcpy(d, s, z->w * 4); - d += z->w * 4; - } - evas_object_image_save(o, file, NULL, opts); - evas_object_del(o); - } - } -} - -static void -_file_select_ok_cb(void *data __UNUSED__, E_Dialog *dia) -{ - const char *file; - - file = e_widget_fsel_selection_path_get(o_fsel); - if (file) _save_to(file); - if (dia) e_util_defer_object_del(E_OBJECT(dia)); - if (win) - { - e_object_del(E_OBJECT(win)); - win = NULL; - } -} - -static void -_file_select_cancel_cb(void *data __UNUSED__, E_Dialog *dia) -{ - if (dia) e_util_defer_object_del(E_OBJECT(dia)); - if (win) - { - e_object_del(E_OBJECT(win)); - win = NULL; - } -} - -static void -_win_save_cb(void *data __UNUSED__, void *data2 __UNUSED__) -{ - E_Dialog *dia; - Evas_Object *o; - Evas_Coord mw, mh; - - dia = e_dialog_new(scon, "E", "_e_shot_fsel"); - e_dialog_title_set(dia, _("Select screenshot save location")); - o = e_widget_fsel_add(dia->win->evas, "~/", "/", NULL, NULL, - NULL, NULL, - NULL, NULL, 1); - o_fsel = o; - evas_object_show(o); - e_widget_size_min_get(o, &mw, &mh); - e_dialog_content_set(dia, o, mw, mh); - e_dialog_button_add(dia, _("OK"), NULL, - _file_select_ok_cb, NULL); - e_dialog_button_add(dia, _("Cancel"), NULL, - _file_select_cancel_cb, NULL); - e_dialog_resizable_set(dia, 1); - e_win_centered_set(dia->win, 1); - e_dialog_show(dia); -} - -static void -_share_done(void) -{ - Ecore_Event_Handler *h; - - EINA_LIST_FREE(handlers, h) ecore_event_handler_del(h); - o_label = NULL; - if (url_ret) - { - free(url_ret); - url_ret = NULL; - } - if (url_up) - { - ecore_con_url_free(url_up); - url_up = NULL; - } - ecore_con_url_shutdown(); -} - -static void -_upload_ok_cb(void *data __UNUSED__, E_Dialog *dia) -{ - // ok just hides dialog and does background upload - o_label = NULL; - if (dia) e_util_defer_object_del(E_OBJECT(dia)); - if (win) - { - e_object_del(E_OBJECT(win)); - win = NULL; - } - _share_done(); -} - -static void -_upload_cancel_cb(void *data __UNUSED__, E_Dialog *dia) -{ - if (dia) e_util_defer_object_del(E_OBJECT(dia)); - if (win) - { - e_object_del(E_OBJECT(win)); - win = NULL; - } -} - -static Eina_Bool -_upload_data_cb(void *data __UNUSED__, int ev_type __UNUSED__, void *event) -{ - Ecore_Con_Event_Url_Data *ev = event; - if (ev->url_con != url_up) return EINA_TRUE; - if ((o_label) && (ev->size < 1024)) - { - char *txt = alloca(ev->size + 1); - - memcpy(txt, ev->data, ev->size); - txt[ev->size] = 0; -/* - printf("GOT %i bytes: '%s'\n", ev->size, txt); - int i; - for (i = 0; i < ev->size; i++) printf("%02x.", ev->data[i]); - printf("\n"); - */ - if (!url_ret) url_ret = strdup(txt); - else - { - char *n; - - n = malloc(strlen(url_ret) + ev->size + 1); - if (n) - { - free(url_ret); - strcpy(n, url_ret); - strcat(n, txt); - url_ret = n; - } - } - } - return EINA_FALSE; -} - -static Eina_Bool -_upload_progress_cb(void *data __UNUSED__, int ev_type __UNUSED__, void *event) -{ - Ecore_Con_Event_Url_Progress *ev = event; - if (ev->url_con != url_up) return EINA_TRUE; - if (o_label) - { - char buf[1024]; - - snprintf(buf, sizeof(buf), - "Uploaded %1.1fKB / %1.1fKB", - ev->up.now / 1024, - ev->up.total / 1024); - e_widget_label_text_set(o_label, buf); - } - return EINA_FALSE; -} - -static Eina_Bool -_upload_complete_cb(void *data __UNUSED__, int ev_type __UNUSED__, void *event) -{ - Ecore_Con_Event_Url_Complete *ev = event; - if (ev->url_con != url_up) return EINA_TRUE; - if (ev->status != 200) - { - e_util_dialog_show - (_("Error - Upload Failed"), - _("Upload failed with status code:<br>" - "%i"), - ev->status); - _share_done(); - return EINA_FALSE; - } - if ((o_entry) && (url_ret)) - e_widget_entry_text_set(o_entry, url_ret); - _share_done(); - return EINA_FALSE; -} - -static void -_win_share_cb(void *data __UNUSED__, void *data2 __UNUSED__) -{ - E_Dialog *dia; - Evas_Object *o, *ol; - Evas_Coord mw, mh; - char buf[PATH_MAX]; - FILE *f; - - if (quality == 100) snprintf(buf, sizeof(buf), "/tmp/e-shot-XXXXXX.png"); - else snprintf(buf, sizeof(buf), "/tmp/e-shot-XXXXXX.jpg"); - if (!mkstemp(buf)) - { - e_util_dialog_show - (_("Error - Can't create File"), - _("Cannot create temporary file:\n" - "%s"), - buf); - if (win) - { - e_object_del(E_OBJECT(win)); - win = NULL; - } - return; - } - _save_to(buf); - if (win) - { - e_object_del(E_OBJECT(win)); - win = NULL; - } - f = fopen(buf, "rb"); - if (!f) - { - // FIXME: error disp - return; - } - fseek(f, 0, SEEK_END); - fsize = ftell(f); - if (fsize < 1) - { - // FIXME: error disp - fclose(f); - return; - } - rewind(f); - if (fdata) free(fdata); - fdata = malloc(fsize); - if (!fdata) - { - // FIXME: error disp - fclose(f); - return; - } - if (fread(fdata, fsize, 1, f) != 1) - { - // FIXME: error disp - free(fdata); - fdata = NULL; - fclose(f); - return; - } - fclose(f); - ecore_file_unlink(buf); - - _share_done(); - - if (!ecore_con_url_init()) - { - // FIXME: error disp - free(fdata); - fdata = NULL; - return; - } - - handlers = eina_list_append - (handlers, ecore_event_handler_add - (ECORE_CON_EVENT_URL_DATA, _upload_data_cb, NULL)); - handlers = eina_list_append - (handlers, ecore_event_handler_add - (ECORE_CON_EVENT_URL_PROGRESS, _upload_progress_cb, NULL)); - handlers = eina_list_append - (handlers, ecore_event_handler_add - (ECORE_CON_EVENT_URL_COMPLETE, _upload_complete_cb, NULL)); - - url_up = ecore_con_url_new("http://www.enlightenment.org/shot.php"); - ecore_con_url_post(url_up, fdata, fsize, "application/x-e-shot"); - - dia = e_dialog_new(scon, "E", "_e_shot_share"); - e_dialog_title_set(dia, _("Uploading screenshot")); - - o = e_widget_list_add(dia->win->evas, 0, 0); - ol = o; - - o = e_widget_label_add(dia->win->evas, _("Uploading ...")); - o_label = o; - e_widget_list_object_append(ol, o, 0, 0, 0.5); - - o = e_widget_label_add(dia->win->evas, - _("Screenshot is available at this location:")); - e_widget_list_object_append(ol, o, 0, 0, 0.5); - - o = e_widget_entry_add(dia->win->evas, NULL, NULL, NULL, NULL); - o_entry = o; - e_widget_list_object_append(ol, o, 1, 0, 0.5); - - e_widget_size_min_get(ol, &mw, &mh); - e_dialog_content_set(dia, ol, mw, mh); - e_dialog_button_add(dia, _("OK"), NULL, _upload_ok_cb, NULL); - e_dialog_button_add(dia, _("Cancel"), NULL, _upload_cancel_cb, NULL); - e_dialog_resizable_set(dia, 1); - e_win_centered_set(dia->win, 1); - e_dialog_show(dia); -} - -static void -_win_cancel_cb(void *data __UNUSED__, void *data2 __UNUSED__) -{ - if (win) - { - e_object_del(E_OBJECT(win)); - win = NULL; - } -} - -static void -_rect_down_cb(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) -{ - Evas_Event_Mouse_Down *ev = event_info; - Eina_List *l; - E_Zone *z; - - if (ev->button != 1) return; - - e_widget_radio_toggle_set(o_radio_all, 0); - EINA_LIST_FOREACH(scon->zones, l, z) - { - if (obj == o_rectdim[z->num]) - { - screen = z->num; - e_widget_radio_toggle_set(o_radio[z->num], 1); - } - else - e_widget_radio_toggle_set(o_radio[z->num], 0); - } - - EINA_LIST_FOREACH(scon->zones, l, z) - { - if (screen == -1) - evas_object_color_set(o_rectdim[z->num], 0, 0, 0, 0); - else if (screen == (int)z->num) - evas_object_color_set(o_rectdim[z->num], 0, 0, 0, 0); - else - evas_object_color_set(o_rectdim[z->num], 0, 0, 0, 200); - } -} - -static void -_shot_now(E_Zone *zone) -{ - Ecore_X_Image *img; - Ecore_X_Window_Attributes att; - unsigned char *src; - unsigned int *dst; - int bpl = 0, rows = 0, bpp = 0; - Evas *evas, *evas2; - Evas_Object *o, *oa, *op, *ol; - Evas_Coord w, h; - Evas_Modifier_Mask mask; - E_Radio_Group *rg; - - sman = zone->container->manager; - scon = zone->container; - memset(&att, 0, sizeof(Ecore_X_Window_Attributes)); - ecore_x_window_attributes_get(sman->root, &att); - img = ecore_x_image_new(sman->w, sman->h, att.visual, att.depth); - ecore_x_image_get(img, sman->root, 0, 0, 0, 0, sman->w, sman->h); - src = ecore_x_image_data_get(img, &bpl, &rows, &bpp); - if (!ecore_x_image_is_argb32_get(img)) - { - dst = malloc(sman->w * sman->h * sizeof(int)); - ecore_x_image_to_argb_convert(src, bpp, bpl, att.colormap, att.visual, - 0, 0, sman->w, sman->h, - dst, (sman->w * sizeof(int)), 0, 0); - } - else - dst = (unsigned int *)src; - - if (win) e_object_del(E_OBJECT(win)); - win = e_win_new(e_container_current_get(e_manager_current_get())); - - evas = e_win_evas_get(win); - e_win_title_set(win, _("Where to put Screenshot...")); - e_win_delete_callback_set(win, _win_delete_cb); - e_win_resize_callback_set(win, _win_resize_cb); - e_win_dialog_set(win, 1); - e_win_centered_set(win, 1); - e_win_name_class_set(win, "E", "_shot_dialog"); - - o = edje_object_add(evas); - o_bg = o;; - e_theme_edje_object_set(o, "base/theme/dialog", "e/widgets/dialog/main"); - evas_object_move(o, 0, 0); - evas_object_show(o); - - o = e_widget_list_add(evas, 0, 0); - o_content = o; - e_widget_size_min_get(o, &w, &h); - edje_extern_object_min_size_set(o, w, h); - edje_object_part_swallow(o_bg, "e.swallow.content", o); - evas_object_show(o); - - w = sman->w / 4; - if (w < 220) w = 220; - h = (w * sman->h) / sman->w; - - o = e_widget_aspect_add(evas, w, h); - oa = o; - o = e_widget_preview_add(evas, w, h); - op = o; - - evas2 = e_widget_preview_evas_get(op); - - o = evas_object_image_filled_add(evas2); - o_img = o; - evas_object_image_colorspace_set(o, EVAS_COLORSPACE_ARGB8888); - evas_object_image_alpha_set(o, EINA_FALSE); - evas_object_image_size_set(o, sman->w, sman->h); - evas_object_image_data_copy_set(o, dst); - if (dst != (unsigned int *)src) free(dst); - ecore_x_image_free(img); - evas_object_image_data_update_add(o, 0, 0, sman->w, sman->h); - e_widget_preview_extern_object_set(op, o); - evas_object_show(o); - - evas_object_show(op); - evas_object_show(oa); - - e_widget_aspect_child_set(oa, op); - e_widget_list_object_append(o_content, oa, 0, 0, 0.5); - - o = e_widget_list_add(evas, 1, 1); - o_hlist = o; - - o = e_widget_framelist_add(evas, _("Quality"), 0); - ol = o; - - rg = e_widget_radio_group_new(&quality); - o = e_widget_radio_add(evas, _("Perfect"), 100, rg); - e_widget_framelist_object_append(ol, o); - o = e_widget_radio_add(evas, _("High"), 90, rg); - e_widget_framelist_object_append(ol, o); - o = e_widget_radio_add(evas, _("Medium"), 70, rg); - e_widget_framelist_object_append(ol, o); - o = e_widget_radio_add(evas, _("Low"), 50, rg); - e_widget_framelist_object_append(ol, o); - - e_widget_list_object_append(o_hlist, ol, 1, 0, 0.5); - - screen = -1; - if (eina_list_count(scon->zones) > 1) - { - Eina_List *l; - E_Zone *z; - int i; - - o = e_widget_framelist_add(evas, _("Screen"), 0); - ol = o; - - rg = e_widget_radio_group_new(&screen); - o = e_widget_radio_add(evas, _("All"), -1, rg); - o_radio_all = o; - evas_object_smart_callback_add(o, "changed", _screen_change_cb, NULL); - e_widget_framelist_object_append(ol, o); - i = 0; - EINA_LIST_FOREACH(scon->zones, l, z) - { - char buf[32]; - - if (z->num >= MAXZONES) continue; - snprintf(buf, sizeof(buf), "%i", z->num); - o = e_widget_radio_add(evas, buf, z->num, rg); - o_radio[z->num] = o; - evas_object_smart_callback_add(o, "changed", _screen_change_cb, NULL); - e_widget_framelist_object_append(ol, o); - - o = evas_object_rectangle_add(evas2); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, - _rect_down_cb, NULL); - o_rectdim[z->num] = o; - evas_object_color_set(o, 0, 0, 0, 0); - evas_object_show(o); - evas_object_geometry_get(o_img, NULL, NULL, &w, &h); - evas_object_move(o, - (z->x * w) / sman->w, - (z->y * h) / sman->h); - evas_object_resize(o, - (z->w * w) / sman->w, - (z->h * h) / sman->h); - i++; - } - - e_widget_list_object_append(o_hlist, ol, 1, 0, 0.5); - } - - e_widget_list_object_append(o_content, o_hlist, 0, 0, 0.5); - - o = o_content; - e_widget_size_min_get(o, &w, &h); - edje_extern_object_min_size_set(o, w, h); - edje_object_part_swallow(o_bg, "e.swallow.content", o); - evas_object_show(o); - - /////////////////////////////////////////////////////////////////////// - - o = e_widget_list_add(evas, 1, 1); - o_box = o; - e_widget_on_focus_hook_set(o, _on_focus_cb, NULL); - edje_object_part_swallow(o_bg, "e.swallow.buttons", o); - - o = e_widget_button_add(evas, _("Save"), NULL, _win_save_cb, win, NULL); - e_widget_list_object_append(o_box, o, 1, 0, 0.5); - o = e_widget_button_add(evas, _("Share"), NULL, _win_share_cb, win, NULL); - e_widget_list_object_append(o_box, o, 1, 0, 0.5); - o = e_widget_button_add(evas, _("Cancel"), NULL, _win_cancel_cb, win, NULL); - e_widget_list_object_append(o_box, o, 1, 0, 0.5); - - o = o_box; - e_widget_size_min_get(o, &w, &h); - edje_extern_object_min_size_set(o, w, h); - edje_object_part_swallow(o_bg, "e.swallow.buttons", o); - - o = evas_object_rectangle_add(evas); - o_event = o; - mask = 0; - if (!evas_object_key_grab(o, "Tab", mask, ~mask, 0)) printf("grab err\n"); - mask = evas_key_modifier_mask_get(evas, "Shift"); - if (!evas_object_key_grab(o, "Tab", mask, ~mask, 0)) printf("grab err\n"); - mask = 0; - if (!evas_object_key_grab(o, "Return", mask, ~mask, 0)) printf("grab err\n"); - mask = 0; - if (!evas_object_key_grab(o, "KP_Enter", mask, ~mask, 0)) printf("grab err\n"); - evas_object_event_callback_add(o, EVAS_CALLBACK_KEY_DOWN, _key_down_cb, NULL); - - edje_object_size_min_calc(o_bg, &w, &h); - evas_object_resize(o_bg, w, h); - e_win_resize(win, w, h); - e_win_size_min_set(win, w, h); - e_win_size_max_set(win, 99999, 99999); - e_win_show(win); - e_win_border_icon_set(win, "enlightenment/shot"); - - if (!e_widget_focus_get(o_bg)) e_widget_focus_set(o_box, 1); -} - -static Eina_Bool -_shot_delay(void *data) -{ - timer = NULL; - _shot_now(data); - return EINA_FALSE; -} - -static void -_shot(E_Zone *zone) -{ - if (timer) ecore_timer_del(timer); - timer = ecore_timer_add(1.0, _shot_delay, zone); -} - -static void -_e_mod_menu_cb(void *data __UNUSED__, E_Menu *m, E_Menu_Item *mi __UNUSED__) -{ - if (m->zone) _shot(m->zone); -} - -static void -_e_mod_action_cb(E_Object *obj, const char *params __UNUSED__) -{ - E_Zone *zone = NULL; - - if (obj) - { - if (obj->type == E_MANAGER_TYPE) - zone = e_util_zone_current_get((E_Manager *)obj); - else if (obj->type == E_CONTAINER_TYPE) - zone = e_util_zone_current_get(((E_Container *)obj)->manager); - else if (obj->type == E_ZONE_TYPE) - zone = ((E_Zone *)obj); - else - zone = e_util_zone_current_get(e_manager_current_get()); - } - if (!zone) zone = e_util_zone_current_get(e_manager_current_get()); - if (!zone) return; - if (timer) - { - ecore_timer_del(timer); - timer = NULL; - } - _shot_now(zone); -} - -static void -_e_mod_menu_add(void *data __UNUSED__, E_Menu *m) -{ - E_Menu_Item *mi; - - mi = e_menu_item_new(m); - e_menu_item_label_set(mi, _("Take Screenshot")); - e_util_menu_item_theme_icon_set(mi, "screenshot"); - e_menu_item_callback_set(mi, _e_mod_menu_cb, NULL); -} - -/* module setup */ -EAPI E_Module_Api e_modapi = -{ - E_MODULE_API_VERSION, - "Shot" -}; - -EAPI void * -e_modapi_init(E_Module *m) -{ - e_module_delayed_set(m, 1); - - shot_module = m; - act = e_action_add("shot"); - if (act) - { - act->func.go = _e_mod_action_cb; - e_action_predef_name_set(_("Screen"), _("Take Screenshot"), - "shot", NULL, NULL, 0); - } - maug = e_int_menus_menu_augmentation_add_sorted - ("main/2", _("Take Screenshot"), _e_mod_menu_add, NULL, NULL, NULL); - return m; -} - -EAPI int -e_modapi_shutdown(E_Module *m __UNUSED__) -{ - _share_done(); - if (win) - { - e_object_del(E_OBJECT(win)); - win = NULL; - } - if (timer) - { - ecore_timer_del(timer); - timer = NULL; - } - if (maug) - { - e_int_menus_menu_augmentation_del("main/2", maug); - maug = NULL; - } - if (act) - { - e_action_predef_name_del(_("Screen"), _("Take Screenshot")); - e_action_del("shot"); - act = NULL; - } - shot_module = NULL; - return 1; -} - -EAPI int -e_modapi_save(E_Module *m __UNUSED__) -{ - return 1; -} diff --git a/src/modules/shot/.svn/text-base/e_mod_main.h.svn-base b/src/modules/shot/.svn/text-base/e_mod_main.h.svn-base deleted file mode 100755 index 4adf2f1..0000000 --- a/src/modules/shot/.svn/text-base/e_mod_main.h.svn-base +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef E_MOD_MAIN_H -#define E_MOD_MAIN_H - -EAPI extern E_Module_Api e_modapi; - -EAPI void *e_modapi_init (E_Module *m); -EAPI int e_modapi_shutdown (E_Module *m); -EAPI int e_modapi_save (E_Module *m); - -#endif diff --git a/src/modules/shot/.svn/text-base/module.desktop.in.svn-base b/src/modules/shot/.svn/text-base/module.desktop.in.svn-base deleted file mode 100755 index d13feb9..0000000 --- a/src/modules/shot/.svn/text-base/module.desktop.in.svn-base +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Type=Link -Name=Shot -Name[fr]=Déclic -Name[ko]=스크린샷 -Icon=e-module-shot -X-Enlightenment-ModuleType=utils -Comment=Simple screenshot+save/upload module -Comment[fr]=Module pour faire des captures d'écran et les partager. -Comment[it]=Semplice modulo per il salvataggio e l'upload di istantanee del desktop. -Comment[ko]=간단한 스크린샷 저장/공유 모듈 diff --git a/src/modules/shot/e-module-shot.edj b/src/modules/shot/e-module-shot.edj Binary files differindex a507906..a507906 100755..100644 --- a/src/modules/shot/e-module-shot.edj +++ b/src/modules/shot/e-module-shot.edj diff --git a/src/modules/start/module.desktop.in b/src/modules/start/module.desktop.in index 6999579..6999579 100755..100644 --- a/src/modules/start/module.desktop.in +++ b/src/modules/start/module.desktop.in diff --git a/src/modules/syscon/module.desktop.in b/src/modules/syscon/module.desktop.in index ed2f342..ed2f342 100755..100644 --- a/src/modules/syscon/module.desktop.in +++ b/src/modules/syscon/module.desktop.in diff --git a/src/modules/systray/module.desktop.in b/src/modules/systray/module.desktop.in index 03d5451..03d5451 100755..100644 --- a/src/modules/systray/module.desktop.in +++ b/src/modules/systray/module.desktop.in diff --git a/src/modules/winlist/module.desktop.in b/src/modules/winlist/module.desktop.in index a1cb8c6..a1cb8c6 100755..100644 --- a/src/modules/winlist/module.desktop.in +++ b/src/modules/winlist/module.desktop.in |