From 9e8e755cdf37a22c1a1ab48e0abf21a1d8450563 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 11 Jan 2013 10:34:29 +0000 Subject: [PATCH] formatting: all at once SVN revision: 82625 --- src/bin/e_about.c | 52 +-- src/bin/e_acpi.c | 96 ++--- src/bin/e_actions.c | 32 +- src/bin/e_alert_main.c | 4 +- src/bin/e_atoms.c | 23 +- src/bin/e_backlight.c | 66 ++-- src/bin/e_backlight_main.c | 16 +- src/bin/e_bg.c | 5 +- src/bin/e_bindings.c | 90 +++-- src/bin/e_border.c | 292 +++++++------- src/bin/e_box.c | 8 +- src/bin/e_color.c | 32 +- src/bin/e_color_class.c | 68 ++-- src/bin/e_color_dialog.c | 9 +- src/bin/e_comp.c | 307 ++++++++------- src/bin/e_comp_cfdata.c | 3 +- src/bin/e_comp_update.c | 18 +- src/bin/e_comp_wl.c | 2 +- src/bin/e_comp_wl_comp.c | 4 +- src/bin/e_comp_wl_input.c | 24 +- src/bin/e_comp_wl_shell.c | 2 +- src/bin/e_comp_wl_surface.c | 3 +- src/bin/e_config.c | 331 ++++++++-------- src/bin/e_config_data.c | 5 +- src/bin/e_config_dialog.c | 4 +- src/bin/e_configure.c | 24 +- src/bin/e_configure_option.c | 352 +++++++++-------- src/bin/e_container.c | 4 +- src/bin/e_dbusmenu.c | 15 +- src/bin/e_desk.c | 22 +- src/bin/e_deskenv.c | 1 + src/bin/e_desklock.c | 59 +-- src/bin/e_dnd.c | 11 +- src/bin/e_dpms.c | 22 +- src/bin/e_entry.c | 260 ++++++------- src/bin/e_env.c | 4 +- src/bin/e_exec.c | 89 +++-- src/bin/e_filereg.c | 27 +- src/bin/e_fm.c | 261 +++++++------ src/bin/e_fm_cmdline.c | 13 +- src/bin/e_fm_device.c | 33 +- src/bin/e_fm_mime.c | 3 +- src/bin/e_fm_op.c | 71 ++-- src/bin/e_fm_prop.c | 4 +- src/bin/e_fm_shared_codec.c | 2 +- src/bin/e_fm_shared_device.c | 4 +- src/bin/e_gadcon.c | 83 ++-- src/bin/e_grab_dialog.c | 15 +- src/bin/e_grabinput.c | 9 +- src/bin/e_hints.c | 109 +++--- src/bin/e_icon.c | 12 +- src/bin/e_ilist.c | 51 +-- src/bin/e_imc_main.c | 214 +++++----- src/bin/e_import_config_dialog.c | 28 +- src/bin/e_import_dialog.c | 12 +- src/bin/e_int_border_locks.c | 1 - src/bin/e_int_border_menu.c | 2 +- src/bin/e_int_border_prop.c | 36 +- src/bin/e_int_border_remember.c | 11 +- src/bin/e_int_config_modules.c | 17 +- src/bin/e_int_gadcon_config.c | 63 +-- src/bin/e_int_menus.c | 15 +- src/bin/e_int_shelf_config.c | 39 +- src/bin/e_int_toolbar_config.c | 37 +- src/bin/e_intl.c | 1 + src/bin/e_intl_data.c | 22 +- src/bin/e_ipc.c | 124 +++--- src/bin/e_ipc_codec.c | 74 ++-- src/bin/e_layout.c | 177 ++++----- src/bin/e_log.c | 3 +- src/bin/e_main.c | 24 +- src/bin/e_manager.c | 4 +- src/bin/e_maximize.c | 260 +++++++------ src/bin/e_menu.c | 68 ++-- src/bin/e_module.c | 147 +++---- src/bin/e_mouse.c | 1 + src/bin/e_msg.c | 40 +- src/bin/e_msgbus.c | 117 +++--- src/bin/e_notification.c | 37 +- src/bin/e_obj_dialog.c | 27 +- src/bin/e_object.c | 209 +++++----- src/bin/e_open.c | 81 ++-- src/bin/e_pan.c | 1 + src/bin/e_place.c | 605 +++++++++++++++-------------- src/bin/e_pointer.c | 71 ++-- src/bin/e_prefix.c | 3 +- src/bin/e_randr.c | 6 +- src/bin/e_randr_11.c | 5 +- src/bin/e_randr_11_serialization.c | 17 +- src/bin/e_randr_12_ask_dialog.c | 25 +- src/bin/e_randr_12_crtc.c | 7 +- src/bin/e_randr_12_output.c | 26 +- src/bin/e_randr_12_serialization.c | 66 ++-- src/bin/e_randr_serialization.c | 23 +- src/bin/e_remember.c | 20 +- src/bin/e_scale.c | 17 +- src/bin/e_screensaver.c | 91 ++--- src/bin/e_scrollframe.c | 15 +- src/bin/e_sha1.c | 122 +++--- src/bin/e_shelf.c | 195 +++++----- src/bin/e_slidecore.c | 257 ++++++------ src/bin/e_slider.c | 246 ++++++------ src/bin/e_slidesel.c | 165 ++++---- src/bin/e_spectrum.c | 479 ++++++++++++----------- src/bin/e_start_main.c | 2 +- src/bin/e_static_grab.c | 324 +++++++-------- src/bin/e_stolen.c | 37 +- src/bin/e_sys.c | 40 +- src/bin/e_sys_main.c | 137 +++---- src/bin/e_test.c | 201 +++++----- src/bin/e_theme.c | 10 +- src/bin/e_theme_about.c | 7 +- src/bin/e_thumb_main.c | 18 +- src/bin/e_toolbar.c | 14 +- src/bin/e_update.c | 15 +- src/bin/e_user.c | 68 ++-- src/bin/e_utils.c | 53 ++- src/bin/e_widget_aspect.c | 19 +- src/bin/e_widget_button.c | 1 + src/bin/e_widget_check.c | 12 +- src/bin/e_widget_color_well.c | 55 +-- src/bin/e_widget_config_list.c | 91 ++--- src/bin/e_widget_csel.c | 14 +- src/bin/e_widget_cslider.c | 327 ++++++++-------- src/bin/e_widget_deskpreview.c | 16 +- src/bin/e_widget_entry.c | 46 +-- src/bin/e_widget_filepreview.c | 212 +++++----- src/bin/e_widget_flist.c | 1 + src/bin/e_widget_font_preview.c | 4 +- src/bin/e_widget_framelist.c | 28 +- src/bin/e_widget_fsel.c | 15 +- src/bin/e_widget_ilist.c | 6 +- src/bin/e_widget_image.c | 3 +- src/bin/e_widget_label.c | 11 +- src/bin/e_widget_list.c | 89 ++--- src/bin/e_widget_scrollframe.c | 1 + src/bin/e_widget_slider.c | 19 +- src/bin/e_widget_spectrum.c | 127 +++--- src/bin/e_widget_textblock.c | 82 ++-- src/bin/e_widget_toolbar.c | 123 +++--- src/bin/e_widget_toolbook.c | 3 +- src/bin/e_win.c | 97 ++--- src/bin/e_xinerama.c | 7 +- src/bin/e_xsettings.c | 127 +++--- src/bin/e_zone.c | 322 +++++++-------- 145 files changed, 5219 insertions(+), 4974 deletions(-) diff --git a/src/bin/e_about.c b/src/bin/e_about.c index 965b61a9d..741517ce4 100644 --- a/src/bin/e_about.c +++ b/src/bin/e_about.c @@ -32,32 +32,32 @@ e_about_new(E_Container *con) "To contact us please visit:
" "http://www.enlightenment.org
" "
" - ), - "All rights reserved.
" - "
" - "Redistribution and use in source and binary forms, with or without " - "modification, are permitted provided that the following conditions " - "are met:
" - "
" - "1. Redistributions of source code must retain the above copyright " - "notice, this list of conditions and the following disclaimer.
" - "2. Redistributions in binary form must reproduce the above copyright " - "notice, this list of conditions and the following disclaimer in the " - "documentation and/or other materials provided with the " - "distribution.
" - "
" - "THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR " - "IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED " - "WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE " - "ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR " - "CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, " - "SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT " - "LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF " - "USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED " - "AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT " - "LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN " - "ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE " - "POSSIBILITY OF SUCH DAMAGE.
" + ), + "All rights reserved.
" + "
" + "Redistribution and use in source and binary forms, with or without " + "modification, are permitted provided that the following conditions " + "are met:
" + "
" + "1. Redistributions of source code must retain the above copyright " + "notice, this list of conditions and the following disclaimer.
" + "2. Redistributions in binary form must reproduce the above copyright " + "notice, this list of conditions and the following disclaimer in the " + "documentation and/or other materials provided with the " + "distribution.
" + "
" + "THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR " + "IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED " + "WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE " + "ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR " + "CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, " + "SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT " + "LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF " + "USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED " + "AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT " + "LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN " + "ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE " + "POSSIBILITY OF SUCH DAMAGE.
" ); e_obj_dialog_obj_part_text_set(od, "e.textblock.about", buf); diff --git a/src/bin/e_acpi.c b/src/bin/e_acpi.c index d2b86f5ab..6e692613e 100644 --- a/src/bin/e_acpi.c +++ b/src/bin/e_acpi.c @@ -34,8 +34,8 @@ struct _E_ACPI_Device_Multiplexed /* local function prototypes */ static Eina_Bool _e_acpi_cb_server_del(void *data __UNUSED__, int type __UNUSED__, void *event); static Eina_Bool _e_acpi_cb_server_data(void *data __UNUSED__, int type __UNUSED__, void *event); -static void _e_acpi_cb_event_free(void *data __UNUSED__, void *event); -static int _e_acpi_lid_status_get(const char *device, const char *bus); +static void _e_acpi_cb_event_free(void *data __UNUSED__, void *event); +static int _e_acpi_lid_status_get(const char *device, const char *bus); static Eina_Bool _e_acpi_cb_event(void *data __UNUSED__, int type __UNUSED__, void *event); /* local variables */ @@ -47,48 +47,48 @@ static Eina_Strbuf *acpibuf = NULL; static E_ACPI_Device_Simple _devices_simple[] = { /* NB: DO NOT TRANSLATE THESE. */ - {"ac_adapter", E_ACPI_TYPE_AC_ADAPTER}, - {"battery", E_ACPI_TYPE_BATTERY}, - {"button/lid", E_ACPI_TYPE_LID}, + {"ac_adapter", E_ACPI_TYPE_AC_ADAPTER}, + {"battery", E_ACPI_TYPE_BATTERY}, + {"button/lid", E_ACPI_TYPE_LID}, {"button/power", E_ACPI_TYPE_POWER}, {"button/sleep", E_ACPI_TYPE_SLEEP}, - {"fan", E_ACPI_TYPE_FAN}, - {"processor", E_ACPI_TYPE_PROCESSOR}, + {"fan", E_ACPI_TYPE_FAN}, + {"processor", E_ACPI_TYPE_PROCESSOR}, {"thermal_zone", E_ACPI_TYPE_THERMAL}, - {"video", E_ACPI_TYPE_VIDEO}, + {"video", E_ACPI_TYPE_VIDEO}, - {NULL, E_ACPI_TYPE_UNKNOWN} + {NULL, E_ACPI_TYPE_UNKNOWN} }; static E_ACPI_Device_Multiplexed _devices_multiplexed[] = { /* NB: DO NOT TRANSLATE THESE. */ /* Sony VAIO - VPCF115FM / PCG-81114L - nvidia gfx */ - {"sony/hotkey", NULL, 0x10, E_ACPI_TYPE_BRIGHTNESS_DOWN}, - {"sony/hotkey", NULL, 0x11, E_ACPI_TYPE_BRIGHTNESS_UP}, - {"sony/hotkey", NULL, 0x12, E_ACPI_TYPE_VIDEO}, - {"sony/hotkey", NULL, 0x14, E_ACPI_TYPE_ZOOM_OUT}, - {"sony/hotkey", NULL, 0x15, E_ACPI_TYPE_ZOOM_IN}, - {"sony/hotkey", NULL, 0x17, E_ACPI_TYPE_HIBERNATE}, - {"sony/hotkey", NULL, 0xa6, E_ACPI_TYPE_ASSIST}, - {"sony/hotkey", NULL, 0x20, E_ACPI_TYPE_S1}, - {"sony/hotkey", NULL, 0xa5, E_ACPI_TYPE_VAIO}, + {"sony/hotkey", NULL, 0x10, E_ACPI_TYPE_BRIGHTNESS_DOWN}, + {"sony/hotkey", NULL, 0x11, E_ACPI_TYPE_BRIGHTNESS_UP}, + {"sony/hotkey", NULL, 0x12, E_ACPI_TYPE_VIDEO}, + {"sony/hotkey", NULL, 0x14, E_ACPI_TYPE_ZOOM_OUT}, + {"sony/hotkey", NULL, 0x15, E_ACPI_TYPE_ZOOM_IN}, + {"sony/hotkey", NULL, 0x17, E_ACPI_TYPE_HIBERNATE}, + {"sony/hotkey", NULL, 0xa6, E_ACPI_TYPE_ASSIST}, + {"sony/hotkey", NULL, 0x20, E_ACPI_TYPE_S1}, + {"sony/hotkey", NULL, 0xa5, E_ACPI_TYPE_VAIO}, /* Sony VAIO - X505 - intel gfx */ - {"sony/hotkey", NULL, 0x0e, E_ACPI_TYPE_MUTE}, - {"sony/hotkey", NULL, 0x0f, E_ACPI_TYPE_VOLUME}, - {"sony/hotkey", NULL, 0x10, E_ACPI_TYPE_BRIGHTNESS}, - {"sony/hotkey", NULL, 0x12, E_ACPI_TYPE_VIDEO}, + {"sony/hotkey", NULL, 0x0e, E_ACPI_TYPE_MUTE}, + {"sony/hotkey", NULL, 0x0f, E_ACPI_TYPE_VOLUME}, + {"sony/hotkey", NULL, 0x10, E_ACPI_TYPE_BRIGHTNESS}, + {"sony/hotkey", NULL, 0x12, E_ACPI_TYPE_VIDEO}, /* HP Compaq Presario - CQ61 - intel gfx */ /** interesting these get auto-mapped to keys in x11. here for documentation - ** but not enabled as we can use regular keybinds for these +** but not enabled as we can use regular keybinds for these {"video", "DD03", 0x87, E_ACPI_TYPE_BRIGHTNESS_DOWN}, {"video", "DD03", 0x86, E_ACPI_TYPE_BRIGHTNESS_UP}, {"video", "OVGA", 0x80, E_ACPI_TYPE_VIDEO}, - */ +*/ /* END */ - {NULL, NULL, 0x00, E_ACPI_TYPE_UNKNOWN} + {NULL, NULL, 0x00, E_ACPI_TYPE_UNKNOWN} }; /* public variables */ @@ -105,24 +105,24 @@ e_acpi_init(void) /* try to connect to acpid socket */ _e_acpid = ecore_con_server_connect(ECORE_CON_LOCAL_SYSTEM, - "/var/run/acpid.socket", -1, NULL); + "/var/run/acpid.socket", -1, NULL); if (!_e_acpid) return 1; /* setup handlers */ _e_acpid_hdls = - eina_list_append(_e_acpid_hdls, - ecore_event_handler_add(ECORE_CON_EVENT_SERVER_DEL, - _e_acpi_cb_server_del, NULL)); + eina_list_append(_e_acpid_hdls, + ecore_event_handler_add(ECORE_CON_EVENT_SERVER_DEL, + _e_acpi_cb_server_del, NULL)); _e_acpid_hdls = - eina_list_append(_e_acpid_hdls, - ecore_event_handler_add(ECORE_CON_EVENT_SERVER_DATA, - _e_acpi_cb_server_data, NULL)); + eina_list_append(_e_acpid_hdls, + ecore_event_handler_add(ECORE_CON_EVENT_SERVER_DATA, + _e_acpi_cb_server_data, NULL)); /* Add handlers for standard acpi events */ _e_acpid_hdls = - eina_list_append(_e_acpid_hdls, - ecore_event_handler_add(E_EVENT_ACPI, - _e_acpi_cb_event, NULL)); + eina_list_append(_e_acpid_hdls, + ecore_event_handler_add(E_EVENT_ACPI, + _e_acpi_cb_event, NULL)); return 1; } @@ -132,7 +132,8 @@ e_acpi_shutdown(void) Ecore_Event_Handler *hdl; /* cleanup event handlers */ - EINA_LIST_FREE(_e_acpid_hdls, hdl) ecore_event_handler_del(hdl); + EINA_LIST_FREE(_e_acpid_hdls, hdl) + ecore_event_handler_del(hdl); /* kill the server if existing */ if (_e_acpid) @@ -167,7 +168,8 @@ _e_acpi_cb_server_del(void *data __UNUSED__, int type __UNUSED__, void *event) if (ev->server != _e_acpid) return ECORE_CALLBACK_PASS_ON; /* cleanup event handlers */ - EINA_LIST_FREE(_e_acpid_hdls, hdl) ecore_event_handler_del(hdl); + EINA_LIST_FREE(_e_acpid_hdls, hdl) + ecore_event_handler_del(hdl); /* kill the server if existing */ if (_e_acpid) @@ -192,7 +194,7 @@ _e_acpi_cb_server_data(void *data __UNUSED__, int type __UNUSED__, void *event) if ((!ev->data) || (ev->size < 1)) return ECORE_CALLBACK_PASS_ON; /* write out actual acpi received data to stdout for debugging - res = fwrite(ev->data, ev->size, 1, stdout); + res = fwrite(ev->data, ev->size, 1, stdout); */ /* data from a server isnt a string - its not 0 byte terminated. it's just * a blob of data. copy to string and 0 byte terminate it so it can be @@ -232,8 +234,8 @@ _e_acpi_cb_server_data(void *data __UNUSED__, int type __UNUSED__, void *event) if ((!strcmp(device, _devices_multiplexed[i].name)) && // AND busname not set OR device name matches (!_devices_multiplexed[i].bus || - (_devices_multiplexed[i].bus && - (!strcmp(bus, _devices_multiplexed[i].bus)))) && + (_devices_multiplexed[i].bus && + (!strcmp(bus, _devices_multiplexed[i].bus)))) && // AND status matches (_devices_multiplexed[i].status == status)) { @@ -269,6 +271,7 @@ _e_acpi_cb_server_data(void *data __UNUSED__, int type __UNUSED__, void *event) acpi_event->status = _e_acpi_lid_status_get(device, bus); break; + default: break; } @@ -350,15 +353,19 @@ _e_acpi_lid_status_get(const char *device, const char *bus) /* parse out state file */ i = 0; - while (buff[i] != ':') i++; - while (!isalnum(buff[i])) i++; + while (buff[i] != ':') + i++; + while (!isalnum(buff[i])) + i++; ret = &(buff[i]); - while (isalnum(buff[i])) i++; + while (isalnum(buff[i])) + i++; buff[i] = 0; /* compare value from state file and return something sane */ if (!strcmp(ret, "open")) return E_ACPI_LID_OPEN; - else if (!strcmp(ret, "closed")) return E_ACPI_LID_CLOSED; + else if (!strcmp(ret, "closed")) + return E_ACPI_LID_CLOSED; else return E_ACPI_LID_UNKNOWN; } @@ -372,3 +379,4 @@ _e_acpi_cb_event(void *data __UNUSED__, int type __UNUSED__, void *event) e_bindings_acpi_event_handle(E_BINDING_CONTEXT_NONE, NULL, ev); return ECORE_CALLBACK_PASS_ON; } + diff --git a/src/bin/e_actions.c b/src/bin/e_actions.c index b090d06e1..fda4df28b 100644 --- a/src/bin/e_actions.c +++ b/src/bin/e_actions.c @@ -82,7 +82,7 @@ static void _e_actions_act_##act##_go_acpi(E_Object * obj __UNUSED__, const char *params use, E_Event_Acpi * ev __UNUSED__) /* local functions forward declarations (window_jump_to needs the definition of exec) */ -ACT_FN_GO(exec,); +ACT_FN_GO(exec, ); /* local subsystem functions */ static void _e_action_free(E_Action *act); @@ -1175,9 +1175,9 @@ window_jump_to(const char *params) * only if we don't have to warp the pointer anyway */ current_zone = e_util_zone_current_get(e_manager_current_get()); if (current_zone != bd->zone && e_config->focus_policy == E_FOCUS_CLICK) - ecore_x_pointer_warp(bd->zone->container->win, - bd->zone->x + (bd->zone->w / 2), - bd->zone->y + (bd->zone->h / 2)); + ecore_x_pointer_warp(bd->zone->container->win, + bd->zone->x + (bd->zone->w / 2), + bd->zone->y + (bd->zone->h / 2)); /* Change the virtual desktop if the window isn't on the current virtual desktop */ e_desk_show(bd->desk); @@ -1193,12 +1193,12 @@ window_jump_to(const char *params) return 0; } -ACT_FN_GO(window_jump_to,) +ACT_FN_GO(window_jump_to, ) { window_jump_to(params); } -ACT_FN_GO(window_jump_to_or_start,) +ACT_FN_GO(window_jump_to_or_start, ) { char *window_name, *start_name; if (!params) return; @@ -1967,7 +1967,7 @@ ACT_FN_GO_KEY(menu_show, , __UNUSED__) } /***************************************************************************/ -ACT_FN_GO(exec,) +ACT_FN_GO(exec, ) { E_Zone *zone; static double lock; @@ -2037,7 +2037,7 @@ ACT_FN_GO(app_new_instance, __UNUSED__) E_Zone *zone; zone = _e_actions_zone_get(obj); - if (!zone) + if (!zone) zone = e_util_zone_current_get(e_manager_current_get()); if (!obj) obj = E_OBJECT(e_border_focused_get()); @@ -2812,7 +2812,7 @@ _delayed_action_mouse_del(E_Object *obj, const char *params __UNUSED__, Ecore_Ev } // obj , params , ev -ACT_FN_GO_KEY(delayed_action, ,) +ACT_FN_GO_KEY(delayed_action, , ) { _delayed_action_key_add(obj, params, ev); } @@ -2889,7 +2889,7 @@ ACT_FN_GO(kbd_layout_prev, __UNUSED__) ACT_FN_GO(module_enable, ) { E_Module *m; - + if (!params) return; m = e_module_find(params); if (!m) @@ -2903,7 +2903,7 @@ ACT_FN_GO(module_enable, ) ACT_FN_GO(module_disable, ) { E_Module *m; - + if (!params) return; m = e_module_find(params); if (!m) return; @@ -2913,7 +2913,7 @@ ACT_FN_GO(module_disable, ) ACT_FN_GO(module_toggle, ) { E_Module *m; - + fprintf(stderr, "toggle\n"); if (!params) return; fprintf(stderr, "'%s'\n", params); @@ -3019,7 +3019,6 @@ e_actions_init(void) e_action_predef_name_set(N_("Window : State"), N_("Fullscreen Mode Enable"), "window_fullscreen", NULL, NULL, 0); - /* window_maximized_toggle */ ACT_GO(window_maximized_toggle); e_action_predef_name_set(N_("Window : State"), N_("Maximize"), @@ -3062,7 +3061,7 @@ e_actions_init(void) ACT_GO(window_shaded); e_action_predef_name_set(N_("Window : State"), N_("Set Shaded State"), - "window_shaded", NULL, _("syntax: \"(0|1) (up|down|left|right)\"") , 1); + "window_shaded", NULL, _("syntax: \"(0|1) (up|down|left|right)\""), 1); /* window_borderless_toggle */ ACT_GO(window_borderless_toggle); @@ -3228,8 +3227,6 @@ e_actions_init(void) e_action_predef_name_set(N_("Window : List"), N_("Jump to window... or start..."), "window_jump_to_or_start", NULL, "syntax: icccm_window_name application", 1); - - /* screen_send_to */ ACT_GO(screen_send_to); e_action_predef_name_set(N_("Screen"), N_("Send Mouse To Screen 0"), @@ -3392,7 +3389,7 @@ e_actions_init(void) e_action_predef_name_set(N_("Enlightenment : Module"), N_("Toggle the named module"), "module_toggle", NULL, NULL, 1); - + ACT_GO(logout); e_action_predef_name_set(N_("System"), N_("Log Out"), "logout", NULL, NULL, 0); @@ -3726,3 +3723,4 @@ _action_groups_sort_cb(const void *d1, const void *d2) if (!(g2 = d2)) return -1; return strcmp(g1->act_grp, g2->act_grp); } + diff --git a/src/bin/e_alert_main.c b/src/bin/e_alert_main.c index 12a26d9ad..1ce5a2b16 100644 --- a/src/bin/e_alert_main.c +++ b/src/bin/e_alert_main.c @@ -82,8 +82,8 @@ main(int argc, char **argv) pid = atoi(argv[i]); // E's pid else if (i == 3) backtrace_str = argv[i]; - else if (i == 4) - exit_gdb = atoi(argv[i]); + else if (i == 4) + exit_gdb = atoi(argv[i]); } fprintf(stderr, "exit_gdb: %i\n", exit_gdb); diff --git a/src/bin/e_atoms.c b/src/bin/e_atoms.c index 4e321cd58..889921d31 100644 --- a/src/bin/e_atoms.c +++ b/src/bin/e_atoms.c @@ -20,17 +20,17 @@ e_atoms_init(void) { const char *atom_names[] = { "__E_WINDOW_MANAGED", - "__E_WINDOW_CONTAINER", - "__E_WINDOW_ZONE", - "__E_WINDOW_DESK", - "__E_WINDOW_MAPPED", - "__E_WINDOW_SHADE_DIRECTION", - "__E_WINDOW_HIDDEN", - "__E_WINDOW_BORDER_SIZE", - "__E_ATOM_WINDOW_STATE", - "__E_ATOM_WINDOW_STATE_CENTERED", - "__E_ATOM_DESKTOP_FILE", - "E_ZONE_GEOMETRY" + "__E_WINDOW_CONTAINER", + "__E_WINDOW_ZONE", + "__E_WINDOW_DESK", + "__E_WINDOW_MAPPED", + "__E_WINDOW_SHADE_DIRECTION", + "__E_WINDOW_HIDDEN", + "__E_WINDOW_BORDER_SIZE", + "__E_ATOM_WINDOW_STATE", + "__E_ATOM_WINDOW_STATE_CENTERED", + "__E_ATOM_DESKTOP_FILE", + "E_ZONE_GEOMETRY" }; Ecore_X_Atom atoms[12]; @@ -56,3 +56,4 @@ e_atoms_shutdown(void) /* Nothing really to do here yet, just present for consistency right now */ return 1; } + diff --git a/src/bin/e_backlight.c b/src/bin/e_backlight.c index 9813ea428..21b98e641 100644 --- a/src/bin/e_backlight.c +++ b/src/bin/e_backlight.c @@ -26,8 +26,8 @@ static Ecore_Event_Handler *_e_backlight_handler_border_uniconify = NULL; static Ecore_Event_Handler *_e_backlight_handler_border_desk_set = NULL; static Ecore_Event_Handler *_e_backlight_handler_desk_show = NULL; -static void _e_backlight_update(E_Zone *zone); -static void _e_backlight_set(E_Zone *zone, double val); +static void _e_backlight_update(E_Zone *zone); +static void _e_backlight_set(E_Zone *zone, double val); static Eina_Bool _bl_anim(void *data, double pos); static Eina_Bool bl_avail = EINA_FALSE; static Eina_Bool _e_backlight_handler(void *d, int type, void *ev); @@ -39,10 +39,10 @@ static Ecore_Exe *bl_sys_set_exe = NULL; static Eina_Bool bl_sys_pending_set = EINA_FALSE; static Eina_Bool bl_sys_set_exe_ready = EINA_TRUE; -static void _bl_sys_find(void); -static void _bl_sys_level_get(void); +static void _bl_sys_find(void); +static void _bl_sys_level_get(void); static Eina_Bool _e_bl_cb_exit(void *data __UNUSED__, int type __UNUSED__, void *event); -static void _bl_sys_level_set(double val); +static void _bl_sys_level_set(double val); #endif EAPI int E_EVENT_BACKLIGHT_CHANGE = -1; @@ -59,28 +59,28 @@ e_backlight_init(void) bl_avail = EINA_TRUE; _e_backlight_handler_config_mode = ecore_event_handler_add - (E_EVENT_CONFIG_MODE_CHANGED, _e_backlight_handler, NULL); + (E_EVENT_CONFIG_MODE_CHANGED, _e_backlight_handler, NULL); _e_backlight_handler_border_fullscreen = ecore_event_handler_add - (E_EVENT_BORDER_FULLSCREEN, _e_backlight_handler, NULL); + (E_EVENT_BORDER_FULLSCREEN, _e_backlight_handler, NULL); _e_backlight_handler_border_unfullscreen = ecore_event_handler_add - (E_EVENT_BORDER_UNFULLSCREEN, _e_backlight_handler, NULL); + (E_EVENT_BORDER_UNFULLSCREEN, _e_backlight_handler, NULL); _e_backlight_handler_border_remove = ecore_event_handler_add - (E_EVENT_BORDER_REMOVE, _e_backlight_handler, NULL); + (E_EVENT_BORDER_REMOVE, _e_backlight_handler, NULL); _e_backlight_handler_border_iconify = ecore_event_handler_add - (E_EVENT_BORDER_ICONIFY, _e_backlight_handler, NULL); + (E_EVENT_BORDER_ICONIFY, _e_backlight_handler, NULL); _e_backlight_handler_border_uniconify = ecore_event_handler_add - (E_EVENT_BORDER_UNICONIFY, _e_backlight_handler, NULL); + (E_EVENT_BORDER_UNICONIFY, _e_backlight_handler, NULL); _e_backlight_handler_border_desk_set = ecore_event_handler_add - (E_EVENT_BORDER_DESK_SET, _e_backlight_handler, NULL); + (E_EVENT_BORDER_DESK_SET, _e_backlight_handler, NULL); _e_backlight_handler_desk_show = ecore_event_handler_add - (E_EVENT_DESK_SHOW, _e_backlight_handler, NULL); + (E_EVENT_DESK_SHOW, _e_backlight_handler, NULL); if (bl_avail) { @@ -101,14 +101,15 @@ EINTERN int e_backlight_shutdown(void) { const char *s; - + if (bl_anim) ecore_animator_del(bl_anim); bl_anim = NULL; if (e_config->backlight.mode != E_BACKLIGHT_MODE_NORMAL) e_backlight_level_set(NULL, e_config->backlight.normal, 0.0); - - EINA_LIST_FREE(bl_devs, s) eina_stringshare_del(s); + + EINA_LIST_FREE(bl_devs, s) + eina_stringshare_del(s); #ifdef HAVE_EEZE if (bl_sysval) eina_stringshare_del(bl_sysval); bl_sysval = NULL; @@ -206,16 +207,18 @@ e_backlight_level_set(E_Zone *zone, double val, double tim) // if tim == 0.0 - then do it instantnly, if time == -1 use some default // transition time if (val < 0.0) val = 0.0; - else if (val > 1.0) val = 1.0; + else if (val > 1.0) + val = 1.0; if ((val == bl_val) && (!bl_anim)) return; if (!zone) zone = e_util_zone_current_get(e_manager_current_get()); bl_now = bl_val; bl_val = val; // if (e_config->backlight.mode != E_BACKLIGHT_MODE_NORMAL) return; if (e_config->backlight.mode == E_BACKLIGHT_MODE_NORMAL) - tim = 0.5; + tim = 0.5; else - if (tim < 0.0) tim = e_config->backlight.transition; + if (tim < 0.0) + tim = e_config->backlight.transition; ecore_event_add(E_EVENT_BACKLIGHT_CHANGE, NULL, NULL, NULL); if (tim == 0.0) { @@ -225,7 +228,7 @@ e_backlight_level_set(E_Zone *zone, double val, double tim) bl_anim = NULL; } _e_backlight_set(zone, val); - return; + return; } if (bl_anim) ecore_animator_del(bl_anim); bl_anim = ecore_animator_timeline_add(tim, _bl_anim, zone); @@ -245,7 +248,7 @@ e_backlight_mode_set(E_Zone *zone, E_Backlight_Mode mode) // zone == NULL == everything if (e_config->backlight.mode == mode) return; e_config->backlight.mode = mode; - if (e_config->backlight.mode == E_BACKLIGHT_MODE_NORMAL) + if (e_config->backlight.mode == E_BACKLIGHT_MODE_NORMAL) { e_backlight_level_set(zone, e_config->backlight.normal, -1.0); } @@ -258,7 +261,7 @@ e_backlight_mode_set(E_Zone *zone, E_Backlight_Mode mode) e_backlight_level_set(zone, e_config->backlight.dim, -1.0); } else if (e_config->backlight.mode == E_BACKLIGHT_MODE_MAX) - e_backlight_level_set(zone, 1.0, -1.0); + e_backlight_level_set(zone, 1.0, -1.0); } EAPI E_Backlight_Mode @@ -299,8 +302,9 @@ _e_backlight_update(E_Zone *zone) char *name; const char *s; Eina_Bool gotten = EINA_FALSE; - - EINA_LIST_FREE(bl_devs, s) eina_stringshare_del(s); + + EINA_LIST_FREE(bl_devs, s) + eina_stringshare_del(s); for (i = 0; i < num; i++) { name = ecore_x_randr_output_name_get(root, out[i], NULL); @@ -390,7 +394,7 @@ _bl_anim(void *data, double pos) // FIXME: if zone is deleted while anim going... bad things. pos = ecore_animator_pos_map(pos, ECORE_POS_MAP_DECELERATE, 0.0, 0.0); - v = (bl_animval * (1.0 - pos)) + (bl_val *pos); + v = (bl_animval * (1.0 - pos)) + (bl_val * pos); _e_backlight_set(zone, v); if (pos >= 1.0) { @@ -470,7 +474,8 @@ _bl_sys_find(void) eina_stringshare_del(bl_sysval); bl_sysval = NULL; } - EINA_LIST_FREE(bl_devs, s) eina_stringshare_del(s); + EINA_LIST_FREE(bl_devs, s) + eina_stringshare_del(s); /* if configured backlight is there - use it, or if not use first */ EINA_LIST_FOREACH(pdevs, l, f) { @@ -504,7 +509,7 @@ _bl_sys_level_get(void) const char *str; if (bl_anim) return; - + str = eeze_udev_syspath_get_sysattr(bl_sysval, "max_brightness"); if (!str) return; @@ -528,7 +533,7 @@ _e_bl_cb_ext_delay(void *data __UNUSED__) if (bl_sys_pending_set) { bl_sys_pending_set = EINA_FALSE; - + _bl_sys_level_set(bl_delayval); } return EINA_FALSE; @@ -555,8 +560,8 @@ _bl_sys_level_set(double val) char buf[PATH_MAX]; if (!bl_sys_exit_handler) - bl_sys_exit_handler = ecore_event_handler_add(ECORE_EXE_EVENT_DEL, - _e_bl_cb_exit, NULL); + bl_sys_exit_handler = ecore_event_handler_add(ECORE_EXE_EVENT_DEL, + _e_bl_cb_exit, NULL); bl_delayval = val; if ((bl_sys_set_exe) || (!bl_sys_set_exe_ready)) { @@ -569,4 +574,5 @@ _bl_sys_level_set(double val) e_prefix_lib_get(), (int)(val * 1000.0), bl_sysval); bl_sys_set_exe = ecore_exe_run(buf, NULL); } + #endif diff --git a/src/bin/e_backlight_main.c b/src/bin/e_backlight_main.c index e6c83214a..4aadbab27 100644 --- a/src/bin/e_backlight_main.c +++ b/src/bin/e_backlight_main.c @@ -61,7 +61,7 @@ main(int argc, char **argv) } else exit(1); - + if (!dev) return -1; if (setuid(0) != 0) @@ -94,9 +94,9 @@ main(int argc, char **argv) } } } - + if (!devok) return -1; - + str = eeze_udev_syspath_get_sysattr(dev, "max_brightness"); if (str) { @@ -109,19 +109,21 @@ main(int argc, char **argv) eina_stringshare_del(str); } } - + if (maxlevel <= 0) maxlevel = 255; if (curlevel >= 0) { curlevel = ((maxlevel * level) + 500) / 1000; if (curlevel > maxlevel) curlevel = maxlevel; - else if (curlevel < 0) curlevel = 0; + else if (curlevel < 0) + curlevel = 0; snprintf(buf, sizeof(buf), "%s/brightness", f); return _bl_write_file(buf, curlevel); } - + EINA_LIST_FREE(devs, f) eina_stringshare_del(f); - + return -1; } + diff --git a/src/bin/e_bg.c b/src/bin/e_bg.c index e0ccf4ab4..fb758252b 100644 --- a/src/bin/e_bg.c +++ b/src/bin/e_bg.c @@ -4,7 +4,7 @@ static void _e_bg_signal(void *data, Evas_Object *obj, const char *emission, const char *source); static void _e_bg_event_bg_update_free(void *data, void *event); static void e_bg_handler_set(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *path); -static int e_bg_handler_test(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *path); +static int e_bg_handler_test(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *path); static void _e_bg_handler_image_imported(const char *image_path, void *data); /* local subsystem globals */ @@ -187,7 +187,7 @@ e_bg_file_get(int container_num, int zone_num, int desk_x, int desk_y) ok = 1; if (!ok) eina_stringshare_replace(&bgfile, e_theme_edje_file_get("base/theme/background", - "e/desktop/background")); + "e/desktop/background")); return bgfile; } @@ -538,7 +538,6 @@ _e_bg_event_bg_update_free(void *data __UNUSED__, void *event) static void _e_bg_handler_image_imported(const char *image_path, void *data __UNUSED__) { - e_bg_default_set(image_path); e_bg_update(); e_config_save_queue(); diff --git a/src/bin/e_bindings.c b/src/bin/e_bindings.c index 2634b40f6..77ac25f5e 100644 --- a/src/bin/e_bindings.c +++ b/src/bin/e_bindings.c @@ -1,18 +1,18 @@ #include "e.h" /* local subsystem functions */ -static Eina_Bool _e_bindings_mapping_change_event_cb(void *data, int type, void *event); +static Eina_Bool _e_bindings_mapping_change_event_cb(void *data, int type, void *event); -static void _e_bindings_mouse_free(E_Binding_Mouse *bind); -static void _e_bindings_key_free(E_Binding_Key *bind); -static void _e_bindings_edge_free(E_Binding_Edge *bind); -static void _e_bindings_signal_free(E_Binding_Signal *bind); -static void _e_bindings_wheel_free(E_Binding_Wheel *bind); -static void _e_bindings_acpi_free(E_Binding_Acpi *bind); -static int _e_bindings_context_match(E_Binding_Context bctxt, E_Binding_Context ctxt); +static void _e_bindings_mouse_free(E_Binding_Mouse *bind); +static void _e_bindings_key_free(E_Binding_Key *bind); +static void _e_bindings_edge_free(E_Binding_Edge *bind); +static void _e_bindings_signal_free(E_Binding_Signal *bind); +static void _e_bindings_wheel_free(E_Binding_Wheel *bind); +static void _e_bindings_acpi_free(E_Binding_Acpi *bind); +static int _e_bindings_context_match(E_Binding_Context bctxt, E_Binding_Context ctxt); static E_Binding_Modifier _e_bindings_modifiers(unsigned int modifiers); -static int _e_ecore_modifiers(E_Binding_Modifier modifiers); -static Eina_Bool _e_bindings_edge_cb_timer(void *data); +static int _e_ecore_modifiers(E_Binding_Modifier modifiers); +static Eina_Bool _e_bindings_edge_cb_timer(void *data); /* local subsystem globals */ @@ -50,7 +50,7 @@ e_bindings_init(void) Eina_List *l; mapping_handler = ecore_event_handler_add - (ECORE_X_EVENT_MAPPING_CHANGE, _e_bindings_mapping_change_event_cb, NULL); + (ECORE_X_EVENT_MAPPING_CHANGE, _e_bindings_mapping_change_event_cb, NULL); EINA_LIST_FOREACH(e_config->mouse_bindings, l, ebm) e_bindings_mouse_add(ebm->context, ebm->button, ebm->modifiers, @@ -107,10 +107,10 @@ e_bindings_shutdown(void) E_FREE_LIST(acpi_bindings, _e_bindings_acpi_free); if (mapping_handler) - { - ecore_event_handler_del(mapping_handler); - mapping_handler = NULL; - } + { + ecore_event_handler_del(mapping_handler); + mapping_handler = NULL; + } return 1; } @@ -175,9 +175,9 @@ e_bindings_edge_reset(void) { E_Config_Binding_Edge *ebe; Eina_List *l; - + E_FREE_LIST(edge_bindings, _e_bindings_edge_free); - + EINA_LIST_FOREACH(e_config->edge_bindings, l, ebe) e_bindings_edge_add(ebe->context, ebe->edge, ebe->modifiers, ebe->any_mod, ebe->action, ebe->params, ebe->delay); @@ -194,7 +194,6 @@ e_bindings_mouse_reset(void) EINA_LIST_FOREACH(e_config->mouse_bindings, l, ebm) e_bindings_mouse_add(ebm->context, ebm->button, ebm->modifiers, ebm->any_mod, ebm->action, ebm->params); - } EAPI void @@ -307,7 +306,7 @@ e_bindings_mouse_down_find(E_Binding_Context ctxt, E_Object *obj __UNUSED__, Eco mod = _e_bindings_modifiers(ev->modifiers); EINA_LIST_FOREACH(mouse_bindings, l, binding) { - if ((binding->button == (int) ev->buttons) && + if ((binding->button == (int)ev->buttons) && ((binding->any_mod) || (binding->mod == mod))) { if (_e_bindings_context_match(binding->ctxt, ctxt)) @@ -351,7 +350,7 @@ e_bindings_mouse_up_find(E_Binding_Context ctxt, E_Object *obj __UNUSED__, Ecore mod = _e_bindings_modifiers(ev->modifiers); EINA_LIST_FOREACH(mouse_bindings, l, binding) { - if ((binding->button == (int) ev->buttons) && + if ((binding->button == (int)ev->buttons) && ((binding->any_mod) || (binding->mod == mod))) { if (_e_bindings_context_match(binding->ctxt, ctxt)) @@ -634,7 +633,7 @@ e_bindings_edge_flippable_get(E_Zone_Edge edge) { if ((!strcmp(binding->action, "desk_flip_in_direction")) || (!strcmp(binding->action, "desk_flip_by"))) - return EINA_TRUE; + return EINA_TRUE; } } return EINA_FALSE; @@ -652,7 +651,7 @@ e_bindings_edge_non_flippable_get(E_Zone_Edge edge) { if ((!strcmp(binding->action, "desk_flip_in_direction")) || (!strcmp(binding->action, "desk_flip_by"))) - continue; + continue; return EINA_TRUE; } } @@ -740,16 +739,16 @@ e_bindings_edge_in_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Event_Z /* The original event will be freed before it can be * used again */ - ev2->zone = ev->zone; - ev2->edge = ev->edge; - ev2->x = ev->x; - ev2->y = ev->y; + ev2->zone = ev->zone; + ev2->edge = ev->edge; + ev2->x = ev->x; + ev2->y = ev->y; ed->bind = binding; - ed->obj = obj; - ed->act = act; - ed->ev = ev2; - binding->timer = ecore_timer_add(((double) binding->delay), _e_bindings_edge_cb_timer, ed); + ed->obj = obj; + ed->act = act; + ed->ev = ev2; + binding->timer = ecore_timer_add(((double)binding->delay), _e_bindings_edge_cb_timer, ed); } } } @@ -907,7 +906,7 @@ e_bindings_signal_del(E_Binding_Context ctxt, const char *sig, const char *src, } } -EAPI E_Action * +EAPI E_Action * e_bindings_signal_find(E_Binding_Context ctxt, E_Object *obj __UNUSED__, const char *sig, const char *src, E_Binding_Signal **bind_ret) { E_Binding_Modifier mod = 0; @@ -1013,12 +1012,14 @@ e_bindings_wheel_grab(E_Binding_Context ctxt, Ecore_X_Window win) if (binding->direction == 0) { if (binding->z < 0) button = 4; - else if (binding->z > 0) button = 5; + else if (binding->z > 0) + button = 5; } else if (binding->direction == 1) { if (binding->z < 0) button = 6; - else if (binding->z > 0) button = 7; + else if (binding->z > 0) + button = 7; } if (button != 0) ecore_x_window_button_grab(win, button, @@ -1043,12 +1044,14 @@ e_bindings_wheel_ungrab(E_Binding_Context ctxt, Ecore_X_Window win) if (binding->direction == 0) { if (binding->z < 0) button = 4; - else if (binding->z > 0) button = 5; + else if (binding->z > 0) + button = 5; } else if (binding->direction == 1) { if (binding->z < 0) button = 6; - else if (binding->z > 0) button = 7; + else if (binding->z > 0) + button = 7; } if (button != 0) ecore_x_window_button_ungrab(win, button, @@ -1200,12 +1203,12 @@ e_bindings_mapping_change_enable(Eina_Bool enable) static Eina_Bool _e_bindings_mapping_change_event_cb(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__) { - if (!_e_bindings_mapping_change_enabled) return ECORE_CALLBACK_RENEW; - e_managers_keys_ungrab(); - e_border_button_bindings_ungrab_all(); - e_border_button_bindings_grab_all(); - e_managers_keys_grab(); - return ECORE_CALLBACK_PASS_ON; + if (!_e_bindings_mapping_change_enabled) return ECORE_CALLBACK_RENEW; + e_managers_keys_ungrab(); + e_border_button_bindings_ungrab_all(); + e_border_button_bindings_grab_all(); + e_managers_keys_grab(); + return ECORE_CALLBACK_PASS_ON; } static void @@ -1299,7 +1302,7 @@ _e_bindings_modifiers(unsigned int modifiers) * may vary from system to system as different xservers may have differing * modifier masks for numlock (it is queried at startup). * - if (ev->modifiers & ECORE_X_LOCK_NUM) mod |= ECORE_X_LOCK_NUM; + if (ev->modifiers & ECORE_X_LOCK_NUM) mod |= ECORE_X_LOCK_NUM; */ return mod; @@ -1316,7 +1319,7 @@ _e_ecore_modifiers(E_Binding_Modifier modifiers) if (modifiers & E_BINDING_MODIFIER_WIN) mod |= ECORE_EVENT_MODIFIER_WIN; /* see comment in e_bindings on numlock if (modifiers & ECORE_X_LOCK_NUM) mod |= ECORE_X_LOCK_NUM; - */ + */ return mod; } @@ -1350,3 +1353,4 @@ _e_bindings_edge_cb_timer(void *data) return ECORE_CALLBACK_CANCEL; } + diff --git a/src/bin/e_border.c b/src/bin/e_border.c index 16622f279..a4f483fcd 100644 --- a/src/bin/e_border.c +++ b/src/bin/e_border.c @@ -130,7 +130,7 @@ static void _e_border_cb_drag_finished(E_Drag *drag, int dropped); #if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8) static Eina_Bool _e_border_cb_desk_window_profile_change(void *data, - int ev_type, + int ev_type, void *ev); #endif static void _e_border_eval(E_Border *bd); @@ -214,7 +214,7 @@ static void _e_border_shape_input_rectangle_set(E_Border *bd); static void _e_border_show(E_Border *bd); static void _e_border_hide(E_Border *bd); -static void _e_border_move_lost_window_to_center(E_Border *bd); +static void _e_border_move_lost_window_to_center(E_Border *bd); static void _e_border_reset_lost_window(E_Border *bd); static Eina_Bool _e_border_pointer_warp_to_center_timer(void *data); /* local subsystem globals */ @@ -272,10 +272,10 @@ EAPI int E_EVENT_BORDER_PROPERTY = 0; EAPI int E_EVENT_BORDER_FULLSCREEN = 0; EAPI int E_EVENT_BORDER_UNFULLSCREEN = 0; -#define GRAV_SET(bd, grav) \ - ecore_x_window_gravity_set(bd->bg_win, grav); \ - ecore_x_window_gravity_set(bd->client.shell_win, grav); \ - if (bd->client.lock_win) ecore_x_window_gravity_set(bd->client.lock_win, grav); \ +#define GRAV_SET(bd, grav) \ + ecore_x_window_gravity_set(bd->bg_win, grav); \ + ecore_x_window_gravity_set(bd->client.shell_win, grav); \ + if (bd->client.lock_win) ecore_x_window_gravity_set(bd->client.lock_win, grav); \ ecore_x_window_gravity_set(bd->client.win, grav); static Eina_List * @@ -1000,7 +1000,7 @@ e_border_desk_set(E_Border *bd, Eina_List *list = _e_border_sub_borders_new(bd); EINA_LIST_FREE(list, child) - e_border_desk_set(child, bd->desk); + e_border_desk_set(child, bd->desk); } e_remember_update(bd); } @@ -1091,16 +1091,18 @@ e_border_hide(E_Border *bd, switch (manage) { case 2: break; + case 3: bd->hidden = 1; + case 1: default: - if (!e_manager_comp_evas_get(bd->zone->container->manager)) - { - /* Make sure that this border isn't deleted */ - bd->await_hide_event++; - ecore_x_window_hide(bd->client.win); - } + if (!e_manager_comp_evas_get(bd->zone->container->manager)) + { + /* Make sure that this border isn't deleted */ + bd->await_hide_event++; + ecore_x_window_hide(bd->client.win); + } } } @@ -1785,7 +1787,7 @@ e_border_layer_set(E_Border *bd, */ e_config->transient.raise = 1; EINA_LIST_FREE(list, child) - e_border_layer_set(child, layer); + e_border_layer_set(child, layer); } e_border_raise(bd); if (layer == E_LAYER_BELOW) @@ -1814,39 +1816,39 @@ e_border_raise(E_Border *bd) Eina_List *list = _e_border_sub_borders_new(bd); EINA_LIST_REVERSE_FOREACH_SAFE(list, l, l_prev, child) - { - /* Don't stack iconic transients. If the user wants these shown, - * thats another option. - */ - if (!child->iconic) - { - if (last) - e_border_stack_below(child, last); - else - { - E_Border *above; + { + /* Don't stack iconic transients. If the user wants these shown, + * thats another option. + */ + if (!child->iconic) + { + if (last) + e_border_stack_below(child, last); + else + { + E_Border *above; - /* First raise the border to find out which border we will end up above */ - above = e_container_border_raise(child); + /* First raise the border to find out which border we will end up above */ + above = e_container_border_raise(child); - if (above) - { - /* We ended up above a border, now we must stack this border to - * generate the stacking event, and to check if this transient - * has other transients etc. - */ - e_border_stack_above(child, above); - } - else - { - /* If we didn't end up above any border, we are on the bottom! */ - e_border_lower(child); - } - } - last = child; - } - list = eina_list_remove_list(list, l); - } + if (above) + { + /* We ended up above a border, now we must stack this border to + * generate the stacking event, and to check if this transient + * has other transients etc. + */ + e_border_stack_above(child, above); + } + else + { + /* If we didn't end up above any border, we are on the bottom! */ + e_border_lower(child); + } + } + last = child; + } + list = eina_list_remove_list(list, l); + } } ev = E_NEW(E_Event_Border_Stack, 1); @@ -1903,39 +1905,39 @@ e_border_lower(E_Border *bd) Eina_List *list = _e_border_sub_borders_new(bd); EINA_LIST_REVERSE_FOREACH_SAFE(list, l, l_prev, child) - { - /* Don't stack iconic transients. If the user wants these shown, - * thats another option. - */ - if (!child->iconic) - { - if (last) - e_border_stack_below(child, last); - else - { - E_Border *below; + { + /* Don't stack iconic transients. If the user wants these shown, + * thats another option. + */ + if (!child->iconic) + { + if (last) + e_border_stack_below(child, last); + else + { + E_Border *below; - /* First lower the border to find out which border we will end up below */ - below = e_container_border_lower(child); + /* First lower the border to find out which border we will end up below */ + below = e_container_border_lower(child); - if (below) - { - /* We ended up below a border, now we must stack this border to - * generate the stacking event, and to check if this transient - * has other transients etc. - */ - e_border_stack_below(child, below); - } - else - { - /* If we didn't end up below any border, we are on top! */ - e_border_raise(child); - } - } - last = child; - } - list = eina_list_remove_list(list, l); - } + if (below) + { + /* We ended up below a border, now we must stack this border to + * generate the stacking event, and to check if this transient + * has other transients etc. + */ + e_border_stack_below(child, below); + } + else + { + /* If we didn't end up below any border, we are on top! */ + e_border_raise(child); + } + } + last = child; + } + list = eina_list_remove_list(list, l); + } } ev = E_NEW(E_Event_Border_Stack, 1); @@ -1993,20 +1995,20 @@ e_border_stack_above(E_Border *bd, Eina_List *list = _e_border_sub_borders_new(bd); EINA_LIST_REVERSE_FOREACH_SAFE(list, l, l_prev, child) - { - /* Don't stack iconic transients. If the user wants these shown, - * thats another option. - */ - if (!child->iconic) - { - if (last) - e_border_stack_below(child, last); - else - e_border_stack_above(child, above); - last = child; - } - list = eina_list_remove_list(list, l); - } + { + /* Don't stack iconic transients. If the user wants these shown, + * thats another option. + */ + if (!child->iconic) + { + if (last) + e_border_stack_below(child, last); + else + e_border_stack_above(child, above); + last = child; + } + list = eina_list_remove_list(list, l); + } } ev = E_NEW(E_Event_Border_Stack, 1); @@ -2051,20 +2053,20 @@ e_border_stack_below(E_Border *bd, Eina_List *list = _e_border_sub_borders_new(bd); EINA_LIST_REVERSE_FOREACH_SAFE(bd->transients, l, l_prev, child) - { - /* Don't stack iconic transients. If the user wants these shown, - * thats another option. - */ - if (!child->iconic) - { - if (last) - e_border_stack_below(child, last); - else - e_border_stack_below(child, below); - last = child; - } - list = eina_list_remove_list(list, l); - } + { + /* Don't stack iconic transients. If the user wants these shown, + * thats another option. + */ + if (!child->iconic) + { + if (last) + e_border_stack_below(child, last); + else + e_border_stack_below(child, below); + last = child; + } + list = eina_list_remove_list(list, l); + } } ev = E_NEW(E_Event_Border_Stack, 1); @@ -2744,7 +2746,7 @@ _e_border_maximize(E_Border *bd, E_Maximize max) _e_border_client_inset_calc(bd); } e_border_resize_limit(bd, &w, &h); - + if (bd->w < zw) w = bd->w; else @@ -3217,7 +3219,7 @@ e_border_iconify(E_Border *bd) Eina_List *list = _e_border_sub_borders_new(bd); EINA_LIST_FREE(list, child) - e_border_iconify(child); + e_border_iconify(child); } e_remember_update(bd); } @@ -3258,7 +3260,7 @@ e_border_uniconify(E_Border *bd) Eina_List *list = _e_border_sub_borders_new(bd); EINA_LIST_FREE(list, child) - e_border_uniconify(child); + e_border_uniconify(child); } e_remember_update(bd); } @@ -3541,14 +3543,14 @@ e_border_idler_before(void) bd->changes.visible = 0; } - if (bd->zone && (!bd->new_client) && - (!E_INSIDE(bd->x, bd->y, 0, 0, bd->zone->w - 5, bd->zone->h - 5)) && - (!E_INSIDE(bd->x, bd->y, 0 - bd->w + 5, 0 - bd->h + 5, bd->zone->w - 5, bd->zone->h - 5)) + if (bd->zone && (!bd->new_client) && + (!E_INSIDE(bd->x, bd->y, 0, 0, bd->zone->w - 5, bd->zone->h - 5)) && + (!E_INSIDE(bd->x, bd->y, 0 - bd->w + 5, 0 - bd->h + 5, bd->zone->w - 5, bd->zone->h - 5)) ) - { + { if (e_config->screen_limits != E_SCREEN_LIMITS_COMPLETELY) - _e_border_move_lost_window_to_center(bd); - } + _e_border_move_lost_window_to_center(bd); + } } e_container_border_list_free(bl); @@ -4389,30 +4391,30 @@ _e_border_zones_layout_calc(E_Border *bd, int *zx, int *zy, int *zw, int *zh) zone_right = e_container_zone_at_point_get(bd->zone->container, (x + w + 5), y); zone_above = e_container_zone_at_point_get(bd->zone->container, x, (y - h + 5)); zone_below = e_container_zone_at_point_get(bd->zone->container, x, (y + h + 5)); - + if (!(zone_above) && (y)) - zone_above = e_container_zone_at_point_get(bd->zone->container, x, (h - 5)); - - if (!(zone_left) &&(x)) - zone_left = e_container_zone_at_point_get(bd->zone->container, (x - 5), y); + zone_above = e_container_zone_at_point_get(bd->zone->container, x, (h - 5)); + + if (!(zone_left) && (x)) + zone_left = e_container_zone_at_point_get(bd->zone->container, (x - 5), y); if (zone_right) - w = zone_right->x + zone_right->w; + w = zone_right->x + zone_right->w; if (zone_left) - w = bd->zone->x + bd->zone->w; + w = bd->zone->x + bd->zone->w; if (zone_below) - h = zone_below->y + zone_below->h; + h = zone_below->y + zone_below->h; if (zone_above) - h = bd->zone->y + bd->zone->h; + h = bd->zone->y + bd->zone->h; if ((zone_left) && (zone_right)) - w = bd->zone->w + zone_right->x; + w = bd->zone->w + zone_right->x; if ((zone_above) && (zone_below)) - h = bd->zone->h + zone_below->y; + h = bd->zone->h + zone_below->y; if (x) x -= bd->zone->w; if (y) y -= bd->zone->h; @@ -4442,7 +4444,7 @@ _e_border_move_lost_window_to_center(E_Border *bd) { if (e_config->edge_flip_dragging) { - Eina_Bool lf, rf, tf, bf; + Eina_Bool lf, rf, tf, bf; lf = rf = tf = bf = EINA_TRUE; @@ -4459,7 +4461,7 @@ _e_border_move_lost_window_to_center(E_Border *bd) if (bd->zone->desk_y_current == 0) tf = EINA_FALSE; if (bd->zone->desk_y_current == (bd->zone->desk_y_count - 1)) bf = EINA_FALSE; } - + if (!(lf) && (bd->x <= loss_overlap) && !(bd->zone->flip.switching)) _e_border_reset_lost_window(bd); @@ -4470,11 +4472,11 @@ _e_border_move_lost_window_to_center(E_Border *bd) _e_border_reset_lost_window(bd); if (!(bf) && (bd->y >= (bd->zone->h - loss_overlap)) && !(bd->zone->flip.switching)) - _e_border_reset_lost_window(bd); - } - - if (!e_config->edge_flip_dragging) - _e_border_reset_lost_window(bd); + _e_border_reset_lost_window(bd); + } + + if (!e_config->edge_flip_dragging) + _e_border_reset_lost_window(bd); } } @@ -4484,7 +4486,7 @@ _e_border_reset_lost_window(E_Border *bd) int x, y, w, h; E_OBJECT_CHECK(bd); - if (bd->during_lost) return ; + if (bd->during_lost) return; bd->during_lost = EINA_TRUE; if (bd->iconic) e_border_uniconify(bd); @@ -6151,7 +6153,7 @@ _e_border_cb_window_focus_out(void *data __UNUSED__, static Eina_Bool _e_border_cb_client_message(void *data __UNUSED__, int ev_type __UNUSED__, - void *ev) + void *ev) { E_Border *bd; Ecore_X_Event_Client_Message *e; @@ -6199,6 +6201,7 @@ _e_border_cb_client_message(void *data __UNUSED__, return ECORE_CALLBACK_PASS_ON; } + #endif static Eina_Bool _e_border_cb_window_state_request(void *data __UNUSED__, @@ -6586,7 +6589,8 @@ _e_border_cb_mouse_in(void *data, if (!bd->iconic) e_focus_event_mouse_in(bd); } - else if (focus_locked) return ECORE_CALLBACK_RENEW; + else if (focus_locked) + return ECORE_CALLBACK_RENEW; #if 0 if ((ev->win != bd->win) && (ev->win != bd->event_win) && @@ -6880,7 +6884,7 @@ _e_border_stay_within_container(E_Border *bd, int x, int y, int *new_x, int *new new_y_max = zh - bd->h; lw = bd->w > zw ? EINA_TRUE : EINA_FALSE; lh = bd->h > zh ? EINA_TRUE : EINA_FALSE; - + if (lw) { if (x <= new_x_max) @@ -6960,12 +6964,12 @@ _e_border_cb_mouse_move(void *data, e_resist_container_border_position(bd->zone->container, skiplist, bd->x, bd->y, bd->w, bd->h, x, y, bd->w, bd->h, - &new_x, &new_y, &new_w, &new_h); + &new_x, &new_y, &new_w, &new_h); eina_list_free(skiplist); - + if (e_config->screen_limits == E_SCREEN_LIMITS_WITHIN) _e_border_stay_within_container(bd, x, y, &new_x, &new_y); - + bd->shelf_fix.x = 0; bd->shelf_fix.y = 0; bd->shelf_fix.modified = 0; @@ -7122,6 +7126,7 @@ _e_border_cb_desk_window_profile_change(void *data __UNUSED__, } return ECORE_CALLBACK_PASS_ON; } + #endif static Eina_Bool _e_border_post_move_resize_job(void *data) @@ -7220,7 +7225,7 @@ _e_border_eval0(E_Border *bd) #if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8) Eina_Bool need_desk_set = EINA_FALSE; #endif - + if (e_object_is_del(E_OBJECT(bd))) { CRI("_e_border_eval(%p) with deleted border!\n", bd); @@ -8250,7 +8255,7 @@ _e_border_eval0(E_Border *bd) else if ((bd->internal) && (bd->client.icccm.class) && (!strncmp(bd->client.icccm.class, "e_fwin", 6))) bordername = "internal_fileman"; -*/ + */ else bordername = e_config->theme_default_border_style; if (!bordername) bordername = "default"; @@ -8312,7 +8317,6 @@ _e_border_eval0(E_Border *bd) if (use_argb != bd->argb) _e_border_frame_replace(bd, use_argb); - if (bd->icon_object != o) { if (bd->bg_object) @@ -8564,11 +8568,11 @@ _e_border_eval(E_Border *bd) { if (((abs((bd->zone->container->w / 2) - bd->x) < 3) || //bd->x is center of container ((abs((bd->zone->container->w / 2) - bd->x - bd->w) < 3) || //bd->x - bd->w is center of container - (abs((bd->zone->container->w / 2) - bd->x - (bd->w / 2)) < 3))) || //bd->x - bd->w/2 is center of container + (abs((bd->zone->container->w / 2) - bd->x - (bd->w / 2)) < 3))) || //bd->x - bd->w/2 is center of container ((abs((bd->zone->container->h / 2) - bd->y) < 3) || //bd->y is center of container ((abs((bd->zone->container->h / 2) - bd->y - bd->h) < 3) || //bd->y - bd->h is center of container - (abs((bd->zone->container->h / 2) - bd->y - (bd->h / 2)) < 3))) //bd->y - bd->h/2 is center of container - ) + (abs((bd->zone->container->h / 2) - bd->y - (bd->h / 2)) < 3))) //bd->y - bd->h/2 is center of container + ) e_border_center(bd); else _e_border_move_internal(bd, bd->x, bd->y, 1); diff --git a/src/bin/e_box.c b/src/bin/e_box.c index e80c0f51d..1ed6383a5 100644 --- a/src/bin/e_box.c +++ b/src/bin/e_box.c @@ -12,8 +12,8 @@ struct _E_Smart_Data unsigned char changed : 1; unsigned char horizontal : 1; unsigned char homogenous : 1; - E_Box_Item *items; - unsigned int item_count; + E_Box_Item *items; + unsigned int item_count; struct { Evas_Coord w, h; @@ -40,7 +40,7 @@ struct _E_Box_Item { double x, y; } align; - int x, y, w, h; + int x, y, w, h; Evas_Object *obj; }; @@ -232,7 +232,7 @@ e_box_pack_before(Evas_Object *obj, Evas_Object *child, Evas_Object *before) l = eina_inlist_prepend_relative(l, EINA_INLIST_GET(bi), EINA_INLIST_GET(bi2)); sd->items = EINA_INLIST_CONTAINER_GET(l, E_Box_Item); sd->item_count++; - + for (l = EINA_INLIST_GET(bi)->prev; l; l = l->prev) i++; sd->changed = 1; diff --git a/src/bin/e_color.c b/src/bin/e_color.c index d616b7e6a..6f547972f 100644 --- a/src/bin/e_color.c +++ b/src/bin/e_color.c @@ -3,30 +3,30 @@ void e_color_update_rgb(E_Color *ec) { - if (!ec) return; - evas_color_rgb_to_hsv(ec->r, ec->g, ec->b, &(ec->h), &(ec->s), &(ec->v)); + if (!ec) return; + evas_color_rgb_to_hsv(ec->r, ec->g, ec->b, &(ec->h), &(ec->s), &(ec->v)); } void e_color_update_hsv(E_Color *ec) { - - if (!ec) return; - if (ec->v == 0) - ec->r = ec->g = ec->b = 0; - else - evas_color_hsv_to_rgb(ec->h, ec->s, ec->v, &(ec->r), &(ec->g), &(ec->b)); + if (!ec) return; + if (ec->v == 0) + ec->r = ec->g = ec->b = 0; + else + evas_color_hsv_to_rgb(ec->h, ec->s, ec->v, &(ec->r), &(ec->g), &(ec->b)); } void e_color_copy(const E_Color *from, E_Color *to) { - if (!from || !to) return; - to->r = from->r; - to->g = from->g; - to->b = from->b; - to->h = from->h; - to->s = from->s; - to->v = from->v; - to->a = from->a; + if (!from || !to) return; + to->r = from->r; + to->g = from->g; + to->b = from->b; + to->h = from->h; + to->s = from->s; + to->v = from->v; + to->a = from->a; } + diff --git a/src/bin/e_color_class.c b/src/bin/e_color_class.c index f209fa5dd..a5af91dbb 100644 --- a/src/bin/e_color_class.c +++ b/src/bin/e_color_class.c @@ -6,18 +6,17 @@ e_color_class_init(void) const Eina_List *l; const E_Color_Class *cc; - EINA_LIST_FOREACH(e_config->color_classes, l, cc) - { - if (!cc) continue; + EINA_LIST_FOREACH(e_config->color_classes, l, cc) + { + if (!cc) continue; - printf("INIT CC: %s, %d %d %d %d\n", cc->name, cc->r, cc->g, cc->b, cc->a); - edje_color_class_set(cc->name, - cc->r, cc->g, cc->b, cc->a, - cc->r2, cc->g2, cc->b2, cc->a2, - cc->r3, cc->g3, cc->b3, cc->a3); - - } - return 1; + printf("INIT CC: %s, %d %d %d %d\n", cc->name, cc->r, cc->g, cc->b, cc->a); + edje_color_class_set(cc->name, + cc->r, cc->g, cc->b, cc->a, + cc->r2, cc->g2, cc->b2, cc->a2, + cc->r3, cc->g3, cc->b3, cc->a3); + } + return 1; } EINTERN int @@ -77,32 +76,32 @@ e_color_class_instance_set(E_Color_Class *cc, int r, int g, int b, int a, int r2 if (a3 != -1) cc->a3 = E_CLAMP(a3, 0, 255); edje_color_class_set(cc->name, - cc->r, cc->g, cc->b, cc->a, - cc->r2, cc->g2, cc->b2, cc->a2, - cc->r3, cc->g3, cc->b3, cc->a3); + cc->r, cc->g, cc->b, cc->a, + cc->r2, cc->g2, cc->b2, cc->a2, + cc->r3, cc->g3, cc->b3, cc->a3); e_config_save_queue(); } EAPI E_Color_Class * e_color_class_set_stringshared(const char *color_class, int r, int g, int b, int a, int r2, int b2, int g2, int a2, int r3, int g3, int b3, int a3) { - E_Color_Class *cc = e_color_class_find_stringshared(color_class); - if (!cc) - { - cc = E_NEW(E_Color_Class, 1); - if (!cc) return NULL; - e_config->color_classes = eina_list_append(e_config->color_classes, cc); - cc->name = eina_stringshare_ref(color_class); - cc->r = cc->g = cc->b = cc->a = 255; - cc->r2 = cc->g2 = cc->b2 = cc->a2 = 255; - cc->r3 = cc->g3 = cc->b3 = cc->a3 = 255; - } + E_Color_Class *cc = e_color_class_find_stringshared(color_class); + if (!cc) + { + cc = E_NEW(E_Color_Class, 1); + if (!cc) return NULL; + e_config->color_classes = eina_list_append(e_config->color_classes, cc); + cc->name = eina_stringshare_ref(color_class); + cc->r = cc->g = cc->b = cc->a = 255; + cc->r2 = cc->g2 = cc->b2 = cc->a2 = 255; + cc->r3 = cc->g3 = cc->b3 = cc->a3 = 255; + } - e_color_class_instance_set(cc, - r, g, b, a, - r2, g2, b2, a2, - r3, g3, b3, a3); - return cc; + e_color_class_instance_set(cc, + r, g, b, a, + r2, g2, b2, a2, + r3, g3, b3, a3); + return cc; } EAPI E_Color_Class * @@ -112,9 +111,9 @@ e_color_class_set(const char *color_class, int r, int g, int b, int a, int r2, i color_class = eina_stringshare_add(color_class); cc = e_color_class_set_stringshared(color_class, - r, g, b, a, - r2, g2, b2, a2, - r3, g3, b3, a3); + r, g, b, a, + r2, g2, b2, a2, + r3, g3, b3, a3); eina_stringshare_del(color_class); return cc; @@ -159,5 +158,6 @@ e_color_class_del(const char *name) EAPI Eina_List * e_color_class_list(void) { - return e_config->color_classes; + return e_config->color_classes; } + diff --git a/src/bin/e_color_dialog.c b/src/bin/e_color_dialog.c index 2291465b2..a536c2a23 100644 --- a/src/bin/e_color_dialog.c +++ b/src/bin/e_color_dialog.c @@ -13,7 +13,7 @@ static void _e_color_dialog_cb_csel_change(void *data, Evas_Object *obj); * @param color color to initialize to (or NULL for black). * @param alpha_enabled if set, uses alpha and let user edit it. */ -E_Color_Dialog * +E_Color_Dialog * e_color_dialog_new(E_Container *con, const E_Color *color, Eina_Bool alpha_enabled) { E_Color_Dialog *dia; @@ -124,9 +124,9 @@ _e_color_dialog_free(E_Color_Dialog *dia) { if (dia->dia) { - e_object_del_attach_func_set(E_OBJECT(dia->dia), NULL); - e_object_del(E_OBJECT(dia->dia)); - dia->dia = NULL; + e_object_del_attach_func_set(E_OBJECT(dia->dia), NULL); + e_object_del(E_OBJECT(dia->dia)); + dia->dia = NULL; } E_FREE(dia->color); E_FREE(dia); @@ -143,3 +143,4 @@ _e_color_dialog_dia_del(void *obj) cdia->dia = NULL; e_object_del(E_OBJECT(cdia)); } + diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c index 0b8af9802..5f3a2f758 100644 --- a/src/bin/e_comp.c +++ b/src/bin/e_comp.c @@ -66,14 +66,14 @@ struct _E_Comp struct _E_Comp_Zone { - E_Zone *zone; // never deref - just use for handle cmp's - Evas_Object *base; - Evas_Object *over; - int container_num; - int zone_num; - int x, y, w, h; - double bl; - Eina_Bool bloff; + E_Zone *zone; // never deref - just use for handle cmp's + Evas_Object *base; + Evas_Object *over; + int container_num; + int zone_num; + int x, y, w, h; + double bl; + Eina_Bool bloff; }; struct _E_Comp_Win @@ -262,7 +262,7 @@ _e_comp_fullscreen_check(E_Comp *c) ((cw->x + cw->w) >= c->man->w) && ((cw->y + cw->h) >= c->man->h) && (!cw->argb) && (!cw->shaped) - ) + ) { return cw; } @@ -471,7 +471,7 @@ _e_comp_win_ready_timeout_setup(E_Comp_Win *cw) else { cw->ready_timeout = ecore_timer_add - (conf->first_draw_delay, _e_comp_cb_win_show_ready_timeout, cw); + (conf->first_draw_delay, _e_comp_cb_win_show_ready_timeout, cw); } } @@ -656,7 +656,7 @@ _e_comp_win_update(E_Comp_Win *cw) } } } - */ + */ ecore_x_pixmap_free(oldpm); } } @@ -836,10 +836,10 @@ _e_comp_win_update(E_Comp_Win *cw) int srcbpp = 0, srcbpl = 0; // why do we neeed these 2? this smells wrong srcpix = ecore_x_image_data_get - (cw->xim, &srcbpl, NULL, &srcbpp); - ecore_x_image_to_argb_convert(srcpix, + (cw->xim, &srcbpl, NULL, &srcbpp); + ecore_x_image_to_argb_convert(srcpix, srcbpp, - srcbpl, + srcbpl, cw->cmap, cw->vis, x, y, w, h, @@ -878,7 +878,7 @@ _e_comp_win_update(E_Comp_Win *cw) } // FIXME: below cw update check screws with show if (/*(!cw->update) &&*/ (cw->visible) && (cw->dmg_updates >= 1) && - (cw->show_ready) && (!cw->bd || cw->bd->visible)) + (cw->show_ready) && (!cw->bd || cw->bd->visible)) { if (!evas_object_visible_get(cw->shobj)) { @@ -900,8 +900,8 @@ _e_comp_win_update(E_Comp_Win *cw) cw->pending_count++; e_manager_comp_event_src_visibility_send - (cw->c->man, (E_Manager_Comp_Source *)cw, - _e_comp_cb_pending_after, cw->c); + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_comp_cb_pending_after, cw->c); cw->show_anim = EINA_TRUE; } @@ -1039,7 +1039,7 @@ _e_comp_win_adopt(E_Comp_Win *cw) if (!cw->damage) { cw->damage = ecore_x_damage_new - (cw->win, ECORE_X_DAMAGE_REPORT_DELTA_RECTANGLES); + (cw->win, ECORE_X_DAMAGE_REPORT_DELTA_RECTANGLES); eina_hash_add(damages, e_util_winid_str_get(cw->damage), cw); } if (!cw->update) @@ -1081,7 +1081,7 @@ _e_comp_cb_nocomp_begin(E_Comp *c) _e_comp_win_release(cw); ecore_x_composite_unredirect_subwindows - (c->man->root, ECORE_X_COMPOSITE_UPDATE_MANUAL); + (c->man->root, ECORE_X_COMPOSITE_UPDATE_MANUAL); c->nocomp = 1; c->render_overflow = OVER_FLOW; ecore_x_window_hide(c->win); @@ -1128,7 +1128,7 @@ _e_comp_cb_nocomp_end(E_Comp *c) if (!c->nocomp) return; ecore_x_composite_redirect_subwindows - (c->man->root, ECORE_X_COMPOSITE_UPDATE_MANUAL); + (c->man->root, ECORE_X_COMPOSITE_UPDATE_MANUAL); fprintf(stderr, "COMP!\n"); c->nocomp = 0; @@ -1164,8 +1164,8 @@ _e_comp_cb_nocomp_end(E_Comp *c) if (!cw->hidden_override) _e_comp_child_show(cw); cw->pending_count++; e_manager_comp_event_src_visibility_send - (cw->c->man, (E_Manager_Comp_Source *)cw, - _e_comp_cb_pending_after, cw->c); + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_comp_cb_pending_after, cw->c); // no need for effect } if (cw->counter) @@ -1270,24 +1270,24 @@ _e_comp_cb_update(E_Comp *c) switch (conf->fps_corner) { case 3: // bottom-right - x = z->x + z->w - w; - y = z->y + z->h - h; - break; + x = z->x + z->w - w; + y = z->y + z->h - h; + break; case 2: // bottom-left - x = z->x; - y = z->y + z->h - h; - break; + x = z->x; + y = z->y + z->h - h; + break; case 1: // top-right - x = z->x + z->w - w; - y = z->y; - break; + x = z->x + z->w - w; + y = z->y; + break; default: // 0 // top-left - x = z->x; - y = z->y; - break; + x = z->x; + y = z->y; + break; } } evas_object_move(c->fps_bg, x, y); @@ -1319,7 +1319,7 @@ _e_comp_cb_update(E_Comp *c) DBG("JOB1...\n"); if (c->new_up_timer) ecore_timer_del(c->new_up_timer); c->new_up_timer = - ecore_timer_add(0.001, _e_comp_cb_delayed_update_timer, c); + ecore_timer_add(0.001, _e_comp_cb_delayed_update_timer, c); // _e_comp_render_queue(c); } c->updates = new_updates; @@ -1347,7 +1347,7 @@ _e_comp_cb_update(E_Comp *c) } t0 = t; } - */ + */ nocomp: cw = _e_comp_fullscreen_check(c); if (cw) @@ -1358,7 +1358,7 @@ nocomp: { if (!c->nocomp_delay_timer) c->nocomp_delay_timer = ecore_timer_add - (1.0, _e_comp_cb_nocomp_begin_timeout, c); + (1.0, _e_comp_cb_nocomp_begin_timeout, c); } } } @@ -1994,7 +1994,7 @@ _e_comp_win_add(E_Comp *c, int num; cw->damage = ecore_x_damage_new - (cw->win, ECORE_X_DAMAGE_REPORT_DELTA_RECTANGLES); + (cw->win, ECORE_X_DAMAGE_REPORT_DELTA_RECTANGLES); eina_hash_add(damages, e_util_winid_str_get(cw->damage), cw); cw->shobj = edje_object_add(c->evas); cw->obj = evas_object_image_filled_add(c->evas); @@ -2042,8 +2042,8 @@ _e_comp_win_add(E_Comp *c, cw->pending_count++; e_manager_comp_event_src_add_send - (cw->c->man, (E_Manager_Comp_Source *)cw, - _e_comp_cb_pending_after, cw->c); + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_comp_cb_pending_after, cw->c); } else { @@ -2064,7 +2064,7 @@ _e_comp_win_add(E_Comp *c, e_comp_update_tile_size_set(cw->up, 32, 32); // for software: e_comp_update_policy_set - (cw->up, E_UPDATE_POLICY_HALF_WIDTH_OR_MORE_ROUND_UP_TO_FULL_WIDTH); + (cw->up, E_UPDATE_POLICY_HALF_WIDTH_OR_MORE_ROUND_UP_TO_FULL_WIDTH); if (((!cw->input_only) && (!cw->invalid)) && (cw->override)) { cw->redirected = 1; @@ -2092,8 +2092,8 @@ _e_comp_win_del(E_Comp_Win *cw) { cw->pending_count++; e_manager_comp_event_src_del_send - (cw->c->man, (E_Manager_Comp_Source *)cw, - _e_comp_cb_pending_after, cw->c); + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_comp_cb_pending_after, cw->c); } e_comp_update_free(cw->up); @@ -2297,8 +2297,8 @@ _e_comp_win_show(E_Comp_Win *cw) cw->pending_count++; e_manager_comp_event_src_visibility_send - (cw->c->man, (E_Manager_Comp_Source *)cw, - _e_comp_cb_pending_after, cw->c); + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_comp_cb_pending_after, cw->c); } _e_comp_win_render_queue(cw); } @@ -2338,8 +2338,8 @@ _e_comp_win_hide(E_Comp_Win *cw) cw->pending_count++; e_manager_comp_event_src_visibility_send - (cw->c->man, (E_Manager_Comp_Source *)cw, - _e_comp_cb_pending_after, cw->c); + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_comp_cb_pending_after, cw->c); return; } cw->defer_hide = 0; @@ -2436,8 +2436,8 @@ _e_comp_win_raise_above(E_Comp_Win *cw, _e_comp_win_render_queue(cw); cw->pending_count++; e_manager_comp_event_src_config_send - (cw->c->man, (E_Manager_Comp_Source *)cw, - _e_comp_cb_pending_after, cw->c); + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_comp_cb_pending_after, cw->c); } static void @@ -2451,8 +2451,8 @@ _e_comp_win_raise(E_Comp_Win *cw) _e_comp_win_render_queue(cw); cw->pending_count++; e_manager_comp_event_src_config_send - (cw->c->man, (E_Manager_Comp_Source *)cw, - _e_comp_cb_pending_after, cw->c); + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_comp_cb_pending_after, cw->c); } static void @@ -2466,8 +2466,8 @@ _e_comp_win_lower(E_Comp_Win *cw) _e_comp_win_render_queue(cw); cw->pending_count++; e_manager_comp_event_src_config_send - (cw->c->man, (E_Manager_Comp_Source *)cw, - _e_comp_cb_pending_after, cw->c); + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_comp_cb_pending_after, cw->c); } static void @@ -2612,7 +2612,7 @@ _e_comp_win_damage(E_Comp_Win *cw, { if (!cw->update_timeout) cw->update_timeout = ecore_timer_add - (ecore_animator_frametime_get() * 2, + (ecore_animator_frametime_get() * 2, _e_comp_win_damage_timeout, cw); return; } @@ -2687,24 +2687,24 @@ _e_comp_show(void *data __UNUSED__, /* Vincent Torri via lists.sourceforge.net -2:31 PM (8 minutes ago) + 2:31 PM (8 minutes ago) -to enlightenment-devel. -would it be possible to add a note in the code, about the reason of -that change ? + to enlightenment-devel. + would it be possible to add a note in the code, about the reason of + that change ? -Vincent + Vincent -On Thu, Jun 21, 2012 at 3:29 PM, Enlightenment SVN - wrote: -> Log: -> gtk developers with IQs over 180 enjoy hiding and showing their windows constantly, -> especially when resizing. this broke e's comp since we are not nearly that clever -> and try to defer hide animations in most cases. undoing the defer whenever -> this happens allows us to keep up with their towering genius. -> fixes ticket #765 and probably some others. -> affected apps: claws-mail, firefox -*/ + On Thu, Jun 21, 2012 at 3:29 PM, Enlightenment SVN + wrote: + > Log: + > gtk developers with IQs over 180 enjoy hiding and showing their windows constantly, + > especially when resizing. this broke e's comp since we are not nearly that clever + > and try to defer hide animations in most cases. undoing the defer whenever + > this happens allows us to keep up with their towering genius. + > fixes ticket #765 and probably some others. + > affected apps: claws-mail, firefox + */ if (cw->defer_hide) { /* @@ -2873,11 +2873,11 @@ _e_comp_message(void *data __UNUSED__, if ((cw->bd->shading) || (cw->bd->shaded)) force = 1; clw = cw->hidden.w - - cw->bd->client_inset.l - - cw->bd->client_inset.r; + cw->bd->client_inset.l - + cw->bd->client_inset.r; clh = cw->hidden.h - - cw->bd->client_inset.t - - cw->bd->client_inset.b; + cw->bd->client_inset.t - + cw->bd->client_inset.b; DBG(" [0x%x] sync draw done @%4ix%4i, bd %4ix%4i\n", cw->win, w, h, cw->bd->client.w, cw->bd->client.h); if ((w != clw) || (h != clh)) @@ -2909,40 +2909,40 @@ _e_comp_message(void *data __UNUSED__, } DBG(" [0x%x] sync draw done %4ix%4i\n", cw->win, cw->w, cw->h); // if (cw->bd) - { - if (cw->counter) - { - DBG(" [0x%x] have counter\n", cw->win); - cw->show_ready = 1; - if (!cw->update) - { - DBG(" [0x%x] set update\n", cw->win); - if (cw->update_timeout) - { - DBG(" [0x%x] del timeout\n", cw->win); - ecore_timer_del(cw->update_timeout); - cw->update_timeout = NULL; - } - cw->update = 1; - cw->c->updates = eina_list_append(cw->c->updates, cw); - } - if ((cw->w != cw->hidden.w) || - (cw->h != cw->hidden.h) || - (force)) - { - DBG(" [0x%x] rsz done msg %4ix%4i\n", cw->win, cw->hidden.w, cw->hidden.h); - cw->w = cw->hidden.w; - cw->h = cw->hidden.h; - cw->needpix = 1; - // was cw->w / cw->h - // evas_object_resize(cw->shobj, cw->pw, cw->ph); - _e_comp_win_geometry_update(cw); - _e_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0); - } - cw->drawme = 1; - _e_comp_win_render_queue(cw); - } - } + { + if (cw->counter) + { + DBG(" [0x%x] have counter\n", cw->win); + cw->show_ready = 1; + if (!cw->update) + { + DBG(" [0x%x] set update\n", cw->win); + if (cw->update_timeout) + { + DBG(" [0x%x] del timeout\n", cw->win); + ecore_timer_del(cw->update_timeout); + cw->update_timeout = NULL; + } + cw->update = 1; + cw->c->updates = eina_list_append(cw->c->updates, cw); + } + if ((cw->w != cw->hidden.w) || + (cw->h != cw->hidden.h) || + (force)) + { + DBG(" [0x%x] rsz done msg %4ix%4i\n", cw->win, cw->hidden.w, cw->hidden.h); + cw->w = cw->hidden.w; + cw->h = cw->hidden.h; + cw->needpix = 1; + // was cw->w / cw->h + // evas_object_resize(cw->shobj, cw->pw, cw->ph); + _e_comp_win_geometry_update(cw); + _e_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0); + } + cw->drawme = 1; + _e_comp_win_render_queue(cw); + } + } return ECORE_CALLBACK_PASS_ON; } @@ -3019,7 +3019,7 @@ _e_comp_override_timed_pop(E_Comp *c) if (c->nocomp_override_timer) ecore_timer_del(c->nocomp_override_timer); c->nocomp_override_timer = - ecore_timer_add(5.0, _e_comp_override_expire, c); + ecore_timer_add(5.0, _e_comp_override_expire, c); } /* here for completeness @@ -3033,7 +3033,7 @@ _e_comp_override_timed_pop(E_Comp *c) if (c->nocomp_want) _e_comp_cb_nocomp_begin(c); } } - */ + */ static void _e_comp_override_push(E_Comp *c) @@ -3088,9 +3088,9 @@ _e_comp_screensaver_on(void *data __UNUSED__, { _e_comp_override_push(c); _e_comp_fade_handle(cz, 1, 3.0); - edje_object_signal_emit(cz->base, + edje_object_signal_emit(cz->base, "e,state,screensaver,on", "e"); - edje_object_signal_emit(cz->over, + edje_object_signal_emit(cz->over, "e,state,screensaver,on", "e"); } } @@ -3115,9 +3115,9 @@ _e_comp_screensaver_off(void *data __UNUSED__, c->saver = EINA_FALSE; EINA_LIST_FOREACH(c->zones, ll, cz) { - edje_object_signal_emit(cz->base, + edje_object_signal_emit(cz->base, "e,state,screensaver,off", "e"); - edje_object_signal_emit(cz->over, + edje_object_signal_emit(cz->over, "e,state,screensaver,off", "e"); _e_comp_fade_handle(cz, 0, 0.5); _e_comp_override_timed_pop(c); @@ -3140,7 +3140,7 @@ _e_comp_zone_fill(E_Comp *c, E_Comp_Zone *cz) if (cz->over) { e_theme_edje_object_set(cz->over, "base/theme/modules/comp", - styles[conf->disable_screen_effects]); + styles[conf->disable_screen_effects]); return; } cz->base = o = edje_object_add(c->evas); @@ -3469,7 +3469,8 @@ _e_comp_fps_toggle(void) conf->fps_show = 1; e_config_save_queue(); } - EINA_LIST_FOREACH(compositors, l, c) _e_comp_cb_update(c); + EINA_LIST_FOREACH(compositors, l, c) + _e_comp_cb_update(c); } static Eina_Bool @@ -3480,9 +3481,9 @@ _e_comp_key_down(void *data __UNUSED__, Ecore_Event_Key *ev = event; if ((!strcasecmp(ev->keyname, "f")) && - (ev->modifiers & ECORE_EVENT_MODIFIER_SHIFT) && - (ev->modifiers & ECORE_EVENT_MODIFIER_CTRL) && - (ev->modifiers & ECORE_EVENT_MODIFIER_ALT)) + (ev->modifiers & ECORE_EVENT_MODIFIER_SHIFT) && + (ev->modifiers & ECORE_EVENT_MODIFIER_CTRL) && + (ev->modifiers & ECORE_EVENT_MODIFIER_ALT)) { _e_comp_fps_toggle(); } @@ -3691,9 +3692,9 @@ _e_comp_add(E_Manager *man) if (res) { e_util_dialog_internal - (_("Compositor Error"), - _("Another compositor is already running
" - "on your display server.")); + (_("Compositor Error"), + _("Another compositor is already running
" + "on your display server.")); free(c); return NULL; } @@ -3713,10 +3714,10 @@ _e_comp_add(E_Manager *man) if (!c->win) { e_util_dialog_internal - (_("Compositor Error"), - _("Your display server does not support the
" - "compositor overlay window. This is needed
" - "for it to function.")); + (_("Compositor Error"), + _("Your display server does not support the
" + "compositor overlay window. This is needed
" + "for it to function.")); free(c); return NULL; } @@ -3726,7 +3727,7 @@ _e_comp_add(E_Manager *man) if ((att.depth != 24) && (att.depth != 32)) { - /* + /* e_util_dialog_internal (_("Compositor Error"), _("Your screen is not in 24/32bit display mode.
" @@ -3735,7 +3736,7 @@ _e_comp_add(E_Manager *man) ecore_x_composite_render_window_disable(c->win); free(c); return NULL; - */ + */ } if (c->man->num == 0) e_alert_composite_win(c->man->root, c->win); @@ -3767,12 +3768,12 @@ _e_comp_add(E_Manager *man) opt[opt_i] = conf->swap_mode; opt_i++; } -#endif +#endif if (opt_i > 0) { opt[opt_i] = ECORE_EVAS_GL_X11_OPT_NONE; c->ee = ecore_evas_gl_x11_options_new - (NULL, c->win, 0, 0, man->w, man->h, opt); + (NULL, c->win, 0, 0, man->w, man->h, opt); } if (!c->ee) c->ee = ecore_evas_gl_x11_new(NULL, c->win, 0, 0, man->w, man->h); @@ -3780,7 +3781,7 @@ _e_comp_add(E_Manager *man) { c->gl = 1; ecore_evas_gl_x11_pre_post_swap_callback_set - (c->ee, c, _e_comp_pre_swap, NULL); + (c->ee, c, _e_comp_pre_swap, NULL); } } if (!c->ee) @@ -3788,10 +3789,10 @@ _e_comp_add(E_Manager *man) if (conf->engine == E_COMP_ENGINE_GL) { e_util_dialog_internal - (_("Compositor Warning"), - _("Your display driver does not support OpenGL, or
" - "no OpenGL engines were compiled or installed for
" - "Evas or Ecore-Evas. Falling back to software engine.")); + (_("Compositor Warning"), + _("Your display driver does not support OpenGL, or
" + "no OpenGL engines were compiled or installed for
" + "Evas or Ecore-Evas. Falling back to software engine.")); } c->ee = ecore_evas_software_x11_new(NULL, c->win, 0, 0, man->w, man->h); @@ -3809,7 +3810,7 @@ _e_comp_add(E_Manager *man) c->ee_win = ecore_evas_window_get(c->ee); ecore_x_composite_redirect_subwindows - (c->man->root, ECORE_X_COMPOSITE_UPDATE_MANUAL); + (c->man->root, ECORE_X_COMPOSITE_UPDATE_MANUAL); wins = ecore_x_window_children_get(c->man->root, &num); if (wins) @@ -3949,7 +3950,7 @@ _e_comp_del(E_Comp *c) ecore_evas_free(c->ee); ecore_x_composite_unredirect_subwindows - (c->man->root, ECORE_X_COMPOSITE_UPDATE_MANUAL); + (c->man->root, ECORE_X_COMPOSITE_UPDATE_MANUAL); ecore_x_composite_render_window_disable(c->win); if (c->man->num == 0) e_alert_composite_win(c->man->root, 0); if (c->render_animator) ecore_animator_del(c->render_animator); @@ -3975,7 +3976,6 @@ _e_comp_del(E_Comp *c) ////////////////////////////////////////////////////////////////////////// - static void _e_comp_sys_done_cb(void *data, Evas_Object *obj, const char *sig, const char *src) { @@ -4072,8 +4072,8 @@ _e_comp_config_engine_info_cb(E_Configure_Option *co) int x; const char *name[] = { - "Software", - NULL + "Software", + NULL }; #define ENGINE_SW 1 @@ -4089,14 +4089,13 @@ _e_comp_config_engine_info_cb(E_Configure_Option *co) for (x = ENGINE_SW; x <= ENGINE_GL; x++) { if (!name[x - 1]) continue; - oi = e_configure_option_info_new(co, _(name[x - 1]), (intptr_t*)(long)x); - oi->current = (*(int*)co->valptr == x); + oi = e_configure_option_info_new(co, _(name[x - 1]), (intptr_t *)(long)x); + oi->current = (*(int *)co->valptr == x); ret = eina_list_append(ret, oi); } return ret; } - static Eina_Bool _e_comp_config_style_thumb_timer_cb(void *data) { @@ -4105,7 +4104,7 @@ _e_comp_config_style_thumb_timer_cb(void *data) demo_state = (long)(intptr_t)evas_object_data_get(data, "style_demo_state"); demo_state = (demo_state + 1) % 4; - evas_object_data_set(data, "style_demo_state", (intptr_t*)(long)demo_state); + evas_object_data_set(data, "style_demo_state", (intptr_t *)(long)demo_state); oo = evas_object_data_get(ofr, "comp_preview"); switch (demo_state) @@ -4321,19 +4320,19 @@ e_comp_init(void) if (!ecore_x_composite_query()) { e_util_dialog_internal - (_("Compositor Error"), - _("Your display server does not support XComposite,
" - "or Ecore-X was built without XComposite support.
" - "Note that for composite support you will also need
" - "XRender and XFixes support in X11 and Ecore.")); + (_("Compositor Error"), + _("Your display server does not support XComposite,
" + "or Ecore-X was built without XComposite support.
" + "Note that for composite support you will also need
" + "XRender and XFixes support in X11 and Ecore.")); return EINA_FALSE; } if (!ecore_x_damage_query()) { e_util_dialog_internal - (_("Compositor Error"), - _("Your display server does not support XDamage
" - "or Ecore was built without XDamage support.")); + (_("Compositor Error"), + _("Your display server does not support XDamage
" + "or Ecore was built without XDamage support.")); return EINA_FALSE; } @@ -4425,7 +4424,7 @@ e_comp_shadows_reset(void) // ecore_evas_manual_render_set(c->ee, conf->lock_fps); _e_comp_fps_update(c); EINA_LIST_FOREACH(c->zones, ll, cz) - _e_comp_zone_fill(c, cz); + _e_comp_zone_fill(c, cz); EINA_INLIST_FOREACH(c->wins, cw) { if ((cw->shobj) && (cw->obj)) @@ -4444,8 +4443,8 @@ e_comp_shadows_reset(void) cw->pending_count++; e_manager_comp_event_src_visibility_send - (cw->c->man, (E_Manager_Comp_Source *)cw, - _e_comp_cb_pending_after, cw->c); + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_comp_cb_pending_after, cw->c); } } } diff --git a/src/bin/e_comp_cfdata.c b/src/bin/e_comp_cfdata.c index ffe3017f5..a3233deba 100644 --- a/src/bin/e_comp_cfdata.c +++ b/src/bin/e_comp_cfdata.c @@ -88,7 +88,7 @@ e_comp_cfdata_config_new(void) cfg->vsync = 1; #ifdef ECORE_EVAS_GL_X11_OPT_SWAP_MODE cfg->swap_mode = ECORE_EVAS_GL_X11_SWAP_MODE_AUTO; -#else +#else cfg->swap_mode = 0; #endif cfg->keep_unmapped = 1; @@ -208,3 +208,4 @@ e_comp_cfdata_config_free(E_Comp_Config *cfg) free(cfg); } + diff --git a/src/bin/e_comp_update.c b/src/bin/e_comp_update.c index 4c59e40d0..31ed4a661 100644 --- a/src/bin/e_comp_update.c +++ b/src/bin/e_comp_update.c @@ -33,15 +33,15 @@ e_comp_update_free(E_Update *up) void e_comp_update_policy_set(E_Update *up, - E_Update_Policy pol) + E_Update_Policy pol) { up->pol = pol; } void e_comp_update_tile_size_set(E_Update *up, - int tsw, - int tsh) + int tsw, + int tsh) { if ((up->tsw == tsw) && (up->tsh == tsh)) return; up->tsw = tsw; @@ -51,8 +51,8 @@ e_comp_update_tile_size_set(E_Update *up, void e_comp_update_resize(E_Update *up, - int w, - int h) + int w, + int h) { unsigned char *ptiles, *p, *pp; int ptw, pth, x, y; @@ -105,10 +105,10 @@ e_comp_update_resize(E_Update *up, void e_comp_update_add(E_Update *up, - int x, - int y, - int w, - int h) + int x, + int y, + int w, + int h) { int tx, ty, txx, tyy, xx, yy; unsigned char *t, *t2; diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index 319183ea4..82ee381ed 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -81,7 +81,7 @@ e_comp_wl_init(void) fd = wl_event_loop_get_fd(loop); _wl_fd_handler = - ecore_main_fd_handler_add(fd, ECORE_FD_READ,// | ECORE_FD_WRITE, + ecore_main_fd_handler_add(fd, ECORE_FD_READ, // | ECORE_FD_WRITE, _e_comp_wl_fd_handle, NULL, NULL, NULL); wl_event_loop_dispatch(loop, 0); diff --git a/src/bin/e_comp_wl_comp.c b/src/bin/e_comp_wl_comp.c index 63c3c3822..17d51b9f1 100644 --- a/src/bin/e_comp_wl_comp.c +++ b/src/bin/e_comp_wl_comp.c @@ -200,7 +200,7 @@ e_comp_wl_comp_repick(struct wl_seat *seat, uint32_t timestamp __UNUSED__) ws = _e_comp_wl_comp_pick_surface(pointer->x, pointer->y, - &pointer->current_x, &pointer->current_y); + &pointer->current_x, &pointer->current_y); if (!ws) return; if (&ws->surface != pointer->current) { @@ -413,7 +413,7 @@ _e_comp_wl_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event /* ev = event; */ input = e_comp_wl_input_get(); - if ((!input) || (!input->seat.keyboard)) + if ((!input) || (!input->seat.keyboard)) return ECORE_CALLBACK_PASS_ON; wl_keyboard_set_focus(input->seat.keyboard, NULL); wl_data_device_set_keyboard_focus(&input->seat); diff --git a/src/bin/e_comp_wl_input.c b/src/bin/e_comp_wl_input.c index 142b28441..b8c7cd3ca 100644 --- a/src/bin/e_comp_wl_input.c +++ b/src/bin/e_comp_wl_input.c @@ -20,7 +20,7 @@ static const struct wl_seat_interface _wl_seat_interface = _e_comp_wl_input_touch_get }; -static const struct wl_pointer_interface _wl_pointer_interface = +static const struct wl_pointer_interface _wl_pointer_interface = { _e_comp_wl_input_pointer_cursor_set }; @@ -108,7 +108,7 @@ _e_comp_wl_input_unbind(struct wl_resource *resource) free(resource); } -static void +static void _e_comp_wl_input_pointer_get(struct wl_client *client, struct wl_resource *resource, unsigned int id) { Wayland_Input *wi; @@ -119,23 +119,23 @@ _e_comp_wl_input_pointer_get(struct wl_client *client, struct wl_resource *resou if (!(wi = resource->data)) return; if (!wi->seat.pointer) return; - res = wl_client_add_object(client, &wl_pointer_interface, + res = wl_client_add_object(client, &wl_pointer_interface, &_wl_pointer_interface, id, wi); wl_list_insert(&wi->seat.pointer->resource_list, &res->link); res->destroy = _e_comp_wl_input_unbind; - if ((wi->seat.pointer->focus) && + if ((wi->seat.pointer->focus) && (wi->seat.pointer->focus->resource.client == client)) { /* TODO: surface_from_global_fixed ?? */ - wl_pointer_set_focus(wi->seat.pointer, wi->seat.pointer->focus, - wi->seat.pointer->x, + wl_pointer_set_focus(wi->seat.pointer, wi->seat.pointer->focus, + wi->seat.pointer->x, wi->seat.pointer->y); } } -static void +static void _e_comp_wl_input_keyboard_get(struct wl_client *client, struct wl_resource *resource, unsigned int id) { Wayland_Input *wi; @@ -152,14 +152,14 @@ _e_comp_wl_input_keyboard_get(struct wl_client *client, struct wl_resource *reso /* TODO: wl_keyboard_send_keymap ?? */ - if ((wi->seat.keyboard->focus) && + if ((wi->seat.keyboard->focus) && (wi->seat.keyboard->focus->resource.client == client)) { wl_keyboard_set_focus(wi->seat.keyboard, wi->seat.keyboard->focus); } } -static void +static void _e_comp_wl_input_touch_get(struct wl_client *client, struct wl_resource *resource, unsigned int id) { Wayland_Input *wi; @@ -175,7 +175,7 @@ _e_comp_wl_input_touch_get(struct wl_client *client, struct wl_resource *resourc res->destroy = _e_comp_wl_input_unbind; } -static void +static void _e_comp_wl_input_pointer_cursor_set(struct wl_client *client, struct wl_resource *resource, unsigned int serial, struct wl_resource *surface_resource, int x, int y) { /* Wayland_Input *wi; */ @@ -213,8 +213,8 @@ _e_comp_wl_input_pointer_cursor_set(struct wl_client *client, struct wl_resource /* if (ws->buffer) */ /* { */ - /* TODO: cursor surface configure */ - /* } */ + /* TODO: cursor surface configure */ + /* } */ } /* static void */ diff --git a/src/bin/e_comp_wl_shell.c b/src/bin/e_comp_wl_shell.c index d811c13a1..323e7191e 100644 --- a/src/bin/e_comp_wl_shell.c +++ b/src/bin/e_comp_wl_shell.c @@ -180,7 +180,7 @@ _e_comp_wl_shell_map(Wayland_Shell *base, Wayland_Surface *surface, int32_t widt if (do_configure) e_comp_wl_surface_configure(surface, surface->x, surface->y, - surface->w, surface->h); + surface->w, surface->h); switch (type) { diff --git a/src/bin/e_comp_wl_surface.c b/src/bin/e_comp_wl_surface.c index 48b36e4f2..8119265c0 100644 --- a/src/bin/e_comp_wl_surface.c +++ b/src/bin/e_comp_wl_surface.c @@ -183,7 +183,7 @@ e_comp_wl_surface_set_input_region(struct wl_client *client __UNUSED__, struct w e_comp_wl_comp_repick(&input->seat, e_comp_wl_time_get()); } -void +void e_comp_wl_surface_commit(struct wl_client *client, struct wl_resource *resource) { Wayland_Surface *ws; @@ -371,3 +371,4 @@ _e_comp_wl_surface_frame_destroy_callback(struct wl_resource *resource) wl_list_remove(&cb->link); free(cb); } + diff --git a/src/bin/e_config.c b/src/bin/e_config.c index e5fb80723..ae15e3ebd 100644 --- a/src/bin/e_config.c +++ b/src/bin/e_config.c @@ -856,7 +856,7 @@ e_config_init(void) E_CONFIG_VAL(D, T, desk_auto_switch, INT); E_CONFIG_VAL(D, T, screen_actions_fullscreen_windows_ignore, UCHAR); - E_CONFIG_VAL(D, T, screen_limits, INT); + E_CONFIG_VAL(D, T, screen_limits, INT); E_CONFIG_VAL(D, T, thumb_nice, INT); @@ -1086,189 +1086,189 @@ e_config_load(void) e_sys_action_do(E_SYS_RESTART, NULL); } } - if (!e_config->remember_internal_fm_windows) - e_config->remember_internal_fm_windows = !!(e_config->remember_internal_windows & E_REMEMBER_INTERNAL_FM_WINS); + if (!e_config->remember_internal_fm_windows) + e_config->remember_internal_fm_windows = !!(e_config->remember_internal_windows & E_REMEMBER_INTERNAL_FM_WINS); - e_config->config_version = E_CONFIG_FILE_VERSION; + e_config->config_version = E_CONFIG_FILE_VERSION; - /* limit values so they are sane */ - E_CONFIG_LIMIT(e_config->menus_scroll_speed, 1.0, 20000.0); - E_CONFIG_LIMIT(e_config->show_splash, 0, 1); - E_CONFIG_LIMIT(e_config->menus_fast_mouse_move_threshhold, 1.0, 2000.0); - E_CONFIG_LIMIT(e_config->menus_click_drag_timeout, 0.0, 10.0); - E_CONFIG_LIMIT(e_config->border_shade_animate, 0, 1); - E_CONFIG_LIMIT(e_config->border_shade_transition, 0, 8); - E_CONFIG_LIMIT(e_config->border_shade_speed, 1.0, 20000.0); - E_CONFIG_LIMIT(e_config->framerate, 1.0, 200.0); - E_CONFIG_LIMIT(e_config->priority, 0, 19); - E_CONFIG_LIMIT(e_config->image_cache, 0, 256 * 1024); - E_CONFIG_LIMIT(e_config->font_cache, 0, 32 * 1024); - E_CONFIG_LIMIT(e_config->edje_cache, 0, 256); - E_CONFIG_LIMIT(e_config->edje_collection_cache, 0, 512); - E_CONFIG_LIMIT(e_config->cache_flush_poll_interval, 8, 32768); - E_CONFIG_LIMIT(e_config->zone_desks_x_count, 1, 64); - E_CONFIG_LIMIT(e_config->zone_desks_y_count, 1, 64); - E_CONFIG_LIMIT(e_config->show_desktop_icons, 0, 1); - E_CONFIG_LIMIT(e_config->edge_flip_dragging, 0, 1); - E_CONFIG_LIMIT(e_config->window_placement_policy, E_WINDOW_PLACEMENT_SMART, E_WINDOW_PLACEMENT_MANUAL); - E_CONFIG_LIMIT(e_config->window_grouping, 0, 1); - E_CONFIG_LIMIT(e_config->focus_policy, 0, 2); - E_CONFIG_LIMIT(e_config->focus_setting, 0, 3); - E_CONFIG_LIMIT(e_config->pass_click_on, 0, 1); - E_CONFIG_LIMIT(e_config->window_activehint_policy, 0, 2); - E_CONFIG_LIMIT(e_config->always_click_to_raise, 0, 1); - E_CONFIG_LIMIT(e_config->always_click_to_focus, 0, 1); - E_CONFIG_LIMIT(e_config->use_auto_raise, 0, 1); - E_CONFIG_LIMIT(e_config->auto_raise_delay, 0.0, 9.9); - E_CONFIG_LIMIT(e_config->use_resist, 0, 1); - E_CONFIG_LIMIT(e_config->drag_resist, 0, 100); - E_CONFIG_LIMIT(e_config->desk_resist, 0, 100); - E_CONFIG_LIMIT(e_config->window_resist, 0, 100); - E_CONFIG_LIMIT(e_config->gadget_resist, 0, 100); - E_CONFIG_LIMIT(e_config->geometry_auto_move, 0, 1); - E_CONFIG_LIMIT(e_config->geometry_auto_resize_limit, 0, 1); - E_CONFIG_LIMIT(e_config->winlist_warp_while_selecting, 0, 1); - E_CONFIG_LIMIT(e_config->winlist_warp_at_end, 0, 1); - E_CONFIG_LIMIT(e_config->winlist_no_warp_on_direction, 0, 1); - E_CONFIG_LIMIT(e_config->winlist_warp_speed, 0.0, 1.0); - E_CONFIG_LIMIT(e_config->winlist_scroll_animate, 0, 1); - E_CONFIG_LIMIT(e_config->winlist_scroll_speed, 0.0, 1.0); - E_CONFIG_LIMIT(e_config->winlist_list_show_iconified, 0, 1); - E_CONFIG_LIMIT(e_config->winlist_list_show_other_desk_iconified, 0, 1); - E_CONFIG_LIMIT(e_config->winlist_list_show_other_screen_iconified, 0, 1); - E_CONFIG_LIMIT(e_config->winlist_list_show_other_desk_windows, 0, 1); - E_CONFIG_LIMIT(e_config->winlist_list_show_other_screen_windows, 0, 1); - E_CONFIG_LIMIT(e_config->winlist_list_uncover_while_selecting, 0, 1); - E_CONFIG_LIMIT(e_config->winlist_list_jump_desk_while_selecting, 0, 1); - E_CONFIG_LIMIT(e_config->winlist_pos_align_x, 0.0, 1.0); - E_CONFIG_LIMIT(e_config->winlist_pos_align_y, 0.0, 1.0); - E_CONFIG_LIMIT(e_config->winlist_pos_size_w, 0.0, 1.0); - E_CONFIG_LIMIT(e_config->winlist_pos_size_h, 0.0, 1.0); - E_CONFIG_LIMIT(e_config->winlist_pos_min_w, 0, 4000); - E_CONFIG_LIMIT(e_config->winlist_pos_min_h, 0, 4000); - E_CONFIG_LIMIT(e_config->winlist_pos_max_w, 8, 4000); - E_CONFIG_LIMIT(e_config->winlist_pos_max_h, 8, 4000); - E_CONFIG_LIMIT(e_config->maximize_policy, E_MAXIMIZE_FULLSCREEN, E_MAXIMIZE_DIRECTION); - E_CONFIG_LIMIT(e_config->allow_manip, 0, 1); - E_CONFIG_LIMIT(e_config->border_fix_on_shelf_toggle, 0, 1); - E_CONFIG_LIMIT(e_config->allow_above_fullscreen, 0, 1); - E_CONFIG_LIMIT(e_config->kill_if_close_not_possible, 0, 1); - E_CONFIG_LIMIT(e_config->kill_process, 0, 1); - E_CONFIG_LIMIT(e_config->kill_timer_wait, 0.0, 120.0); - E_CONFIG_LIMIT(e_config->ping_clients, 0, 1); - E_CONFIG_LIMIT(e_config->move_info_follows, 0, 1); - E_CONFIG_LIMIT(e_config->resize_info_follows, 0, 1); - E_CONFIG_LIMIT(e_config->move_info_visible, 0, 1); - E_CONFIG_LIMIT(e_config->resize_info_visible, 0, 1); - E_CONFIG_LIMIT(e_config->focus_last_focused_per_desktop, 0, 1); - E_CONFIG_LIMIT(e_config->focus_revert_on_hide_or_close, 0, 1); - E_CONFIG_LIMIT(e_config->pointer_slide, 0, 1); - E_CONFIG_LIMIT(e_config->show_cursor, 0, 1); - E_CONFIG_LIMIT(e_config->use_e_cursor, 0, 1); - E_CONFIG_LIMIT(e_config->cursor_size, 0, 1024); - E_CONFIG_LIMIT(e_config->menu_autoscroll_margin, 0, 50); - E_CONFIG_LIMIT(e_config->menu_autoscroll_cursor_margin, 0, 50); - E_CONFIG_LIMIT(e_config->menu_eap_name_show, 0, 1); - E_CONFIG_LIMIT(e_config->menu_eap_generic_show, 0, 1); - E_CONFIG_LIMIT(e_config->menu_eap_comment_show, 0, 1); - E_CONFIG_LIMIT(e_config->use_app_icon, 0, 1); - E_CONFIG_LIMIT(e_config->cnfmdlg_disabled, 0, 1); - E_CONFIG_LIMIT(e_config->cfgdlg_auto_apply, 0, 1); - E_CONFIG_LIMIT(e_config->cfgdlg_default_mode, 0, 1); - E_CONFIG_LIMIT(e_config->font_hinting, 0, 2); - E_CONFIG_LIMIT(e_config->desklock_login_box_zone, -2, 1000); - E_CONFIG_LIMIT(e_config->desklock_autolock_screensaver, 0, 1); - E_CONFIG_LIMIT(e_config->desklock_post_screensaver_time, 0.0, 300.0); - E_CONFIG_LIMIT(e_config->desklock_autolock_idle, 0, 1); - E_CONFIG_LIMIT(e_config->desklock_autolock_idle_timeout, 1.0, 5400.0); - E_CONFIG_LIMIT(e_config->desklock_use_custom_desklock, 0, 1); - E_CONFIG_LIMIT(e_config->desklock_ask_presentation, 0, 1); - E_CONFIG_LIMIT(e_config->desklock_ask_presentation_timeout, 1.0, 300.0); - E_CONFIG_LIMIT(e_config->border_raise_on_mouse_action, 0, 1); - E_CONFIG_LIMIT(e_config->border_raise_on_focus, 0, 1); - E_CONFIG_LIMIT(e_config->desk_flip_wrap, 0, 1); - E_CONFIG_LIMIT(e_config->fullscreen_flip, 0, 1); - E_CONFIG_LIMIT(e_config->icon_theme_overrides, 0, 1); - E_CONFIG_LIMIT(e_config->remember_internal_windows, 0, 3); - E_CONFIG_LIMIT(e_config->remember_internal_fm_windows, 0, 1); - E_CONFIG_LIMIT(e_config->desk_auto_switch, 0, 1); + /* limit values so they are sane */ + E_CONFIG_LIMIT(e_config->menus_scroll_speed, 1.0, 20000.0); + E_CONFIG_LIMIT(e_config->show_splash, 0, 1); + E_CONFIG_LIMIT(e_config->menus_fast_mouse_move_threshhold, 1.0, 2000.0); + E_CONFIG_LIMIT(e_config->menus_click_drag_timeout, 0.0, 10.0); + E_CONFIG_LIMIT(e_config->border_shade_animate, 0, 1); + E_CONFIG_LIMIT(e_config->border_shade_transition, 0, 8); + E_CONFIG_LIMIT(e_config->border_shade_speed, 1.0, 20000.0); + E_CONFIG_LIMIT(e_config->framerate, 1.0, 200.0); + E_CONFIG_LIMIT(e_config->priority, 0, 19); + E_CONFIG_LIMIT(e_config->image_cache, 0, 256 * 1024); + E_CONFIG_LIMIT(e_config->font_cache, 0, 32 * 1024); + E_CONFIG_LIMIT(e_config->edje_cache, 0, 256); + E_CONFIG_LIMIT(e_config->edje_collection_cache, 0, 512); + E_CONFIG_LIMIT(e_config->cache_flush_poll_interval, 8, 32768); + E_CONFIG_LIMIT(e_config->zone_desks_x_count, 1, 64); + E_CONFIG_LIMIT(e_config->zone_desks_y_count, 1, 64); + E_CONFIG_LIMIT(e_config->show_desktop_icons, 0, 1); + E_CONFIG_LIMIT(e_config->edge_flip_dragging, 0, 1); + E_CONFIG_LIMIT(e_config->window_placement_policy, E_WINDOW_PLACEMENT_SMART, E_WINDOW_PLACEMENT_MANUAL); + E_CONFIG_LIMIT(e_config->window_grouping, 0, 1); + E_CONFIG_LIMIT(e_config->focus_policy, 0, 2); + E_CONFIG_LIMIT(e_config->focus_setting, 0, 3); + E_CONFIG_LIMIT(e_config->pass_click_on, 0, 1); + E_CONFIG_LIMIT(e_config->window_activehint_policy, 0, 2); + E_CONFIG_LIMIT(e_config->always_click_to_raise, 0, 1); + E_CONFIG_LIMIT(e_config->always_click_to_focus, 0, 1); + E_CONFIG_LIMIT(e_config->use_auto_raise, 0, 1); + E_CONFIG_LIMIT(e_config->auto_raise_delay, 0.0, 9.9); + E_CONFIG_LIMIT(e_config->use_resist, 0, 1); + E_CONFIG_LIMIT(e_config->drag_resist, 0, 100); + E_CONFIG_LIMIT(e_config->desk_resist, 0, 100); + E_CONFIG_LIMIT(e_config->window_resist, 0, 100); + E_CONFIG_LIMIT(e_config->gadget_resist, 0, 100); + E_CONFIG_LIMIT(e_config->geometry_auto_move, 0, 1); + E_CONFIG_LIMIT(e_config->geometry_auto_resize_limit, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_warp_while_selecting, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_warp_at_end, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_no_warp_on_direction, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_warp_speed, 0.0, 1.0); + E_CONFIG_LIMIT(e_config->winlist_scroll_animate, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_scroll_speed, 0.0, 1.0); + E_CONFIG_LIMIT(e_config->winlist_list_show_iconified, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_list_show_other_desk_iconified, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_list_show_other_screen_iconified, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_list_show_other_desk_windows, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_list_show_other_screen_windows, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_list_uncover_while_selecting, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_list_jump_desk_while_selecting, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_pos_align_x, 0.0, 1.0); + E_CONFIG_LIMIT(e_config->winlist_pos_align_y, 0.0, 1.0); + E_CONFIG_LIMIT(e_config->winlist_pos_size_w, 0.0, 1.0); + E_CONFIG_LIMIT(e_config->winlist_pos_size_h, 0.0, 1.0); + E_CONFIG_LIMIT(e_config->winlist_pos_min_w, 0, 4000); + E_CONFIG_LIMIT(e_config->winlist_pos_min_h, 0, 4000); + E_CONFIG_LIMIT(e_config->winlist_pos_max_w, 8, 4000); + E_CONFIG_LIMIT(e_config->winlist_pos_max_h, 8, 4000); + E_CONFIG_LIMIT(e_config->maximize_policy, E_MAXIMIZE_FULLSCREEN, E_MAXIMIZE_DIRECTION); + E_CONFIG_LIMIT(e_config->allow_manip, 0, 1); + E_CONFIG_LIMIT(e_config->border_fix_on_shelf_toggle, 0, 1); + E_CONFIG_LIMIT(e_config->allow_above_fullscreen, 0, 1); + E_CONFIG_LIMIT(e_config->kill_if_close_not_possible, 0, 1); + E_CONFIG_LIMIT(e_config->kill_process, 0, 1); + E_CONFIG_LIMIT(e_config->kill_timer_wait, 0.0, 120.0); + E_CONFIG_LIMIT(e_config->ping_clients, 0, 1); + E_CONFIG_LIMIT(e_config->move_info_follows, 0, 1); + E_CONFIG_LIMIT(e_config->resize_info_follows, 0, 1); + E_CONFIG_LIMIT(e_config->move_info_visible, 0, 1); + E_CONFIG_LIMIT(e_config->resize_info_visible, 0, 1); + E_CONFIG_LIMIT(e_config->focus_last_focused_per_desktop, 0, 1); + E_CONFIG_LIMIT(e_config->focus_revert_on_hide_or_close, 0, 1); + E_CONFIG_LIMIT(e_config->pointer_slide, 0, 1); + E_CONFIG_LIMIT(e_config->show_cursor, 0, 1); + E_CONFIG_LIMIT(e_config->use_e_cursor, 0, 1); + E_CONFIG_LIMIT(e_config->cursor_size, 0, 1024); + E_CONFIG_LIMIT(e_config->menu_autoscroll_margin, 0, 50); + E_CONFIG_LIMIT(e_config->menu_autoscroll_cursor_margin, 0, 50); + E_CONFIG_LIMIT(e_config->menu_eap_name_show, 0, 1); + E_CONFIG_LIMIT(e_config->menu_eap_generic_show, 0, 1); + E_CONFIG_LIMIT(e_config->menu_eap_comment_show, 0, 1); + E_CONFIG_LIMIT(e_config->use_app_icon, 0, 1); + E_CONFIG_LIMIT(e_config->cnfmdlg_disabled, 0, 1); + E_CONFIG_LIMIT(e_config->cfgdlg_auto_apply, 0, 1); + E_CONFIG_LIMIT(e_config->cfgdlg_default_mode, 0, 1); + E_CONFIG_LIMIT(e_config->font_hinting, 0, 2); + E_CONFIG_LIMIT(e_config->desklock_login_box_zone, -2, 1000); + E_CONFIG_LIMIT(e_config->desklock_autolock_screensaver, 0, 1); + E_CONFIG_LIMIT(e_config->desklock_post_screensaver_time, 0.0, 300.0); + E_CONFIG_LIMIT(e_config->desklock_autolock_idle, 0, 1); + E_CONFIG_LIMIT(e_config->desklock_autolock_idle_timeout, 1.0, 5400.0); + E_CONFIG_LIMIT(e_config->desklock_use_custom_desklock, 0, 1); + E_CONFIG_LIMIT(e_config->desklock_ask_presentation, 0, 1); + E_CONFIG_LIMIT(e_config->desklock_ask_presentation_timeout, 1.0, 300.0); + E_CONFIG_LIMIT(e_config->border_raise_on_mouse_action, 0, 1); + E_CONFIG_LIMIT(e_config->border_raise_on_focus, 0, 1); + E_CONFIG_LIMIT(e_config->desk_flip_wrap, 0, 1); + E_CONFIG_LIMIT(e_config->fullscreen_flip, 0, 1); + E_CONFIG_LIMIT(e_config->icon_theme_overrides, 0, 1); + E_CONFIG_LIMIT(e_config->remember_internal_windows, 0, 3); + E_CONFIG_LIMIT(e_config->remember_internal_fm_windows, 0, 1); + E_CONFIG_LIMIT(e_config->desk_auto_switch, 0, 1); - E_CONFIG_LIMIT(e_config->screen_actions_fullscreen_windows_ignore, 0, 1); - E_CONFIG_LIMIT(e_config->screen_limits, 0, 2); + E_CONFIG_LIMIT(e_config->screen_actions_fullscreen_windows_ignore, 0, 1); + E_CONFIG_LIMIT(e_config->screen_limits, 0, 2); - E_CONFIG_LIMIT(e_config->dpms_enable, 0, 1); - E_CONFIG_LIMIT(e_config->dpms_standby_enable, 0, 1); - E_CONFIG_LIMIT(e_config->dpms_suspend_enable, 0, 1); - E_CONFIG_LIMIT(e_config->dpms_off_enable, 0, 1); - E_CONFIG_LIMIT(e_config->dpms_standby_timeout, 30, 5400); - E_CONFIG_LIMIT(e_config->dpms_suspend_timeout, 30, 5400); - E_CONFIG_LIMIT(e_config->dpms_off_timeout, 30, 5400); + E_CONFIG_LIMIT(e_config->dpms_enable, 0, 1); + E_CONFIG_LIMIT(e_config->dpms_standby_enable, 0, 1); + E_CONFIG_LIMIT(e_config->dpms_suspend_enable, 0, 1); + E_CONFIG_LIMIT(e_config->dpms_off_enable, 0, 1); + E_CONFIG_LIMIT(e_config->dpms_standby_timeout, 30, 5400); + E_CONFIG_LIMIT(e_config->dpms_suspend_timeout, 30, 5400); + E_CONFIG_LIMIT(e_config->dpms_off_timeout, 30, 5400); - E_CONFIG_LIMIT(e_config->backlight.timer, 1, 3600); + E_CONFIG_LIMIT(e_config->backlight.timer, 1, 3600); - E_CONFIG_LIMIT(e_config->screensaver_timeout, 30, 5400); - E_CONFIG_LIMIT(e_config->screensaver_interval, 0, 5400); - E_CONFIG_LIMIT(e_config->screensaver_blanking, 0, 2); - E_CONFIG_LIMIT(e_config->screensaver_expose, 0, 2); - E_CONFIG_LIMIT(e_config->screensaver_ask_presentation, 0, 1); - E_CONFIG_LIMIT(e_config->screensaver_ask_presentation_timeout, 1.0, 300.0); + E_CONFIG_LIMIT(e_config->screensaver_timeout, 30, 5400); + E_CONFIG_LIMIT(e_config->screensaver_interval, 0, 5400); + E_CONFIG_LIMIT(e_config->screensaver_blanking, 0, 2); + E_CONFIG_LIMIT(e_config->screensaver_expose, 0, 2); + E_CONFIG_LIMIT(e_config->screensaver_ask_presentation, 0, 1); + E_CONFIG_LIMIT(e_config->screensaver_ask_presentation_timeout, 1.0, 300.0); - E_CONFIG_LIMIT(e_config->clientlist_group_by, 0, 2); - E_CONFIG_LIMIT(e_config->clientlist_include_all_zones, 0, 1); - E_CONFIG_LIMIT(e_config->clientlist_separate_with, 0, 2); - E_CONFIG_LIMIT(e_config->clientlist_sort_by, 0, 3); - E_CONFIG_LIMIT(e_config->clientlist_separate_iconified_apps, 0, 2); - E_CONFIG_LIMIT(e_config->clientlist_warp_to_iconified_desktop, 0, 1); - E_CONFIG_LIMIT(e_config->mouse_hand, 0, 1); - E_CONFIG_LIMIT(e_config->clientlist_limit_caption_len, 0, 1); - E_CONFIG_LIMIT(e_config->clientlist_max_caption_len, 2, E_CLIENTLIST_MAX_CAPTION_LEN); + E_CONFIG_LIMIT(e_config->clientlist_group_by, 0, 2); + E_CONFIG_LIMIT(e_config->clientlist_include_all_zones, 0, 1); + E_CONFIG_LIMIT(e_config->clientlist_separate_with, 0, 2); + E_CONFIG_LIMIT(e_config->clientlist_sort_by, 0, 3); + E_CONFIG_LIMIT(e_config->clientlist_separate_iconified_apps, 0, 2); + E_CONFIG_LIMIT(e_config->clientlist_warp_to_iconified_desktop, 0, 1); + E_CONFIG_LIMIT(e_config->mouse_hand, 0, 1); + E_CONFIG_LIMIT(e_config->clientlist_limit_caption_len, 0, 1); + E_CONFIG_LIMIT(e_config->clientlist_max_caption_len, 2, E_CLIENTLIST_MAX_CAPTION_LEN); - E_CONFIG_LIMIT(e_config->mouse_accel_numerator, 1, 10); - E_CONFIG_LIMIT(e_config->mouse_accel_denominator, 1, 10); - E_CONFIG_LIMIT(e_config->mouse_accel_threshold, 1, 10); + E_CONFIG_LIMIT(e_config->mouse_accel_numerator, 1, 10); + E_CONFIG_LIMIT(e_config->mouse_accel_denominator, 1, 10); + E_CONFIG_LIMIT(e_config->mouse_accel_threshold, 1, 10); - E_CONFIG_LIMIT(e_config->menu_favorites_show, 0, 1); - E_CONFIG_LIMIT(e_config->menu_apps_show, 0, 1); - E_CONFIG_LIMIT(e_config->menu_gadcon_client_toplevel, 0, 1); + E_CONFIG_LIMIT(e_config->menu_favorites_show, 0, 1); + E_CONFIG_LIMIT(e_config->menu_apps_show, 0, 1); + E_CONFIG_LIMIT(e_config->menu_gadcon_client_toplevel, 0, 1); - E_CONFIG_LIMIT(e_config->ping_clients_interval, 16, 1024); + E_CONFIG_LIMIT(e_config->ping_clients_interval, 16, 1024); - E_CONFIG_LIMIT(e_config->mode.presentation, 0, 1); - E_CONFIG_LIMIT(e_config->mode.offline, 0, 1); + E_CONFIG_LIMIT(e_config->mode.presentation, 0, 1); + E_CONFIG_LIMIT(e_config->mode.offline, 0, 1); - E_CONFIG_LIMIT(e_config->exec.expire_timeout, 0.1, 1000); - E_CONFIG_LIMIT(e_config->exec.show_run_dialog, 0, 1); - E_CONFIG_LIMIT(e_config->exec.show_exit_dialog, 0, 1); + E_CONFIG_LIMIT(e_config->exec.expire_timeout, 0.1, 1000); + E_CONFIG_LIMIT(e_config->exec.show_run_dialog, 0, 1); + E_CONFIG_LIMIT(e_config->exec.show_exit_dialog, 0, 1); - E_CONFIG_LIMIT(e_config->null_container_win, 0, 1); + E_CONFIG_LIMIT(e_config->null_container_win, 0, 1); - E_CONFIG_LIMIT(e_config->powersave.none, 0.01, 5400.00); - E_CONFIG_LIMIT(e_config->powersave.low, 0.01, 5400.00); - E_CONFIG_LIMIT(e_config->powersave.medium, 0.01, 5400.00); - E_CONFIG_LIMIT(e_config->powersave.high, 0.01, 5400.00); - E_CONFIG_LIMIT(e_config->powersave.extreme, 0.01, 5400.00); - E_CONFIG_LIMIT(e_config->powersave.min, E_POWERSAVE_MODE_NONE, E_POWERSAVE_MODE_EXTREME); - E_CONFIG_LIMIT(e_config->powersave.max, E_POWERSAVE_MODE_NONE, E_POWERSAVE_MODE_EXTREME); + E_CONFIG_LIMIT(e_config->powersave.none, 0.01, 5400.00); + E_CONFIG_LIMIT(e_config->powersave.low, 0.01, 5400.00); + E_CONFIG_LIMIT(e_config->powersave.medium, 0.01, 5400.00); + E_CONFIG_LIMIT(e_config->powersave.high, 0.01, 5400.00); + E_CONFIG_LIMIT(e_config->powersave.extreme, 0.01, 5400.00); + E_CONFIG_LIMIT(e_config->powersave.min, E_POWERSAVE_MODE_NONE, E_POWERSAVE_MODE_EXTREME); + E_CONFIG_LIMIT(e_config->powersave.max, E_POWERSAVE_MODE_NONE, E_POWERSAVE_MODE_EXTREME); - E_CONFIG_LIMIT(e_config->border_keyboard.move.dx, 1, 255); - E_CONFIG_LIMIT(e_config->border_keyboard.move.dy, 1, 255); - E_CONFIG_LIMIT(e_config->border_keyboard.resize.dx, 1, 255); - E_CONFIG_LIMIT(e_config->border_keyboard.resize.dy, 1, 255); + E_CONFIG_LIMIT(e_config->border_keyboard.move.dx, 1, 255); + E_CONFIG_LIMIT(e_config->border_keyboard.move.dy, 1, 255); + E_CONFIG_LIMIT(e_config->border_keyboard.resize.dx, 1, 255); + E_CONFIG_LIMIT(e_config->border_keyboard.resize.dy, 1, 255); - E_CONFIG_LIMIT(e_config->multiscreen_flip, 0, 1); + E_CONFIG_LIMIT(e_config->multiscreen_flip, 0, 1); - if (!e_config->icon_theme) - e_config->icon_theme = eina_stringshare_add("hicolor"); // FDO default + if (!e_config->icon_theme) + e_config->icon_theme = eina_stringshare_add("hicolor"); // FDO default - /* FIXME: disabled auto apply because it causes problems */ - e_config->cfgdlg_auto_apply = 0; - /* FIXME: desklock personalized password id disabled for security reasons */ - e_config->desklock_auth_method = 0; - if (e_config->desklock_personal_passwd) - eina_stringshare_del(e_config->desklock_personal_passwd); - e_config->desklock_personal_passwd = NULL; + /* FIXME: disabled auto apply because it causes problems */ + e_config->cfgdlg_auto_apply = 0; + /* FIXME: desklock personalized password id disabled for security reasons */ + e_config->desklock_auth_method = 0; + if (e_config->desklock_personal_passwd) + eina_stringshare_del(e_config->desklock_personal_passwd); + e_config->desklock_personal_passwd = NULL; - ecore_event_add(E_EVENT_CONFIG_LOADED, NULL, NULL, NULL); + ecore_event_add(E_EVENT_CONFIG_LOADED, NULL, NULL, NULL); } EAPI int @@ -2175,3 +2175,4 @@ _e_config_eet_close_handle(Eet_File *ef, char *file) } return 1; } + diff --git a/src/bin/e_config_data.c b/src/bin/e_config_data.c index 8caea0a75..688e5fd57 100644 --- a/src/bin/e_config_data.c +++ b/src/bin/e_config_data.c @@ -10,7 +10,8 @@ e_config_descriptor_new(const char *name, int size) /* FIXME: We can directly map string inside an Eet_File and reuse it. But this need a break in all user of config every where in E. - */ + */ - return (E_Config_DD *) eet_data_descriptor_stream_new(&eddc); + return (E_Config_DD *)eet_data_descriptor_stream_new(&eddc); } + diff --git a/src/bin/e_config_dialog.c b/src/bin/e_config_dialog.c index de549fc17..cf2263dbc 100644 --- a/src/bin/e_config_dialog.c +++ b/src/bin/e_config_dialog.c @@ -18,8 +18,8 @@ static Eina_List *_e_config_dialog_list = NULL; /* externally accessible functions */ -/** - * Creates a new dialog +/** + * Creates a new dialog * * @param con the container the dialog will be added too * @param title to display for the dialog diff --git a/src/bin/e_configure.c b/src/bin/e_configure.c index 20cf49d1d..6d0459c1a 100644 --- a/src/bin/e_configure.c +++ b/src/bin/e_configure.c @@ -101,10 +101,10 @@ e_configure_registry_item_params_add(const char *path, int pri, const char *labe _e_configure_registry_item_full_add(path, pri, label, icon_file, icon, func, NULL, NULL, params); } -/** +/** * Delete an item in the configuration panel. - * - * @param path location the item to delete + * + * @param path location the item to delete */ EAPI void e_configure_registry_item_del(const char *path) @@ -138,15 +138,15 @@ e_configure_registry_item_del(const char *path) free(cat); } -/** +/** * Add a category to the configuration panel. * - * @param path location the new category + * @param path location the new category * @param pri the priority for sorting the category in the category list * @param label the name the user will see in configuration panel * @param icon_file the edje file that holds the icon for the category. * Can be null to use current theme. - * @param icon the name of the edje group to use as icon + * @param icon the name of the edje group to use as icon */ static int _E_configure_category_pri_cb(E_Configure_Cat *ecat, E_Configure_Cat *ecat2) @@ -180,10 +180,10 @@ e_configure_registry_category_add(const char *path, int pri, const char *label, ecat); } -/** +/** * Delete a category in the configuration panel. - * - * @param path location the category to delete + * + * @param path location the category to delete */ EAPI void e_configure_registry_category_del(const char *path) @@ -209,10 +209,10 @@ e_configure_registry_category_del(const char *path) free(cat); } -/** +/** * Add a item to the configuration panel. * - * @param path location the location to place configuration item + * @param path location the location to place configuration item * @param pri the priority for sorting the item in the category list * @param label the name the user will see in configuration panel * @param icon_file the edje file that holds the icon for the category. @@ -313,7 +313,7 @@ _e_configure_efreet_desktop_cleanup(void) E_Configure_It *eci; Eina_List *ll, *ln; - EINA_LIST_FOREACH_SAFE (ecat->items, ll, ln, eci) + EINA_LIST_FOREACH_SAFE(ecat->items, ll, ln, eci) if (eci->desktop) { _e_configure_registry_item_free(eci); diff --git a/src/bin/e_configure_option.c b/src/bin/e_configure_option.c index 152831b61..08eac77d8 100644 --- a/src/bin/e_configure_option.c +++ b/src/bin/e_configure_option.c @@ -18,13 +18,13 @@ static Eina_List *gtk_theme_mons = NULL; //Eio_Monitor static Eio_File *bg_ls[2] = {NULL, NULL}; static Eio_Monitor *bg_mon[2] = {NULL, NULL}; static Eina_Inlist *opts_list = NULL; -static Eina_Hash *tags_name_hash = NULL;/* (const char*)tag:(Eina_Stringshare*)tag */ -static Eina_Hash *tags_hash = NULL;/* tag:item */ +static Eina_Hash *tags_name_hash = NULL; /* (const char*)tag:(Eina_Stringshare*)tag */ +static Eina_Hash *tags_hash = NULL; /* tag:item */ static Eina_Hash *tags_alias_hash = NULL; /* alias:tag */ static Eina_Hash *tags_tag_alias_hash = NULL; /* tag:Eina_List(aliases) */ -static Eina_Hash *tags_alias_name_hash = NULL;/* (const char*)alias:(Eina_Stringshare*)alias */ +static Eina_Hash *tags_alias_name_hash = NULL; /* (const char*)alias:(Eina_Stringshare*)alias */ static Eina_List *tags_alias_list = NULL; /* alias:tag */ -static Eina_List *tags_list = NULL;/* Eina_Stringshare */ +static Eina_List *tags_list = NULL; /* Eina_Stringshare */ static Eina_List *opts_changed_list = NULL; //co->changed static Eina_List *handlers = NULL; static Eina_List *bgs = NULL; @@ -113,7 +113,6 @@ _e_configure_option_tag_remove(E_Configure_Option *co, Eina_Stringshare *tag) eina_hash_set(tags_hash, tag, items); } - static void _e_configure_option_free(E_Configure_Option *co) { @@ -225,22 +224,27 @@ _e_configure_option_value_reset(E_Configure_Option *co) case E_CONFIGURE_OPTION_TYPE_BOOL: eina_value_setup(&co->val, EINA_VALUE_TYPE_UCHAR); break; + case E_CONFIGURE_OPTION_TYPE_INT: case E_CONFIGURE_OPTION_TYPE_ENUM: eina_value_setup(&co->val, EINA_VALUE_TYPE_INT); break; + case E_CONFIGURE_OPTION_TYPE_UINT: eina_value_setup(&co->val, EINA_VALUE_TYPE_UINT); break; + case E_CONFIGURE_OPTION_TYPE_DOUBLE_UCHAR: case E_CONFIGURE_OPTION_TYPE_DOUBLE_INT: case E_CONFIGURE_OPTION_TYPE_DOUBLE_UINT: case E_CONFIGURE_OPTION_TYPE_DOUBLE: eina_value_setup(&co->val, EINA_VALUE_TYPE_DOUBLE); break; + case E_CONFIGURE_OPTION_TYPE_STR: eina_value_setup(&co->val, EINA_VALUE_TYPE_STRINGSHARE); break; + case E_CONFIGURE_OPTION_TYPE_CUSTOM: break; } @@ -261,9 +265,9 @@ _e_configure_option_apply(E_Configure_Option *co, Eina_List **events, Eina_List eina_value_get(&co->val, &dbl); x = lround(dbl); if (co->type == E_CONFIGURE_OPTION_TYPE_DOUBLE_INT) - *(int*)co->valptr = x; + *(int *)co->valptr = x; else - *(unsigned int*)co->valptr = MAX(x, 0); + *(unsigned int *)co->valptr = MAX(x, 0); } else if (co->type == E_CONFIGURE_OPTION_TYPE_STR) { @@ -282,7 +286,7 @@ _e_configure_option_apply(E_Configure_Option *co, Eina_List **events, Eina_List { if (!acts) { - act->func.go((E_Object*)e_util_container_current_get(), NULL); + act->func.go((E_Object *)e_util_container_current_get(), NULL); break; } if (*acts && eina_list_data_find(*acts, act)) break; @@ -297,12 +301,12 @@ _e_configure_option_apply(E_Configure_Option *co, Eina_List **events, Eina_List ecore_event_add(co->event_type, NULL, NULL, NULL); break; } - if (*events && eina_list_data_find(*events, (intptr_t*)(long)co->event_type)) break; - *events = eina_list_append(*events, (intptr_t*)(long)co->event_type); - break; + if (*events && eina_list_data_find(*events, (intptr_t *)(long)co->event_type)) break; + *events = eina_list_append(*events, (intptr_t *)(long)co->event_type); + break; } if (co->type == E_CONFIGURE_OPTION_TYPE_BOOL) - none = co->funcs[*(Eina_Bool*)co->valptr].none; + none = co->funcs[*(Eina_Bool *)co->valptr].none; else if (co->funcs[0].none) none = co->funcs[0].none; while (none) @@ -321,26 +325,32 @@ _e_configure_option_apply(E_Configure_Option *co, Eina_List **events, Eina_List switch (co->type) { case E_CONFIGURE_OPTION_TYPE_BOOL: - co->funcs[0].one(*(Eina_Bool*)co->valptr); + co->funcs[0].one(*(Eina_Bool *)co->valptr); break; + case E_CONFIGURE_OPTION_TYPE_DOUBLE_UCHAR: - co->funcs[0].one(*(unsigned char*)co->valptr); + co->funcs[0].one(*(unsigned char *)co->valptr); break; + case E_CONFIGURE_OPTION_TYPE_DOUBLE_INT: //lround(double) case E_CONFIGURE_OPTION_TYPE_INT: case E_CONFIGURE_OPTION_TYPE_ENUM: - co->funcs[0].one(*(int*)co->valptr); + co->funcs[0].one(*(int *)co->valptr); break; + case E_CONFIGURE_OPTION_TYPE_DOUBLE_UINT: //lround(double) case E_CONFIGURE_OPTION_TYPE_UINT: - co->funcs[0].one(*(unsigned int*)co->valptr); + co->funcs[0].one(*(unsigned int *)co->valptr); break; + case E_CONFIGURE_OPTION_TYPE_DOUBLE: - co->funcs[0].one(*(double*)co->valptr); + co->funcs[0].one(*(double *)co->valptr); break; + case E_CONFIGURE_OPTION_TYPE_STR: - co->funcs[0].one(*(Eina_Stringshare**)co->valptr); + co->funcs[0].one(*(Eina_Stringshare **)co->valptr); break; + case E_CONFIGURE_OPTION_TYPE_CUSTOM: break; } @@ -418,7 +428,6 @@ _e_configure_zone_desks_count_changed(void) e_zone_desk_count_set(zone, e_config->zone_desks_x_count, e_config->zone_desks_x_count); } - /******************************************************** * THUMB CALLBACKS */ @@ -531,7 +540,6 @@ _e_configure_border_style_thumb_cb(E_Configure_Option_Info *oi, Evas *evas) return ob; } - static Evas_Object * _e_configure_icon_theme_thumb_cb(E_Configure_Option_Info *oi, Evas *evas) { @@ -584,7 +592,7 @@ _e_configure_netwm_theme_thumb_cb(E_Configure_Option_Info *oi EINA_UNUSED, Evas Evas_Object *o; /* FIXME: uhhhhhhhhhhhhhhhhhhhhhh */ - //o = e_widget_label_add(evas, oi->name); +//o = e_widget_label_add(evas, oi->name); o = e_box_add(evas); return o; } @@ -593,11 +601,10 @@ _e_configure_netwm_theme_thumb_cb(E_Configure_Option_Info *oi EINA_UNUSED, Evas * INFO CALLBACKS */ - /* FIXME -static Eina_List * -_e_configure_language_info_cb(E_Configure_Option *co) -{ + static Eina_List * + _e_configure_language_info_cb(E_Configure_Option *co) + { Eina_List *l, *ret = NULL; E_Configure_Option_Info *oi; char *lang; @@ -611,8 +618,8 @@ _e_configure_language_info_cb(E_Configure_Option *co) } return ret; -} -*/ + } + */ static Eina_List * _e_configure_border_shade_transition_info_cb(E_Configure_Option *co) @@ -622,21 +629,21 @@ _e_configure_border_shade_transition_info_cb(E_Configure_Option *co) int x; const char *name[] = { - "Linear", - "Accelerate, then decelerate", - "Accelerate", - "Decelerate", - "Pronounced accelerate", - "Pronounced decelerate", - "Pronounced accelerate, then decelerate", - "Bounce", - "Bounce more" + "Linear", + "Accelerate, then decelerate", + "Accelerate", + "Decelerate", + "Pronounced accelerate", + "Pronounced decelerate", + "Pronounced accelerate, then decelerate", + "Bounce", + "Bounce more" }; for (x = 0; x <= E_TRANSITION_BOUNCE_LOTS; x++) { - oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x); - oi->current = (*(int*)co->valptr == x); + oi = e_configure_option_info_new(co, _(name[x]), (intptr_t *)(long)x); + oi->current = (*(int *)co->valptr == x); ret = eina_list_append(ret, oi); } return ret; @@ -650,16 +657,16 @@ _e_configure_window_placement_policy_info_cb(E_Configure_Option *co) int x; const char *name[] = { - "Try not to cover other windows", - "Try not to cover gadgets", - "Place at mouse pointer (automatic)", - "Place at mouse pointer (interactive)" + "Try not to cover other windows", + "Try not to cover gadgets", + "Place at mouse pointer (automatic)", + "Place at mouse pointer (interactive)" }; for (x = 0; x <= E_WINDOW_PLACEMENT_MANUAL; x++) { - oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x); - oi->current = (*(int*)co->valptr == x); + oi = e_configure_option_info_new(co, _(name[x]), (intptr_t *)(long)x); + oi->current = (*(int *)co->valptr == x); ret = eina_list_append(ret, oi); } return ret; @@ -673,15 +680,15 @@ _e_configure_focus_policy_info_cb(E_Configure_Option *co) int x; const char *name[] = { - "Click", - "Pointer", - "Sloppy" + "Click", + "Pointer", + "Sloppy" }; for (x = 0; x <= E_FOCUS_SLOPPY; x++) { - oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x); - oi->current = (*(int*)co->valptr == x); + oi = e_configure_option_info_new(co, _(name[x]), (intptr_t *)(long)x); + oi->current = (*(int *)co->valptr == x); ret = eina_list_append(ret, oi); } return ret; @@ -695,16 +702,16 @@ _e_configure_focus_setting_info_cb(E_Configure_Option *co) int x; const char *name[] = { - "Don't set focus on new windows", - "Set focus on all new windows", - "Set focus only on all new dialog windows", - "Set focus only on new dialog windows if dialog's parent window has focus" + "Don't set focus on new windows", + "Set focus on all new windows", + "Set focus only on all new dialog windows", + "Set focus only on new dialog windows if dialog's parent window has focus" }; for (x = 0; x <= E_FOCUS_NEW_DIALOG_IF_OWNER_FOCUSED; x++) { - oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x); - oi->current = (*(int*)co->valptr == x); + oi = e_configure_option_info_new(co, _(name[x]), (intptr_t *)(long)x); + oi->current = (*(int *)co->valptr == x); ret = eina_list_append(ret, oi); } return ret; @@ -718,15 +725,15 @@ _e_configure_window_activehint_policy_info_cb(E_Configure_Option *co) int x; const char *name[] = { - "Ignore application", - "Animate application window", - "Raise and set focus to application window" + "Ignore application", + "Animate application window", + "Raise and set focus to application window" }; for (x = 0; x <= E_ACTIVEHINT_POLICY_ACTIVATE; x++) { - oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x); - oi->current = (*(int*)co->valptr == x); + oi = e_configure_option_info_new(co, _(name[x]), (intptr_t *)(long)x); + oi->current = (*(int *)co->valptr == x); ret = eina_list_append(ret, oi); } return ret; @@ -740,14 +747,14 @@ _e_configure_fullscreen_policy_info_cb(E_Configure_Option *co) int x; const char *name[] = { - "Resize window, do not resize screen", - "Resize window and screen" + "Resize window, do not resize screen", + "Resize window and screen" }; for (x = 0; x <= E_FULLSCREEN_ZOOM; x++) { - oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x); - oi->current = (*(int*)co->valptr == x); + oi = e_configure_option_info_new(co, _(name[x]), (intptr_t *)(long)x); + oi->current = (*(int *)co->valptr == x); ret = eina_list_append(ret, oi); } return ret; @@ -761,17 +768,17 @@ _e_configure_maximize_policy_info_cb(E_Configure_Option *co) int x; const char *name[] = { - "Fullscreen", /* 1 */ - "Expand to maximum size without covering shelves", /* 2 */ - NULL, - "Expand to maximum size ignoring shelves" /* 4 */ + "Fullscreen", /* 1 */ + "Expand to maximum size without covering shelves", /* 2 */ + NULL, + "Expand to maximum size ignoring shelves" /* 4 */ }; for (x = E_MAXIMIZE_FULLSCREEN; x <= E_MAXIMIZE_FILL; x++) { if (!name[x]) continue; - oi = e_configure_option_info_new(co, _(name[x - 1]), (intptr_t*)(long)x); - oi->current = (*(int*)co->valptr == x); + oi = e_configure_option_info_new(co, _(name[x - 1]), (intptr_t *)(long)x); + oi->current = (*(int *)co->valptr == x); ret = eina_list_append(ret, oi); } return ret; @@ -785,15 +792,15 @@ _e_configure_font_hinting_info_cb(E_Configure_Option *co) int x; const char *name[] = { - "No hinting", - "Automatic hinting", - "Bytecode hinting" + "No hinting", + "Automatic hinting", + "Bytecode hinting" }; for (x = 0; x <= EVAS_FONT_HINTING_BYTECODE; x++) { - oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x); - oi->current = (*(int*)co->valptr == x); + oi = e_configure_option_info_new(co, _(name[x]), (intptr_t *)(long)x); + oi->current = (*(int *)co->valptr == x); ret = eina_list_append(ret, oi); } return ret; @@ -810,9 +817,9 @@ _e_configure_desklock_login_box_zone_info_cb(E_Configure_Option *co) Eina_List *ml; const char *name[] = { - "Show on all screens", - "Show on screen of pointer", - "Show on screen %d" + "Show on all screens", + "Show on screen of pointer", + "Show on screen %d" }; EINA_LIST_FOREACH(e_manager_list(), ml, m) @@ -829,13 +836,13 @@ _e_configure_desklock_login_box_zone_info_cb(E_Configure_Option *co) char buf[128]; if (x < 0) - oi = e_configure_option_info_new(co, _(name[x + 2]), (intptr_t*)(long)x); + oi = e_configure_option_info_new(co, _(name[x + 2]), (intptr_t *)(long)x); else { snprintf(buf, sizeof(buf), _(name[2]), x); - oi = e_configure_option_info_new(co, buf, (intptr_t*)(long)x); + oi = e_configure_option_info_new(co, buf, (intptr_t *)(long)x); } - oi->current = (*(int*)co->valptr == x); + oi->current = (*(int *)co->valptr == x); ret = eina_list_append(ret, oi); } return ret; @@ -849,15 +856,15 @@ _e_configure_clientlist_group_by_info_cb(E_Configure_Option *co) int x; const char *name[] = { - "No grouping", - "Virtual desktop", - "Window class" + "No grouping", + "Virtual desktop", + "Window class" }; for (x = 0; x <= E_CLIENTLIST_GROUP_CLASS; x++) { - oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x); - oi->current = (*(int*)co->valptr == x); + oi = e_configure_option_info_new(co, _(name[x]), (intptr_t *)(long)x); + oi->current = (*(int *)co->valptr == x); ret = eina_list_append(ret, oi); } return ret; @@ -871,15 +878,15 @@ _e_configure_clientlist_separate_with_info_cb(E_Configure_Option *co) int x; const char *name[] = { - "No separation", - "Separator bars", - "Separate menus" + "No separation", + "Separator bars", + "Separate menus" }; for (x = 0; x <= E_CLIENTLIST_GROUP_SEP_MENU; x++) { - oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x); - oi->current = (*(int*)co->valptr == x); + oi = e_configure_option_info_new(co, _(name[x]), (intptr_t *)(long)x); + oi->current = (*(int *)co->valptr == x); ret = eina_list_append(ret, oi); } return ret; @@ -893,16 +900,16 @@ _e_configure_clientlist_sort_by_info_cb(E_Configure_Option *co) int x; const char *name[] = { - "No sorting", - "Alphabetical order", - "Window stacking layer", - "Recently used windows first" + "No sorting", + "Alphabetical order", + "Window stacking layer", + "Recently used windows first" }; for (x = 0; x <= E_CLIENTLIST_SORT_MOST_RECENT; x++) { - oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x); - oi->current = (*(int*)co->valptr == x); + oi = e_configure_option_info_new(co, _(name[x]), (intptr_t *)(long)x); + oi->current = (*(int *)co->valptr == x); ret = eina_list_append(ret, oi); } return ret; @@ -916,15 +923,15 @@ _e_configure_clientlist_separate_iconified_apps_info_cb(E_Configure_Option *co) int x; const char *name[] = { - "Group by owner virtual desktop", - "Group by current virtual desktop", - "Separate group" + "Group by owner virtual desktop", + "Group by current virtual desktop", + "Separate group" }; for (x = 0; x <= E_CLIENTLIST_GROUPICONS_SEP; x++) { - oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x); - oi->current = (*(int*)co->valptr == x); + oi = e_configure_option_info_new(co, _(name[x]), (intptr_t *)(long)x); + oi->current = (*(int *)co->valptr == x); ret = eina_list_append(ret, oi); } return ret; @@ -938,15 +945,15 @@ _e_configure_desk_flip_animate_mode_info_cb(E_Configure_Option *co) int x; const char *name[] = { - "No animation", - "Pane", - "Zoom" + "No animation", + "Pane", + "Zoom" }; for (x = 0; x <= E_DESKFLIP_ANIMATION_MODE_ZOOM; x++) { - oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x); - oi->current = (*(int*)co->valptr == x); + oi = e_configure_option_info_new(co, _(name[x]), (intptr_t *)(long)x); + oi->current = (*(int *)co->valptr == x); ret = eina_list_append(ret, oi); } return ret; @@ -960,15 +967,15 @@ _e_configure_screen_limits_info_cb(E_Configure_Option *co) int x; const char *name[] = { - "Allow windows partly out of the screen limits", - "Allow windows completely out of the screen limits", - "Keep windows completely within the screen limits" + "Allow windows partly out of the screen limits", + "Allow windows completely out of the screen limits", + "Keep windows completely within the screen limits" }; for (x = 0; x <= E_SCREEN_LIMITS_WITHIN; x++) { - oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x); - oi->current = (*(int*)co->valptr == x); + oi = e_configure_option_info_new(co, _(name[x]), (intptr_t *)(long)x); + oi->current = (*(int *)co->valptr == x); ret = eina_list_append(ret, oi); } return ret; @@ -998,8 +1005,8 @@ _e_configure_icon_theme_info_cb(E_Configure_Option *co) l = eina_list_sort(l, 0, _e_configure_icon_theme_info_sort_cb); EINA_LIST_FREE(l, theme) { - if (!theme->directories) continue; //invalid - if (!e_util_strcasecmp(theme->name.internal, "hicolor")) continue; //default + if (!theme->directories) continue; //invalid + if (!e_util_strcasecmp(theme->name.internal, "hicolor")) continue; //default oi = e_configure_option_info_new(co, theme->name.name, eina_stringshare_add(theme->name.internal)); oi->current = !e_util_strcmp(e_config->icon_theme, theme->name.internal); oi->thumb_file = eina_stringshare_add(theme->example_icon); @@ -1028,7 +1035,7 @@ _e_configure_netwm_theme_info_cb(E_Configure_Option *co) if ((!gtk2) && (!gtk3)) continue; name = ecore_file_file_get(dir); snprintf(buf, sizeof(buf), "%s (%s)%s%s%s", name, gtk2 ? "gtk2" : "gtk3", - (gtk2 && gtk3) ? " (" : "", (gtk2 && gtk3) ? "gtk3" : "", (gtk2 && gtk3) ? ")" : ""); + (gtk2 && gtk3) ? " (" : "", (gtk2 && gtk3) ? "gtk3" : "", (gtk2 && gtk3) ? ")" : ""); oi = e_configure_option_info_new(co, buf, eina_stringshare_add(name)); oi->current = (e_config->xsettings.net_theme_name == oi->value); ret = eina_list_append(ret, oi); @@ -1048,7 +1055,7 @@ _e_configure_transition_info_cb(E_Configure_Option *co) file = e_theme_edje_file_get("base/theme/widgets", "e/transpreview/0"); key = "e/transitions/%s"; - cur = *(Eina_Stringshare**)co->valptr; + cur = *(Eina_Stringshare **)co->valptr; oi = e_configure_option_info_new(co, _("None"), NULL); oi->thumb_file = eina_stringshare_ref(file); @@ -1121,7 +1128,7 @@ _e_configure_init_default_theme_info_cb(E_Configure_Option *co) oi->thumb_file = eina_stringshare_ref(file); oi->thumb_key = eina_stringshare_ref(key); ret = eina_list_append(ret, oi); - oi->current = (oi->name == *(Eina_Stringshare**)co->valptr); + oi->current = (oi->name == *(Eina_Stringshare **)co->valptr); } if (ret && sthemes) ret = eina_list_append(ret, e_configure_option_info_new(co, NULL, NULL)); @@ -1134,7 +1141,7 @@ _e_configure_init_default_theme_info_cb(E_Configure_Option *co) ret = eina_list_append(ret, oi); oi->thumb_file = eina_stringshare_ref(file); oi->thumb_key = eina_stringshare_ref(key); - oi->current = (oi->name == *(Eina_Stringshare**)co->valptr); + oi->current = (oi->name == *(Eina_Stringshare **)co->valptr); } eina_stringshare_del(key); return ret; @@ -1152,7 +1159,7 @@ _e_configure_background_info_cb(E_Configure_Option *co) Eina_Stringshare *key; key = eina_stringshare_add("e/desktop/background"); - cur = *(Eina_Stringshare**)co->valptr; + cur = *(Eina_Stringshare **)co->valptr; if (!cur) { E_Config_Theme *ct; @@ -1171,7 +1178,6 @@ _e_configure_background_info_cb(E_Configure_Option *co) oi->thumb_key = eina_stringshare_ref(key); ret = eina_list_append(ret, oi); oi->current = ((file == cur) || (!e_util_strcmp(f, cur))); - } EINA_LIST_FOREACH(sthemes, l, file) { @@ -1426,16 +1432,16 @@ e_configure_option_init(void) tags_tag_alias_hash = eina_hash_stringshared_new((Eina_Free_Cb)_e_configure_option_tag_alias_list_free); tags_alias_hash = eina_hash_string_superfast_new(NULL); tags_alias_name_hash = eina_hash_string_superfast_new(NULL); -#define OPT_ADD(TYPE, NAME, DESC, ...) \ - co = e_configure_option_add(E_CONFIGURE_OPTION_TYPE_##TYPE, DESC, #NAME, EINA_FALSE, &e_config->NAME, NULL);\ - e_configure_option_tags_set(co, (const char*[]){__VA_ARGS__, NULL}, 0) +#define OPT_ADD(TYPE, NAME, DESC, ...) \ + co = e_configure_option_add(E_CONFIGURE_OPTION_TYPE_##TYPE, DESC, #NAME, EINA_FALSE, &e_config->NAME, NULL); \ + e_configure_option_tags_set(co, (const char *[]){__VA_ARGS__, NULL}, 0) #define OPT_HELP(STR) \ - co->help = eina_stringshare_add(STR) -#define OPT_MINMAX_STEP_FMT(MIN, MAX, STEP, FMT) \ - co->minmax[0] = (MIN), co->minmax[1] = (MAX), co->step = (STEP),\ - co->info = eina_stringshare_add(_(FMT)) + co->help = eina_stringshare_add(STR) +#define OPT_MINMAX_STEP_FMT(MIN, MAX, STEP, FMT) \ + co->minmax[0] = (MIN), co->minmax[1] = (MAX), co->step = (STEP), \ + co->info = eina_stringshare_add(_(FMT)) #define OPT_ICON(ICON) \ - e_configure_option_data_set(co, "icon", eina_stringshare_add(ICON)) + e_configure_option_data_set(co, "icon", eina_stringshare_add(ICON)) OPT_ADD(BOOL, show_splash, _("Show splash screen on startup"), _("splash"), _("startup")); OPT_ADD(STR, init_default_theme, _("Startup splash theme"), _("splash"), _("startup"), _("theme"), _("animate")); @@ -1544,7 +1550,7 @@ e_configure_option_init(void) OPT_ICON("preferences-plugin"); OPT_ADD(BOOL, no_module_delay, _("Disable module delay"), _("module"), _("delay")); OPT_HELP(_("If enabled, this causes E to load all modules at once during startup " - "instead of loading them incrementally")); + "instead of loading them incrementally")); /* FIXME */ OPT_ADD(CUSTOM, language, _("Language"), _("language")); @@ -1776,7 +1782,7 @@ e_configure_option_init(void) /* seems to be disabled ? OPT_ADD(STR, desklock_personal_passwd, _("Desklock custom password"), _("desklock")); //passwd OPT_HELP(_("This option causes desklock to use a custom-provided password instead of the user's password")); -*/ + */ OPT_ADD(BOOL, desklock_auth_method, _("Use custom command for desklock"), _("desklock"), _("exec")); OPT_HELP(_("This option allows an external application to manage desklock")); OPT_ADD(STR, desklock_custom_desklock_cmd, _("Custom desklock command"), _("desklock"), _("exec")); @@ -1828,7 +1834,7 @@ e_configure_option_init(void) OPT_ADD(BOOL, dpms_off_enable, _("dpms")); OPT_ADD(DOUBLE_INT, dpms_off_timeout, _("dpms"), _("delay")); OPT_MINMAX_STEP_FMT(30, 5400); -*/ + */ OPT_ADD(ENUM, clientlist_group_by, _("Window list menu grouping policy"), _("menu"), _("border")); //enum co->info_cb = _e_configure_clientlist_group_by_info_cb; OPT_ICON("preferences-winlist"); @@ -1859,11 +1865,11 @@ e_configure_option_init(void) OPT_ADD(BOOL, mouse_hand, _("Enable left-handed mouse"), _("mouse")); co->funcs[0].none = co->funcs[1].none = _e_configure_pointer_changed; /* FIXME: need to group these two - OPT_ADD(DOUBLE_INT, mouse_accel_numerator, _("mouse"), _("speed")); //slider - OPT_MINMAX_STEP_FMT(1, 10); - OPT_ADD(DOUBLE_INT, mouse_accel_denominator, _("mouse"), _("speed")); //also slider - OPT_MINMAX_STEP_FMT(1, 10); - */ + OPT_ADD(DOUBLE_INT, mouse_accel_numerator, _("mouse"), _("speed")); //slider + OPT_MINMAX_STEP_FMT(1, 10); + OPT_ADD(DOUBLE_INT, mouse_accel_denominator, _("mouse"), _("speed")); //also slider + OPT_MINMAX_STEP_FMT(1, 10); + */ OPT_ADD(DOUBLE_INT, mouse_accel_threshold, _("Mouse acceleration threshold"), _("mouse"), _("speed")); OPT_MINMAX_STEP_FMT(1, 10, 1, "%1.0f"); co->funcs[0].none = co->funcs[1].none = _e_configure_pointer_changed; @@ -1967,21 +1973,21 @@ e_configure_option_init(void) co->funcs[0].none = _e_configure_dpms_changed; /* FIXME - OPT_ADD(DOUBLE, powersave.none, _("powersave")); - OPT_MINMAX_STEP_FMT(0.01, 5400.00); - OPT_ADD(DOUBLE, powersave.low, _("powersave")); - OPT_MINMAX_STEP_FMT(0.01, 5400.00); - OPT_ADD(DOUBLE, powersave.medium, _("powersave")); - OPT_MINMAX_STEP_FMT(0.01, 5400.00); - OPT_ADD(DOUBLE, powersave.high, _("powersave")); - OPT_MINMAX_STEP_FMT(0.01, 5400.00); - OPT_ADD(DOUBLE, powersave.extreme, _("powersave")); - OPT_MINMAX_STEP_FMT(0.01, 5400.00); - OPT_ADD(DOUBLE_UINT, powersave.min, _("powersave")); - OPT_MINMAX_STEP_FMT(E_POWERSAVE_MODE_NONE, E_POWERSAVE_MODE_EXTREME); - OPT_ADD(DOUBLE_UINT, powersave.max, _("powersave")); - OPT_MINMAX_STEP_FMT(E_POWERSAVE_MODE_NONE, E_POWERSAVE_MODE_EXTREME); - */ + OPT_ADD(DOUBLE, powersave.none, _("powersave")); + OPT_MINMAX_STEP_FMT(0.01, 5400.00); + OPT_ADD(DOUBLE, powersave.low, _("powersave")); + OPT_MINMAX_STEP_FMT(0.01, 5400.00); + OPT_ADD(DOUBLE, powersave.medium, _("powersave")); + OPT_MINMAX_STEP_FMT(0.01, 5400.00); + OPT_ADD(DOUBLE, powersave.high, _("powersave")); + OPT_MINMAX_STEP_FMT(0.01, 5400.00); + OPT_ADD(DOUBLE, powersave.extreme, _("powersave")); + OPT_MINMAX_STEP_FMT(0.01, 5400.00); + OPT_ADD(DOUBLE_UINT, powersave.min, _("powersave")); + OPT_MINMAX_STEP_FMT(E_POWERSAVE_MODE_NONE, E_POWERSAVE_MODE_EXTREME); + OPT_ADD(DOUBLE_UINT, powersave.max, _("powersave")); + OPT_MINMAX_STEP_FMT(E_POWERSAVE_MODE_NONE, E_POWERSAVE_MODE_EXTREME); + */ OPT_ADD(BOOL, deskenv.load_xrdb, _("Load ~/.xrdb on startup"), _("environment")); OPT_ADD(BOOL, deskenv.load_xmodmap, _("Load ~/.Xmodmap"), _("environment")); OPT_ADD(BOOL, deskenv.load_gnome, _("Run gnome-settings-daemon"), _("environment")); @@ -2011,7 +2017,6 @@ e_configure_option_init(void) OPT_ADD(BOOL, exe_always_single_instance, _("Always launch applications as single-instance"), _("exec")); //OPT_ADD(INT, use_desktop_window_profile, - e_user_dir_concat_static(buf, "themes"); theme_ls[0] = eio_file_ls(buf, _edj_filter_cb, _init_main_cb, _init_done_cb, _init_error_cb, NULL); theme_mon[0] = eio_monitor_add(buf); @@ -2125,7 +2130,7 @@ e_configure_option_shutdown(void) E_FREE_LIST(tags_list, eina_stringshare_del); E_FREE_LIST(tags_alias_list, eina_stringshare_del); while (opts_list) - _e_configure_option_free((E_Configure_Option*)opts_list); + _e_configure_option_free((E_Configure_Option *)opts_list); E_FN_DEL(eina_hash_free, tags_hash); E_FN_DEL(eina_hash_free, tags_tag_alias_hash); E_FN_DEL(eina_hash_free, tags_name_hash); @@ -2168,7 +2173,7 @@ e_configure_option_add(E_Configure_Option_Type type, const char *desc, const cha co->name = eina_stringshare_add(name); co->desc = eina_stringshare_add(desc); co->valptr = valptr; - co->data = (void*)data; + co->data = (void *)data; co->private = !!private_scope; _e_configure_option_event_changed(co); return co; @@ -2190,7 +2195,6 @@ e_configure_option_tags_set(E_Configure_Option *co, const char **const tags, uns { for (x = 0; x < num_tags; x++) _e_configure_option_tag_append(co, tags[x]); - } else { @@ -2207,7 +2211,7 @@ e_configure_option_info_new(E_Configure_Option *co, const char *name, const void oi = E_NEW(E_Configure_Option_Info, 1); oi->co = co; oi->name = eina_stringshare_add(name); - oi->value = (void*)value; + oi->value = (void *)value; return oi; } @@ -2295,49 +2299,57 @@ e_configure_option_changed(E_Configure_Option *co) { case E_CONFIGURE_OPTION_TYPE_BOOL: eina_value_get(&co->val, &u); - if (*(unsigned char*)co->valptr != u) break; + if (*(unsigned char *)co->valptr != u) break; co->changed = EINA_FALSE; break; + case E_CONFIGURE_OPTION_TYPE_DOUBLE_UCHAR: eina_value_get(&co->val, &d); l = lround(d); u = MAX(0, l); - if (*(unsigned char*)co->valptr != u) break; + if (*(unsigned char *)co->valptr != u) break; co->changed = EINA_FALSE; break; + case E_CONFIGURE_OPTION_TYPE_DOUBLE_INT: //lround(double) eina_value_get(&co->val, &d); - if (*(int*)co->valptr != lround(d)) break; + if (*(int *)co->valptr != lround(d)) break; co->changed = EINA_FALSE; break; + case E_CONFIGURE_OPTION_TYPE_INT: case E_CONFIGURE_OPTION_TYPE_ENUM: eina_value_get(&co->val, &i); - if (*(int*)co->valptr != i) break; + if (*(int *)co->valptr != i) break; co->changed = EINA_FALSE; break; + case E_CONFIGURE_OPTION_TYPE_DOUBLE_UINT: //lround(double) eina_value_get(&co->val, &d); l = lround(d); ui = MAX(0, l); - if (*(unsigned int*)co->valptr != ui) break; + if (*(unsigned int *)co->valptr != ui) break; co->changed = EINA_FALSE; break; + case E_CONFIGURE_OPTION_TYPE_UINT: eina_value_get(&co->val, &ui); - if (*(unsigned int*)co->valptr != ui) break; + if (*(unsigned int *)co->valptr != ui) break; co->changed = EINA_FALSE; break; + case E_CONFIGURE_OPTION_TYPE_DOUBLE: eina_value_get(&co->val, &d); - if (fabs(*(double*)co->valptr - d) > DBL_EPSILON) break; + if (fabs(*(double *)co->valptr - d) > DBL_EPSILON) break; co->changed = EINA_FALSE; break; + case E_CONFIGURE_OPTION_TYPE_STR: eina_value_get(&co->val, &s); - if (*(Eina_Stringshare**)co->valptr != s) break; + if (*(Eina_Stringshare **)co->valptr != s) break; co->changed = EINA_FALSE; break; + case E_CONFIGURE_OPTION_TYPE_CUSTOM: break; } @@ -2416,7 +2428,7 @@ e_configure_option_apply_all(void) EINA_LIST_FREE(funcs, none) none(); EINA_LIST_FREE(acts, act) - act->func.go((E_Object*)e_util_container_current_get(), NULL); + act->func.go((E_Object *)e_util_container_current_get(), NULL); e_config_save_queue(); if (e_restart) e_sys_action_do(E_SYS_RESTART, NULL); } @@ -2437,6 +2449,7 @@ e_configure_option_value_get(E_Configure_Option *co) case E_CONFIGURE_OPTION_TYPE_BOOL: eina_value_get(&co->val, &u); return &u; + case E_CONFIGURE_OPTION_TYPE_DOUBLE_UCHAR: case E_CONFIGURE_OPTION_TYPE_DOUBLE_INT: //lround(double) case E_CONFIGURE_OPTION_TYPE_DOUBLE_UINT: //lround(double) @@ -2444,15 +2457,19 @@ e_configure_option_value_get(E_Configure_Option *co) case E_CONFIGURE_OPTION_TYPE_DOUBLE: eina_value_get(&co->val, &d); return &d; + case E_CONFIGURE_OPTION_TYPE_INT: eina_value_get(&co->val, &l); return &l; + case E_CONFIGURE_OPTION_TYPE_UINT: eina_value_get(&co->val, &i); return &i; + case E_CONFIGURE_OPTION_TYPE_STR: eina_value_get(&co->val, &s); return &s; + case E_CONFIGURE_OPTION_TYPE_CUSTOM: break; } @@ -2573,7 +2590,7 @@ e_configure_option_tag_alias_add(const char *tag, const char *alias) t = eina_hash_find(tags_name_hash, tag); if (!t) return; o = eina_hash_set(tags_alias_hash, alias, t); - if (o) return; //alias already in list + if (o) return; //alias already in list o = eina_stringshare_add(alias); tags_alias_list = eina_list_append(tags_alias_list, o); l = eina_hash_find(tags_tag_alias_hash, t); @@ -2590,7 +2607,7 @@ e_configure_option_tag_alias_del(const char *tag, const char *alias) EINA_SAFETY_ON_NULL_RETURN(alias); t = eina_hash_set(tags_alias_hash, alias, NULL); - if (!t) return; //alias doesn't exist + if (!t) return; //alias doesn't exist a = eina_hash_find(tags_alias_name_hash, alias); tags_alias_list = eina_list_remove(tags_alias_list, a); l = eina_hash_find(tags_tag_alias_hash, t); @@ -2780,3 +2797,4 @@ e_configure_option_ctx_free(E_Configure_Option_Ctx *ctx) eina_list_free(ctx->match_tags); free(ctx); } + diff --git a/src/bin/e_container.c b/src/bin/e_container.c index 89ab5df06..f84fc3894 100644 --- a/src/bin/e_container.c +++ b/src/bin/e_container.c @@ -362,7 +362,7 @@ 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) + const char *profile) { Eina_List *l = NULL; E_Zone *zone = NULL; @@ -767,7 +767,7 @@ e_container_border_stack_above(E_Border *bd, E_Border *above) /* Add to new layer */ bd->layer = above->layer; pos = _e_container_layer_map(bd->layer); - + ecore_x_window_configure(bd->win, ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, diff --git a/src/bin/e_dbusmenu.c b/src/bin/e_dbusmenu.c index 53b76958e..c8dbcbd4e 100644 --- a/src/bin/e_dbusmenu.c +++ b/src/bin/e_dbusmenu.c @@ -4,11 +4,11 @@ struct _E_DBusMenu_Ctx { - EDBus_Proxy *proxy; - E_DBusMenu_Item *root_menu; - void *data; + EDBus_Proxy *proxy; + E_DBusMenu_Item *root_menu; + void *data; E_DBusMenu_Pop_Request_Cb pop_request_cb; - E_DBusMenu_Update_Cb update_cb; + E_DBusMenu_Update_Cb update_cb; }; static const char *Menu_Item_Type_Names[] = @@ -40,7 +40,7 @@ id_find(const char *text, const char *array_of_names[], unsigned max) if (strcmp(text, array_of_names[i])) continue; return i; - } + } return 0; } @@ -63,7 +63,7 @@ dbus_menu_prop_dict_cb(void *data, const void *key, EDBus_Message_Iter *var) continue; } - if (label[i+1] == '_') + if (label[i + 1] == '_') { eina_strbuf_append_char(label_buf, label[i]); i++; @@ -186,7 +186,7 @@ dbus_menu_free(E_DBusMenu_Item *m) if (m->icon_name) eina_stringshare_del(m->icon_name); if (m->label) - eina_stringshare_del(m->label); + eina_stringshare_del(m->label); EINA_INLIST_FOREACH_SAFE(m->sub_items, inlist, child) dbus_menu_free(child); if (m->parent) @@ -426,3 +426,4 @@ e_dbusmenu_update_cb_set(E_DBusMenu_Ctx *ctx, E_DBusMenu_Update_Cb cb) { ctx->update_cb = cb; } + diff --git a/src/bin/e_desk.c b/src/bin/e_desk.c index a465f471a..3dce7f9c8 100644 --- a/src/bin/e_desk.c +++ b/src/bin/e_desk.c @@ -107,7 +107,7 @@ e_desk_new(E_Zone *zone, int x, int y) if (!ok) { desk->window_profile = eina_stringshare_add - (e_config->desktop_default_window_profile); + (e_config->desktop_default_window_profile); } #endif return desk; @@ -374,8 +374,8 @@ e_desk_deskshow(E_Zone *zone) { if (bd->deskshow) { - bd->deskshow = 0; - e_border_uniconify(bd); + bd->deskshow = 0; + e_border_uniconify(bd); } } else @@ -453,7 +453,7 @@ e_desk_current_get(E_Zone *zone) { E_OBJECT_CHECK_RETURN(zone, NULL); E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, NULL); - + return e_desk_at_xy_get(zone, zone->desk_x_current, zone->desk_y_current); } @@ -550,7 +550,7 @@ e_desk_prev(E_Zone *zone) #if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8) EAPI void -e_desk_window_profile_set(E_Desk *desk, +e_desk_window_profile_set(E_Desk *desk, const char *profile) { E_Event_Desk_Window_Profile_Change *ev; @@ -568,10 +568,10 @@ e_desk_window_profile_set(E_Desk *desk, } EAPI void -e_desk_window_profile_add(int container, - int zone, - int desk_x, - int desk_y, +e_desk_window_profile_add(int container, + int zone, + int desk_x, + int desk_y, const char *profile) { E_Config_Desktop_Window_Profile *cfprof; @@ -666,6 +666,7 @@ e_desk_window_profile_update(void) } } } + #endif static void @@ -727,6 +728,7 @@ _e_desk_event_desk_name_change_free(void *data __UNUSED__, void *event) e_object_unref(E_OBJECT(ev->desk)); free(ev); } + #if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8) static void _e_desk_event_desk_window_profile_change_free(void *data __UNUSED__, void *event) @@ -736,6 +738,7 @@ _e_desk_event_desk_window_profile_change_free(void *data __UNUSED__, void *event e_object_unref(E_OBJECT(ev->desk)); E_FREE(ev); } + #endif static void _e_desk_show_begin(E_Desk *desk, int mode, int dx, int dy) @@ -1076,4 +1079,5 @@ _e_desk_window_profile_change_protocol_set(void) (man->root, e_config->use_desktop_window_profile); } } + #endif diff --git a/src/bin/e_deskenv.c b/src/bin/e_deskenv.c index f89b21dba..4bed4f172 100644 --- a/src/bin/e_deskenv.c +++ b/src/bin/e_deskenv.c @@ -58,3 +58,4 @@ e_deskenv_xmodmap_run(void) snprintf(buf2, sizeof(buf2), "xmodmap %s", buf); ecore_exe_run(buf2, NULL); } + diff --git a/src/bin/e_desklock.c b/src/bin/e_desklock.c index 63c095018..bfa7e74a0 100644 --- a/src/bin/e_desklock.c +++ b/src/bin/e_desklock.c @@ -17,7 +17,7 @@ typedef struct _E_Desklock_Popup_Data E_Desklock_Popup_Data; typedef struct _E_Desklock_Auth E_Desklock_Auth; #endif -typedef struct _E_Desklock_Run E_Desklock_Run; +typedef struct _E_Desklock_Run E_Desklock_Run; struct _E_Desklock_Popup_Data { @@ -28,20 +28,20 @@ struct _E_Desklock_Popup_Data struct _E_Desklock_Data { - Eina_List *elock_wnd_list; - Ecore_X_Window elock_wnd; - Eina_List *handlers; + Eina_List *elock_wnd_list; + Ecore_X_Window elock_wnd; + Eina_List *handlers; Ecore_Event_Handler *move_handler; - Ecore_X_Window elock_grab_break_wnd; - char passwd[PASSWD_LEN]; - int state; - Eina_Bool selected : 1; + Ecore_X_Window elock_grab_break_wnd; + char passwd[PASSWD_LEN]; + int state; + Eina_Bool selected : 1; }; struct _E_Desklock_Run { E_Order *desk_run; - int position; + int position; }; #ifdef HAVE_PAM @@ -133,7 +133,7 @@ e_desklock_init(void) E_EVENT_DESKLOCK = ecore_event_type_new(); _e_desklock_run_handler = ecore_event_handler_add(E_EVENT_DESKLOCK, - _e_desklock_cb_run, NULL); + _e_desklock_cb_run, NULL); return 1; } @@ -202,7 +202,7 @@ e_desklock_show_autolocked(void) { if ((e_config->screen_actions_fullscreen_windows_ignore) || ((!e_config->screen_actions_fullscreen_windows_ignore) && (!e_util_fullscreen_any()))) - return 0; + return 0; if (_e_desklock_autolock_time < 1.0) _e_desklock_autolock_time = ecore_loop_time_get(); return e_desklock_show(EINA_FALSE); @@ -657,7 +657,7 @@ _e_desklock_cb_zone_del(void *data __UNUSED__, if (!edd) return ECORE_CALLBACK_PASS_ON; if ((eina_list_count(e_container_current_get(e_manager_current_get())->zones) == 1) && (e_config->desklock_login_box_zone == -2)) edd->move_handler = ecore_event_handler_del(edd->move_handler); - + l = _e_desklock_popup_find(ev->zone); if (l) { @@ -801,8 +801,9 @@ _e_desklock_passwd_update(void) *pp = 0; EINA_LIST_FOREACH(edd->elock_wnd_list, l, edp) - if (edp->login_box) edje_object_part_text_set(edp->login_box, "e.text.password", - passwd_hidden); + if (edp->login_box) + edje_object_part_text_set(edp->login_box, "e.text.password", + passwd_hidden); } static void @@ -885,7 +886,7 @@ _e_desklock_check_auth(void) if (e_config->desklock_auth_method == 0) { int ret; - + ret = _desklock_auth(edd->passwd); // passwd off in child proc now - null out from parent memset(edd->passwd, 0, sizeof(char) * PASSWD_LEN); @@ -894,20 +895,20 @@ _e_desklock_check_auth(void) else if (e_config->desklock_auth_method == 1) { #endif - if ((e_config->desklock_personal_passwd) && - (!strcmp(!edd->passwd ? "" : edd->passwd, - !e_config->desklock_personal_passwd ? "" : - e_config->desklock_personal_passwd))) - { - /* password ok */ - /* security - null out passwd string once we are done with it */ - memset(edd->passwd, 0, sizeof(char) * PASSWD_LEN); - e_desklock_hide(); - return 1; - } -#ifdef HAVE_PAM + if ((e_config->desklock_personal_passwd) && + (!strcmp(!edd->passwd ? "" : edd->passwd, + !e_config->desklock_personal_passwd ? "" : + e_config->desklock_personal_passwd))) + { + /* password ok */ + /* security - null out passwd string once we are done with it */ + memset(edd->passwd, 0, sizeof(char) * PASSWD_LEN); + e_desklock_hide(); + return 1; } - +#ifdef HAVE_PAM +} + #endif /* password is definitely wrong */ _e_desklock_state_set(E_DESKLOCK_STATE_INVALID); @@ -1356,7 +1357,7 @@ _e_desklock_job(void *data __UNUSED__) E_Desklock_Run *task; job = NULL; - if (!tasks) return ; + if (!tasks) return; task = eina_list_data_get(tasks); if (!_e_desklock_run(task)) diff --git a/src/bin/e_dnd.c b/src/bin/e_dnd.c index ac04464f1..e627b0e51 100644 --- a/src/bin/e_dnd.c +++ b/src/bin/e_dnd.c @@ -349,7 +349,7 @@ e_drop_xds_update(Eina_Bool enable, const char *value) size_t len; enable = !!enable; - + xwin = ecore_x_selection_owner_get(ECORE_X_ATOM_SELECTION_XDND); if (enable) { @@ -364,7 +364,7 @@ e_drop_xds_update(Eina_Bool enable, const char *value) snprintf(buf, sizeof(buf), "file://%s/", value); strncat(buf, file, size); free(file); - ecore_x_window_prop_property_set(xwin, _xds_atom, _text_atom, 8, (void*)buf, size + len + 8); + ecore_x_window_prop_property_set(xwin, _xds_atom, _text_atom, 8, (void *)buf, size + len + 8); } else ecore_x_window_prop_property_del(xwin, _xds_atom); @@ -621,9 +621,10 @@ _e_drag_coords_update(const E_Drop_Handler *h, int *dx, int *dy) { switch (h->obj->type) { - E_Gadcon *gc; + E_Gadcon *gc; + case E_GADCON_TYPE: - gc = (E_Gadcon*)h->obj; + gc = (E_Gadcon *)h->obj; e_gadcon_canvas_zone_geometry_get(gc, &px, &py, NULL, NULL); if (!gc->toolbar) break; px += gc->toolbar->fwin->x; @@ -1374,7 +1375,7 @@ _e_dnd_cb_event_dnd_finished(void *data __UNUSED__, int type __UNUSED__, void *e ev = event; if (!ev->completed) return ECORE_CALLBACK_PASS_ON; -*/ + */ if (_drag_current) { E_Drag *tmp; diff --git a/src/bin/e_dpms.c b/src/bin/e_dpms.c index a7bac0008..8c0c07445 100644 --- a/src/bin/e_dpms.c +++ b/src/bin/e_dpms.c @@ -14,7 +14,6 @@ static unsigned int _e_dpms_timeout_suspend = 0; static unsigned int _e_dpms_timeout_off = 0; static int _e_dpms_enabled = EINA_FALSE; - EAPI void e_dpms_update(void) { @@ -63,12 +62,12 @@ e_dpms_force_update(void) unsigned int standby = 0, suspend = 0, off = 0; int enabled; - enabled = ((e_config->screensaver_enable) && + enabled = ((e_config->screensaver_enable) && (!e_config->mode.presentation) && (!e_util_fullscreen_current_any())); ecore_x_dpms_enabled_set(enabled); if (!enabled) return; - + if (e_config->screensaver_enable) { off = suspend = standby = e_screensaver_timeout_get(EINA_FALSE); @@ -112,28 +111,28 @@ EINTERN int e_dpms_init(void) { _e_dpms_handler_config_mode = ecore_event_handler_add - (E_EVENT_CONFIG_MODE_CHANGED, _e_dpms_handler_config_mode_cb, NULL); + (E_EVENT_CONFIG_MODE_CHANGED, _e_dpms_handler_config_mode_cb, NULL); _e_dpms_handler_border_fullscreen = ecore_event_handler_add - (E_EVENT_BORDER_FULLSCREEN, _e_dpms_handler_border_fullscreen_check_cb, NULL); + (E_EVENT_BORDER_FULLSCREEN, _e_dpms_handler_border_fullscreen_check_cb, NULL); _e_dpms_handler_border_unfullscreen = ecore_event_handler_add - (E_EVENT_BORDER_UNFULLSCREEN, _e_dpms_handler_border_fullscreen_check_cb, NULL); + (E_EVENT_BORDER_UNFULLSCREEN, _e_dpms_handler_border_fullscreen_check_cb, NULL); _e_dpms_handler_border_remove = ecore_event_handler_add - (E_EVENT_BORDER_REMOVE, _e_dpms_handler_border_fullscreen_check_cb, NULL); + (E_EVENT_BORDER_REMOVE, _e_dpms_handler_border_fullscreen_check_cb, NULL); _e_dpms_handler_border_iconify = ecore_event_handler_add - (E_EVENT_BORDER_ICONIFY, _e_dpms_handler_border_fullscreen_check_cb, NULL); + (E_EVENT_BORDER_ICONIFY, _e_dpms_handler_border_fullscreen_check_cb, NULL); _e_dpms_handler_border_uniconify = ecore_event_handler_add - (E_EVENT_BORDER_UNICONIFY, _e_dpms_handler_border_fullscreen_check_cb, NULL); + (E_EVENT_BORDER_UNICONIFY, _e_dpms_handler_border_fullscreen_check_cb, NULL); _e_dpms_handler_border_desk_set = ecore_event_handler_add - (E_EVENT_BORDER_DESK_SET, _e_dpms_handler_border_desk_set_cb, NULL); + (E_EVENT_BORDER_DESK_SET, _e_dpms_handler_border_desk_set_cb, NULL); _e_dpms_handler_desk_show = ecore_event_handler_add - (E_EVENT_DESK_SHOW, _e_dpms_handler_desk_show_cb, NULL); + (E_EVENT_DESK_SHOW, _e_dpms_handler_desk_show_cb, NULL); _e_dpms_enabled = ecore_x_dpms_enabled_get(); ecore_x_dpms_timeouts_get @@ -197,3 +196,4 @@ e_dpms_shutdown(void) return 1; } + diff --git a/src/bin/e_entry.c b/src/bin/e_entry.c index d819e7853..5291d0933 100644 --- a/src/bin/e_entry.c +++ b/src/bin/e_entry.c @@ -6,50 +6,49 @@ typedef struct _E_Entry_Smart_Data E_Entry_Smart_Data; struct _E_Entry_Smart_Data { - Evas_Object *entry_object; - Evas_Object *scroll_object; - E_Menu *popup; + Evas_Object *entry_object; + Evas_Object *scroll_object; + E_Menu *popup; Ecore_Event_Handler *selection_handler; - int min_width; - int height; - Evas_Coord theme_width; - Evas_Coord theme_height; - int preedit_start_pos; - int preedit_end_pos; - int changing; - Eina_Bool enabled : 1; - Eina_Bool noedit : 1; - Eina_Bool focused : 1; - Eina_Bool password_mode : 1; + int min_width; + int height; + Evas_Coord theme_width; + Evas_Coord theme_height; + int preedit_start_pos; + int preedit_end_pos; + int changing; + Eina_Bool enabled : 1; + Eina_Bool noedit : 1; + Eina_Bool focused : 1; + Eina_Bool password_mode : 1; }; /* local subsystem functions */ static Eina_Bool _e_entry_x_selection_notify_handler(void *data, int type, void *event); -static void _e_entry_x_selection_update(Evas_Object *entry); +static void _e_entry_x_selection_update(Evas_Object *entry); -static void _e_entry_smart_add(Evas_Object *object); -static void _e_entry_smart_del(Evas_Object *object); -static void _e_entry_smart_move(Evas_Object *object, Evas_Coord x, Evas_Coord y); -static void _e_entry_smart_resize(Evas_Object *object, Evas_Coord w, Evas_Coord h); -static void _e_entry_smart_show(Evas_Object *object); -static void _e_entry_smart_hide(Evas_Object *object); -static void _e_entry_color_set(Evas_Object *object, int r, int g, int b, int a); -static void _e_entry_clip_set(Evas_Object *object, Evas_Object *clip); -static void _e_entry_clip_unset(Evas_Object *object); -static void _e_entry_cb_menu_post(void *data, E_Menu *m); -static void _e_entry_cb_cut(void *data, E_Menu *m, E_Menu_Item *mi); -static void _e_entry_cb_copy(void *data, E_Menu *m, E_Menu_Item *mi); -static void _e_entry_cb_paste(void *data, E_Menu *m, E_Menu_Item *mi); -static void _e_entry_cb_select_all(void *data, E_Menu *m, E_Menu_Item *mi); -static void _e_entry_cb_delete(void *data, E_Menu *m , E_Menu_Item *mi ); -static void _e_entry_mouse_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _e_entry_smart_add(Evas_Object *object); +static void _e_entry_smart_del(Evas_Object *object); +static void _e_entry_smart_move(Evas_Object *object, Evas_Coord x, Evas_Coord y); +static void _e_entry_smart_resize(Evas_Object *object, Evas_Coord w, Evas_Coord h); +static void _e_entry_smart_show(Evas_Object *object); +static void _e_entry_smart_hide(Evas_Object *object); +static void _e_entry_color_set(Evas_Object *object, int r, int g, int b, int a); +static void _e_entry_clip_set(Evas_Object *object, Evas_Object *clip); +static void _e_entry_clip_unset(Evas_Object *object); +static void _e_entry_cb_menu_post(void *data, E_Menu *m); +static void _e_entry_cb_cut(void *data, E_Menu *m, E_Menu_Item *mi); +static void _e_entry_cb_copy(void *data, E_Menu *m, E_Menu_Item *mi); +static void _e_entry_cb_paste(void *data, E_Menu *m, E_Menu_Item *mi); +static void _e_entry_cb_select_all(void *data, E_Menu *m, E_Menu_Item *mi); +static void _e_entry_cb_delete(void *data, E_Menu *m, E_Menu_Item *mi); +static void _e_entry_mouse_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info); /* local subsystem globals */ static Evas_Smart *_e_entry_smart = NULL; static int _e_entry_smart_use = 0; - /* externally accessible functions */ /** @@ -67,26 +66,26 @@ e_entry_add(Evas *evas) if (!_e_entry_smart) { static const Evas_Smart_Class sc = - { - "e_entry", - EVAS_SMART_CLASS_VERSION, - _e_entry_smart_add, - _e_entry_smart_del, - _e_entry_smart_move, - _e_entry_smart_resize, - _e_entry_smart_show, - _e_entry_smart_hide, - _e_entry_color_set, - _e_entry_clip_set, - _e_entry_clip_unset, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL - }; + { + "e_entry", + EVAS_SMART_CLASS_VERSION, + _e_entry_smart_add, + _e_entry_smart_del, + _e_entry_smart_move, + _e_entry_smart_resize, + _e_entry_smart_show, + _e_entry_smart_hide, + _e_entry_color_set, + _e_entry_clip_set, + _e_entry_clip_unset, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL + }; _e_entry_smart = evas_smart_class_new(&sc); _e_entry_smart_use = 0; } @@ -113,8 +112,8 @@ e_entry_text_set(Evas_Object *entry, const char *_text) return; text = evas_textblock_text_utf8_to_markup( - edje_object_part_object_get(sd->entry_object, ENTRY_PART_NAME), - _text); + edje_object_part_object_get(sd->entry_object, ENTRY_PART_NAME), + _text); otext = edje_object_part_text_get(sd->entry_object, ENTRY_PART_NAME); if ((text) && (otext) && (!strcmp(text, otext))) { @@ -151,8 +150,8 @@ e_entry_text_get(Evas_Object *entry) E_FREE(text); } text = evas_textblock_text_markup_to_utf8( - edje_object_part_object_get(sd->entry_object, ENTRY_PART_NAME), - edje_object_part_text_get(sd->entry_object, ENTRY_PART_NAME)); + edje_object_part_object_get(sd->entry_object, ENTRY_PART_NAME), + edje_object_part_text_get(sd->entry_object, ENTRY_PART_NAME)); return text; } @@ -202,16 +201,16 @@ e_entry_password_set(Evas_Object *entry, int password_mode) if ((!entry) || (!(sd = evas_object_smart_data_get(entry)))) return; if (sd->password_mode == password_mode) - return; + return; text = eina_stringshare_add( - edje_object_part_text_get(sd->entry_object, ENTRY_PART_NAME)); + edje_object_part_text_get(sd->entry_object, ENTRY_PART_NAME)); sd->password_mode = !!password_mode; if (!sd->password_mode) - e_theme_edje_object_set(sd->entry_object, "base/theme/widgets", "e/widgets/entry/text"); + e_theme_edje_object_set(sd->entry_object, "base/theme/widgets", "e/widgets/entry/text"); else - e_theme_edje_object_set(sd->entry_object, "base/theme/widgets", "e/widgets/entry/password"); + e_theme_edje_object_set(sd->entry_object, "base/theme/widgets", "e/widgets/entry/password"); /* Set the text back. */ if (text) @@ -273,7 +272,7 @@ e_entry_focus(Evas_Object *entry) edje_object_part_text_cursor_end_set(sd->entry_object, ENTRY_PART_NAME, EDJE_CURSOR_MAIN); if ((sd->enabled) && (!sd->noedit)) - edje_object_signal_emit(sd->entry_object, "e,action,show,cursor", "e"); + edje_object_signal_emit(sd->entry_object, "e,action,show,cursor", "e"); sd->focused = EINA_TRUE; } @@ -318,10 +317,10 @@ e_entry_enable(Evas_Object *entry) return; edje_object_signal_emit(e_scrollframe_edje_object_get(sd->scroll_object), - "e,state,enabled", "e"); + "e,state,enabled", "e"); edje_object_signal_emit(sd->entry_object, "e,state,enabled", "e"); if (sd->focused) - edje_object_signal_emit(sd->entry_object, "e,action,show,cursor", "e"); + edje_object_signal_emit(sd->entry_object, "e,action,show,cursor", "e"); sd->enabled = EINA_TRUE; } @@ -343,7 +342,7 @@ e_entry_disable(Evas_Object *entry) return; edje_object_signal_emit(e_scrollframe_edje_object_get(sd->scroll_object), - "e,state,disabled", "e"); + "e,state,disabled", "e"); edje_object_signal_emit(sd->entry_object, "e,state,disabled", "e"); edje_object_signal_emit(sd->entry_object, "e,action,hide,cursor", "e"); sd->enabled = EINA_FALSE; @@ -367,7 +366,7 @@ e_entry_edit(Evas_Object *entry) sd->noedit = EINA_FALSE; edje_object_signal_emit(e_scrollframe_edje_object_get(sd->scroll_object), - "e,state,edit", "e"); + "e,state,edit", "e"); edje_object_signal_emit(sd->entry_object, "e,state,edit", "e"); if (sd->focused) { @@ -395,7 +394,7 @@ e_entry_noedit(Evas_Object *entry) sd->noedit = EINA_TRUE; edje_object_signal_emit(e_scrollframe_edje_object_get(sd->scroll_object), - "e,state,noedit", "e"); + "e,state,noedit", "e"); edje_object_signal_emit(sd->entry_object, "e,state,noedit", "e"); edje_object_signal_emit(sd->entry_object, "e,action,hide,cursor", "e"); } @@ -408,7 +407,7 @@ e_entry_nomenu(Evas_Object *entry) { if (evas_object_smart_smart_get(entry) != _e_entry_smart) SMARTERRNR(); evas_object_event_callback_del_full(entry, EVAS_CALLBACK_MOUSE_DOWN, - _e_entry_mouse_down_cb, entry); + _e_entry_mouse_down_cb, entry); } /* Private functions */ @@ -432,7 +431,6 @@ _e_entry_is_empty(const Evas_Object *entry_edje) evas_textblock_cursor_free(cur); return !ret; - } /* Called when the entry object is pressed by the mouse */ @@ -480,10 +478,10 @@ _e_entry_mouse_down_cb(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *o e_menu_item_label_set(mi, _("Delete")); e_util_menu_item_theme_icon_set(mi, "edit-delete"); e_menu_item_callback_set(mi, _e_entry_cb_delete, sd); - + mi = e_menu_item_new(sd->popup); e_menu_item_separator_set(mi, 1); - + if (!s_passwd) { mi = e_menu_item_new(sd->popup); @@ -543,20 +541,20 @@ _e_entry_x_selection_notify_handler(void *data, int type __UNUSED__, void *event ev = event; if (((ev->selection == ECORE_X_SELECTION_CLIPBOARD) || - (ev->selection == ECORE_X_SELECTION_PRIMARY)) && - (strcmp(ev->target, ECORE_X_SELECTION_TARGET_UTF8_STRING) == 0)) + (ev->selection == ECORE_X_SELECTION_PRIMARY)) && + (strcmp(ev->target, ECORE_X_SELECTION_TARGET_UTF8_STRING) == 0)) { Ecore_X_Selection_Data_Text *text_data; text_data = ev->data; if ((text_data->data.content == ECORE_X_SELECTION_CONTENT_TEXT) && - (text_data->text)) + (text_data->text)) { char *txt = evas_textblock_text_utf8_to_markup(NULL, text_data->text); if (txt) { edje_object_part_text_user_insert(sd->entry_object, - ENTRY_PART_NAME, txt); + ENTRY_PART_NAME, txt); free(txt); } } @@ -591,7 +589,7 @@ _e_entry_x_selection_update(Evas_Object *entry) xwin = win->evas_win; if (sd->password_mode) - return; + return; text = edje_object_part_text_selection_get(sd->entry_object, ENTRY_PART_NAME); if (text) @@ -600,14 +598,14 @@ _e_entry_x_selection_update(Evas_Object *entry) static void _entry_paste_request_signal_cb(void *data, - Evas_Object *obj EINA_UNUSED, - const char *emission, - const char *source EINA_UNUSED) + Evas_Object *obj EINA_UNUSED, + const char *emission, + const char *source EINA_UNUSED) { Ecore_X_Window xwin; E_Win *win; E_Container *con; - + if (!(win = e_win_evas_object_win_get(data))) { xwin = e_grabinput_key_win_get(); @@ -624,38 +622,38 @@ _entry_paste_request_signal_cb(void *data, if (emission[sizeof("ntry,paste,request,")] == '1') { ecore_x_selection_primary_request(xwin, - ECORE_X_SELECTION_TARGET_UTF8_STRING); + ECORE_X_SELECTION_TARGET_UTF8_STRING); } else { ecore_x_selection_clipboard_request(xwin, - ECORE_X_SELECTION_TARGET_UTF8_STRING); + ECORE_X_SELECTION_TARGET_UTF8_STRING); } } static void _entry_selection_changed_signal_cb(void *data, - Evas_Object *obj EINA_UNUSED, - const char *emission EINA_UNUSED, - const char *source EINA_UNUSED) + Evas_Object *obj EINA_UNUSED, + const char *emission EINA_UNUSED, + const char *source EINA_UNUSED) { _e_entry_x_selection_update(data); } static void _entry_selection_all_signal_cb(void *data, - Evas_Object *obj EINA_UNUSED, - const char *emission EINA_UNUSED, - const char *source EINA_UNUSED) + Evas_Object *obj EINA_UNUSED, + const char *emission EINA_UNUSED, + const char *source EINA_UNUSED) { e_entry_select_all(data); } static void _entry_copy_notify_signal_cb(void *data, - Evas_Object *obj EINA_UNUSED, - const char *emission EINA_UNUSED, - const char *source EINA_UNUSED) + Evas_Object *obj EINA_UNUSED, + const char *emission EINA_UNUSED, + const char *source EINA_UNUSED) { E_Entry_Smart_Data *sd; @@ -667,9 +665,9 @@ _entry_copy_notify_signal_cb(void *data, static void _entry_cut_notify_signal_cb(void *data, - Evas_Object *obj EINA_UNUSED, - const char *emission EINA_UNUSED, - const char *source EINA_UNUSED) + Evas_Object *obj EINA_UNUSED, + const char *emission EINA_UNUSED, + const char *source EINA_UNUSED) { E_Entry_Smart_Data *sd; @@ -698,9 +696,9 @@ _entry_recalc_size(Evas_Object *object) static void _entry_changed_signal_cb(void *data, - Evas_Object *obj EINA_UNUSED, - const char *emission EINA_UNUSED, - const char *source EINA_UNUSED) + Evas_Object *obj EINA_UNUSED, + const char *emission EINA_UNUSED, + const char *source EINA_UNUSED) { Evas_Object *object = data; E_Entry_Smart_Data *sd; @@ -715,9 +713,9 @@ _entry_changed_signal_cb(void *data, static void _entry_cursor_changed_signal_cb(void *data, - Evas_Object *obj EINA_UNUSED, - const char *emission EINA_UNUSED, - const char *source EINA_UNUSED) + Evas_Object *obj EINA_UNUSED, + const char *emission EINA_UNUSED, + const char *source EINA_UNUSED) { Evas_Object *object = data; E_Entry_Smart_Data *sd; @@ -727,7 +725,7 @@ _entry_cursor_changed_signal_cb(void *data, return; edje_object_part_text_cursor_geometry_get(sd->entry_object, ENTRY_PART_NAME, - &cx, &cy, &cw, &ch); + &cx, &cy, &cw, &ch); e_scrollframe_child_region_show(sd->scroll_object, cx, cy, cw, ch); } @@ -763,7 +761,7 @@ _e_entry_smart_add(Evas_Object *object) evas_object_propagate_events_set(sd->scroll_object, EINA_TRUE); e_scrollframe_custom_theme_set(sd->scroll_object, "base/theme/widgets", "e/widgets/entry/scrollframe"); edje_object_size_min_calc(e_scrollframe_edje_object_get(sd->scroll_object), - &sd->theme_width, &sd->theme_height); + &sd->theme_width, &sd->theme_height); evas_object_smart_member_add(sd->scroll_object, object); evas_object_show(sd->scroll_object); @@ -778,28 +776,28 @@ _e_entry_smart_add(Evas_Object *object) evas_object_show(o); evas_object_event_callback_add(object, EVAS_CALLBACK_MOUSE_DOWN, - _e_entry_mouse_down_cb, object); + _e_entry_mouse_down_cb, object); edje_object_signal_callback_add(sd->entry_object, - "selection,changed", ENTRY_PART_NAME, - _entry_selection_changed_signal_cb, object); + "selection,changed", ENTRY_PART_NAME, + _entry_selection_changed_signal_cb, object); edje_object_signal_callback_add(sd->entry_object, - "entry,selection,all,request", ENTRY_PART_NAME, - _entry_selection_all_signal_cb, object); + "entry,selection,all,request", ENTRY_PART_NAME, + _entry_selection_all_signal_cb, object); edje_object_signal_callback_add(sd->entry_object, - "entry,changed", ENTRY_PART_NAME, - _entry_changed_signal_cb, object); + "entry,changed", ENTRY_PART_NAME, + _entry_changed_signal_cb, object); edje_object_signal_callback_add(sd->entry_object, - "entry,paste,request,*", ENTRY_PART_NAME, - _entry_paste_request_signal_cb, object); + "entry,paste,request,*", ENTRY_PART_NAME, + _entry_paste_request_signal_cb, object); edje_object_signal_callback_add(sd->entry_object, - "entry,copy,notify", ENTRY_PART_NAME, - _entry_copy_notify_signal_cb, object); + "entry,copy,notify", ENTRY_PART_NAME, + _entry_copy_notify_signal_cb, object); edje_object_signal_callback_add(sd->entry_object, - "entry,cut,notify", ENTRY_PART_NAME, - _entry_cut_notify_signal_cb, object); + "entry,cut,notify", ENTRY_PART_NAME, + _entry_cut_notify_signal_cb, object); edje_object_signal_callback_add(sd->entry_object, - "cursor,changed", ENTRY_PART_NAME, - _entry_cursor_changed_signal_cb, object); + "cursor,changed", ENTRY_PART_NAME, + _entry_cursor_changed_signal_cb, object); _entry_recalc_size(object); @@ -817,29 +815,29 @@ _e_entry_smart_del(Evas_Object *object) return; evas_object_event_callback_del_full(object, EVAS_CALLBACK_MOUSE_DOWN, - _e_entry_mouse_down_cb, object); + _e_entry_mouse_down_cb, object); edje_object_signal_callback_del_full(sd->entry_object, - "selection,changed", ENTRY_PART_NAME, - _entry_selection_changed_signal_cb, object); + "selection,changed", ENTRY_PART_NAME, + _entry_selection_changed_signal_cb, object); edje_object_signal_callback_del_full(sd->entry_object, - "entry,selection,all,request", ENTRY_PART_NAME, - _entry_selection_all_signal_cb, object); + "entry,selection,all,request", ENTRY_PART_NAME, + _entry_selection_all_signal_cb, object); edje_object_signal_callback_del_full(sd->entry_object, - "entry,changed", ENTRY_PART_NAME, - _entry_changed_signal_cb, object); + "entry,changed", ENTRY_PART_NAME, + _entry_changed_signal_cb, object); edje_object_signal_callback_del_full(sd->entry_object, - "entry,paste,request,*", ENTRY_PART_NAME, - _entry_paste_request_signal_cb, object); + "entry,paste,request,*", ENTRY_PART_NAME, + _entry_paste_request_signal_cb, object); edje_object_signal_callback_del_full(sd->entry_object, - "entry,copy,notify", ENTRY_PART_NAME, - _entry_copy_notify_signal_cb, object); + "entry,copy,notify", ENTRY_PART_NAME, + _entry_copy_notify_signal_cb, object); edje_object_signal_callback_del_full(sd->entry_object, - "entry,cut,notify", ENTRY_PART_NAME, - _entry_cut_notify_signal_cb, object); + "entry,cut,notify", ENTRY_PART_NAME, + _entry_cut_notify_signal_cb, object); edje_object_signal_callback_del_full(sd->entry_object, - "cursor,changed", ENTRY_PART_NAME, - _entry_cursor_changed_signal_cb, object); + "cursor,changed", ENTRY_PART_NAME, + _entry_cursor_changed_signal_cb, object); if (sd->selection_handler) ecore_event_handler_del(sd->selection_handler); evas_object_del(sd->entry_object); diff --git a/src/bin/e_env.c b/src/bin/e_env.c index 3b0adef47..719a276b7 100644 --- a/src/bin/e_env.c +++ b/src/bin/e_env.c @@ -12,9 +12,9 @@ e_env_init(void) EINA_LIST_FOREACH(e_config->env_vars, l, evr) { if (evr->unset) - e_env_unset(evr->var); + e_env_unset(evr->var); else - e_env_set(evr->var, evr->val); + e_env_set(evr->var, evr->val); } return 1; } diff --git a/src/bin/e_exec.c b/src/bin/e_exec.c index c9f4780af..4f75dfd04 100644 --- a/src/bin/e_exec.c +++ b/src/bin/e_exec.c @@ -11,7 +11,7 @@ typedef struct _E_Exec_Launch E_Exec_Launch; typedef struct _E_Exec_Search E_Exec_Search; -typedef struct _E_Exec_Watch E_Exec_Watch; +typedef struct _E_Exec_Watch E_Exec_Watch; struct _E_Exec_Launch { @@ -29,9 +29,9 @@ struct _E_Exec_Search struct _E_Exec_Watch { - void (*func) (void *data, E_Exec_Instance *inst, E_Exec_Watch_Type type); + void (*func)(void *data, E_Exec_Instance *inst, E_Exec_Watch_Type type); const void *data; - Eina_Bool delete_me : 1; + Eina_Bool delete_me : 1; }; struct _E_Config_Dialog_Data @@ -71,7 +71,7 @@ static int startup_id = 0; static Ecore_Event_Handler *_e_exec_exit_handler = NULL; static Ecore_Event_Handler *_e_exec_border_add_handler = NULL; -static E_Exec_Instance *(*_e_exec_executor_func) (void *data, E_Zone *zone, Efreet_Desktop *desktop, const char *exec, Eina_List *files, const char *launch_method) = NULL; +static E_Exec_Instance *(*_e_exec_executor_func)(void *data, E_Zone * zone, Efreet_Desktop * desktop, const char *exec, Eina_List *files, const char *launch_method) = NULL; static void *_e_exec_executor_data = NULL; /* externally accessible functions */ @@ -106,7 +106,7 @@ e_exec_shutdown(void) } EAPI void -e_exec_executor_set(E_Exec_Instance *(*func) (void *data, E_Zone *zone, Efreet_Desktop *desktop, const char *exec, Eina_List *files, const char *launch_method), const void *data) +e_exec_executor_set(E_Exec_Instance *(*func)(void *data, E_Zone * zone, Efreet_Desktop * desktop, const char *exec, Eina_List *files, const char *launch_method), const void *data) { _e_exec_executor_func = func; _e_exec_executor_data = (void *)data; @@ -120,7 +120,7 @@ e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec, E_Exec_Instance *inst = NULL; if ((!desktop) && (!exec)) return NULL; - + if (_e_exec_executor_func) return _e_exec_executor_func(_e_exec_executor_data, zone, desktop, exec, files, launch_method); @@ -128,34 +128,34 @@ e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec, if (desktop) { const char *single; - + single = eina_hash_find(desktop->x, "X-Enlightenment-Single-Instance"); if ((single) || (e_config->exe_always_single_instance)) { Eina_Bool dosingle = EINA_FALSE; - + // first take system config for always single instance if set if (e_config->exe_always_single_instance) dosingle = EINA_TRUE; - + // and now let desktop file override it if (single) { if ((!strcasecmp(single, "true")) || - (!strcasecmp(single, "yes"))|| + (!strcasecmp(single, "yes")) || (!strcasecmp(single, "1"))) dosingle = EINA_TRUE; else if ((!strcasecmp(single, "false")) || - (!strcasecmp(single, "no"))|| + (!strcasecmp(single, "no")) || (!strcasecmp(single, "0"))) dosingle = EINA_FALSE; } - + if (dosingle) { Eina_List *l; E_Border *bd; - + EINA_LIST_FOREACH(e_border_client_list(), l, bd) { if (bd && bd->desktop == desktop) @@ -170,7 +170,7 @@ e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec, } } } - + launch = E_NEW(E_Exec_Launch, 1); if (!launch) return NULL; if (zone) @@ -187,7 +187,7 @@ e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec, inst = _e_exec_cb_exec(launch, NULL, strdup(exec), 0); else inst = efreet_desktop_command_get - (desktop, files, (Efreet_Desktop_Command_Cb)_e_exec_cb_exec, launch); + (desktop, files, (Efreet_Desktop_Command_Cb)_e_exec_cb_exec, launch); } else inst = _e_exec_cb_exec(launch, NULL, strdup(exec), 0); @@ -227,7 +227,7 @@ EAPI E_Exec_Instance * e_exec_startup_desktop_instance_find(Efreet_Desktop *desktop) { E_Exec_Search search; - + search.inst = NULL; search.desktop = desktop; search.startup_id = 0; @@ -241,7 +241,7 @@ _e_exe_instance_watchers_call(E_Exec_Instance *inst, E_Exec_Watch_Type type) { E_Exec_Watch *iw; Eina_List *l, *ln; - + inst->walking++; EINA_LIST_FOREACH(inst->watchers, l, iw) { @@ -268,10 +268,10 @@ e_exec_instance_found(E_Exec_Instance *inst) } EAPI void -e_exec_instance_watcher_add(E_Exec_Instance *inst, void (*func) (void *data, E_Exec_Instance *inst, E_Exec_Watch_Type type), const void *data) +e_exec_instance_watcher_add(E_Exec_Instance *inst, void (*func)(void *data, E_Exec_Instance *inst, E_Exec_Watch_Type type), const void *data) { E_Exec_Watch *iw; - + iw = E_NEW(E_Exec_Watch, 1); if (!iw) return; iw->func = func; @@ -280,11 +280,11 @@ e_exec_instance_watcher_add(E_Exec_Instance *inst, void (*func) (void *data, E_E } EAPI void -e_exec_instance_watcher_del(E_Exec_Instance *inst, void (*func) (void *data, E_Exec_Instance *inst, E_Exec_Watch_Type type), const void *data) +e_exec_instance_watcher_del(E_Exec_Instance *inst, void (*func)(void *data, E_Exec_Instance *inst, E_Exec_Watch_Type type), const void *data) { E_Exec_Watch *iw; Eina_List *l, *ln; - + EINA_LIST_FOREACH_SAFE(inst->watchers, l, ln, iw) { if ((iw->func == func) && (iw->data == data)) @@ -398,7 +398,7 @@ _e_exec_cb_exec(void *data, Efreet_Desktop *desktop, char *exec, int remaining) free(inst); e_util_dialog_show (_("Run Error"), - _("Enlightenment was unable to get current directory")); + _("Enlightenment was unable to get current directory")); return NULL; } if (chdir(desktop->path)) @@ -406,10 +406,10 @@ _e_exec_cb_exec(void *data, Efreet_Desktop *desktop, char *exec, int remaining) free(inst); e_util_dialog_show (_("Run Error"), - _("Enlightenment was unable to change to directory:
" - "
" - "%s"), - desktop->path); + _("Enlightenment was unable to change to directory:
" + "
" + "%s"), + desktop->path); return NULL; } exe = ecore_exe_run(exec, inst); @@ -417,10 +417,10 @@ _e_exec_cb_exec(void *data, Efreet_Desktop *desktop, char *exec, int remaining) { e_util_dialog_show (_("Run Error"), - _("Enlightenment was unable to restore to directory:
" - "
" - "%s"), - buf); + _("Enlightenment was unable to restore to directory:
" + "
" + "%s"), + buf); free(inst); return NULL; } @@ -430,7 +430,7 @@ _e_exec_cb_exec(void *data, Efreet_Desktop *desktop, char *exec, int remaining) if ((desktop) && (desktop->terminal)) { Efreet_Desktop *tdesktop; - + tdesktop = e_util_terminal_desktop_get(); if (tdesktop) { @@ -534,10 +534,11 @@ _e_exec_instance_free(E_Exec_Instance *inst) { Eina_List *instances; E_Exec_Watch *iw; - + _e_exe_instance_watchers_call(inst, E_EXEC_WATCH_STOPPED); - EINA_LIST_FREE(inst->watchers, iw) free(iw); - + EINA_LIST_FREE(inst->watchers, iw) + free(iw); + if (inst->key) { instances = eina_hash_find(e_exec_instances, inst->key); @@ -558,14 +559,15 @@ _e_exec_instance_free(E_Exec_Instance *inst) if (inst->desktop) efreet_desktop_free(inst->desktop); free(inst); } + /* -static Eina_Bool -_e_exec_cb_instance_finish(void *data) -{ + static Eina_Bool + _e_exec_cb_instance_finish(void *data) + { _e_exec_instance_free(data); return ECORE_CALLBACK_CANCEL; -} -*/ + } + */ static Eina_Bool _e_exec_cb_exit(void *data __UNUSED__, int type __UNUSED__, void *event) @@ -640,7 +642,7 @@ _e_exec_cb_exit(void *data __UNUSED__, int type __UNUSED__, void *event) /* scripts that fork off children with & break child tracking... but this hack * also breaks apps that handle single-instance themselves */ -/* +/* if ((ecore_time_get() - inst->launch_time) < 2.0) { inst->exe = NULL; @@ -649,7 +651,7 @@ _e_exec_cb_exit(void *data __UNUSED__, int type __UNUSED__, void *event) } else */ - _e_exec_instance_free(inst); + _e_exec_instance_free(inst); return ECORE_CALLBACK_PASS_ON; } @@ -666,10 +668,10 @@ _e_exec_startup_id_pid_find(const Eina_Hash *hash __UNUSED__, const void *key __ { if (((search->desktop) && (search->desktop == inst->desktop)) || - + ((search->startup_id > 0) && (search->startup_id == inst->startup_id)) || - + ((inst->exe) && (search->pid > 1) && (search->pid == ecore_exe_pid_get(inst->exe)))) { @@ -1082,3 +1084,4 @@ _dialog_save_cb(void *data __UNUSED__, void *data2) fclose(f); } + diff --git a/src/bin/e_filereg.c b/src/bin/e_filereg.c index 4ee0f02a8..d92b508be 100644 --- a/src/bin/e_filereg.c +++ b/src/bin/e_filereg.c @@ -11,12 +11,12 @@ typedef struct _Filereg_Item Filereg_Item; struct _Filereg_Item { const char *path; - int ref_count; + int ref_count; }; static Eina_Bool _filereg_hash_cb_free(const Eina_Hash *hash __UNUSED__, - const void *key __UNUSED__, - void *data, void *fdata __UNUSED__); + const void *key __UNUSED__, + void *data, void *fdata __UNUSED__); /* Externally accessible functions */ EINTERN int @@ -44,8 +44,8 @@ e_filereg_register(const char *path) fi = eina_hash_find(_e_filereg, path); if (fi) { - fi->ref_count++; - return 1; + fi->ref_count++; + return 1; } fi = E_NEW(Filereg_Item, 1); if (!fi) return 0; @@ -63,13 +63,13 @@ e_filereg_deregister(const char *path) fi = eina_hash_find(_e_filereg, path); if (fi) { - fi->ref_count--; - if (fi->ref_count == 0) - { - eina_hash_del(_e_filereg, path, fi); - if (fi->path) eina_stringshare_del(fi->path); - E_FREE(fi); - } + fi->ref_count--; + if (fi->ref_count == 0) + { + eina_hash_del(_e_filereg, path, fi); + if (fi->path) eina_stringshare_del(fi->path); + E_FREE(fi); + } } } @@ -83,7 +83,7 @@ e_filereg_file_protected(const char *path) /* Private Functions */ static Eina_Bool _filereg_hash_cb_free(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, - void *data, void *fdata __UNUSED__) + void *data, void *fdata __UNUSED__) { Filereg_Item *fi; @@ -93,3 +93,4 @@ _filereg_hash_cb_free(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED E_FREE(fi); return EINA_TRUE; } + diff --git a/src/bin/e_fm.c b/src/bin/e_fm.c index c75f3c3b1..4ffff7c28 100644 --- a/src/bin/e_fm.c +++ b/src/bin/e_fm.c @@ -16,12 +16,13 @@ * being able to save/load icon placement. it doesn't support custom frames or icons yet */ -#define EFM_SMART_CHECK(args...) \ - E_Fm2_Smart_Data *sd; \ -\ - if (evas_object_smart_smart_get(obj) != _e_fm2_smart) SMARTERRNR() args; \ - sd = evas_object_smart_data_get(obj); \ - if ((!sd) || (e_util_strcmp(evas_object_type_get(obj), "e_fm"))) return args +#define EFM_SMART_CHECK(args ...) \ + E_Fm2_Smart_Data * sd; \ + \ + if (evas_object_smart_smart_get(obj) != _e_fm2_smart) SMARTERRNR() args; \ + sd = evas_object_smart_data_get(obj); \ + if ((!sd) || (e_util_strcmp(evas_object_type_get(obj), "e_fm"))) \ + return args typedef enum _E_Fm2_Action_Type { @@ -81,8 +82,8 @@ struct _E_Fm2_Smart_Data struct { - Ecore_Thread *thread; - const char *filename; + Ecore_Thread *thread; + const char *filename; } new_file; E_Fm2_Icon *last_selected; @@ -132,40 +133,40 @@ struct _E_Fm2_Smart_Data struct { char *buf; - const char *start; + const char *start; Ecore_Timer *timer; unsigned int wildcard; - Eina_Bool setting : 1; - Eina_Bool disabled : 1; + Eina_Bool setting : 1; + Eina_Bool disabled : 1; } typebuf; - int busy_count; + int busy_count; - E_Object *eobj; - E_Drop_Handler *drop_handler; - E_Fm2_Icon *drop_icon; - Ecore_Animator *dnd_scroller; - Evas_Point dnd_current; - Eina_List *mount_ops; - E_Fm2_Mount *mount; - signed char drop_after; - Eina_Bool drop_show : 1; - Eina_Bool drop_in_show : 1; - Eina_Bool drop_all : 1; - Eina_Bool drag : 1; - Eina_Bool selecting : 1; - Eina_Bool toomany : 1; + E_Object *eobj; + E_Drop_Handler *drop_handler; + E_Fm2_Icon *drop_icon; + Ecore_Animator *dnd_scroller; + Evas_Point dnd_current; + Eina_List *mount_ops; + E_Fm2_Mount *mount; + signed char drop_after; + Eina_Bool drop_show : 1; + Eina_Bool drop_in_show : 1; + Eina_Bool drop_all : 1; + Eina_Bool drag : 1; + Eina_Bool selecting : 1; + Eina_Bool toomany : 1; struct { int ox, oy; int x, y, w, h; } selrect; - E_Fm2_Icon *iop_icon; + E_Fm2_Icon *iop_icon; - Eina_List *handlers; + Eina_List *handlers; Ecore_Event_Handler *efreet_cache_update; - Efreet_Desktop *desktop; + Efreet_Desktop *desktop; }; struct _E_Fm2_Region @@ -193,31 +194,31 @@ struct _E_Fm2_Icon E_Dialog *dialog; E_Fm2_Icon_Info info; - E_Fm2_Mount *mount; // for dnd into unmounted dirs - Ecore_Timer *mount_timer; // autounmount in 15s + E_Fm2_Mount *mount; // for dnd into unmounted dirs + Ecore_Timer *mount_timer; // autounmount in 15s struct { - Evas_Coord x, y; + Evas_Coord x, y; Ecore_Timer *dnd_end_timer; //we need this for XDirectSave drops so we don't lose the icon - Eina_Bool start : 1; - Eina_Bool dnd : 1; // currently dragging - Eina_Bool src : 1; // drag source - Eina_Bool hidden : 1; // dropped into different dir + Eina_Bool start : 1; + Eina_Bool dnd : 1; // currently dragging + Eina_Bool src : 1; // drag source + Eina_Bool hidden : 1; // dropped into different dir } drag; - int saved_rel; - - Eina_Bool realized : 1; - Eina_Bool selected : 1; - Eina_Bool last_selected : 1; - Eina_Bool saved_pos : 1; - Eina_Bool odd : 1; - Eina_Bool down_sel : 1; - Eina_Bool removable_state_change : 1; - Eina_Bool thumb_failed : 1; - Eina_Bool queued : 1; - Eina_Bool inserted : 1; + int saved_rel; + + Eina_Bool realized : 1; + Eina_Bool selected : 1; + Eina_Bool last_selected : 1; + Eina_Bool saved_pos : 1; + Eina_Bool odd : 1; + Eina_Bool down_sel : 1; + Eina_Bool removable_state_change : 1; + Eina_Bool thumb_failed : 1; + Eina_Bool queued : 1; + Eina_Bool inserted : 1; }; struct _E_Fm2_Finfo @@ -252,10 +253,10 @@ struct _E_Fm2_Uri struct _E_Fm2_Context_Menu_Data { E_Fm2_Icon *icon; - E_Fm2_Smart_Data *sd; + E_Fm2_Smart_Data *sd; E_Fm2_Mime_Handler *handler; }; -static Eina_Bool _e_fm2_cb_drag_finished_show(E_Fm2_Icon *ic); +static Eina_Bool _e_fm2_cb_drag_finished_show(E_Fm2_Icon *ic); static const char *_e_fm2_dev_path_map(E_Fm2_Smart_Data *sd, const char *dev, const char *path); static void _e_fm2_file_add(Evas_Object *obj, const char *file, int unique, Eina_Stringshare *file_rel, int after, E_Fm2_Finfo *finf); static void _e_fm2_file_del(Evas_Object *obj, const char *file); @@ -315,7 +316,7 @@ static void _e_fm2_typebuf_hide(Evas_Object *obj); //static void _e_fm2_typebuf_history_prev(Evas_Object *obj); //static void _e_fm2_typebuf_history_next(Evas_Object *obj); static void _e_fm2_typebuf_run(Evas_Object *obj); -static E_Fm2_Icon *_e_fm2_typebuf_match(Evas_Object *obj, int next); +static E_Fm2_Icon *_e_fm2_typebuf_match(Evas_Object *obj, int next); static void _e_fm2_typebuf_complete(Evas_Object *obj); static void _e_fm2_typebuf_char_append(Evas_Object *obj, const char *ch); static void _e_fm2_typebuf_char_backspace(Evas_Object *obj); @@ -464,13 +465,13 @@ static void _e_fm2_volume_eject(void *data, E_Menu *m, E_Menu_Item *mi) static void _e_fm2_icon_removable_update(E_Fm2_Icon *ic); static void _e_fm2_volume_icon_update(E_Volume *v); -static int _e_fm2_desktop_open(E_Fm2_Smart_Data *sd); +static int _e_fm2_desktop_open(E_Fm2_Smart_Data *sd); static void _e_fm2_operation_abort_internal(E_Fm2_Op_Registry_Entry *ere); -static Eina_Bool _e_fm2_sys_suspend_hibernate(void *, int, void *); +static Eina_Bool _e_fm2_sys_suspend_hibernate(void *, int, void *); -static void _e_fm2_favorites_thread_cb(void *d, Ecore_Thread *et); -static void _e_fm2_thread_cleanup_cb(void *d, Ecore_Thread *et); +static void _e_fm2_favorites_thread_cb(void *d, Ecore_Thread *et); +static void _e_fm2_thread_cleanup_cb(void *d, Ecore_Thread *et); static char *_e_fm2_meta_path = NULL; static Evas_Smart *_e_fm2_smart = NULL; @@ -606,7 +607,7 @@ static inline Eina_Bool _e_fm2_toomany_get(const E_Fm2_Smart_Data *sd) { char mode; - + mode = sd->config->view.mode; if (sd->view_mode > -1) mode = sd->view_mode; if (((mode >= E_FM2_VIEW_MODE_CUSTOM_ICONS) && @@ -620,7 +621,7 @@ static inline char _e_fm2_view_mode_get(const E_Fm2_Smart_Data *sd) { char mode; - + mode = sd->config->view.mode; if (sd->view_mode > -1) mode = sd->view_mode; if ((sd->toomany) && @@ -731,13 +732,13 @@ _e_fm2_op_registry_entry_print(const E_Fm2_Op_Registry_Entry *ere) status = status_strings[0]; DBG("id: %8d, op: %2d [%s] finished: %hhu, needs_attention: %hhu\n" - " %3d%% (%" PRIi64 "/%" PRIi64 "), start_time: %10.0f, eta: %5ds, xwin: %#x\n" - " src=[%s]\n" - " dst=[%s]", - ere->id, ere->op, status, ere->finished, ere->needs_attention, - ere->percent, ere->done, ere->total, ere->start_time, ere->eta, - e_fm2_op_registry_entry_xwin_get(ere), - ere->src, ere->dst); + " %3d%% (%" PRIi64 "/%" PRIi64 "), start_time: %10.0f, eta: %5ds, xwin: %#x\n" + " src=[%s]\n" + " dst=[%s]", + ere->id, ere->op, status, ere->finished, ere->needs_attention, + ere->percent, ere->done, ere->total, ere->start_time, ere->eta, + e_fm2_op_registry_entry_xwin_get(ere), + ere->src, ere->dst); } static Eina_Bool @@ -898,7 +899,7 @@ _e_fm2_cb_dnd_drop(void *data, const char *type) else allow = (sd->realpath && ecore_file_can_write(sd->realpath)); } - + e_drop_xds_update(allow, sd->drop_icon ? buf : sd->realpath); if (sd->dnd_scroller) ecore_animator_del(sd->dnd_scroller); sd->dnd_scroller = NULL; @@ -1438,7 +1439,6 @@ e_fm2_parent_go(Evas_Object *obj) e_fm2_path_set(obj, "/", path); free(path); } - } EAPI void @@ -2777,7 +2777,7 @@ e_fm2_client_data(Ecore_Ipc_Event_Client_Data *e) } break; } - /*file add - listing*/ + /*file add - listing*/ if (e->minor == E_FM_OP_FILE_ADD) /*file add*/ { if (!sd->scan_timer) @@ -2798,7 +2798,7 @@ e_fm2_client_data(Ecore_Ipc_Event_Client_Data *e) * dramatically improve load times */ ecore_timer_interval_set(sd->scan_timer, 1.5); - ecore_timer_reset(sd->scan_timer); + ecore_timer_reset(sd->scan_timer); } } if (path[0] != 0) @@ -2821,7 +2821,6 @@ e_fm2_client_data(Ecore_Ipc_Event_Client_Data *e) NULL, 0, &finf); if (n - sd->overlay_count > 150) { - sd->overlay_count = n + 1; snprintf(buf, sizeof(buf), P_("%u file", "%u files", sd->overlay_count), sd->overlay_count); edje_object_part_text_set(sd->overlay, "e.text.busy_label", buf); @@ -2951,6 +2950,7 @@ e_fm2_client_data(Ecore_Ipc_Event_Client_Data *e) case E_FM_OP_VOLUME_LIST_DONE: e_fm2_device_check_desktop_icons(); break; + case E_FM_OP_VOLUME_ADD: /*volume add*/ if ((e->data) && (e->size > 0)) { @@ -3491,7 +3491,7 @@ _e_fm2_file_paste(Evas_Object *obj) size_t size = 0; char *args = NULL; Eina_Bool memerr = EINA_FALSE; - + sd = evas_object_smart_data_get(obj); if (!sd) return; @@ -3524,7 +3524,7 @@ _e_fm2_file_paste(Evas_Object *obj) eina_stringshare_del(filepath); } if (memerr) return; - + /* Add destination to the arguments. */ { E_Fm2_Icon *ic = NULL; @@ -3579,7 +3579,7 @@ _e_fm2_file_symlink(Evas_Object *obj) size_t size = 0; char *args = NULL; Eina_Bool memerr = EINA_FALSE; - + sd = evas_object_smart_data_get(obj); if (!sd) return; @@ -3615,7 +3615,7 @@ _e_fm2_file_symlink(Evas_Object *obj) eina_stringshare_del(filepath); } if (memerr) return; - + /* Add destination to the arguments. */ args = e_util_string_append_quoted(args, &size, &length, sd->realpath); if (!args) return; @@ -3703,7 +3703,7 @@ _e_fm2_queue_process(Evas_Object *obj) i = (p0 + p1) / 2; ll = sd->tmp.list_index; if (ll[i]) - do /* avoid garbage deref */ + do /* avoid garbage deref */ { ic2 = eina_list_data_get(ll[i]); v = _e_fm2_cb_icon_sort(ic, ic2); @@ -4181,7 +4181,8 @@ _e_fm2_icons_place_list(E_Fm2_Smart_Data *sd) y += ic->h; ic->odd = (i & 0x01); if ((ic->w != sd->w) && ((ic->x + ic->w) > sd->max.w)) sd->max.w = ic->x + ic->w; - else if (ic->min_w > sd->max.w) sd->max.w = ic->min_w; + else if (ic->min_w > sd->max.w) + sd->max.w = ic->min_w; if ((ic->y + ic->h) > sd->max.h) sd->max.h = ic->y + ic->h; w = MAX(w, ic->min_w); w = MAX(w, sd->w); @@ -4246,7 +4247,6 @@ _e_fm2_icons_free(Evas_Object *obj) { E_Fm2_Smart_Data *sd; E_Fm2_Icon *ic; - sd = evas_object_smart_data_get(obj); if (!sd) return; @@ -4397,7 +4397,7 @@ _e_fm2_uri_parse(const char *val) hostname[i] = '\0'; /* See http://www.faqs.org/rfcs/rfc1738.html for the escaped chars */ - for (i = 0; (*p != '\0') && (i < (PATH_MAX-1)); i++, p++) + for (i = 0; (*p != '\0') && (i < (PATH_MAX - 1)); i++, p++) { if (*p == '%') { @@ -5050,7 +5050,7 @@ _e_fm2_cb_eio_stat(void *data, Eio_File *handler __UNUSED__, const Eina_Stat *st E_Fm2_Icon *ic = data; ic->eio = NULL; #define FUCK_EINA_STAT_WHY_IS_IT_NOT_THE_SAME_AS_STAT(member) \ - ic->info.statinfo.st_##member = st->member + ic->info.statinfo.st_##member = st->member FUCK_EINA_STAT_WHY_IS_IT_NOT_THE_SAME_AS_STAT(dev); FUCK_EINA_STAT_WHY_IS_IT_NOT_THE_SAME_AS_STAT(ino); @@ -5718,9 +5718,9 @@ _e_fm2_inplace_open(const E_Fm2_Icon *ic) char buf[PATH_MAX]; if (((!S_ISDIR(ic->info.statinfo.st_mode)) || - (ic->info.link && (!S_ISDIR(ic->info.statinfo.st_mode))) || - (!ic->sd->config->view.open_dirs_in_place) || - (ic->sd->config->view.no_subdir_jump))) + (ic->info.link && (!S_ISDIR(ic->info.statinfo.st_mode))) || + (!ic->sd->config->view.open_dirs_in_place) || + (ic->sd->config->view.no_subdir_jump))) return 0; if (!_e_fm2_icon_path(ic, buf, sizeof(buf))) @@ -5754,7 +5754,6 @@ _e_fm2_typebuf_match_func(E_Fm2_Icon *ic, void *data) (e_util_glob_case_match(ic->info.label, tb))) || ((ic->info.file) && (e_util_glob_case_match(ic->info.file, tb))); - } static Eina_Bool @@ -5835,6 +5834,7 @@ _e_fm2_typebuf_match(Evas_Object *obj, int next) x++; break; } + case 1: _e_fm2_icon_desel_any(obj); if (sel) @@ -5846,7 +5846,8 @@ _e_fm2_typebuf_match(Evas_Object *obj, int next) } evas_object_smart_callback_call(obj, "selection_change", NULL); } - } while (0); + } while (0) + ; if (sd->typebuf.timer) ecore_timer_reset(sd->typebuf.timer); else sd->typebuf.timer = ecore_timer_add(3.5, _e_fm_typebuf_timer_cb, sd); @@ -6253,17 +6254,17 @@ _e_fm2_cb_dnd_scroller(E_Fm2_Smart_Data *sd) x = MAX(0, x); y = MAX(0, y); e_fm2_pan_set(sd->obj, x, y); - if ((sd->drop_icon) && - (!E_INSIDE(sd->dnd_current.x, sd->dnd_current.y, - sd->drop_icon->x - sd->drop_icon->sd->pos.x, - sd->drop_icon->y - sd->drop_icon->sd->pos.y, + if ((sd->drop_icon) && + (!E_INSIDE(sd->dnd_current.x, sd->dnd_current.y, + sd->drop_icon->x - sd->drop_icon->sd->pos.x, + sd->drop_icon->y - sd->drop_icon->sd->pos.y, sd->drop_icon->w, sd->drop_icon->h))) _e_fm2_dnd_drop_hide(sd->obj); /* * FIXME: this is slow and doesn't do much, need a better way... if (!sd->drop_icon) _e_fm2_cb_dnd_move(sd, NULL, NULL); -*/ + */ #undef EFM_MAX_PIXEL_DRAG return EINA_TRUE; } @@ -6285,7 +6286,6 @@ _e_fm2_cb_dnd_enter(void *data, const char *type, void *event) static Eina_Bool _e_fm2_cb_dnd_move_helper(E_Fm2_Smart_Data *sd, E_Fm2_Icon *ic, int dx, int dy) { - if (!E_INSIDE(dx, dy, ic->x - ic->sd->pos.x, ic->y - ic->sd->pos.y, ic->w, ic->h)) return EINA_FALSE; if (ic->drag.dnd) return EINA_FALSE; if (!S_ISDIR(ic->info.statinfo.st_mode)) @@ -6371,7 +6371,7 @@ _e_fm2_cb_dnd_move(void *data, const char *type, void *event) if (E_INSIDE(dx, dy, 0, 0, sd->w, sd->h)) { #if 0 //this is broken since we don't allow custom list sorting - /* if listview - it is now after last file */ + /* if listview - it is now after last file */ if (_e_fm2_view_mode_get(sd) == E_FM2_VIEW_MODE_LIST) { /* if there is a .order file - we can re-order files */ @@ -6393,7 +6393,7 @@ _e_fm2_cb_dnd_move(void *data, const char *type, void *event) } else #endif - _e_fm2_dnd_drop_all_show(sd->obj); + _e_fm2_dnd_drop_all_show(sd->obj); return; } /* outside fm view */ @@ -6480,9 +6480,11 @@ _e_fm_drop_menu_queue(Evas_Object *e_fm, void *args, int op) case 0: //copy mop->action = ECORE_X_ATOM_XDND_ACTION_COPY; break; + case 1: //move mop->action = ECORE_X_ATOM_XDND_ACTION_MOVE; break; + case 2: //link mop->action = ECORE_X_ATOM_XDND_ACTION_LINK; break; @@ -6494,9 +6496,11 @@ _e_fm_drop_menu_queue(Evas_Object *e_fm, void *args, int op) case 0: //copy e_fm2_client_file_copy(e_fm, mop->args); break; + case 1: //move e_fm2_client_file_move(e_fm, mop->args); break; + case 2: //link e_fm2_client_file_symlink(e_fm, mop->args); break; @@ -6560,16 +6564,16 @@ static void _e_fm2_cb_dnd_selection_notify_post_mount_fail(E_Volume *vol) { E_Fm2_Device_Mount_Op *mop; - + while (vol->mount_ops) { E_Fm2_Icon *ic; - mop = (E_Fm2_Device_Mount_Op*) vol->mount_ops; + mop = (E_Fm2_Device_Mount_Op *)vol->mount_ops; ic = mop->ic; vol->mount_ops = eina_inlist_remove(vol->mount_ops, EINA_INLIST_GET(mop)); /* FIXME: this can be made more clear */ - e_util_dialog_show(_("Error"), _("The recent DND operation requested for '%s' has failed."), vol->label ?: vol->udi); + e_util_dialog_show(_("Error"), _("The recent DND operation requested for '%s' has failed."), vol->label ? : vol->udi); evas_object_data_del(ic->sd->obj, "dnd_queue"); free(mop->args); ic->sd->mount_ops = eina_list_remove(ic->sd->mount_ops, mop); @@ -6595,14 +6599,14 @@ _e_fm2_cb_dnd_selection_notify_post_mount(E_Volume *vol) if (mop->action == ECORE_X_ATOM_XDND_ACTION_ASK) continue; else if (mop->action == ECORE_X_ATOM_XDND_ACTION_MOVE) - e_fm2_client_file_move(ic->sd->obj, mop->args); + e_fm2_client_file_move(ic->sd->obj, mop->args); else if (mop->action == ECORE_X_ATOM_XDND_ACTION_COPY) e_fm2_client_file_copy(ic->sd->obj, mop->args); else if (mop->action == ECORE_X_ATOM_XDND_ACTION_LINK) e_fm2_client_file_symlink(ic->sd->obj, mop->args); } else - e_util_dialog_show(_("Error"), _("The recent DND operation requested for '%s' has failed."), vol->label ?: vol->udi); + e_util_dialog_show(_("Error"), _("The recent DND operation requested for '%s' has failed."), vol->label ? : vol->udi); free(mop->args); vol->mount_ops = eina_inlist_remove(vol->mount_ops, EINA_INLIST_GET(mop)); ic->sd->mount_ops = eina_list_remove(ic->sd->mount_ops, mop); @@ -6655,7 +6659,7 @@ _e_fm2_cb_dnd_selection_notify(void *data, const char *type, void *event) size_t length = 0; Eina_Bool lnk = EINA_FALSE, memerr = EINA_FALSE, mnt = EINA_FALSE; E_Fm2_Device_Mount_Op *mop = NULL; - + sd = data; ev = event; if (!_e_fm2_dnd_type_implemented(type)) return; @@ -6671,7 +6675,7 @@ _e_fm2_cb_dnd_selection_notify(void *data, const char *type, void *event) */ f = ecore_file_file_get(fp); if ((((f - fp - 1 == 0) && (!strcmp(sd->realpath, "/"))) || - ((f - fp - 1 > 0) && (!strncmp(sd->realpath, fp, f - fp - 1)))) && + ((f - fp - 1 > 0) && (!strncmp(sd->realpath, fp, f - fp - 1)))) && ((size_t)(f - fp - 1) == strlen(sd->realpath))) { if ((e_drop_handler_action_get() == ECORE_X_ATOM_XDND_ACTION_MOVE) || (sd->config->view.link_drop)) @@ -6683,7 +6687,7 @@ _e_fm2_cb_dnd_selection_notify(void *data, const char *type, void *event) } } } - + isel = _e_fm2_uri_icon_list_get(fsel); ox = 0; oy = 0; EINA_LIST_FOREACH(isel, l, ic) @@ -6752,7 +6756,8 @@ _e_fm2_cb_dnd_selection_notify(void *data, const char *type, void *event) { args = e_util_string_append_char(args, &size, &length, ' '); if (!args) memerr = EINA_TRUE; - else if (ic) ic->drag.hidden = EINA_TRUE; + else if (ic) + ic->drag.hidden = EINA_TRUE; } } eina_stringshare_del(fp); @@ -6823,8 +6828,8 @@ _e_fm2_cb_dnd_selection_notify(void *data, const char *type, void *event) } else if (!sd->drop_icon->mount) sd->drop_icon->mount = e_fm2_device_mount(vol, (Ecore_Cb)_e_fm2_cb_dnd_selection_notify_post_mount, - (Ecore_Cb)_e_fm2_cb_dnd_selection_notify_post_mount_fail, (Ecore_Cb)_e_fm2_cb_dnd_selection_notify_post_umount, - NULL, vol); + (Ecore_Cb)_e_fm2_cb_dnd_selection_notify_post_mount_fail, (Ecore_Cb)_e_fm2_cb_dnd_selection_notify_post_umount, + NULL, vol); if (sd->drop_icon->mount_timer) ecore_timer_reset(sd->drop_icon->mount_timer); else sd->drop_icon->mount_timer = ecore_timer_add(15., (Ecore_Task_Cb)_e_fm2_cb_dnd_selection_notify_post_mount_timer, sd->drop_icon); @@ -7241,7 +7246,7 @@ _e_fm2_cb_icon_mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSE ic = data; ev = event_info; - + edje_object_message_signal_process(ic->obj); edje_object_message_signal_process(ic->obj); @@ -8203,8 +8208,10 @@ _e_fm2_cb_icon_sort(const void *data1, const void *data2) cmp = strcasecmp(f1, f2); if (cmp) return cmp; } - else if (f1) return 1; - else if (f2) return -1; + else if (f1) + return 1; + else if (f2) + return -1; } if (ic1->sd->config->list.sort.size) { @@ -8616,8 +8623,6 @@ _e_fm2_overlay_clip_move(void *data, Evas *e __UNUSED__, Evas_Object *obj, void evas_object_move(sd->overlay, x, y); } - - static void _e_fm2_view_menu_sorting_change_case(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi) { @@ -8765,7 +8770,7 @@ _e_fm2_menu(Evas_Object *obj, unsigned int timestamp) e_menu_item_submenu_pre_callback_set(mi, _e_fm2_view_menu_sorting_pre, sd); } if (!(sd->icon_menu.flags & - (E_FM2_MENU_NO_SHOW_HIDDEN | E_FM2_MENU_NO_REMEMBER_ORDERING | E_FM2_MENU_NO_ACTIVATE_CHANGE))) + (E_FM2_MENU_NO_SHOW_HIDDEN | E_FM2_MENU_NO_REMEMBER_ORDERING | E_FM2_MENU_NO_ACTIVATE_CHANGE))) { mi = e_menu_item_new(mn); e_menu_item_label_set(mi, _("Options")); @@ -8925,7 +8930,7 @@ _e_fm2_icon_menu(E_Fm2_Icon *ic, Evas_Object *obj, unsigned int timestamp) e_menu_item_submenu_pre_callback_set(mi, _e_fm2_view_menu_sorting_pre, sd); } if (!(sd->icon_menu.flags & - (E_FM2_MENU_NO_SHOW_HIDDEN | E_FM2_MENU_NO_REMEMBER_ORDERING | E_FM2_MENU_NO_ACTIVATE_CHANGE))) + (E_FM2_MENU_NO_SHOW_HIDDEN | E_FM2_MENU_NO_REMEMBER_ORDERING | E_FM2_MENU_NO_ACTIVATE_CHANGE))) { mi = e_menu_item_new(mn); e_menu_item_label_set(mi, _("Options")); @@ -9012,7 +9017,7 @@ _e_fm2_icon_menu(E_Fm2_Icon *ic, Evas_Object *obj, unsigned int timestamp) _e_fm2_context_menu_append(sd, buf, l, subm, ic); eina_list_free(l); } - } + } } if (!ic->info.removable) { @@ -9163,7 +9168,6 @@ _e_fm2_icon_menu(E_Fm2_Icon *ic, Evas_Object *obj, unsigned int timestamp) if ((!ic->info.removable) && ic->info.file && (ic->info.file[0] != '|') && ic->info.mime && (!strcmp(ic->info.mime, "application/x-desktop"))) { - mi = e_menu_item_new(mn); e_menu_item_label_set(mi, _("Properties")); e_util_menu_item_theme_icon_set(mi, "document-properties"); @@ -9180,7 +9184,7 @@ _e_fm2_icon_menu(E_Fm2_Icon *ic, Evas_Object *obj, unsigned int timestamp) else sub = NULL; - mi = e_menu_item_new(sub ?: mn); + mi = e_menu_item_new(sub ? : mn); e_menu_item_label_set(mi, _("File Properties")); e_util_menu_item_theme_icon_set(mi, "document-properties"); e_menu_item_callback_set(mi, _e_fm2_file_properties, ic); @@ -9425,7 +9429,6 @@ _e_fm2_view_menu_common(E_Menu *subm, E_Fm2_Smart_Data *sd) view_mode = _e_fm2_view_mode_get(sd); if (!(sd->icon_menu.flags & E_FM2_MENU_NO_VIEW_CHANGE)) { - mi = e_menu_item_new(subm); e_menu_item_label_set(mi, _("Grid Icons")); e_menu_item_radio_group_set(mi, 1); @@ -9456,7 +9459,6 @@ _e_fm2_view_menu_common(E_Menu *subm, E_Fm2_Smart_Data *sd) e_menu_item_toggle_set(mi, sd->view_mode == -1); e_menu_item_callback_set(mi, _e_fm2_view_menu_use_default_cb, sd); - mi = e_menu_item_new(subm); e_menu_item_separator_set(mi, 1); } @@ -9535,7 +9537,7 @@ _e_fm2_new_thread_helper(Ecore_Thread *eth, Eina_Bool dir) } else { - fd = open(buf, O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR | S_IWUSR); + fd = open(buf, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); if (fd) { close(fd); @@ -9560,7 +9562,7 @@ _e_fm2_new_thread_helper(Ecore_Thread *eth, Eina_Bool dir) } else { - fd = open(buf, O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR | S_IWUSR); + fd = open(buf, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); if (fd) { close(fd); @@ -9582,6 +9584,7 @@ _e_fm2_new_file_thread(void *data __UNUSED__, Ecore_Thread *eth) { _e_fm2_new_thread_helper(eth, EINA_FALSE); } + static void _e_fm2_new_dir_thread(void *data __UNUSED__, Ecore_Thread *eth) { @@ -9623,7 +9626,7 @@ _e_fm2_new_file(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__) } sd->new_file.thread = ecore_thread_feedback_run(_e_fm2_new_file_thread, (Ecore_Thread_Notify_Cb)_e_fm2_new_file_notify, _e_fm2_new_file_end, _e_fm2_new_file_cancel, sd, EINA_FALSE); - ecore_thread_global_data_add("path", (void*)eina_stringshare_ref(sd->realpath), (void*)eina_stringshare_del, EINA_FALSE); + ecore_thread_global_data_add("path", (void *)eina_stringshare_ref(sd->realpath), (void *)eina_stringshare_del, EINA_FALSE); evas_object_ref(sd->obj); } @@ -9644,7 +9647,7 @@ _e_fm2_new_directory(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED_ } sd->new_file.thread = ecore_thread_feedback_run(_e_fm2_new_dir_thread, (Ecore_Thread_Notify_Cb)_e_fm2_new_dir_notify, _e_fm2_new_file_end, _e_fm2_new_file_cancel, sd, EINA_FALSE); - ecore_thread_global_data_add("path", (void*)eina_stringshare_ref(sd->realpath), (void*)eina_stringshare_del, EINA_FALSE); + ecore_thread_global_data_add("path", (void *)eina_stringshare_ref(sd->realpath), (void *)eina_stringshare_del, EINA_FALSE); evas_object_ref(sd->obj); } @@ -9766,7 +9769,6 @@ _e_fm2_options_menu_pre(void *data, E_Menu *subm) e_menu_item_callback_set(mi, _e_fm2_settings_icon_item, sd); } - static void _custom_file_key_del(E_Fm2_Smart_Data *sd, const char *key) { @@ -9991,7 +9993,7 @@ _e_fm2_desktop_open(E_Fm2_Smart_Data *sd) snprintf(buf, sizeof(buf), "%s/.directory.desktop", sd->realpath); ret = ecore_file_exists(buf) ? ecore_file_can_write(buf) - : ecore_file_can_write(sd->realpath); + : ecore_file_can_write(sd->realpath); if (!ret) return -1; ef = efreet_desktop_new(buf); if (!ef) return 0; @@ -10268,11 +10270,14 @@ _e_fm2_icon_entry_widget_accept(E_Fm2_Icon *ic) case -2: e_util_dialog_show(_("Error"), _("%s already exists!"), txt); return; + case -1: e_util_dialog_show(_("Error"), _("%s could not be renamed because it is protected"), ic->info.file); break; + case 0: e_util_dialog_show(_("Error"), _("Internal filemanager error :(")); + default: /* success! */ break; } @@ -10302,11 +10307,14 @@ _e_fm2_file_rename_yes_cb(void *data, char *text) e_util_dialog_show(_("Error"), _("%s already exists!"), text); _e_fm2_file_rename(ic, NULL, NULL); break; + case -1: e_util_dialog_show(_("Error"), _("%s could not be renamed because it is protected"), ic->info.file); break; + case 0: e_util_dialog_show(_("Error"), _("Internal filemanager error :(")); + default: /* success! */ break; } @@ -10356,7 +10364,7 @@ _e_fm_retry_abort_dialog(int pid, const char *str) void *id; char text[4096 + PATH_MAX]; - id = (intptr_t*)(long)pid; + id = (intptr_t *)(long)pid; dialog = e_dialog_new(NULL, "E", "_fm_overwrite_dialog"); E_OBJECT(dialog)->data = id; @@ -10402,7 +10410,7 @@ _e_fm_overwrite_dialog(int pid, const char *str) char text[4096 + PATH_MAX]; E_Fm2_Op_Registry_Entry *ere; - id = (intptr_t*)(long)pid; + id = (intptr_t *)(long)pid; ere = e_fm2_op_registry_entry_get(pid); if (ere) { @@ -10412,7 +10420,6 @@ _e_fm_overwrite_dialog(int pid, const char *str) if (sd) E_LIST_FOREACH(sd->icons, _e_fm2_cb_drag_finished_show); } - dialog = e_dialog_new(NULL, "E", "_fm_overwrite_dialog"); E_OBJECT(dialog)->data = id; @@ -10555,7 +10562,7 @@ _e_fm_error_dialog(int pid, const char *str) E_Fm2_Mount *m; Eina_Bool devlink = EINA_FALSE; - id = (intptr_t*)(long)pid; + id = (intptr_t *)(long)pid; ere = e_fm2_op_registry_entry_get(pid); if (!ere) return NULL; sd = evas_object_smart_data_get(ere->e_fm); @@ -10632,7 +10639,7 @@ _e_fm_error_link_source(void *data, E_Dialog *dialog) size_t length = 0; file = ecore_file_readlink(ere->src); - if (!file) file = (char*)ere->src; + if (!file) file = (char *)ere->src; f = ecore_file_file_get(file); if (!f) return; @@ -10843,7 +10850,7 @@ _e_fm2_file_delete_yes_cb(void *data, E_Dialog *dialog) Eina_List *sel, *l; E_Fm2_Icon_Info *ici; Eina_Bool memerr = EINA_FALSE; - + ic = data; ic->dialog = NULL; @@ -11373,6 +11380,7 @@ e_fm2_optimal_size_calc(Evas_Object *obj, int maxw, int maxh, int *w, int *h) *w = MIN(minw, maxw); *h = MIN(minh * eina_list_count(sd->icons), (unsigned int)maxh); return; + default: break; } @@ -11583,3 +11591,4 @@ error: e_object_del(E_OBJECT(menu)); sd->menu = NULL; } + diff --git a/src/bin/e_fm_cmdline.c b/src/bin/e_fm_cmdline.c index ae23f8a03..35a142861 100644 --- a/src/bin/e_fm_cmdline.c +++ b/src/bin/e_fm_cmdline.c @@ -118,11 +118,11 @@ main(int argc, char *argv[]) { Eina_Bool quit_option = EINA_FALSE; Ecore_Getopt_Value values[] = { - ECORE_GETOPT_VALUE_BOOL(quit_option), - ECORE_GETOPT_VALUE_BOOL(quit_option), - ECORE_GETOPT_VALUE_BOOL(quit_option), - ECORE_GETOPT_VALUE_BOOL(quit_option), - ECORE_GETOPT_VALUE_NONE + ECORE_GETOPT_VALUE_BOOL(quit_option), + ECORE_GETOPT_VALUE_BOOL(quit_option), + ECORE_GETOPT_VALUE_BOOL(quit_option), + ECORE_GETOPT_VALUE_BOOL(quit_option), + ECORE_GETOPT_VALUE_NONE }; int args; @@ -158,9 +158,10 @@ main(int argc, char *argv[]) ecore_main_loop_begin(); edbus_connection_unref(conn); - end: +end: edbus_shutdown(); ecore_file_shutdown(); ecore_shutdown(); return retval; } + diff --git a/src/bin/e_fm_device.c b/src/bin/e_fm_device.c index c6960f374..8e96a3d09 100644 --- a/src/bin/e_fm_device.c +++ b/src/bin/e_fm_device.c @@ -50,8 +50,7 @@ _e_fm2_device_volume_setup(E_Volume *v) /* Choose the label */ if ((v->label) && (v->label[0])) - {} - else if ((v->partition_label) && (v->partition_label[0])) + {}else if ((v->partition_label) && (v->partition_label[0])) snprintf(label, sizeof(label) - 1, "%s", v->partition_label); else if (((v->storage->vendor) && (v->storage->vendor[0])) && ((v->storage->model) && (v->storage->model[0]))) @@ -190,8 +189,8 @@ EAPI void e_fm2_device_storage_del(E_Storage *s) { // printf("STO- %s\n", s->udi); - _e_stores = eina_list_remove(_e_stores, s); - _e_fm_shared_device_storage_free(s); + _e_stores = eina_list_remove(_e_stores, s); + _e_fm_shared_device_storage_free(s); } EAPI E_Storage * @@ -208,7 +207,6 @@ e_fm2_device_storage_find(const char *udi) return NULL; } - EAPI void e_fm2_device_volume_add(E_Volume *v) { @@ -280,7 +278,6 @@ e_fm2_device_volume_add(E_Volume *v) } if (v->storage) _e_fm2_device_volume_setup(v); - } EAPI void @@ -305,7 +302,7 @@ e_fm2_device_volume_del(E_Volume *v) { E_Fm2_Device_Mount_Op *mop; - mop = (E_Fm2_Device_Mount_Op*)v->mount_ops; + mop = (E_Fm2_Device_Mount_Op *)v->mount_ops; v->mount_ops = eina_inlist_remove(v->mount_ops, v->mount_ops); _e_fm2_device_mount_op_free(mop); } @@ -419,7 +416,7 @@ e_fm2_device_volume_mountpoint_get(E_Volume *v) if (v->mount_point) { // printf("GET MOUNTPOINT = %s\n", v->mount_point); - return eina_stringshare_add(v->mount_point); + return eina_stringshare_add(v->mount_point); } else if (v->efm_mode != EFM_MODE_USING_HAL_MOUNT) return NULL; @@ -450,7 +447,7 @@ e_fm2_device_mount_op_add(E_Fm2_Mount *m, char *args, size_t size, size_t length } EAPI void -e_fm2_device_mount_add(E_Volume *v, +e_fm2_device_mount_add(E_Volume *v, const char *mountpoint) { v->mounted = EINA_TRUE; @@ -512,11 +509,11 @@ e_fm2_device_mount_find(const char *path) EAPI E_Fm2_Mount * e_fm2_device_mount(E_Volume *v, - Ecore_Cb mount_ok, - Ecore_Cb mount_fail, - Ecore_Cb unmount_ok, - Ecore_Cb unmount_fail, - void *data) + Ecore_Cb mount_ok, + Ecore_Cb mount_fail, + Ecore_Cb unmount_ok, + Ecore_Cb unmount_fail, + void *data) { E_Fm2_Mount *m; @@ -535,7 +532,6 @@ e_fm2_device_mount(E_Volume *v, v->mounts = eina_list_prepend(v->mounts, m); - if (!v->mounted) { //printf("BEGIN MOUNT %p '%s'\n", m, v->mount_point); @@ -671,14 +667,14 @@ _e_fm2_device_check_desktop_icons_list_cb(const char *name, const char *path, vo Eina_List *l; char *file; - if (path[0] != '|') return; // not e17 link + if (path[0] != '|') return; // not e17 link if (!eina_str_has_extension(name, ".desktop")) return; snprintf(buf, sizeof(buf), "%s/%s", path, name); - if (ecore_file_size(buf) > 200) return; // unlikely that we're going to write a desktop file this long + if (ecore_file_size(buf) > 200) return; // unlikely that we're going to write a desktop file this long e_user_dir_snprintf(buf2, sizeof(buf2), "fileman/favorites/%s", name); if (!ecore_file_exists(buf2)) return; EINA_LIST_FOREACH(data, l, file) - if (!strcmp(file, buf)) return; // valid link + if (!strcmp(file, buf)) return; // valid link ecore_file_unlink(buf); ecore_file_unlink(buf2); @@ -791,3 +787,4 @@ e_fm2_device_volume_list_get(void) { return _e_vols; } + diff --git a/src/bin/e_fm_mime.c b/src/bin/e_fm_mime.c index fdbaca275..7ea2f6314 100644 --- a/src/bin/e_fm_mime.c +++ b/src/bin/e_fm_mime.c @@ -137,7 +137,8 @@ e_fm_mime_icon_cache_flush(void) } /* create (allocate), set properties, and return a new mime handler */ -EAPI E_Fm2_Mime_Handler *e_fm2_mime_handler_new(const char *label, const char *icon_group, void (*action_func) (void *data, Evas_Object *obj, const char *path), void *action_data, int (test_func) (void *data, Evas_Object *obj, const char *path), void *test_data) +EAPI E_Fm2_Mime_Handler * +e_fm2_mime_handler_new(const char *label, const char *icon_group, void (*action_func)(void *data, Evas_Object *obj, const char *path), void *action_data, int(test_func) (void *data, Evas_Object * obj, const char *path), void *test_data) { E_Fm2_Mime_Handler *handler; diff --git a/src/bin/e_fm_op.c b/src/bin/e_fm_op.c index dd13376bc..1474b2fb2 100644 --- a/src/bin/e_fm_op.c +++ b/src/bin/e_fm_op.c @@ -142,17 +142,17 @@ struct _E_Fm_Op_Task size_t done; } dst; - int started, finished; - unsigned int passes; - off_t pos; + int started, finished; + unsigned int passes; + off_t pos; - void *data; + void *data; E_Fm_Op_Task *parent; - E_Fm_Op_Type type; - E_Fm_Op_Type overwrite; + E_Fm_Op_Type type; + E_Fm_Op_Type overwrite; - Eina_List *link; + Eina_List *link; }; struct _E_Fm_Op_Copy_Data @@ -252,7 +252,7 @@ main(int argc, char **argv) memcpy(p3, name, name_len + 1); if ((type == E_FM_OP_SYMLINK) && - (symlink(argv[i], buf) == 0)) + (symlink(argv[i], buf) == 0)) { done++; _e_fm_op_update_progress_report_simple @@ -363,7 +363,7 @@ skip_arg: if (i) goto quit; if ((type == E_FM_OP_SYMLINK) && - (symlink(argv[2], argv[3]) == 0)) + (symlink(argv[2], argv[3]) == 0)) { _e_fm_op_update_progress_report_simple(100, argv[2], argv[3]); goto quit; @@ -1705,30 +1705,30 @@ _e_fm_op_destroy_atom(E_Fm_Op_Task *task) if (fd == -1) { - E_FM_OP_DEBUG("Secure remove: %s\n", task->src.name); - struct stat st2; + E_FM_OP_DEBUG("Secure remove: %s\n", task->src.name); + struct stat st2; - if (!S_ISREG(task->src.st.st_mode)) - goto finish; + if (!S_ISREG(task->src.st.st_mode)) + goto finish; - if (task->src.st.st_nlink > 1) - goto finish; + if (task->src.st.st_nlink > 1) + goto finish; - if ((fd = open(task->src.name, O_WRONLY|O_NOFOLLOW, 0)) == -1) - goto finish; + if ((fd = open(task->src.name, O_WRONLY | O_NOFOLLOW, 0)) == -1) + goto finish; - if (fstat(fd, &st2) == -1) - goto finish; + if (fstat(fd, &st2) == -1) + goto finish; - if (st2.st_dev != task->src.st.st_dev || - st2.st_ino != task->src.st.st_ino || - st2.st_mode != task->src.st.st_mode) - goto finish; + if (st2.st_dev != task->src.st.st_dev || + st2.st_ino != task->src.st.st_ino || + st2.st_mode != task->src.st.st_mode) + goto finish; - if ((buf = malloc(READBUFSIZE)) == NULL) - goto finish; + if ((buf = malloc(READBUFSIZE)) == NULL) + goto finish; - task->src.st.st_size = st2.st_size; + task->src.st.st_size = st2.st_size; } if (task->pos + READBUFSIZE > task->src.st.st_size) sz = task->src.st.st_size - task->pos; @@ -1742,20 +1742,20 @@ _e_fm_op_destroy_atom(E_Fm_Op_Task *task) task->pos += sz; - _e_fm_op_update_progress_report_simple(lround((double) ((task->pos + (task->passes * task->src.st.st_size)) / - (double)(task->src.st.st_size * NB_PASS)) * 100.), + _e_fm_op_update_progress_report_simple(lround((double)((task->pos + (task->passes * task->src.st.st_size)) / + (double)(task->src.st.st_size * NB_PASS)) * 100.), "/dev/urandom", task->src.name); if (task->pos >= task->src.st.st_size) { - task->passes++; + task->passes++; - if (task->passes == NB_PASS) - goto finish; - if (lseek(fd, 0, SEEK_SET) == -1) - goto finish; + if (task->passes == NB_PASS) + goto finish; + if (lseek(fd, 0, SEEK_SET) == -1) + goto finish; - task->pos = 0; + task->pos = 0; } return 1; @@ -1791,7 +1791,7 @@ _e_fm_op_random_char(char *buf, size_t len) { size_t i; static int sranded = 0; - + if (!sranded) { srand((unsigned int)time(NULL)); @@ -1803,3 +1803,4 @@ _e_fm_op_random_char(char *buf, size_t len) buf[i] = (rand() % 256) + 'a'; } } + diff --git a/src/bin/e_fm_prop.c b/src/bin/e_fm_prop.c index 7a61d6336..10abca6a7 100644 --- a/src/bin/e_fm_prop.c +++ b/src/bin/e_fm_prop.c @@ -555,8 +555,8 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf if (cfdata->fi->broken_link) { - ob = e_widget_label_add(evas, _("This link is broken.")); - e_widget_frametable_object_append(ot, ob, 0, 1, 1, 1, 1, 0, 1, 0); + ob = e_widget_label_add(evas, _("This link is broken.")); + e_widget_frametable_object_append(ot, ob, 0, 1, 1, 1, 1, 0, 1, 0); } e_widget_table_object_append(o, ot, 1, 1, 2, 1, 1, 1, 1, 1); diff --git a/src/bin/e_fm_shared_codec.c b/src/bin/e_fm_shared_codec.c index d799bc12f..e31fee4fd 100644 --- a/src/bin/e_fm_shared_codec.c +++ b/src/bin/e_fm_shared_codec.c @@ -83,7 +83,6 @@ _e_fm_shared_codec_storage_decode(void *s, int size) return eet_data_descriptor_decode(_e_storage_edd, s, size); } - void * _e_fm_shared_codec_volume_encode(E_Volume *v, int *size) { @@ -117,3 +116,4 @@ _e_storage_volume_edd_shutdown(void) _e_storage_edd = NULL; } } + diff --git a/src/bin/e_fm_shared_device.c b/src/bin/e_fm_shared_device.c index 78a7e1e4a..1d02c7379 100644 --- a/src/bin/e_fm_shared_device.c +++ b/src/bin/e_fm_shared_device.c @@ -25,14 +25,13 @@ _e_fm_shared_device_storage_free(E_Storage *s) free(s); } - void _e_fm_shared_device_volume_free(E_Volume *v) { if (v->storage) { v->storage->volumes = eina_list_remove(v->storage->volumes, v); - v->storage = NULL; + v->storage = NULL; } if (v->udi) eina_stringshare_del(v->udi); if (v->uuid) eina_stringshare_del(v->uuid); @@ -45,3 +44,4 @@ _e_fm_shared_device_volume_free(E_Volume *v) eina_stringshare_del(v->dbus_path); free(v); } + diff --git a/src/bin/e_gadcon.c b/src/bin/e_gadcon.c index 1c867df4e..6ba67b072 100644 --- a/src/bin/e_gadcon.c +++ b/src/bin/e_gadcon.c @@ -6,7 +6,7 @@ #define E_LAYOUT_ITEM_DRAG_RESIST_LEVEL 10 static void _e_gadcon_event_populate(E_Gadcon *gc); -static Eina_Bool _e_gadcon_client_populate(E_Gadcon *gc, const E_Gadcon_Client_Class *cc, E_Config_Gadcon_Client *cf_gcc); +static Eina_Bool _e_gadcon_client_populate(E_Gadcon *gc, const E_Gadcon_Client_Class *cc, E_Config_Gadcon_Client *cf_gcc); static void _e_gadcon_client_unpopulate(E_Gadcon_Client *gcc); static void _e_gadcon_free(E_Gadcon *gc); static void _e_gadcon_client_free(E_Gadcon_Client *gcc); @@ -251,11 +251,11 @@ e_gadcon_shutdown(void) return 1; } -/** +/** * Registers a new gadget class in e * - * @param cc version of gadcon, name and callbacks to use - * for handling creation and destroying a gadget + * @param cc version of gadcon, name and callbacks to use + * for handling creation and destroying a gadget */ EAPI void e_gadcon_provider_register(const E_Gadcon_Client_Class *cc) @@ -287,7 +287,7 @@ e_gadcon_provider_register(const E_Gadcon_Client_Class *cc) } } -/** +/** * unregisters a gadget class in e * * @param cc the gadget class that was used to register the gadget @@ -639,7 +639,7 @@ e_gadcon_orient(E_Gadcon *gc, E_Gadcon_Orient orient) E_OBJECT_CHECK(gc); E_OBJECT_IF_NOT_TYPE(gc, E_GADCON_DUMMY_TYPE) - E_OBJECT_TYPE_CHECK(gc, E_GADCON_TYPE); + E_OBJECT_TYPE_CHECK(gc, E_GADCON_TYPE); if (gc->orient == orient) return; gc->orient = orient; if (gc->dummy) return; @@ -905,16 +905,17 @@ e_gadcon_client_config_new(E_Gadcon *gc, const char *name) evas_object_geometry_get(gc->o_container, NULL, NULL, &w, &h); switch (gc->orient) { - case E_GADCON_ORIENT_VERT: - case E_GADCON_ORIENT_LEFT: - case E_GADCON_ORIENT_RIGHT: - case E_GADCON_ORIENT_CORNER_LT: - case E_GADCON_ORIENT_CORNER_RT: - case E_GADCON_ORIENT_CORNER_LB: - case E_GADCON_ORIENT_CORNER_RB: + case E_GADCON_ORIENT_VERT: + case E_GADCON_ORIENT_LEFT: + case E_GADCON_ORIENT_RIGHT: + case E_GADCON_ORIENT_CORNER_LT: + case E_GADCON_ORIENT_CORNER_RT: + case E_GADCON_ORIENT_CORNER_LB: + case E_GADCON_ORIENT_CORNER_RB: cf_gcc->geom.res = h; break; - default: + + default: cf_gcc->geom.res = w; } } @@ -1005,12 +1006,12 @@ e_gadcon_drag_finished_cb(E_Drag *drag, int dropped) e_object_unref(E_OBJECT(gcc)); } -/** - * Creates a new gadget +/** + * Creates a new gadget * * @param gc gadcon pointer * @param name to use for gadget - * @param id assigned to gadget + * @param id assigned to gadget * @param style to for gadget * @param base_obj the evas object that will show up in the shelf or gadget module * @return returns pointer to created gadget, on failure returns null @@ -1570,7 +1571,7 @@ _e_gadcon_client_populate(E_Gadcon *gc, const E_Gadcon_Client_Class *cc, E_Confi if (!gcc->autoscroll_set) e_gadcon_client_autoscroll_set(gcc, cf_gcc->autoscroll); - // e_gadcon_client_resizable_set(gcc, cf_gcc->resizable); + // e_gadcon_client_resizable_set(gcc, cf_gcc->resizable); if (gcc->client_class->func.orient) gcc->client_class->func.orient(gcc, gc->orient); @@ -1721,7 +1722,7 @@ e_gadcon_client_util_menu_items_append(E_Gadcon_Client *gcc, E_Menu *menu_gadget mi = e_menu_item_new(menu_gadget); e_menu_item_separator_set(mi, 1); } -/* +/* if (!gcc->o_control) { mi = e_menu_item_new(menu_gadget); @@ -1759,7 +1760,7 @@ e_gadcon_client_util_menu_items_append(E_Gadcon_Client *gcc, E_Menu *menu_gadget if (!e_util_strcmp(gcc->style, E_GADCON_CLIENT_STYLE_PLAIN)) e_menu_item_toggle_set(mi, 1); else if ((!gcc->style) && - (!e_util_strcmp(gcc->client_class->default_style, E_GADCON_CLIENT_STYLE_PLAIN))) + (!e_util_strcmp(gcc->client_class->default_style, E_GADCON_CLIENT_STYLE_PLAIN))) e_menu_item_toggle_set(mi, 1); e_menu_item_disabled_set(mi, mi->toggle); e_menu_item_callback_set(mi, _e_gadcon_client_cb_menu_style_plain, gcc); @@ -1772,7 +1773,7 @@ e_gadcon_client_util_menu_items_append(E_Gadcon_Client *gcc, E_Menu *menu_gadget if (!e_util_strcmp(gcc->style, E_GADCON_CLIENT_STYLE_INSET)) e_menu_item_toggle_set(mi, 1); else if ((!gcc->style) && - (!e_util_strcmp(gcc->client_class->default_style, E_GADCON_CLIENT_STYLE_INSET))) + (!e_util_strcmp(gcc->client_class->default_style, E_GADCON_CLIENT_STYLE_INSET))) e_menu_item_toggle_set(mi, 1); e_menu_item_disabled_set(mi, mi->toggle); e_menu_item_callback_set(mi, _e_gadcon_client_cb_menu_style_inset, gcc); @@ -1836,11 +1837,11 @@ e_gadcon_client_util_menu_attach(E_Gadcon_Client *gcc) if (gcc->o_frame) { evas_object_event_callback_del_full(gcc->o_frame, EVAS_CALLBACK_MOUSE_DOWN, - _e_gadcon_client_cb_mouse_down, gcc); + _e_gadcon_client_cb_mouse_down, gcc); evas_object_event_callback_del_full(gcc->o_frame, EVAS_CALLBACK_MOUSE_UP, - _e_gadcon_client_cb_mouse_up, gcc); + _e_gadcon_client_cb_mouse_up, gcc); evas_object_event_callback_del_full(gcc->o_frame, EVAS_CALLBACK_MOUSE_MOVE, - _e_gadcon_client_cb_mouse_move, gcc); + _e_gadcon_client_cb_mouse_move, gcc); evas_object_event_callback_add(gcc->o_frame, EVAS_CALLBACK_MOUSE_DOWN, _e_gadcon_client_cb_mouse_down, gcc); evas_object_event_callback_add(gcc->o_frame, EVAS_CALLBACK_MOUSE_UP, @@ -1851,11 +1852,11 @@ e_gadcon_client_util_menu_attach(E_Gadcon_Client *gcc) else if (gcc->o_base) { evas_object_event_callback_del_full(gcc->o_base, EVAS_CALLBACK_MOUSE_DOWN, - _e_gadcon_client_cb_mouse_down, gcc); + _e_gadcon_client_cb_mouse_down, gcc); evas_object_event_callback_del_full(gcc->o_base, EVAS_CALLBACK_MOUSE_UP, - _e_gadcon_client_cb_mouse_up, gcc); + _e_gadcon_client_cb_mouse_up, gcc); evas_object_event_callback_del_full(gcc->o_base, EVAS_CALLBACK_MOUSE_MOVE, - _e_gadcon_client_cb_mouse_move, gcc); + _e_gadcon_client_cb_mouse_move, gcc); evas_object_event_callback_add(gcc->o_base, EVAS_CALLBACK_MOUSE_DOWN, _e_gadcon_client_cb_mouse_down, gcc); evas_object_event_callback_add(gcc->o_base, EVAS_CALLBACK_MOUSE_UP, @@ -2278,8 +2279,8 @@ _e_gadcon_client_drag_begin(E_Gadcon_Client *gcc, int x, int y) ecore_x_pointer_xy_get(gcc->gadcon->zone->container->win, &x, &y); gcc->drag.drag = drag = e_drag_new(gcc->gadcon->zone->container, x, y, - drag_types, 1, gcc, -1, NULL, - e_gadcon_drag_finished_cb); + drag_types, 1, gcc, -1, NULL, + e_gadcon_drag_finished_cb); if (!drag) return; o = gcc->client_class->func.icon((E_Gadcon_Client_Class *)gcc->client_class, @@ -2849,7 +2850,7 @@ _e_gadcon_cb_dnd_enter(void *data, const char *type __UNUSED__, void *event) gc = data; //INF("DND ENTER"); gcc = gc->drag_gcc; - if (!gcc) return; // dnd from efm or something + if (!gcc) return; // dnd from efm or something if ((!gcc->hidden) && (gcc->gadcon == gc)) { if (gc->dnd_enter_cb) gc->dnd_enter_cb(gc, gc->drag_gcc); @@ -2883,10 +2884,10 @@ _e_gadcon_cb_dnd_enter(void *data, const char *type __UNUSED__, void *event) if (!cc) break; if (!gcc->style) gc->new_gcc = cc->func.init(gc, gcc->name, gcc->cf->id, - cc->default_style); + cc->default_style); else gc->new_gcc = cc->func.init(gc, gcc->name, gcc->cf->id, - gcc->style); + gcc->style); if (!gc->new_gcc) break; gc->new_gcc->cf = gcc->cf; @@ -2931,7 +2932,7 @@ _e_gadcon_cb_dnd_enter(void *data, const char *type __UNUSED__, void *event) } if ((!gc->new_gcc->config.size_w) && (!gc->new_gcc->config.size_h)) { - evas_object_geometry_get(gcc->o_frame ?: gcc->o_base, NULL, NULL, &gw, &gh); + evas_object_geometry_get(gcc->o_frame ? : gcc->o_base, NULL, NULL, &gw, &gh); gc->new_gcc->config.size_w = (double)gw / (double)w; gc->new_gcc->config.size_h = (double)gh / (double)h; } @@ -2970,7 +2971,7 @@ _e_gadcon_cb_dnd_move(void *data, const char *type __UNUSED__, void *event) ev = event; gc = data; //INF("DND (%d,%d)", ev->x, ev->y); - gcc = gc->new_gcc ?: gc->drag_gcc; + gcc = gc->new_gcc ? : gc->drag_gcc; if (!gcc) return; if (gcc->state_info.resist > 0) @@ -2992,7 +2993,8 @@ _e_gadcon_cb_dnd_move(void *data, const char *type __UNUSED__, void *event) gcc->config.pos_x = (double)ev->x / (double)w; gcc->config.pos_y = (double)ev->y / (double)h; if (gcc->o_frame) evas_object_move(gcc->o_frame, ev->x, ev->y); - else if (gcc->o_base) evas_object_move(gcc->o_base, ev->x, ev->y); + else if (gcc->o_base) + evas_object_move(gcc->o_base, ev->x, ev->y); } else evas_object_geometry_get(gc->o_container, &dx, &dy, NULL, NULL); @@ -3309,8 +3311,8 @@ _e_gadcon_client_cb_menu_pre(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi) { // e menu ASSUMES... EXPECTS the icon to be an.... e_icon! // if it's not, spankies for whoever wrote the icon callback! - mi->icon_object = - gcc->client_class->func.icon((E_Gadcon_Client_Class *)gcc->client_class, + mi->icon_object = + gcc->client_class->func.icon((E_Gadcon_Client_Class *)gcc->client_class, mi->menu->evas); } else @@ -5619,9 +5621,9 @@ _e_gadcon_provider_populate_job(void *data __UNUSED__) } x++; } - if (freeze) e_gadcon_layout_thaw(gc->o_container); - if (x && _modules_loaded) _e_gadcon_event_populate(gc); - } + if (freeze) e_gadcon_layout_thaw(gc->o_container); + if (x && _modules_loaded) _e_gadcon_event_populate(gc); + } //out: #ifndef E17_RELEASE_BUILD if (first) @@ -5726,3 +5728,4 @@ _e_gadcon_location_change(E_Gadcon_Client *gcc, E_Gadcon_Location *src, E_Gadcon src->gadget_remove.func(src->gadget_remove.data, gcc); return 1; } + diff --git a/src/bin/e_grab_dialog.c b/src/bin/e_grab_dialog.c index 342c63daf..c875a413d 100644 --- a/src/bin/e_grab_dialog.c +++ b/src/bin/e_grab_dialog.c @@ -1,7 +1,7 @@ #include "e.h" -#define TEXT_PRESS_KEY_SEQUENCE _("Please press key sequence,

" \ - "or Escape to abort.") +#define TEXT_PRESS_KEY_SEQUENCE _("Please press key sequence,

" \ + "or Escape to abort.") #define TEXT_PRESS_MOUSE_BINIDING_SEQUENCE _("Please hold any modifier you want
" \ "and press any button on your mouse,
or roll a" \ " wheel, to assign mouse binding." \ @@ -22,11 +22,11 @@ _e_grab_dialog_key_handler(void *data, int type __UNUSED__, Ecore_Event_Key *ev) e_object_del(data); return ECORE_CALLBACK_RENEW; } - + if (eg->key) { e_object_ref(data); - eg->key(eg->data ?: eg, type, ev); + eg->key(eg->data ? : eg, type, ev); e_object_unref(data); } return ECORE_CALLBACK_RENEW; @@ -42,7 +42,7 @@ _e_grab_dialog_wheel_handler(void *data, int type __UNUSED__, Ecore_Event_Mouse_ if (eg->wheel) { e_object_ref(data); - eg->wheel(eg->data ?: eg, type, ev); + eg->wheel(eg->data ? : eg, type, ev); e_object_unref(data); } return ECORE_CALLBACK_RENEW; @@ -58,7 +58,7 @@ _e_grab_dialog_mouse_handler(void *data, int type __UNUSED__, Ecore_Event_Mouse_ if (eg->mouse) { e_object_ref(data); - eg->mouse(eg->data ?: eg, type, ev); + eg->mouse(eg->data ? : eg, type, ev); e_object_unref(data); } else @@ -149,7 +149,7 @@ e_grab_dialog_show(E_Win *parent, Eina_Bool is_mouse, Ecore_Event_Handler_Cb key eg->key = key; eg->mouse = mouse; eg->wheel = wheel; - eg->data = (void*)data; + eg->data = (void *)data; eh = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, (Ecore_Event_Handler_Cb)_e_grab_dialog_key_handler, eg); eg->handlers = eina_list_append(eg->handlers, eh); @@ -166,3 +166,4 @@ e_grab_dialog_show(E_Win *parent, Eina_Bool is_mouse, Ecore_Event_Handler_Cb key e_dialog_parent_set(eg->dia, parent); return eg; } + diff --git a/src/bin/e_grabinput.c b/src/bin/e_grabinput.c index 77346d62c..2dfd3cdf0 100644 --- a/src/bin/e_grabinput.c +++ b/src/bin/e_grabinput.c @@ -2,8 +2,8 @@ /* local subsystem functions */ static Eina_Bool _e_grabinput_focus_check(void *data); -static void _e_grabinput_focus_do(Ecore_X_Window win, E_Focus_Method method); -static void _e_grabinput_focus(Ecore_X_Window win, E_Focus_Method method); +static void _e_grabinput_focus_do(Ecore_X_Window win, E_Focus_Method method); +static void _e_grabinput_focus(Ecore_X_Window win, E_Focus_Method method); /* local subsystem globals */ static Ecore_X_Window grab_mouse_win = 0; @@ -154,16 +154,20 @@ _e_grabinput_focus_do(Ecore_X_Window win, E_Focus_Method method) { case E_FOCUS_METHOD_NO_INPUT: break; + case E_FOCUS_METHOD_LOCALLY_ACTIVE: ecore_x_window_focus_at_time(win, ecore_x_current_time_get()); ecore_x_icccm_take_focus_send(win, ecore_x_current_time_get()); break; + case E_FOCUS_METHOD_GLOBALLY_ACTIVE: ecore_x_icccm_take_focus_send(win, ecore_x_current_time_get()); break; + case E_FOCUS_METHOD_PASSIVE: ecore_x_window_focus_at_time(win, ecore_x_current_time_get()); break; + default: break; } @@ -180,3 +184,4 @@ _e_grabinput_focus(Ecore_X_Window win, E_Focus_Method method) if (focus_fix_timer) ecore_timer_del(focus_fix_timer); focus_fix_timer = ecore_timer_add(0.2, _e_grabinput_focus_check, NULL); } + diff --git a/src/bin/e_hints.c b/src/bin/e_hints.c index d4008004a..10d43a6d5 100644 --- a/src/bin/e_hints.c +++ b/src/bin/e_hints.c @@ -218,47 +218,47 @@ EINTERN void e_hints_manager_init(E_Manager *man) { /* Set desktop count, desktop names and workarea */ - int i = 0, num = 0; - unsigned int *areas = NULL; - Eina_List *cl; - E_Container *c; - Ecore_X_Window *vroots = NULL; - /* FIXME: Desktop names not yet implemented */ + int i = 0, num = 0; + unsigned int *areas = NULL; + Eina_List *cl; + E_Container *c; + Ecore_X_Window *vroots = NULL; + /* FIXME: Desktop names not yet implemented */ /* char **names; */ - e_hints_e16_comms_pretend(man); + e_hints_e16_comms_pretend(man); - num = eina_list_count(man->containers); + num = eina_list_count(man->containers); - vroots = calloc(num, sizeof(Ecore_X_Window)); - if (!vroots) return; + vroots = calloc(num, sizeof(Ecore_X_Window)); + if (!vroots) return; /* names = calloc(num, sizeof(char *));*/ - areas = calloc(4 * num, sizeof(unsigned int)); - if (!areas) - { - free(vroots); - return; - } + areas = calloc(4 * num, sizeof(unsigned int)); + if (!areas) + { + free(vroots); + return; + } - EINA_LIST_FOREACH(man->containers, cl, c) - { - areas[4 * i] = c->x; - areas[4 * i + 1] = c->y; - areas[4 * i + 2] = c->w; - areas[4 * i + 3] = c->h; - vroots[i++] = c->win; - } + EINA_LIST_FOREACH(man->containers, cl, c) + { + areas[4 * i] = c->x; + areas[4 * i + 1] = c->y; + areas[4 * i + 2] = c->w; + areas[4 * i + 3] = c->h; + vroots[i++] = c->win; + } #if 0 - ecore_x_netwm_desk_count_set(man->root, num); - /* No need for workarea without desktops */ - ecore_x_netwm_desk_workareas_set(man->root, num, areas); + ecore_x_netwm_desk_count_set(man->root, num); + /* No need for workarea without desktops */ + ecore_x_netwm_desk_workareas_set(man->root, num, areas); #endif - free(vroots); - free(areas); + free(vroots); + free(areas); } /* FIXME, this should set the list in map order, not stack order */ @@ -395,7 +395,7 @@ e_hints_client_stacking_set(void) EAPI void e_hints_active_window_set(E_Manager *man, - E_Border *bd) + E_Border *bd) { E_OBJECT_CHECK(man); if (bd) @@ -466,13 +466,13 @@ e_hints_window_init(E_Border *bd) else { /* Update netwm desktop with current desktop */ - e_hints_window_desktop_set(bd); + e_hints_window_desktop_set(bd); } } else { /* Update netwm desktop with current desktop */ - e_hints_window_desktop_set(bd); + e_hints_window_desktop_set(bd); } #endif @@ -692,8 +692,8 @@ e_hints_window_type_get(E_Border *bd) } EAPI void -e_hints_window_state_update(E_Border *bd, - Ecore_X_Window_State state, +e_hints_window_state_update(E_Border *bd, + Ecore_X_Window_State state, Ecore_X_Window_State_Action action) { switch (state) @@ -1175,7 +1175,7 @@ _e_hints_process_wakeup(E_Border *bd) if (bd->client.netwm.pid <= 0) return; #ifdef SIGCHLD kill(bd->client.netwm.pid, SIGCHLD); -#endif +#endif } EAPI void @@ -1231,7 +1231,7 @@ e_hints_window_hidden_set(E_Border *bd) EAPI void e_hints_window_shaded_set(E_Border *bd, - int on) + int on) { if ((!bd->client.netwm.state.shaded) && (on)) { @@ -1249,7 +1249,7 @@ e_hints_window_shaded_set(E_Border *bd, } EAPI void -e_hints_window_shade_direction_set(E_Border *bd, +e_hints_window_shade_direction_set(E_Border *bd, E_Direction dir) { ecore_x_window_prop_card32_set(bd->client.win, E_ATOM_SHADE_DIRECTION, &dir, 1); @@ -1310,8 +1310,8 @@ e_hints_window_size_get(E_Border *bd) EAPI void e_hints_window_maximized_set(E_Border *bd, - int horizontal, - int vertical) + int horizontal, + int vertical) { if ((horizontal) && (!bd->client.netwm.state.maximized_h)) { @@ -1341,7 +1341,7 @@ e_hints_window_maximized_set(E_Border *bd, EAPI void e_hints_window_fullscreen_set(E_Border *bd, - int on) + int on) { if ((!bd->client.netwm.state.fullscreen) && (on)) { @@ -1359,7 +1359,7 @@ e_hints_window_fullscreen_set(E_Border *bd, EAPI void e_hints_window_sticky_set(E_Border *bd, - int on) + int on) { if ((!bd->client.netwm.state.sticky) && (on)) { @@ -1376,7 +1376,7 @@ e_hints_window_sticky_set(E_Border *bd, } EAPI void -e_hints_window_stacking_set(E_Border *bd, +e_hints_window_stacking_set(E_Border *bd, E_Stacking stacking) { if (bd->client.netwm.state.stacking == stacking) return; @@ -1391,21 +1391,21 @@ e_hints_window_desktop_set(E_Border *bd) /* This function is only called when really changing desktop, * so just set the property and don't care about the roundtrip. */ - unsigned int deskpos[2]; + unsigned int deskpos[2]; - /* if valgrind complains here it is complaining bd->client.netwm.desktop - * is an uninitialised variable - but it isn't. it can't be. its part of - * a calloc()'d struct and thus has to have been set to 0. hell even - * e_border.c explicitly sets it to 0 on creation of the border object. - */ - deskpos[0] = bd->desk->x; - deskpos[1] = bd->desk->y; - ecore_x_window_prop_card32_set(bd->client.win, E_ATOM_DESK, deskpos, 2); + /* if valgrind complains here it is complaining bd->client.netwm.desktop + * is an uninitialised variable - but it isn't. it can't be. its part of + * a calloc()'d struct and thus has to have been set to 0. hell even + * e_border.c explicitly sets it to 0 on creation of the border object. + */ + deskpos[0] = bd->desk->x; + deskpos[1] = bd->desk->y; + ecore_x_window_prop_card32_set(bd->client.win, E_ATOM_DESK, deskpos, 2); #if 0 - ecore_x_netwm_desktop_set(bd->client.win, current); + ecore_x_netwm_desktop_set(bd->client.win, current); #endif - bd->client.netwm.desktop = (bd->desk->y * bd->zone->desk_x_count) + bd->desk->x; + bd->client.netwm.desktop = (bd->desk->y * bd->zone->desk_x_count) + bd->desk->x; } EAPI void @@ -1466,7 +1466,7 @@ e_hints_window_virtual_keyboard_state_get(E_Border *bd) { Ecore_X_Atom atom = 0; bd->client.vkbd.state = ecore_x_e_virtual_keyboard_state_get(bd->client.win); - if (ecore_x_window_prop_atom_get(bd->client.win, + if (ecore_x_window_prop_atom_get(bd->client.win, ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE, &atom, 1)) bd->client.vkbd.have_property = 1; @@ -1514,3 +1514,4 @@ e_hints_scale_update(void) free(roots); } } + diff --git a/src/bin/e_icon.c b/src/bin/e_icon.c index 02c8d0d55..7d25e97b2 100644 --- a/src/bin/e_icon.c +++ b/src/bin/e_icon.c @@ -26,7 +26,7 @@ struct _E_Smart_Data unsigned char preload : 1; unsigned char loading : 1; unsigned char animated : 1; - Eina_Bool edje : 1; + Eina_Bool edje : 1; }; struct _Cache_Item @@ -480,7 +480,7 @@ e_icon_object_set(Evas_Object *obj, Evas_Object *o) if (!(sd = evas_object_smart_data_get(obj))) return; str = evas_object_type_get(o); if ((!str) || strcmp(str, "image")) - CRI(EINA_COLOR_RED"******************\ntrying to set an image object of type '%s'! this is not what you want!\n******************\n"EINA_COLOR_RESET, str); + CRI(EINA_COLOR_RED "******************\ntrying to set an image object of type '%s'! this is not what you want!\n******************\n"EINA_COLOR_RESET, str); if (sd->timer) ecore_timer_del(sd->timer); sd->timer = NULL; @@ -512,8 +512,8 @@ e_icon_file_get(const Evas_Object *obj, const char **file, const char **group) #ifdef USE_ICON_CACHE if (sd->file) { - if (file) *file = sd->file; - return EINA_TRUE; + if (file) *file = sd->file; + return EINA_TRUE; } #endif if (sd->edje) @@ -905,7 +905,7 @@ _e_icon_fdo_reload(void *data) sd->size = MAX(sd->w, sd->h); path = efreet_icon_path_find(e_config->icon_theme, sd->fdo, sd->size); if (!path) return EINA_FALSE; - + /* smart code here */ evas_object_image_load_size_set(sd->obj, sd->size, sd->size); evas_object_image_file_set(sd->obj, path, NULL); @@ -933,7 +933,7 @@ _e_icon_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h) } if ((!sd->edje) && ((sd->loading && sd->preload) || - (!sd->loading && !sd->preload)) + (!sd->loading && !sd->preload)) && !sd->animated) { evas_object_image_scale_hint_set(sd->obj, diff --git a/src/bin/e_ilist.c b/src/bin/e_ilist.c index 0241f501d..276b7fc1c 100644 --- a/src/bin/e_ilist.c +++ b/src/bin/e_ilist.c @@ -12,7 +12,7 @@ struct _E_Smart_Data Eina_List *items; Eina_List *selected_items; int selected; - const char *theme; + const char *theme; unsigned char selector : 1; unsigned char multi_select : 1; unsigned char on_hold : 1; @@ -25,34 +25,34 @@ struct _E_Smart_Data } typebuf; }; -static void _e_smart_init(void); -static void _e_smart_add(Evas_Object *obj); -static void _e_smart_del(Evas_Object *obj); -static void _e_smart_show(Evas_Object *obj); -static void _e_smart_hide(Evas_Object *obj); -static void _e_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y); -static void _e_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h); -static void _e_smart_color_set(Evas_Object *obj, int r, int g, int b, int a); -static void _e_smart_clip_set(Evas_Object *obj, Evas_Object *clip); -static void _e_smart_clip_unset(Evas_Object *obj); -static void _e_smart_reconfigure(E_Smart_Data *sd); -static void _e_smart_event_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info); -static void _e_smart_event_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info); -static void _e_smart_event_key_down(void *data, Evas *evas, Evas_Object *obj, void *event_info); +static void _e_smart_init(void); +static void _e_smart_add(Evas_Object *obj); +static void _e_smart_del(Evas_Object *obj); +static void _e_smart_show(Evas_Object *obj); +static void _e_smart_hide(Evas_Object *obj); +static void _e_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y); +static void _e_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h); +static void _e_smart_color_set(Evas_Object *obj, int r, int g, int b, int a); +static void _e_smart_clip_set(Evas_Object *obj, Evas_Object *clip); +static void _e_smart_clip_unset(Evas_Object *obj); +static void _e_smart_reconfigure(E_Smart_Data *sd); +static void _e_smart_event_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info); +static void _e_smart_event_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info); +static void _e_smart_event_key_down(void *data, Evas *evas, Evas_Object *obj, void *event_info); -static void _e_typebuf_add(Evas_Object *obj, const char *s); -static void _e_typebuf_match(Evas_Object *obj); -static Eina_Bool _e_typebuf_timer_cb(void *data); -static void _e_typebuf_timer_update(Evas_Object *obj); -static void _e_typebuf_timer_delete(Evas_Object *obj); -static void _e_typebuf_clean(Evas_Object *obj); +static void _e_typebuf_add(Evas_Object *obj, const char *s); +static void _e_typebuf_match(Evas_Object *obj); +static Eina_Bool _e_typebuf_timer_cb(void *data); +static void _e_typebuf_timer_update(Evas_Object *obj); +static void _e_typebuf_timer_delete(Evas_Object *obj); +static void _e_typebuf_clean(Evas_Object *obj); static E_Ilist_Item *_e_ilist_item_new(E_Smart_Data *sd, Evas_Object *icon, Evas_Object *end, const char *label, int header, Ecore_End_Cb func, Ecore_End_Cb func_hilight, void *data, void *data2); -static void _e_ilist_item_theme_set(E_Ilist_Item *si, Eina_Bool custom, Eina_Bool header, Eina_Bool even); -static void _e_ilist_widget_hack_cb(E_Smart_Data *sd, Evas_Object *obj __UNUSED__, Evas_Object *scr); +static void _e_ilist_item_theme_set(E_Ilist_Item *si, Eina_Bool custom, Eina_Bool header, Eina_Bool even); +static void _e_ilist_widget_hack_cb(E_Smart_Data *sd, Evas_Object *obj __UNUSED__, Evas_Object *scr); -static void _item_select(E_Ilist_Item *si); -static void _item_unselect(E_Ilist_Item *si); +static void _item_select(E_Ilist_Item *si); +static void _item_unselect(E_Ilist_Item *si); static Evas_Smart *_e_smart = NULL; @@ -1392,3 +1392,4 @@ _e_ilist_item_new(E_Smart_Data *sd, Evas_Object *icon, Evas_Object *end, const c _e_smart_event_mouse_up, si); return si; } + diff --git a/src/bin/e_imc_main.c b/src/bin/e_imc_main.c index 99408d8d4..8c5adc296 100644 --- a/src/bin/e_imc_main.c +++ b/src/bin/e_imc_main.c @@ -27,94 +27,95 @@ main(int argc, char **argv) /* handle some command-line parameters */ for (i = 1; i < argc; i++) { - if ((!strcmp(argv[i], "-set-name")) && (i < (argc - 1))) - { - i++; - set_name = argv[i]; + if ((!strcmp(argv[i], "-set-name")) && (i < (argc - 1))) + { + i++; + set_name = argv[i]; valid_args++; write_ops++; - } - else if ((!strcmp(argv[i], "-set-exe")) && (i < (argc - 1))) - { - i++; - set_exe = argv[i]; + } + else if ((!strcmp(argv[i], "-set-exe")) && (i < (argc - 1))) + { + i++; + set_exe = argv[i]; valid_args++; write_ops++; - } - else if ((!strcmp(argv[i], "-set-setup")) && (i < (argc - 1))) - { - i++; - set_setup = argv[i]; + } + else if ((!strcmp(argv[i], "-set-setup")) && (i < (argc - 1))) + { + i++; + set_setup = argv[i]; valid_args++; write_ops++; - } - else if ((!strcmp(argv[i], "-set-gtk-im-module")) && (i < (argc - 1))) - { - i++; - set_gtk_im_module = argv[i]; + } + else if ((!strcmp(argv[i], "-set-gtk-im-module")) && (i < (argc - 1))) + { + i++; + set_gtk_im_module = argv[i]; valid_args++; write_ops++; - } - else if ((!strcmp(argv[i], "-set-qt-im-module")) && (i < (argc - 1))) - { - i++; - set_qt_im_module = argv[i]; + } + else if ((!strcmp(argv[i], "-set-qt-im-module")) && (i < (argc - 1))) + { + i++; + set_qt_im_module = argv[i]; valid_args++; write_ops++; - } - else if ((!strcmp(argv[i], "-set-xmodifiers")) && (i < (argc - 1))) - { - i++; - set_xmodifiers = argv[i]; + } + else if ((!strcmp(argv[i], "-set-xmodifiers")) && (i < (argc - 1))) + { + i++; + set_xmodifiers = argv[i]; valid_args++; write_ops++; - } - else if ((!strcmp(argv[i], "-set-ecore-imf-module")) && (i < (argc - 1))) - { - i++; - set_ecore_imf_module = argv[i]; + } + else if ((!strcmp(argv[i], "-set-ecore-imf-module")) && (i < (argc - 1))) + { + i++; + set_ecore_imf_module = argv[i]; valid_args++; write_ops++; - } - else if ((!strcmp(argv[i], "-h")) || - (!strcmp(argv[i], "-help")) || - (!strcmp(argv[i], "--h")) || - (!strcmp(argv[i], "--help"))) - { - _e_help(); - exit(0); - } - else if ((!strcmp(argv[i], "-list"))) - { - list = 1; - valid_args++; - } - else - file = argv[i]; + } + else if ((!strcmp(argv[i], "-h")) || + (!strcmp(argv[i], "-help")) || + (!strcmp(argv[i], "--h")) || + (!strcmp(argv[i], "--help"))) + { + _e_help(); + exit(0); + } + else if ((!strcmp(argv[i], "-list"))) + { + list = 1; + valid_args++; + } + else + file = argv[i]; } if (!file) { - printf("ERROR: no file specified!\n"); - _e_help(); - exit(0); + printf("ERROR: no file specified!\n"); + _e_help(); + exit(0); } - if (valid_args == 0) { + if (valid_args == 0) + { printf("ERROR: no valid arguments!\n"); _e_help(); exit(0); - } + } eet_init(); e_intl_data_init(); if (write_ops != 0 && ecore_file_exists(file)) { - ef = eet_open(file, EET_FILE_MODE_READ_WRITE); + ef = eet_open(file, EET_FILE_MODE_READ_WRITE); } else if (write_ops != 0) { - ef = eet_open(file, EET_FILE_MODE_WRITE); + ef = eet_open(file, EET_FILE_MODE_WRITE); } else { @@ -123,9 +124,9 @@ main(int argc, char **argv) if (!ef) { - printf("ERROR: cannot open file %s for READ/WRITE (%i:%s)\n", + printf("ERROR: cannot open file %s for READ/WRITE (%i:%s)\n", file, errno, strerror(errno)); - return -1; + return -1; } /* If File Exists, Try to read imc */ @@ -134,51 +135,49 @@ main(int argc, char **argv) /* else create new imc */ if (write_ops != 0) { - write_imc = calloc(sizeof(E_Input_Method_Config), 1); - write_imc->version = E_INTL_INPUT_METHOD_CONFIG_VERSION; - if (read_imc) - { - write_imc->e_im_name = read_imc->e_im_name; - write_imc->gtk_im_module = read_imc->gtk_im_module; - write_imc->qt_im_module = read_imc->qt_im_module; - write_imc->xmodifiers = read_imc->xmodifiers; - write_imc->ecore_imf_module = read_imc->ecore_imf_module; - write_imc->e_im_exec = read_imc->e_im_exec; - write_imc->e_im_setup_exec = read_imc->e_im_setup_exec; - } + write_imc = calloc(sizeof(E_Input_Method_Config), 1); + write_imc->version = E_INTL_INPUT_METHOD_CONFIG_VERSION; + if (read_imc) + { + write_imc->e_im_name = read_imc->e_im_name; + write_imc->gtk_im_module = read_imc->gtk_im_module; + write_imc->qt_im_module = read_imc->qt_im_module; + write_imc->xmodifiers = read_imc->xmodifiers; + write_imc->ecore_imf_module = read_imc->ecore_imf_module; + write_imc->e_im_exec = read_imc->e_im_exec; + write_imc->e_im_setup_exec = read_imc->e_im_setup_exec; + } - if (set_name) - write_imc->e_im_name = set_name; - if (set_gtk_im_module) - write_imc->gtk_im_module = set_gtk_im_module; - if (set_qt_im_module) - write_imc->qt_im_module = set_qt_im_module; - if (set_xmodifiers) - write_imc->xmodifiers = set_xmodifiers; - if (set_ecore_imf_module) - write_imc->ecore_imf_module = set_ecore_imf_module; - if (set_exe) - write_imc->e_im_exec = set_exe; - if (set_setup) - write_imc->e_im_setup_exec = set_setup; + if (set_name) + write_imc->e_im_name = set_name; + if (set_gtk_im_module) + write_imc->gtk_im_module = set_gtk_im_module; + if (set_qt_im_module) + write_imc->qt_im_module = set_qt_im_module; + if (set_xmodifiers) + write_imc->xmodifiers = set_xmodifiers; + if (set_ecore_imf_module) + write_imc->ecore_imf_module = set_ecore_imf_module; + if (set_exe) + write_imc->e_im_exec = set_exe; + if (set_setup) + write_imc->e_im_setup_exec = set_setup; - - /* write imc to file */ - e_intl_input_method_config_write(ef, write_imc); + /* write imc to file */ + e_intl_input_method_config_write(ef, write_imc); } - if (list) { - printf("Config File List:\n"); - printf("Config Version: %i\n", read_imc->version); - printf("Config Name: %s\n", read_imc->e_im_name); - printf("Command Line: %s\n", read_imc->e_im_exec); - printf("Setup Line: %s\n", read_imc->e_im_setup_exec); - printf("gtk_im_module: %s\n", read_imc->gtk_im_module); - printf("qt_im_module: %s\n", read_imc->qt_im_module); - printf("xmodifiers: %s\n", read_imc->xmodifiers); - printf("ecore_imf_module: %s\n", read_imc->ecore_imf_module); + printf("Config File List:\n"); + printf("Config Version: %i\n", read_imc->version); + printf("Config Name: %s\n", read_imc->e_im_name); + printf("Command Line: %s\n", read_imc->e_im_exec); + printf("Setup Line: %s\n", read_imc->e_im_setup_exec); + printf("gtk_im_module: %s\n", read_imc->gtk_im_module); + printf("qt_im_module: %s\n", read_imc->qt_im_module); + printf("xmodifiers: %s\n", read_imc->xmodifiers); + printf("ecore_imf_module: %s\n", read_imc->ecore_imf_module); } e_intl_input_method_config_free(read_imc); @@ -194,13 +193,14 @@ static void _e_help(void) { printf("OPTIONS:\n" - " -set-name NAME Set the application name\n" - " -set-exe EXE Set the application execute line\n" - " -set-setup EXE Set the setup application execute line\n" - " -set-gtk-im-module Set the gtk_im_module env var\n" - " -set-qt-im-module Set the qt_im_module env var\n" - " -set-ecore-imf-module Set the ecore_imf_module env var\n" - " -set-xmodifiers Set the xmodifiers env var\n" - " -list List Contents of Input Method Config file\n" - ); + " -set-name NAME Set the application name\n" + " -set-exe EXE Set the application execute line\n" + " -set-setup EXE Set the setup application execute line\n" + " -set-gtk-im-module Set the gtk_im_module env var\n" + " -set-qt-im-module Set the qt_im_module env var\n" + " -set-ecore-imf-module Set the ecore_imf_module env var\n" + " -set-xmodifiers Set the xmodifiers env var\n" + " -list List Contents of Input Method Config file\n" + ); } + diff --git a/src/bin/e_import_config_dialog.c b/src/bin/e_import_config_dialog.c index 4e7670ee1..022bffb79 100644 --- a/src/bin/e_import_config_dialog.c +++ b/src/bin/e_import_config_dialog.c @@ -10,7 +10,6 @@ static void _import_edj_gen(E_Import_Config_Dialog *import); static Eina_Bool _import_cb_edje_cc_exit(void *data, int type, void *event); - static void _import_edj_gen(E_Import_Config_Dialog *import) { @@ -301,7 +300,7 @@ _import_cb_edje_cc_exit(void *data, __UNUSED__ int type, void *event) if (r && import->ok) { e_object_ref(E_OBJECT(import)); - import->ok((void*)import->fdest, import); + import->ok((void *)import->fdest, import); e_object_del(E_OBJECT(import)); e_object_unref(E_OBJECT(import)); } @@ -369,7 +368,7 @@ _import_cb_ok(void *data, E_Dialog *dia __UNUSED__) if (r) { e_object_ref(E_OBJECT(import)); - if (import->ok) import->ok((void*)buf, import); + if (import->ok) import->ok((void *)buf, import); e_object_del(E_OBJECT(import)); e_object_unref(E_OBJECT(import)); } @@ -378,16 +377,16 @@ _import_cb_ok(void *data, E_Dialog *dia __UNUSED__) } static void -_e_import_config_preview_size_get(int size, int w, int h,int *tw, int *th) +_e_import_config_preview_size_get(int size, int w, int h, int *tw, int *th) { if (size <= 0) return; double aspect; - aspect = (double)w/h; - - if(w > size) + aspect = (double)w / h; + + if (w > size) { w = size; - h = (w/aspect); + h = (w / aspect); } *tw = w; *th = h; @@ -430,8 +429,8 @@ _e_import_config_dialog_win_del(E_Win *win) e_object_del(E_OBJECT(import)); e_object_unref(E_OBJECT(import)); } -/////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////// EAPI E_Import_Config_Dialog * e_import_config_dialog_show(E_Container *con, const char *path, Ecore_End_Cb ok, Ecore_Cb cancel) @@ -451,7 +450,7 @@ e_import_config_dialog_show(E_Container *con, const char *path, Ecore_End_Cb ok, dia = e_dialog_new(con, "E", "_import_config_dialog"); if (!dia) return NULL; e_dialog_resizable_set(dia, 1); - + e_dialog_title_set(dia, _("Import Settings...")); dia->data = import; import->dia = dia; @@ -471,14 +470,14 @@ e_import_config_dialog_show(E_Container *con, const char *path, Ecore_End_Cb ok, ot = e_widget_list_add(evas, 0, 0); frame = e_widget_frametable_add(evas, _("Preview"), 1); - + preview = evas_object_image_add(evas); evas_object_image_file_set(preview, path, NULL); - evas_object_image_size_get(preview,&w, &h); + evas_object_image_size_get(preview, &w, &h); evas_object_del(preview); _e_import_config_preview_size_get(320, w, h, &tw, &th); - + preview = e_widget_preview_add(evas, tw, th); e_widget_preview_thumb_set(preview, path, NULL, tw, th); @@ -498,7 +497,7 @@ e_import_config_dialog_show(E_Container *con, const char *path, Ecore_End_Cb ok, "enlightenment/wallpaper_tile", 24, 24, IMPORT_TILE, rg); e_widget_frametable_object_append(of, ord, 2, 0, 1, 1, 1, 0, 1, 0); - + ord = e_widget_radio_icon_add(evas, _("Within"), "enlightenment/wallpaper_scale_aspect_in", 24, 24, IMPORT_SCALE_ASPECT_IN, rg); @@ -542,3 +541,4 @@ e_import_config_dialog_show(E_Container *con, const char *path, Ecore_End_Cb ok, return import; } + diff --git a/src/bin/e_import_dialog.c b/src/bin/e_import_dialog.c index a26279cb8..2c109a3ab 100644 --- a/src/bin/e_import_dialog.c +++ b/src/bin/e_import_dialog.c @@ -99,7 +99,6 @@ _fsel_cb_ok(void *data, E_Dialog *dia __UNUSED__) _fsel_cb_close(id, NULL); } - static void _e_import_dia_del(void *data) { @@ -148,7 +147,7 @@ e_import_dialog_show(E_Container *con, const char *dev, const char *path, Ecore_ dia = e_dialog_new(con, "E", "_import_fsel_dialog"); if (!dia) return NULL; e_dialog_resizable_set(dia, 1); - + dia->data = id; id->dia = dia; id->ok = ok, id->cancel = cancel; @@ -158,8 +157,8 @@ e_import_dialog_show(E_Container *con, const char *dev, const char *path, Ecore_ evas = e_win_evas_get(dia->win); e_dialog_title_set(dia, _("Select a Picture...")); - fdev = dev ?: e_config->wallpaper_import_last_dev; - fpath = path ?: e_config->wallpaper_import_last_path; + fdev = dev ? : e_config->wallpaper_import_last_dev; + fpath = path ? : e_config->wallpaper_import_last_path; if (fdev) snprintf(buf, sizeof(buf), "%s/%s", fdev, path); @@ -170,7 +169,7 @@ e_import_dialog_show(E_Container *con, const char *dev, const char *path, Ecore_ if (!ecore_file_exists(rpath)) fpath = "/"; else - fpath = path ?: e_config->wallpaper_import_last_path; + fpath = path ? : e_config->wallpaper_import_last_path; free(rpath); if ((!fdev) && (!fpath)) @@ -183,7 +182,7 @@ e_import_dialog_show(E_Container *con, const char *dev, const char *path, Ecore_ /* if we ever use the second param in _fsel_cb_ok() then we will have to create a second function * for this callback, but as of now it's okay */ - ofm = e_widget_fsel_add(evas, fdev, fpath, NULL, NULL, (void*)_fsel_cb_ok, id, + ofm = e_widget_fsel_add(evas, fdev, fpath, NULL, NULL, (void *)_fsel_cb_ok, id, NULL, NULL, 1); e_widget_fsel_window_object_set(ofm, E_OBJECT(dia->win)); id->fsel_obj = ofm; @@ -199,3 +198,4 @@ e_import_dialog_show(E_Container *con, const char *dev, const char *path, Ecore_ return id; } + diff --git a/src/bin/e_int_border_locks.c b/src/bin/e_int_border_locks.c index 753a6fec7..a7f267c08 100644 --- a/src/bin/e_int_border_locks.c +++ b/src/bin/e_int_border_locks.c @@ -356,7 +356,6 @@ _advanced_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_D ob = e_widget_check_add(evas, _("Remember these Locks"), &(cfdata->lock.remember)); e_widget_list_object_append(ol, ob, 1, 1, 0.5); - return ol; } diff --git a/src/bin/e_int_border_menu.c b/src/bin/e_int_border_menu.c index 00632da6d..6a7c8e502 100644 --- a/src/bin/e_int_border_menu.c +++ b/src/bin/e_int_border_menu.c @@ -62,7 +62,7 @@ e_int_border_menu_hook_add(E_Border_Menu_Hook_Cb cb, const void *data) if (!h) return NULL; h->cb = cb; - h->data = (void*)data; + h->data = (void *)data; menu_hooks = eina_list_append(menu_hooks, h); return h; } diff --git a/src/bin/e_int_border_prop.c b/src/bin/e_int_border_prop.c index b9559a806..e75a76e92 100644 --- a/src/bin/e_int_border_prop.c +++ b/src/bin/e_int_border_prop.c @@ -403,25 +403,25 @@ _bd_go(void *data, void *data2) e_dialog_show(dia); } -#define STR_ENTRY(label, x, y, val) \ - { \ - Evas_Coord mw, mh; \ - ob = e_widget_label_add(evas, label); \ - if (!cfdata->val) e_widget_disabled_set(ob, 1); \ - e_widget_table_object_append(o, ob, x, y, 1, 1, 1, 1, 0, 1); \ - ob = e_widget_entry_add(evas, &(cfdata->val), NULL, NULL, NULL); \ - e_widget_entry_readonly_set(ob, 1); \ - e_widget_size_min_get(ob, &mw, &mh); \ - e_widget_size_min_set(ob, 160, mh); \ - e_widget_table_object_append(o, ob, x + 1, y, 1, 1, 1, 0, 1, 0); \ +#define STR_ENTRY(label, x, y, val) \ + { \ + Evas_Coord mw, mh; \ + ob = e_widget_label_add(evas, label); \ + if (!cfdata->val) e_widget_disabled_set(ob, 1); \ + e_widget_table_object_append(o, ob, x, y, 1, 1, 1, 1, 0, 1); \ + ob = e_widget_entry_add(evas, & (cfdata->val), NULL, NULL, NULL); \ + e_widget_entry_readonly_set(ob, 1); \ + e_widget_size_min_get(ob, &mw, &mh); \ + e_widget_size_min_set(ob, 160, mh); \ + e_widget_table_object_append(o, ob, x + 1, y, 1, 1, 1, 0, 1, 0); \ } -#define CHK_ENTRY(label, x, y, val) \ - { \ - ob = e_widget_label_add(evas, label); \ - e_widget_table_object_append(o, ob, x, y, 1, 1, 1, 1, 0, 1); \ - ob = e_widget_check_add(evas, "", & (cfdata->val)); \ - e_widget_disabled_set(ob, 1); \ - e_widget_table_object_append(o, ob, x + 1, y, 1, 1, 1, 0, 1, 0); \ +#define CHK_ENTRY(label, x, y, val) \ + { \ + ob = e_widget_label_add(evas, label); \ + e_widget_table_object_append(o, ob, x, y, 1, 1, 1, 1, 0, 1); \ + ob = e_widget_check_add(evas, "", & (cfdata->val)); \ + e_widget_disabled_set(ob, 1); \ + e_widget_table_object_append(o, ob, x + 1, y, 1, 1, 1, 0, 1, 0); \ } static Evas_Object * diff --git a/src/bin/e_int_border_remember.c b/src/bin/e_int_border_remember.c index fc5654bb4..6ffc6610c 100644 --- a/src/bin/e_int_border_remember.c +++ b/src/bin/e_int_border_remember.c @@ -14,11 +14,11 @@ static Evas_Object *_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E #define MODE_LOCKS E_REMEMBER_APPLY_LOCKS #define MODE_GEOMETRY_LOCKS E_REMEMBER_APPLY_POS | E_REMEMBER_APPLY_SIZE | E_REMEMBER_APPLY_LOCKS #define MODE_ALL E_REMEMBER_APPLY_POS | E_REMEMBER_APPLY_SIZE | E_REMEMBER_APPLY_LAYER | \ - E_REMEMBER_APPLY_LOCKS | E_REMEMBER_APPLY_BORDER | E_REMEMBER_APPLY_STICKY | \ - E_REMEMBER_APPLY_DESKTOP | E_REMEMBER_APPLY_SHADE | E_REMEMBER_APPLY_ZONE | \ - E_REMEMBER_APPLY_SKIP_WINLIST | E_REMEMBER_APPLY_SKIP_PAGER | \ - E_REMEMBER_APPLY_SKIP_TASKBAR | E_REMEMBER_APPLY_FULLSCREEN | E_REMEMBER_APPLY_ICON_PREF | \ - E_REMEMBER_APPLY_OFFER_RESISTANCE + E_REMEMBER_APPLY_LOCKS | E_REMEMBER_APPLY_BORDER | E_REMEMBER_APPLY_STICKY | \ + E_REMEMBER_APPLY_DESKTOP | E_REMEMBER_APPLY_SHADE | E_REMEMBER_APPLY_ZONE | \ + E_REMEMBER_APPLY_SKIP_WINLIST | E_REMEMBER_APPLY_SKIP_PAGER | \ + E_REMEMBER_APPLY_SKIP_TASKBAR | E_REMEMBER_APPLY_FULLSCREEN | E_REMEMBER_APPLY_ICON_PREF | \ + E_REMEMBER_APPLY_OFFER_RESISTANCE struct _E_Config_Dialog_Data { E_Border *border; @@ -687,7 +687,6 @@ _advanced_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_D e_widget_list_object_append(of, ob, 1, 0, 0.5); e_widget_toolbook_page_append(o, NULL, _("Identifiers"), of, 1, 1, 1, 1, 0.5, 0.0); - of = e_widget_table_add(evas, 0); ob = e_widget_check_add(evas, _("Position"), &(cfdata->remember.apply_pos)); diff --git a/src/bin/e_int_config_modules.c b/src/bin/e_int_config_modules.c index 55314c017..f93dbd051 100644 --- a/src/bin/e_int_config_modules.c +++ b/src/bin/e_int_config_modules.c @@ -24,16 +24,16 @@ struct _CFType struct _E_Config_Dialog_Data { - Evas *evas; - Evas_Object *l_modules; - Evas_Object *o_toolbar; - Evas_Object *b_load, *b_unload; - Evas_Object *o_desc; - Eina_List *types; + Evas *evas; + Evas_Object *l_modules; + Evas_Object *o_toolbar; + Evas_Object *b_load, *b_unload; + Evas_Object *o_desc; + Eina_List *types; Ecore_Event_Handler *module_update; struct { - Eina_List *loaded, *unloaded; + Eina_List *loaded, *unloaded; } selected; }; @@ -176,7 +176,7 @@ _basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata) Evas_Object *of, *ol; e_dialog_resizable_set(cfd->dia, 1); - + cfdata->evas = e_win_evas_get(cfd->dia->win); of = e_widget_table_add(evas, 0); @@ -617,7 +617,6 @@ _widget_list_selection_changed(void *data, Evas_Object *obj __UNUSED__) e_widget_disabled_set(cfdata->b_unload, 1); } } - if ((cfm) && (eina_list_count(cfdata->selected.loaded) + eina_list_count(cfdata->selected.unloaded) == 1)) description = cfm->comment; diff --git a/src/bin/e_int_gadcon_config.c b/src/bin/e_int_gadcon_config.c index d358d7f73..f89d967b0 100644 --- a/src/bin/e_int_gadcon_config.c +++ b/src/bin/e_int_gadcon_config.c @@ -8,43 +8,43 @@ struct _CFGadget struct _E_Config_Dialog_Data { - E_Gadcon *gc; - E_Gadcon_Site site; + E_Gadcon *gc; + E_Gadcon_Site site; - const char *sel; + const char *sel; struct { Evas_Object *o_list; } basic, advanced; - Evas_Object *class_list; - Evas_Object *o_add, *o_del; + Evas_Object *class_list; + Evas_Object *o_add, *o_del; Ecore_Event_Handler *gcc_add; Ecore_Event_Handler *gcc_del; Ecore_Event_Handler *cc_del; Ecore_Event_Handler *cc_add; - Ecore_Timer *load_timer; - Eina_Hash *gadget_hash; + Ecore_Timer *load_timer; + Eina_Hash *gadget_hash; }; /* local function prototypes */ -static void *_create_data(E_Config_Dialog *cfd); -static void _fill_data(E_Config_Dialog_Data *cfdata); -static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata); -static Eina_Bool _free_gadgets(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata __UNUSED__); +static void *_create_data(E_Config_Dialog *cfd); +static void _fill_data(E_Config_Dialog_Data *cfdata); +static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata); +static Eina_Bool _free_gadgets(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata __UNUSED__); static Evas_Object *_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata); static Evas_Object *_advanced_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata); -static Eina_Bool _cb_load_timer(void *data); -static void _fill_list(E_Config_Dialog_Data *cfdata); -static void _fill_list_advanced(E_Config_Dialog_Data *cfdata, Eina_Bool, Eina_Bool); -static void _cb_list_selected(void *data); -static void _cb_add(void *data, void *data2 __UNUSED__); -static void _cb_del(void *data, void *data2 __UNUSED__); -static CFGadget *_search_hash(E_Config_Dialog_Data *cfdata, const char *name); -static Eina_Bool _cb_cc_add(E_Config_Dialog_Data *cfdata, int type, E_Event_Gadcon_Client_Class_Add *ev); -static Eina_Bool _cb_cc_del(E_Config_Dialog_Data *cfdata, int type, E_Event_Gadcon_Client_Class_Add *ev); -static Eina_Bool _cb_gcc_add(E_Config_Dialog_Data *cfdata, int type, E_Event_Gadcon_Client_Add *ev); -static Eina_Bool _cb_gcc_del(E_Config_Dialog_Data *cfdata, int type, E_Event_Gadcon_Client_Add *ev); +static Eina_Bool _cb_load_timer(void *data); +static void _fill_list(E_Config_Dialog_Data *cfdata); +static void _fill_list_advanced(E_Config_Dialog_Data *cfdata, Eina_Bool, Eina_Bool); +static void _cb_list_selected(void *data); +static void _cb_add(void *data, void *data2 __UNUSED__); +static void _cb_del(void *data, void *data2 __UNUSED__); +static CFGadget *_search_hash(E_Config_Dialog_Data *cfdata, const char *name); +static Eina_Bool _cb_cc_add(E_Config_Dialog_Data *cfdata, int type, E_Event_Gadcon_Client_Class_Add *ev); +static Eina_Bool _cb_cc_del(E_Config_Dialog_Data *cfdata, int type, E_Event_Gadcon_Client_Class_Add *ev); +static Eina_Bool _cb_gcc_add(E_Config_Dialog_Data *cfdata, int type, E_Event_Gadcon_Client_Add *ev); +static Eina_Bool _cb_gcc_del(E_Config_Dialog_Data *cfdata, int type, E_Event_Gadcon_Client_Add *ev); /* local function prototypes */ static void @@ -91,14 +91,14 @@ _create_data(E_Config_Dialog *cfd) _fill_data(cfdata); cfdata->gcc_add = ecore_event_handler_add(E_EVENT_GADCON_CLIENT_ADD, - (Ecore_Event_Handler_Cb)_cb_gcc_add, cfdata); + (Ecore_Event_Handler_Cb)_cb_gcc_add, cfdata); cfdata->gcc_del = ecore_event_handler_add(E_EVENT_GADCON_CLIENT_DEL, - (Ecore_Event_Handler_Cb)_cb_gcc_del, cfdata); + (Ecore_Event_Handler_Cb)_cb_gcc_del, cfdata); cfdata->cc_add = ecore_event_handler_add(E_EVENT_GADCON_CLIENT_CLASS_ADD, - (Ecore_Event_Handler_Cb)_cb_cc_add, cfdata); + (Ecore_Event_Handler_Cb)_cb_cc_add, cfdata); cfdata->cc_del = ecore_event_handler_add(E_EVENT_GADCON_CLIENT_CLASS_DEL, - (Ecore_Event_Handler_Cb)_cb_cc_del, cfdata); + (Ecore_Event_Handler_Cb)_cb_cc_del, cfdata); return cfdata; } @@ -487,7 +487,7 @@ _cb_del_advanced(void *data, void *data2 __UNUSED__) E_Config_Gadcon_Client *cf_gcc; const Eina_List *l, *sel, *ll, *lll, *llll; E_Ilist_Item *ili; - int x = 0, refresh = 0;; + int x = 0, refresh = 0; sel = e_widget_ilist_items_get(cfdata->advanced.o_list); EINA_LIST_FOREACH_SAFE(sel, ll, lll, ili) @@ -686,13 +686,13 @@ _advanced_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata) //////////////////////////////////////////////////////////// ot = e_widget_table_add(evas, EINA_FALSE); - cfdata->advanced.o_list = + cfdata->advanced.o_list = e_widget_ilist_add(evas, (24 * e_scale), (24 * e_scale), &cfdata->sel); e_widget_ilist_multi_select_set(cfdata->advanced.o_list, EINA_TRUE); e_widget_size_min_get(cfdata->advanced.o_list, &mw, NULL); if (mw < (200 * e_scale)) mw = (200 * e_scale); e_widget_size_min_set(cfdata->advanced.o_list, mw, (160 * e_scale)); - e_widget_table_object_append(ot, cfdata->advanced.o_list, + e_widget_table_object_append(ot, cfdata->advanced.o_list, 0, 0, 1, 1, 1, 1, 1, 1); cfdata->o_del = @@ -706,12 +706,12 @@ _advanced_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata) // ot = e_widget_list_add(evas, 0, 0); ot = e_widget_table_add(evas, EINA_FALSE); - cfdata->class_list = + cfdata->class_list = e_widget_ilist_add(evas, (24 * e_scale), (24 * e_scale), NULL); e_widget_size_min_get(cfdata->class_list, &mw, NULL); if (mw < (200 * e_scale)) mw = (200 * e_scale); e_widget_size_min_set(cfdata->class_list, mw, (160 * e_scale)); - e_widget_table_object_append(ot, cfdata->class_list, + e_widget_table_object_append(ot, cfdata->class_list, 0, 0, 1, 1, 1, 1, 1, 1); // e_widget_list_object_append(ot, cfdata->class_list, 1, 1, 0.5); @@ -797,3 +797,4 @@ e_int_gadcon_config_hook(E_Gadcon *gc, const char *name, E_Gadcon_Site site) { _create_dialog(gc, name, site); } + diff --git a/src/bin/e_int_menus.c b/src/bin/e_int_menus.c index 4f1fc1c9d..007b62b92 100644 --- a/src/bin/e_int_menus.c +++ b/src/bin/e_int_menus.c @@ -61,7 +61,7 @@ static void _e_int_menus_desktops_free_hook(void *obj); static void _e_int_menus_desk_item_cb(void *data, E_Menu *m, E_Menu_Item *mi); static void _e_int_menus_item_label_set(Efreet_Menu *entry, E_Menu_Item *mi); static Efreet_Menu *_e_int_menus_apps_thread_new(E_Menu *m, const char *dir); -static Eina_Bool _e_int_menus_efreet_desktop_cache_update(void *d, int type, void *e); +static Eina_Bool _e_int_menus_efreet_desktop_cache_update(void *d, int type, void *e); //static void _e_int_menus_apps_drag_finished(E_Drag *drag, int dropped __UNUSED__); /* local subsystem globals */ @@ -118,6 +118,7 @@ _TEST(void *d __UNUSED__, E_Menu *m, E_Menu_Item *mi __UNUSED__) e_dialog_content_set(dia, o_list, 100, 300); e_dialog_show(dia); } + #endif /* externally accessible functions */ @@ -849,7 +850,7 @@ _e_int_menus_apps_free_hook2(void *obj) m = obj; // XXX TODO: this should be automatic in e_menu, just get references right! // XXX TODO: fix references and remove me!!! - EINA_LIST_FOREACH_SAFE (m->items, l, l_next, mi) + EINA_LIST_FOREACH_SAFE(m->items, l, l_next, mi) { if (mi->submenu) e_object_del(E_OBJECT(mi->submenu)); @@ -958,7 +959,7 @@ _e_int_menus_desktops_free_hook(void *obj) m = obj; // XXX TODO: this should be automatic in e_menu, just get references right! // XXX TODO: fix references and remove me!!! - EINA_LIST_FOREACH_SAFE (m->items, l, l_next, mi) + EINA_LIST_FOREACH_SAFE(m->items, l, l_next, mi) { if (mi->submenu) e_object_del(E_OBJECT(mi->submenu)); @@ -1392,8 +1393,8 @@ _e_int_menus_clients_title_abbrv(const char *title) memset(&abbv, 0, sizeof(abbv)); /* Advance to the end of the first half of the string. */ len = 0; - for (len2 = (max_len / 2) ; len2 ; len2--) - eina_unicode_utf8_get_next(title, &len); + for (len2 = (max_len / 2); len2; len2--) + eina_unicode_utf8_get_next(title, &len); strncat(abbvptr, title, len); abbvptr += len; @@ -1404,8 +1405,8 @@ _e_int_menus_clients_title_abbrv(const char *title) /* Advance to the start of the second half of the string */ len = str_len = strlen(title); - for (len2 = (max_len / 2) ; len2 ; len2--) - eina_unicode_utf8_get_prev(title, &len); + for (len2 = (max_len / 2); len2; len2--) + eina_unicode_utf8_get_prev(title, &len); strncpy(abbvptr, title + len, str_len); abbvptr[str_len] = '\0'; diff --git a/src/bin/e_int_shelf_config.c b/src/bin/e_int_shelf_config.c index 44e9f9139..b019129f4 100644 --- a/src/bin/e_int_shelf_config.c +++ b/src/bin/e_int_shelf_config.c @@ -2,31 +2,31 @@ struct _E_Config_Dialog_Data { - E_Shelf *es; + E_Shelf *es; E_Config_Shelf *escfg; - Evas_Object *o_autohide, *o_desk_list; - Eina_List *autohide_list, *desk_list; + Evas_Object *o_autohide, *o_desk_list; + Eina_List *autohide_list, *desk_list; - int layer, overlap; - int orient, fit_along; - int size; - const char *style; - int autohide, autohide_action; - double hide_timeout, hide_duration; - int desk_show_mode; - Eina_List *handlers; + int layer, overlap; + int orient, fit_along; + int size; + const char *style; + int autohide, autohide_action; + double hide_timeout, hide_duration; + int desk_show_mode; + Eina_List *handlers; }; /* local function prototypes */ -static void *_create_data(E_Config_Dialog *cfd); -static void _fill_data(E_Config_Dialog_Data *cfdata); -static void _free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata); +static void *_create_data(E_Config_Dialog *cfd); +static void _fill_data(E_Config_Dialog_Data *cfdata); +static void _free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata); static Evas_Object *_basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata); -static int _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata); -static void _fill_styles(E_Config_Dialog_Data *cfdata, Evas_Object *obj); -static void _cb_autohide_change(void *data, Evas_Object *obj __UNUSED__); -static void _fill_desks(E_Config_Dialog_Data *cfdata); +static int _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata); +static void _fill_styles(E_Config_Dialog_Data *cfdata, Evas_Object *obj); +static void _cb_autohide_change(void *data, Evas_Object *obj __UNUSED__); +static void _fill_desks(E_Config_Dialog_Data *cfdata); EAPI void e_int_shelf_config(E_Shelf *es) @@ -447,7 +447,7 @@ _fill_styles(E_Config_Dialog_Data *cfdata, Evas_Object *obj) e_livethumb_thumb_set(thumb, ow); e_widget_ilist_append(obj, thumb, style, NULL, NULL, style); if (!strcmp(cfdata->style, style)) - e_widget_ilist_selected_set(obj, n); + e_widget_ilist_selected_set(obj, n); n++; } @@ -516,3 +516,4 @@ _fill_desks(E_Config_Dialog_Data *cfdata) edje_thaw(); evas_event_thaw(evas); } + diff --git a/src/bin/e_int_toolbar_config.c b/src/bin/e_int_toolbar_config.c index d14c7aa6b..37b452347 100644 --- a/src/bin/e_int_toolbar_config.c +++ b/src/bin/e_int_toolbar_config.c @@ -1,16 +1,16 @@ #include "e.h" /* local function protos */ -static void *_create_data (E_Config_Dialog *cfd); -static void _fill_data (E_Config_Dialog_Data *cfdata); -static void _free_data (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata); -static int _basic_apply (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata); -static Evas_Object *_basic_create (E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata); +static void *_create_data(E_Config_Dialog *cfd); +static void _fill_data(E_Config_Dialog_Data *cfdata); +static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata); +static int _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata); +static Evas_Object *_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata); struct _E_Config_Dialog_Data { E_Toolbar *tbar; - int orient; + int orient; }; EAPI void @@ -28,8 +28,8 @@ e_int_toolbar_config(E_Toolbar *tbar) v->basic.apply_cfdata = _basic_apply; v->basic.create_widgets = _basic_create; cfd = e_config_dialog_new(con, _("Toolbar Settings"), "E", - "_toolbar_config_dialog", "preferences-desktop-shelf", - 0, v, tbar); + "_toolbar_config_dialog", "preferences-desktop-shelf", + 0, v, tbar); tbar->cfg_dlg = cfd; } @@ -81,21 +81,22 @@ _basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data ot = e_widget_frametable_add(evas, _("Layout"), 1); rg = e_widget_radio_group_new(&(cfdata->orient)); /* - ow = e_widget_radio_icon_add(evas, NULL, "preferences-position-left", - 24, 24, E_GADCON_ORIENT_LEFT, rg); - e_widget_frametable_object_append(ot, ow, 0, 1, 1, 1, 1, 1, 1, 1); - */ + ow = e_widget_radio_icon_add(evas, NULL, "preferences-position-left", + 24, 24, E_GADCON_ORIENT_LEFT, rg); + e_widget_frametable_object_append(ot, ow, 0, 1, 1, 1, 1, 1, 1, 1); + */ ow = e_widget_radio_icon_add(evas, NULL, "preferences-position-top", - 24, 24, E_GADCON_ORIENT_TOP, rg); + 24, 24, E_GADCON_ORIENT_TOP, rg); e_widget_frametable_object_append(ot, ow, 0, 0, 1, 1, 1, 1, 1, 1); /* - ow = e_widget_radio_icon_add(evas, NULL, "preferences-position-right", - 24, 24, E_GADCON_ORIENT_RIGHT, rg); - e_widget_frametable_object_append(ot, ow, 2, 1, 1, 1, 1, 1, 1, 1); - */ + ow = e_widget_radio_icon_add(evas, NULL, "preferences-position-right", + 24, 24, E_GADCON_ORIENT_RIGHT, rg); + e_widget_frametable_object_append(ot, ow, 2, 1, 1, 1, 1, 1, 1, 1); + */ ow = e_widget_radio_icon_add(evas, NULL, "preferences-position-bottom", - 24, 24, E_GADCON_ORIENT_BOTTOM, rg); + 24, 24, E_GADCON_ORIENT_BOTTOM, rg); e_widget_frametable_object_append(ot, ow, 0, 1, 1, 1, 1, 1, 1, 1); e_widget_list_object_append(o, ot, 1, 1, 0.5); return o; } + diff --git a/src/bin/e_intl.c b/src/bin/e_intl.c index 91df5f222..c060707fa 100644 --- a/src/bin/e_intl.c +++ b/src/bin/e_intl.c @@ -1054,3 +1054,4 @@ _e_intl_imc_dir_scan(const char *dir) } return imcs; } + diff --git a/src/bin/e_intl_data.c b/src/bin/e_intl_data.c index a972cbf8b..a8156e452 100644 --- a/src/bin/e_intl_data.c +++ b/src/bin/e_intl_data.c @@ -30,7 +30,6 @@ e_intl_data_shutdown(void) return 1; } - /* Get the input method configuration from the file */ EAPI E_Input_Method_Config * e_intl_input_method_config_read(Eet_File *imc_file) @@ -40,7 +39,7 @@ e_intl_input_method_config_read(Eet_File *imc_file) imc = NULL; if (imc_file) { - imc = (E_Input_Method_Config *) eet_data_read(imc_file, _e_intl_input_method_config_edd, "imc"); + imc = (E_Input_Method_Config *)eet_data_read(imc_file, _e_intl_input_method_config_edd, "imc"); } return imc; } @@ -53,7 +52,7 @@ e_intl_input_method_config_write(Eet_File *imc_file, E_Input_Method_Config *imc) if (imc_file) { - ok = eet_data_write(imc_file, _e_intl_input_method_config_edd, "imc", imc, 0); + ok = eet_data_write(imc_file, _e_intl_input_method_config_edd, "imc", imc, 0); } return ok; } @@ -63,13 +62,14 @@ e_intl_input_method_config_free(E_Input_Method_Config *imc) { if (imc) { - if (imc->e_im_name) eina_stringshare_del(imc->e_im_name); - if (imc->gtk_im_module) eina_stringshare_del(imc->gtk_im_module); - if (imc->qt_im_module) eina_stringshare_del(imc->qt_im_module); - if (imc->xmodifiers) eina_stringshare_del(imc->xmodifiers); - if (imc->ecore_imf_module) eina_stringshare_del(imc->ecore_imf_module); - if (imc->e_im_exec) eina_stringshare_del(imc->e_im_exec); - if (imc->e_im_setup_exec) eina_stringshare_del(imc->e_im_setup_exec); - E_FREE(imc); + if (imc->e_im_name) eina_stringshare_del(imc->e_im_name); + if (imc->gtk_im_module) eina_stringshare_del(imc->gtk_im_module); + if (imc->qt_im_module) eina_stringshare_del(imc->qt_im_module); + if (imc->xmodifiers) eina_stringshare_del(imc->xmodifiers); + if (imc->ecore_imf_module) eina_stringshare_del(imc->ecore_imf_module); + if (imc->e_im_exec) eina_stringshare_del(imc->e_im_exec); + if (imc->e_im_setup_exec) eina_stringshare_del(imc->e_im_setup_exec); + E_FREE(imc); } } + diff --git a/src/bin/e_ipc.c b/src/bin/e_ipc.c index c616c0f47..850195819 100644 --- a/src/bin/e_ipc.c +++ b/src/bin/e_ipc.c @@ -27,12 +27,12 @@ e_ipc_init(void) if (tmp) base = tmp; tmp = getenv("SD_USER_SOCKETS_DIR"); if (tmp) base = tmp; - + user = getenv("USER"); if (!user) { int uidint; - + user = "__unknown__"; uidint = getuid(); if (uidint >= 0) @@ -41,31 +41,31 @@ e_ipc_init(void) user = buf2; } } - + disp = getenv("DISPLAY"); if (!disp) disp = ":0"; - + e_util_env_set("E_IPC_SOCKET", ""); - + pid = (int)getpid(); for (trynum = 0; trynum <= 4096; trynum++) { struct stat st; int id1 = 0; - + snprintf(buf, sizeof(buf), "%s/e-%s@%x", base, user, id1); mkdir(buf, S_IRWXU); if (stat(buf, &st) == 0) { if ((st.st_uid == getuid()) && - ((st.st_mode & (S_IFDIR | S_IRWXU | S_IRWXG | S_IRWXO)) == - (S_IRWXU | S_IFDIR))) + ((st.st_mode & (S_IFDIR | S_IRWXU | S_IRWXG | S_IRWXO)) == + (S_IRWXU | S_IFDIR))) { snprintf(buf3, sizeof(buf3), "%s/%s-%i", buf, disp, pid); _e_ipc_server = ecore_ipc_server_add - (ECORE_IPC_LOCAL_SYSTEM, buf3, 0, NULL); + (ECORE_IPC_LOCAL_SYSTEM, buf3, 0, NULL); if (_e_ipc_server) break; } } @@ -146,50 +146,50 @@ _e_ipc_cb_client_data(void *data __UNUSED__, int type __UNUSED__, void *event) switch (e->minor) { case E_IPC_OP_EXEC_ACTION: - { - E_Ipc_2Str *req = NULL; + { + E_Ipc_2Str *req = NULL; - if (e_ipc_codec_2str_dec(e->data, e->size, &req)) - { - Eina_List *m = e_manager_list(); - int len, ok = 0; - void *d; + if (e_ipc_codec_2str_dec(e->data, e->size, &req)) + { + Eina_List *m = e_manager_list(); + int len, ok = 0; + void *d; - if (m) - { - E_Manager *man = eina_list_data_get(m); + if (m) + { + E_Manager *man = eina_list_data_get(m); - if (man) - { - E_Action *act = e_action_find(req->str1); + if (man) + { + E_Action *act = e_action_find(req->str1); - if ((act) && (act->func.go)) - { - act->func.go(E_OBJECT(man), req->str2); - ok = 1; - } - } - } + if ((act) && (act->func.go)) + { + act->func.go(E_OBJECT(man), req->str2); + ok = 1; + } + } + } - d = e_ipc_codec_int_enc(ok, &len); - if (d) - { - ecore_ipc_client_send(e->client, - E_IPC_DOMAIN_REPLY, - E_IPC_OP_EXEC_ACTION_REPLY, - 0, 0, 0, d, len); - free(d); - } + d = e_ipc_codec_int_enc(ok, &len); + if (d) + { + ecore_ipc_client_send(e->client, + E_IPC_DOMAIN_REPLY, + E_IPC_OP_EXEC_ACTION_REPLY, + 0, 0, 0, d, len); + free(d); + } - if (req) - { - E_FREE(req->str1); - E_FREE(req->str2); - E_FREE(req); - } - } - } - break; + if (req) + { + E_FREE(req->str1); + E_FREE(req->str2); + E_FREE(req); + } + } + } + break; default: break; @@ -209,20 +209,22 @@ _e_ipc_cb_client_data(void *data __UNUSED__, int type __UNUSED__, void *event) break; case E_IPC_DOMAIN_ALERT: - { - switch (e->minor) - { - case E_ALERT_OP_RESTART: - if (getenv("E_START_MTRACK")) - e_util_env_set("MTRACK", "track"); - ecore_app_restart(); - break; - case E_ALERT_OP_EXIT: - exit(-11); - break; - } - } - break; + { + switch (e->minor) + { + case E_ALERT_OP_RESTART: + if (getenv("E_START_MTRACK")) + e_util_env_set("MTRACK", "track"); + ecore_app_restart(); + break; + + case E_ALERT_OP_EXIT: + exit(-11); + break; + } + } + break; + default: break; } diff --git a/src/bin/e_ipc_codec.c b/src/bin/e_ipc_codec.c index ae72c06dc..d237a7800 100644 --- a/src/bin/e_ipc_codec.c +++ b/src/bin/e_ipc_codec.c @@ -28,9 +28,9 @@ static Eet_Data_Descriptor *_e_ipc_3int_3str_list_edd = NULL; static Eet_Data_Descriptor *_e_ipc_str_4int_edd = NULL; static Eet_Data_Descriptor *_e_ipc_str_4int_list_edd = NULL; -#define E_IPC_DD(Edd, Eddc, Name, Type) \ - Eddc.name = Name; \ - Eddc.size = sizeof (Type); \ +#define E_IPC_DD(Edd, Eddc, Name, Type) \ + Eddc.name = Name; \ + Eddc.size = sizeof (Type); \ Edd = eet_data_descriptor_stream_new(&Eddc); /* externally accessible functions */ @@ -250,7 +250,7 @@ e_ipc_codec_str_enc(const char *str, int *size_ret) { E_Ipc_Str dat; - dat.str = (char *) str; + dat.str = (char *)str; return eet_data_descriptor_encode(_e_ipc_str_edd, &dat, size_ret); } @@ -271,8 +271,8 @@ e_ipc_codec_2str_enc(const char *str1, const char *str2, int *size_ret) { E_Ipc_2Str dat; - dat.str1 = (char *) str1; - dat.str2 = (char *) str2; + dat.str1 = (char *)str1; + dat.str2 = (char *)str2; return eet_data_descriptor_encode(_e_ipc_2str_edd, &dat, size_ret); } @@ -309,7 +309,7 @@ e_ipc_codec_str_list_dec(char *data, int bytes, Eina_List **dest) if (!dat) return 0; EINA_LIST_FOREACH(dat->list, l, str_node) { - list = eina_list_append(list, str_node->str); + list = eina_list_append(list, str_node->str); } if (dest) *dest = list; E_FREE_LIST(dat->list, free); @@ -329,9 +329,9 @@ e_ipc_codec_str_list_enc(Eina_List *list, int *size_ret) dat.list = NULL; EINA_LIST_FOREACH(list, l, str) { - str_node = malloc(sizeof(E_Ipc_Str)); - str_node->str = str; - dat.list = eina_list_append(dat.list, str_node); + str_node = malloc(sizeof(E_Ipc_Str)); + str_node->str = str; + dat.list = eina_list_append(dat.list, str_node); } data = eet_data_descriptor_encode(_e_ipc_str_list_edd, &dat, size_ret); E_FREE_LIST(dat.list, free); @@ -355,7 +355,7 @@ e_ipc_codec_str_int_enc(const char *str, int val, int *size_ret) { E_Ipc_Str_Int dat; - dat.str = (char *) str; + dat.str = (char *)str; dat.val = val; return eet_data_descriptor_encode(_e_ipc_str_int_edd, &dat, size_ret); } @@ -398,8 +398,8 @@ e_ipc_codec_2str_int_enc(const char *str1, const char *str2, int val, int *size_ { E_Ipc_2Str_Int dat; - dat.str1 = (char *) str1; - dat.str2 = (char *) str2; + dat.str1 = (char *)str1; + dat.str2 = (char *)str2; dat.val = val; return eet_data_descriptor_encode(_e_ipc_2str_int_edd, &dat, size_ret); } @@ -446,8 +446,8 @@ e_ipc_codec_4int_2str_enc(int val1, int val2, int val3, int val4, const char *st dat.val2 = val2; dat.val3 = val3; dat.val4 = val4; - dat.str1 = (char *) str1; - dat.str2 = (char *) str2; + dat.str1 = (char *)str1; + dat.str2 = (char *)str2; return eet_data_descriptor_encode(_e_ipc_4int_2str_edd, &dat, size_ret); } @@ -494,8 +494,8 @@ e_ipc_codec_5int_2str_enc(int val1, int val2, int val3, int val4, int val5, cons dat.val3 = val3; dat.val4 = val4; dat.val5 = val5; - dat.str1 = (char *) str1; - dat.str2 = (char *) str2; + dat.str1 = (char *)str1; + dat.str2 = (char *)str2; return eet_data_descriptor_encode(_e_ipc_5int_2str_edd, &dat, size_ret); } @@ -540,10 +540,10 @@ e_ipc_codec_3int_4str_enc(int val1, int val2, int val3, const char *str1, const dat.val1 = val1; dat.val2 = val2; dat.val3 = val3; - dat.str1 = (char *) str1; - dat.str2 = (char *) str2; - dat.str3 = (char *) str3; - dat.str4 = (char *) str4; + dat.str1 = (char *)str1; + dat.str2 = (char *)str2; + dat.str3 = (char *)str3; + dat.str4 = (char *)str4; return eet_data_descriptor_encode(_e_ipc_3int_4str_edd, &dat, size_ret); } @@ -588,9 +588,9 @@ e_ipc_codec_3int_3str_enc(int val1, int val2, int val3, const char *str1, const dat.val1 = val1; dat.val2 = val2; dat.val3 = val3; - dat.str1 = (char *) str1; - dat.str2 = (char *) str2; - dat.str3 = (char *) str3; + dat.str1 = (char *)str1; + dat.str2 = (char *)str2; + dat.str3 = (char *)str3; return eet_data_descriptor_encode(_e_ipc_3int_3str_edd, &dat, size_ret); } @@ -618,27 +618,27 @@ e_ipc_codec_3int_3str_list_enc(Eina_List *list, int *size_ret) EAPI int e_ipc_codec_str_4int_dec(char *data, int bytes, E_Ipc_Str_4Int **dest) { - E_Ipc_Str_4Int *dat; + E_Ipc_Str_4Int *dat; - if (!data) return 0; - dat = eet_data_descriptor_decode(_e_ipc_str_4int_edd, data, bytes); - if (!dat) return 0; - if (dest) *dest = dat; - return 1; + if (!data) return 0; + dat = eet_data_descriptor_decode(_e_ipc_str_4int_edd, data, bytes); + if (!dat) return 0; + if (dest) *dest = dat; + return 1; } EAPI void * e_ipc_codec_str_4int_enc(const char *str1, int val1, int val2, int val3, int val4, int *size_ret) { - E_Ipc_Str_4Int dat; + E_Ipc_Str_4Int dat; - dat.str = (char *) str1; - dat.val1 = val1; - dat.val2 = val2; - dat.val3 = val3; - dat.val4 = val4; + dat.str = (char *)str1; + dat.val1 = val1; + dat.val2 = val2; + dat.val3 = val3; + dat.val4 = val4; - return eet_data_descriptor_encode(_e_ipc_str_4int_edd, &dat, size_ret); + return eet_data_descriptor_encode(_e_ipc_str_4int_edd, &dat, size_ret); } EAPI int diff --git a/src/bin/e_layout.c b/src/bin/e_layout.c index 837100da5..1dcd374ed 100644 --- a/src/bin/e_layout.c +++ b/src/bin/e_layout.c @@ -3,44 +3,44 @@ /* FIXME: something is weird here - i had to reverse all stacking logic to make * it work... */ -typedef struct _E_Smart_Data E_Smart_Data; +typedef struct _E_Smart_Data E_Smart_Data; typedef struct _E_Layout_Item E_Layout_Item; struct _E_Smart_Data { - Evas_Coord x, y, w, h; - Evas_Coord vw, vh; - Evas_Object *obj; - Evas_Object *clip; - int frozen; - unsigned char changed : 1; - Eina_List *items; + Evas_Coord x, y, w, h; + Evas_Coord vw, vh; + Evas_Object *obj; + Evas_Object *clip; + int frozen; + unsigned char changed : 1; + Eina_List *items; }; struct _E_Layout_Item { - E_Smart_Data *sd; - Evas_Coord x, y, w, h; - Evas_Object *obj; + E_Smart_Data *sd; + Evas_Coord x, y, w, h; + Evas_Object *obj; }; /* local subsystem functions */ static E_Layout_Item *_e_layout_smart_adopt(E_Smart_Data *sd, Evas_Object *obj); -static void _e_layout_smart_disown(Evas_Object *obj); -static void _e_layout_smart_item_del_hook(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _e_layout_smart_reconfigure(E_Smart_Data *sd); -static void _e_layout_smart_move_resize_item(E_Layout_Item *li); +static void _e_layout_smart_disown(Evas_Object *obj); +static void _e_layout_smart_item_del_hook(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _e_layout_smart_reconfigure(E_Smart_Data *sd); +static void _e_layout_smart_move_resize_item(E_Layout_Item *li); -static void _e_layout_smart_init(void); -static void _e_layout_smart_add(Evas_Object *obj); -static void _e_layout_smart_del(Evas_Object *obj); -static void _e_layout_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y); -static void _e_layout_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h); -static void _e_layout_smart_show(Evas_Object *obj); -static void _e_layout_smart_hide(Evas_Object *obj); -static void _e_layout_smart_color_set(Evas_Object *obj, int r, int g, int b, int a); -static void _e_layout_smart_clip_set(Evas_Object *obj, Evas_Object *clip); -static void _e_layout_smart_clip_unset(Evas_Object *obj); +static void _e_layout_smart_init(void); +static void _e_layout_smart_add(Evas_Object *obj); +static void _e_layout_smart_del(Evas_Object *obj); +static void _e_layout_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y); +static void _e_layout_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h); +static void _e_layout_smart_show(Evas_Object *obj); +static void _e_layout_smart_hide(Evas_Object *obj); +static void _e_layout_smart_color_set(Evas_Object *obj, int r, int g, int b, int a); +static void _e_layout_smart_clip_set(Evas_Object *obj, Evas_Object *clip); +static void _e_layout_smart_clip_unset(Evas_Object *obj); /* local subsystem globals */ static Evas_Smart *_e_smart = NULL; @@ -179,9 +179,9 @@ e_layout_child_lower(Evas_Object *obj) if (!eina_list_data_find(li->sd->items, obj)) return; if ((li->sd->items) && eina_list_next(li->sd->items)) { - li->sd->items = eina_list_remove(li->sd->items, obj); - evas_object_lower(obj); - li->sd->items = eina_list_prepend(li->sd->items, obj); + li->sd->items = eina_list_remove(li->sd->items, obj); + evas_object_lower(obj); + li->sd->items = eina_list_prepend(li->sd->items, obj); } } @@ -195,9 +195,9 @@ e_layout_child_raise(Evas_Object *obj) if (!eina_list_data_find(li->sd->items, obj)) return; if ((li->sd->items) && eina_list_next(li->sd->items)) { - li->sd->items = eina_list_remove(li->sd->items, obj); - evas_object_raise(obj); - li->sd->items = eina_list_append(li->sd->items, obj); + li->sd->items = eina_list_remove(li->sd->items, obj); + evas_object_raise(obj); + li->sd->items = eina_list_append(li->sd->items, obj); } } @@ -212,9 +212,9 @@ e_layout_child_lower_below(Evas_Object *obj, Evas_Object *below) if (!eina_list_data_find(li->sd->items, obj)) return; if ((li->sd->items) && eina_list_next(li->sd->items)) { - li->sd->items = eina_list_remove(li->sd->items, obj); - evas_object_stack_below(obj, below); - li->sd->items = eina_list_prepend_relative(li->sd->items, obj, below); + li->sd->items = eina_list_remove(li->sd->items, obj); + evas_object_stack_below(obj, below); + li->sd->items = eina_list_prepend_relative(li->sd->items, obj, below); } } @@ -229,9 +229,9 @@ e_layout_child_raise_above(Evas_Object *obj, Evas_Object *above) if (!eina_list_data_find(li->sd->items, obj)) return; if ((li->sd->items) && eina_list_next(li->sd->items)) { - li->sd->items = eina_list_remove(li->sd->items, obj); - evas_object_stack_above(obj, above); - li->sd->items = eina_list_append_relative(li->sd->items, obj, above); + li->sd->items = eina_list_remove(li->sd->items, obj); + evas_object_stack_above(obj, above); + li->sd->items = eina_list_append_relative(li->sd->items, obj, above); } } @@ -283,7 +283,7 @@ _e_layout_smart_adopt(E_Smart_Data *sd, Evas_Object *obj) evas_object_smart_member_add(obj, li->sd->obj); evas_object_data_set(obj, "e_layout_data", li); evas_object_event_callback_add(obj, EVAS_CALLBACK_FREE, - _e_layout_smart_item_del_hook, NULL); + _e_layout_smart_item_del_hook, NULL); if ((!evas_object_visible_get(sd->clip)) && (evas_object_visible_get(sd->obj))) evas_object_show(sd->clip); @@ -299,12 +299,12 @@ _e_layout_smart_disown(Evas_Object *obj) if (!li) return; if (!li->sd->items) { - if (evas_object_visible_get(li->sd->clip)) - evas_object_hide(li->sd->clip); + if (evas_object_visible_get(li->sd->clip)) + evas_object_hide(li->sd->clip); } evas_object_event_callback_del(obj, - EVAS_CALLBACK_FREE, - _e_layout_smart_item_del_hook); + EVAS_CALLBACK_FREE, + _e_layout_smart_item_del_hook); evas_object_smart_member_del(obj); evas_object_data_del(obj, "e_layout_data"); free(li); @@ -326,9 +326,9 @@ _e_layout_smart_reconfigure(E_Smart_Data *sd) EINA_LIST_FOREACH(sd->items, l, obj) { - E_Layout_Item *li; - li = evas_object_data_get(obj, "e_layout_data"); - _e_layout_smart_move_resize_item(li); + E_Layout_Item *li; + li = evas_object_data_get(obj, "e_layout_data"); + _e_layout_smart_move_resize_item(li); } sd->changed = 0; } @@ -337,41 +337,41 @@ static void _e_layout_smart_move_resize_item(E_Layout_Item *li) { evas_object_move(li->obj, - li->sd->x + ((li->x * li->sd->w) / li->sd->vw), - li->sd->y + ((li->y * li->sd->h) / li->sd->vh)); + li->sd->x + ((li->x * li->sd->w) / li->sd->vw), + li->sd->y + ((li->y * li->sd->h) / li->sd->vh)); evas_object_resize(li->obj, - (li->w * li->sd->w) / li->sd->vw, - (li->h * li->sd->h) / li->sd->vh); + (li->w * li->sd->w) / li->sd->vw, + (li->h * li->sd->h) / li->sd->vh); } static void _e_layout_smart_init(void) { if (_e_smart) return; - { - static const Evas_Smart_Class sc = - { - "e_layout", - EVAS_SMART_CLASS_VERSION, - _e_layout_smart_add, - _e_layout_smart_del, - _e_layout_smart_move, - _e_layout_smart_resize, - _e_layout_smart_show, - _e_layout_smart_hide, - _e_layout_smart_color_set, - _e_layout_smart_clip_set, - _e_layout_smart_clip_unset, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL - }; - _e_smart = evas_smart_class_new(&sc); - } + { + static const Evas_Smart_Class sc = + { + "e_layout", + EVAS_SMART_CLASS_VERSION, + _e_layout_smart_add, + _e_layout_smart_del, + _e_layout_smart_move, + _e_layout_smart_resize, + _e_layout_smart_show, + _e_layout_smart_hide, + _e_layout_smart_color_set, + _e_layout_smart_clip_set, + _e_layout_smart_clip_unset, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL + }; + _e_smart = evas_smart_class_new(&sc); + } } static void @@ -405,10 +405,10 @@ _e_layout_smart_del(Evas_Object *obj) if (!sd) return; while (sd->items) { - Evas_Object *child; + Evas_Object *child; - child = eina_list_data_get(sd->items); - e_layout_unpack(child); + child = eina_list_data_get(sd->items); + e_layout_unpack(child); } evas_object_del(sd->clip); free(sd); @@ -423,20 +423,20 @@ _e_layout_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) sd = evas_object_smart_data_get(obj); if (!sd) return; if ((x == sd->x) && (y == sd->y)) return; - { - Eina_List *l; - Evas_Coord dx, dy; + { + Eina_List *l; + Evas_Coord dx, dy; - dx = x - sd->x; - dy = y - sd->y; - EINA_LIST_FOREACH(sd->items, l, item) - { - Evas_Coord ox, oy; + dx = x - sd->x; + dy = y - sd->y; + EINA_LIST_FOREACH(sd->items, l, item) + { + Evas_Coord ox, oy; - evas_object_geometry_get(item, &ox, &oy, NULL, NULL); - evas_object_move(item, ox + dx, oy + dy); - } - } + evas_object_geometry_get(item, &ox, &oy, NULL, NULL); + evas_object_move(item, ox + dx, oy + dy); + } + } sd->x = x; sd->y = y; } @@ -504,3 +504,4 @@ _e_layout_smart_clip_unset(Evas_Object *obj) if (!sd) return; evas_object_clip_unset(sd->clip); } + diff --git a/src/bin/e_log.c b/src/bin/e_log.c index bdcc7a7b7..9f03a8ddc 100644 --- a/src/bin/e_log.c +++ b/src/bin/e_log.c @@ -34,7 +34,7 @@ e_log_init(void) e_log_dom = eina_log_domain_register("e", EINA_COLOR_WHITE); eina_log_domain_level_set("e", E_LOG_LEVEL); eina_log_print_cb_set(_e_log_cb, NULL); - return (e_log_dom != -1); + return e_log_dom != -1; } EINTERN int @@ -44,3 +44,4 @@ e_log_shutdown(void) e_log_dom = -1; return 0; } + diff --git a/src/bin/e_main.c b/src/bin/e_main.c index 8d20df371..cef8cba44 100644 --- a/src/bin/e_main.c +++ b/src/bin/e_main.c @@ -132,7 +132,7 @@ _xdg_data_dirs_augment(void) char newpath[4096], buf[4096]; if (!p) return; - + snprintf(newpath, sizeof(newpath), "%s:%s/share", e_prefix_data_get(), p); if (s) { @@ -233,11 +233,11 @@ main(int argc, char **argv) } #ifdef TS_DO #undef TS -# define TS(x) \ - { \ - t1 = ecore_time_unix_get(); \ +# define TS(x) \ + { \ + t1 = ecore_time_unix_get(); \ printf("ESTART: %1.5f [%1.5f] - %s\n", t1 - t0, t1 - t2, x); \ - t2 = t1; \ + t2 = t1; \ } #endif TS("Eina Init Done"); @@ -404,7 +404,7 @@ main(int argc, char **argv) _e_main_shutdown(-1); } TS("Emotion Init Done"); - _e_main_shutdown_push((void*)emotion_shutdown); + _e_main_shutdown_push((void *)emotion_shutdown); #endif /* e doesn't sync to compositor - it should be one */ @@ -514,7 +514,7 @@ main(int argc, char **argv) _e_main_shutdown_push(e_configure_option_shutdown); _xdg_data_dirs_augment(); - + _fix_user_default_edj(); TS("E_Randr Init"); @@ -1030,7 +1030,6 @@ main(int argc, char **argv) e_test(); TS("E_Test Done"); - if (e_config->show_splash) e_init_status_set(_("Setup Shelves")); TS("E_Shelf Init"); @@ -1060,7 +1059,7 @@ main(int argc, char **argv) inloop = EINA_TRUE; e_util_env_set("E_RESTART", "1"); - + TS("MAIN LOOP AT LAST"); if (!setjmp(x_fatal_buff)) ecore_main_loop_begin(); @@ -1207,8 +1206,8 @@ _e_main_parse_arguments(int argc, char **argv) really_know = EINA_TRUE; else if (!strcmp(argv[i], "-locked")) locked = EINA_TRUE; - else if (!strcmp(argv[i], "-nopause")) - e_nopause = EINA_TRUE; + else if (!strcmp(argv[i], "-nopause")) + e_nopause = EINA_TRUE; else if ((!strcmp(argv[i], "-h")) || (!strcmp(argv[i], "-help")) || (!strcmp(argv[i], "--help"))) @@ -1884,7 +1883,7 @@ _e_main_cb_idle_before(void *data __UNUSED__) if (!eb->func(eb->data)) eb->delete_me = 1; } } - EINA_LIST_FOREACH_SAFE (_idle_before_list, pl, l, eb) + EINA_LIST_FOREACH_SAFE(_idle_before_list, pl, l, eb) { if ((eb->once) || (eb->delete_me)) { @@ -1938,3 +1937,4 @@ _e_main_cb_startup_fake_end(void *data __UNUSED__) e_init_hide(); return ECORE_CALLBACK_CANCEL; } + diff --git a/src/bin/e_manager.c b/src/bin/e_manager.c index 8818fda6b..9f773e1c8 100644 --- a/src/bin/e_manager.c +++ b/src/bin/e_manager.c @@ -956,7 +956,7 @@ _e_manager_cb_screensaver_on(void *data __UNUSED__, int ev_type __UNUSED__, void e_desklock_show_autolocked(); else timer_post_screensaver_lock = ecore_timer_add - (e_config->desklock_post_screensaver_time, + (e_config->desklock_post_screensaver_time, _e_manager_cb_timer_post_screensaver_lock, NULL); } return ECORE_CALLBACK_PASS_ON; @@ -994,9 +994,11 @@ _e_manager_cb_client_message(void *data __UNUSED__, int ev_type __UNUSED__, void switch (e_config->window_activehint_policy) { case 0: break; + case 1: edje_object_signal_emit(bd->bg_object, "e,state,urgent", "e"); break; + default: if (!bd->focused) e_border_activate(bd, EINA_TRUE); else e_border_raise(bd); diff --git a/src/bin/e_maximize.c b/src/bin/e_maximize.c index e34f7674b..0ec2e2f9b 100644 --- a/src/bin/e_maximize.c +++ b/src/bin/e_maximize.c @@ -7,12 +7,12 @@ struct _E_Maximize_Rect int x1, yy1, x2, y2; }; -#define OBSTACLE(_x1, _y1, _x2, _y2) \ - { \ - r = E_NEW(E_Maximize_Rect, 1); \ - r->x1 = (_x1); r->yy1 = (_y1); r->x2 = (_x2); r->y2 = (_y2); \ - rects = eina_list_append(rects, r); \ - } +#define OBSTACLE(_x1, _y1, _x2, _y2) \ + { \ + r = E_NEW(E_Maximize_Rect, 1); \ + r->x1 = (_x1); r->yy1 = (_y1); r->x2 = (_x2); r->y2 = (_y2); \ + rects = eina_list_append(rects, r); \ + } static void _e_maximize_border_rects_fill(E_Border *bd, Eina_List *list, int *x1, int *yy1, int *x2, int *y2, E_Maximize dir); static void _e_maximize_border_rects_fill_both(E_Border *bd, Eina_List *rects, int *x1, int *yy1, int *x2, int *y2); @@ -47,71 +47,76 @@ e_maximize_border_dock_fit(E_Border *bd, int *x1, int *yy1, int *x2, int *y2) bl = e_container_border_list_first(bd->zone->container); while ((bd2 = e_container_border_list_next(bl))) { - enum { - NONE, - TOP, - RIGHT, - BOTTOM, - LEFT - } edge = NONE; + enum + { + NONE, + TOP, + RIGHT, + BOTTOM, + LEFT + } edge = NONE; - if ((bd2->zone != bd->zone) || (bd2 == bd) || - (bd2->client.netwm.type != ECORE_X_WINDOW_TYPE_DOCK)) - continue; + if ((bd2->zone != bd->zone) || (bd2 == bd) || + (bd2->client.netwm.type != ECORE_X_WINDOW_TYPE_DOCK)) + continue; - if (((bd2->x == bd2->zone->x) || ((bd2->x + bd2->w) == (bd2->zone->x + bd2->zone->w))) && - ((bd2->y == bd2->zone->y) || ((bd2->x + bd2->h) == (bd2->zone->x + bd2->zone->h)))) - { - /* corner */ - if (bd2->w > bd2->h) - { - if (bd2->y == bd2->zone->y) - edge = TOP; - else if ((bd2->y + bd2->h) == (bd2->zone->y + bd2->zone->h)) - edge = BOTTOM; - } - else - { - if ((bd2->x + bd2->w) == (bd2->zone->x + bd2->zone->w)) - edge = RIGHT; - else if (bd2->x == bd2->zone->x) - edge = LEFT; - } - } - else - { - if (bd2->y == bd2->zone->y) - edge = TOP; - else if ((bd2->y + bd2->h) == (bd2->zone->y + bd2->zone->h)) - edge = BOTTOM; - else if (bd2->x == bd2->zone->x) - edge = LEFT; - else if ((bd2->x + bd2->w) == (bd2->zone->x + bd2->zone->w)) - edge = RIGHT; - } + if (((bd2->x == bd2->zone->x) || ((bd2->x + bd2->w) == (bd2->zone->x + bd2->zone->w))) && + ((bd2->y == bd2->zone->y) || ((bd2->x + bd2->h) == (bd2->zone->x + bd2->zone->h)))) + { + /* corner */ + if (bd2->w > bd2->h) + { + if (bd2->y == bd2->zone->y) + edge = TOP; + else if ((bd2->y + bd2->h) == (bd2->zone->y + bd2->zone->h)) + edge = BOTTOM; + } + else + { + if ((bd2->x + bd2->w) == (bd2->zone->x + bd2->zone->w)) + edge = RIGHT; + else if (bd2->x == bd2->zone->x) + edge = LEFT; + } + } + else + { + if (bd2->y == bd2->zone->y) + edge = TOP; + else if ((bd2->y + bd2->h) == (bd2->zone->y + bd2->zone->h)) + edge = BOTTOM; + else if (bd2->x == bd2->zone->x) + edge = LEFT; + else if ((bd2->x + bd2->w) == (bd2->zone->x + bd2->zone->w)) + edge = RIGHT; + } - switch (edge) - { - case TOP: - if ((bd2->y + bd2->h) > cy1) - cy1 = (bd2->y + bd2->h); - break; - case RIGHT: - if (bd2->x < cx2) - cx2 = bd2->x; - break; - case BOTTOM: - if (bd2->y < cy2) - cy2 = bd2->y; - break; - case LEFT: - if ((bd2->x + bd2->w) > cx1) - cx1 = (bd2->x + bd2->w); - break; - case NONE: - printf("Crazy people. Dock isn't at the edge.\n"); - break; - } + switch (edge) + { + case TOP: + if ((bd2->y + bd2->h) > cy1) + cy1 = (bd2->y + bd2->h); + break; + + case RIGHT: + if (bd2->x < cx2) + cx2 = bd2->x; + break; + + case BOTTOM: + if (bd2->y < cy2) + cy2 = bd2->y; + break; + + case LEFT: + if ((bd2->x + bd2->w) > cx1) + cx1 = (bd2->x + bd2->w); + break; + + case NONE: + printf("Crazy people. Dock isn't at the edge.\n"); + break; + } } e_container_border_list_free(bl); @@ -130,34 +135,34 @@ e_maximize_border_shelf_fill(E_Border *bd, int *x1, int *yy1, int *x2, int *y2, EINA_LIST_FOREACH(e_shelf_list(), l, es) { - Eina_List *ll; - E_Config_Shelf_Desk *sd; + Eina_List *ll; + E_Config_Shelf_Desk *sd; - if (es->cfg->overlap) continue; - if (es->zone != bd->zone) continue; - if (es->cfg->desk_show_mode) - { - EINA_LIST_FOREACH(es->cfg->desk_list, ll, sd) - { - if (!sd) continue; - if ((sd->x == bd->desk->x) && (sd->y == bd->desk->y)) - { - OBSTACLE(es->x + es->zone->x, es->y + es->zone->y, - es->x + es->zone->x + es->w, es->y + es->zone->y + es->h); - break; - } - } - } - else - { - OBSTACLE(es->x + es->zone->x, es->y + es->zone->y, - es->x + es->zone->x + es->w, es->y + es->zone->y + es->h); - } + if (es->cfg->overlap) continue; + if (es->zone != bd->zone) continue; + if (es->cfg->desk_show_mode) + { + EINA_LIST_FOREACH(es->cfg->desk_list, ll, sd) + { + if (!sd) continue; + if ((sd->x == bd->desk->x) && (sd->y == bd->desk->y)) + { + OBSTACLE(es->x + es->zone->x, es->y + es->zone->y, + es->x + es->zone->x + es->w, es->y + es->zone->y + es->h); + break; + } + } + } + else + { + OBSTACLE(es->x + es->zone->x, es->y + es->zone->y, + es->x + es->zone->x + es->w, es->y + es->zone->y + es->h); + } } if (rects) { - _e_maximize_border_rects_fill(bd, rects, x1, yy1, x2, y2, dir); - E_FREE_LIST(rects, free); + _e_maximize_border_rects_fill(bd, rects, x1, yy1, x2, y2, dir); + E_FREE_LIST(rects, free); } } @@ -172,15 +177,15 @@ e_maximize_border_border_fill(E_Border *bd, int *x1, int *yy1, int *x2, int *y2, bl = e_container_border_list_first(bd->zone->container); while ((bd2 = e_container_border_list_next(bl))) { - if ((bd2->zone != bd->zone) || (bd == bd2) || (bd2->desk != bd->desk && !bd2->sticky) || (bd2->iconic)) - continue; - OBSTACLE(bd2->x, bd2->y, bd2->x + bd2->w, bd2->y + bd2->h); + if ((bd2->zone != bd->zone) || (bd == bd2) || (bd2->desk != bd->desk && !bd2->sticky) || (bd2->iconic)) + continue; + OBSTACLE(bd2->x, bd2->y, bd2->x + bd2->w, bd2->y + bd2->h); } e_container_border_list_free(bl); if (rects) { - _e_maximize_border_rects_fill(bd, rects, x1, yy1, x2, y2, dir); - E_FREE_LIST(rects, free); + _e_maximize_border_rects_fill(bd, rects, x1, yy1, x2, y2, dir); + E_FREE_LIST(rects, free); } } @@ -200,10 +205,10 @@ _e_maximize_border_rects_fill(E_Border *bd, Eina_List *rects, int *x1, int *yy1, bw = bd->w; bh = bd->h; - if ((dir & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_HORIZONTAL) - _e_maximize_border_rects_fill_horiz(bd, rects, x1, x2, &bx, &by, &bw, &bh); - else if ((dir & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_VERTICAL) - _e_maximize_border_rects_fill_vert(bd, rects, yy1, y2, &bx, &by, &bw, &bh); + if ((dir & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_HORIZONTAL) + _e_maximize_border_rects_fill_horiz(bd, rects, x1, x2, &bx, &by, &bw, &bh); + else if ((dir & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_VERTICAL) + _e_maximize_border_rects_fill_vert(bd, rects, yy1, y2, &bx, &by, &bw, &bh); } } @@ -246,16 +251,16 @@ _e_maximize_border_rects_fill_both(E_Border *bd, Eina_List *rects, int *x1, int if (((hx2 - hx1) * (hy2 - hy1)) > ((vx2 - vx1) * (vy2 - vy1))) { if (x1) *x1 = hx1; - if (yy1) *yy1 = hy1; - if (x2) *x2 = hx2; - if (y2) *y2 = hy2; + if (yy1) *yy1 = hy1; + if (x2) *x2 = hx2; + if (y2) *y2 = hy2; } else { if (x1) *x1 = vx1; - if (yy1) *yy1 = vy1; - if (x2) *x2 = vx2; - if (y2) *y2 = vy2; + if (yy1) *yy1 = vy1; + if (x2) *x2 = vx2; + if (y2) *y2 = vy2; } } @@ -275,11 +280,11 @@ _e_maximize_border_rects_fill_horiz(E_Border *bd, Eina_List *rects, int *x1, int /* Expand left */ EINA_LIST_FOREACH(rects, l, rect) { - if ((rect->x2 > cx1) && (rect->x2 <= *bx) && - E_INTERSECTS(0, rect->yy1, bd->zone->w, (rect->y2 - rect->yy1), 0, *by, bd->zone->w, *bh)) - { - cx1 = rect->x2; - } + if ((rect->x2 > cx1) && (rect->x2 <= *bx) && + E_INTERSECTS(0, rect->yy1, bd->zone->w, (rect->y2 - rect->yy1), 0, *by, bd->zone->w, *bh)) + { + cx1 = rect->x2; + } } *bw += (*bx - cx1); *bx = cx1; @@ -287,11 +292,11 @@ _e_maximize_border_rects_fill_horiz(E_Border *bd, Eina_List *rects, int *x1, int /* Expand right */ EINA_LIST_FOREACH(rects, l, rect) { - if ((rect->x1 < cx2) && (rect->x1 >= (*bx + *bw)) && - E_INTERSECTS(0, rect->yy1, bd->zone->w, (rect->y2 - rect->yy1), 0, *by, bd->zone->w, *bh)) - { - cx2 = rect->x1; - } + if ((rect->x1 < cx2) && (rect->x1 >= (*bx + *bw)) && + E_INTERSECTS(0, rect->yy1, bd->zone->w, (rect->y2 - rect->yy1), 0, *by, bd->zone->w, *bh)) + { + cx2 = rect->x1; + } } *bw = (cx2 - cx1); @@ -315,11 +320,11 @@ _e_maximize_border_rects_fill_vert(E_Border *bd, Eina_List *rects, int *yy1, int /* Expand up */ EINA_LIST_FOREACH(rects, l, rect) { - if ((rect->y2 > cy1) && (rect->y2 <= *by) && - E_INTERSECTS(rect->x1, 0, (rect->x2 - rect->x1), bd->zone->h, *bx, 0, *bw, bd->zone->h)) - { - cy1 = rect->y2; - } + if ((rect->y2 > cy1) && (rect->y2 <= *by) && + E_INTERSECTS(rect->x1, 0, (rect->x2 - rect->x1), bd->zone->h, *bx, 0, *bw, bd->zone->h)) + { + cy1 = rect->y2; + } } *bh += (*by - cy1); *by = cy1; @@ -327,14 +332,15 @@ _e_maximize_border_rects_fill_vert(E_Border *bd, Eina_List *rects, int *yy1, int /* Expand down */ EINA_LIST_FOREACH(rects, l, rect) { - if ((rect->yy1 < cy2) && (rect->yy1 >= (*by + *bh)) && - E_INTERSECTS(rect->x1, 0, (rect->x2 - rect->x1), bd->zone->h, *bx, 0, *bw, bd->zone->h)) - { - cy2 = rect->yy1; - } + if ((rect->yy1 < cy2) && (rect->yy1 >= (*by + *bh)) && + E_INTERSECTS(rect->x1, 0, (rect->x2 - rect->x1), bd->zone->h, *bx, 0, *bw, bd->zone->h)) + { + cy2 = rect->yy1; + } } *bh = (cy2 - cy1); if (yy1) *yy1 = cy1; if (y2) *y2 = cy2; } + diff --git a/src/bin/e_menu.c b/src/bin/e_menu.c index 174ba90f8..26ea7d74f 100644 --- a/src/bin/e_menu.c +++ b/src/bin/e_menu.c @@ -137,24 +137,24 @@ _e_menu_list_free_unref(Eina_List *l) * are deleted before their parents */ EINA_LIST_REVERSE_FOREACH_SAFE(l, ll, lll, o) - { - e_object_unref(o); - l = eina_list_remove_list(l, ll); - } + { + e_object_unref(o); + l = eina_list_remove_list(l, ll); + } return l; } /* macros for debugging menu refcounts */ #if 0 -#define e_object_ref(X) do {\ - int xx; \ - xx = e_object_ref(X); \ - INF("REF: %p || %d", X, xx); \ +#define e_object_ref(X) do { \ + int xx; \ + xx = e_object_ref(X); \ + INF("REF: %p || %d", X, xx); \ } while (0) -#define e_object_unref(X) do {\ - int xx; \ - xx = e_object_unref(X); \ - INF("UNREF: %p || %d", X, xx); \ +#define e_object_unref(X) do { \ + int xx; \ + xx = e_object_unref(X); \ + INF("UNREF: %p || %d", X, xx); \ } while (0) #endif @@ -557,7 +557,7 @@ e_menu_category_data_set(char *category, void *data) } EAPI E_Menu_Category_Callback * -e_menu_category_callback_add(char *category, void (*create_cb) (void *data, E_Menu *m, void *category_data), Ecore_Cb free_cb, void *data) +e_menu_category_callback_add(char *category, void (*create_cb)(void *data, E_Menu *m, void *category_data), Ecore_Cb free_cb, void *data) { E_Menu_Category *cat; E_Menu_Category_Callback *cb = NULL; @@ -791,7 +791,7 @@ e_menu_item_submenu_set(E_Menu_Item *mi, E_Menu *sub) 0.5, 0.5, /* align */ ww, hh, /* min */ -1, -1 /* max */ - ); + ); return; } evas_object_del(mi->submenu_object); @@ -814,7 +814,7 @@ e_menu_item_submenu_set(E_Menu_Item *mi, E_Menu *sub) 0.5, 0.5, /* align */ ww, hh, /* min */ -1, -1 /* max */ - ); + ); edje_object_part_swallow(mi->bg_object, "e.swallow.content", mi->container_object); edje_object_size_min_calc(mi->bg_object, &ww, &hh); @@ -840,10 +840,10 @@ e_menu_item_submenu_set(E_Menu_Item *mi, E_Menu *sub) if ((mi->submenu) || (mi->submenu_pre_cb.func)) { if (e_theme_edje_object_set(mi->bg_object, "base/theme/menus", - "e/widgets/menu/default/submenu_bg")) + "e/widgets/menu/default/submenu_bg")) return; } - + e_theme_edje_object_set(mi->bg_object, "base/theme/menus", "e/widgets/menu/default/item_bg"); } @@ -961,7 +961,7 @@ e_menu_item_callback_set(E_Menu_Item *mi, void (*func)(void *data, E_Menu *m, E_ E_OBJECT_CHECK(mi); E_OBJECT_TYPE_CHECK(mi, E_MENU_ITEM_TYPE); mi->cb.func = func; - mi->cb.data = (void*)data; + mi->cb.data = (void *)data; } EAPI void @@ -979,7 +979,7 @@ e_menu_item_submenu_pre_callback_set(E_Menu_Item *mi, void (*func)(void *data, E E_OBJECT_CHECK(mi); E_OBJECT_TYPE_CHECK(mi, E_MENU_ITEM_TYPE); mi->submenu_pre_cb.func = func; - mi->submenu_pre_cb.data = (void*)data; + mi->submenu_pre_cb.data = (void *)data; if (!mi->submenu_post_cb.func) mi->submenu_post_cb.func = _e_menu_cb_item_submenu_post_default; } @@ -990,7 +990,7 @@ e_menu_item_submenu_post_callback_set(E_Menu_Item *mi, void (*func)(void *data, E_OBJECT_CHECK(mi); E_OBJECT_TYPE_CHECK(mi, E_MENU_ITEM_TYPE); mi->submenu_post_cb.func = func; - mi->submenu_post_cb.data = (void*)data; + mi->submenu_post_cb.data = (void *)data; } EAPI void @@ -1150,7 +1150,7 @@ e_menu_idler_before(void) ((m->cur.h) != (m->prev.h))) { int w, h; - + m->prev.w = m->cur.w; m->prev.h = m->cur.h; w = m->cur.w; @@ -1323,7 +1323,7 @@ _e_menu_free(E_Menu *m) _e_menu_unrealize(m); E_FREE(m->shape_rects); m->shape_rects_num = 0; - EINA_LIST_FOREACH_SAFE (m->items, l, l_next, mi) + EINA_LIST_FOREACH_SAFE(m->items, l, l_next, mi) e_object_del(E_OBJECT(mi)); if (m->in_active_list) { @@ -1357,8 +1357,8 @@ _e_menu_item_free(E_Menu_Item *mi) ref = e_object_ref_get(E_OBJECT(mi->submenu)) - 1; e_object_unref(E_OBJECT(mi->submenu)); } - if (ref) - WRN("DANGLING SUBMENU FOR %s: REF(%d)||MENU(%p)", mi->label, ref, mi->submenu); + if (ref) + WRN("DANGLING SUBMENU FOR %s: REF(%d)||MENU(%p)", mi->label, ref, mi->submenu); } if (mi->menu->realized) _e_menu_item_unrealize(mi); mi->menu->items = eina_list_remove(mi->menu->items, mi); @@ -1486,7 +1486,7 @@ no_submenu_item: 0.5, 0.5, /* align */ ww, hh, /* min */ -1, -1 /* max */ - ); + ); } else if (mi->radio) { @@ -1506,7 +1506,7 @@ no_submenu_item: 0.5, 0.5, /* align */ ww, hh, /* min */ -1, -1 /* max */ - ); + ); } else { @@ -1601,7 +1601,7 @@ no_submenu_item: 0.5, 0.5, /* align */ ww, hh, /* min */ -1, -1 /* max */ - ); + ); } else { @@ -1616,7 +1616,7 @@ no_submenu_item: 0.5, 0.5, /* align */ ww, hh, /* min */ -1, -1 /* max */ - ); + ); } } else @@ -1648,7 +1648,7 @@ no_submenu_item: 0.5, 0.5, /* align */ ww, hh, /* min */ -1, -1 /* max */ - ); + ); } else { @@ -1676,7 +1676,7 @@ no_submenu_item: 0.5, 0.5, /* align */ ww, hh, /* min */ -1, -1 /* max */ - ); + ); } else { @@ -1717,7 +1717,7 @@ _e_menu_realize(E_Menu *m) E_Menu_Item *mi; int ok = 0; int w, h; - + if (m->realized || (!m->items)) return; m->realized = 1; m->ecore_evas = e_canvas_new(m->zone->container->win, @@ -1888,7 +1888,7 @@ _e_menu_items_layout_update(E_Menu *m) { e_zone_useful_geometry_get(m->zone, NULL, NULL, NULL, &zh); maxh = zh * 4; - if (maxh > 30000) maxh = 30000; // 32k x 32k mx coord limit for wins + if (maxh > 30000) maxh = 30000; // 32k x 32k mx coord limit for wins max_items = (maxh / min_h) - 1; } EINA_LIST_FOREACH(m->items, l, mi) @@ -2787,8 +2787,8 @@ _e_menu_auto_place(E_Menu *m, int x, int y, int w, int h) return 1; } else - /* T */ { + /* T */ m->cur.y = y + h; if (x < (m->zone->x + ((m->zone->w * 1) / 3))) m->cur.x = x; @@ -2814,8 +2814,8 @@ _e_menu_auto_place(E_Menu *m, int x, int y, int w, int h) return 4; } else - /* R */ { + /* R */ m->cur.x = x - m->cur.w; if (y < (m->zone->y + ((m->zone->h * 1) / 3))) m->cur.y = y; diff --git a/src/bin/e_module.c b/src/bin/e_module.c index 44d96f94d..e0b999c8a 100644 --- a/src/bin/e_module.c +++ b/src/bin/e_module.c @@ -75,7 +75,7 @@ e_module_all_load(void) char buf[128]; _e_modules_initting = EINA_TRUE; - + e_config->modules = eina_list_sort(e_config->modules, 0, _e_module_sort_priority); @@ -595,7 +595,7 @@ _e_module_cb_idler(void *data __UNUSED__) } ecore_event_add(E_EVENT_MODULE_INIT_END, NULL, NULL, NULL); - + _e_modules_initting = EINA_FALSE; _e_module_whitelist_check(); @@ -655,80 +655,80 @@ _e_module_whitelist_check(void) unsigned int known = 0; int i; const char *s; - const char *goodmods[] = - { - "access", - "backlight", - "battery", - "bluez4", - "clock", - "conf", - "conf_applications", - "conf_comp", - "conf_dialogs", - "conf_display", - "conf_edgebindings", - "conf_interaction", - "conf_intl", - "conf_keybindings", - "conf_menus", - "conf_paths", - "conf_performance", - "conf_randr", - "conf_shelves", - "conf_theme", - "conf_wallpaper2", - "conf_window_manipulation", - "conf_window_remembers", - "connman", - "cpufreq", - "everything", - "fileman", - "fileman_opinfo", - "gadman", - "ibar", - "ibox", - "illume2", - "illume-bluetooth", - "illume-home", - "illume-home-toggle", - "illume-indicator", - "illume-kbd-toggle", - "illume-keyboard", - "illume-mode-toggle", - "illume-softkey", - "layout", - "mixer", - "msgbus", - "notification", - "ofono", - "pager", - "physics", - "quickaccess", - "shot", - "start", - "syscon", - "systray", - "tasks", - "temperature", - "tiling", - "winlist", - "wizard", - "wl_drm", - "wl_screenshot", - "wl_shell", - "xkbswitch", - "echievements", - "music-control", - "conf2", - "appmenu", - NULL // end marker - }; + const char *goodmods[] = + { + "access", + "backlight", + "battery", + "bluez4", + "clock", + "conf", + "conf_applications", + "conf_comp", + "conf_dialogs", + "conf_display", + "conf_edgebindings", + "conf_interaction", + "conf_intl", + "conf_keybindings", + "conf_menus", + "conf_paths", + "conf_performance", + "conf_randr", + "conf_shelves", + "conf_theme", + "conf_wallpaper2", + "conf_window_manipulation", + "conf_window_remembers", + "connman", + "cpufreq", + "everything", + "fileman", + "fileman_opinfo", + "gadman", + "ibar", + "ibox", + "illume2", + "illume-bluetooth", + "illume-home", + "illume-home-toggle", + "illume-indicator", + "illume-kbd-toggle", + "illume-keyboard", + "illume-mode-toggle", + "illume-softkey", + "layout", + "mixer", + "msgbus", + "notification", + "ofono", + "pager", + "physics", + "quickaccess", + "shot", + "start", + "syscon", + "systray", + "tasks", + "temperature", + "tiling", + "winlist", + "wizard", + "wl_drm", + "wl_screenshot", + "wl_shell", + "xkbswitch", + "echievements", + "music-control", + "conf2", + "appmenu", + NULL // end marker + }; EINA_LIST_FOREACH(_e_modules, l, m) { Eina_Bool ok; - + if (!m->name) continue; ok = EINA_FALSE; for (i = 0; goodmods[i]; i++) @@ -780,7 +780,7 @@ _e_module_whitelist_check(void) { E_Dialog *dia; Eina_Strbuf *sbuf; - + dia = e_dialog_new(e_container_current_get(e_manager_current_get()), "E", "_module_whitelist_dialog"); if (!dia) @@ -824,3 +824,4 @@ _e_module_whitelist_check(void) eina_stringshare_del(s); } } + diff --git a/src/bin/e_mouse.c b/src/bin/e_mouse.c index 3533da6e4..cdcb0043f 100644 --- a/src/bin/e_mouse.c +++ b/src/bin/e_mouse.c @@ -39,3 +39,4 @@ e_mouse_update(void) return 1; } + diff --git a/src/bin/e_msg.c b/src/bin/e_msg.c index 21180c122..536b01298 100644 --- a/src/bin/e_msg.c +++ b/src/bin/e_msg.c @@ -4,8 +4,8 @@ typedef struct _E_Msg_Event E_Msg_Event; struct _E_Msg_Handler { - void (*func) (void *data, const char *name, const char *info, int val, E_Object *obj, void *msgdata); - void *data; + void (*func)(void *data, const char *name, const char *info, int val, E_Object *obj, void *msgdata); + void *data; unsigned char delete_me : 1; }; @@ -16,13 +16,13 @@ struct _E_Msg_Event int val; E_Object *obj; void *msgdata; - void (*afterfunc) (void *data, E_Object *obj, void *msgdata); + void (*afterfunc)(void *data, E_Object *obj, void *msgdata); void *afterdata; }; /* local subsystem functions */ static Eina_Bool _e_msg_event_cb(void *data, int ev_type, void *ev); -static void _e_msg_event_free(void *data, void *ev); +static void _e_msg_event_free(void *data, void *ev); /* local subsystem globals */ static Eina_List *handlers = NULL; @@ -43,7 +43,8 @@ e_msg_init(void) EINTERN int e_msg_shutdown(void) { - while (handlers) e_msg_handler_del(eina_list_data_get(handlers)); + while (handlers) + e_msg_handler_del(eina_list_data_get(handlers)); E_EVENT_MSG = 0; if (hand) ecore_event_handler_del(hand); hand = NULL; @@ -51,7 +52,7 @@ e_msg_shutdown(void) } EAPI void -e_msg_send(const char *name, const char *info, int val, E_Object *obj, void *msgdata, void (*afterfunc) (void *data, E_Object *obj, void *msgdata), void *afterdata) +e_msg_send(const char *name, const char *info, int val, E_Object *obj, void *msgdata, void (*afterfunc)(void *data, E_Object *obj, void *msgdata), void *afterdata) { unsigned int size, pos, name_len, info_len; E_Msg_Event *ev; @@ -65,14 +66,14 @@ e_msg_send(const char *name, const char *info, int val, E_Object *obj, void *msg pos = size; if (name) { - ev->name = ((char *)ev) + pos; - pos += name_len; - strcpy(ev->name, name); + ev->name = ((char *)ev) + pos; + pos += name_len; + strcpy(ev->name, name); } if (info) { - ev->info = ((char *)ev) + pos; - strcpy(ev->info, info); + ev->info = ((char *)ev) + pos; + strcpy(ev->info, info); } ev->val = val; ev->obj = obj; @@ -84,7 +85,7 @@ e_msg_send(const char *name, const char *info, int val, E_Object *obj, void *msg } EAPI E_Msg_Handler * -e_msg_handler_add(void (*func) (void *data, const char *name, const char *info, int val, E_Object *obj, void *msgdata), void *data) +e_msg_handler_add(void (*func)(void *data, const char *name, const char *info, int val, E_Object *obj, void *msgdata), void *data) { E_Msg_Handler *emsgh; @@ -101,13 +102,13 @@ e_msg_handler_del(E_Msg_Handler *emsgh) { if (processing_handlers > 0) { - emsgh->delete_me = 1; - del_handlers = eina_list_append(del_handlers, emsgh); + emsgh->delete_me = 1; + del_handlers = eina_list_append(del_handlers, emsgh); } else { - handlers = eina_list_remove(handlers, emsgh); - free(emsgh); + handlers = eina_list_remove(handlers, emsgh); + free(emsgh); } } @@ -124,14 +125,14 @@ _e_msg_event_cb(void *data __UNUSED__, int ev_type __UNUSED__, void *ev) e = ev; EINA_LIST_FOREACH(handlers, l, emsgh) { - if (!emsgh->delete_me) - emsgh->func(emsgh->data, e->name, e->info, e->val, e->obj, e->msgdata); + if (!emsgh->delete_me) + emsgh->func(emsgh->data, e->name, e->info, e->val, e->obj, e->msgdata); } if (e->afterfunc) e->afterfunc(e->afterdata, e->obj, e->msgdata); processing_handlers--; if ((processing_handlers == 0) && (del_handlers)) { - E_FREE_LIST(del_handlers, e_msg_handler_del); + E_FREE_LIST(del_handlers, e_msg_handler_del); } return 1; } @@ -146,3 +147,4 @@ _e_msg_event_free(void *data __UNUSED__, void *ev) E_FREE(ev); } + diff --git a/src/bin/e_msgbus.c b/src/bin/e_msgbus.c index 4ff255368..1d005e0db 100644 --- a/src/bin/e_msgbus.c +++ b/src/bin/e_msgbus.c @@ -1,8 +1,8 @@ #include "e.h" /* local subsystem functions */ -static void _e_msgbus_request_name_cb(void *data, const EDBus_Message *msg, - EDBus_Pending *pending); +static void _e_msgbus_request_name_cb(void *data, const EDBus_Message *msg, + EDBus_Pending *pending); static EDBus_Message *_e_msgbus_core_restart_cb(const EDBus_Service_Interface *iface, const EDBus_Message *msg); @@ -31,9 +31,9 @@ static EDBus_Message *_e_msgbus_profile_add_cb(const EDBus_Service_Interface *if static EDBus_Message *_e_msgbus_profile_delete_cb(const EDBus_Service_Interface *iface, const EDBus_Message *msg); -#define E_MSGBUS_WIN_ACTION_CB_PROTO(NAME) \ -static EDBus_Message *_e_msgbus_window_##NAME##_cb(const EDBus_Service_Interface *iface, \ - const EDBus_Message *msg) +#define E_MSGBUS_WIN_ACTION_CB_PROTO(NAME) \ + static EDBus_Message * _e_msgbus_window_##NAME##_cb(const EDBus_Service_Interface * iface, \ + const EDBus_Message * msg) E_MSGBUS_WIN_ACTION_CB_PROTO(list); E_MSGBUS_WIN_ACTION_CB_PROTO(close); @@ -59,7 +59,7 @@ static const EDBus_Method module_methods[] = { { "Enable", EDBUS_ARGS({"s", "module"}), NULL, _e_msgbus_module_enable_cb }, { "Disable", EDBUS_ARGS({"s", "module"}), NULL, _e_msgbus_module_disable_cb }, { "List", NULL, EDBUS_ARGS({"a(si)", "modules"}), - _e_msgbus_module_list_cb }, + _e_msgbus_module_list_cb }, { } }; @@ -67,7 +67,7 @@ static const EDBus_Method profile_methods[] = { { "Set", EDBUS_ARGS({"s", "profile"}), NULL, _e_msgbus_profile_set_cb }, { "Get", NULL, EDBUS_ARGS({"s", "profile"}), _e_msgbus_profile_get_cb }, { "List", NULL, EDBUS_ARGS({"as", "array_profiles"}), - _e_msgbus_profile_list_cb }, + _e_msgbus_profile_list_cb }, { "Add", EDBUS_ARGS({"s", "profile"}), NULL, _e_msgbus_profile_add_cb }, { "Delete", EDBUS_ARGS({"s", "profile"}), NULL, _e_msgbus_profile_delete_cb }, { } @@ -75,18 +75,18 @@ static const EDBus_Method profile_methods[] = { static const EDBus_Method window_methods[] = { { "List", NULL, EDBUS_ARGS({"a(si)", "array_of_window"}), - _e_msgbus_window_list_cb }, + _e_msgbus_window_list_cb }, { "Close", EDBUS_ARGS({"i", "window_id"}), NULL, _e_msgbus_window_close_cb }, { "Kill", EDBUS_ARGS({"i", "window_id"}), NULL, _e_msgbus_window_kill_cb }, { "Focus", EDBUS_ARGS({"i", "window_id"}), NULL, _e_msgbus_window_focus_cb }, { "Iconify", EDBUS_ARGS({"i", "window_id"}), NULL, - _e_msgbus_window_iconify_cb }, + _e_msgbus_window_iconify_cb }, { "Uniconify", EDBUS_ARGS({"i", "window_id"}), NULL, - _e_msgbus_window_uniconify_cb }, + _e_msgbus_window_uniconify_cb }, { "Maximize", EDBUS_ARGS({"i", "window_id"}), NULL, - _e_msgbus_window_maximize_cb }, + _e_msgbus_window_maximize_cb }, { "Unmaximize", EDBUS_ARGS({"i", "window_id"}), NULL, - _e_msgbus_window_unmaximize_cb }, + _e_msgbus_window_unmaximize_cb }, { } }; @@ -437,55 +437,54 @@ _e_msgbus_window_list_cb(const EDBus_Service_Interface *iface __UNUSED__, return reply; } -#define E_MSGBUS_WIN_ACTION_CB_BEGIN(NAME) \ -static EDBus_Message * \ -_e_msgbus_window_##NAME##_cb(const EDBus_Service_Interface *iface __UNUSED__,\ - const EDBus_Message *msg) \ -{ \ - E_Border *bd; \ - int xwin;\ -\ - if (!edbus_message_arguments_get(msg, "i", &xwin)) \ - return edbus_message_method_return_new(msg); \ - bd = e_border_find_by_client_window(xwin);\ - if (bd)\ - { - -#define E_MSGBUS_WIN_ACTION_CB_END \ - }\ -\ - return edbus_message_method_return_new(msg);\ -} - -E_MSGBUS_WIN_ACTION_CB_BEGIN(close) -e_border_act_close_begin(bd); -E_MSGBUS_WIN_ACTION_CB_END - -E_MSGBUS_WIN_ACTION_CB_BEGIN(kill) -e_border_act_kill_begin(bd); -E_MSGBUS_WIN_ACTION_CB_END - -E_MSGBUS_WIN_ACTION_CB_BEGIN(focus) -e_border_focus_set(bd, 1, 1); -if (!bd->lock_user_stacking) - { - if (e_config->border_raise_on_focus) - e_border_raise(bd); +#define E_MSGBUS_WIN_ACTION_CB_BEGIN(NAME) \ + static EDBus_Message * \ + _e_msgbus_window_##NAME##_cb(const EDBus_Service_Interface * iface __UNUSED__, \ + const EDBus_Message * msg) \ + { \ + E_Border *bd; \ + int xwin; \ + \ + if (!edbus_message_arguments_get(msg, "i", &xwin)) \ + return edbus_message_method_return_new(msg); \ + bd = e_border_find_by_client_window(xwin); \ + if (bd) \ + { +#define E_MSGBUS_WIN_ACTION_CB_END \ + } \ + \ + return edbus_message_method_return_new(msg); \ } -E_MSGBUS_WIN_ACTION_CB_END -E_MSGBUS_WIN_ACTION_CB_BEGIN(iconify) -e_border_iconify(bd); -E_MSGBUS_WIN_ACTION_CB_END + E_MSGBUS_WIN_ACTION_CB_BEGIN(close) + e_border_act_close_begin(bd); + E_MSGBUS_WIN_ACTION_CB_END -E_MSGBUS_WIN_ACTION_CB_BEGIN(uniconify) -e_border_uniconify(bd); -E_MSGBUS_WIN_ACTION_CB_END + E_MSGBUS_WIN_ACTION_CB_BEGIN(kill) + e_border_act_kill_begin(bd); + E_MSGBUS_WIN_ACTION_CB_END -E_MSGBUS_WIN_ACTION_CB_BEGIN(maximize) -e_border_maximize(bd, e_config->maximize_policy); -E_MSGBUS_WIN_ACTION_CB_END + E_MSGBUS_WIN_ACTION_CB_BEGIN(focus) + e_border_focus_set(bd, 1, 1); + if (!bd->lock_user_stacking) + { + if (e_config->border_raise_on_focus) + e_border_raise(bd); + } + E_MSGBUS_WIN_ACTION_CB_END -E_MSGBUS_WIN_ACTION_CB_BEGIN(unmaximize) -e_border_unmaximize(bd, E_MAXIMIZE_BOTH); -E_MSGBUS_WIN_ACTION_CB_END + E_MSGBUS_WIN_ACTION_CB_BEGIN(iconify) + e_border_iconify(bd); + E_MSGBUS_WIN_ACTION_CB_END + + E_MSGBUS_WIN_ACTION_CB_BEGIN(uniconify) + e_border_uniconify(bd); + E_MSGBUS_WIN_ACTION_CB_END + + E_MSGBUS_WIN_ACTION_CB_BEGIN(maximize) + e_border_maximize(bd, e_config->maximize_policy); + E_MSGBUS_WIN_ACTION_CB_END + + E_MSGBUS_WIN_ACTION_CB_BEGIN(unmaximize) + e_border_unmaximize(bd, E_MAXIMIZE_BOTH); + E_MSGBUS_WIN_ACTION_CB_END diff --git a/src/bin/e_notification.c b/src/bin/e_notification.c index dc10fb932..d5c9e1fd8 100644 --- a/src/bin/e_notification.c +++ b/src/bin/e_notification.c @@ -2,11 +2,11 @@ typedef struct _Notification_Data { - EDBus_Connection *conn; - EDBus_Service_Interface *iface; - E_Notification_Notify_Cb notify_cb; - E_Notification_Close_Cb close_cb; - void *data; + EDBus_Connection *conn; + EDBus_Service_Interface *iface; + E_Notification_Notify_Cb notify_cb; + E_Notification_Close_Cb close_cb; + void *data; const E_Notification_Server_Info *server_info; } Notification_Data; @@ -38,7 +38,7 @@ hints_dict_iter(void *data, const void *key, EDBus_Message_Iter *var) n->icon.raw.channels = channels; n->icon.raw.data = malloc(sizeof(char) * n->icon.raw.data_size); EINA_SAFETY_ON_NULL_RETURN(n->icon.raw.data); - memcpy(n->icon.raw.data, raw_data, sizeof(char)*n->icon.raw.data_size); + memcpy(n->icon.raw.data, raw_data, sizeof(char) * n->icon.raw.data_size); } else if (!strcmp(key, "urgency")) { @@ -111,7 +111,7 @@ capabilities_cb(const EDBus_Service_Interface *iface EINA_UNUSED, const EDBus_Me for (i = 0; n_data->server_info->capabilities[i]; i++) edbus_message_iter_arguments_append(array, "s", - n_data->server_info->capabilities[i]); + n_data->server_info->capabilities[i]); edbus_message_iter_container_close(main_iter, array); return reply; } @@ -133,10 +133,10 @@ static const EDBus_Method methods[] = { EDBUS_ARGS({"u", "id"}), notify_cb }, { "CloseNotification", EDBUS_ARGS({"u", "id"}), NULL, close_notification_cb }, { "GetCapabilities", NULL, EDBUS_ARGS({"as", "capabilities"}), - capabilities_cb }, + capabilities_cb }, { "GetServerInformation", NULL, - EDBUS_ARGS({"s", "name"}, {"s", "vendor"}, {"s", "version"}, {"s", "spec_version"}), - server_info_cb }, + EDBUS_ARGS({"s", "name"}, {"s", "vendor"}, {"s", "version"}, {"s", "spec_version"}), + server_info_cb }, { } }; @@ -148,9 +148,9 @@ enum static const EDBus_Signal signals[] = { [SIGNAL_NOTIFICATION_CLOSED] = - { "NotificationClosed", EDBUS_ARGS({"u", "id"}, {"u", "reason"}) }, + { "NotificationClosed", EDBUS_ARGS({"u", "id"}, {"u", "reason"}) }, [SIGNAL_ACTION_INVOKED] = - { "ActionInvoked", EDBUS_ARGS({"u", "id"}, {"s", "action_key"}) }, + { "ActionInvoked", EDBUS_ARGS({"u", "id"}, {"s", "action_key"}) }, { } }; @@ -176,7 +176,7 @@ e_notification_server_register(const E_Notification_Server_Info *server_info, E_ n_data->iface = edbus_service_interface_register(n_data->conn, PATH, &desc); n_data->notify_cb = n_cb; n_data->close_cb = close_cb; - n_data->data = (void *) data; + n_data->data = (void *)data; n_data->server_info = server_info; edbus_name_request(n_data->conn, BUS, EDBUS_NAME_REQUEST_FLAG_REPLACE_EXISTING, NULL, NULL); @@ -311,11 +311,11 @@ notification_client_dbus_send(E_Notification_Notify *notify, E_Notification_Clie //build message main_iter = edbus_message_iter_get(msg); if (!edbus_message_iter_arguments_append(main_iter, "susssas", - notify->app_name ?: "", + notify->app_name ? : "", notify->replaces_id, - notify->icon.icon ?: "", - notify->sumary ?: "", - notify->body ?: "", + notify->icon.icon ? : "", + notify->sumary ? : "", + notify->body ? : "", &actions)) goto error; edbus_message_iter_container_close(main_iter, actions); @@ -410,6 +410,7 @@ e_notification_client_send(E_Notification_Notify *notify, E_Notification_Client_ id = n_data->notify_cb(n_data->data, copy); if (cb) - cb((void *) data, id); + cb((void *)data, id); return EINA_TRUE; } + diff --git a/src/bin/e_obj_dialog.c b/src/bin/e_obj_dialog.c index 319aec6b7..bafe057d9 100644 --- a/src/bin/e_obj_dialog.c +++ b/src/bin/e_obj_dialog.c @@ -30,19 +30,19 @@ e_obj_dialog_new(E_Container *con, char *title, char *class_name, char *class_cl if (!con) { - man = e_manager_current_get(); - if (!man) return NULL; - con = e_container_current_get(man); - if (!con) con = e_container_number_get(man, 0); - if (!con) return NULL; + man = e_manager_current_get(); + if (!man) return NULL; + con = e_container_current_get(man); + if (!con) con = e_container_number_get(man, 0); + if (!con) return NULL; } od = E_OBJECT_ALLOC(E_Obj_Dialog, E_OBJ_DIALOG_TYPE, _e_obj_dialog_free); if (!od) return NULL; od->win = e_win_new(con); if (!od->win) { - free(od); - return NULL; + free(od); + return NULL; } e_win_delete_callback_set(od->win, _e_obj_dialog_cb_delete); e_win_resize_callback_set(od->win, _e_obj_dialog_cb_resize); @@ -80,8 +80,8 @@ e_obj_dialog_icon_set(E_Obj_Dialog *od, char *icon) E_OBJECT_TYPE_CHECK(od, E_OBJ_DIALOG_TYPE); if (od->win->border->internal_icon) { - eina_stringshare_del(od->win->border->internal_icon); - od->win->border->internal_icon = NULL; + eina_stringshare_del(od->win->border->internal_icon); + od->win->border->internal_icon = NULL; } if (icon) od->win->border->internal_icon = eina_stringshare_add(icon); @@ -104,9 +104,9 @@ e_obj_dialog_show(E_Obj_Dialog *od) edje_object_size_max_get(od->bg_object, &w, &h); if ((w > 0) && (h > 0)) { - if (w < mw) w = mw; - if (h < mh) h = mh; - e_win_size_max_set(od->win, w, h); + if (w < mw) w = mw; + if (h < mh) h = mh; + e_win_size_max_set(od->win, w, h); } s = edje_object_data_get(od->bg_object, "borderless"); if (s && (!strcmp(s, "1"))) @@ -135,7 +135,7 @@ e_obj_dialog_obj_theme_set(E_Obj_Dialog *od, char *theme_cat, char *theme_obj) evas_object_move(od->bg_object, 0, 0); evas_object_show(od->bg_object); edje_object_signal_callback_add(od->bg_object, "e,action,close", "", - _e_obj_dialog_cb_close, od); + _e_obj_dialog_cb_close, od); } /* local subsystem functions */ @@ -177,3 +177,4 @@ _e_obj_dialog_cb_resize(E_Win *win) od = win->data; evas_object_resize(od->bg_object, od->win->w, od->win->h); } + diff --git a/src/bin/e_object.c b/src/bin/e_object.c index 373910019..973af2ca6 100644 --- a/src/bin/e_object.c +++ b/src/bin/e_object.c @@ -21,7 +21,7 @@ e_object_alloc(int size, int type, E_Object_Cleanup_Func cleanup_func) if (!obj) return NULL; obj->magic = E_OBJECT_MAGIC; obj->type = type; - obj->references = 1; + obj->references = 1; obj->cleanup_func = cleanup_func; return obj; } @@ -30,7 +30,7 @@ static void _delay_del(void *data) { E_Object *obj = data; - + obj->delay_del_job = NULL; if (obj->del_att_func) obj->del_att_func(obj); if (obj->del_func) obj->del_func(obj); @@ -158,12 +158,14 @@ e_bt(void) { int j; - for (j = 1; j < i; j++) putchar(' '); + for (j = 1; j < i; j++) + putchar(' '); printf("%s\n", messages[i]); } free(messages); } } + #endif EAPI int @@ -184,90 +186,90 @@ e_object_error(E_Object *obj) bt[0] = 0; if (messages) { - for (i = 1; i < trace_num; i++) - { - strcat(bt, messages[i]); - strcat(bt, "\n"); - } - free(messages); + for (i = 1; i < trace_num; i++) + { + strcat(bt, messages[i]); + strcat(bt, "\n"); + } + free(messages); } /* if NULL obj then dump stacktrace */ if (!obj) { - snprintf(buf, sizeof(buf), - "Object is NULL.\n" - "%s", - bt); + snprintf(buf, sizeof(buf), + "Object is NULL.\n" + "%s", + bt); } /* if obj pointer is non NULL, actually try an access and see if we segv */ else if (obj) { - struct sigaction act, oact; - int magic = 0, segv = 0; + struct sigaction act, oact; + int magic = 0, segv = 0; - /* setup segv handler */ - act.sa_handler = _e_object_segv; - act.sa_flags = SA_RESETHAND; - sigemptyset(&act.sa_mask); - sigaction(SIGSEGV, &act, &oact); - /* set a longjump to be within this if statement. only called if we */ - /* segfault */ - if (sigsetjmp(_e_object_segv_buf, 1)) - { - sigaction(SIGSEGV, &oact, NULL); - segv = 1; - } - else - { - /* try access magic value */ - magic = obj->magic; - /* if pointer is bogus we'd segv and so jump to the if () above */ - /* contents, and thus reset segv handler and set segv flag. */ - /* if not we just continue moving along here and reset handler */ - sigaction(SIGSEGV, &oact, NULL); - } - /* if we segfaulted above... */ - if (segv) - snprintf(buf, sizeof(buf), - "Object [%p] is an invalid/garbage pointer.\n" - "Segfault successfully avoided.\n" - "%s", - obj, - bt); - else - { - /* valid ram then... if we freed this object before */ - if (magic == E_OBJECT_MAGIC_FREED) - snprintf(buf, sizeof(buf), - "Object [%p] is already freed.\n" - "%s", - obj, - bt); - /* garbage magic value - pointer to non object */ - else if (magic != E_OBJECT_MAGIC) - snprintf(buf, sizeof(buf), - "Object [%p] has garbage magic (%x).\n" - "%s", - obj, magic, - bt); - else if (obj->references < 0) - snprintf(buf, sizeof(buf), - "Object [%p] has negative references (%i).\n" - "%s", - obj, obj->references, - bt); - else if (obj->references > 100) - snprintf(buf, sizeof(buf), - "Object [%p] has unusually high reference count (%i).\n" - "%s", - obj, obj->references, - bt); - /* it's all ok! */ - else - { - return 0; - } - } + /* setup segv handler */ + act.sa_handler = _e_object_segv; + act.sa_flags = SA_RESETHAND; + sigemptyset(&act.sa_mask); + sigaction(SIGSEGV, &act, &oact); + /* set a longjump to be within this if statement. only called if we */ + /* segfault */ + if (sigsetjmp(_e_object_segv_buf, 1)) + { + sigaction(SIGSEGV, &oact, NULL); + segv = 1; + } + else + { + /* try access magic value */ + magic = obj->magic; + /* if pointer is bogus we'd segv and so jump to the if () above */ + /* contents, and thus reset segv handler and set segv flag. */ + /* if not we just continue moving along here and reset handler */ + sigaction(SIGSEGV, &oact, NULL); + } + /* if we segfaulted above... */ + if (segv) + snprintf(buf, sizeof(buf), + "Object [%p] is an invalid/garbage pointer.\n" + "Segfault successfully avoided.\n" + "%s", + obj, + bt); + else + { + /* valid ram then... if we freed this object before */ + if (magic == E_OBJECT_MAGIC_FREED) + snprintf(buf, sizeof(buf), + "Object [%p] is already freed.\n" + "%s", + obj, + bt); + /* garbage magic value - pointer to non object */ + else if (magic != E_OBJECT_MAGIC) + snprintf(buf, sizeof(buf), + "Object [%p] has garbage magic (%x).\n" + "%s", + obj, magic, + bt); + else if (obj->references < 0) + snprintf(buf, sizeof(buf), + "Object [%p] has negative references (%i).\n" + "%s", + obj, obj->references, + bt); + else if (obj->references > 100) + snprintf(buf, sizeof(buf), + "Object [%p] has unusually high reference count (%i).\n" + "%s", + obj, obj->references, + bt); + /* it's all ok! */ + else + { + return 0; + } + } } /* display actual error message */ e_error_message_show("%s", buf); @@ -275,9 +277,9 @@ e_object_error(E_Object *obj) #else if (!obj) { - fprintf(stderr, "ERROR: Object is NULL. Add break point at %s:%d\n", - __FILE__, __LINE__); - return 1; + fprintf(stderr, "ERROR: Object is NULL. Add break point at %s:%d\n", + __FILE__, __LINE__); + return 1; } return 0; #endif @@ -287,7 +289,7 @@ EAPI void e_object_data_set(E_Object *obj, const void *data) { E_OBJECT_CHECK(obj); - obj->data = (void*)data; + obj->data = (void *)data; } EAPI void * @@ -315,7 +317,7 @@ EAPI void e_object_delfn_clear(E_Object *obj) { E_Object_Delfn *dfn; - + E_OBJECT_CHECK(obj); if (obj->walking_list) { @@ -335,7 +337,7 @@ e_object_delfn_clear(E_Object *obj) } EAPI E_Object_Delfn * -e_object_delfn_add(E_Object *obj, void (*func) (void *data, void *obj), void *data) +e_object_delfn_add(E_Object *obj, void (*func)(void *data, void *obj), void *data) { E_Object_Delfn *dfn; E_OBJECT_CHECK_RETURN(obj, NULL); @@ -361,42 +363,42 @@ e_object_delfn_del(E_Object *obj, E_Object_Delfn *dfn) } /* -void -e_object_breadcrumb_add(E_Object *obj, char *crumb) -{ + void + e_object_breadcrumb_add(E_Object *obj, char *crumb) + { E_OBJECT_CHECK(obj); obj->crumbs = eina_list_append(obj->crumbs, strdup(crumb)); -} + } -void -e_object_breadcrumb_del(E_Object *obj, char *crumb) -{ + void + e_object_breadcrumb_del(E_Object *obj, char *crumb) + { Eina_List *l; char *key; E_OBJECT_CHECK(obj); EINA_LIST_FOREACH(obj->crumbs, l, key) { - if (!strcmp(crumb, key)) - { - free(key); - obj->crumbs = eina_list_remove_list(obj->crumbs, l); - return; - } + if (!strcmp(crumb, key)) + { + free(key); + obj->crumbs = eina_list_remove_list(obj->crumbs, l); + return; + } } -} + } -void -e_object_breadcrumb_debug(E_Object *obj) -{ + void + e_object_breadcrumb_debug(E_Object *obj) + { Eina_List *l; char *key; E_OBJECT_CHECK(obj); EINA_LISt_FOREACH(obj->crumbs, l, key) printf("CRUMB: %s\n", key); -} -*/ + } + */ #ifdef OBJECT_PARANOIA_CHECK /* local subsystem functions */ @@ -405,4 +407,5 @@ _e_object_segv(int sig) { siglongjmp(_e_object_segv_buf, 1); } + #endif diff --git a/src/bin/e_open.c b/src/bin/e_open.c index b7b3acadf..aca3cbd7d 100644 --- a/src/bin/e_open.c +++ b/src/bin/e_open.c @@ -124,7 +124,7 @@ get_command(void *data, Efreet_Desktop *desktop __UNUSED__, char *command, int r } static char ** -mime_open(const char *mime, const char * const *argv, int argc) +mime_open(const char *mime, const char *const *argv, int argc) { Efreet_Desktop *desktop = handler_find(mime); Eina_List *files = NULL; @@ -181,7 +181,7 @@ append_single_quote_escaped(Eina_Strbuf *b, const char *str) } static char ** -single_command_open(const char *command, const char * const *argv, int argc) +single_command_open(const char *command, const char *const *argv, int argc) { char **ret = calloc(2, sizeof(char *)); Eina_Strbuf *b; @@ -269,7 +269,7 @@ _terminal_get(const char *defaults_list) Efreet_Desktop *tdesktop = NULL; Efreet_Ini *ini; const char *s; - + ini = efreet_ini_new(defaults_list); if ((ini) && (ini->data) && (efreet_ini_section_set(ini, "Default Applications")) && @@ -286,20 +286,20 @@ static char ** terminal_open(void) { const char *terms[] = - { - "terminology.desktop", - "xterm.desktop", - "rxvt.desktop", - "gnome-terimnal.desktop", - "konsole.desktop", - NULL - }; + { + "terminology.desktop", + "xterm.desktop", + "rxvt.desktop", + "gnome-terimnal.desktop", + "konsole.desktop", + NULL + }; const char *s; char buf[PATH_MAX], **ret; Efreet_Desktop *tdesktop = NULL, *td; Eina_List *l; int i; - + s = efreet_data_home_get(); if (s) { @@ -313,7 +313,7 @@ terminal_open(void) tdesktop = _terminal_get(buf); if (tdesktop) goto have_desktop; } - + for (i = 0; terms[i]; i++) { tdesktop = efreet_util_desktop_file_id_find(terms[i]); @@ -355,7 +355,7 @@ have_desktop: } static char ** -browser_open(const char * const *argv, int argc) +browser_open(const char *const *argv, int argc) { const char *env = getenv("BROWSER"); if (env) return single_command_open(env, argv, argc); @@ -404,29 +404,30 @@ protocol_open(const char *str) return ret; } -static const struct type_mime { +static const struct type_mime +{ const char *type; const char *mime; } type_mimes[] = { - /* {"browser", "x-scheme-handler/http"}, */ - {"mail", "x-scheme-handler/mailto"}, - /* {"terminal", NULL}, */ - {"filemanager", "x-scheme-handler/file"}, - {"image", "image/jpeg"}, - {"video", "video/x-mpeg"}, - {"music", "audio/mp3"}, - {NULL, NULL} + /* {"browser", "x-scheme-handler/http"}, */ + {"mail", "x-scheme-handler/mailto"}, + /* {"terminal", NULL}, */ + {"filemanager", "x-scheme-handler/file"}, + {"image", "image/jpeg"}, + {"video", "video/x-mpeg"}, + {"music", "audio/mp3"}, + {NULL, NULL} }; static const char *type_choices[] = { - "browser", - "mail", - "terminal", - "filemanager", - "image", - "video", - "music", - NULL + "browser", + "mail", + "terminal", + "filemanager", + "image", + "video", + "music", + NULL }; static const Ecore_Getopt options = { @@ -454,12 +455,12 @@ main(int argc, char *argv[]) Eina_Bool quit_option = EINA_FALSE; char *type = NULL; Ecore_Getopt_Value values[] = { - ECORE_GETOPT_VALUE_STR(type), - ECORE_GETOPT_VALUE_BOOL(quit_option), - ECORE_GETOPT_VALUE_BOOL(quit_option), - ECORE_GETOPT_VALUE_BOOL(quit_option), - ECORE_GETOPT_VALUE_BOOL(quit_option), - ECORE_GETOPT_VALUE_NONE + ECORE_GETOPT_VALUE_STR(type), + ECORE_GETOPT_VALUE_BOOL(quit_option), + ECORE_GETOPT_VALUE_BOOL(quit_option), + ECORE_GETOPT_VALUE_BOOL(quit_option), + ECORE_GETOPT_VALUE_BOOL(quit_option), + ECORE_GETOPT_VALUE_NONE }; int args; char **cmds; @@ -486,7 +487,7 @@ main(int argc, char *argv[]) if (strcmp(type, "terminal") == 0) cmds = terminal_open(); else if (strcmp(type, "browser") == 0) - cmds = browser_open((const char * const *)argv + args, argc - args); + cmds = browser_open((const char *const *)argv + args, argc - args); else { const struct type_mime *itr; @@ -496,7 +497,7 @@ main(int argc, char *argv[]) if (strcmp(type, itr->type) == 0) { cmds = mime_open(itr->mime, - (const char * const *)argv + args, + (const char *const *)argv + args, argc - args); break; } @@ -516,7 +517,6 @@ main(int argc, char *argv[]) efreet_mime_shutdown(); efreet_shutdown(); - /* No EFL, plain boring sequential system() calls */ if (!cmds) return EXIT_FAILURE; @@ -541,3 +541,4 @@ main(int argc, char *argv[]) return ret; } } + diff --git a/src/bin/e_pan.c b/src/bin/e_pan.c index b6d8317c3..9ba5a3c48 100644 --- a/src/bin/e_pan.c +++ b/src/bin/e_pan.c @@ -278,3 +278,4 @@ _e_smart_init(void) _e_smart = evas_smart_class_new(&sc); } } + diff --git a/src/bin/e_place.c b/src/bin/e_place.c index 1e76863ac..e7878cc92 100644 --- a/src/bin/e_place.c +++ b/src/bin/e_place.c @@ -13,42 +13,42 @@ e_place_zone_region_smart_cleanup(E_Zone *zone) bl = e_container_border_list_first(desk->zone->container); while ((border = e_container_border_list_next(bl))) { - /* Build a list of windows on this desktop and not iconified. */ - if ((border->desk == desk) && (!border->iconic) && - (!border->lock_user_location)) - { - int area; - Eina_List *ll; - E_Border *bd; + /* Build a list of windows on this desktop and not iconified. */ + if ((border->desk == desk) && (!border->iconic) && + (!border->lock_user_location)) + { + int area; + Eina_List *ll; + E_Border *bd; - /* Ordering windows largest to smallest gives better results */ - area = border->w * border->h; - EINA_LIST_FOREACH(borders, ll, bd) - { - int testarea; + /* Ordering windows largest to smallest gives better results */ + area = border->w * border->h; + EINA_LIST_FOREACH(borders, ll, bd) + { + int testarea; - testarea = bd->w * bd->h; - /* Insert the border if larger than the current border */ - if (area >= testarea) - { - borders = eina_list_prepend_relative(borders, border, bd); - break; - } - } - /* Looped over all borders without placing, so place at end */ - if (!ll) borders = eina_list_append(borders, border); - } + testarea = bd->w * bd->h; + /* Insert the border if larger than the current border */ + if (area >= testarea) + { + borders = eina_list_prepend_relative(borders, border, bd); + break; + } + } + /* Looped over all borders without placing, so place at end */ + if (!ll) borders = eina_list_append(borders, border); + } } e_container_border_list_free(bl); /* Loop over the borders moving each one using the smart placement */ EINA_LIST_FREE(borders, border) { - int new_x, new_y; + int new_x, new_y; - e_place_zone_region_smart(zone, borders, border->x, border->y, - border->w, border->h, &new_x, &new_y); - e_border_move(border, new_x, new_y); + e_place_zone_region_smart(zone, borders, border->x, border->y, + border->w, border->h, &new_x, &new_y); + e_border_move(border, new_x, new_y); } } @@ -72,33 +72,33 @@ _e_place_coverage_border_add(E_Desk *desk, Eina_List *skiplist, int ar, int x, i bl = e_container_border_list_first(desk->zone->container); while ((bd = e_container_border_list_next(bl))) { - ok = 1; - x2 = (bd->x - desk->zone->x); y2 = (bd->y - desk->zone->y); w2 = bd->w; h2 = bd->h; - EINA_LIST_FOREACH(skiplist, ll, bd2) - { - if (bd2 == bd) - { - ok = 0; - break; - } - } - if ((ok) && + ok = 1; + x2 = (bd->x - desk->zone->x); y2 = (bd->y - desk->zone->y); w2 = bd->w; h2 = bd->h; + EINA_LIST_FOREACH(skiplist, ll, bd2) + { + if (bd2 == bd) + { + ok = 0; + break; + } + } + if ((ok) && E_INTERSECTS(x, y, w, h, x2, y2, w2, h2) && ((bd->sticky) || (bd->desk == desk)) && (!bd->iconic) && (bd->visible)) - { - x0 = x; - if (x < x2) x0 = x2; - x00 = (x + w); - if ((x2 + w2) < (x + w)) x00 = (x2 + w2); - yy0 = y; - if (y < y2) yy0 = y2; - y00 = (y + h); - if ((y2 + h2) < (y + h)) y00 = (y2 + h2); - iw = x00 - x0; - ih = y00 - yy0; - ar += (iw * ih); - } + { + x0 = x; + if (x < x2) x0 = x2; + x00 = (x + w); + if ((x2 + w2) < (x + w)) x00 = (x2 + w2); + yy0 = y; + if (y < y2) yy0 = y2; + y00 = (y + h); + if ((y2 + h2) < (y + h)) y00 = (y2 + h2); + iw = x00 - x0; + ih = y00 - yy0; + ar += (iw * ih); + } } e_container_border_list_free(bl); return ar; @@ -113,25 +113,25 @@ _e_place_coverage_shelf_add(E_Zone *zone, int ar, int x, int y, int w, int h) EINA_LIST_FOREACH(e_shelf_list(), l, es) { - if (es->zone != zone) continue; - x2 = es->x; y2 = es->y; w2 = es->w; h2 = es->h; - if (E_INTERSECTS(x, y, w, h, x2, y2, w2, h2)) + if (es->zone != zone) continue; + x2 = es->x; y2 = es->y; w2 = es->w; h2 = es->h; + if (E_INTERSECTS(x, y, w, h, x2, y2, w2, h2)) { int x0, x00, yy0, y00; int iw, ih; if (!es->cfg->overlap) return 0x7fffffff; - x0 = x; - if (x < x2) x0 = x2; - x00 = (x + w); - if ((x2 + w2) < (x + w)) x00 = (x2 + w2); - yy0 = y; - if (y < y2) yy0 = y2; - y00 = (y + h); - if ((y2 + h2) < (y + h)) y00 = (y2 + h2); - iw = x00 - x0; - ih = y00 - yy0; - ar += (iw * ih); + x0 = x; + if (x < x2) x0 = x2; + x00 = (x + w); + if ((x2 + w2) < (x + w)) x00 = (x2 + w2); + yy0 = y; + if (y < y2) yy0 = y2; + y00 = (y + h); + if ((y2 + h2) < (y + h)) y00 = (y2 + h2); + iw = x00 - x0; + ih = y00 - yy0; + ar += (iw * ih); } } return ar; @@ -140,13 +140,13 @@ _e_place_coverage_shelf_add(E_Zone *zone, int ar, int x, int y, int w, int h) EAPI int e_place_desk_region_smart(E_Desk *desk, Eina_List *skiplist, int x, int y, int w, int h, int *rx, int *ry) { - int a_w = 0, a_h = 0, a_alloc_w = 0, a_alloc_h = 0; - int *a_x = NULL, *a_y = NULL; - int zw, zh; - char *u_x = NULL, *u_y = NULL; - Eina_List *ll; - E_Border_List *bl; - E_Border *bd, *bd2; + int a_w = 0, a_h = 0, a_alloc_w = 0, a_alloc_h = 0; + int *a_x = NULL, *a_y = NULL; + int zw, zh; + char *u_x = NULL, *u_y = NULL; + Eina_List *ll; + E_Border_List *bl; + E_Border *bd, *bd2; *rx = x; *ry = y; @@ -157,8 +157,8 @@ e_place_desk_region_smart(E_Desk *desk, Eina_List *skiplist, int x, int y, int w if ((w <= 0) || (h <= 0)) { - printf("EEEK! trying to place 0x0 window!!!!\n"); - return 1; + printf("EEEK! trying to place 0x0 window!!!!\n"); + return 1; } /* FIXME: this NEEDS optimizing */ @@ -187,167 +187,167 @@ e_place_desk_region_smart(E_Desk *desk, Eina_List *skiplist, int x, int y, int w if (e_config->window_placement_policy == E_WINDOW_PLACEMENT_SMART) { - Eina_List *l; - E_Shelf *es; + Eina_List *l; + E_Shelf *es; - EINA_LIST_FOREACH(e_shelf_list(), l, es) - { - int bx, by, bw, bh; + EINA_LIST_FOREACH(e_shelf_list(), l, es) + { + int bx, by, bw, bh; - if (es->zone != desk->zone) continue; + if (es->zone != desk->zone) continue; - bx = es->x; - by = es->y; - bw = es->w; - bh = es->h; - if (!E_INTERSECTS(bx, by, bw, bh, 0, 0, zw, zh)) continue; + bx = es->x; + by = es->y; + bw = es->w; + bh = es->h; + if (!E_INTERSECTS(bx, by, bw, bh, 0, 0, zw, zh)) continue; - if (bx < 0) - { - bw += bx; - bx = 0; - } - if ((bx + bw) > zw) bw = zw - bx; - if (bx >= zw) continue; - if (by < 0) - { - bh += by; - by = 0; - } - if ((by + bh) > zh) bh = zh - by; - if (by >= zh) continue; - if (!u_x[bx]) - { - a_w++; - if (a_w > a_alloc_w) - { - a_alloc_w += 32; - E_REALLOC(a_x, int, a_alloc_w); - } - a_x[a_w - 1] = bx; - u_x[bx] = 1; - } - if (!u_x[bx + bw]) - { - a_w++; - if (a_w > a_alloc_w) - { - a_alloc_w += 32; - E_REALLOC(a_x, int, a_alloc_w); - } - a_x[a_w - 1] = bx + bw; - u_x[bx + bw] = 1; - } - if (!u_y[by]) - { - a_h++; - if (a_h > a_alloc_h) - { - a_alloc_h += 32; - E_REALLOC(a_y, int, a_alloc_h); - } - a_y[a_h - 1] = by; - u_y[by] = 1; - } - if (!u_y[by + bh]) - { - a_h++; - if (a_h > a_alloc_h) - { - a_alloc_h += 32; - E_REALLOC(a_y, int, a_alloc_h); - } - a_y[a_h - 1] = by + bh; - u_y[by + bh] = 1; - } - } + if (bx < 0) + { + bw += bx; + bx = 0; + } + if ((bx + bw) > zw) bw = zw - bx; + if (bx >= zw) continue; + if (by < 0) + { + bh += by; + by = 0; + } + if ((by + bh) > zh) bh = zh - by; + if (by >= zh) continue; + if (!u_x[bx]) + { + a_w++; + if (a_w > a_alloc_w) + { + a_alloc_w += 32; + E_REALLOC(a_x, int, a_alloc_w); + } + a_x[a_w - 1] = bx; + u_x[bx] = 1; + } + if (!u_x[bx + bw]) + { + a_w++; + if (a_w > a_alloc_w) + { + a_alloc_w += 32; + E_REALLOC(a_x, int, a_alloc_w); + } + a_x[a_w - 1] = bx + bw; + u_x[bx + bw] = 1; + } + if (!u_y[by]) + { + a_h++; + if (a_h > a_alloc_h) + { + a_alloc_h += 32; + E_REALLOC(a_y, int, a_alloc_h); + } + a_y[a_h - 1] = by; + u_y[by] = 1; + } + if (!u_y[by + bh]) + { + a_h++; + if (a_h > a_alloc_h) + { + a_alloc_h += 32; + E_REALLOC(a_y, int, a_alloc_h); + } + a_y[a_h - 1] = by + bh; + u_y[by + bh] = 1; + } + } } bl = e_container_border_list_first(desk->zone->container); while ((bd = e_container_border_list_next(bl))) { - int ok; - int bx, by, bw, bh; + int ok; + int bx, by, bw, bh; - ok = 1; - EINA_LIST_FOREACH(skiplist, ll, bd2) - { - if (bd2 == bd) - { - ok = 0; - break; - } - } - if (!ok) continue; + ok = 1; + EINA_LIST_FOREACH(skiplist, ll, bd2) + { + if (bd2 == bd) + { + ok = 0; + break; + } + } + if (!ok) continue; if (!((bd->sticky) || (bd->desk == desk))) continue; - bx = bd->x - desk->zone->x; - by = bd->y - desk->zone->y; - bw = bd->w; - bh = bd->h; + bx = bd->x - desk->zone->x; + by = bd->y - desk->zone->y; + bw = bd->w; + bh = bd->h; - if (E_INTERSECTS(bx, by, bw, bh, 0, 0, zw, zh)) - { - if (bx < 0) - { - bw += bx; - bx = 0; - } - if ((bx + bw) > zw) bw = zw - bx; - if (bx >= zw) continue; - if (by < 0) - { - bh += by; - by = 0; - } - if ((by + bh) > zh) bh = zh - by; - if (by >= zh) continue; - if (!u_x[bx]) - { - a_w++; - if (a_w > a_alloc_w) - { - a_alloc_w += 32; - E_REALLOC(a_x, int, a_alloc_w); - } - a_x[a_w - 1] = bx; - u_x[bx] = 1; - } - if (!u_x[bx + bw]) - { - a_w++; - if (a_w > a_alloc_w) - { - a_alloc_w += 32; - E_REALLOC(a_x, int, a_alloc_w); - } - a_x[a_w - 1] = bx + bw; - u_x[bx + bw] = 1; - } - if (!u_y[by]) - { - a_h++; - if (a_h > a_alloc_h) - { - a_alloc_h += 32; - E_REALLOC(a_y, int, a_alloc_h); - } - a_y[a_h - 1] = by; - u_y[by] = 1; - } - if (!u_y[by + bh]) - { - a_h++; - if (a_h > a_alloc_h) - { - a_alloc_h += 32; - E_REALLOC(a_y, int, a_alloc_h); - } - a_y[a_h - 1] = by + bh; - u_y[by + bh] = 1; - } - } + if (E_INTERSECTS(bx, by, bw, bh, 0, 0, zw, zh)) + { + if (bx < 0) + { + bw += bx; + bx = 0; + } + if ((bx + bw) > zw) bw = zw - bx; + if (bx >= zw) continue; + if (by < 0) + { + bh += by; + by = 0; + } + if ((by + bh) > zh) bh = zh - by; + if (by >= zh) continue; + if (!u_x[bx]) + { + a_w++; + if (a_w > a_alloc_w) + { + a_alloc_w += 32; + E_REALLOC(a_x, int, a_alloc_w); + } + a_x[a_w - 1] = bx; + u_x[bx] = 1; + } + if (!u_x[bx + bw]) + { + a_w++; + if (a_w > a_alloc_w) + { + a_alloc_w += 32; + E_REALLOC(a_x, int, a_alloc_w); + } + a_x[a_w - 1] = bx + bw; + u_x[bx + bw] = 1; + } + if (!u_y[by]) + { + a_h++; + if (a_h > a_alloc_h) + { + a_alloc_h += 32; + E_REALLOC(a_y, int, a_alloc_h); + } + a_y[a_h - 1] = by; + u_y[by] = 1; + } + if (!u_y[by + bh]) + { + a_h++; + if (a_h > a_alloc_h) + { + a_alloc_h += 32; + E_REALLOC(a_y, int, a_alloc_h); + } + a_y[a_h - 1] = by + bh; + u_y[by + bh] = 1; + } + } } qsort(a_x, a_w, sizeof(int), _e_place_cb_sort_cmp); qsort(a_y, a_h, sizeof(int), _e_place_cb_sort_cmp); @@ -356,94 +356,94 @@ e_place_desk_region_smart(E_Desk *desk, Eina_List *skiplist, int x, int y, int w free(u_y); { - int i, j; - int area = 0x7fffffff; + int i, j; + int area = 0x7fffffff; for (j = 0; j < a_h - 1; j++) - { - for (i = 0; i < a_w - 1; i++) - { - if ((a_x[i] <= (zw - w)) && - (a_y[j] <= (zh - h))) - { - int ar = 0; + { + for (i = 0; i < a_w - 1; i++) + { + if ((a_x[i] <= (zw - w)) && + (a_y[j] <= (zh - h))) + { + int ar = 0; - ar = _e_place_coverage_border_add(desk, skiplist, ar, - a_x[i], a_y[j], - w, h); - if (e_config->window_placement_policy == E_WINDOW_PLACEMENT_SMART) - ar = _e_place_coverage_shelf_add(desk->zone, ar, - a_x[i], a_y[j], - w, h); - if (ar < area) - { - area = ar; - *rx = a_x[i]; - *ry = a_y[j]; - if (ar == 0) goto done; - } - } - if ((a_x[i + 1] - w > 0) && (a_y[j] <= (zh - h))) - { - int ar = 0; + ar = _e_place_coverage_border_add(desk, skiplist, ar, + a_x[i], a_y[j], + w, h); + if (e_config->window_placement_policy == E_WINDOW_PLACEMENT_SMART) + ar = _e_place_coverage_shelf_add(desk->zone, ar, + a_x[i], a_y[j], + w, h); + if (ar < area) + { + area = ar; + *rx = a_x[i]; + *ry = a_y[j]; + if (ar == 0) goto done; + } + } + if ((a_x[i + 1] - w > 0) && (a_y[j] <= (zh - h))) + { + int ar = 0; - ar = _e_place_coverage_border_add(desk, skiplist, ar, - a_x[i + 1] - w, a_y[j], - w, h); - if (e_config->window_placement_policy == E_WINDOW_PLACEMENT_SMART) - ar = _e_place_coverage_shelf_add(desk->zone, ar, - a_x[i + 1] - w, a_y[j], - w, h); - if (ar < area) - { - area = ar; - *rx = a_x[i + 1] - w; - *ry = a_y[j]; - if (ar == 0) goto done; - } - } - if ((a_x[i + 1] - w > 0) && (a_y[j + 1] - h > 0)) - { - int ar = 0; + ar = _e_place_coverage_border_add(desk, skiplist, ar, + a_x[i + 1] - w, a_y[j], + w, h); + if (e_config->window_placement_policy == E_WINDOW_PLACEMENT_SMART) + ar = _e_place_coverage_shelf_add(desk->zone, ar, + a_x[i + 1] - w, a_y[j], + w, h); + if (ar < area) + { + area = ar; + *rx = a_x[i + 1] - w; + *ry = a_y[j]; + if (ar == 0) goto done; + } + } + if ((a_x[i + 1] - w > 0) && (a_y[j + 1] - h > 0)) + { + int ar = 0; - ar = _e_place_coverage_border_add(desk, skiplist, ar, - a_x[i + 1] - w, a_y[j + 1] - h, - w, h); - if (e_config->window_placement_policy == E_WINDOW_PLACEMENT_SMART) - ar = _e_place_coverage_shelf_add(desk->zone, ar, - a_x[i + 1] - w, a_y[j + 1] - h, - w, h); - if (ar < area) - { - area = ar; - *rx = a_x[i + 1] - w; - *ry = a_y[j + 1] - h; - if (ar == 0) goto done; - } - } - if ((a_x[i] <= (zw - w)) && (a_y[j + 1] - h > 0)) - { - int ar = 0; + ar = _e_place_coverage_border_add(desk, skiplist, ar, + a_x[i + 1] - w, a_y[j + 1] - h, + w, h); + if (e_config->window_placement_policy == E_WINDOW_PLACEMENT_SMART) + ar = _e_place_coverage_shelf_add(desk->zone, ar, + a_x[i + 1] - w, a_y[j + 1] - h, + w, h); + if (ar < area) + { + area = ar; + *rx = a_x[i + 1] - w; + *ry = a_y[j + 1] - h; + if (ar == 0) goto done; + } + } + if ((a_x[i] <= (zw - w)) && (a_y[j + 1] - h > 0)) + { + int ar = 0; - ar = _e_place_coverage_border_add(desk, skiplist, ar, - a_x[i], a_y[j + 1] - h, - w, h); - if (e_config->window_placement_policy == E_WINDOW_PLACEMENT_SMART) - ar = _e_place_coverage_shelf_add(desk->zone, ar, - a_x[i], a_y[j + 1] - h, - w, h); - if (ar < area) - { - area = ar; - *rx = a_x[i]; - *ry = a_y[j + 1] - h; - if (ar == 0) goto done; - } - } - } - } + ar = _e_place_coverage_border_add(desk, skiplist, ar, + a_x[i], a_y[j + 1] - h, + w, h); + if (e_config->window_placement_policy == E_WINDOW_PLACEMENT_SMART) + ar = _e_place_coverage_shelf_add(desk->zone, ar, + a_x[i], a_y[j + 1] - h, + w, h); + if (ar < area) + { + area = ar; + *rx = a_x[i]; + *ry = a_y[j + 1] - h; + if (ar == 0) goto done; + } + } + } + } } - done: +done: E_FREE(a_x); E_FREE(a_y); @@ -509,3 +509,4 @@ e_place_zone_manual(E_Zone *zone, int w, int h, int *rx, int *ry) return 1; } + diff --git a/src/bin/e_pointer.c b/src/bin/e_pointer.c index 5887e127f..e02a246ee 100644 --- a/src/bin/e_pointer.c +++ b/src/bin/e_pointer.c @@ -17,29 +17,29 @@ struct _E_Pointer_Stack static Eina_List *_e_pointers = NULL; static Eina_List *handlers = NULL; -static void _e_pointer_canvas_add(E_Pointer *p); -static void _e_pointer_canvas_del(E_Pointer *p); -static void _e_pointer_cb_move(void *data, - Evas *e __UNUSED__, - Evas_Object *obj __UNUSED__, - void *event_info); +static void _e_pointer_canvas_add(E_Pointer *p); +static void _e_pointer_canvas_del(E_Pointer *p); +static void _e_pointer_cb_move(void *data, + Evas *e __UNUSED__, + Evas_Object *obj __UNUSED__, + void *event_info); static void _e_pointer_free(E_Pointer *p); static void _e_pointer_stack_free(E_Pointer_Stack *elem); -static void _e_pointer_type_set(E_Pointer *p, +static void _e_pointer_type_set(E_Pointer *p, const char *type); static void _e_pointer_active_handle(E_Pointer *p); static Eina_Bool _e_pointer_cb_mouse_down(void *data, - int type, + int type, void *event); static Eina_Bool _e_pointer_cb_mouse_up(void *data, - int type, + int type, void *event); static Eina_Bool _e_pointer_cb_mouse_move(void *data, - int type, + int type, void *event); static Eina_Bool _e_pointer_cb_mouse_wheel(void *data, - int type, + int type, void *event); static Eina_Bool _e_pointer_cb_idle_timer_pre(void *data); static Eina_Bool _e_pointer_cb_idle_timer_wait(void *data); @@ -77,7 +77,7 @@ e_pointer_shutdown(void) EAPI E_Pointer * e_pointer_window_new(Ecore_X_Window win, - int filled) + int filled) { E_Pointer *p = NULL; @@ -151,8 +151,8 @@ e_pointer_hide(E_Pointer *p) } EAPI void -e_pointer_type_push(E_Pointer *p, - void *obj, +e_pointer_type_push(E_Pointer *p, + void *obj, const char *type) { E_Pointer_Stack *stack; @@ -174,8 +174,8 @@ e_pointer_type_push(E_Pointer *p, } EAPI void -e_pointer_type_pop(E_Pointer *p, - void *obj, +e_pointer_type_pop(E_Pointer *p, + void *obj, const char *type) { Eina_List *l; @@ -316,10 +316,10 @@ _e_pointer_canvas_del(E_Pointer *p) } static void -_e_pointer_cb_move(void *data, - Evas *e __UNUSED__, +_e_pointer_cb_move(void *data, + Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) + void *event_info __UNUSED__) { E_Pointer *p; Evas_Coord x, y; @@ -366,7 +366,7 @@ _e_pointer_stack_free(E_Pointer_Stack *elem) } static void -_e_pointer_type_set(E_Pointer *p, +_e_pointer_type_set(E_Pointer *p, const char *type) { if (!p) return; @@ -489,7 +489,7 @@ _e_pointer_active_handle(E_Pointer *p) static Eina_Bool _e_pointer_cb_mouse_down(void *data __UNUSED__, - int type __UNUSED__, + int type __UNUSED__, void *event __UNUSED__) { Eina_List *l; @@ -510,7 +510,7 @@ _e_pointer_cb_mouse_down(void *data __UNUSED__, static Eina_Bool _e_pointer_cb_mouse_up(void *data __UNUSED__, - int type __UNUSED__, + int type __UNUSED__, void *event __UNUSED__) { Eina_List *l; @@ -531,7 +531,7 @@ _e_pointer_cb_mouse_up(void *data __UNUSED__, static Eina_Bool _e_pointer_cb_mouse_move(void *data __UNUSED__, - int type __UNUSED__, + int type __UNUSED__, void *event __UNUSED__) { Eina_List *l; @@ -552,7 +552,7 @@ _e_pointer_cb_mouse_move(void *data __UNUSED__, static Eina_Bool _e_pointer_cb_mouse_wheel(void *data __UNUSED__, - int type __UNUSED__, + int type __UNUSED__, void *event __UNUSED__) { Eina_List *l; @@ -626,17 +626,17 @@ _e_pointer_cb_idle_poller(void *data) { /* it moved - so we are not idle yet - record position and wait * 4 secons more */ - p->x = x; - p->y = y; - if (p->idle) - { - if (p->pointer_object) - edje_object_signal_emit(p->pointer_object, - "e,state,mouse,active", "e"); - p->idle = 0; - } - /* use poller to check from now on */ - return ECORE_CALLBACK_RENEW; + p->x = x; + p->y = y; + if (p->idle) + { + if (p->pointer_object) + edje_object_signal_emit(p->pointer_object, + "e,state,mouse,active", "e"); + p->idle = 0; + } + /* use poller to check from now on */ + return ECORE_CALLBACK_RENEW; } /* we are idle - report it if not idle before */ if (!p->idle) @@ -647,3 +647,4 @@ _e_pointer_cb_idle_poller(void *data) } return ECORE_CALLBACK_RENEW; } + diff --git a/src/bin/e_prefix.c b/src/bin/e_prefix.c index c681ac7b1..583073a85 100644 --- a/src/bin/e_prefix.c +++ b/src/bin/e_prefix.c @@ -20,7 +20,7 @@ e_prefix_determine(char *argv0) if (!pfx) return 0; _prefix_path_data = eina_prefix_data_get(pfx); - _prefix_path_data_len= strlen(_prefix_path_data); + _prefix_path_data_len = strlen(_prefix_path_data); #ifdef E_LOGGING INF("================================="); INF("Enlightenment relocation handling"); @@ -135,3 +135,4 @@ e_prefix_data_snprintf(char *dst, size_t size, const char *fmt, ...) va_end(ap); return ret; } + diff --git a/src/bin/e_randr.c b/src/bin/e_randr.c index 3c78a0067..a8cf3a7ed 100644 --- a/src/bin/e_randr.c +++ b/src/bin/e_randr.c @@ -8,7 +8,7 @@ #define ECORE_X_RANDR_1_2 ((1 << 16) | 2) #define ECORE_X_RANDR_1_3 ((1 << 16) | 3) -#define Ecore_X_Randr_None 0 +#define Ecore_X_Randr_None 0 #define Ecore_X_Randr_Unset -1 /* @@ -89,7 +89,6 @@ _shutdown(void) _event_listeners_remove(); } - /** * @return EINA_TRUE if info could be refreshed, else EINA_FALSE */ @@ -148,7 +147,7 @@ static void _event_listeners_remove(void) { Ecore_Event_Handler *_event_handler = NULL; - EINA_LIST_FREE (_event_handlers, _event_handler) + EINA_LIST_FREE(_event_handlers, _event_handler) ecore_event_handler_del(_event_handler); if (e_randr_screen_info.randr_version >= ECORE_X_RANDR_1_2) @@ -156,3 +155,4 @@ _event_listeners_remove(void) _12_event_listeners_remove(); } } + diff --git a/src/bin/e_randr_11.c b/src/bin/e_randr_11.c index 2b8192e48..45770dbf8 100644 --- a/src/bin/e_randr_11.c +++ b/src/bin/e_randr_11.c @@ -30,7 +30,7 @@ _11_screen_info_new(void) ecore_x_randr_screen_primary_output_current_size_get(e_randr_screen_info.root, NULL, NULL, NULL, NULL, &(randr_info_11->csize_index)); randr_info_11->corientation = ecore_x_randr_screen_primary_output_orientation_get(e_randr_screen_info.root); randr_info_11->orientations = ecore_x_randr_screen_primary_output_orientations_get(e_randr_screen_info.root); - randr_info_11->rates = malloc(sizeof(Ecore_X_Randr_Refresh_Rate*) * nsizes); + randr_info_11->rates = malloc(sizeof(Ecore_X_Randr_Refresh_Rate *) * nsizes); randr_info_11->nrates = malloc(sizeof(int) * nsizes); for (i = 0; i < nsizes; i++) { @@ -84,5 +84,6 @@ _11_screen_info_refresh(void) _11_screen_info_free(e_randr_screen_info.rrvd_info.randr_info_11); e_randr_screen_info.rrvd_info.randr_info_11 = _11_screen_info_new(); - return (e_randr_screen_info.rrvd_info.randr_info_11 != NULL); + return e_randr_screen_info.rrvd_info.randr_info_11 != NULL; } + diff --git a/src/bin/e_randr_11_serialization.c b/src/bin/e_randr_11_serialization.c index 8a2a11195..9ca1d2f4e 100644 --- a/src/bin/e_randr_11_serialization.c +++ b/src/bin/e_randr_11_serialization.c @@ -24,7 +24,7 @@ _serialized_setup_11_new(void) { if (e_randr_screen_info.rrvd_info.randr_info_11->csize_index >= e_randr_screen_info.rrvd_info.randr_info_11->nsizes) goto _serialized_setup_11_new_failed_free_ss; size = e_randr_screen_info.rrvd_info.randr_info_11->sizes + e_randr_screen_info.rrvd_info.randr_info_11->csize_index; - if (!size) goto _serialized_setup_11_new_failed_free_ss;; + if (!size) goto _serialized_setup_11_new_failed_free_ss; ; rate = e_randr_screen_info.rrvd_info.randr_info_11->current_rate; ori = e_randr_screen_info.rrvd_info.randr_info_11->corientation; ss->size.width = size->width; @@ -73,8 +73,8 @@ _11_store_configuration(E_Randr_Configuration_Store_Modifier modifier __UNUSED__ e_config->randr_serialized_setup->serialized_setup_11 = _serialized_setup_11_new(); } - -EAPI void e_randr_11_store_configuration(E_Randr_Configuration_Store_Modifier modifier __UNUSED__) +EAPI void +e_randr_11_store_configuration(E_Randr_Configuration_Store_Modifier modifier __UNUSED__) { _11_store_configuration(modifier); e_config_save_queue(); @@ -99,11 +99,11 @@ _11_try_restore_configuration(void) Ecore_X_Randr_Screen_Size_MM *stored_size, *sizes = NULL; int i = 0, nsizes; -#define SIZE_EQUAL(size) \ - ((stored_size->width == (size).width) \ - && (stored_size->height == (size).height) \ - && (stored_size->width_mm == (size).width_mm) \ - && (stored_size->height_mm == (size).height_mm)) +#define SIZE_EQUAL(size) \ + ((stored_size->width == (size).width) \ + && (stored_size->height == (size).height) \ + && (stored_size->width_mm == (size).width_mm) \ + && (stored_size->height_mm == (size).height_mm)) if (!e_config->randr_serialized_setup->serialized_setup_11) return EINA_FALSE; stored_size = &e_config->randr_serialized_setup->serialized_setup_11->size; @@ -137,3 +137,4 @@ _11_try_restore_configuration(void) return EINA_FALSE; } + diff --git a/src/bin/e_randr_12_ask_dialog.c b/src/bin/e_randr_12_ask_dialog.c index 193434290..463c3d570 100644 --- a/src/bin/e_randr_12_ask_dialog.c +++ b/src/bin/e_randr_12_ask_dialog.c @@ -7,7 +7,8 @@ static void _e_randr_ask_memorize_monitor_cb(void *data, E_Dialog *dia); static E_Randr_Output_Info *_ask_output_info = NULL; -EINTERN void e_randr_12_ask_dialog_new(E_Randr_Output_Info *oi) +EINTERN void +e_randr_12_ask_dialog_new(E_Randr_Output_Info *oi) { E_Dialog *dia = NULL; @@ -19,10 +20,10 @@ EINTERN void e_randr_12_ask_dialog_new(E_Randr_Output_Info *oi) e_dialog_title_set(dia, _("Position of New Monitor")); e_dialog_icon_set(dia, "display", 64); e_dialog_text_set(dia, _("Where should the newly connected monitor be put?")); - e_dialog_button_add(dia, _("Left"), "stock-left", _e_randr_ask_cb, (void*)ECORE_X_RANDR_OUTPUT_POLICY_LEFT); - e_dialog_button_add(dia, _("Right"), "stock-right", _e_randr_ask_cb, (void*)ECORE_X_RANDR_OUTPUT_POLICY_RIGHT); - e_dialog_button_add(dia, _("Above"), "stock-top", _e_randr_ask_cb, (void*)ECORE_X_RANDR_OUTPUT_POLICY_ABOVE); - e_dialog_button_add(dia, _("Below"), "stock-bottom", _e_randr_ask_cb, (void*)ECORE_X_RANDR_OUTPUT_POLICY_BELOW); + e_dialog_button_add(dia, _("Left"), "stock-left", _e_randr_ask_cb, (void *)ECORE_X_RANDR_OUTPUT_POLICY_LEFT); + e_dialog_button_add(dia, _("Right"), "stock-right", _e_randr_ask_cb, (void *)ECORE_X_RANDR_OUTPUT_POLICY_RIGHT); + e_dialog_button_add(dia, _("Above"), "stock-top", _e_randr_ask_cb, (void *)ECORE_X_RANDR_OUTPUT_POLICY_ABOVE); + e_dialog_button_add(dia, _("Below"), "stock-bottom", _e_randr_ask_cb, (void *)ECORE_X_RANDR_OUTPUT_POLICY_BELOW); e_dialog_button_focus_num(dia, 1); e_win_centered_set(dia->win, 1); e_dialog_show(dia); @@ -48,7 +49,8 @@ _close_ret: e_object_del(E_OBJECT(dia)); } -static void e_randr_12_memorize_monitor_dialog_new(void) +static void +e_randr_12_memorize_monitor_dialog_new(void) { E_Dialog *dia = NULL; @@ -58,8 +60,8 @@ static void e_randr_12_memorize_monitor_dialog_new(void) e_dialog_title_set(dia, _("Memorize This Monitor?")); e_dialog_icon_set(dia, "display", 64); e_dialog_text_set(dia, _("Should the position of this monitor be memorized?")); - e_dialog_button_add(dia, _("Yes"), "stock-yes", _e_randr_ask_memorize_monitor_cb, (void*)EINA_TRUE); - e_dialog_button_add(dia, _("No"), "stock-no", _e_randr_ask_memorize_monitor_cb, (void*)EINA_FALSE); + e_dialog_button_add(dia, _("Yes"), "stock-yes", _e_randr_ask_memorize_monitor_cb, (void *)EINA_TRUE); + e_dialog_button_add(dia, _("No"), "stock-no", _e_randr_ask_memorize_monitor_cb, (void *)EINA_FALSE); e_dialog_button_focus_num(dia, 1); e_win_centered_set(dia->win, 1); e_dialog_show(dia); @@ -70,12 +72,13 @@ _e_randr_ask_memorize_monitor_cb(void *data, E_Dialog *dia) { Eina_Bool memorize = (Eina_Bool)(intptr_t)data; const E_Randr_Configuration_Store_Modifier modifier = ( - E_RANDR_CONFIGURATION_STORE_RESOLUTIONS - | E_RANDR_CONFIGURATION_STORE_ARRANGEMENT - | E_RANDR_CONFIGURATION_STORE_ORIENTATIONS); + E_RANDR_CONFIGURATION_STORE_RESOLUTIONS + | E_RANDR_CONFIGURATION_STORE_ARRANGEMENT + | E_RANDR_CONFIGURATION_STORE_ORIENTATIONS); if (memorize) e_randr_store_configuration(modifier); e_object_del(E_OBJECT(dia)); } + diff --git a/src/bin/e_randr_12_crtc.c b/src/bin/e_randr_12_crtc.c index fd7850ac9..65aac3717 100644 --- a/src/bin/e_randr_12_crtc.c +++ b/src/bin/e_randr_12_crtc.c @@ -223,7 +223,7 @@ _crtc_according_to_policy_get(E_Randr_Crtc_Info *but, Ecore_X_Randr_Output_Polic } // get an initial value for ret - ret = (E_Randr_Crtc_Info*)eina_list_last_data_get(possible_crtcs); + ret = (E_Randr_Crtc_Info *)eina_list_last_data_get(possible_crtcs); switch (policy) { @@ -239,7 +239,7 @@ _crtc_according_to_policy_get(E_Randr_Crtc_Info *but, Ecore_X_Randr_Output_Polic EINA_LIST_FOREACH(e_randr_screen_info.rrvd_info.randr_info_12->crtcs, iter, crtc_info) { if ((crtc_info->geometry.x + crtc_info->geometry.w) > - (ret->geometry.x + ret->geometry.w)) + (ret->geometry.x + ret->geometry.w)) ret = crtc_info; } break; @@ -248,7 +248,7 @@ _crtc_according_to_policy_get(E_Randr_Crtc_Info *but, Ecore_X_Randr_Output_Polic EINA_LIST_FOREACH(e_randr_screen_info.rrvd_info.randr_info_12->crtcs, iter, crtc_info) { if ((crtc_info->geometry.y + crtc_info->geometry.h) > - (ret->geometry.y + ret->geometry.h)) + (ret->geometry.y + ret->geometry.h)) ret = crtc_info; } break; @@ -272,3 +272,4 @@ _crtc_according_to_policy_get(E_Randr_Crtc_Info *but, Ecore_X_Randr_Output_Polic eina_list_free(possible_crtcs); return ret; } + diff --git a/src/bin/e_randr_12_output.c b/src/bin/e_randr_12_output.c index 52e673eb1..c1aa91cf8 100644 --- a/src/bin/e_randr_12_output.c +++ b/src/bin/e_randr_12_output.c @@ -1,8 +1,8 @@ #include "e_randr_private.h" #include "e_randr.h" -E_Randr_Monitor_Info *_monitor_info_new(E_Randr_Output_Info *output_info); -static int _modes_size_sort_cb(const void *d1, const void *d2); +E_Randr_Monitor_Info *_monitor_info_new(E_Randr_Output_Info *output_info); +static int _modes_size_sort_cb(const void *d1, const void *d2); void _monitor_modes_refs_set(E_Randr_Monitor_Info *mi, Ecore_X_Randr_Output o) @@ -127,13 +127,13 @@ _output_info_free(E_Randr_Output_Info *output_info) { EINA_SAFETY_ON_NULL_RETURN(output_info); - eina_list_free(output_info->wired_clones); - eina_list_free(output_info->possible_crtcs); - eina_list_free(output_info->compatibility_list); - eina_stringshare_del(output_info->name); - _monitor_info_free(output_info->monitor); - output_info->monitor = NULL; - free(output_info); + eina_list_free(output_info->wired_clones); + eina_list_free(output_info->possible_crtcs); + eina_list_free(output_info->compatibility_list); + eina_stringshare_del(output_info->name); + _monitor_info_free(output_info->monitor); + output_info->monitor = NULL; + free(output_info); } void @@ -177,8 +177,8 @@ _outputs_to_array(Eina_List *outputs_info) if (!outputs_info || !(ret = malloc(sizeof(Ecore_X_Randr_Output) * eina_list_count(outputs_info)))) return NULL; EINA_LIST_FOREACH(outputs_info, output_iter, output_info) - /* output_info == NULL should _not_ be possible! */ - ret[i++] = output_info ? output_info->xid : Ecore_X_Randr_None; + /* output_info == NULL should _not_ be possible! */ + ret[i++] = output_info ? output_info->xid : Ecore_X_Randr_None; return ret; } @@ -187,7 +187,8 @@ _outputs_to_array(Eina_List *outputs_info) * optionally limited by max_size_mode. If none are found, NULL is returned. */ Eina_List -*_outputs_common_modes_get(Eina_List *outputs, Ecore_X_Randr_Mode_Info *max_size_mode) +* +_outputs_common_modes_get(Eina_List *outputs, Ecore_X_Randr_Mode_Info *max_size_mode) { Eina_List *common_modes = NULL, *mode_iter, *output_iter, *mode_next, *output_next; E_Randr_Output_Info *output_info; @@ -237,3 +238,4 @@ _modes_size_sort_cb(const void *d1, const void *d2) return (mode1->width * mode1->height) - (mode2->width * mode2->height); } + diff --git a/src/bin/e_randr_12_serialization.c b/src/bin/e_randr_12_serialization.c index cd39d30d7..670bb3d44 100644 --- a/src/bin/e_randr_12_serialization.c +++ b/src/bin/e_randr_12_serialization.c @@ -5,10 +5,10 @@ static const char *_POLICIES_STRINGS[] = {"ABOVE", "RIGHT", "BELOW", "LEFT", "CLONE", "NONE"}; -static E_Randr_Serialized_Crtc *_serialized_crtc_new(E_Randr_Crtc_Info *crtc_info); -static inline int _sort_by_number_of_edids(const void *d1, const void *d2); -static inline Eina_List *_find_matching_outputs(Eina_List *sois); -static inline E_Randr_Crtc_Info *_find_matching_crtc(E_Randr_Serialized_Crtc *sc); +static E_Randr_Serialized_Crtc *_serialized_crtc_new(E_Randr_Crtc_Info *crtc_info); +static inline int _sort_by_number_of_edids(const void *d1, const void *d2); +static inline Eina_List *_find_matching_outputs(Eina_List *sois); +static inline E_Randr_Crtc_Info *_find_matching_crtc(E_Randr_Serialized_Crtc *sc); static inline Ecore_X_Randr_Mode_Info *_find_matching_mode_info(Ecore_X_Randr_Mode_Info *mode); /********************************************************************** @@ -87,8 +87,8 @@ _serialized_crtc_free(E_Randr_Serialized_Crtc *sc) EINA_SAFETY_ON_NULL_RETURN(sc); - EINA_LIST_FREE (sc->outputs, so) - _serialized_output_free(so); + EINA_LIST_FREE(sc->outputs, so) + _serialized_output_free(so); _mode_info_free(sc->mode_info); free(sc); } @@ -121,7 +121,8 @@ _eina_list_data_index_get(const Eina_List *list, const void *data) } Ecore_X_Randr_Mode_Info -*_mode_info_clone(const Ecore_X_Randr_Mode_Info *src) +* +_mode_info_clone(const Ecore_X_Randr_Mode_Info *src) { Ecore_X_Randr_Mode_Info *mi = NULL; @@ -142,7 +143,7 @@ Ecore_X_Randr_Mode_Info mi->vTotal = src->vTotal; if (src->nameLength > 0) { - mi->name = (char*)eina_stringshare_add(src->name); + mi->name = (char *)eina_stringshare_add(src->name); } mi->nameLength = src->nameLength; mi->modeFlags = src->modeFlags; @@ -151,7 +152,8 @@ Ecore_X_Randr_Mode_Info } E_Randr_Edid_Hash -*_monitor_edid_hash_clone(E_Randr_Monitor_Info *mi) +* +_monitor_edid_hash_clone(E_Randr_Monitor_Info *mi) { E_Randr_Edid_Hash *edid_hash; @@ -330,7 +332,7 @@ _outputs_policies_update(Eina_List *sops) { E_Randr_Serialized_Output_Policy *sop; - EINA_LIST_FREE (sops, sop) + EINA_LIST_FREE(sops, sop) { _serialized_output_policy_free(sop); } @@ -443,7 +445,7 @@ _12_try_restore_configuration(void) continue; } EINA_LIST_FOREACH(outputs_list, outputs_iter, output_info) - ecore_x_randr_output_mode_add(output_info->xid, mode); + ecore_x_randr_output_mode_add(output_info->xid, mode); INF("E_RANDR: \tSerialized mode was added to the server manually using the name %s.", mi->name); } @@ -452,7 +454,7 @@ _12_try_restore_configuration(void) DBG("E_RANDR: \tRestoring CRTC %d (index %d) in mode %s.", ci->xid, sc->index, (mode == Ecore_X_Randr_None) ? "(disabled)" : mi->name); DBG("E_RANDR: \t\tUsed outputs:"); EINA_LIST_FOREACH(outputs_list, outputs_iter, output_info) - DBG("\t\t%s", output_info->name); + DBG("\t\t%s", output_info->name); // DEBUG END ret &= ecore_x_randr_crtc_settings_set(e_randr_screen_info.root, ci->xid, outputs_array, eina_list_count(outputs_list), sc->pos.x, sc->pos.y, mode, sc->orientation); @@ -470,12 +472,12 @@ _12_serialized_setup_free(E_Randr_Serialized_Setup_12 *ss_12) if (!ss_12) return; - EINA_LIST_FREE (ss_12->crtcs, sc) + EINA_LIST_FREE(ss_12->crtcs, sc) { _serialized_crtc_free(sc); } - EINA_LIST_FREE (ss_12->edid_hashes, edid_hash) - free(edid_hash); + EINA_LIST_FREE(ss_12->edid_hashes, edid_hash) + free(edid_hash); free(ss_12); } @@ -483,7 +485,7 @@ _12_serialized_setup_free(E_Randr_Serialized_Setup_12 *ss_12) EINTERN void e_randr_12_serialized_setup_free(E_Randr_Serialized_Setup_12 *ss_12) { - _12_serialized_setup_free(ss_12); + _12_serialized_setup_free(ss_12); } void @@ -491,7 +493,7 @@ _12_store_configuration(E_Randr_Configuration_Store_Modifier modifier) { if (modifier & (E_RANDR_CONFIGURATION_STORE_RESOLUTIONS | E_RANDR_CONFIGURATION_STORE_ARRANGEMENT | E_RANDR_CONFIGURATION_STORE_ORIENTATIONS)) { - e_config->randr_serialized_setup->serialized_setups_12 = _12_serialized_setup_update(e_config->randr_serialized_setup->serialized_setups_12); + e_config->randr_serialized_setup->serialized_setups_12 = _12_serialized_setup_update(e_config->randr_serialized_setup->serialized_setups_12); } if (modifier & E_RANDR_CONFIGURATION_STORE_POLICIES) @@ -536,7 +538,6 @@ _find_matching_outputs(Eina_List *sois) INF("E_RANDR: \t\tComparing to output \"%s\"", oi->name); if (!strncmp(so->name, oi->name, oi->name_length)) { - list = eina_list_append(list, oi); break; } @@ -565,18 +566,18 @@ _find_matching_mode_info(Ecore_X_Randr_Mode_Info *mode) EINA_LIST_FOREACH(e_randr_screen_info.rrvd_info.randr_info_12->modes, iter, mi) { #define EQL(arg) (mi->arg == mode->arg) - if (EQL(width) && - EQL(height) && - EQL(dotClock) && - EQL(hSyncStart) && - EQL(hSyncEnd) && - EQL(hTotal) && - EQL(hSkew) && - EQL(vSyncStart) && - EQL(vSyncEnd) && - EQL(vTotal) && - EQL(modeFlags)) - return mi; + if (EQL(width) && + EQL(height) && + EQL(dotClock) && + EQL(hSyncStart) && + EQL(hSyncEnd) && + EQL(hTotal) && + EQL(hSkew) && + EQL(vSyncStart) && + EQL(vSyncEnd) && + EQL(vTotal) && + EQL(modeFlags)) + return mi; #undef EQL } return NULL; @@ -585,8 +586,8 @@ _find_matching_mode_info(Ecore_X_Randr_Mode_Info *mode) static int _sort_by_number_of_edids(const void *d1, const void *d2) { - const E_Randr_Serialized_Setup_12 *ss1 = (const E_Randr_Serialized_Setup_12*)d1; - const E_Randr_Serialized_Setup_12 *ss2 = (const E_Randr_Serialized_Setup_12*)d2; + const E_Randr_Serialized_Setup_12 *ss1 = (const E_Randr_Serialized_Setup_12 *)d1; + const E_Randr_Serialized_Setup_12 *ss2 = (const E_Randr_Serialized_Setup_12 *)d2; EINA_SAFETY_ON_NULL_RETURN_VAL(ss1, 1); EINA_SAFETY_ON_NULL_RETURN_VAL(ss2, -1); @@ -596,3 +597,4 @@ _sort_by_number_of_edids(const void *d1, const void *d2) else return -1; } + diff --git a/src/bin/e_randr_serialization.c b/src/bin/e_randr_serialization.c index 19a94fe46..c50b840f5 100644 --- a/src/bin/e_randr_serialization.c +++ b/src/bin/e_randr_serialization.c @@ -1,9 +1,9 @@ #include "e_randr_private.h" #include "e_randr.h" -#define ECORE_X_RANDR_1_1 ((1 << 16) | 1) -#define ECORE_X_RANDR_1_2 ((1 << 16) | 2) -#define ECORE_X_RANDR_1_3 ((1 << 16) | 3) +#define ECORE_X_RANDR_1_1 ((1 << 16) | 1) +#define ECORE_X_RANDR_1_2 ((1 << 16) | 2) +#define ECORE_X_RANDR_1_3 ((1 << 16) | 3) /********************************************************************** * @@ -19,11 +19,11 @@ e_randr_store_configuration(E_Randr_Configuration_Store_Modifier modifier) e_config->randr_serialized_setup = e_randr_serialized_setup_new(); fprintf(stderr, "E_RANDR: Configuration shall be stored using the following modifier:%s\n%s%s%s%s", - ((!modifier) ? "NONE" : ""), - ((modifier & E_RANDR_CONFIGURATION_STORE_POLICIES) ? "\tPOLICIES\n" : ""), - ((modifier & E_RANDR_CONFIGURATION_STORE_RESOLUTIONS) ? "\tRESOLUTIONS\n" : ""), - ((modifier & E_RANDR_CONFIGURATION_STORE_ARRANGEMENT) ? "\tARRANGEMENTS\n" : ""), - ((modifier & E_RANDR_CONFIGURATION_STORE_ORIENTATIONS) ? "\tORIENTATIONS\n" : "")); + ((!modifier) ? "NONE" : ""), + ((modifier & E_RANDR_CONFIGURATION_STORE_POLICIES) ? "\tPOLICIES\n" : ""), + ((modifier & E_RANDR_CONFIGURATION_STORE_RESOLUTIONS) ? "\tRESOLUTIONS\n" : ""), + ((modifier & E_RANDR_CONFIGURATION_STORE_ARRANGEMENT) ? "\tARRANGEMENTS\n" : ""), + ((modifier & E_RANDR_CONFIGURATION_STORE_ORIENTATIONS) ? "\tORIENTATIONS\n" : "")); if (e_randr_screen_info.randr_version == ECORE_X_RANDR_1_1) { @@ -36,7 +36,7 @@ e_randr_store_configuration(E_Randr_Configuration_Store_Modifier modifier) e_config_save_queue(); } -EAPI Eina_Bool +EAPI Eina_Bool e_randr_try_restore_configuration(void) { EINA_SAFETY_ON_NULL_RETURN_VAL(e_config, EINA_FALSE); @@ -54,10 +54,10 @@ e_randr_try_restore_configuration(void) EINTERN E_Randr_Serialized_Setup * e_randr_serialized_setup_new(void) { - return E_NEW(E_Randr_Serialized_Setup, 1); + return E_NEW(E_Randr_Serialized_Setup, 1); } -EINTERN void +EINTERN void e_randr_serialized_setup_free(E_Randr_Serialized_Setup *ss) { E_Randr_Serialized_Setup_12 *serialized_setup_12 = NULL; @@ -79,3 +79,4 @@ e_randr_serialized_setup_free(E_Randr_Serialized_Setup *ss) } free(ss); } + diff --git a/src/bin/e_remember.c b/src/bin/e_remember.c index 61f89dea0..0e399a3ab 100644 --- a/src/bin/e_remember.c +++ b/src/bin/e_remember.c @@ -603,7 +603,7 @@ _e_remember_cb_hook_eval_post_new_border(void *data __UNUSED__, void *border) if (!strncmp(bd->client.icccm.class, "e_fwin", 6)) { if (!(e_config->remember_internal_windows & E_REMEMBER_INTERNAL_FM_WINS) && - (!e_config->remember_internal_fm_windows)) + (!e_config->remember_internal_fm_windows)) return; } else @@ -820,15 +820,15 @@ _e_remember_cb_hook_pre_post_fetch(void *data __UNUSED__, void *border) // if (bd->zone->h != rem->prop.res_y) // bd->y = (rem->prop.pos_y * bd->zone->h) / rem->prop.res_y; if ( - /* upper left */ - (!E_INSIDE(bd->x, bd->y, 0, 0, bd->zone->w, bd->zone->h)) && - /* upper right */ - (!E_INSIDE(bd->x + bd->w, bd->y, 0, 0, bd->zone->w, bd->zone->h)) && - /* lower left */ - (!E_INSIDE(bd->x, bd->y + bd->h, 0, 0, bd->zone->w, bd->zone->h)) && - /* lower right */ - (!E_INSIDE(bd->x + bd->w, bd->y + bd->h, 0, 0, bd->zone->w, bd->zone->h)) - ) + /* upper left */ + (!E_INSIDE(bd->x, bd->y, 0, 0, bd->zone->w, bd->zone->h)) && + /* upper right */ + (!E_INSIDE(bd->x + bd->w, bd->y, 0, 0, bd->zone->w, bd->zone->h)) && + /* lower left */ + (!E_INSIDE(bd->x, bd->y + bd->h, 0, 0, bd->zone->w, bd->zone->h)) && + /* lower right */ + (!E_INSIDE(bd->x + bd->w, bd->y + bd->h, 0, 0, bd->zone->w, bd->zone->h)) + ) { e_border_center_pos_get(bd, &bd->x, &bd->y); rem->prop.pos_x = bd->x, rem->prop.pos_y = bd->y; diff --git a/src/bin/e_scale.c b/src/bin/e_scale.c index 85d807dc8..87a2c3b48 100644 --- a/src/bin/e_scale.c +++ b/src/bin/e_scale.c @@ -23,16 +23,18 @@ e_scale_update(void) if (e_config->scale.use_dpi) { - dpi = ecore_x_dpi_get(); - e_scale = (double)dpi / (double)e_config->scale.base_dpi; - if (e_scale > e_config->scale.max) e_scale = e_config->scale.max; - else if (e_scale < e_config->scale.min) e_scale = e_config->scale.min; + dpi = ecore_x_dpi_get(); + e_scale = (double)dpi / (double)e_config->scale.base_dpi; + if (e_scale > e_config->scale.max) e_scale = e_config->scale.max; + else if (e_scale < e_config->scale.min) + e_scale = e_config->scale.min; } else if (e_config->scale.use_custom) { - e_scale = e_config->scale.factor; - if (e_scale > e_config->scale.max) e_scale = e_config->scale.max; - else if (e_scale < e_config->scale.min) e_scale = e_config->scale.min; + e_scale = e_config->scale.factor; + if (e_scale > e_config->scale.max) e_scale = e_config->scale.max; + else if (e_scale < e_config->scale.min) + e_scale = e_config->scale.min; } edje_scale_set(e_scale); @@ -40,3 +42,4 @@ e_scale_update(void) e_util_env_set("E_SCALE", buf); e_hints_scale_update(); } + diff --git a/src/bin/e_screensaver.c b/src/bin/e_screensaver.c index d387e4618..fa85fb46f 100644 --- a/src/bin/e_screensaver.c +++ b/src/bin/e_screensaver.c @@ -30,12 +30,12 @@ EAPI int e_screensaver_timeout_get(Eina_Bool use_idle) { int timeout = 0, count = (1 + _e_screensaver_ask_presentation_count); - + if ((e_config->screensaver_enable) && (!e_config->mode.presentation) && ((e_config->screen_actions_fullscreen_windows_ignore) || ((!e_config->screen_actions_fullscreen_windows_ignore) && (!e_util_fullscreen_any())))) timeout = e_config->screensaver_timeout * count; - + if ((use_idle) && (!e_config->mode.presentation) && ((e_config->screen_actions_fullscreen_windows_ignore) || ((!e_config->screen_actions_fullscreen_windows_ignore) && (!e_util_fullscreen_any())))) @@ -61,7 +61,7 @@ e_screensaver_update(void) Eina_Bool changed = EINA_FALSE; timeout = e_screensaver_timeout_get(EINA_TRUE); - + interval = e_config->screensaver_interval; blanking = e_config->screensaver_blanking; expose = e_config->screensaver_expose; @@ -183,20 +183,20 @@ _e_screensaver_ask_presentation_mode(void) e_dialog_title_set(dia, _("Activate Presentation Mode?")); e_dialog_icon_set(dia, "dialog-ask", 64); e_dialog_text_set(dia, - _("You disabled the screensaver too fast.

" - "Would you like to enable presentation mode and " - "temporarily disable screen saver, lock and power saving?")); + _("You disabled the screensaver too fast.

" + "Would you like to enable presentation mode and " + "temporarily disable screen saver, lock and power saving?")); e_object_del_attach_func_set(E_OBJECT(dia), - _e_screensaver_ask_presentation_del); + _e_screensaver_ask_presentation_del); e_dialog_button_add(dia, _("Yes"), NULL, - _e_screensaver_ask_presentation_yes, NULL); + _e_screensaver_ask_presentation_yes, NULL); e_dialog_button_add(dia, _("No"), NULL, - _e_screensaver_ask_presentation_no, NULL); + _e_screensaver_ask_presentation_no, NULL); e_dialog_button_add(dia, _("No, but increase timeout"), NULL, - _e_screensaver_ask_presentation_no_increase, NULL); + _e_screensaver_ask_presentation_no_increase, NULL); e_dialog_button_add(dia, _("No, and stop asking"), NULL, - _e_screensaver_ask_presentation_no_forever, NULL); + _e_screensaver_ask_presentation_no_forever, NULL); e_dialog_button_focus_num(dia, 0); e_widget_list_homogeneous_set(dia->box_object, 0); @@ -204,7 +204,7 @@ _e_screensaver_ask_presentation_mode(void) e_dialog_show(dia); evas_object_event_callback_add(dia->bg_object, EVAS_CALLBACK_KEY_DOWN, - _e_screensaver_ask_presentation_key_down, dia); + _e_screensaver_ask_presentation_key_down, dia); _e_screensaver_ask_presentation_dia = dia; } @@ -217,7 +217,7 @@ _e_screensaver_suspend_cb(void *data __UNUSED__) { if ((e_config->screensaver_suspend_on_ac) || (e_powersave_mode_get() > E_POWERSAVE_MODE_LOW)) - e_sys_action_do(E_SYS_SUSPEND, NULL); + e_sys_action_do(E_SYS_SUSPEND, NULL); } return EINA_FALSE; } @@ -228,10 +228,10 @@ _e_screensaver_handler_powersave_cb(void *data __UNUSED__, int type __UNUSED__, if ((e_config->screensaver_suspend) && (_e_screensaver_on)) { if (_e_screensaver_suspend_timer) - ecore_timer_del(_e_screensaver_suspend_timer); + ecore_timer_del(_e_screensaver_suspend_timer); _e_screensaver_suspend_timer = - ecore_timer_add(e_config->screensaver_suspend_delay, - _e_screensaver_suspend_cb, NULL); + ecore_timer_add(e_config->screensaver_suspend_delay, + _e_screensaver_suspend_cb, NULL); } return ECORE_CALLBACK_PASS_ON; } @@ -249,8 +249,8 @@ _e_screensaver_handler_screensaver_on_cb(void *data __UNUSED__, int type __UNUSE } if (e_config->screensaver_suspend) _e_screensaver_suspend_timer = - ecore_timer_add(e_config->screensaver_suspend_delay, - _e_screensaver_suspend_cb, NULL); + ecore_timer_add(e_config->screensaver_suspend_delay, + _e_screensaver_suspend_cb, NULL); last_start = ecore_loop_time_get(); _e_screensaver_ask_presentation_count = 0; return ECORE_CALLBACK_PASS_ON; @@ -261,7 +261,7 @@ _e_screensaver_handler_screensaver_off_cb(void *data __UNUSED__, int type __UNUS { // e_screensaver_force_update(); // e_dpms_force_update(); - + _e_screensaver_on = EINA_FALSE; if (_e_screensaver_suspend_timer) { @@ -270,12 +270,12 @@ _e_screensaver_handler_screensaver_off_cb(void *data __UNUSED__, int type __UNUS } if ((last_start > 0.0) && (e_config->screensaver_ask_presentation)) { - double current = ecore_loop_time_get(); - - if ((last_start + e_config->screensaver_ask_presentation_timeout) + double current = ecore_loop_time_get(); + + if ((last_start + e_config->screensaver_ask_presentation_timeout) >= current) - _e_screensaver_ask_presentation_mode(); - last_start = 0.0; + _e_screensaver_ask_presentation_mode(); + last_start = 0.0; } else if (_e_screensaver_ask_presentation_count) _e_screensaver_ask_presentation_count = 0; @@ -304,9 +304,9 @@ _e_screensaver_handler_screensaver_notify_cb(void *data __UNUSED__, int type __U saver_on = EINA_TRUE; if (e_config->backlight.idle_dim) { - double t = e_config->screensaver_timeout - + double t = e_config->screensaver_timeout - e_config->backlight.timer; - + if (t < 1.0) t = 1.0; if (idle_timer) { @@ -315,7 +315,7 @@ _e_screensaver_handler_screensaver_notify_cb(void *data __UNUSED__, int type __U } if (e_config->screensaver_enable) idle_timer = ecore_timer_add - (t, _e_screensaver_idle_timer_cb, NULL); + (t, _e_screensaver_idle_timer_cb, NULL); if (e_backlight_mode_get(NULL) != E_BACKLIGHT_MODE_DIM) { e_backlight_mode_set(NULL, E_BACKLIGHT_MODE_DIM); @@ -390,34 +390,34 @@ e_screensaver_init(void) ecore_x_screensaver_custom_blanking_enable(); _e_screensaver_handler_on = ecore_event_handler_add - (E_EVENT_SCREENSAVER_ON, _e_screensaver_handler_screensaver_on_cb, NULL); + (E_EVENT_SCREENSAVER_ON, _e_screensaver_handler_screensaver_on_cb, NULL); _e_screensaver_handler_off = ecore_event_handler_add - (E_EVENT_SCREENSAVER_OFF, _e_screensaver_handler_screensaver_off_cb, NULL); - + (E_EVENT_SCREENSAVER_OFF, _e_screensaver_handler_screensaver_off_cb, NULL); + _e_screensaver_handler_screensaver_notify = ecore_event_handler_add - (ECORE_X_EVENT_SCREENSAVER_NOTIFY, _e_screensaver_handler_screensaver_notify_cb, NULL); - + (ECORE_X_EVENT_SCREENSAVER_NOTIFY, _e_screensaver_handler_screensaver_notify_cb, NULL); + _e_screensaver_handler_config_mode = ecore_event_handler_add - (E_EVENT_CONFIG_MODE_CHANGED, _e_screensaver_handler_config_mode_cb, NULL); - + (E_EVENT_CONFIG_MODE_CHANGED, _e_screensaver_handler_config_mode_cb, NULL); + _e_screensaver_handler_border_fullscreen = ecore_event_handler_add - (E_EVENT_BORDER_FULLSCREEN, _e_screensaver_handler_border_fullscreen_check_cb, NULL); + (E_EVENT_BORDER_FULLSCREEN, _e_screensaver_handler_border_fullscreen_check_cb, NULL); _e_screensaver_handler_border_unfullscreen = ecore_event_handler_add - (E_EVENT_BORDER_UNFULLSCREEN, _e_screensaver_handler_border_fullscreen_check_cb, NULL); + (E_EVENT_BORDER_UNFULLSCREEN, _e_screensaver_handler_border_fullscreen_check_cb, NULL); _e_screensaver_handler_border_remove = ecore_event_handler_add - (E_EVENT_BORDER_REMOVE, _e_screensaver_handler_border_fullscreen_check_cb, NULL); + (E_EVENT_BORDER_REMOVE, _e_screensaver_handler_border_fullscreen_check_cb, NULL); _e_screensaver_handler_border_iconify = ecore_event_handler_add - (E_EVENT_BORDER_ICONIFY, _e_screensaver_handler_border_fullscreen_check_cb, NULL); + (E_EVENT_BORDER_ICONIFY, _e_screensaver_handler_border_fullscreen_check_cb, NULL); _e_screensaver_handler_border_uniconify = ecore_event_handler_add - (E_EVENT_BORDER_UNICONIFY, _e_screensaver_handler_border_fullscreen_check_cb, NULL); + (E_EVENT_BORDER_UNICONIFY, _e_screensaver_handler_border_fullscreen_check_cb, NULL); _e_screensaver_handler_border_desk_set = ecore_event_handler_add - (E_EVENT_BORDER_DESK_SET, _e_screensaver_handler_border_desk_set_cb, NULL); + (E_EVENT_BORDER_DESK_SET, _e_screensaver_handler_border_desk_set_cb, NULL); _e_screensaver_handler_desk_show = ecore_event_handler_add - (E_EVENT_DESK_SHOW, _e_screensaver_handler_desk_show_cb, NULL); + (E_EVENT_DESK_SHOW, _e_screensaver_handler_desk_show_cb, NULL); _e_screensaver_handler_powersave = ecore_event_handler_add - (E_EVENT_POWERSAVE_UPDATE, _e_screensaver_handler_powersave_cb, NULL); - + (E_EVENT_POWERSAVE_UPDATE, _e_screensaver_handler_powersave_cb, NULL); + _e_screensaver_timeout = ecore_x_screensaver_timeout_get(); // _e_screensaver_interval = ecore_x_screensaver_interval_get(); _e_screensaver_blanking = ecore_x_screensaver_blank_get(); @@ -442,13 +442,13 @@ e_screensaver_shutdown(void) ecore_event_handler_del(_e_screensaver_handler_off); _e_screensaver_handler_off = NULL; } - + if (_e_screensaver_suspend_timer) { ecore_timer_del(_e_screensaver_suspend_timer); _e_screensaver_suspend_timer = NULL; } - + ecore_x_screensaver_custom_blanking_disable(); if (_e_screensaver_handler_powersave) @@ -513,3 +513,4 @@ e_screensaver_shutdown(void) return 1; } + diff --git a/src/bin/e_scrollframe.c b/src/bin/e_scrollframe.c index 786589486..976ab4ba9 100644 --- a/src/bin/e_scrollframe.c +++ b/src/bin/e_scrollframe.c @@ -62,7 +62,7 @@ struct _E_Smart_Data unsigned char vbar_visible : 1; unsigned char extern_pan : 1; unsigned char one_dir_at_a_time : 1; - Eina_Bool key_nav : 1; + Eina_Bool key_nav : 1; }; /* local subsystem functions */ @@ -276,7 +276,7 @@ e_scrollframe_child_region_show(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Ev /* Abort if the request region is already shown */ if ((px <= x) && (py <= y) && (x + w <= px + vw) && (y + h <= py + vh)) - return; + return; nx = px; if (x < px) nx = x; @@ -394,15 +394,15 @@ e_scrollframe_key_navigation_set(Evas_Object *obj, Eina_Bool enabled) { API_ENTRY return; if (enabled == sd->key_nav) - return; + return; sd->key_nav = enabled; if (sd->key_nav) - evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN, - _e_smart_event_key_down, sd); + evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN, + _e_smart_event_key_down, sd); else - evas_object_event_callback_del_full(obj, EVAS_CALLBACK_KEY_DOWN, - _e_smart_event_key_down, sd); + evas_object_event_callback_del_full(obj, EVAS_CALLBACK_KEY_DOWN, + _e_smart_event_key_down, sd); } /* local subsystem functions */ @@ -1157,3 +1157,4 @@ _e_smart_init(void) _e_smart = evas_smart_class_new(&sc); } } + diff --git a/src/bin/e_sha1.c b/src/bin/e_sha1.c index c45ec4472..1b52ebf90 100644 --- a/src/bin/e_sha1.c +++ b/src/bin/e_sha1.c @@ -24,12 +24,12 @@ e_sha1_sum(unsigned char *data, int size, unsigned char *dst) unsigned char buf[64], *d; int idx, left, i; const unsigned int magic[4] = - { - 0x5a827999, - 0x6ed9eba1, - 0x8f1bbcdc, - 0xca62c1d6 - }; + { + 0x5a827999, + 0x6ed9eba1, + 0x8f1bbcdc, + 0xca62c1d6 + }; idx = 0; digest[0] = 0x67452301; @@ -41,62 +41,62 @@ e_sha1_sum(unsigned char *data, int size, unsigned char *dst) memset(buf, 0, sizeof(buf)); for (left = size, d = data; left > 0; left--, d++) { - if ((idx == 0) && (left < 64)) - { - memset(buf, 0, 60); - buf[60] = (size >> 24) & 0xff; - buf[61] = (size >> 16) & 0xff; - buf[62] = (size >> 8) & 0xff; - buf[63] = (size ) & 0xff; - } - buf[idx] = *d; - idx++; - if ((idx == 64) || (left == 1)) - { - if ((left == 1) && (idx < 64)) buf[idx] = 0x80; - for (i = 0; i < 16; i++) - { - word[i] = (unsigned int)buf[(i * 4) ] << 24; - word[i] |= (unsigned int)buf[(i * 4) + 1] << 16; - word[i] |= (unsigned int)buf[(i * 4) + 2] << 8; - word[i] |= (unsigned int)buf[(i * 4) + 3]; - } - for (i = 16; i < 80; i++) - word[i] = SHSH(1, - word[i - 3 ] ^ word[i - 8 ] ^ - word[i - 14] ^ word[i - 16]); - wa = digest[0]; - wb = digest[1]; - wc = digest[2]; - wd = digest[3]; - we = digest[4]; + if ((idx == 0) && (left < 64)) + { + memset(buf, 0, 60); + buf[60] = (size >> 24) & 0xff; + buf[61] = (size >> 16) & 0xff; + buf[62] = (size >> 8) & 0xff; + buf[63] = (size) & 0xff; + } + buf[idx] = *d; + idx++; + if ((idx == 64) || (left == 1)) + { + if ((left == 1) && (idx < 64)) buf[idx] = 0x80; + for (i = 0; i < 16; i++) + { + word[i] = (unsigned int)buf[(i * 4) ] << 24; + word[i] |= (unsigned int)buf[(i * 4) + 1] << 16; + word[i] |= (unsigned int)buf[(i * 4) + 2] << 8; + word[i] |= (unsigned int)buf[(i * 4) + 3]; + } + for (i = 16; i < 80; i++) + word[i] = SHSH(1, + word[i - 3 ] ^ word[i - 8 ] ^ + word[i - 14] ^ word[i - 16]); + wa = digest[0]; + wb = digest[1]; + wc = digest[2]; + wd = digest[3]; + we = digest[4]; for (i = 0; i < 80; i++) - { - if (i < 20) - t = SHSH(5, wa) + ((wb & wc) | ((~wb) & wd)) + - we + word[i] + magic[0]; - else if (i < 40) - t = SHSH(5, wa) + (wb ^ wc ^ wd) + - we + word[i] + magic[1]; - else if (i < 60) - t = SHSH(5, wa) + ((wb & wc) | (wb & wd) | (wc & wd)) + - we + word[i] + magic[2]; - else if (i < 80) - t = SHSH(5, wa) + (wb ^ wc ^ wd) + - we + word[i] + magic[3]; - we = wd; - wd = wc; - wc = SHSH(30, wb); - wb = wa; - wa = t; - } - digest[0] += wa; - digest[1] += wb; - digest[2] += wc; - digest[3] += wd; - digest[4] += we; - idx = 0; - } + { + if (i < 20) + t = SHSH(5, wa) + ((wb & wc) | ((~wb) & wd)) + + we + word[i] + magic[0]; + else if (i < 40) + t = SHSH(5, wa) + (wb ^ wc ^ wd) + + we + word[i] + magic[1]; + else if (i < 60) + t = SHSH(5, wa) + ((wb & wc) | (wb & wd) | (wc & wd)) + + we + word[i] + magic[2]; + else if (i < 80) + t = SHSH(5, wa) + (wb ^ wc ^ wd) + + we + word[i] + magic[3]; + we = wd; + wd = wc; + wc = SHSH(30, wb); + wb = wa; + wa = t; + } + digest[0] += wa; + digest[1] += wb; + digest[2] += wc; + digest[3] += wd; + digest[4] += we; + idx = 0; + } } t = htonl(digest[0]); digest[0] = t; diff --git a/src/bin/e_shelf.c b/src/bin/e_shelf.c index 1cf508013..311f07bba 100644 --- a/src/bin/e_shelf.c +++ b/src/bin/e_shelf.c @@ -33,11 +33,11 @@ static const char *_e_shelf_orient_icon_name_get(E_Shelf *s); static void _e_shelf_bindings_add(E_Shelf *es); static void _e_shelf_bindings_del(E_Shelf *es); static Eina_Bool _e_shelf_on_current_desk(E_Shelf *es, E_Event_Zone_Edge *ev); -static void _e_shelf_cb_dummy_del(E_Shelf *, Evas *e, Evas_Object *obj, void *event_info); -static void _e_shelf_cb_dummy_moveresize(E_Shelf *, Evas *e, Evas_Object *obj, void *event_info); +static void _e_shelf_cb_dummy_del(E_Shelf *, Evas *e, Evas_Object *obj, void *event_info); +static void _e_shelf_cb_dummy_moveresize(E_Shelf *, Evas *e, Evas_Object *obj, void *event_info); static Eina_Bool _e_shelf_gadcon_populate_handler_cb(void *, int, void *); static Eina_Bool _e_shelf_module_init_end_handler_cb(void *, int, void *); -static void _e_shelf_event_rename_end_cb(void *data, E_Event_Shelf *ev); +static void _e_shelf_event_rename_end_cb(void *data, E_Event_Shelf *ev); static Eina_List *shelves = NULL; static Eina_List *dummies = NULL; @@ -160,7 +160,7 @@ e_shelf_list_all(void) if (s && d) ret = eina_list_merge(s, d); else - ret = d ?: s; + ret = d ? : s; return ret; } @@ -180,17 +180,17 @@ e_shelf_zone_dummy_new(E_Zone *zone, Evas_Object *obj, int id) if (!es) return NULL; es->id = id; evas_object_geometry_get(obj, &es->x, &es->y, &es->w, &es->h); - evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, + evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, (Evas_Object_Event_Cb)_e_shelf_cb_dummy_del, es); - evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, + evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, (Evas_Object_Event_Cb)_e_shelf_cb_dummy_moveresize, es); - evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, + evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, (Evas_Object_Event_Cb)_e_shelf_cb_dummy_moveresize, es); es->zone = zone; es->dummy = 1; es->o_base = obj; es->cfg = E_NEW(E_Config_Shelf, 1); - + e_object_del_attach_func_set(E_OBJECT(es), _e_shelf_del_cb); dummies = eina_list_append(dummies, es); @@ -232,24 +232,24 @@ e_shelf_zone_new(E_Zone *zone, const char *name, const char *style, int popup, E es->o_event = evas_object_rectangle_add(es->evas); evas_object_color_set(es->o_event, 0, 0, 0, 0); evas_object_resize(es->o_event, es->w, es->h); - evas_object_event_callback_add(es->o_event, EVAS_CALLBACK_MOUSE_DOWN, + evas_object_event_callback_add(es->o_event, EVAS_CALLBACK_MOUSE_DOWN, _e_shelf_cb_mouse_down, es); - es->handlers = + es->handlers = eina_list_append(es->handlers, - ecore_event_handler_add(E_EVENT_ZONE_EDGE_MOVE, + ecore_event_handler_add(E_EVENT_ZONE_EDGE_MOVE, _e_shelf_cb_mouse_in, es)); es->o_base = edje_object_add(es->evas); es->name = eina_stringshare_add(name); evas_object_resize(es->o_base, es->w, es->h); - + e_shelf_style_set(es, style); - + if (es->popup) { evas_object_show(es->o_event); evas_object_show(es->o_base); - ecore_x_netwm_window_type_set(es->popup->evas_win, + ecore_x_netwm_window_type_set(es->popup->evas_win, ECORE_X_WINDOW_TYPE_DOCK); } else @@ -260,15 +260,15 @@ e_shelf_zone_new(E_Zone *zone, const char *name, const char *style, int popup, E evas_object_layer_set(es->o_base, layer); } - es->gadcon = + es->gadcon = e_gadcon_swallowed_new(es->name, es->id, es->o_base, "e.swallow.content"); if (es->name) snprintf(buf, sizeof(buf), "%s", es->name); else snprintf(buf, sizeof(buf), _("Shelf #%d"), es->id); - es->gadcon->location = - e_gadcon_location_new(buf, E_GADCON_SITE_SHELF, - _e_shelf_gadcon_client_add, es, + es->gadcon->location = + e_gadcon_location_new(buf, E_GADCON_SITE_SHELF, + _e_shelf_gadcon_client_add, es, _e_shelf_gadcon_client_remove, es); e_gadcon_location_register(es->gadcon->location); // hmm dnd in ibar and ibox kill this. ok. need to look into this more @@ -631,7 +631,7 @@ e_shelf_orient(E_Shelf *es, E_Gadcon_Orient orient) E_OBJECT_CHECK(es); E_OBJECT_IF_NOT_TYPE(es, E_SHELF_DUMMY_TYPE) - E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE); + E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE); if (!es->dummy) { @@ -640,7 +640,7 @@ e_shelf_orient(E_Shelf *es, E_Gadcon_Orient orient) e_shelf_orient_string_get(es)); edje_object_signal_emit(es->o_base, buf, "e"); edje_object_message_signal_process(es->o_base); - e_gadcon_location_set_icon_name(es->gadcon->location, + e_gadcon_location_set_icon_name(es->gadcon->location, _e_shelf_orient_icon_name_get(es)); } e_zone_useful_geometry_dirty(es->zone); @@ -869,18 +869,21 @@ e_shelf_position_calc(E_Shelf *es) if (!e_zone_exists_direction(es->zone, E_ZONE_EDGE_LEFT)) break; err = EINA_TRUE; break; + case E_GADCON_ORIENT_RIGHT: case E_GADCON_ORIENT_CORNER_RT: case E_GADCON_ORIENT_CORNER_RB: if (!e_zone_exists_direction(es->zone, E_ZONE_EDGE_RIGHT)) break; err = EINA_TRUE; break; + case E_GADCON_ORIENT_TOP: case E_GADCON_ORIENT_CORNER_TL: case E_GADCON_ORIENT_CORNER_TR: if (!e_zone_exists_direction(es->zone, E_ZONE_EDGE_TOP)) break; err = EINA_TRUE; break; + case E_GADCON_ORIENT_BOTTOM: case E_GADCON_ORIENT_CORNER_BL: case E_GADCON_ORIENT_CORNER_BR: @@ -988,7 +991,7 @@ e_shelf_popup_set(E_Shelf *es, int popup) evas_object_show(es->o_event); evas_object_show(es->o_base); e_popup_edje_bg_object_set(es->popup, es->o_base); - ecore_x_netwm_window_type_set(es->popup->evas_win, + ecore_x_netwm_window_type_set(es->popup->evas_win, ECORE_X_WINDOW_TYPE_DOCK); e_drop_xdnd_register_set(es->popup->evas_win, 1); @@ -1040,23 +1043,23 @@ e_shelf_autohide_set(E_Shelf *es, int autohide_type) es->autohide = NULL; /* * see FIXME in _e_shelf_cb_mouse_in() for why these are commented out - es->handlers = + es->handlers = eina_list_append(es->handlers, - ecore_event_handler_add(ECORE_X_EVENT_MOUSE_IN, + ecore_event_handler_add(ECORE_X_EVENT_MOUSE_IN, _e_shelf_cb_mouse_in, es)); -*/ + */ if (!es->cfg->autohide_show_action) - es->autohide = ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE, + es->autohide = ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE, _e_shelf_cb_mouse_in, es); /* - es->handlers = + es->handlers = eina_list_append(es->handlers, - ecore_event_handler_add(ECORE_X_EVENT_MOUSE_OUT, + ecore_event_handler_add(ECORE_X_EVENT_MOUSE_OUT, _e_shelf_cb_mouse_out, es)); if (!popup) - evas_object_event_callback_add(es->o_event, EVAS_CALLBACK_MOUSE_OUT, + evas_object_event_callback_add(es->o_event, EVAS_CALLBACK_MOUSE_OUT, (Evas_Object_Event_Cb)_e_shelf_cb_mouse_out2, es); -*/ + */ } EAPI E_Shelf * @@ -1120,8 +1123,8 @@ e_shelf_new_dialog(E_Zone *zone) snprintf(buf, sizeof(buf), _("Shelf #%d"), eina_list_count(e_config->shelves)); return e_entry_dialog_show(_("Add New Shelf"), "preferences-desktop-shelf", - _("Name:"), buf, NULL, NULL, - _e_shelf_new_dialog_ok, NULL, zone); + _("Name:"), buf, NULL, NULL, + _e_shelf_new_dialog_ok, NULL, zone); } /* local subsystem functions */ @@ -1266,11 +1269,11 @@ _e_shelf_free(E_Shelf *es) } if (es->dummy) { - evas_object_event_callback_del_full(es->o_base, EVAS_CALLBACK_DEL, + evas_object_event_callback_del_full(es->o_base, EVAS_CALLBACK_DEL, (Evas_Object_Event_Cb)_e_shelf_cb_dummy_del, es); - evas_object_event_callback_del_full(es->o_base, EVAS_CALLBACK_MOVE, + evas_object_event_callback_del_full(es->o_base, EVAS_CALLBACK_MOVE, (Evas_Object_Event_Cb)_e_shelf_cb_dummy_moveresize, es); - evas_object_event_callback_del_full(es->o_base, EVAS_CALLBACK_RESIZE, + evas_object_event_callback_del_full(es->o_base, EVAS_CALLBACK_RESIZE, (Evas_Object_Event_Cb)_e_shelf_cb_dummy_moveresize, es); } else @@ -1784,11 +1787,11 @@ _e_shelf_cb_menu_delete(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUS } e_object_ref(E_OBJECT(es)); - e_confirm_dialog_show(_("Are you sure you want to delete this shelf?"), + e_confirm_dialog_show(_("Are you sure you want to delete this shelf?"), "enlightenment", _("You requested to delete this shelf.
" "
" - "Are you sure you want to delete it?"), + "Are you sure you want to delete it?"), _("Delete"), _("Keep"), _e_shelf_cb_confirm_dialog_yes, NULL, data, NULL, _e_shelf_cb_confirm_dialog_destroy, data); @@ -1927,30 +1930,30 @@ _e_shelf_cb_mouse_in(void *data, int type, void *event) else e_shelf_toggle(es, 0); } - /* - else if (type == ECORE_X_EVENT_MOUSE_IN) - { - Ecore_X_Event_Mouse_In *ev; + /* + else if (type == ECORE_X_EVENT_MOUSE_IN) + { + Ecore_X_Event_Mouse_In *ev; - ev = event; - if ((!es->hidden) && (!es->menu)) - { - int x, y, w, h; - evas_object_geometry_get(es->o_event, &x, &y, &w, &h); - if (!E_INSIDE(ev->x, ev->y, x, y, w, h)) - e_shelf_toggle(es, 0); - } - if (!es->popup) return ECORE_CALLBACK_PASS_ON; - if (ev->win == es->popup->evas_win) - { - if (es->hidden || (!es->toggle)) - { - edje_object_signal_emit(es->o_base, "e,state,focused", "e"); - e_shelf_toggle(es, 1); - } - } - } - */ + ev = event; + if ((!es->hidden) && (!es->menu)) + { + int x, y, w, h; + evas_object_geometry_get(es->o_event, &x, &y, &w, &h); + if (!E_INSIDE(ev->x, ev->y, x, y, w, h)) + e_shelf_toggle(es, 0); + } + if (!es->popup) return ECORE_CALLBACK_PASS_ON; + if (ev->win == es->popup->evas_win) + { + if (es->hidden || (!es->toggle)) + { + edje_object_signal_emit(es->o_base, "e,state,focused", "e"); + e_shelf_toggle(es, 1); + } + } + } + */ else if (type == ECORE_EVENT_MOUSE_MOVE) { Ecore_Event_Mouse_Move *ev; @@ -1970,10 +1973,10 @@ _e_shelf_cb_mouse_in(void *data, int type, void *event) x = ev->root.x - es->zone->x, y = ev->root.y - es->zone->y; if (inside) inside = ( - ((E_INSIDE(x, y, es->x, es->y, es->w, es->h)) || - (E_INSIDE(x, y, es->x - 2, es->y - 2, es->w + 4, es->h + 4)) || - (E_INSIDE(x, y, es->x + 2, es->y + 2, es->w + 4, es->h + 4))) - ); + ((E_INSIDE(x, y, es->x, es->y, es->w, es->h)) || + (E_INSIDE(x, y, es->x - 2, es->y - 2, es->w + 4, es->h + 4)) || + (E_INSIDE(x, y, es->x + 2, es->y + 2, es->w + 4, es->h + 4))) + ); if (inside && es->popup) { if (es->autohide_timer) @@ -1998,6 +2001,7 @@ _e_shelf_cb_mouse_in(void *data, int type, void *event) } return ECORE_CALLBACK_PASS_ON; } + #if 0 static void _e_shelf_cb_mouse_out2(E_Shelf *es, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, Evas_Event_Mouse_Out *ev) @@ -2052,6 +2056,7 @@ _e_shelf_cb_mouse_out(void *data, int type, void *event) } return ECORE_CALLBACK_PASS_ON; } + #endif static void _e_shelf_cb_dummy_moveresize(E_Shelf *es, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) @@ -2360,9 +2365,9 @@ _e_shelf_cb_menu_rename(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUS E_Shelf *es = data; if (es->rename_dialog) return; es->rename_dialog = e_entry_dialog_show(_("Rename Shelf"), "edit-rename", - _("Name:"), es->name, NULL, NULL, - _e_shelf_cb_menu_rename_yes_cb, - NULL, es); + _("Name:"), es->name, NULL, NULL, + _e_shelf_cb_menu_rename_yes_cb, + NULL, es); e_object_data_set(E_OBJECT(es->rename_dialog), es); e_object_del_attach_func_set(E_OBJECT(es->rename_dialog), _e_shelf_cb_menu_rename_cb); @@ -2524,16 +2529,17 @@ _e_shelf_gadcon_client_add(void *data, E_Gadcon_Client *gcc, const E_Gadcon_Clie evas_object_geometry_get(gc->o_container, NULL, NULL, &w, &h); switch (gc->orient) { - case E_GADCON_ORIENT_VERT: - case E_GADCON_ORIENT_LEFT: - case E_GADCON_ORIENT_RIGHT: - case E_GADCON_ORIENT_CORNER_LT: - case E_GADCON_ORIENT_CORNER_RT: - case E_GADCON_ORIENT_CORNER_LB: - case E_GADCON_ORIENT_CORNER_RB: + case E_GADCON_ORIENT_VERT: + case E_GADCON_ORIENT_LEFT: + case E_GADCON_ORIENT_RIGHT: + case E_GADCON_ORIENT_CORNER_LT: + case E_GADCON_ORIENT_CORNER_RT: + case E_GADCON_ORIENT_CORNER_LB: + case E_GADCON_ORIENT_CORNER_RB: cf_gcc->geom.res = h; break; - default: + + default: cf_gcc->geom.res = w; } } @@ -2543,7 +2549,8 @@ _e_shelf_gadcon_client_add(void *data, E_Gadcon_Client *gcc, const E_Gadcon_Clie cf_gcc->geom.pos = cf_gcc->geom.res - cf_gcc->geom.size; gc->cf->clients = eina_list_append(gc->cf->clients, cf_gcc); } - else if (!e_gadcon_client_config_new(gc, cc->name)) return 0; + else if (!e_gadcon_client_config_new(gc, cc->name)) + return 0; e_gadcon_unpopulate(gc); e_gadcon_populate(gc); e_config_save_queue(); @@ -2637,62 +2644,62 @@ _e_shelf_bindings_add(E_Shelf *es) break; case E_GADCON_ORIENT_LEFT: - e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_LEFT, + e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_LEFT, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0); break; case E_GADCON_ORIENT_RIGHT: - e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_RIGHT, + e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_RIGHT, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0); break; case E_GADCON_ORIENT_TOP: - e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_TOP, + e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_TOP, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0); break; case E_GADCON_ORIENT_BOTTOM: - e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_BOTTOM, + e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_BOTTOM, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0); break; case E_GADCON_ORIENT_CORNER_TL: case E_GADCON_ORIENT_CORNER_LT: - e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_TOP, + e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_TOP, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0); - e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_LEFT, + e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_LEFT, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0); - e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_TOP_LEFT, + e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_TOP_LEFT, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0); break; case E_GADCON_ORIENT_CORNER_TR: case E_GADCON_ORIENT_CORNER_RT: - e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_TOP, + e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_TOP, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0); - e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_RIGHT, + e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_RIGHT, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0); - e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_TOP_RIGHT, + e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_TOP_RIGHT, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0); break; case E_GADCON_ORIENT_CORNER_BL: case E_GADCON_ORIENT_CORNER_LB: - e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_BOTTOM, + e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_BOTTOM, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0); - e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_LEFT, + e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_LEFT, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0); - e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_BOTTOM_LEFT, + e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_BOTTOM_LEFT, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0); break; case E_GADCON_ORIENT_CORNER_BR: case E_GADCON_ORIENT_CORNER_RB: - e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_BOTTOM, + e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_BOTTOM, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0); - e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_RIGHT, + e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_RIGHT, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0); - e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_BOTTOM_RIGHT, + e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_BOTTOM_RIGHT, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0); break; } @@ -2706,7 +2713,7 @@ _e_shelf_bindings_del(E_Shelf *es) snprintf(buf, sizeof(buf), "shelf.%d", es->id); for (edge = E_ZONE_EDGE_LEFT; edge <= E_ZONE_EDGE_BOTTOM_LEFT; edge++) - e_bindings_edge_del(E_BINDING_CONTEXT_ZONE, edge, + e_bindings_edge_del(E_BINDING_CONTEXT_ZONE, edge, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0); } @@ -2718,13 +2725,12 @@ _e_shelf_on_current_desk(E_Shelf *es, E_Event_Zone_Edge *ev) int on_current_desk = 0; int on_all_desks = 1; - if (ev->zone != es->zone) return EINA_FALSE; EINA_LIST_FOREACH(es->cfg->desk_list, ll, sd) { if (!sd) continue; on_all_desks = 0; - if ((sd->x == ev->zone->desk_x_current) && + if ((sd->x == ev->zone->desk_x_current) && (sd->y == ev->zone->desk_y_current)) { on_current_desk = 1; @@ -2736,3 +2742,4 @@ _e_shelf_on_current_desk(E_Shelf *es, E_Event_Zone_Edge *ev) return EINA_TRUE; } + diff --git a/src/bin/e_slidecore.c b/src/bin/e_slidecore.c index e08e25e5e..77a1afac1 100644 --- a/src/bin/e_slidecore.c +++ b/src/bin/e_slidecore.c @@ -1,50 +1,50 @@ #include "e.h" -#define SMART_NAME "e_slidecore" -#define API_ENTRY E_Smart_Data *sd; sd = evas_object_smart_data_get(obj); if ((!obj) || (!sd) || (evas_object_type_get(obj) && strcmp(evas_object_type_get(obj), SMART_NAME))) -#define INTERNAL_ENTRY E_Smart_Data *sd; sd = evas_object_smart_data_get(obj); if (!sd) return; +#define SMART_NAME "e_slidecore" +#define API_ENTRY E_Smart_Data * sd; sd = evas_object_smart_data_get(obj); if ((!obj) || (!sd) || (evas_object_type_get(obj) && strcmp(evas_object_type_get(obj), SMART_NAME))) +#define INTERNAL_ENTRY E_Smart_Data * sd; sd = evas_object_smart_data_get(obj); if (!sd) return; typedef struct _E_Smart_Data E_Smart_Data; typedef struct _E_Smart_Item E_Smart_Item; struct _E_Smart_Data { - Evas_Coord x, y, w, h; + Evas_Coord x, y, w, h; - Evas_Object *smart_obj; - Evas_Object *event_obj; - Evas_Object *o1, *o2; - Eina_List *items; - double slide_time, slide_start; + Evas_Object *smart_obj; + Evas_Object *event_obj; + Evas_Object *o1, *o2; + Eina_List *items; + double slide_time, slide_start; Ecore_Animator *slide_animator; - Evas_Coord dist, pos, slide_pos, slide_start_pos; - int p1, p2, pn; - unsigned char down : 1; + Evas_Coord dist, pos, slide_pos, slide_start_pos; + int p1, p2, pn; + unsigned char down : 1; }; struct _E_Smart_Item { const char *label; const char *icon; - void (*func) (void *data); - void *data; + void (*func)(void *data); + void *data; }; /* local subsystem functions */ static Eina_Bool _e_smart_cb_slide_animator(void *data); -static void _e_smart_event_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _e_smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _e_smart_event_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _e_smart_reconfigure(E_Smart_Data *sd); -static void _e_smart_add(Evas_Object *obj); -static void _e_smart_del(Evas_Object *obj); -static void _e_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y); -static void _e_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h); -static void _e_smart_show(Evas_Object *obj); -static void _e_smart_hide(Evas_Object *obj); -static void _e_smart_color_set(Evas_Object *obj, int r, int g, int b, int a); -static void _e_smart_clip_set(Evas_Object *obj, Evas_Object * clip); -static void _e_smart_clip_unset(Evas_Object *obj); -static void _e_smart_init(void); +static void _e_smart_event_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _e_smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _e_smart_event_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _e_smart_reconfigure(E_Smart_Data *sd); +static void _e_smart_add(Evas_Object *obj); +static void _e_smart_del(Evas_Object *obj); +static void _e_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y); +static void _e_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h); +static void _e_smart_show(Evas_Object *obj); +static void _e_smart_hide(Evas_Object *obj); +static void _e_smart_color_set(Evas_Object *obj, int r, int g, int b, int a); +static void _e_smart_clip_set(Evas_Object *obj, Evas_Object *clip); +static void _e_smart_clip_unset(Evas_Object *obj); +static void _e_smart_init(void); /* local subsystem globals */ static Evas_Smart *_e_smart = NULL; @@ -67,7 +67,7 @@ e_slidecore_item_distance_set(Evas_Object *obj, Evas_Coord dist) } EAPI void -e_slidecore_item_add(Evas_Object *obj, const char *label, const char *icon, void (*func) (void *data), void *data) +e_slidecore_item_add(Evas_Object *obj, const char *label, const char *icon, void (*func)(void *data), void *data) { E_Smart_Item *it; @@ -91,7 +91,7 @@ e_slidecore_jump(Evas_Object *obj, int num) sd->slide_pos = num * sd->dist; if (!sd->slide_animator) sd->slide_animator = ecore_animator_add(_e_smart_cb_slide_animator, - sd); + sd); sd->slide_start = ecore_loop_time_get(); } @@ -102,7 +102,6 @@ e_slidecore_slide_time_set(Evas_Object *obj, double t) sd->slide_time = t; } - /* local subsystem functions */ static Eina_Bool @@ -122,8 +121,8 @@ _e_smart_cb_slide_animator(void *data) if (t >= 1.0) { - sd->slide_animator = NULL; - return ECORE_CALLBACK_CANCEL; + sd->slide_animator = NULL; + return ECORE_CALLBACK_CANCEL; } return ECORE_CALLBACK_RENEW; } @@ -139,8 +138,8 @@ _e_smart_event_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNU if (ev->button == 1) sd->down = 1; if (sd->slide_animator) { - ecore_animator_del(sd->slide_animator); - sd->slide_animator = NULL; + ecore_animator_del(sd->slide_animator); + sd->slide_animator = NULL; } } @@ -154,18 +153,18 @@ _e_smart_event_mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSE ev = event_info; if (ev->button == 1) { - int gop = 0; + int gop = 0; - sd->down = 0; + sd->down = 0; - gop = sd->pos - (sd->p1 * sd->dist); - gop = ((gop / sd->dist) * sd->dist) + (sd->p1 * sd->dist); - sd->slide_start_pos = sd->pos; - sd->slide_pos = gop; - if (!sd->slide_animator) - sd->slide_animator = ecore_animator_add(_e_smart_cb_slide_animator, - sd); - sd->slide_start = ecore_loop_time_get(); + gop = sd->pos - (sd->p1 * sd->dist); + gop = ((gop / sd->dist) * sd->dist) + (sd->p1 * sd->dist); + sd->slide_start_pos = sd->pos; + sd->slide_pos = gop; + if (!sd->slide_animator) + sd->slide_animator = ecore_animator_add(_e_smart_cb_slide_animator, + sd); + sd->slide_start = ecore_loop_time_get(); } } @@ -194,7 +193,8 @@ _e_smart_reconfigure(E_Smart_Data *sd) pos = sd->pos; n = eina_list_count(sd->items); - while (pos < 0) pos += (sd->dist * n); + while (pos < 0) + pos += (sd->dist * n); p1 = pos / sd->dist; p2 = (pos + sd->dist) / sd->dist; dp = pos - (p1 * sd->dist); @@ -202,64 +202,64 @@ _e_smart_reconfigure(E_Smart_Data *sd) while ((p1 < 0) || (p2 < 0)) { - p1 += n; - p2 += n; - at += 255; - dp += sd->dist; + p1 += n; + p2 += n; + at += 255; + dp += sd->dist; } if ((sd->p1 != p1) || (sd->p2 != p2) || (sd->pn != n)) { - E_Smart_Item *it1, *it2; + E_Smart_Item *it1, *it2; - sd->pn = n; - if (n > 0) - { - sd->p1 = p1; - sd->p2 = p2; - if (sd->o1) evas_object_del(sd->o1); - if (sd->o2) evas_object_del(sd->o2); - sd->o1 = NULL; - sd->o2 = NULL; - pl1 = sd->p1 % n; - pl2 = sd->p2 % n; - it1 = eina_list_nth(sd->items, pl1); - it2 = eina_list_nth(sd->items, pl2); - if (it1 && it2) - { - sd->o1 = e_util_icon_theme_icon_add(it1->icon, 512, - evas_object_evas_get(sd->smart_obj)); - if (sd->o1) - { - e_icon_scale_size_set(sd->o1, 0); - evas_object_stack_below(sd->o1, sd->event_obj); - evas_object_pass_events_set(sd->o1, 1); - evas_object_smart_member_add(sd->o1, sd->smart_obj); - e_icon_fill_inside_set(sd->o1, 0); - evas_object_clip_set(sd->o1, evas_object_clip_get(sd->smart_obj)); - evas_object_show(sd->o1); - } - sd->o2 = e_util_icon_theme_icon_add(it2->icon, 512, - evas_object_evas_get(sd->smart_obj)); - if (sd->o2) - { - e_icon_scale_size_set(sd->o2, 0); - evas_object_stack_below(sd->o2, sd->event_obj); - evas_object_pass_events_set(sd->o2, 1); - evas_object_smart_member_add(sd->o2, sd->smart_obj); - e_icon_fill_inside_set(sd->o2, 0); - evas_object_clip_set(sd->o2, evas_object_clip_get(sd->smart_obj)); - evas_object_show(sd->o2); - } - if (at < 128) - { - if (it1->func) it1->func(it1->data); - } - else - { - if (it2->func) it2->func(it2->data); - } - } - } + sd->pn = n; + if (n > 0) + { + sd->p1 = p1; + sd->p2 = p2; + if (sd->o1) evas_object_del(sd->o1); + if (sd->o2) evas_object_del(sd->o2); + sd->o1 = NULL; + sd->o2 = NULL; + pl1 = sd->p1 % n; + pl2 = sd->p2 % n; + it1 = eina_list_nth(sd->items, pl1); + it2 = eina_list_nth(sd->items, pl2); + if (it1 && it2) + { + sd->o1 = e_util_icon_theme_icon_add(it1->icon, 512, + evas_object_evas_get(sd->smart_obj)); + if (sd->o1) + { + e_icon_scale_size_set(sd->o1, 0); + evas_object_stack_below(sd->o1, sd->event_obj); + evas_object_pass_events_set(sd->o1, 1); + evas_object_smart_member_add(sd->o1, sd->smart_obj); + e_icon_fill_inside_set(sd->o1, 0); + evas_object_clip_set(sd->o1, evas_object_clip_get(sd->smart_obj)); + evas_object_show(sd->o1); + } + sd->o2 = e_util_icon_theme_icon_add(it2->icon, 512, + evas_object_evas_get(sd->smart_obj)); + if (sd->o2) + { + e_icon_scale_size_set(sd->o2, 0); + evas_object_stack_below(sd->o2, sd->event_obj); + evas_object_pass_events_set(sd->o2, 1); + evas_object_smart_member_add(sd->o2, sd->smart_obj); + e_icon_fill_inside_set(sd->o2, 0); + evas_object_clip_set(sd->o2, evas_object_clip_get(sd->smart_obj)); + evas_object_show(sd->o2); + } + if (at < 128) + { + if (it1->func) it1->func(it1->data); + } + else + { + if (it2->func) it2->func(it2->data); + } + } + } } evas_object_color_get(sd->smart_obj, &r, &g, &b, &a); @@ -317,9 +317,9 @@ _e_smart_del(Evas_Object *obj) if (sd->slide_animator) ecore_animator_del(sd->slide_animator); EINA_LIST_FREE(sd->items, it) { - if (it->label) eina_stringshare_del(it->label); - if (it->icon) eina_stringshare_del(it->icon); - free(it); + if (it->label) eina_stringshare_del(it->label); + if (it->icon) eina_stringshare_del(it->icon); + free(it); } evas_object_del(sd->event_obj); if (sd->o1) evas_object_del(sd->o1); @@ -368,7 +368,7 @@ _e_smart_color_set(Evas_Object *obj, int r, int g, int b, int a) } static void -_e_smart_clip_set(Evas_Object *obj, Evas_Object * clip) +_e_smart_clip_set(Evas_Object *obj, Evas_Object *clip) { INTERNAL_ENTRY; evas_object_clip_set(sd->event_obj, clip); @@ -389,28 +389,29 @@ static void _e_smart_init(void) { if (_e_smart) return; - { - static const Evas_Smart_Class sc = - { - SMART_NAME, - EVAS_SMART_CLASS_VERSION, - _e_smart_add, - _e_smart_del, - _e_smart_move, - _e_smart_resize, - _e_smart_show, - _e_smart_hide, - _e_smart_color_set, - _e_smart_clip_set, - _e_smart_clip_unset, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL - }; - _e_smart = evas_smart_class_new(&sc); - } + { + static const Evas_Smart_Class sc = + { + SMART_NAME, + EVAS_SMART_CLASS_VERSION, + _e_smart_add, + _e_smart_del, + _e_smart_move, + _e_smart_resize, + _e_smart_show, + _e_smart_hide, + _e_smart_color_set, + _e_smart_clip_set, + _e_smart_clip_unset, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL + }; + _e_smart = evas_smart_class_new(&sc); + } } + diff --git a/src/bin/e_slider.c b/src/bin/e_slider.c index 44a1df1c8..8c88bc346 100644 --- a/src/bin/e_slider.c +++ b/src/bin/e_slider.c @@ -1,10 +1,10 @@ -#define _XOPEN_SOURCE 600 +#define _XOPEN_SOURCE 600 #include "e.h" -#define SMART_NAME "e_slider" -#define API_ENTRY E_Smart_Data *sd; sd = evas_object_smart_data_get(obj); if ((!obj) || (!sd) || (evas_object_type_get(obj) && strcmp(evas_object_type_get(obj), SMART_NAME))) -#define INTERNAL_ENTRY E_Smart_Data *sd; sd = evas_object_smart_data_get(obj); if (!sd) return; -typedef struct _E_Smart_Data E_Smart_Data; +#define SMART_NAME "e_slider" +#define API_ENTRY E_Smart_Data * sd; sd = evas_object_smart_data_get(obj); if ((!obj) || (!sd) || (evas_object_type_get(obj) && strcmp(evas_object_type_get(obj), SMART_NAME))) +#define INTERNAL_ENTRY E_Smart_Data * sd; sd = evas_object_smart_data_get(obj); if (!sd) return; +typedef struct _E_Smart_Data E_Smart_Data; typedef struct _E_Slider_Special_Value E_Slider_Special_Value; @@ -12,50 +12,50 @@ struct _E_Smart_Data { Evas_Coord x, y, w, h; - Evas_Object *smart_obj; - Evas_Object *edje_obj; - Evas_Object *event; - double val, val_min, val_max, val_range, step_size; - int reversed, step_count, horizontal; - int direction; - int changing; - const char *format; - Evas_Coord minw, minh; - Ecore_Timer *set_timer; - Eina_List *special_values; - Eina_Bool disabled : 1; + Evas_Object *smart_obj; + Evas_Object *edje_obj; + Evas_Object *event; + double val, val_min, val_max, val_range, step_size; + int reversed, step_count, horizontal; + int direction; + int changing; + const char *format; + Evas_Coord minw, minh; + Ecore_Timer *set_timer; + Eina_List *special_values; + Eina_Bool disabled : 1; }; struct _E_Slider_Special_Value { - double value; - double error; + double value; + double error; const char *label; }; /* local subsystem functions */ static Eina_Bool _e_smart_set_timer(void *data); -static void _e_smart_value_update(E_Smart_Data *sd); -static void _e_smart_value_update_now(E_Smart_Data *sd); -static void _e_smart_value_fetch(E_Smart_Data *sd); -static void _e_smart_value_limit(E_Smart_Data *sd); -static void _e_smart_format_update(E_Smart_Data *sd); -static void _e_smart_signal_cb_drag(void *data, Evas_Object *obj, const char *emission, const char *source); -static void _e_smart_signal_cb_drag_start(void *data, Evas_Object *obj, const char *emission, const char *source); -static void _e_smart_signal_cb_drag_stop(void *data, Evas_Object *obj, const char *emission, const char *source); -static void _e_smart_event_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _e_smart_event_mouse_down(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *event_info); -static void _e_smart_reconfigure(E_Smart_Data *sd); -static void _e_smart_add(Evas_Object *obj); -static void _e_smart_del(Evas_Object *obj); -static void _e_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y); -static void _e_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h); -static void _e_smart_show(Evas_Object *obj); -static void _e_smart_hide(Evas_Object *obj); -static void _e_smart_color_set(Evas_Object *obj, int r, int g, int b, int a); -static void _e_smart_clip_set(Evas_Object *obj, Evas_Object * clip); -static void _e_smart_clip_unset(Evas_Object *obj); -static void _e_smart_init(void); +static void _e_smart_value_update(E_Smart_Data *sd); +static void _e_smart_value_update_now(E_Smart_Data *sd); +static void _e_smart_value_fetch(E_Smart_Data *sd); +static void _e_smart_value_limit(E_Smart_Data *sd); +static void _e_smart_format_update(E_Smart_Data *sd); +static void _e_smart_signal_cb_drag(void *data, Evas_Object *obj, const char *emission, const char *source); +static void _e_smart_signal_cb_drag_start(void *data, Evas_Object *obj, const char *emission, const char *source); +static void _e_smart_signal_cb_drag_stop(void *data, Evas_Object *obj, const char *emission, const char *source); +static void _e_smart_event_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _e_smart_event_mouse_down(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *event_info); +static void _e_smart_reconfigure(E_Smart_Data *sd); +static void _e_smart_add(Evas_Object *obj); +static void _e_smart_del(Evas_Object *obj); +static void _e_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y); +static void _e_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h); +static void _e_smart_show(Evas_Object *obj); +static void _e_smart_hide(Evas_Object *obj); +static void _e_smart_color_set(Evas_Object *obj, int r, int g, int b, int a); +static void _e_smart_clip_set(Evas_Object *obj, Evas_Object *clip); +static void _e_smart_clip_unset(Evas_Object *obj); +static void _e_smart_init(void); /* local subsystem globals */ static Evas_Smart *_e_smart = NULL; @@ -76,10 +76,10 @@ e_slider_orientation_set(Evas_Object *obj, int horizontal) sd->horizontal = horizontal; if (sd->horizontal) e_theme_edje_object_set(sd->edje_obj, "base/theme/widgets", - "e/widgets/slider_horizontal"); + "e/widgets/slider_horizontal"); else e_theme_edje_object_set(sd->edje_obj, "base/theme/widgets", - "e/widgets/slider_vertical"); + "e/widgets/slider_vertical"); edje_object_size_min_calc(sd->edje_obj, &(sd->minw), &(sd->minh)); _e_smart_value_update(sd); } @@ -181,10 +181,10 @@ e_slider_value_format_display_set(Evas_Object *obj, const char *format) if (format) sd->format = eina_stringshare_add(format); if (changed) { - if (sd->format) - edje_object_signal_emit(sd->edje_obj, "e,action,show,label", "e"); - else - edje_object_signal_emit(sd->edje_obj, "e,action,hide,label", "e"); + if (sd->format) + edje_object_signal_emit(sd->edje_obj, "e,action,show,label", "e"); + else + edje_object_signal_emit(sd->edje_obj, "e,action,hide,label", "e"); } _e_smart_format_update(sd); edje_object_message_signal_process(sd->edje_obj); @@ -260,7 +260,8 @@ _e_smart_set_timer(void *data) if (sd->val_range > 0.0) pos = (sd->val - sd->val_min) / sd->val_range; if (pos < 0.0) pos = 0.0; - else if (pos > 1.0) pos = 1.0; + else if (pos > 1.0) + pos = 1.0; if (sd->reversed) pos = 1.0 - pos; sd->changing++; if (sd->set_timer) ecore_timer_del(sd->set_timer); @@ -304,33 +305,33 @@ _e_smart_value_limit(E_Smart_Data *sd) if (sd->val > sd->val_max) sd->val = sd->val_max; if (sd->val_range > 0.0) { - if (sd->step_count > 0) - { - double p, s; + if (sd->step_count > 0) + { + double p, s; - s = sd->val_range / sd->step_count; - p = sd->val / s; - if (sd->direction == 1) - p = ceil(p); - else if (sd->direction == -1) - p = floor(p); - else - p = round(p); - sd->val = p * s; - } - else if (sd->step_size > 0.0) - { - double p; + s = sd->val_range / sd->step_count; + p = sd->val / s; + if (sd->direction == 1) + p = ceil(p); + else if (sd->direction == -1) + p = floor(p); + else + p = round(p); + sd->val = p * s; + } + else if (sd->step_size > 0.0) + { + double p; - p = sd->val / sd->step_size; - if (sd->direction == 1) - p = ceil(p); - else if (sd->direction == -1) - p = floor(p); - else - p = round(p); - sd->val = p * sd->step_size; - } + p = sd->val / sd->step_size; + if (sd->direction == 1) + p = ceil(p); + else if (sd->direction == -1) + p = floor(p); + else + p = round(p); + sd->val = p * sd->step_size; + } } sd->direction = 0; } @@ -344,16 +345,16 @@ _e_smart_format_update(E_Smart_Data *sd) EINA_LIST_FOREACH(sd->special_values, l, sv) if (fabs(sd->val - sv->value) <= sv->error) { - edje_object_part_text_set(sd->edje_obj, "e.text.label", sv->label); - return; + edje_object_part_text_set(sd->edje_obj, "e.text.label", sv->label); + return; } if (sd->format) { - char buf[256]; + char buf[256]; - snprintf(buf, sizeof(buf), sd->format, sd->val); - edje_object_part_text_set(sd->edje_obj, "e.text.label", buf); + snprintf(buf, sizeof(buf), sd->format, sd->val); + edje_object_part_text_set(sd->edje_obj, "e.text.label", buf); } } @@ -432,40 +433,40 @@ _e_smart_event_key_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSE (!strcmp(ev->keyname, "Left")) || (!strcmp(ev->keyname, "KP_Left"))) { - if (sd->step_count > 0) - { - double s = sd->val_range / sd->step_count; - edje_object_part_drag_step(sd->edje_obj, "e.dragable.slider", -s, -s); - } - else - edje_object_part_drag_step(sd->edje_obj, "e.dragable.slider", -1, -1); - sd->direction = -1; + if (sd->step_count > 0) + { + double s = sd->val_range / sd->step_count; + edje_object_part_drag_step(sd->edje_obj, "e.dragable.slider", -s, -s); + } + else + edje_object_part_drag_step(sd->edje_obj, "e.dragable.slider", -1, -1); + sd->direction = -1; } else if ((!strcmp(ev->keyname, "Down")) || - (!strcmp(ev->keyname, "KP_Down")) || - (!strcmp(ev->keyname, "Right")) || - (!strcmp(ev->keyname, "KP_Right"))) + (!strcmp(ev->keyname, "KP_Down")) || + (!strcmp(ev->keyname, "Right")) || + (!strcmp(ev->keyname, "KP_Right"))) { - if (sd->step_count > 0) - { - double s = sd->val_range / sd->step_count; - edje_object_part_drag_step(sd->edje_obj, "e.dragable.slider", s, s); - } - else - edje_object_part_drag_step(sd->edje_obj, "e.dragable.slider", 1, 1); - sd->direction = 1; + if (sd->step_count > 0) + { + double s = sd->val_range / sd->step_count; + edje_object_part_drag_step(sd->edje_obj, "e.dragable.slider", s, s); + } + else + edje_object_part_drag_step(sd->edje_obj, "e.dragable.slider", 1, 1); + sd->direction = 1; } else if ((!strcmp(ev->keyname, "Home")) || - (!strcmp(ev->keyname, "KP_Home"))) + (!strcmp(ev->keyname, "KP_Home"))) { - edje_object_part_drag_value_set(sd->edje_obj, "e.dragable.slider", 0., 0.); - sd->direction = 0; + edje_object_part_drag_value_set(sd->edje_obj, "e.dragable.slider", 0., 0.); + sd->direction = 0; } else if ((!strcmp(ev->keyname, "End")) || - (!strcmp(ev->keyname, "KP_End"))) + (!strcmp(ev->keyname, "KP_End"))) { - edje_object_part_drag_value_set(sd->edje_obj, "e.dragable.slider", 1., 1.); - sd->direction = 0; + edje_object_part_drag_value_set(sd->edje_obj, "e.dragable.slider", 1., 1.); + sd->direction = 0; } } @@ -541,7 +542,7 @@ _e_smart_add(Evas_Object *obj) sd->edje_obj = edje_object_add(evas_object_evas_get(obj)); e_theme_edje_object_set(sd->edje_obj, "base/theme/widgets", - "e/widgets/slider_vertical"); + "e/widgets/slider_vertical"); edje_object_size_min_calc(sd->edje_obj, &(sd->minw), &(sd->minh)); evas_object_smart_member_add(sd->edje_obj, obj); @@ -575,8 +576,8 @@ _e_smart_del(Evas_Object *obj) if (sd->set_timer) ecore_timer_del(sd->set_timer); EINA_LIST_FREE(sd->special_values, sv) { - eina_stringshare_del(sv->label); - free(sv); + eina_stringshare_del(sv->label); + free(sv); } free(sd); } @@ -623,7 +624,7 @@ _e_smart_color_set(Evas_Object *obj, int r, int g, int b, int a) } static void -_e_smart_clip_set(Evas_Object *obj, Evas_Object * clip) +_e_smart_clip_set(Evas_Object *obj, Evas_Object *clip) { INTERNAL_ENTRY; evas_object_clip_set(sd->edje_obj, clip); @@ -642,20 +643,21 @@ static void _e_smart_init(void) { if (_e_smart) return; - { - static Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION(SMART_NAME); - if (!sc.add) - { - sc.add = _e_smart_add; - sc.del = _e_smart_del; - sc.move = _e_smart_move; - sc.resize = _e_smart_resize; - sc.show = _e_smart_show; - sc.hide = _e_smart_hide; - sc.color_set = _e_smart_color_set; - sc.clip_set = _e_smart_clip_set; - sc.clip_unset = _e_smart_clip_unset; - } - _e_smart = evas_smart_class_new(&sc); - } + { + static Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION(SMART_NAME); + if (!sc.add) + { + sc.add = _e_smart_add; + sc.del = _e_smart_del; + sc.move = _e_smart_move; + sc.resize = _e_smart_resize; + sc.show = _e_smart_show; + sc.hide = _e_smart_hide; + sc.color_set = _e_smart_color_set; + sc.clip_set = _e_smart_clip_set; + sc.clip_unset = _e_smart_clip_unset; + } + _e_smart = evas_smart_class_new(&sc); + } } + diff --git a/src/bin/e_slidesel.c b/src/bin/e_slidesel.c index 1c82d6aac..d2bfc6148 100644 --- a/src/bin/e_slidesel.c +++ b/src/bin/e_slidesel.c @@ -1,23 +1,23 @@ #include "e.h" -#define SMART_NAME "e_slidesel" -#define API_ENTRY E_Smart_Data *sd; sd = evas_object_smart_data_get(obj); if ((!obj) || (!sd) || (evas_object_type_get(obj) && strcmp(evas_object_type_get(obj), SMART_NAME))) -#define INTERNAL_ENTRY E_Smart_Data *sd; sd = evas_object_smart_data_get(obj); if (!sd) return; +#define SMART_NAME "e_slidesel" +#define API_ENTRY E_Smart_Data * sd; sd = evas_object_smart_data_get(obj); if ((!obj) || (!sd) || (evas_object_type_get(obj) && strcmp(evas_object_type_get(obj), SMART_NAME))) +#define INTERNAL_ENTRY E_Smart_Data * sd; sd = evas_object_smart_data_get(obj); if (!sd) return; typedef struct _E_Smart_Data E_Smart_Data; typedef struct _E_Smart_Item E_Smart_Item; struct _E_Smart_Data { - Evas_Coord x, y, w, h; + Evas_Coord x, y, w, h; - Evas_Object *smart_obj; - Evas_Object *edje_obj; - Evas_Object *event_obj; - Evas_Object *slide_obj; - Eina_List *items; - Evas_Coord down_x, down_y; + Evas_Object *smart_obj; + Evas_Object *edje_obj; + Evas_Object *event_obj; + Evas_Object *slide_obj; + Eina_List *items; + Evas_Coord down_x, down_y; E_Smart_Item *cur; - double down_time; + double down_time; unsigned char down : 1; unsigned char down_cancel : 1; }; @@ -25,10 +25,10 @@ struct _E_Smart_Data struct _E_Smart_Item { E_Smart_Data *sd; - const char *label; - const char *icon; - void (*func) (void *data); - void *data; + const char *label; + const char *icon; + void (*func)(void *data); + void *data; }; /* local subsystem functions */ @@ -44,7 +44,7 @@ static void _e_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h); static void _e_smart_show(Evas_Object *obj); static void _e_smart_hide(Evas_Object *obj); static void _e_smart_color_set(Evas_Object *obj, int r, int g, int b, int a); -static void _e_smart_clip_set(Evas_Object *obj, Evas_Object * clip); +static void _e_smart_clip_set(Evas_Object *obj, Evas_Object *clip); static void _e_smart_clip_unset(Evas_Object *obj); static void _e_smart_init(void); @@ -77,7 +77,7 @@ e_slidesel_item_distance_set(Evas_Object *obj, Evas_Coord dist) } EAPI void -e_slidesel_item_add(Evas_Object *obj, const char *label, const char *icon, void (*func) (void *data), void *data) +e_slidesel_item_add(Evas_Object *obj, const char *label, const char *icon, void (*func)(void *data), void *data) { E_Smart_Item *it; @@ -111,12 +111,12 @@ _e_smart_event_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNU ev = event_info; if (ev->button == 1) { - sd->down_time = ecore_loop_time_get(); - sd->down = 1; - sd->down_cancel = 0; - sd->down_x = ev->canvas.x; - sd->down_y = ev->canvas.y; - edje_object_signal_emit(sd->edje_obj, "e,state,slide,hint,on", "e"); + sd->down_time = ecore_loop_time_get(); + sd->down = 1; + sd->down_cancel = 0; + sd->down_x = ev->canvas.x; + sd->down_y = ev->canvas.y; + edje_object_signal_emit(sd->edje_obj, "e,state,slide,hint,on", "e"); } } @@ -130,23 +130,23 @@ _e_smart_event_mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSE ev = event_info; if (ev->button == 1) { - if (!sd->down_cancel) - { - edje_object_signal_emit(sd->edje_obj, "e,state,slide,hint,off", "e"); - if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)) - { - if (sd->cur) - { - /* get rid of accidental release and presses */ + if (!sd->down_cancel) + { + edje_object_signal_emit(sd->edje_obj, "e,state,slide,hint,off", "e"); + if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)) + { + if (sd->cur) + { + /* get rid of accidental release and presses */ // if ((t - sd->down_time) > 0.2) - { - edje_object_signal_emit(sd->edje_obj, "e,action,select", "e"); - if (sd->cur->func) sd->cur->func(sd->cur->data); - } - } - } - } - sd->down = 0; + { + edje_object_signal_emit(sd->edje_obj, "e,action,select", "e"); + if (sd->cur->func) sd->cur->func(sd->cur->data); + } + } + } + } + sd->down = 0; } } @@ -160,16 +160,16 @@ _e_smart_event_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNU ev = event_info; if ((sd->down) && (!sd->down_cancel)) { - Evas_Coord d1, d2, d; + Evas_Coord d1, d2, d; - d1 = ev->cur.canvas.x - sd->down_x; - d2 = ev->cur.canvas.y - sd->down_y; - d = (d1 * d1) + (d2 * d2); - if (d > (64 * 64)) - { - edje_object_signal_emit(sd->edje_obj, "e,state,slide,hint,off", "e"); - sd->down_cancel = 1; - } + d1 = ev->cur.canvas.x - sd->down_x; + d2 = ev->cur.canvas.y - sd->down_y; + d = (d1 * d1) + (d2 * d2); + if (d > (64 * 64)) + { + edje_object_signal_emit(sd->edje_obj, "e,state,slide,hint,off", "e"); + sd->down_cancel = 1; + } } } @@ -196,17 +196,17 @@ _e_smart_event_key_down(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object * y += sd->step.y; else if (!strcmp(ev->keyname, "Prior")) { - if (sd->page.y < 0) - y -= -(sd->page.y * vh) / 100; - else - y -= sd->page.y; + if (sd->page.y < 0) + y -= -(sd->page.y * vh) / 100; + else + y -= sd->page.y; } else if (!strcmp(ev->keyname, "Next")) { - if (sd->page.y < 0) - y += -(sd->page.y * vh) / 100; - else - y += sd->page.y; + if (sd->page.y < 0) + y += -(sd->page.y * vh) / 100; + else + y += sd->page.y; } */ } @@ -242,7 +242,7 @@ _e_smart_add(Evas_Object *obj) o = edje_object_add(evas_object_evas_get(obj)); sd->edje_obj = o; e_theme_edje_object_set(o, "base/theme/widgets", - "e/widgets/slidesel"); + "e/widgets/slidesel"); evas_object_smart_member_add(o, obj); o = e_slidecore_add(evas_object_evas_get(obj)); @@ -312,7 +312,7 @@ _e_smart_color_set(Evas_Object *obj, int r, int g, int b, int a) } static void -_e_smart_clip_set(Evas_Object *obj, Evas_Object * clip) +_e_smart_clip_set(Evas_Object *obj, Evas_Object *clip) { INTERNAL_ENTRY; evas_object_clip_set(sd->edje_obj, clip); @@ -333,28 +333,29 @@ static void _e_smart_init(void) { if (_e_smart) return; - { - static const Evas_Smart_Class sc = - { - SMART_NAME, - EVAS_SMART_CLASS_VERSION, - _e_smart_add, - _e_smart_del, - _e_smart_move, - _e_smart_resize, - _e_smart_show, - _e_smart_hide, - _e_smart_color_set, - _e_smart_clip_set, - _e_smart_clip_unset, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL - }; - _e_smart = evas_smart_class_new(&sc); - } + { + static const Evas_Smart_Class sc = + { + SMART_NAME, + EVAS_SMART_CLASS_VERSION, + _e_smart_add, + _e_smart_del, + _e_smart_move, + _e_smart_resize, + _e_smart_show, + _e_smart_hide, + _e_smart_color_set, + _e_smart_clip_set, + _e_smart_clip_unset, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL + }; + _e_smart = evas_smart_class_new(&sc); + } } + diff --git a/src/bin/e_spectrum.c b/src/bin/e_spectrum.c index aea616990..d107d800c 100644 --- a/src/bin/e_spectrum.c +++ b/src/bin/e_spectrum.c @@ -6,15 +6,15 @@ typedef struct _E_Spectrum E_Spectrum; struct _E_Spectrum { - Evas_Object *o_spectrum; - Evas_Object *o_event; - Evas_Object *o_cursor; + Evas_Object *o_spectrum; + Evas_Object *o_event; + Evas_Object *o_cursor; - int iw, ih; /* square image width/height */ - E_Color_Component mode; + int iw, ih; /* square image width/height */ + E_Color_Component mode; - E_Color *cv; - Ecore_Timer *draw_timer; + E_Color *cv; + Ecore_Timer *draw_timer; }; static Eina_Bool _e_spectrum_redraw(void *d); @@ -22,158 +22,158 @@ static Eina_Bool _e_spectrum_redraw(void *d); static void _e_spectrum_smart_add(Evas_Object *o) { - E_Spectrum *sp; - sp = E_NEW(E_Spectrum, 1); + E_Spectrum *sp; + sp = E_NEW(E_Spectrum, 1); - if (!sp) return; + if (!sp) return; - evas_object_smart_data_set(o, sp); + evas_object_smart_data_set(o, sp); - sp->mode = E_COLOR_COMPONENT_R; + sp->mode = E_COLOR_COMPONENT_R; - sp->o_spectrum = evas_object_image_add(evas_object_evas_get(o)); - sp->iw = sp->ih = 255; - evas_object_image_size_set(sp->o_spectrum, sp->iw, sp->ih); - evas_object_image_alpha_set(sp->o_spectrum, 1); + sp->o_spectrum = evas_object_image_add(evas_object_evas_get(o)); + sp->iw = sp->ih = 255; + evas_object_image_size_set(sp->o_spectrum, sp->iw, sp->ih); + evas_object_image_alpha_set(sp->o_spectrum, 1); - evas_object_smart_member_add(sp->o_spectrum, o); + evas_object_smart_member_add(sp->o_spectrum, o); } static void _e_spectrum_smart_del(Evas_Object *o) { - E_Spectrum *sp; + E_Spectrum *sp; - sp = evas_object_smart_data_get(o); - if (!sp) return; + sp = evas_object_smart_data_get(o); + if (!sp) return; - evas_object_del(sp->o_spectrum); - evas_object_del(sp->o_event); - evas_object_del(sp->o_cursor); + evas_object_del(sp->o_spectrum); + evas_object_del(sp->o_event); + evas_object_del(sp->o_cursor); - if (sp->draw_timer) ecore_timer_del(sp->draw_timer); + if (sp->draw_timer) ecore_timer_del(sp->draw_timer); - E_FREE(sp); + E_FREE(sp); } static void _e_spectrum_smart_show(Evas_Object *o) { - E_Spectrum *sp; + E_Spectrum *sp; - sp = evas_object_smart_data_get(o); - if (!sp) return; + sp = evas_object_smart_data_get(o); + if (!sp) return; - evas_object_show(sp->o_spectrum); - evas_object_show(sp->o_event); - evas_object_show(sp->o_cursor); + evas_object_show(sp->o_spectrum); + evas_object_show(sp->o_event); + evas_object_show(sp->o_cursor); } static void _e_spectrum_smart_hide(Evas_Object *o) { - E_Spectrum *sp; + E_Spectrum *sp; - sp = evas_object_smart_data_get(o); - if (!sp) return; + sp = evas_object_smart_data_get(o); + if (!sp) return; - evas_object_hide(sp->o_spectrum); - evas_object_hide(sp->o_event); - evas_object_hide(sp->o_cursor); + evas_object_hide(sp->o_spectrum); + evas_object_hide(sp->o_event); + evas_object_hide(sp->o_cursor); } static void _e_spectrum_smart_move(Evas_Object *o, Evas_Coord x, Evas_Coord y) { - E_Spectrum *sp; + E_Spectrum *sp; - sp = evas_object_smart_data_get(o); - if (!sp) return; + sp = evas_object_smart_data_get(o); + if (!sp) return; - evas_object_move(sp->o_spectrum, x, y); - evas_object_move(sp->o_event, x, y); - evas_object_move(sp->o_cursor, x, y); + evas_object_move(sp->o_spectrum, x, y); + evas_object_move(sp->o_event, x, y); + evas_object_move(sp->o_cursor, x, y); } static void _e_spectrum_smart_resize(Evas_Object *o, Evas_Coord w, Evas_Coord h) { - E_Spectrum *sp; + E_Spectrum *sp; - sp = evas_object_smart_data_get(o); - if (!sp) return; + sp = evas_object_smart_data_get(o); + if (!sp) return; - evas_object_image_fill_set(sp->o_spectrum, 0, 0, w, h); + evas_object_image_fill_set(sp->o_spectrum, 0, 0, w, h); - evas_object_resize(sp->o_spectrum, w, h); - evas_object_resize(sp->o_event, w, h); - evas_object_resize(sp->o_cursor, w, h); + evas_object_resize(sp->o_spectrum, w, h); + evas_object_resize(sp->o_event, w, h); + evas_object_resize(sp->o_cursor, w, h); } static void _e_spectrum_smart_color_set(Evas_Object *o, int r, int g, int b, int a) { - E_Spectrum *sp; + E_Spectrum *sp; - sp = evas_object_smart_data_get(o); - if (!sp) return; - evas_object_color_set(sp->o_spectrum, r, g, b, a); - evas_object_color_set(sp->o_event, r, g, b, a); - evas_object_color_set(sp->o_cursor, r, g, b, a); + sp = evas_object_smart_data_get(o); + if (!sp) return; + evas_object_color_set(sp->o_spectrum, r, g, b, a); + evas_object_color_set(sp->o_event, r, g, b, a); + evas_object_color_set(sp->o_cursor, r, g, b, a); } static void _e_spectrum_smart_clip_set(Evas_Object *o, Evas_Object *o_clip) { - E_Spectrum *sp; + E_Spectrum *sp; - sp = evas_object_smart_data_get(o); - if (!sp) return; - evas_object_clip_set(sp->o_spectrum, o_clip); - evas_object_clip_set(sp->o_event, o_clip); - evas_object_clip_set(sp->o_cursor, o_clip); + sp = evas_object_smart_data_get(o); + if (!sp) return; + evas_object_clip_set(sp->o_spectrum, o_clip); + evas_object_clip_set(sp->o_event, o_clip); + evas_object_clip_set(sp->o_cursor, o_clip); } static void _e_spectrum_smart_clip_unset(Evas_Object *o) { - E_Spectrum *sp; + E_Spectrum *sp; - sp = evas_object_smart_data_get(o); - if (!sp) return; - evas_object_clip_unset(sp->o_spectrum); - evas_object_clip_unset(sp->o_event); - evas_object_clip_unset(sp->o_cursor); + sp = evas_object_smart_data_get(o); + if (!sp) return; + evas_object_clip_unset(sp->o_spectrum); + evas_object_clip_unset(sp->o_event); + evas_object_clip_unset(sp->o_cursor); } static void _e_spectrum_smart_init(void) { if (_e_spectrum_smart) return; - { - static const Evas_Smart_Class sc = - { - "e_spectrum", - EVAS_SMART_CLASS_VERSION, - _e_spectrum_smart_add, - _e_spectrum_smart_del, - _e_spectrum_smart_move, - _e_spectrum_smart_resize, - _e_spectrum_smart_show, - _e_spectrum_smart_hide, - _e_spectrum_smart_color_set, - _e_spectrum_smart_clip_set, - _e_spectrum_smart_clip_unset, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL - }; - _e_spectrum_smart = evas_smart_class_new(&sc); - } + { + static const Evas_Smart_Class sc = + { + "e_spectrum", + EVAS_SMART_CLASS_VERSION, + _e_spectrum_smart_add, + _e_spectrum_smart_del, + _e_spectrum_smart_move, + _e_spectrum_smart_resize, + _e_spectrum_smart_show, + _e_spectrum_smart_hide, + _e_spectrum_smart_color_set, + _e_spectrum_smart_clip_set, + _e_spectrum_smart_clip_unset, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL + }; + _e_spectrum_smart = evas_smart_class_new(&sc); + } } void @@ -182,155 +182,173 @@ _e_spectrum_color_calc(E_Spectrum *sp, float vx, float vy, float vz, int *r, int switch (sp->mode) { case E_COLOR_COMPONENT_R: - *r = 255 * vz; - *g = 255 * vy; - *b = 255 * vx; - break; + *r = 255 * vz; + *g = 255 * vy; + *b = 255 * vx; + break; + case E_COLOR_COMPONENT_G: - *r = 255 * vx; - *g = 255 * vz; - *b = 255 * vy; - break; + *r = 255 * vx; + *g = 255 * vz; + *b = 255 * vy; + break; + case E_COLOR_COMPONENT_B: - *r = 255 * vy; - *g = 255 * vx; - *b = 255 * vz; - break; + *r = 255 * vy; + *g = 255 * vx; + *b = 255 * vz; + break; + case E_COLOR_COMPONENT_H: - evas_color_hsv_to_rgb(vz * 360.0, vy, vx, r, g, b); - break; + evas_color_hsv_to_rgb(vz * 360.0, vy, vx, r, g, b); + break; + case E_COLOR_COMPONENT_S: - evas_color_hsv_to_rgb(vx * 360.0, vz, vy, r, g, b); - break; + evas_color_hsv_to_rgb(vx * 360.0, vz, vy, r, g, b); + break; + case E_COLOR_COMPONENT_V: - evas_color_hsv_to_rgb(vy * 360.0, vx, vz, r, g, b); - break; + evas_color_hsv_to_rgb(vy * 360.0, vx, vz, r, g, b); + break; + default: - break; + break; } } void _e_spectrum_2d_color_at(E_Spectrum *sp, int x, int y, int *r, int *g, int *b) { - int rr, gg, bb; - float h, s, v; + int rr, gg, bb; + float h, s, v; - if (!sp || !sp->cv) return; + if (!sp || !sp->cv) return; - switch (sp->mode) - { - case E_COLOR_COMPONENT_R: - rr = sp->cv->r; - gg = (1 - (y / (double)(sp->ih))) * 255; - bb = (x / (double)(sp->iw)) * 255; - break; - case E_COLOR_COMPONENT_G: - rr = (x / (double)(sp->iw)) * 255; - gg = sp->cv->g; - bb = (1 - (y / (double)(sp->ih))) * 255; - break; - case E_COLOR_COMPONENT_B: - rr = (1 - (y / (double)(sp->ih))) * 255; - gg = (x / (double)(sp->iw)) * 255; - bb = sp->cv->b; - break; - case E_COLOR_COMPONENT_H: - h = sp->cv->h; - s = 1 - (y / (double)(sp->ih)); - v = x / (double)(sp->iw); - evas_color_hsv_to_rgb(h, s, v, &rr, &gg, &bb); - break; - case E_COLOR_COMPONENT_S: - s = sp->cv->s; - v = 1 - (y / (double)(sp->ih)); - h = x / (double)(sp->iw) * 360; - evas_color_hsv_to_rgb(h, s, v, &rr, &gg, &bb); - break; - case E_COLOR_COMPONENT_V: - v = sp->cv->v; - h = (1 - (y / (double)(sp->ih))) * 360; - s = x / (double)(sp->iw); - evas_color_hsv_to_rgb(h, s, v, &rr, &gg, &bb); - break; - case E_COLOR_COMPONENT_MAX: - default: - return; - } + switch (sp->mode) + { + case E_COLOR_COMPONENT_R: + rr = sp->cv->r; + gg = (1 - (y / (double)(sp->ih))) * 255; + bb = (x / (double)(sp->iw)) * 255; + break; - if (r) *r = rr; - if (g) *g = gg; - if (b) *b = bb; + case E_COLOR_COMPONENT_G: + rr = (x / (double)(sp->iw)) * 255; + gg = sp->cv->g; + bb = (1 - (y / (double)(sp->ih))) * 255; + break; + + case E_COLOR_COMPONENT_B: + rr = (1 - (y / (double)(sp->ih))) * 255; + gg = (x / (double)(sp->iw)) * 255; + bb = sp->cv->b; + break; + + case E_COLOR_COMPONENT_H: + h = sp->cv->h; + s = 1 - (y / (double)(sp->ih)); + v = x / (double)(sp->iw); + evas_color_hsv_to_rgb(h, s, v, &rr, &gg, &bb); + break; + + case E_COLOR_COMPONENT_S: + s = sp->cv->s; + v = 1 - (y / (double)(sp->ih)); + h = x / (double)(sp->iw) * 360; + evas_color_hsv_to_rgb(h, s, v, &rr, &gg, &bb); + break; + + case E_COLOR_COMPONENT_V: + v = sp->cv->v; + h = (1 - (y / (double)(sp->ih))) * 360; + s = x / (double)(sp->iw); + evas_color_hsv_to_rgb(h, s, v, &rr, &gg, &bb); + break; + + case E_COLOR_COMPONENT_MAX: + default: + return; + } + + if (r) *r = rr; + if (g) *g = gg; + if (b) *b = bb; } static Eina_Bool _e_spectrum_redraw(void *d) { - E_Spectrum *sp = d; - int *data; - int i, j; - int r, g, b; - float vx, vy, vz = 0; + E_Spectrum *sp = d; + int *data; + int i, j; + int r, g, b; + float vx, vy, vz = 0; - data = evas_object_image_data_get(sp->o_spectrum, 1); - if (!data) - { - sp->draw_timer = NULL; - return ECORE_CALLBACK_CANCEL; - } + data = evas_object_image_data_get(sp->o_spectrum, 1); + if (!data) + { + sp->draw_timer = NULL; + return ECORE_CALLBACK_CANCEL; + } - switch (sp->mode) - { - case E_COLOR_COMPONENT_R: - vz = (float)sp->cv->r / 255; - break; - case E_COLOR_COMPONENT_G: - vz = (float)sp->cv->g / 255; - break; - case E_COLOR_COMPONENT_B: - vz = (float)sp->cv->b / 255; - break; - case E_COLOR_COMPONENT_H: - vz = sp->cv->h / 360; - break; - case E_COLOR_COMPONENT_S: - vz = sp->cv->s; - break; - case E_COLOR_COMPONENT_V: - vz = sp->cv->v; - break; - case E_COLOR_COMPONENT_MAX: - break; - } + switch (sp->mode) + { + case E_COLOR_COMPONENT_R: + vz = (float)sp->cv->r / 255; + break; - for (i = 0; i < sp->ih; i++) - { - vy = (float)i / sp->ih; - for (j = 0; j < sp->iw; j++) - { - vx = (float)j / sp->iw; - _e_spectrum_color_calc(sp, vx, vy, vz, &r, &g, &b); - data[(i * sp->iw) + j] = - (sp->cv->a << 24) | - (((r * sp->cv->a) / 255) << 16) | - (((g * sp->cv->a) / 255) << 8) | - (((b * sp->cv->a) / 255) ); - } - } + case E_COLOR_COMPONENT_G: + vz = (float)sp->cv->g / 255; + break; - evas_object_image_data_set(sp->o_spectrum, data); - evas_object_image_data_update_add(sp->o_spectrum, 0, 0, sp->iw, sp->ih); - sp->draw_timer = NULL; - return ECORE_CALLBACK_CANCEL; + case E_COLOR_COMPONENT_B: + vz = (float)sp->cv->b / 255; + break; + + case E_COLOR_COMPONENT_H: + vz = sp->cv->h / 360; + break; + + case E_COLOR_COMPONENT_S: + vz = sp->cv->s; + break; + + case E_COLOR_COMPONENT_V: + vz = sp->cv->v; + break; + + case E_COLOR_COMPONENT_MAX: + break; + } + + for (i = 0; i < sp->ih; i++) + { + vy = (float)i / sp->ih; + for (j = 0; j < sp->iw; j++) + { + vx = (float)j / sp->iw; + _e_spectrum_color_calc(sp, vx, vy, vz, &r, &g, &b); + data[(i * sp->iw) + j] = + (sp->cv->a << 24) | + (((r * sp->cv->a) / 255) << 16) | + (((g * sp->cv->a) / 255) << 8) | + (((b * sp->cv->a) / 255)); + } + } + + evas_object_image_data_set(sp->o_spectrum, data); + evas_object_image_data_update_add(sp->o_spectrum, 0, 0, sp->iw, sp->ih); + sp->draw_timer = NULL; + return ECORE_CALLBACK_CANCEL; } static void _e_spectrum_update(E_Spectrum *sp) { - if (!sp || !sp->cv) return; + if (!sp || !sp->cv) return; - if (sp->draw_timer) ecore_timer_del(sp->draw_timer); - sp->draw_timer = ecore_timer_add(.001, _e_spectrum_redraw, sp); + if (sp->draw_timer) ecore_timer_del(sp->draw_timer); + sp->draw_timer = ecore_timer_add(.001, _e_spectrum_redraw, sp); } Evas_Object * @@ -343,50 +361,51 @@ e_spectrum_add(Evas *e) void e_spectrum_mode_set(Evas_Object *o, E_Color_Component mode) { - E_Spectrum *sp; + E_Spectrum *sp; if (evas_object_smart_smart_get(o) != _e_spectrum_smart) SMARTERRNR(); - sp = evas_object_smart_data_get(o); - if (!sp) return; + sp = evas_object_smart_data_get(o); + if (!sp) return; - if (sp->mode == mode) return; - sp->mode = mode; - _e_spectrum_update(sp); + if (sp->mode == mode) return; + sp->mode = mode; + _e_spectrum_update(sp); } E_Color_Component e_spectrum_mode_get(Evas_Object *o) { - E_Spectrum *sp; + E_Spectrum *sp; if (evas_object_smart_smart_get(o) != _e_spectrum_smart) SMARTERR(0); - sp = evas_object_smart_data_get(o); - if (!sp) return -1; + sp = evas_object_smart_data_get(o); + if (!sp) return -1; - return sp->mode; + return sp->mode; } void e_spectrum_color_value_set(Evas_Object *o, E_Color *cv) { - E_Spectrum *sp; + E_Spectrum *sp; if (evas_object_smart_smart_get(o) != _e_spectrum_smart) SMARTERRNR(); - sp = evas_object_smart_data_get(o); - if (!sp) return; + sp = evas_object_smart_data_get(o); + if (!sp) return; - sp->cv = cv; - _e_spectrum_update(sp); + sp->cv = cv; + _e_spectrum_update(sp); } void e_spectrum_update(Evas_Object *o) { - E_Spectrum *sp; + E_Spectrum *sp; if (evas_object_smart_smart_get(o) != _e_spectrum_smart) SMARTERRNR(); - sp = evas_object_smart_data_get(o); - if (!sp) return; + sp = evas_object_smart_data_get(o); + if (!sp) return; - _e_spectrum_update(sp); + _e_spectrum_update(sp); } + diff --git a/src/bin/e_start_main.c b/src/bin/e_start_main.c index 7ce1415ad..ea83960af 100644 --- a/src/bin/e_start_main.c +++ b/src/bin/e_start_main.c @@ -421,7 +421,7 @@ main(int argc, char **argv) { pid_t child; - stop_ptrace = EINA_FALSE; + stop_ptrace = EINA_FALSE; child = fork(); diff --git a/src/bin/e_static_grab.c b/src/bin/e_static_grab.c index de7a53e6d..bc34130e2 100644 --- a/src/bin/e_static_grab.c +++ b/src/bin/e_static_grab.c @@ -1,25 +1,25 @@ #include "e.h" -typedef struct _E_Static_Grab E_Static_Grab; +typedef struct _E_Static_Grab E_Static_Grab; typedef struct _E_Static_Grab_Module E_Static_Grab_Module; struct _E_Static_Grab { struct { - int core_count; - int thread_count; - int bogo; - int model; - int family; - int stepping; - int cache_size; - int addr_space; + int core_count; + int thread_count; + int bogo; + int model; + int family; + int stepping; + int cache_size; + int addr_space; const char *vendor; const char *model_name; - Eina_Bool fpu; + Eina_Bool fpu; } cpu; struct @@ -30,7 +30,8 @@ struct _E_Static_Grab const char *kernel_release; } distribution; - struct { + struct + { struct { const char *vendor; @@ -42,7 +43,7 @@ struct _E_Static_Grab const char *release_date; const char *build_date; - Eina_List *modules; + Eina_List *modules; } x; }; @@ -58,30 +59,30 @@ struct _E_Static_Grab_Module }; /* For /proc/cpuinfo */ -#define CPU_CORES "cpu cores" -#define CACHE_SIZE "cache size" -#define CPU_FAMILY "cpu family" -#define STEPPING "stepping" -#define SIBLINGS "siblings" -#define BOGOMIPS "bogomips" -#define MODEL "model" -#define MODEL_NAME "model name" -#define VENDOR_ID "vendor_id" -#define FPU "fpu" +#define CPU_CORES "cpu cores" +#define CACHE_SIZE "cache size" +#define CPU_FAMILY "cpu family" +#define STEPPING "stepping" +#define SIBLINGS "siblings" +#define BOGOMIPS "bogomips" +#define MODEL "model" +#define MODEL_NAME "model name" +#define VENDOR_ID "vendor_id" +#define FPU "fpu" /* For /var/log/Xorg.0.log */ -#define RELEASE_DATE "Release Date" -#define BUILD_DATE "Build Date" -#define LOAD_MODULE "(II) LoadModule" +#define RELEASE_DATE "Release Date" +#define BUILD_DATE "Build Date" +#define LOAD_MODULE "(II) LoadModule" #define UNLOAD_MODULE "(II) UnloadModule" -#define MODULE_OF "(II) Module %s" -#define LOADING "(II) Loading" -#define VENDOR "vendor=\"" -#define COMPILED "compiled for " -#define MODULE_CLASS "Module class" -#define ABI_CLASS "ABI class" +#define MODULE_OF "(II) Module %s" +#define LOADING "(II) Loading" +#define VENDOR "vendor=\"" +#define COMPILED "compiled for " +#define MODULE_CLASS "Module class" +#define ABI_CLASS "ABI class" #undef VERSION -#define VERSION ", version " +#define VERSION ", version " static const char * _e_static_grab_name(const char *line, const char *end, const char *name) @@ -180,10 +181,10 @@ _e_static_grab_cpu(E_Static_Grab *grab) const char *fpu = NULL; int siblings = 0; - grab->cpu.addr_space = sizeof (void*); + grab->cpu.addr_space = sizeof (void *); f = fopen("/proc/cpuinfo", "r"); - if (!f) return ; + if (!f) return; while (!feof(f)) { @@ -194,32 +195,37 @@ _e_static_grab_cpu(E_Static_Grab *grab) length = strlen(buf); end = buf + length; - if (length < 3) continue ; + if (length < 3) continue; switch (*buf) { case 'c': - if (_e_static_grab_int(buf, end, CPU_CORES, &grab->cpu.core_count)) break; - if (_e_static_grab_int(buf, end, CACHE_SIZE, &grab->cpu.cache_size)) break; - _e_static_grab_int(buf, end, CPU_FAMILY, &grab->cpu.family); - break; + if (_e_static_grab_int(buf, end, CPU_CORES, &grab->cpu.core_count)) break; + if (_e_static_grab_int(buf, end, CACHE_SIZE, &grab->cpu.cache_size)) break; + _e_static_grab_int(buf, end, CPU_FAMILY, &grab->cpu.family); + break; + case 's': - if (_e_static_grab_int(buf, end, STEPPING, &grab->cpu.stepping)) break; - _e_static_grab_int(buf, end, SIBLINGS, &siblings); - break; + if (_e_static_grab_int(buf, end, STEPPING, &grab->cpu.stepping)) break; + _e_static_grab_int(buf, end, SIBLINGS, &siblings); + break; + case 'b': - _e_static_grab_int(buf, end, BOGOMIPS, &grab->cpu.bogo); - break; + _e_static_grab_int(buf, end, BOGOMIPS, &grab->cpu.bogo); + break; + case 'm': - if (_e_static_grab_string(buf, end, MODEL_NAME, &grab->cpu.model_name)) break; - _e_static_grab_int(buf, end, MODEL, &grab->cpu.model); - break; + if (_e_static_grab_string(buf, end, MODEL_NAME, &grab->cpu.model_name)) break; + _e_static_grab_int(buf, end, MODEL, &grab->cpu.model); + break; + case 'v': - _e_static_grab_string(buf, end, VENDOR_ID, &grab->cpu.vendor); - break; + _e_static_grab_string(buf, end, VENDOR_ID, &grab->cpu.vendor); + break; + case 'f': - _e_static_grab_string(buf, end, FPU, &fpu); - break; + _e_static_grab_string(buf, end, FPU, &fpu); + break; } } fclose(f); @@ -242,13 +248,13 @@ _e_static_grab_x(E_Static_Grab *grab) Eina_File *f; f = eina_file_open("/var/log/Xorg.0.log", EINA_FALSE); - if (!f) return ; + if (!f) return; module = calloc(1, sizeof (E_Static_Grab_Module)); if (!module) { eina_file_close(f); - return ; + return; } it = eina_file_map_lines(f); @@ -257,13 +263,13 @@ _e_static_grab_x(E_Static_Grab *grab) const char *current; current = _e_static_grab_discard(line->start, line, '[', ']'); - if (current >= line->end) continue ; + if (current >= line->end) continue; if (!grab->x.name) { - if (line->end - current - 1 <= 0) continue ; + if (line->end - current - 1 <= 0) continue; grab->x.name = eina_stringshare_add_length(current, line->end - current - 1); - continue ; + continue; } if (!in_module) @@ -271,53 +277,53 @@ _e_static_grab_x(E_Static_Grab *grab) switch (*current) { case 'R': - if (_e_static_grab_string(current, line->end, RELEASE_DATE, &grab->x.release_date)) break; - break; + if (_e_static_grab_string(current, line->end, RELEASE_DATE, &grab->x.release_date)) break; + break; case 'B': - if (_e_static_grab_string(current, line->end, BUILD_DATE, &grab->x.build_date)) break; - break; + if (_e_static_grab_string(current, line->end, BUILD_DATE, &grab->x.build_date)) break; + break; case '(': - { - E_Static_Grab_Module *md; - Eina_List *l; - const char *tmp; + { + E_Static_Grab_Module *md; + Eina_List *l; + const char *tmp; - if (_e_static_grab_string(current, line->end, LOAD_MODULE, &module->name)) - { - EINA_LIST_FOREACH(grab->x.modules, l, md) - if (md->name == module->name) - { - eina_stringshare_del(module->name); - module->name = NULL; - break; - } + if (_e_static_grab_string(current, line->end, LOAD_MODULE, &module->name)) + { + EINA_LIST_FOREACH(grab->x.modules, l, md) + if (md->name == module->name) + { + eina_stringshare_del(module->name); + module->name = NULL; + break; + } - if (module->name) in_module = EINA_TRUE; - break; - } - else if (_e_static_grab_string(current, line->end, UNLOAD_MODULE, &tmp)) - { - EINA_LIST_FOREACH(grab->x.modules, l, md) - if (md->name == tmp) - { - grab->x.modules = eina_list_remove_list(grab->x.modules, l); + if (module->name) in_module = EINA_TRUE; + break; + } + else if (_e_static_grab_string(current, line->end, UNLOAD_MODULE, &tmp)) + { + EINA_LIST_FOREACH(grab->x.modules, l, md) + if (md->name == tmp) + { + grab->x.modules = eina_list_remove_list(grab->x.modules, l); - eina_stringshare_del(md->name); - eina_stringshare_del(md->vendor); - eina_stringshare_del(md->compiled_for); - eina_stringshare_del(md->version); - eina_stringshare_del(md->class); - eina_stringshare_del(md->ABI_class); - eina_stringshare_del(md->ABI_version); - free(md); - break; - } - eina_stringshare_del(tmp); - } - break; - } + eina_stringshare_del(md->name); + eina_stringshare_del(md->vendor); + eina_stringshare_del(md->compiled_for); + eina_stringshare_del(md->version); + eina_stringshare_del(md->class); + eina_stringshare_del(md->ABI_class); + eina_stringshare_del(md->ABI_version); + free(md); + break; + } + eina_stringshare_del(tmp); + } + break; + } } } else @@ -328,76 +334,79 @@ _e_static_grab_x(E_Static_Grab *grab) switch (*current) { case '(': - { - const char *vendor; + { + const char *vendor; - if (strncmp(current, LOADING, strlen(LOADING)) == 0) - { - found = EINA_TRUE; - break; - } + if (strncmp(current, LOADING, strlen(LOADING)) == 0) + { + found = EINA_TRUE; + break; + } - buffer = alloca(strlen(MODULE_OF) + strlen(module->name)); - sprintf(buffer, MODULE_OF, module->name); + buffer = alloca(strlen(MODULE_OF) + strlen(module->name)); + sprintf(buffer, MODULE_OF, module->name); + + if (_e_static_grab_string(current, line->end, buffer, &vendor)) + { + if (strncmp(vendor, VENDOR, strlen(VENDOR)) == 0) + { + module->vendor = eina_stringshare_add_length(vendor + strlen(VENDOR), + eina_stringshare_strlen(vendor) - strlen(VENDOR) - 1); + found = EINA_TRUE; + } + eina_stringshare_del(vendor); + } + break; + } - if (_e_static_grab_string(current, line->end, buffer, &vendor)) - { - if (strncmp(vendor, VENDOR, strlen(VENDOR)) == 0) - { - module->vendor = eina_stringshare_add_length(vendor + strlen(VENDOR), - eina_stringshare_strlen(vendor) - strlen(VENDOR) - 1); - found = EINA_TRUE; - } - eina_stringshare_del(vendor); - } - break; - } case 'c': - if (strncmp(current, COMPILED, strlen(COMPILED)) == 0) - { - const char *lookup = current + strlen(COMPILED); + if (strncmp(current, COMPILED, strlen(COMPILED)) == 0) + { + const char *lookup = current + strlen(COMPILED); - while (lookup < line->end && *lookup != ',') - lookup++; + while (lookup < line->end && *lookup != ',') + lookup++; + + module->compiled_for = eina_stringshare_add_length(current + strlen(COMPILED), + lookup - current - strlen(COMPILED)); + found = EINA_TRUE; + break; + } + break; - module->compiled_for = eina_stringshare_add_length(current + strlen(COMPILED), - lookup - current - strlen(COMPILED)); - found = EINA_TRUE; - break; - } - break; case 'M': - if (_e_static_grab_string(current, line->end, MODULE_CLASS, &module->class)) + if (_e_static_grab_string(current, line->end, MODULE_CLASS, &module->class)) + { + found = EINA_TRUE; + break; + } + break; + + case 'A': + { + const char *tmp; + + if (_e_static_grab_string(current, line->end, ABI_CLASS, &tmp)) { - found = EINA_TRUE; - break; + const char *lookup = strchr(tmp, ','); + + if (lookup) + { + module->ABI_class = eina_stringshare_add_length(tmp, lookup - tmp); + if (strncmp(lookup, VERSION, strlen(VERSION)) == 0) + { + module->ABI_version = eina_stringshare_add_length(lookup + strlen(VERSION), + eina_stringshare_strlen(tmp) - (lookup - tmp + strlen(VERSION) - 1)); + } + eina_stringshare_del(tmp); + } + else + { + module->ABI_class = tmp; + } } break; - case 'A': - { - const char *tmp; - - if (_e_static_grab_string(current, line->end, ABI_CLASS, &tmp)) - { - const char *lookup = strchr(tmp, ','); - - if (lookup) - { - module->ABI_class = eina_stringshare_add_length(tmp, lookup - tmp); - if (strncmp(lookup, VERSION, strlen(VERSION)) == 0) - { - module->ABI_version = eina_stringshare_add_length(lookup + strlen(VERSION), - eina_stringshare_strlen(tmp) - (lookup - tmp + strlen(VERSION) - 1)); - } - eina_stringshare_del(tmp); - } - else - { - module->ABI_class = tmp; - } - } - break; - } + } } if (!found) @@ -444,7 +453,7 @@ main(int argc, char **argv EINA_UNUSED) _e_static_grab_x(&grab); fprintf(stderr, "%i core with %i thread running in %i bits at %i bogomips with %i cache from vendor %s with model %s\n", - grab.cpu.core_count, grab.cpu.thread_count, grab.cpu.addr_space * 8, grab.cpu.bogo, grab.cpu.cache_size, grab.cpu.vendor, grab.cpu.model_name); + grab.cpu.core_count, grab.cpu.thread_count, grab.cpu.addr_space * 8, grab.cpu.bogo, grab.cpu.cache_size, grab.cpu.vendor, grab.cpu.model_name); fprintf(stderr, "X Server: '%s' released '%s' and build '%s'\n", grab.x.name, grab.x.release_date, grab.x.build_date); fprintf(stderr, "*** X Modules ***\n"); @@ -463,3 +472,4 @@ main(int argc, char **argv EINA_UNUSED) return 0; } + diff --git a/src/bin/e_stolen.c b/src/bin/e_stolen.c index 4fe0ab8aa..1b58f9a56 100644 --- a/src/bin/e_stolen.c +++ b/src/bin/e_stolen.c @@ -5,7 +5,7 @@ typedef struct _E_Stolen_Window E_Stolen_Window; struct _E_Stolen_Window { Ecore_X_Window win; - int refcount; + int refcount; }; static Eina_Hash *_e_stolen_windows = NULL; @@ -29,15 +29,15 @@ e_stolen_win_add(Ecore_X_Window win) esw = eina_hash_find(_e_stolen_windows, e_util_winid_str_get(win)); if (esw) { - esw->refcount++; + esw->refcount++; } else { - esw = E_NEW(E_Stolen_Window, 1); - esw->win = win; - esw->refcount = 1; - if (!_e_stolen_windows) _e_stolen_windows = eina_hash_string_superfast_new(NULL); - eina_hash_add(_e_stolen_windows, e_util_winid_str_get(win), esw); + esw = E_NEW(E_Stolen_Window, 1); + esw->win = win; + esw->refcount = 1; + if (!_e_stolen_windows) _e_stolen_windows = eina_hash_string_superfast_new(NULL); + eina_hash_add(_e_stolen_windows, e_util_winid_str_get(win), esw); } return; } @@ -50,17 +50,18 @@ e_stolen_win_del(Ecore_X_Window win) esw = eina_hash_find(_e_stolen_windows, e_util_winid_str_get(win)); if (esw) { - esw->refcount--; - if (esw->refcount == 0) - { - eina_hash_del(_e_stolen_windows, e_util_winid_str_get(win), esw); - if (!eina_hash_population(_e_stolen_windows)) - { - eina_hash_free(_e_stolen_windows); - _e_stolen_windows = NULL; - } - free(esw); - } + esw->refcount--; + if (esw->refcount == 0) + { + eina_hash_del(_e_stolen_windows, e_util_winid_str_get(win), esw); + if (!eina_hash_population(_e_stolen_windows)) + { + eina_hash_free(_e_stolen_windows); + _e_stolen_windows = NULL; + } + free(esw); + } } return; } + diff --git a/src/bin/e_sys.c b/src/bin/e_sys.c index 9c4a7eb33..21a91d8b2 100644 --- a/src/bin/e_sys.c +++ b/src/bin/e_sys.c @@ -35,12 +35,12 @@ static E_Obj_Dialog *_e_sys_dialog = NULL; static E_Dialog *_e_sys_logout_confirm_dialog = NULL; static Ecore_Timer *_e_sys_susp_hib_check_timer = NULL; static double _e_sys_susp_hib_check_last_tick = 0.0; -static void (*_e_sys_suspend_func) (void) = NULL; -static void (*_e_sys_hibernate_func) (void) = NULL; -static void (*_e_sys_reboot_func) (void) = NULL; -static void (*_e_sys_shutdown_func) (void) = NULL; -static void (*_e_sys_logout_func) (void) = NULL; -static void (*_e_sys_resume_func) (void) = NULL; +static void (*_e_sys_suspend_func)(void) = NULL; +static void (*_e_sys_hibernate_func)(void) = NULL; +static void (*_e_sys_reboot_func)(void) = NULL; +static void (*_e_sys_shutdown_func)(void) = NULL; +static void (*_e_sys_logout_func)(void) = NULL; +static void (*_e_sys_resume_func)(void) = NULL; static const int E_LOGOUT_AUTO_TIME = 60; static const int E_LOGOUT_WAIT_TIME = 15; @@ -139,6 +139,7 @@ e_sys_action_do(E_Sys_Action a, char *param) } return 1; break; + case E_SYS_REBOOT: if (!e_util_immortal_check()) { @@ -237,12 +238,12 @@ e_sys_con_extra_action_list_get(void) } EAPI void -e_sys_handlers_set(void (*suspend_func) (void), - void (*hibernate_func) (void), - void (*reboot_func) (void), - void (*shutdown_func) (void), - void (*logout_func) (void), - void (*resume_func) (void)) +e_sys_handlers_set(void (*suspend_func)(void), + void (*hibernate_func)(void), + void (*reboot_func)(void), + void (*shutdown_func)(void), + void (*logout_func)(void), + void (*resume_func)(void)) { _e_sys_suspend_func = suspend_func; _e_sys_hibernate_func = hibernate_func; @@ -279,7 +280,7 @@ _e_sys_susp_hib_check(void) if (_e_sys_susp_hib_check_timer) ecore_timer_del(_e_sys_susp_hib_check_timer); _e_sys_susp_hib_check_last_tick = ecore_time_unix_get(); - _e_sys_susp_hib_check_timer = + _e_sys_susp_hib_check_timer = ecore_timer_add(0.1, _e_sys_susp_hib_check_timer_cb, NULL); } @@ -842,9 +843,9 @@ _e_sys_action_do(E_Sys_Action a, char *param __UNUSED__, Eina_Bool raw) { if (e_config->desklock_on_suspend) e_desklock_show(EINA_TRUE); - + _e_sys_susp_hib_check(); - + _e_sys_begin_time = ecore_time_get(); _e_sys_exe = ecore_exe_run(buf, NULL); od = e_obj_dialog_new(e_container_current_get(e_manager_current_get()), @@ -889,7 +890,7 @@ _e_sys_action_do(E_Sys_Action a, char *param __UNUSED__, Eina_Bool raw) { if (e_config->desklock_on_suspend) e_desklock_show(EINA_TRUE); - + _e_sys_susp_hib_check(); _e_sys_begin_time = ecore_time_get(); _e_sys_exe = ecore_exe_run(buf, NULL); @@ -898,9 +899,9 @@ _e_sys_action_do(E_Sys_Action a, char *param __UNUSED__, Eina_Bool raw) { if (e_config->desklock_on_suspend) e_desklock_show(EINA_TRUE); - + _e_sys_susp_hib_check(); - + _e_sys_begin_time = ecore_time_get(); _e_sys_exe = ecore_exe_run(buf, NULL); od = e_obj_dialog_new(e_container_current_get(e_manager_current_get()), @@ -925,7 +926,7 @@ _e_sys_action_do(E_Sys_Action a, char *param __UNUSED__, Eina_Bool raw) } return 1; } - + static void _e_sys_dialog_cb_delete(E_Obj_Dialog *od __UNUSED__) { @@ -934,3 +935,4 @@ _e_sys_dialog_cb_delete(E_Obj_Dialog *od __UNUSED__) * is deleted in some other way. */ _e_sys_dialog = NULL; } + diff --git a/src/bin/e_sys_main.c b/src/bin/e_sys_main.c index 579716e72..6b5aa8633 100644 --- a/src/bin/e_sys_main.c +++ b/src/bin/e_sys_main.c @@ -21,17 +21,17 @@ static Eina_Bool mountopts_check(const char *opts); static Eina_Bool mount_args_check(int argc, char **argv, const char *action); #endif -static int auth_action_ok(char *a, - gid_t gid, - gid_t *gl, - int gn, - gid_t egid); -static int auth_etc_enlightenment_sysactions(char *a, - char *u, - char **g); -static void auth_etc_enlightenment_sysactions_perm(char *path); -static char *get_word(char *s, - char *d); +static int auth_action_ok(char *a, + gid_t gid, + gid_t *gl, + int gn, + gid_t egid); +static int auth_etc_enlightenment_sysactions(char *a, + char *u, + char **g); +static void auth_etc_enlightenment_sysactions_perm(char *path); +static char *get_word(char *s, + char *d); /* local subsystem globals */ static Eina_Hash *actions = NULL; @@ -73,28 +73,28 @@ main(int argc, test = 1; action = argv[2]; } - else if (!strcmp(argv[1], "gdb")) - { - if (argc != 4) exit(1); - char *end = NULL; - - action = argv[1]; - pid = strtoul(argv[2], &end, 10); - if (end == NULL || *end != '\0') + else if (!strcmp(argv[1], "gdb")) { - printf("Invalid pid for '%s'.\n", argv[3]); - exit(0); - } + if (argc != 4) exit(1); + char *end = NULL; - output = argv[3]; - } + action = argv[1]; + pid = strtoul(argv[2], &end, 10); + if (end == NULL || *end != '\0') + { + printf("Invalid pid for '%s'.\n", argv[3]); + exit(0); + } + + output = argv[3]; + } #ifdef HAVE_EEZE_MOUNT else { const char *s; s = strrchr(argv[1], '/'); - if ((!s) || (!s[1])) exit(1); /* eeze always uses complete path */ + if ((!s) || (!s[1])) exit(1); /* eeze always uses complete path */ s++; if (strcmp(s, "mount") && strcmp(s, "umount") && strcmp(s, "eject")) exit(1); mnt = EINA_TRUE; @@ -159,15 +159,15 @@ main(int argc, char buffer[4096]; int r; - snprintf(buffer, 4096, + snprintf(buffer, 4096, "%s --pid=%i " - "-ex 'set logging file %s' " - "-ex 'set logging on' " - "-ex 'thread apply all backtrace full' " - "-ex detach -ex quit > /dev/null 2> /dev/null", + "-ex 'set logging file %s' " + "-ex 'set logging on' " + "-ex 'thread apply all backtrace full' " + "-ex detach -ex quit > /dev/null 2> /dev/null", cmd, - pid, - output); + pid, + output); r = system(buffer); @@ -175,9 +175,9 @@ main(int argc, } if ((!test) #ifdef HAVE_EEZE_MOUNT - && (!mnt) + && (!mnt) #endif - ) + ) return system(cmd); #ifdef HAVE_EEZE_MOUNT if (mnt) @@ -290,36 +290,36 @@ mountopts_check(const char *opts) if (!strncmp(p, OPT, sizeof(OPT) - 1)) CMP("nosuid,") - { - nosuid = EINA_TRUE; - continue; - } + { + nosuid = EINA_TRUE; + continue; + } CMP("nodev,") - { - nodev = EINA_TRUE; - continue; - } + { + nodev = EINA_TRUE; + continue; + } CMP("noexec,") - { - noexec = EINA_TRUE; - continue; - } + { + noexec = EINA_TRUE; + continue; + } CMP("utf8,") continue; CMP("utf8=0,") continue; CMP("utf8=1,") continue; CMP("iocharset=utf8,") continue; CMP("uid=") - { - p += 4; - errno = 0; - muid = strtoul(p, &end, 10); - if (muid == ULONG_MAX) return EINA_FALSE; - if (errno) return EINA_FALSE; - if (end[0] != ',') return EINA_FALSE; - if (muid != uid) return EINA_FALSE; - nuid = EINA_TRUE; - continue; - } + { + p += 4; + errno = 0; + muid = strtoul(p, &end, 10); + if (muid == ULONG_MAX) return EINA_FALSE; + if (errno) return EINA_FALSE; + if (end[0] != ',') return EINA_FALSE; + if (muid != uid) return EINA_FALSE; + nuid = EINA_TRUE; + continue; + } return EINA_FALSE; } if ((!nosuid) || (!nodev) || (!noexec) || (!nuid)) return EINA_FALSE; @@ -347,7 +347,7 @@ mount_args_check(int argc, char **argv, const char *action) if (!strcmp(action, "mount")) { /* will ALWAYS be: - /path/to/mount -o nosuid,uid=XYZ,[utf8,] UUID=XXXX-XXXX[-XXXX-XXXX] /media/$devnode + /path/to/mount -o nosuid,uid=XYZ,[utf8,] UUID=XXXX-XXXX[-XXXX-XXXX] /media/$devnode */ if (argc != 6) return EINA_FALSE; if (argv[2][0] == '-') @@ -366,7 +366,7 @@ mount_args_check(int argc, char **argv, const char *action) if (strncmp(argv[4], "/dev/", 5)) return EINA_FALSE; if (stat(argv[4], &st)) return EINA_FALSE; } - + node = strrchr(argv[5], '/'); if (!node) return EINA_FALSE; if (!node[1]) return EINA_FALSE; @@ -377,7 +377,7 @@ mount_args_check(int argc, char **argv, const char *action) else if (!strcmp(action, "umount")) { /* will ALWAYS be: - /path/to/umount /dev/$devnode + /path/to/umount /dev/$devnode */ if (argc != 3) return EINA_FALSE; if (strncmp(argv[2], "/dev/", 5)) return EINA_FALSE; @@ -388,16 +388,16 @@ mount_args_check(int argc, char **argv, const char *action) if (node - argv[2] != 4) return EINA_FALSE; /* this is good, but it prevents umounting user-mounted removable media; * need to figure out a better way... - * - snprintf(buf, sizeof(buf), "/media%s", node); - if (stat(buf, &st)) return EINA_FALSE; - if (!S_ISDIR(st.st_mode)) return EINA_FALSE; - */ + * + snprintf(buf, sizeof(buf), "/media%s", node); + if (stat(buf, &st)) return EINA_FALSE; + if (!S_ISDIR(st.st_mode)) return EINA_FALSE; + */ } else if (!strcmp(action, "eject")) { /* will ALWAYS be: - /path/to/eject /dev/$devnode + /path/to/eject /dev/$devnode */ if (argc != 3) return EINA_FALSE; if (strncmp(argv[2], "/dev/", 5)) return EINA_FALSE; @@ -410,6 +410,7 @@ mount_args_check(int argc, char **argv, const char *action) else return EINA_FALSE; return EINA_TRUE; } + #endif static int @@ -539,7 +540,8 @@ auth_etc_enlightenment_sysactions(char *a, } else if (!strcmp(id, "action:")) { - while ((*pp) && (isspace(*pp))) pp++; + while ((*pp) && (isspace(*pp))) + pp++; s = eina_hash_find(actions, ugname); if (s) eina_hash_del(actions, ugname, s); if (!actions) actions = eina_hash_string_superfast_new(free); @@ -617,3 +619,4 @@ get_word(char *s, *p2 = 0; return p1; } + diff --git a/src/bin/e_test.c b/src/bin/e_test.c index 9bdaab8b6..030bbbfe5 100644 --- a/src/bin/e_test.c +++ b/src/bin/e_test.c @@ -11,10 +11,10 @@ e_test(void) EINA_LIST_FOREACH(e_manager_list(), l, man) { - EINA_LIST_FOREACH(man->containers, ll, con) - { - _e_test_internal(con); - } + EINA_LIST_FOREACH(man->containers, ll, con) + { + _e_test_internal(con); + } } } @@ -29,20 +29,20 @@ _e_test_timer(void *data) m = data; if (m) { - e_menu_deactivate(m); - e_object_del(E_OBJECT(m)); - ecore_timer_add(0.05, _e_test_timer, NULL); - return 0; + e_menu_deactivate(m); + e_object_del(E_OBJECT(m)); + ecore_timer_add(0.05, _e_test_timer, NULL); + return 0; } managers = e_manager_list(); EINA_LIST_FOREACH(managers, l, man) { - m = e_int_menus_main_new(); - e_menu_activate_mouse(m, - e_container_zone_number_get(e_container_current_get(man), 0), - 0, 0, 1, 1, E_MENU_POP_DIRECTION_DOWN, 0); - ecore_timer_add(0.05, _e_test_timer, m); - return 0; + m = e_int_menus_main_new(); + e_menu_activate_mouse(m, + e_container_zone_number_get(e_container_current_get(man), 0), + 0, 0, 1, 1, E_MENU_POP_DIRECTION_DOWN, 0); + ecore_timer_add(0.05, _e_test_timer, m); + return 0; } return 0; } @@ -52,6 +52,7 @@ _e_test_internal(E_Container *con) { _e_test_timer(NULL); } + #elif 0 static void _e_test_resize(E_Win *win) @@ -94,6 +95,7 @@ _e_test_internal(E_Container *con) win->data = o; } + #elif 0 static int _e_test_timer(void *data) @@ -117,13 +119,14 @@ _e_test_internal(E_Container *con) EINA_LIST_FOREACH(e_manager_list(), l, man) { - m = e_int_menus_main_new(); - e_menu_activate_mouse(m, - e_container_zone_number_get(e_container_current_get(man), 0), - 0, 0, 1, 1, E_MENU_POP_DIRECTION_DOWN, 0); - ecore_timer_add(0.02, _e_test_timer, m); + m = e_int_menus_main_new(); + e_menu_activate_mouse(m, + e_container_zone_number_get(e_container_current_get(man), 0), + 0, 0, 1, 1, E_MENU_POP_DIRECTION_DOWN, 0); + ecore_timer_add(0.02, _e_test_timer, m); } } + #elif 0 static void _e_test_dialog_del(void *obj) @@ -150,6 +153,7 @@ _e_test_internal(E_Container *con) e_win_centered_set(dia->win, 1); e_dialog_show(dia); } + #elif 0 static void _e_test_click(void *data, Evas *e, Evas_Object *obj, void *event_info) @@ -198,6 +202,7 @@ _e_test_internal(E_Container *con) evas_object_focus_set(o, 1); } + #elif 0 static E_Dialog * _e_test_dia(E_Container *con) @@ -217,14 +222,14 @@ _e_test_timer(void *data) if (data == NULL) { - dia = _e_test_dia(tcon); - ecore_timer_add(0.2, _e_test_timer, dia); + dia = _e_test_dia(tcon); + ecore_timer_add(0.2, _e_test_timer, dia); } else { - dia = data; - e_object_del(E_OBJECT(dia)); - ecore_timer_add(0.2, _e_test_timer, NULL); + dia = data; + e_object_del(E_OBJECT(dia)); + ecore_timer_add(0.2, _e_test_timer, NULL); } return 0; } @@ -235,6 +240,7 @@ _e_test_internal(E_Container *con) tcon = con; _e_test_timer(NULL); } + #elif 0 struct _tmp @@ -263,7 +269,7 @@ _e_test_resize(void *data, Evas *e, Evas_Object *obj, void *event_info) evas_object_geometry_get(data, NULL, NULL, &w, &h); if (vw >= mw) { - if (w != vw) evas_object_resize(data, vw, h); + if (w != vw) evas_object_resize(data, vw, h); } } @@ -284,7 +290,7 @@ _e_test_internal(E_Container *con) e_livethumb_vsize_set(o3, 160, 96); o4 = edje_object_add(e_livethumb_evas_get(o3)); e_theme_edje_object_set(o4, "base/theme/borders", - "e/widgets/border/default/border"); + "e/widgets/border/default/border"); e_livethumb_thumb_set(o3, o4); e_ilist_append(o, o3, "Item 1", 0, _e_test_sel, NULL, NULL, NULL); @@ -347,6 +353,7 @@ _e_test_internal(E_Container *con) evas_object_focus_set(o, 1); } + #elif 0 static void _e_test_cb_e_smart_pan_changed_hook(void *data, Evas_Object *obj, void *event_info) @@ -381,6 +388,7 @@ _e_test_internal(E_Container *con) evas_object_focus_set(o, 1); } + #elif 0 static void _e_test_internal(E_Container *con) @@ -395,27 +403,27 @@ _e_test_internal(E_Container *con) o = e_widget_textblock_add(dia->win->evas); #if 0 e_widget_textblock_markup_set(o, - "A title" - "This is some text
" - "Blah blah
" - "hilighted text
" - "
" - "More lines of text
" - "And yet more lines of text
" - "A very very long line of text that SHOULD be getting word wrapped because it is so long.
" - "And another line
" - "Some more
" - "Smelly fish on a stick
" - "Whatever." - ); + "A title" + "This is some text
" + "Blah blah
" + "hilighted text
" + "
" + "More lines of text
" + "And yet more lines of text
" + "A very very long line of text that SHOULD be getting word wrapped because it is so long.
" + "And another line
" + "Some more
" + "Smelly fish on a stick
" + "Whatever." + ); #else e_widget_textblock_plain_set(o, - "And here is some plaintext\n" - "with some newlines & other special characters\n" - "that should get escaped like < and >.\n" - "\n" - "\tTabs should become 8 spaces too.\n" - ); + "And here is some plaintext\n" + "with some newlines & other special characters\n" + "that should get escaped like < and >.\n" + "\n" + "\tTabs should become 8 spaces too.\n" + ); #endif evas_object_show(o); @@ -427,6 +435,7 @@ _e_test_internal(E_Container *con) evas_object_focus_set(o, 1); } + #elif 0 static void _e_test_cb_button(void *data1, void *data2) @@ -476,19 +485,19 @@ _e_test_cb_favorites_files_changed(void *data, Evas_Object *obj, void *event_inf if (!p1) goto done; EINA_LIST_FOREACH(icons, l, ici) { - if (ici->link) - { - p2 = ecore_file_realpath(ici->link); - if (!strcmp(p1, p2)) - { - e_fm2_select_set(obj, ici->file); - E_FREE(p2); - goto done; - } - E_FREE(p2); - } + if (ici->link) + { + p2 = ecore_file_realpath(ici->link); + if (!strcmp(p1, p2)) + { + e_fm2_select_set(obj, ici->file); + E_FREE(p2); + goto done; + } + E_FREE(p2); + } } - done: +done: E_FREE(p1); eina_list_free(icons); } @@ -537,14 +546,14 @@ _e_test_internal(E_Container *con) e_fm2_path_set(ofm, "~/", "/"); ob = e_widget_button_add(dia->win->evas, "Up a directory", NULL, - _e_test_cb_button, ofm, NULL); + _e_test_cb_button, ofm, NULL); e_widget_table_object_append(ot, ob, 1, 0, 1, 1, 0, 0, 1, 0); evas_object_show(ob); evas_object_smart_callback_add(ofm, "changed", _e_test_cb_changed, ob); evas_object_smart_callback_add(ofm, "selected", _e_test_cb_selected, NULL); of = e_widget_scrollframe_pan_add(dia->win->evas, ofm, - e_fm2_pan_set, e_fm2_pan_get, - e_fm2_pan_max_get, e_fm2_pan_child_size_get); + e_fm2_pan_set, e_fm2_pan_get, + e_fm2_pan_max_get, e_fm2_pan_child_size_get); e_widget_size_min_set(of, 128, 128); e_widget_table_object_append(ot, of, 1, 1, 1, 1, 1, 1, 1, 1); evas_object_show(ofm); @@ -578,8 +587,8 @@ _e_test_internal(E_Container *con) evas_object_smart_callback_add(ofm, "files_changed", _e_test_cb_favorites_files_changed, ofm2); evas_object_smart_callback_add(ofm, "selected", _e_test_cb_favorites_selected, ofm2); of = e_widget_scrollframe_pan_add(dia->win->evas, ofm, - e_fm2_pan_set, e_fm2_pan_get, - e_fm2_pan_max_get, e_fm2_pan_child_size_get); + e_fm2_pan_set, e_fm2_pan_get, + e_fm2_pan_max_get, e_fm2_pan_child_size_get); e_widget_size_min_set(of, 128, 128); e_widget_table_object_append(ot, of, 0, 1, 1, 1, 0, 1, 0, 1); evas_object_show(ofm); @@ -596,8 +605,8 @@ _e_test_internal(E_Container *con) e_win_centered_set(dia->win, 1); e_dialog_show(dia); e_win_resize(dia->win, 400, 300); - } + #elif 0 static void _e_test_cb_changed(void *data, Evas_Object *obj) @@ -623,8 +632,8 @@ _e_test_internal(E_Container *con) e_dialog_title_set(dia, "A Test Dialog"); o = e_widget_fsel_add(dia->win->evas, "~/", "/tst", NULL, NULL, - _e_test_cb_selected, dia, - _e_test_cb_changed, dia, 0); + _e_test_cb_selected, dia, + _e_test_cb_changed, dia, 0); evas_object_show(o); e_widget_size_min_get(o, &mw, &mh); e_dialog_content_set(dia, o, mw, mh); @@ -635,8 +644,8 @@ _e_test_internal(E_Container *con) e_win_centered_set(dia->win, 1); e_dialog_show(dia); e_win_resize(dia->win, 400, 300); - } + #elif 0 static void @@ -674,36 +683,36 @@ _e_test_internal(E_Container *con) for (i = 0; i < 8; i++) { - o = e_slidesel_add(dia->win->evas); - e_slidesel_item_distance_set(o, 64); - e_slidesel_item_add(o, "blah / item 1", - "/home/raster/pix/OLD/Download/Crystalline____a.jpg", - NULL, NULL); - e_slidesel_item_add(o, "blah / smelly fish", - "/home/raster/pix/OLD/Download/Reluctant_Sunrise.jpg", - NULL, NULL); - e_slidesel_item_add(o, "blah / pong", - "/home/raster/pix/OLD/Download/Soft_Wings.jpg", - NULL, NULL); - e_slidesel_item_add(o, "blah / on a stick", - "/home/raster/pix/OLD/Download/Stock_rose_1.jpg", - NULL, NULL); - e_slidesel_item_add(o, "blah / oath", - "/home/raster/pix/OLD/Download/The_Eyes_Of_A_Killer.jpg", - NULL, NULL); - e_slidesel_item_add(o, "blah / yiiihaaaaa", - "/home/raster/pix/OLD/Download/lady_bug.jpg", - NULL, NULL); - e_slidesel_item_add(o, "blah / blah blah blah", - "/home/raster/pix/OLD/Download/ocean_rocks_covered_by_ash.jpg", - NULL, NULL); - e_slidesel_item_add(o, "blah / bing bing bing", - "/home/raster/pix/OLD/Download/orange_chair_heaven_falling.jpg", - NULL, NULL); + o = e_slidesel_add(dia->win->evas); + e_slidesel_item_distance_set(o, 64); + e_slidesel_item_add(o, "blah / item 1", + "/home/raster/pix/OLD/Download/Crystalline____a.jpg", + NULL, NULL); + e_slidesel_item_add(o, "blah / smelly fish", + "/home/raster/pix/OLD/Download/Reluctant_Sunrise.jpg", + NULL, NULL); + e_slidesel_item_add(o, "blah / pong", + "/home/raster/pix/OLD/Download/Soft_Wings.jpg", + NULL, NULL); + e_slidesel_item_add(o, "blah / on a stick", + "/home/raster/pix/OLD/Download/Stock_rose_1.jpg", + NULL, NULL); + e_slidesel_item_add(o, "blah / oath", + "/home/raster/pix/OLD/Download/The_Eyes_Of_A_Killer.jpg", + NULL, NULL); + e_slidesel_item_add(o, "blah / yiiihaaaaa", + "/home/raster/pix/OLD/Download/lady_bug.jpg", + NULL, NULL); + e_slidesel_item_add(o, "blah / blah blah blah", + "/home/raster/pix/OLD/Download/ocean_rocks_covered_by_ash.jpg", + NULL, NULL); + e_slidesel_item_add(o, "blah / bing bing bing", + "/home/raster/pix/OLD/Download/orange_chair_heaven_falling.jpg", + NULL, NULL); - e_box_pack_end(ob, o); - e_box_pack_options_set(o, 1, 1, 1, 0, 0.5, 0.5, 300, 100, 300, 100); - evas_object_show(o); + e_box_pack_end(ob, o); + e_box_pack_options_set(o, 1, 1, 1, 0, 0.5, 0.5, 300, 100, 300, 100); + evas_object_show(o); } /* fixme... more */ @@ -723,7 +732,6 @@ _e_test_internal(E_Container *con) e_win_centered_set(dia->win, 1); e_dialog_show(dia); e_win_resize(dia->win, 400, 400); - } static void @@ -996,4 +1004,5 @@ static void _e_test_internal(E_Container *con __UNUSED__) { } + #endif diff --git a/src/bin/e_theme.c b/src/bin/e_theme.c index 933ab4596..a9fc886a6 100644 --- a/src/bin/e_theme.c +++ b/src/bin/e_theme.c @@ -15,8 +15,8 @@ static Eina_Bool _e_theme_mappings_quickfind_free_cb(const Eina_Hash *hash, con static void _e_theme_category_register(const char *category); static Eina_List *_e_theme_collection_item_register(Eina_List *list, const char *name); static Eina_List *_e_theme_collection_items_find(const char *base, const char *collname); -static void e_theme_handler_set(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *path); -static int e_theme_handler_test(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *path); +static void e_theme_handler_set(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *path); +static int e_theme_handler_test(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *path); /* local subsystem globals */ static Eina_Hash *mappings = NULL; @@ -85,9 +85,9 @@ e_theme_shutdown(void) return 1; } -/** - * Assigns a edje group from the current theme to - * a recently created edje object +/** + * Assigns a edje group from the current theme to + * a recently created edje object * * @param o edje object to assign group to * @param category that hold the required edj file diff --git a/src/bin/e_theme_about.c b/src/bin/e_theme_about.c index 1cc689414..f431e2727 100644 --- a/src/bin/e_theme_about.c +++ b/src/bin/e_theme_about.c @@ -5,10 +5,10 @@ static void _cb_settings_theme(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) { E_Obj_Dialog *od = data; - + e_configure_registry_call("appearance/theme", od->win->container, NULL); } - + /* local subsystem globals */ /* externally accessible functions */ @@ -23,7 +23,7 @@ e_theme_about_new(E_Container *con) e_obj_dialog_obj_theme_set(od, "base/theme", "e/theme/about"); e_obj_dialog_obj_part_text_set(od, "e.text.label", _("Close")); e_obj_dialog_obj_part_text_set(od, "e.text.theme", _("Select Theme")); - edje_object_signal_callback_add(od->bg_object, + edje_object_signal_callback_add(od->bg_object, "e,action,settings,theme", "", _cb_settings_theme, od); return (E_Theme_About *)od; @@ -35,3 +35,4 @@ e_theme_about_show(E_Theme_About *about) e_obj_dialog_show((E_Obj_Dialog *)about); e_obj_dialog_icon_set((E_Obj_Dialog *)about, "preferences-desktop-theme"); } + diff --git a/src/bin/e_thumb_main.c b/src/bin/e_thumb_main.c index 92663cba7..1851533dc 100644 --- a/src/bin/e_thumb_main.c +++ b/src/bin/e_thumb_main.c @@ -442,17 +442,17 @@ _e_thumb_generate(E_Thumb *eth) #define G(v) (((v) >> 8) & 0xff) #define B(v) (((v)) & 0xff) #define HSV(p) \ -evas_color_rgb_to_hsv(R(p), G(p), B(p), &h, &s, &v); \ -hi = 20 * (h / 360.0); \ -si = 20 * s; \ -vi = 20 * v; \ -if (si < 2) hi = 25; + evas_color_rgb_to_hsv(R(p), G(p), B(p), &h, &s, &v); \ + hi = 20 * (h / 360.0); \ + si = 20 * s; \ + vi = 20 * v; \ + if (si < 2) hi = 25; #define SAVEHSV(h, s, v) \ -id2[n++] = 'a' + h; \ -id2[n++] = 'a' + v; \ -id2[n++] = 'a' + s; + id2[n++] = 'a' + h; \ + id2[n++] = 'a' + v; \ + id2[n++] = 'a' + s; #define SAVEX(x) \ -id2[n++] = 'a' + x; + id2[n++] = 'a' + x; #if 0 HSV(data3[0]); SAVEHSV(hi, si, vi); diff --git a/src/bin/e_toolbar.c b/src/bin/e_toolbar.c index 9e0920ee0..adbc3cd9e 100644 --- a/src/bin/e_toolbar.c +++ b/src/bin/e_toolbar.c @@ -173,17 +173,17 @@ _e_toolbar_free(E_Toolbar *tbar) toolbars = eina_list_remove(toolbars, tbar); evas_object_smart_callback_del_full(tbar->fm2, "changed", - _e_toolbar_fm2_changed, tbar); + _e_toolbar_fm2_changed, tbar); evas_object_smart_callback_del_full(tbar->fm2, "dir_changed", - _e_toolbar_fm2_dir_changed, tbar); + _e_toolbar_fm2_dir_changed, tbar); evas_object_smart_callback_del_full(tbar->fm2, "dir_deleted", - _e_toolbar_fm2_dir_deleted, tbar); + _e_toolbar_fm2_dir_deleted, tbar); evas_object_smart_callback_del_full(tbar->fm2, "files_deleted", - _e_toolbar_fm2_files_deleted, tbar); + _e_toolbar_fm2_files_deleted, tbar); evas_object_smart_callback_del_full(tbar->fm2, "selected", - _e_toolbar_fm2_selected, tbar); + _e_toolbar_fm2_selected, tbar); evas_object_smart_callback_del_full(tbar->fm2, "selection_change", - _e_toolbar_fm2_selection_changed, tbar); + _e_toolbar_fm2_selection_changed, tbar); if (tbar->menu) { e_menu_post_deactivate_callback_set(tbar->menu, NULL, NULL); @@ -332,11 +332,13 @@ _e_toolbar_gadcon_size_request(void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coor w = ww; h = 32; break; + case E_GADCON_ORIENT_LEFT: case E_GADCON_ORIENT_RIGHT: w = 32; h = hh; break; + default: break; } diff --git a/src/bin/e_update.c b/src/bin/e_update.c index 68bb61a62..b9a059749 100644 --- a/src/bin/e_update.c +++ b/src/bin/e_update.c @@ -1,10 +1,10 @@ #include "e.h" static Ecore_Con_Url *url_up = NULL; -static Eina_List *handlers = NULL; -static Ecore_Timer *update_timer = NULL; -static E_Dialog *dialog = NULL; -static char *machid = NULL; +static Eina_List *handlers = NULL; +static Ecore_Timer *update_timer = NULL; +static E_Dialog *dialog = NULL; +static char *machid = NULL; static void _update_done(void) @@ -251,13 +251,13 @@ e_update_init(void) if (ecore_con_url_init()) { handlers = eina_list_append - (handlers, ecore_event_handler_add + (handlers, ecore_event_handler_add (ECORE_CON_EVENT_URL_DATA, _upload_data_cb, NULL)); handlers = eina_list_append - (handlers, ecore_event_handler_add + (handlers, ecore_event_handler_add (ECORE_CON_EVENT_URL_PROGRESS, _upload_progress_cb, NULL)); handlers = eina_list_append - (handlers, ecore_event_handler_add + (handlers, ecore_event_handler_add (ECORE_CON_EVENT_URL_COMPLETE, _upload_complete_cb, NULL)); if (e_config->update.check) { @@ -292,3 +292,4 @@ e_update_shutdown(void) } return 1; } + diff --git a/src/bin/e_user.c b/src/bin/e_user.c index 96a522e62..801decc89 100644 --- a/src/bin/e_user.c +++ b/src/bin/e_user.c @@ -1,6 +1,5 @@ #include "e.h" - static const char *_e_user_homedir = NULL; static size_t _e_user_homedir_len = 0; @@ -16,17 +15,17 @@ e_user_homedir_get(void) _e_user_homedir = d = getenv("HOME"); if (!_e_user_homedir) { - _e_user_homedir = "/tmp"; - _e_user_homedir_len = sizeof("/tmp") - 1; - return _e_user_homedir; + _e_user_homedir = "/tmp"; + _e_user_homedir_len = sizeof("/tmp") - 1; + return _e_user_homedir; } _e_user_homedir_len = strlen(_e_user_homedir); while ((_e_user_homedir_len > 1) && - (d[_e_user_homedir_len - 1] == '/')) + (d[_e_user_homedir_len - 1] == '/')) { - _e_user_homedir_len--; - d[_e_user_homedir_len] = '\0'; + _e_user_homedir_len--; + d[_e_user_homedir_len] = '\0'; } return _e_user_homedir; } @@ -71,14 +70,14 @@ e_user_homedir_snprintf(char *dst, size_t size, const char *fmt, ...) off = _e_user_homedir_len + 1; if (size < _e_user_homedir_len + 2) { - if (size > 1) - { - memcpy(dst, _e_user_homedir, size - 1); - dst[size - 1] = '\0'; - } - ret = off + vsnprintf(dst + off, size - off, fmt, ap); - va_end(ap); - return ret; + if (size > 1) + { + memcpy(dst, _e_user_homedir, size - 1); + dst[size - 1] = '\0'; + } + ret = off + vsnprintf(dst + off, size - off, fmt, ap); + va_end(ap); + return ret; } memcpy(dst, _e_user_homedir, _e_user_homedir_len); @@ -135,17 +134,17 @@ e_user_dir_get(void) if (!dir[0]) { - char *e_home = getenv("E_HOME"); - if (e_home) - { - snprintf(buf, sizeof(buf), "%s/e", e_home); - } - else - { - snprintf(buf, sizeof(buf), ".e/e"); - } - _e_user_dir_len = e_user_homedir_concat(dir, sizeof(dir), buf); - _e_user_dir = dir; + char *e_home = getenv("E_HOME"); + if (e_home) + { + snprintf(buf, sizeof(buf), "%s/e", e_home); + } + else + { + snprintf(buf, sizeof(buf), ".e/e"); + } + _e_user_dir_len = e_user_homedir_concat(dir, sizeof(dir), buf); + _e_user_dir = dir; } return dir; @@ -191,14 +190,14 @@ e_user_dir_snprintf(char *dst, size_t size, const char *fmt, ...) off = _e_user_dir_len + 1; if (size < _e_user_dir_len + 2) { - if (size > 1) - { - memcpy(dst, _e_user_dir, size - 1); - dst[size - 1] = '\0'; - } - ret = off + vsnprintf(dst + off, size - off, fmt, ap); - va_end(ap); - return ret; + if (size > 1) + { + memcpy(dst, _e_user_dir, size - 1); + dst[size - 1] = '\0'; + } + ret = off + vsnprintf(dst + off, size - off, fmt, ap); + va_end(ap); + return ret; } memcpy(dst, _e_user_dir, _e_user_dir_len); @@ -208,3 +207,4 @@ e_user_dir_snprintf(char *dst, size_t size, const char *fmt, ...) va_end(ap); return ret; } + diff --git a/src/bin/e_utils.c b/src/bin/e_utils.c index 0651fc275..f57cdbef6 100644 --- a/src/bin/e_utils.c +++ b/src/bin/e_utils.c @@ -1,13 +1,13 @@ #include "e.h" -EAPI E_Path *path_data = NULL; -EAPI E_Path *path_images = NULL; -EAPI E_Path *path_fonts = NULL; -EAPI E_Path *path_themes = NULL; -EAPI E_Path *path_icons = NULL; -EAPI E_Path *path_modules = NULL; -EAPI E_Path *path_backgrounds = NULL; -EAPI E_Path *path_messages = NULL; +EAPI E_Path * path_data = NULL; +EAPI E_Path * path_images = NULL; +EAPI E_Path * path_fonts = NULL; +EAPI E_Path * path_themes = NULL; +EAPI E_Path * path_icons = NULL; +EAPI E_Path * path_modules = NULL; +EAPI E_Path * path_backgrounds = NULL; +EAPI E_Path * path_messages = NULL; /* local subsystem functions */ static Eina_Bool _e_util_cb_delayed_del(void *data); @@ -579,7 +579,7 @@ static int _e_util_layer_map(int layer) { int pos = 0; - + if (layer < 0) layer = 0; pos = 1 + (layer / 50); if (pos > 10) pos = 10; @@ -1356,16 +1356,16 @@ e_util_size_debug_set(Evas_Object *obj, Eina_Bool enable) { if (enable) { - evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, + evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _e_util_size_debug, NULL); - evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, + evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _e_util_size_debug, NULL); } else { - evas_object_event_callback_del_full(obj, EVAS_CALLBACK_MOVE, + evas_object_event_callback_del_full(obj, EVAS_CALLBACK_MOVE, _e_util_size_debug, NULL); - evas_object_event_callback_del_full(obj, EVAS_CALLBACK_RESIZE, + evas_object_event_callback_del_full(obj, EVAS_CALLBACK_RESIZE, _e_util_size_debug, NULL); } } @@ -1376,7 +1376,7 @@ _e_util_default_terminal_get(const char *defaults_list) Efreet_Desktop *tdesktop = NULL; Efreet_Ini *ini; const char *s; - + ini = efreet_ini_new(defaults_list); if ((ini) && (ini->data) && (efreet_ini_section_set(ini, "Default Applications")) && @@ -1393,14 +1393,14 @@ EAPI Efreet_Desktop * e_util_terminal_desktop_get(void) { const char *terms[] = - { - "terminology.desktop", - "xterm.desktop", - "rxvt.desktop", - "gnome-terminal.desktop", - "konsole.desktop", - NULL - }; + { + "terminology.desktop", + "xterm.desktop", + "rxvt.desktop", + "gnome-terminal.desktop", + "konsole.desktop", + NULL + }; const char *s; char buf[PATH_MAX]; Efreet_Desktop *tdesktop = NULL, *td; @@ -1420,7 +1420,7 @@ e_util_terminal_desktop_get(void) tdesktop = _e_util_default_terminal_get(buf); if (tdesktop) return tdesktop; } - + for (i = 0; terms[i]; i++) { tdesktop = efreet_util_desktop_file_id_find(terms[i]); @@ -1443,7 +1443,6 @@ e_util_terminal_desktop_get(void) return tdesktop; } - EAPI E_Config_Binding_Key * e_util_binding_match(const Eina_List *bindlist, Ecore_Event_Key *ev, unsigned int *num, const E_Config_Binding_Key *skip) { @@ -1465,7 +1464,7 @@ e_util_binding_match(const Eina_List *bindlist, Ecore_Event_Key *ev, unsigned in if (ev->modifiers & ECORE_X_LOCK_NUM) mod |= ECORE_X_LOCK_NUM; */ - EINA_LIST_FOREACH(bindlist ?: e_config->key_bindings, l, bi) + EINA_LIST_FOREACH(bindlist ? : e_config->key_bindings, l, bi) { if (bi != skip) { @@ -1596,7 +1595,6 @@ e_util_gadcon_orient_menu_item_icon_set(E_Gadcon_Orient orient, E_Menu_Item *mi) } } - EAPI char * e_util_string_append_char(char *str, size_t *size, size_t *len, char c) { @@ -1612,7 +1610,7 @@ e_util_string_append_char(char *str, size_t *size, size_t *len, char c) if (*len >= *size - 1) { char *str2; - + *size += 1024; str2 = realloc(str, *size); if (!str2) @@ -1663,3 +1661,4 @@ e_util_string_append_quoted(char *str, size_t *size, size_t *len, const char *sr return str; } + diff --git a/src/bin/e_widget_aspect.c b/src/bin/e_widget_aspect.c index b68efef1b..07d0c7dd3 100644 --- a/src/bin/e_widget_aspect.c +++ b/src/bin/e_widget_aspect.c @@ -7,9 +7,9 @@ struct _E_Widget_Data Evas_Object *obj; Evas_Object *child; - int aspect_w, aspect_h; - int aspect_preference; - double align_x, align_y; + int aspect_w, aspect_h; + int aspect_preference; + double align_x, align_y; }; static void @@ -36,21 +36,21 @@ _e_wid_reconfigure(E_Widget_Data *wd) if (ph == 0) { - evas_object_resize(wd->child, 0, 0); - return ; + evas_object_resize(wd->child, 0, 0); + return; } ap = (double)pw / ph; ad = (double)(wd->aspect_w) / wd->aspect_h; if (ap >= ad) { - ch = ph; - cw = (ch * wd->aspect_w) / wd->aspect_h; + ch = ph; + cw = (ch * wd->aspect_w) / wd->aspect_h; } else { - cw = pw; - ch = (cw * wd->aspect_h) / wd->aspect_w; + cw = pw; + ch = (cw * wd->aspect_h) / wd->aspect_w; } cx = px + (wd->align_x * (pw - cw)); @@ -134,3 +134,4 @@ e_widget_aspect_child_set(Evas_Object *obj, Evas_Object *child) e_widget_sub_object_add(obj, child); _e_wid_reconfigure(wd); } + diff --git a/src/bin/e_widget_button.c b/src/bin/e_widget_button.c index 960c319b9..fd3045121 100644 --- a/src/bin/e_widget_button.c +++ b/src/bin/e_widget_button.c @@ -212,3 +212,4 @@ _e_wid_button_state_send(E_Widget_Data *wd) edje_object_signal_emit(wd->o_button, "e,state,icon", "e"); edje_object_message_signal_process(wd->o_button); } + diff --git a/src/bin/e_widget_check.c b/src/bin/e_widget_check.c index 133cc9676..6d7d23179 100644 --- a/src/bin/e_widget_check.c +++ b/src/bin/e_widget_check.c @@ -20,7 +20,7 @@ static void _e_wid_focus_steal(void *data, Evas *e, Evas_Object *obj, void *even /* externally accessible functions */ -/** +/** * Creates a check box widget * * @param evas pointer @@ -66,7 +66,7 @@ e_widget_check_add(Evas *evas, const char *label, int *val) return obj; } -/** +/** * Sets the value of the check box * * @param check the check box widget @@ -86,7 +86,7 @@ e_widget_check_checked_set(Evas_Object *check, int checked) edje_object_signal_emit(wd->o_check, "e,state,unchecked", "e"); } -/** +/** * Sets the value of the check box * * @param check the check box widget @@ -108,8 +108,8 @@ e_widget_check_valptr_set(Evas_Object *check, int *val) edje_object_signal_emit(wd->o_check, "e,state,unchecked", "e"); } -/** - *Get the value of the check box +/** + * Get the value of the check box * * @param check the check box widget * @return the value of the check box @@ -129,7 +129,7 @@ e_widget_check_checked_get(Evas_Object *check) return ret; } -/** +/** * Creates a check box widget with icon * * @param evas pointer diff --git a/src/bin/e_widget_color_well.c b/src/bin/e_widget_color_well.c index 32d72d248..31ce38385 100644 --- a/src/bin/e_widget_color_well.c +++ b/src/bin/e_widget_color_well.c @@ -3,15 +3,15 @@ typedef struct _E_Widget_Data E_Widget_Data; struct _E_Widget_Data { - Evas_Object *obj; - Evas_Object *o_edje; - Evas_Object *o_rect; + Evas_Object *obj; + Evas_Object *o_edje; + Evas_Object *o_rect; E_Color_Dialog *dia; - E_Color *color; - E_Container *con; /* container to pop a color dialog up on */ - Eina_Bool show_color_dialog; - Eina_Bool alpha_enabled; + E_Color *color; + E_Container *con; /* container to pop a color dialog up on */ + Eina_Bool show_color_dialog; + Eina_Bool alpha_enabled; }; static void _e_wid_update(E_Widget_Data *wd); @@ -27,10 +27,10 @@ _e_wid_update(E_Widget_Data *wd) if (!wd) return; evas_object_color_set(wd->o_rect, - (wd->color->r * wd->color->a) / 255, - (wd->color->g * wd->color->a) / 255, - (wd->color->b * wd->color->a) / 255, - wd->color->a); + (wd->color->r * wd->color->a) / 255, + (wd->color->g * wd->color->a) / 255, + (wd->color->b * wd->color->a) / 255, + wd->color->a); e_widget_change(wd->obj); } @@ -46,10 +46,10 @@ _e_wid_signal_cb1(void *data, Evas_Object *obj __UNUSED__, const char *emission if (!wd->show_color_dialog || !wd->con) return; if (!wd->dia) { - wd->dia = e_color_dialog_new(wd->con, wd->color, wd->alpha_enabled); - e_color_dialog_select_callback_set(wd->dia, _e_wid_color_select_cb, wd); - e_color_dialog_cancel_callback_set(wd->dia, _e_wid_color_cancel_cb, wd); - e_color_dialog_change_callback_set(wd->dia, _e_wid_color_change_cb, wd); + wd->dia = e_color_dialog_new(wd->con, wd->color, wd->alpha_enabled); + e_color_dialog_select_callback_set(wd->dia, _e_wid_color_select_cb, wd); + e_color_dialog_cancel_callback_set(wd->dia, _e_wid_color_cancel_cb, wd); + e_color_dialog_change_callback_set(wd->dia, _e_wid_color_change_cb, wd); } e_color_dialog_show(wd->dia); } @@ -107,13 +107,13 @@ _e_wid_disable_hook(Evas_Object *obj) wd = e_widget_data_get(obj); if (e_widget_disabled_get(obj)) { - wd->show_color_dialog = 0; - edje_object_signal_emit(wd->o_edje, "e,state,disabled", "e"); + wd->show_color_dialog = 0; + edje_object_signal_emit(wd->o_edje, "e,state,disabled", "e"); } else { - wd->show_color_dialog = 1; - edje_object_signal_emit(wd->o_edje, "e,state,enabled", "e"); + wd->show_color_dialog = 1; + edje_object_signal_emit(wd->o_edje, "e,state,enabled", "e"); } } @@ -148,9 +148,9 @@ e_widget_color_well_add_full(Evas *evas, E_Color *color, Eina_Bool show_color_di e_widget_sub_object_add(obj, o); e_widget_resize_object_set(obj, o); e_theme_edje_object_set(o, "base/theme/widgets", - "e/widgets/color_well"); + "e/widgets/color_well"); edje_object_signal_callback_add(o, "e,action,click", "", - _e_wid_signal_cb1, obj); + _e_wid_signal_cb1, obj); evas_object_show(o); wd->o_edje = o; @@ -159,10 +159,10 @@ e_widget_color_well_add_full(Evas *evas, E_Color *color, Eina_Bool show_color_di o = evas_object_rectangle_add(evas); e_widget_sub_object_add(obj, o); evas_object_color_set(o, - (color->r * color->a) / 255, - (color->g * color->a) / 255, - (color->b * color->a) / 255, - color->a); + (color->r * color->a) / 255, + (color->g * color->a) / 255, + (color->b * color->a) / 255, + color->a); edje_object_part_swallow(wd->o_edje, "e.swallow.content", o); evas_object_show(o); wd->o_rect = o; @@ -173,13 +173,13 @@ e_widget_color_well_add_full(Evas *evas, E_Color *color, Eina_Bool show_color_di /** * Add a color well widget to an evas. * An optional E_Container may be passed in. - If not NULL, when clicked a color dialog will pop up. + If not NULL, when clicked a color dialog will pop up. */ Evas_Object * e_widget_color_well_add(Evas *evas, E_Color *color, Eina_Bool show_color_dialog) { return e_widget_color_well_add_full - (evas, color, show_color_dialog, EINA_FALSE); + (evas, color, show_color_dialog, EINA_FALSE); } /** @@ -191,3 +191,4 @@ e_widget_color_well_update(Evas_Object *obj) E_Widget_Data *wd = e_widget_data_get(obj); _e_wid_update(wd); } + diff --git a/src/bin/e_widget_config_list.c b/src/bin/e_widget_config_list.c index e83630b92..f2fde915c 100644 --- a/src/bin/e_widget_config_list.c +++ b/src/bin/e_widget_config_list.c @@ -19,20 +19,20 @@ struct _E_Widget_Data int cur_enabled; struct - { - Evas_Object *list; /* Selecting a list entry starts edit*/ - Evas_Object *table; - Evas_Object *entry; /* Generic Entry */ - Evas_Object *up; /* Move selected list entry up */ - Evas_Object *down; /* Move selected list entry down */ - Evas_Object *add; /* create and select a new list entry */ - Evas_Object *remove; /* remove the selected entry */ - } gui; + { + Evas_Object *list; /* Selecting a list entry starts edit*/ + Evas_Object *table; + Evas_Object *entry; /* Generic Entry */ + Evas_Object *up; /* Move selected list entry up */ + Evas_Object *down; /* Move selected list entry down */ + Evas_Object *add; /* create and select a new list entry */ + Evas_Object *remove; /* remove the selected entry */ + } gui; }; /* Externally accessible functions */ EAPI Evas_Object * -e_widget_config_list_add(Evas *evas, Evas_Object* (*func_entry_add) (Evas *evas, char **val, void (*func) (void *data, void *data2), void *data, void *data2), const char *label, int listspan __UNUSED__) +e_widget_config_list_add(Evas *evas, Evas_Object * (*func_entry_add)(Evas * evas, char **val, void (*func)(void *data, void *data2), void *data, void *data2), const char *label, int listspan __UNUSED__) { Evas_Object *obj, *o; E_Widget_Data *wd; @@ -58,13 +58,13 @@ e_widget_config_list_add(Evas *evas, Evas_Object* (*func_entry_add) (Evas *evas, e_widget_table_object_append(wd->gui.table, o, 0, 2, 2, 1, 1, 0, 1, 0); o = e_widget_button_add(evas, _("Add"), "list-add", _button_cb_add, - wd, obj); + wd, obj); wd->gui.add = o; e_widget_disabled_set(o, 1); e_widget_table_object_append(wd->gui.table, o, 0, 3, 1, 1, 1, 0, 1, 0); o = e_widget_button_add(evas, _("Remove"), "list-remove", - _button_cb_remove, wd, obj); + _button_cb_remove, wd, obj); wd->gui.remove = o; e_widget_disabled_set(o, 1); e_widget_table_object_append(wd->gui.table, o, 1, 3, 1, 1, 1, 0, 1, 0); @@ -78,13 +78,13 @@ e_widget_config_list_add(Evas *evas, Evas_Object* (*func_entry_add) (Evas *evas, e_widget_table_object_append(wd->gui.table, o, 0, 4, 2, 1, 1, 1, 1, 1); o = e_widget_button_add(evas, _("Up"), "go-up", - _button_cb_up, wd, NULL); + _button_cb_up, wd, NULL); wd->gui.up = o; e_widget_disabled_set(o, 1); e_widget_table_object_append(wd->gui.table, o, 0, 5, 1, 1, 1, 0, 1, 0); o = e_widget_button_add(evas, _("Down"), "go-down", - _button_cb_down, wd, NULL); + _button_cb_down, wd, NULL); wd->gui.down = o; e_widget_disabled_set(o, 1); e_widget_table_object_append(wd->gui.table, o, 1, 5, 1, 1, 1, 0, 1, 0); @@ -145,8 +145,8 @@ e_widget_config_list_object_append(Evas_Object *obj, Evas_Object *sobj, int col, wd = e_widget_data_get(obj); e_widget_table_object_append(wd->gui.table, sobj, col, row, - colspan, rowspan, fill_w, fill_h, - expand_w, expand_h); + colspan, rowspan, fill_w, fill_h, + expand_w, expand_h); e_widget_size_min_get(wd->gui.table, &mw, &mh); e_widget_size_min_set(obj, mw, mh); } @@ -175,22 +175,22 @@ _button_cb_add(void *data, void *obj) if (!(wd = data)) return; if ((wd->cur_entry) && (wd->cur_entry[0])) { - int i; + int i; - /* If it already esists just select the existing one */ - for (i = 0; i < e_widget_ilist_count(wd->gui.list); i++) - { - const char *label; + /* If it already esists just select the existing one */ + for (i = 0; i < e_widget_ilist_count(wd->gui.list); i++) + { + const char *label; - label = e_widget_ilist_nth_label_get(wd->gui.list, i); - if ((label) && (!strcmp(label, wd->cur_entry))) - { - e_widget_ilist_selected_set(wd->gui.list, i); - return; - } - } - e_widget_config_list_append(o, wd->cur_entry); - e_widget_entry_text_set(wd->gui.entry, ""); + label = e_widget_ilist_nth_label_get(wd->gui.list, i); + if ((label) && (!strcmp(label, wd->cur_entry))) + { + e_widget_ilist_selected_set(wd->gui.list, i); + return; + } + } + e_widget_config_list_append(o, wd->cur_entry); + e_widget_entry_text_set(wd->gui.entry, ""); } } @@ -271,23 +271,23 @@ _list_select_num(E_Widget_Data *wd, int indx) if ((count == 1) || (indx < 0)) { - e_widget_disabled_set(wd->gui.up, 1); - e_widget_disabled_set(wd->gui.down, 1); + e_widget_disabled_set(wd->gui.up, 1); + e_widget_disabled_set(wd->gui.down, 1); } else if (indx == 0) { - e_widget_disabled_set(wd->gui.up, 1); - e_widget_disabled_set(wd->gui.down, 0); + e_widget_disabled_set(wd->gui.up, 1); + e_widget_disabled_set(wd->gui.down, 0); } else if ((indx + 1) == count) { - e_widget_disabled_set(wd->gui.up, 0); - e_widget_disabled_set(wd->gui.down, 1); + e_widget_disabled_set(wd->gui.up, 0); + e_widget_disabled_set(wd->gui.down, 1); } else { - e_widget_disabled_set(wd->gui.up, 0); - e_widget_disabled_set(wd->gui.down, 0); + e_widget_disabled_set(wd->gui.up, 0); + e_widget_disabled_set(wd->gui.down, 0); } } @@ -314,15 +314,16 @@ _e_wid_disable_hook(Evas_Object *obj) if (wd->cur_enabled) { - e_widget_disabled_set(wd->gui.list, 0); - e_widget_disabled_set(wd->gui.add, 0); - e_widget_disabled_set(wd->gui.entry, 0); + e_widget_disabled_set(wd->gui.list, 0); + e_widget_disabled_set(wd->gui.add, 0); + e_widget_disabled_set(wd->gui.entry, 0); } else { - _list_select_num(wd, -1); - e_widget_disabled_set(wd->gui.list, 1); - e_widget_disabled_set(wd->gui.entry, 1); - e_widget_disabled_set(wd->gui.add, 1); + _list_select_num(wd, -1); + e_widget_disabled_set(wd->gui.list, 1); + e_widget_disabled_set(wd->gui.entry, 1); + e_widget_disabled_set(wd->gui.add, 1); } } + diff --git a/src/bin/e_widget_csel.c b/src/bin/e_widget_csel.c index 14f5452a2..4cd692ed0 100644 --- a/src/bin/e_widget_csel.c +++ b/src/bin/e_widget_csel.c @@ -128,7 +128,7 @@ _e_wid_cb_color_changed(void *data, Evas_Object *o) } /* update the spectrum */ - if (o != wd->spectrum/* && changed != -1*/) + if (o != wd->spectrum /* && changed != -1*/) { if (wd->mode == changed || (wd->mode >= E_COLOR_COMPONENT_H && changed <= E_COLOR_COMPONENT_B) || @@ -152,21 +152,27 @@ _e_wid_cb_color_changed(void *data, Evas_Object *o) case E_COLOR_COMPONENT_R: snprintf(buf, 10, "%i", wd->cv->r); break; + case E_COLOR_COMPONENT_G: snprintf(buf, 10, "%i", wd->cv->g); break; + case E_COLOR_COMPONENT_B: snprintf(buf, 10, "%i", wd->cv->b); break; + case E_COLOR_COMPONENT_H: snprintf(buf, 10, "%.0f", wd->cv->h); break; + case E_COLOR_COMPONENT_S: snprintf(buf, 10, "%.2f", wd->cv->s); break; + case E_COLOR_COMPONENT_V: snprintf(buf, 10, "%.2f", wd->cv->v); break; + default: break; } @@ -195,7 +201,7 @@ e_widget_csel_add(Evas *evas, E_Color *color, Eina_Bool alpha_enabled) char *labels[6] = { N_("R"), N_("G"), N_("B"), N_("H"), N_("S"), N_("V") }; E_Widget_Data *wd; Evas_Coord mw, mh; - + obj = e_widget_add(evas); e_widget_del_hook_set(obj, _e_wid_del_hook); @@ -243,7 +249,7 @@ e_widget_csel_add(Evas *evas, E_Color *color, Eina_Bool alpha_enabled) case E_COLOR_COMPONENT_V: snprintf(wd->values[i], 10, "%.2f", wd->cv->v); break; - + default: break; } @@ -306,7 +312,7 @@ e_widget_csel_add(Evas *evas, E_Color *color, Eina_Bool alpha_enabled) e_widget_size_min_get(table, &mw, &mh); e_widget_size_min_set(obj, mw, mh); - + return obj; } diff --git a/src/bin/e_widget_cslider.c b/src/bin/e_widget_cslider.c index d63f20b1f..bb630dc72 100644 --- a/src/bin/e_widget_cslider.c +++ b/src/bin/e_widget_cslider.c @@ -4,20 +4,20 @@ typedef struct _E_Widget_Data E_Widget_Data; struct _E_Widget_Data { - Evas_Object *o_cslider; - Evas_Object *o_grad; - Evas_Object *o_event; + Evas_Object *o_cslider; + Evas_Object *o_grad; + Evas_Object *o_event; - Evas_Coord x, y, w, h; + Evas_Coord x, y, w, h; - int vertical; - int fixed; + int vertical; + int fixed; E_Color_Component mode; - int valnum; - E_Color *color; - E_Color *prev; + int valnum; + E_Color *color; + E_Color *prev; - int dragging; + int dragging; }; static void _e_wid_del_hook(Evas_Object *obj); @@ -37,7 +37,7 @@ static void _e_wid_cb_drag(void *data, Evas_Object *obj, const char *emission, c static void _e_wid_cb_down(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _e_wid_cb_move(void *data, Evas *e, Evas_Object *obj, void *event_info); - static void _e_wid_cb_up(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _e_wid_cb_up(void *data, Evas *e, Evas_Object *obj, void *event_info); Evas_Object * e_widget_cslider_add(Evas *evas, E_Color_Component mode, E_Color *color, int vertical, int fixed) @@ -65,7 +65,7 @@ e_widget_cslider_add(Evas *evas, E_Color_Component mode, E_Color *color, int ver o = edje_object_add(evas); wd->o_cslider = o; e_theme_edje_object_set(o, "base/theme/widgets", - "e/widgets/cslider"); + "e/widgets/cslider"); if (wd->vertical) edje_object_signal_emit(o, "e,state,direction,v", "e"); else @@ -124,7 +124,7 @@ _e_wid_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void { E_Widget_Data *wd; Evas_Coord w, h; - + wd = data; evas_object_geometry_get(obj, NULL, NULL, &w, &h); evas_object_resize(wd->o_event, w, h); @@ -140,31 +140,37 @@ _e_wid_value_set(Evas_Object *o, double vx) switch (wd->mode) { case E_COLOR_COMPONENT_R: - wd->color->r = 255 * vx; - e_color_update_rgb(wd->color); - break; + wd->color->r = 255 * vx; + e_color_update_rgb(wd->color); + break; + case E_COLOR_COMPONENT_G: - wd->color->g = 255 * vx; - e_color_update_rgb(wd->color); - break; + wd->color->g = 255 * vx; + e_color_update_rgb(wd->color); + break; + case E_COLOR_COMPONENT_B: - wd->color->b = 255 * vx; - e_color_update_rgb(wd->color); - break; + wd->color->b = 255 * vx; + e_color_update_rgb(wd->color); + break; + case E_COLOR_COMPONENT_H: - wd->color->h = 360 * vx; - e_color_update_hsv(wd->color); - break; + wd->color->h = 360 * vx; + e_color_update_hsv(wd->color); + break; + case E_COLOR_COMPONENT_S: - wd->color->s = vx; - e_color_update_hsv(wd->color); - break; + wd->color->s = vx; + e_color_update_hsv(wd->color); + break; + case E_COLOR_COMPONENT_V: - wd->color->v = vx; - e_color_update_hsv(wd->color); - break; + wd->color->v = vx; + e_color_update_hsv(wd->color); + break; + case E_COLOR_COMPONENT_MAX: - break; + break; } _e_wid_update(wd); @@ -216,25 +222,25 @@ _e_wid_update(E_Widget_Data *wd) if (changed) { - if (wd->fixed) - _e_wid_update_fixed(wd); - else - _e_wid_update_standard(wd); + if (wd->fixed) + _e_wid_update_fixed(wd); + else + _e_wid_update_standard(wd); - wd->x = x; wd->y = y; - wd->w = w; wd->h = h; - memcpy(wd->prev, wd->color, sizeof (E_Color)); + wd->x = x; wd->y = y; + wd->w = w; wd->h = h; + memcpy(wd->prev, wd->color, sizeof (E_Color)); } } static void _e_wid_gradient_set(Evas_Object *o, Eina_Bool orientation, - int rf, int gf, int bf, - int rt, int gt, int bt) + int rf, int gf, int bf, + int rt, int gt, int bt) { unsigned int *pixels, *p; int x, r, g, b; - + if (!orientation) evas_object_image_size_set(o, 256, 1); else @@ -302,13 +308,13 @@ _e_wid_update_standard(E_Widget_Data *wd) unsigned int i; float vx = 0; int *grad[7][3] = { - { &max, &min, &min }, - { &max, &max, &min }, - { &min, &max, &min }, - { &min, &max, &max }, - { &min, &min, &max }, - { &max, &min, &max }, - { &max, &min, &min } + { &max, &min, &min }, + { &max, &max, &min }, + { &min, &max, &min }, + { &min, &max, &max }, + { &min, &min, &max }, + { &max, &min, &max }, + { &max, &min, &min } }; if (!wd->color) return; @@ -316,53 +322,59 @@ _e_wid_update_standard(E_Widget_Data *wd) switch (wd->mode) { case E_COLOR_COMPONENT_R: - _e_wid_gradient_set(wd->o_grad, wd->vertical, - 0, wd->color->g, wd->color->b, - 255, wd->color->g, wd->color->b); - vx = wd->color->r / 255.0; - break; + _e_wid_gradient_set(wd->o_grad, wd->vertical, + 0, wd->color->g, wd->color->b, + 255, wd->color->g, wd->color->b); + vx = wd->color->r / 255.0; + break; + case E_COLOR_COMPONENT_G: - _e_wid_gradient_set(wd->o_grad, wd->vertical, - wd->color->r, 0, wd->color->b, - wd->color->r, 255, wd->color->b); - vx = wd->color->g / 255.0; - break; + _e_wid_gradient_set(wd->o_grad, wd->vertical, + wd->color->r, 0, wd->color->b, + wd->color->r, 255, wd->color->b); + vx = wd->color->g / 255.0; + break; + case E_COLOR_COMPONENT_B: - _e_wid_gradient_set(wd->o_grad, wd->vertical, - wd->color->r, wd->color->g, 0, - wd->color->r, wd->color->g, 255); - vx = wd->color->b / 255.0; - break; + _e_wid_gradient_set(wd->o_grad, wd->vertical, + wd->color->r, wd->color->g, 0, + wd->color->r, wd->color->g, 255); + vx = wd->color->b / 255.0; + break; + case E_COLOR_COMPONENT_H: - evas_color_hsv_to_rgb(0, wd->color->s, wd->color->v, &max, &min, NULL); + evas_color_hsv_to_rgb(0, wd->color->s, wd->color->v, &max, &min, NULL); for (i = 0; i < 6; i++) _e_wid_gradient_range_set(wd->o_grad, wd->vertical, *grad[i][0], *grad[i][1], *grad[i][2], *grad[i + 1][0], *grad[i + 1][1], *grad[i + 1][2], ((i + 0) * 256) / 6, ((i + 1) * 256) / 6); - vx = wd->color->h / 360.0; - break; + vx = wd->color->h / 360.0; + break; + case E_COLOR_COMPONENT_S: - evas_color_hsv_to_rgb(wd->color->h, 0, wd->color->v, &r, &g, &b); - evas_color_hsv_to_rgb(wd->color->h, 1, wd->color->v, &rd, &gd, &bd); + evas_color_hsv_to_rgb(wd->color->h, 0, wd->color->v, &r, &g, &b); + evas_color_hsv_to_rgb(wd->color->h, 1, wd->color->v, &rd, &gd, &bd); + + _e_wid_gradient_set(wd->o_grad, wd->vertical, + r, g, b, + rd, gd, bd); + vx = wd->color->s; + break; - _e_wid_gradient_set(wd->o_grad, wd->vertical, - r, g, b, - rd, gd, bd); - vx = wd->color->s; - break; case E_COLOR_COMPONENT_V: - evas_color_hsv_to_rgb(wd->color->h, wd->color->s, 0, &r, &g, &b); - evas_color_hsv_to_rgb(wd->color->h, wd->color->s, 1, &rd, &gd, &bd); + evas_color_hsv_to_rgb(wd->color->h, wd->color->s, 0, &r, &g, &b); + evas_color_hsv_to_rgb(wd->color->h, wd->color->s, 1, &rd, &gd, &bd); + + _e_wid_gradient_set(wd->o_grad, wd->vertical, + r, g, b, + rd, gd, bd); + vx = wd->color->v; + break; - _e_wid_gradient_set(wd->o_grad, wd->vertical, - r, g, b, - rd, gd, bd); - vx = wd->color->v; - break; default: - break; + break; } edje_object_part_drag_value_set(wd->o_cslider, "e.dragable.cursor", vx, vx); @@ -377,71 +389,77 @@ _e_wid_update_fixed(E_Widget_Data *wd) unsigned int i; float vx = 0; int grad[7][3] = { - { GMAX, GMIN, GMIN }, - { GMAX, GMIN, GMAX }, - { GMIN, GMIN, GMAX }, - { GMIN, GMAX, GMAX }, - { GMIN, GMAX, GMIN }, - { GMAX, GMAX, GMIN }, - { GMAX, GMIN, GMIN } + { GMAX, GMIN, GMIN }, + { GMAX, GMIN, GMAX }, + { GMIN, GMIN, GMAX }, + { GMIN, GMAX, GMAX }, + { GMIN, GMAX, GMIN }, + { GMAX, GMAX, GMIN }, + { GMAX, GMIN, GMIN } }; if (!wd) return; switch (wd->mode) - { - case E_COLOR_COMPONENT_R: - _e_wid_gradient_set(wd->o_grad, wd->vertical, - 255, 0, 0, - 0, 0, 0); - vx = wd->color->r / 255.0; - break; - case E_COLOR_COMPONENT_G: - _e_wid_gradient_set(wd->o_grad, wd->vertical, - 0, 255, 0, - 0, 0, 0); - vx = wd->color->g / 255.0; - break; - case E_COLOR_COMPONENT_B: - _e_wid_gradient_set(wd->o_grad, wd->vertical, - 0, 0, 255, - 0, 0, 0); - vx = wd->color->b / 255.0; - break; - case E_COLOR_COMPONENT_H: - /* - * Color Stops: - * 0 x n n - * 60 x x n - * 120 n x n - * 180 n x x - * 240 n n x - * 300 x n x - * 360 x n n - */ + { + case E_COLOR_COMPONENT_R: + _e_wid_gradient_set(wd->o_grad, wd->vertical, + 255, 0, 0, + 0, 0, 0); + vx = wd->color->r / 255.0; + break; + + case E_COLOR_COMPONENT_G: + _e_wid_gradient_set(wd->o_grad, wd->vertical, + 0, 255, 0, + 0, 0, 0); + vx = wd->color->g / 255.0; + break; + + case E_COLOR_COMPONENT_B: + _e_wid_gradient_set(wd->o_grad, wd->vertical, + 0, 0, 255, + 0, 0, 0); + vx = wd->color->b / 255.0; + break; + + case E_COLOR_COMPONENT_H: + /* + * Color Stops: + * 0 x n n + * 60 x x n + * 120 n x n + * 180 n x x + * 240 n n x + * 300 x n x + * 360 x n n + */ for (i = 0; i < 6; i++) _e_wid_gradient_range_set(wd->o_grad, wd->vertical, grad[i][0], grad[i][1], grad[i][2], grad[i + 1][0], grad[i + 1][1], grad[i + 1][2], ((i + 0) * 256) / 6, ((i + 1) * 256) / 6); - vx = wd->color->h / 360.0; - break; - case E_COLOR_COMPONENT_S: - _e_wid_gradient_set(wd->o_grad, wd->vertical, - 255, 255, 255, - 0, 0, 0); - vx = wd->color->s; - break; - case E_COLOR_COMPONENT_V: - _e_wid_gradient_set(wd->o_grad, wd->vertical, - 255, 255, 255, - 0, 0, 0); - vx = wd->color->v; - break; - default: - break; - } + vx = wd->color->h / 360.0; + break; + + case E_COLOR_COMPONENT_S: + _e_wid_gradient_set(wd->o_grad, wd->vertical, + 255, 255, 255, + 0, 0, 0); + vx = wd->color->s; + break; + + case E_COLOR_COMPONENT_V: + _e_wid_gradient_set(wd->o_grad, wd->vertical, + 255, 255, 255, + 0, 0, 0); + vx = wd->color->v; + break; + + default: + break; + } edje_object_part_drag_value_set(wd->o_cslider, "e.dragable.cursor", vx, vx); @@ -466,13 +484,13 @@ _e_wid_focus_hook(Evas_Object *obj) wd = e_widget_data_get(obj); if (e_widget_focus_get(obj)) { - edje_object_signal_emit(wd->o_cslider, "e,state,focused", "e"); - evas_object_focus_set(wd->o_cslider, 1); + edje_object_signal_emit(wd->o_cslider, "e,state,focused", "e"); + evas_object_focus_set(wd->o_cslider, 1); } else { - edje_object_signal_emit(wd->o_cslider, "e,state,unfocused", "e"); - evas_object_focus_set(wd->o_cslider, 0); + edje_object_signal_emit(wd->o_cslider, "e,state,unfocused", "e"); + evas_object_focus_set(wd->o_cslider, 0); } } @@ -536,15 +554,15 @@ _e_wid_cb_drag(void *data, Evas_Object *obj __UNUSED__, const char *emission __U if (wd->dragging == 1) { - double val, valx, valy; + double val, valx, valy; edje_object_part_drag_value_get(wd->o_cslider, "e.dragable.cursor", &valx, &valy); - if (wd->vertical) val = valy; - else val = valx; - if (val > 1) val = 1; - if (val < 0) val = 0; - _e_wid_value_set(o_wid, val); + if (wd->vertical) val = valy; + else val = valx; + if (val > 1) val = 1; + if (val < 0) val = 0; + _e_wid_value_set(o_wid, val); } } @@ -554,9 +572,9 @@ _e_wid_mouse_handle(Evas_Object *obj, int mx, int my) E_Widget_Data *wd; Evas_Coord x, y, w, h; double vx = 0.0, vy = 0.0; - + wd = e_widget_data_get(obj); - + evas_object_geometry_get(wd->o_grad, &x, &y, &w, &h); if (w > 1) vx = (mx - x) / (double)(w - 1); if (h > 1) vy = (my - y) / (double)(h - 1); @@ -564,7 +582,6 @@ _e_wid_mouse_handle(Evas_Object *obj, int mx, int my) if (vx < 0) vx = 0; if (vy > 1) vy = 1; if (vy < 0) vy = 0; - if (wd->vertical) { @@ -579,18 +596,17 @@ _e_wid_mouse_handle(Evas_Object *obj, int mx, int my) e_widget_change(obj); } - static void _e_wid_cb_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) { Evas_Event_Mouse_Down *ev; Evas_Object *o_wid; E_Widget_Data *wd; - + o_wid = data; wd = e_widget_data_get(o_wid); ev = event_info; - + wd->dragging = 1; _e_wid_mouse_handle(o_wid, ev->canvas.x, ev->canvas.y); } @@ -600,7 +616,7 @@ _e_wid_cb_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void * { Evas_Object *o_wid; E_Widget_Data *wd; - + o_wid = data; wd = e_widget_data_get(o_wid); wd->dragging = 0; @@ -612,13 +628,14 @@ _e_wid_cb_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void Evas_Event_Mouse_Move *ev; Evas_Object *o_wid; E_Widget_Data *wd; - + o_wid = data; wd = e_widget_data_get(o_wid); ev = event_info; - + if (wd->dragging == 1) { _e_wid_mouse_handle(o_wid, ev->cur.canvas.x, ev->cur.canvas.y); } } + diff --git a/src/bin/e_widget_deskpreview.c b/src/bin/e_widget_deskpreview.c index a2e733fdf..6910f4e76 100644 --- a/src/bin/e_widget_deskpreview.c +++ b/src/bin/e_widget_deskpreview.c @@ -3,17 +3,17 @@ typedef struct _E_Widget_Data E_Widget_Data; struct _E_Widget_Data { - Evas_Object *obj, *table; - Eina_List *desks; - int w, h, dx, dy, cx, cy; + Evas_Object *obj, *table; + Eina_List *desks; + int w, h, dx, dy, cx, cy; }; typedef struct _E_Widget_Desk_Data E_Widget_Desk_Data; struct _E_Widget_Desk_Data { - Evas_Object *icon, *thumb; - int zone, con, x, y; + Evas_Object *icon, *thumb; + int zone, con, x, y; Ecore_Event_Handler *bg_upd_hdl; - Eina_Bool configurable : 1; + Eina_Bool configurable : 1; }; /* local function prototypes */ @@ -166,7 +166,7 @@ _e_wid_reconfigure(E_Widget_Data *wd) } else { - zone_ratio = (double) zone->w / zone->h; + zone_ratio = (double)zone->w / zone->h; desk_ratio = (tw / wd->dx) / (th / wd->dy); if (zone_ratio > desk_ratio) @@ -181,7 +181,7 @@ _e_wid_reconfigure(E_Widget_Data *wd) } } - EINA_LIST_FOREACH_SAFE (wd->desks, l, ll, dw) + EINA_LIST_FOREACH_SAFE(wd->desks, l, ll, dw) { if (!(dd = evas_object_data_get(dw, "desk_data"))) continue; if ((dd->x < wd->dx) && (dd->y < wd->dy)) diff --git a/src/bin/e_widget_entry.c b/src/bin/e_widget_entry.c index 2d35855be..69ca23cdd 100644 --- a/src/bin/e_widget_entry.c +++ b/src/bin/e_widget_entry.c @@ -4,11 +4,11 @@ typedef struct _E_Widget_Data E_Widget_Data; struct _E_Widget_Data { Evas_Object *o_entry, *o_inout; - char **text_location; - void (*func) (void *data, void *data2); - void *data; - void *data2; - Eina_Bool have_pointer : 1; + char **text_location; + void (*func)(void *data, void *data2); + void *data; + void *data2; + Eina_Bool have_pointer : 1; }; /* local subsystem functions */ @@ -36,7 +36,7 @@ static void _e_wid_movresz(void *data, Evas *e, Evas_Object *obj, void *event_in * @return Returns the new entry widget */ EAPI Evas_Object * -e_widget_entry_add(Evas *evas, char **text_location, void (*func) (void *data, void *data2), void *data, void *data2) +e_widget_entry_add(Evas *evas, char **text_location, void (*func)(void *data, void *data2), void *data, void *data2) { Evas_Object *obj, *o; E_Widget_Data *wd; @@ -57,11 +57,11 @@ e_widget_entry_add(Evas *evas, char **text_location, void (*func) (void *data, v e_widget_sub_object_add(obj, o); e_widget_resize_object_set(obj, o); evas_object_show(o); - + evas_object_event_callback_add(o, EVAS_CALLBACK_KEY_DOWN, _e_wid_keydown, obj); evas_object_event_callback_add(o, EVAS_CALLBACK_MOVE, _e_wid_movresz, obj); evas_object_event_callback_add(o, EVAS_CALLBACK_RESIZE, _e_wid_movresz, obj); - + o = evas_object_rectangle_add(evas); wd->o_inout = o; evas_object_repeat_events_set(o, EINA_TRUE); @@ -69,7 +69,7 @@ e_widget_entry_add(Evas *evas, char **text_location, void (*func) (void *data, v e_widget_sub_object_add(obj, o); evas_object_smart_member_add(o, obj); evas_object_show(o); - + evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _e_wid_focus_steal, obj); evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_IN, _e_wid_in, obj); evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_OUT, _e_wid_out, obj); @@ -102,7 +102,7 @@ e_widget_entry_text_set(Evas_Object *entry, const char *text) E_Widget_Data *wd; if (!(entry) || (!(wd = e_widget_data_get(entry)))) - return; + return; e_entry_text_set(wd->o_entry, text); } @@ -118,7 +118,7 @@ e_widget_entry_text_get(Evas_Object *entry) E_Widget_Data *wd; if (!(entry) || (!(wd = e_widget_data_get(entry)))) - return NULL; + return NULL; return e_entry_text_get(wd->o_entry); } @@ -133,7 +133,7 @@ e_widget_entry_clear(Evas_Object *entry) E_Widget_Data *wd; if (!(entry) || (!(wd = e_widget_data_get(entry)))) - return; + return; e_entry_clear(wd->o_entry); } @@ -150,7 +150,7 @@ e_widget_entry_password_set(Evas_Object *entry, int password_mode) E_Widget_Data *wd; if (!(entry) || (!(wd = e_widget_data_get(entry)))) - return; + return; e_entry_password_set(wd->o_entry, password_mode); } @@ -167,7 +167,7 @@ e_widget_entry_readonly_set(Evas_Object *entry, int readonly_mode) E_Widget_Data *wd; if (!(entry) || (!(wd = e_widget_data_get(entry)))) - return; + return; if (readonly_mode) e_entry_noedit(wd->o_entry); @@ -186,11 +186,10 @@ e_widget_entry_select_all(Evas_Object *entry) E_Widget_Data *wd; if (!(entry) || (!(wd = e_widget_data_get(entry)))) - return; + return; e_entry_select_all(wd->o_entry); } - /* Private functions */ static void @@ -199,7 +198,7 @@ _e_wid_del_hook(Evas_Object *obj) E_Widget_Data *wd; if (!(obj) || (!(wd = e_widget_data_get(obj)))) - return; + return; free(wd); } @@ -209,7 +208,7 @@ _e_wid_focus_hook(Evas_Object *obj) E_Widget_Data *wd; if (!(obj) || (!(wd = e_widget_data_get(obj)))) - return; + return; if (e_widget_focus_get(obj)) e_entry_focus(wd->o_entry); @@ -223,7 +222,7 @@ _e_wid_disable_hook(Evas_Object *obj) E_Widget_Data *wd; if (!(obj) || (!(wd = e_widget_data_get(obj)))) - return; + return; if (e_widget_disabled_get(obj)) e_entry_disable(wd->o_entry); @@ -242,7 +241,7 @@ _e_wid_in(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *eve { E_Pointer *p; E_Widget_Data *wd; - + if (!(data) || (!(wd = e_widget_data_get(data)))) return; if (wd->have_pointer) return; @@ -256,7 +255,7 @@ _e_wid_out(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *ev { E_Pointer *p; E_Widget_Data *wd; - + if (!(data) || (!(wd = e_widget_data_get(data)))) return; if (!wd->have_pointer) return; @@ -273,7 +272,7 @@ _e_wid_changed_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UN const char *text; if (!(entry = data) || (!(wd = e_widget_data_get(entry)))) - return; + return; if (wd->text_location) { @@ -297,7 +296,7 @@ _e_wid_movresz(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_inf { E_Widget_Data *wd; Evas_Coord x, y, w, h; - + if (!(data) || (!(wd = e_widget_data_get(data)))) return; evas_object_geometry_get(obj, &x, &y, &w, &h); @@ -307,3 +306,4 @@ _e_wid_movresz(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_inf evas_object_resize(wd->o_inout, w, h); } } + diff --git a/src/bin/e_widget_filepreview.c b/src/bin/e_widget_filepreview.c index cfe7f9d9e..41d8e32e5 100644 --- a/src/bin/e_widget_filepreview.c +++ b/src/bin/e_widget_filepreview.c @@ -10,42 +10,42 @@ typedef struct _E_Widget_Data E_Widget_Data; struct _E_Widget_Data { - Evas_Object *obj; - Evas_Object *o_preview_list; - Evas_Object *o_preview_preview_table; - Evas_Object *o_preview_properties_table; - Evas_Object *o_preview_scroll; - Evas_Object *o_preview_extra; - Evas_Object *o_preview_extra_entry; - Evas_Object *o_preview_size; - Evas_Object *o_preview_size_entry; - Evas_Object *o_preview_owner; - Evas_Object *o_preview_owner_entry; - Evas_Object *o_preview_perms; - Evas_Object *o_preview_perms_entry; - Evas_Object *o_preview_time; - Evas_Object *o_preview_time_entry; - Evas_Object *o_preview_preview; - Evas_Object *o_preview_scrollframe; - Evas_Coord preview_w, preview_h; - int w, h; + Evas_Object *obj; + Evas_Object *o_preview_list; + Evas_Object *o_preview_preview_table; + Evas_Object *o_preview_properties_table; + Evas_Object *o_preview_scroll; + Evas_Object *o_preview_extra; + Evas_Object *o_preview_extra_entry; + Evas_Object *o_preview_size; + Evas_Object *o_preview_size_entry; + Evas_Object *o_preview_owner; + Evas_Object *o_preview_owner_entry; + Evas_Object *o_preview_perms; + Evas_Object *o_preview_perms_entry; + Evas_Object *o_preview_time; + Evas_Object *o_preview_time_entry; + Evas_Object *o_preview_preview; + Evas_Object *o_preview_scrollframe; + Evas_Coord preview_w, preview_h; + int w, h; Ecore_Thread *preview_text_file_thread; - Eio_Monitor *monitor; - Eina_List *handlers; - char *preview_extra_text; - char *preview_size_text; - char *preview_owner_text; - char *preview_perms_text; - char *preview_time_text; - const char *path; - const char *mime; - double vid_pct; - Eina_Bool mime_icon : 1; - Eina_Bool is_dir : 1; - Eina_Bool is_txt : 1; - Eina_Bool prev_is_fm : 1; - Eina_Bool prev_is_txt : 1; - Eina_Bool prev_is_video : 1; + Eio_Monitor *monitor; + Eina_List *handlers; + char *preview_extra_text; + char *preview_size_text; + char *preview_owner_text; + char *preview_perms_text; + char *preview_time_text; + const char *path; + const char *mime; + double vid_pct; + Eina_Bool mime_icon : 1; + Eina_Bool is_dir : 1; + Eina_Bool is_txt : 1; + Eina_Bool prev_is_fm : 1; + Eina_Bool prev_is_txt : 1; + Eina_Bool prev_is_video : 1; }; static void _e_wid_fprev_preview_update(void *data, Evas_Object *obj, void *event_info); @@ -54,11 +54,11 @@ static char *_e_wid_file_size_get(off_t st_size); static char *_e_wid_file_user_get(uid_t st_uid); static char *_e_wid_file_perms_get(mode_t st_mode, uid_t st_uid, gid_t gid); static char *_e_wid_file_time_get(time_t st_modtime); -static void _e_wid_fprev_img_update(E_Widget_Data *wd, const char *path, const char *key); -static void _e_wid_del_hook(Evas_Object *obj); -static void _e_wid_fprev_preview_reset(E_Widget_Data *wd); -static void _e_wid_fprev_preview_txt(E_Widget_Data *wd); -static void _e_wid_fprev_preview_fm(E_Widget_Data *wd); +static void _e_wid_fprev_img_update(E_Widget_Data *wd, const char *path, const char *key); +static void _e_wid_del_hook(Evas_Object *obj); +static void _e_wid_fprev_preview_reset(E_Widget_Data *wd); +static void _e_wid_fprev_preview_txt(E_Widget_Data *wd); +static void _e_wid_fprev_preview_fm(E_Widget_Data *wd); static void _e_wid_fprev_preview_update(void *data, Evas_Object *obj, void *event_info __UNUSED__) @@ -94,9 +94,9 @@ _e_wid_fprev_preview_update(void *data, Evas_Object *obj, void *event_info __UNU const char *mime; Efreet_Desktop *ed = NULL; unsigned int size; - char group[1024]; + char group[1024]; Eina_Bool edj; - + wd->mime_icon = EINA_TRUE; size = wd->w; mime = e_util_mime_icon_get(wd->mime, size); @@ -145,7 +145,7 @@ static void _e_wid_fprev_clear_widgets(E_Widget_Data *wd) { #define CLRWID(xx) \ - do { if (wd->xx) { evas_object_del(wd->xx); wd->xx = NULL; } } while (0) + do { if (wd->xx) { evas_object_del(wd->xx); wd->xx = NULL; } } while (0) CLRWID(o_preview_preview_table); CLRWID(o_preview_properties_table); @@ -176,7 +176,7 @@ _e_wid_fprev_preview_video_position(E_Widget_Data *wd, Evas_Object *obj, void *e double t, tot, ratio; int iw, ih; Evas_Coord w, h; - + evas_object_geometry_get(wd->o_preview_properties_table, NULL, NULL, &w, &h); tot = emotion_object_play_length_get(obj); @@ -200,7 +200,7 @@ _e_wid_fprev_preview_video_position(E_Widget_Data *wd, Evas_Object *obj, void *e static void _e_wid_fprev_preview_video_opened(E_Widget_Data *wd, Evas_Object *obj, void *event_info __UNUSED__) { - e_widget_entry_text_set(wd->o_preview_extra_entry, e_util_time_str_get(emotion_object_play_length_get(obj))); + e_widget_entry_text_set(wd->o_preview_extra_entry, e_util_time_str_get(emotion_object_play_length_get(obj))); } static void @@ -223,34 +223,34 @@ _e_wid_fprev_preview_video_widgets(E_Widget_Data *wd) Evas *evas = evas_object_evas_get(wd->obj); Evas_Object *o, *em; int mw, mh, y = 3; - + _e_wid_fprev_clear_widgets(wd); o = e_widget_table_add(evas, 0); wd->o_preview_properties_table = o; -#define WIDROW(lab, labob, entob, entw) \ - do { \ - o = e_widget_label_add(evas, lab); \ - wd->labob = o; \ - e_widget_table_object_align_append(wd->o_preview_properties_table, \ - wd->labob, \ - 0, y, 1, 1, 0, 1, 0, 0, 1.0, 0.0); \ - o = e_widget_entry_add(evas, &(wd->preview_extra_text), NULL, NULL, NULL); \ - e_widget_entry_readonly_set(o, 1); \ - wd->entob = o; \ - e_widget_size_min_set(o, entw, -1); \ - e_widget_table_object_align_append(wd->o_preview_properties_table, \ - wd->entob, \ - 1, y, 1, 1, 1, 1, 1, 0, 0.0, 0.0); \ - y++; \ - } while (0) +#define WIDROW(lab, labob, entob, entw) \ + do { \ + o = e_widget_label_add(evas, lab); \ + wd->labob = o; \ + e_widget_table_object_align_append(wd->o_preview_properties_table, \ + wd->labob, \ + 0, y, 1, 1, 0, 1, 0, 0, 1.0, 0.0); \ + o = e_widget_entry_add(evas, &(wd->preview_extra_text), NULL, NULL, NULL); \ + e_widget_entry_readonly_set(o, 1); \ + wd->entob = o; \ + e_widget_size_min_set(o, entw, -1); \ + e_widget_table_object_align_append(wd->o_preview_properties_table, \ + wd->entob, \ + 1, y, 1, 1, 1, 1, 1, 0, 0.0, 0.0); \ + y++; \ + } while (0) o = e_widget_table_add(evas, 0); e_widget_size_min_set(o, wd->w, wd->h); e_widget_table_object_append(wd->o_preview_properties_table, o, 0, 0, 2, 2, 1, 1, 1, 1); - + wd->o_preview_preview = e_widget_preview_add(evas, 4, 4); em = o = emotion_object_add(e_widget_preview_evas_get(wd->o_preview_preview)); emotion_object_init(o, NULL); @@ -260,14 +260,14 @@ _e_wid_fprev_preview_video_widgets(E_Widget_Data *wd) e_widget_preview_extern_object_set(wd->o_preview_preview, o); e_widget_table_object_append(wd->o_preview_properties_table, wd->o_preview_preview, 0, 0, 2, 2, 1, 1, 1, 1); - + evas_object_smart_callback_add(o, "length_change", (Evas_Smart_Cb)_e_wid_fprev_preview_video_opened, wd); evas_object_smart_callback_add(o, "frame_decode", (Evas_Smart_Cb)_e_wid_fprev_preview_video_position, wd); o = e_widget_slider_add(evas, 1, 0, _("%3.1f%%"), 0, 100, 0.5, 0, &wd->vid_pct, NULL, 40); wd->o_preview_time = o; e_widget_table_object_align_append(wd->o_preview_properties_table, - wd->o_preview_time, + wd->o_preview_time, 0, 2, 2, 1, 1, 0, 1, 0, 0.5, 0.5); e_widget_on_change_hook_set(o, _e_wid_fprev_preview_video_change, em); WIDROW(_("Length:"), o_preview_extra, o_preview_extra_entry, 40); @@ -277,7 +277,7 @@ _e_wid_fprev_preview_video_widgets(E_Widget_Data *wd) e_widget_list_object_append(wd->o_preview_list, wd->o_preview_properties_table, 1, 1, 0.5); - + e_widget_size_min_get(wd->o_preview_list, &mw, &mh); e_widget_size_min_set(wd->obj, mw, mh); evas_object_show(wd->o_preview_preview_table); @@ -304,29 +304,29 @@ _e_wid_fprev_preview_fs_widgets(E_Widget_Data *wd, Eina_Bool mount_point) Evas *evas = evas_object_evas_get(wd->obj); Evas_Object *o; int mw, mh, y = 0; - + _e_wid_fprev_clear_widgets(wd); o = e_widget_table_add(evas, 0); wd->o_preview_properties_table = o; -#define WIDROW(lab, labob, entob, entw) \ - do { \ - o = e_widget_label_add(evas, lab); \ - wd->labob = o; \ - e_widget_table_object_align_append(wd->o_preview_properties_table, \ - wd->labob, \ - 0, y, 1, 1, 0, 1, 0, 0, 1.0, 0.0); \ - o = e_widget_entry_add(evas, &(wd->preview_extra_text), NULL, NULL, NULL); \ - e_widget_entry_readonly_set(o, 1); \ - wd->entob = o; \ - e_widget_size_min_set(o, entw, -1); \ - e_widget_table_object_align_append(wd->o_preview_properties_table, \ - wd->entob, \ - 1, y, 1, 1, 1, 1, 1, 0, 0.0, 0.0); \ - y++; \ - } while (0) - +#define WIDROW(lab, labob, entob, entw) \ + do { \ + o = e_widget_label_add(evas, lab); \ + wd->labob = o; \ + e_widget_table_object_align_append(wd->o_preview_properties_table, \ + wd->labob, \ + 0, y, 1, 1, 0, 1, 0, 0, 1.0, 0.0); \ + o = e_widget_entry_add(evas, &(wd->preview_extra_text), NULL, NULL, NULL); \ + e_widget_entry_readonly_set(o, 1); \ + wd->entob = o; \ + e_widget_size_min_set(o, entw, -1); \ + e_widget_table_object_align_append(wd->o_preview_properties_table, \ + wd->entob, \ + 1, y, 1, 1, 1, 1, 1, 0, 0.0, 0.0); \ + y++; \ + } while (0) + WIDROW(_("Used:"), o_preview_extra, o_preview_extra_entry, 100); WIDROW(_("Size:"), o_preview_size, o_preview_size_entry, 100); WIDROW(_("Reserved:"), o_preview_owner, o_preview_owner_entry, 100); @@ -337,7 +337,7 @@ _e_wid_fprev_preview_fs_widgets(E_Widget_Data *wd, Eina_Bool mount_point) e_widget_list_object_append(wd->o_preview_list, wd->o_preview_properties_table, 1, 1, 0.5); - + e_widget_size_min_get(wd->o_preview_list, &mw, &mh); e_widget_size_min_set(wd->obj, mw, mh); evas_object_show(wd->o_preview_preview_table); @@ -360,7 +360,7 @@ _e_wid_fprev_preview_file_widgets(E_Widget_Data *wd, Eina_Bool dir, Eina_Bool tx Evas *evas = evas_object_evas_get(wd->obj); Evas_Object *o; int mw, mh, y = 0; - + _e_wid_fprev_clear_widgets(wd); o = e_widget_table_add(evas, 0); @@ -416,12 +416,12 @@ _e_wid_fprev_preview_file(E_Widget_Data *wd) if (stat(wd->path, &st) < 0) return; // if its a desktop file treat is spcially - if (((wd->mime) &&(!strcasecmp(wd->mime, "application/x-desktop"))) || + if (((wd->mime) && (!strcasecmp(wd->mime, "application/x-desktop"))) || (eina_str_has_extension(wd->path, "desktop"))) { Efreet_Desktop *desktop; const char *type, *file; - + // load it and if its a specual removable or mount point // desktop file for e, then we want to do something special desktop = efreet_desktop_new(wd->path); @@ -436,13 +436,13 @@ _e_wid_fprev_preview_file(E_Widget_Data *wd) { struct statvfs stfs; Eina_Bool ok = EINA_FALSE; - + memset(&stfs, 0, sizeof(stfs)); if (statvfs(file, &stfs) == 0) ok = EINA_TRUE; else { E_Volume *v; - + v = e_fm2_device_volume_find(file); if (v && v->mount_point) { @@ -453,7 +453,7 @@ _e_wid_fprev_preview_file(E_Widget_Data *wd) } } } - + if (ok) { unsigned long fragsz; @@ -462,12 +462,12 @@ _e_wid_fprev_preview_file(E_Widget_Data *wd) Eina_Bool rdonly = EINA_FALSE; char buf[PATH_MAX], mpoint[4096], fstype[4096]; FILE *f; - + fragsz = stfs.f_frsize; - blknum = stfs.f_blocks; + blknum = stfs.f_blocks; blkused = stfs.f_blocks - stfs.f_bfree; blkres = stfs.f_bfree - stfs.f_bavail; - + fstype[0] = 0; mpoint[0] = 0; f = fopen("/etc/mtab", "r"); @@ -488,18 +488,18 @@ _e_wid_fprev_preview_file(E_Widget_Data *wd) if (blknum > blkres) { is_fs = EINA_TRUE; - - mbres = ((double)blkres * (double)fragsz) / - (double)(1024*1024); + + mbres = ((double)blkres * (double)fragsz) / + (double)(1024 * 1024); mbsize = ((double)blknum * (double)fragsz) / - (double)(1024*1024); - mbused = (mbsize * (double)blkused) / + (double)(1024 * 1024); + mbused = (mbsize * (double)blkused) / (double)blknum; -#ifdef ST_RDONLY +#ifdef ST_RDONLY if (stfs.f_flag & ST_RDONLY) rdonly = EINA_TRUE; -#endif +#endif _e_wid_fprev_preview_fs_widgets(wd, EINA_TRUE); - + //------------------- if (mbused > 1024.0) snprintf(buf, sizeof(buf), "%1.2f Gb", mbused / 1024.0); @@ -521,7 +521,7 @@ _e_wid_fprev_preview_file(E_Widget_Data *wd) //------------------- if (mpoint[0]) { - if (rdonly) + if (rdonly) e_widget_entry_text_set(wd->o_preview_perms_entry, _("Read Only")); else e_widget_entry_text_set(wd->o_preview_perms_entry, _("Read-Write")); @@ -593,7 +593,6 @@ _e_wid_fprev_preview_file(E_Widget_Data *wd) wd->is_dir = S_ISDIR(st.st_mode); if (wd->mime && st.st_size && (!wd->is_dir)) { - wd->is_txt = !strncmp(wd->mime, "text/", 5); if (!wd->is_txt) wd->is_txt = !strcmp(wd->mime, "application/x-shellscript"); @@ -623,7 +622,6 @@ _e_wid_fprev_preview_file(E_Widget_Data *wd) free(mtime); } - static char * _e_wid_file_size_get(off_t st_size) { @@ -746,7 +744,7 @@ static void _e_wid_fprev_preview_reset(E_Widget_Data *wd) { Evas_Object *o; - + evas_object_del(wd->o_preview_scrollframe); wd->o_preview_scrollframe = wd->o_preview_preview = NULL; if (wd->preview_text_file_thread) ecore_thread_cancel(wd->preview_text_file_thread); @@ -768,7 +766,6 @@ _e_wid_fprev_preview_reset(E_Widget_Data *wd) 1, 1, 0.5); } - static void _e_wid_cb_selected(void *data, Evas_Object *obj, void *event __UNUSED__) { @@ -1049,3 +1046,4 @@ e_widget_filepreview_filemode_force(Evas_Object *obj) if (!wd) return; _e_wid_fprev_preview_file_widgets(wd, 0, 0); } + diff --git a/src/bin/e_widget_flist.c b/src/bin/e_widget_flist.c index 9d3fda1ce..84bf36277 100644 --- a/src/bin/e_widget_flist.c +++ b/src/bin/e_widget_flist.c @@ -235,3 +235,4 @@ _e_wid_cb_file_deleted(void *data, Evas_Object *obj __UNUSED__, void *event) { evas_object_smart_callback_call(data, "files_deleted", event); } + diff --git a/src/bin/e_widget_font_preview.c b/src/bin/e_widget_font_preview.c index d9d8314ee..56b67bcc4 100644 --- a/src/bin/e_widget_font_preview.c +++ b/src/bin/e_widget_font_preview.c @@ -38,7 +38,7 @@ e_widget_font_preview_add(Evas *evas, const char *text) o = edje_object_add(evas); wd->o_text = o; e_theme_edje_object_set(o, "base/theme/widgets", - "e/widgets/fontpreview"); + "e/widgets/fontpreview"); evas_object_event_callback_add(wd->o_scrollframe, EVAS_CALLBACK_RESIZE, _e_wid_cb_scrollframe_resize, wd); e_scrollframe_child_set(wd->o_scrollframe, o); e_widget_sub_object_add(obj, o); @@ -67,7 +67,6 @@ e_widget_font_preview_font_set(Evas_Object *obj, const char *font, Evas_Font_Siz edje_object_text_class_set(wd->o_text, "_e_font_preview", font, size); } - static void _e_wid_del_hook(Evas_Object *obj) { @@ -97,3 +96,4 @@ _e_wid_focus_steal(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, { e_widget_focus_steal(data); } + diff --git a/src/bin/e_widget_framelist.c b/src/bin/e_widget_framelist.c index 38daf7954..1a0518b6f 100644 --- a/src/bin/e_widget_framelist.c +++ b/src/bin/e_widget_framelist.c @@ -29,7 +29,7 @@ e_widget_framelist_add(Evas *evas, const char *label, int horiz) o = edje_object_add(evas); wd->o_frame = o; e_theme_edje_object_set(o, "base/theme/widgets", - "e/widgets/frame"); + "e/widgets/frame"); edje_object_part_text_set(o, "e.text.label", label); evas_object_show(o); e_widget_sub_object_add(obj, o); @@ -60,12 +60,12 @@ e_widget_framelist_object_append_full(Evas_Object *obj, Evas_Object *sobj, int f e_box_pack_end(wd->o_box, sobj); e_widget_size_min_get(sobj, &mw, &mh); e_box_pack_options_set(sobj, - fill_w, fill_h, - expand_w, expand_h, - align_x, align_y, - min_w, min_h, - max_w, max_h - ); + fill_w, fill_h, + expand_w, expand_h, + align_x, align_y, + min_w, min_h, + max_w, max_h + ); e_box_size_min_get(wd->o_box, &mw, &mh); edje_extern_object_min_size_set(wd->o_box, mw, mh); edje_object_part_swallow(wd->o_frame, "e.swallow.content", wd->o_box); @@ -86,12 +86,12 @@ e_widget_framelist_object_append(Evas_Object *obj, Evas_Object *sobj) e_box_pack_end(wd->o_box, sobj); e_widget_size_min_get(sobj, &mw, &mh); e_box_pack_options_set(sobj, - 1, 1, /* fill */ - 1, 1, /* expand */ - 0.5, 0.5, /* align */ - mw, mh, /* min */ - 99999, 99999 /* max */ - ); + 1, 1, /* fill */ + 1, 1, /* expand */ + 0.5, 0.5, /* align */ + mw, mh, /* min */ + 99999, 99999 /* max */ + ); e_box_size_min_get(wd->o_box, &mw, &mh); edje_extern_object_min_size_set(wd->o_box, mw, mh); edje_object_part_swallow(wd->o_frame, "e.swallow.content", wd->o_box); @@ -119,7 +119,6 @@ e_widget_framelist_label_set(Evas_Object *obj, const char *label) edje_object_part_text_set(wd->o_frame, "e.text.label", label); } - static void _e_wid_del_hook(Evas_Object *obj) { @@ -140,3 +139,4 @@ _e_wid_disable_hook(Evas_Object *obj) else edje_object_signal_emit(wd->o_frame, "e,state,enabled", "e"); } + diff --git a/src/bin/e_widget_fsel.c b/src/bin/e_widget_fsel.c index 21380e20b..e92a388de 100644 --- a/src/bin/e_widget_fsel.c +++ b/src/bin/e_widget_fsel.c @@ -19,17 +19,17 @@ struct _E_Widget_Data Evas_Object *o_entry; Evas_Coord preview_w, preview_h; char *entry_text; - const char *path; + const char *path; void (*sel_func)(void *data, Evas_Object *obj); void *sel_data; void (*chg_func)(void *data, Evas_Object *obj); void *chg_data; int preview; - Eina_Bool nochange : 1; // block changing of entry - Eina_Bool fprev : 1; // current fprev is dir + Eina_Bool nochange : 1; // block changing of entry + Eina_Bool fprev : 1; // current fprev is dir }; -static void _e_wid_del_hook(Evas_Object *obj); +static void _e_wid_del_hook(Evas_Object *obj); /* local subsystem functions */ static void @@ -214,7 +214,7 @@ _e_wid_fsel_sel_chg(E_Widget_Data *wd, Evas_Object *fm) rp = e_widget_entry_text_get(wd->o_entry); if (wd->nochange && rp && rp[0]) return; preview = !!fm; - fm = fm ?: wd->o_files_fm; + fm = fm ? : wd->o_files_fm; wd->fprev = (fm != wd->o_files_fm); selected = e_fm2_selected_list_get(fm); if (!selected) return; @@ -344,14 +344,14 @@ e_widget_fsel_add(Evas *evas, const char *dev, const char *path, char *selected, if (preview) { Evas_Coord mw2, mh2; - + wd->o_preview_frame = e_widget_framelist_add(evas, _("Preview"), 0); wd->o_preview = e_widget_filepreview_add(evas, 128, 128, 0); e_widget_filepreview_filemode_force(wd->o_preview); e_widget_framelist_object_append(wd->o_preview_frame, wd->o_preview); evas_object_smart_callback_add(wd->o_preview, "selected", _e_wid_fsel_preview_file_selected, wd); - + e_widget_size_min_get(wd->o_preview, &mw, &mh); e_widget_size_min_get(wd->o_preview_frame, &mw2, &mh2); /* need size of preview here or min size will be off */ @@ -564,3 +564,4 @@ _e_wid_del_hook(Evas_Object *obj) free(wd); } + diff --git a/src/bin/e_widget_ilist.c b/src/bin/e_widget_ilist.c index a4e338491..3279801e3 100644 --- a/src/bin/e_widget_ilist.c +++ b/src/bin/e_widget_ilist.c @@ -8,7 +8,7 @@ struct _E_Widget_Data { Evas_Object *o_widget, *o_scrollframe, *o_ilist; Eina_List *callbacks; - const char **value; + const char **value; struct { Eina_List *queue; @@ -21,8 +21,8 @@ struct _E_Widget_Data struct _E_Widget_Callback { - void (*func)(void *data); - void *data; + void (*func)(void *data); + void *data; const char *value; }; diff --git a/src/bin/e_widget_image.c b/src/bin/e_widget_image.c index 46018b965..26ce53d14 100644 --- a/src/bin/e_widget_image.c +++ b/src/bin/e_widget_image.c @@ -4,7 +4,7 @@ typedef struct _E_Widget_Data E_Widget_Data; struct _E_Widget_Data { Evas_Object *img; - int minw, minh; + int minw, minh; }; static void _e_wid_del_hook(Evas_Object *obj); @@ -112,3 +112,4 @@ _e_wid_del_hook(Evas_Object *obj) wd = e_widget_data_get(obj); free(wd); } + diff --git a/src/bin/e_widget_label.c b/src/bin/e_widget_label.c index ee839b2e3..9d4bb6e53 100644 --- a/src/bin/e_widget_label.c +++ b/src/bin/e_widget_label.c @@ -11,8 +11,8 @@ static void _e_wid_del_hook(Evas_Object *obj); static void _e_wid_disable_hook(Evas_Object *obj); /* externally accessible functions */ -/** - * Creates a new label widget +/** + * Creates a new label widget * * @param evas pointer * @param text to assign to the widget @@ -33,7 +33,7 @@ e_widget_label_add(Evas *evas, const char *label) o = edje_object_add(evas); e_theme_edje_object_set(o, "base/theme/widgets", - "e/widgets/label"); + "e/widgets/label"); wd->text = o; edje_object_part_text_set(o, "e.text.label", label); evas_object_show(o); @@ -46,8 +46,8 @@ e_widget_label_add(Evas *evas, const char *label) return obj; } -/** - * Changes the text for the label +/** + * Changes the text for the label * * @param the label widget * @param text to assign to the widget @@ -85,3 +85,4 @@ _e_wid_disable_hook(Evas_Object *obj) else edje_object_signal_emit(wd->text, "e,state,enabled", "e"); } + diff --git a/src/bin/e_widget_list.c b/src/bin/e_widget_list.c index b42bd844c..c84fb6dca 100644 --- a/src/bin/e_widget_list.c +++ b/src/bin/e_widget_list.c @@ -11,8 +11,8 @@ static void _e_wid_del_hook(Evas_Object *obj); /* local subsystem functions */ /* externally accessible functions */ -/** - * Creates a new list widget +/** + * Creates a new list widget * * @param evas the evas pointer * @param homogenous should widgets append to the list be evenly spaced out @@ -42,13 +42,13 @@ e_widget_list_add(Evas *evas, int homogenous, int horiz) return obj; } -/** - * Prepend a widget to the list +/** + * Prepend a widget to the list * * @param obj the list widget to prepend the sub widget too * @param sobj the sub widget * @param fill DOCUMENT ME! - * @param expand DOCUMENT ME! + * @param expand DOCUMENT ME! * @param align who the sub widget to be aligned, to wards the center or sides * @return the new list wdiget */ @@ -65,33 +65,33 @@ e_widget_list_object_prepend(Evas_Object *obj, Evas_Object *sobj, int fill, int e_widget_size_min_get(sobj, &mw, &mh); if (e_box_orientation_get(wd->o_box) == 1) e_box_pack_options_set(sobj, - 1, fill, /* fill */ - expand, expand, /* expand */ - 0.5, align, /* align */ - mw, mh, /* min */ - 99999, 99999 /* max */ - ); + 1, fill, /* fill */ + expand, expand, /* expand */ + 0.5, align, /* align */ + mw, mh, /* min */ + 99999, 99999 /* max */ + ); else e_box_pack_options_set(sobj, - fill, 1, /* fill */ - expand, expand, /* expand */ - align, 0.5, /* align */ - mw, mh, /* min */ - 99999, 99999 /* max */ - ); + fill, 1, /* fill */ + expand, expand, /* expand */ + align, 0.5, /* align */ + mw, mh, /* min */ + 99999, 99999 /* max */ + ); e_box_size_min_get(wd->o_box, &mw, &mh); e_widget_size_min_set(obj, mw, mh); e_widget_sub_object_add(obj, sobj); evas_object_show(sobj); } -/** - * Append a widget to the list +/** + * Append a widget to the list * * @param obj the list widget to append the sub widget too * @param sobj the sub widget * @param fill DOCUMENT ME! - * @param expand DOCUMENT ME! + * @param expand DOCUMENT ME! * @param align who the sub widget to be aligned, to wards the center or sides * @return the new list wdiget */ @@ -108,20 +108,20 @@ e_widget_list_object_append(Evas_Object *obj, Evas_Object *sobj, int fill, int e e_widget_size_min_get(sobj, &mw, &mh); if (e_box_orientation_get(wd->o_box) == 1) e_box_pack_options_set(sobj, - 1, fill, /* fill */ - expand, expand, /* expand */ - 0.5, align, /* align */ - mw, mh, /* min */ - 99999, 99999 /* max */ - ); + 1, fill, /* fill */ + expand, expand, /* expand */ + 0.5, align, /* align */ + mw, mh, /* min */ + 99999, 99999 /* max */ + ); else e_box_pack_options_set(sobj, - fill, 1, /* fill */ - expand, expand, /* expand */ - align, 0.5, /* align */ - mw, mh, /* min */ - 99999, 99999 /* max */ - ); + fill, 1, /* fill */ + expand, expand, /* expand */ + align, 0.5, /* align */ + mw, mh, /* min */ + 99999, 99999 /* max */ + ); e_box_size_min_get(wd->o_box, &mw, &mh); e_widget_size_min_set(obj, mw, mh); e_widget_sub_object_add(obj, sobj); @@ -140,20 +140,20 @@ e_widget_list_object_repack(Evas_Object *obj, Evas_Object *sobj, int fill, int e e_widget_size_min_get(sobj, &mw, &mh); if (e_box_orientation_get(wd->o_box) == 1) e_box_pack_options_set(sobj, - 1, fill, /* fill */ - expand, expand, /* expand */ - 0.5, align, /* align */ - mw, mh, /* min */ - 99999, 99999 /* max */ - ); + 1, fill, /* fill */ + expand, expand, /* expand */ + 0.5, align, /* align */ + mw, mh, /* min */ + 99999, 99999 /* max */ + ); else e_box_pack_options_set(sobj, - fill, 1, /* fill */ - expand, expand, /* expand */ - align, 0.5, /* align */ - mw, mh, /* min */ - 99999, 99999 /* max */ - ); + fill, 1, /* fill */ + expand, expand, /* expand */ + align, 0.5, /* align */ + mw, mh, /* min */ + 99999, 99999 /* max */ + ); e_box_size_min_get(wd->o_box, &mw, &mh); e_widget_size_min_set(obj, mw, mh); } @@ -173,3 +173,4 @@ _e_wid_del_hook(Evas_Object *obj) wd = e_widget_data_get(obj); free(wd); } + diff --git a/src/bin/e_widget_scrollframe.c b/src/bin/e_widget_scrollframe.c index b36225af4..2d7c262ce 100644 --- a/src/bin/e_widget_scrollframe.c +++ b/src/bin/e_widget_scrollframe.c @@ -171,3 +171,4 @@ _e_wid_cb_scrollframe_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj, v if (w != vw) evas_object_resize(data, vw, h); } } + diff --git a/src/bin/e_widget_slider.c b/src/bin/e_widget_slider.c index 1808db860..da657f815 100644 --- a/src/bin/e_widget_slider.c +++ b/src/bin/e_widget_slider.c @@ -45,7 +45,8 @@ e_widget_slider_add(Evas *evas, int horiz, int rev, const char *fmt, double min, e_slider_value_step_count_set(o, count); e_slider_value_step_size_set(o, step); if (dval) e_slider_value_set(o, *dval); - else if (ival) e_slider_value_set(o, *ival); + else if (ival) + e_slider_value_set(o, *ival); e_slider_size_min_get(o, &mw, &mh); if (horiz) @@ -198,13 +199,13 @@ _e_wid_focus_hook(Evas_Object *obj) wd = e_widget_data_get(obj); if (e_widget_focus_get(obj)) { - edje_object_signal_emit(e_slider_edje_object_get(wd->o_slider), "e,state,focused", "e"); - evas_object_focus_set(wd->o_slider, 1); + edje_object_signal_emit(e_slider_edje_object_get(wd->o_slider), "e,state,focused", "e"); + evas_object_focus_set(wd->o_slider, 1); } else { - edje_object_signal_emit(e_slider_edje_object_get(wd->o_slider), "e,state,unfocused", "e"); - evas_object_focus_set(wd->o_slider, 0); + edje_object_signal_emit(e_slider_edje_object_get(wd->o_slider), "e,state,unfocused", "e"); + evas_object_focus_set(wd->o_slider, 0); } } @@ -221,7 +222,8 @@ _e_wid_cb_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UN wd = data; if (wd->dval) *(wd->dval) = e_slider_value_get(wd->o_slider); - else if (wd->ival) *(wd->ival) = e_slider_value_get(wd->o_slider); + else if (wd->ival) + *(wd->ival) = e_slider_value_get(wd->o_slider); e_widget_change(wd->o_widget); evas_object_smart_callback_call(wd->o_widget, "changed", NULL); } @@ -237,8 +239,9 @@ _e_wid_disable_hook(Evas_Object *obj) e_slider_disabled_set(wd->o_slider, disable); if (disable) edje_object_signal_emit(e_slider_edje_object_get(wd->o_slider), - "e,state,disabled", "e"); + "e,state,disabled", "e"); else edje_object_signal_emit(e_slider_edje_object_get(wd->o_slider), - "e,state,enabled", "e"); + "e,state,enabled", "e"); } + diff --git a/src/bin/e_widget_spectrum.c b/src/bin/e_widget_spectrum.c index b6ae029b1..4649dbd47 100644 --- a/src/bin/e_widget_spectrum.c +++ b/src/bin/e_widget_spectrum.c @@ -4,14 +4,14 @@ typedef struct _E_Widget_Data E_Widget_Data; struct _E_Widget_Data { - Evas_Object *o_edje; - Evas_Object *o_spectrum; - Evas_Object *o_event; + Evas_Object *o_edje; + Evas_Object *o_spectrum; + Evas_Object *o_event; - E_Color *cv; + E_Color *cv; E_Color_Component mode; - int dragging; + int dragging; }; static void _e_wid_del_hook(Evas_Object *obj); @@ -49,7 +49,7 @@ e_widget_spectrum_add(Evas *evas, E_Color_Component mode, E_Color *cv) o = edje_object_add(evas); wd->o_edje = o; e_theme_edje_object_set(o, "base/theme/widgets", - "e/widgets/spectrum"); + "e/widgets/spectrum"); evas_object_show(o); edje_object_size_min_calc(o, &mw, &mh); @@ -98,31 +98,37 @@ e_widget_spectrum_update(Evas_Object *obj, int redraw) switch (wd->mode) { case E_COLOR_COMPONENT_R: - vy = wd->cv->g / 255.0; - vx = wd->cv->b / 255.0; - break; + vy = wd->cv->g / 255.0; + vx = wd->cv->b / 255.0; + break; + case E_COLOR_COMPONENT_G: - vy = wd->cv->b / 255.0; - vx = wd->cv->r / 255.0; - break; + vy = wd->cv->b / 255.0; + vx = wd->cv->r / 255.0; + break; + case E_COLOR_COMPONENT_B: - vy = wd->cv->r / 255.0; - vx = wd->cv->g / 255.0; - break; + vy = wd->cv->r / 255.0; + vx = wd->cv->g / 255.0; + break; + case E_COLOR_COMPONENT_H: - vy = wd->cv->s; - vx = wd->cv->v; - break; + vy = wd->cv->s; + vx = wd->cv->v; + break; + case E_COLOR_COMPONENT_S: - vy = wd->cv->v; - vx = wd->cv->h / 360.0; - break; + vy = wd->cv->v; + vx = wd->cv->h / 360.0; + break; + case E_COLOR_COMPONENT_V: - vy = wd->cv->h / 360.0; - vx = wd->cv->s; - break; - case E_COLOR_COMPONENT_MAX: - break; + vy = wd->cv->h / 360.0; + vx = wd->cv->s; + break; + + case E_COLOR_COMPONENT_MAX: + break; } edje_object_part_drag_value_set(wd->o_edje, "cursor", vx, vy); } @@ -159,7 +165,6 @@ _e_wid_resize(void *data, Evas_Object *o __UNUSED__, Evas_Coord w, Evas_Coord h) evas_object_resize(wd->o_event, w, h); } - static void _e_wid_del_hook(Evas_Object *obj) { @@ -177,13 +182,13 @@ _e_wid_focus_hook(Evas_Object *obj) wd = e_widget_data_get(obj); if (e_widget_focus_get(obj)) { - edje_object_signal_emit(wd->o_edje, "e,state,focused", "e"); - evas_object_focus_set(wd->o_edje, 1); + edje_object_signal_emit(wd->o_edje, "e,state,focused", "e"); + evas_object_focus_set(wd->o_edje, 1); } else { - edje_object_signal_emit(wd->o_edje, "e,state,unfocused", "e"); - evas_object_focus_set(wd->o_edje, 0); + edje_object_signal_emit(wd->o_edje, "e,state,unfocused", "e"); + evas_object_focus_set(wd->o_edje, 0); } } @@ -227,42 +232,47 @@ _e_wid_mouse_handle(Evas_Object *obj, int mx, int my) switch (wd->mode) { case E_COLOR_COMPONENT_R: - wd->cv->g = vy * 255; - wd->cv->b = vx * 255; - e_color_update_rgb(wd->cv); - break; + wd->cv->g = vy * 255; + wd->cv->b = vx * 255; + e_color_update_rgb(wd->cv); + break; + case E_COLOR_COMPONENT_G: - wd->cv->b = vy * 255; - wd->cv->r = vx * 255; - e_color_update_rgb(wd->cv); - break; + wd->cv->b = vy * 255; + wd->cv->r = vx * 255; + e_color_update_rgb(wd->cv); + break; + case E_COLOR_COMPONENT_B: - wd->cv->r = vy * 255; - wd->cv->g = vx * 255; - e_color_update_rgb(wd->cv); - break; + wd->cv->r = vy * 255; + wd->cv->g = vx * 255; + e_color_update_rgb(wd->cv); + break; + case E_COLOR_COMPONENT_H: - wd->cv->s = vy; - wd->cv->v = vx; - e_color_update_hsv(wd->cv); - break; + wd->cv->s = vy; + wd->cv->v = vx; + e_color_update_hsv(wd->cv); + break; + case E_COLOR_COMPONENT_S: - wd->cv->v = vy; - wd->cv->h = vx * 360; - e_color_update_hsv(wd->cv); - break; + wd->cv->v = vy; + wd->cv->h = vx * 360; + e_color_update_hsv(wd->cv); + break; + case E_COLOR_COMPONENT_V: - wd->cv->h = vy * 360; - wd->cv->s = vx; - e_color_update_hsv(wd->cv); - break; + wd->cv->h = vy * 360; + wd->cv->s = vx; + e_color_update_hsv(wd->cv); + break; + case E_COLOR_COMPONENT_MAX: - break; + break; } e_widget_change(obj); } - static void _e_wid_cb_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) { @@ -302,6 +312,7 @@ _e_wid_cb_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void if (wd->dragging == 1) { - _e_wid_mouse_handle(o_wid, ev->cur.canvas.x, ev->cur.canvas.y); + _e_wid_mouse_handle(o_wid, ev->cur.canvas.x, ev->cur.canvas.y); } } + diff --git a/src/bin/e_widget_textblock.c b/src/bin/e_widget_textblock.c index bc946918c..e7f0760b8 100644 --- a/src/bin/e_widget_textblock.c +++ b/src/bin/e_widget_textblock.c @@ -34,7 +34,7 @@ e_widget_textblock_add(Evas *evas) o = edje_object_add(evas); e_theme_edje_object_set(o, "base/theme/widgets", - "e/widgets/textblock"); + "e/widgets/textblock"); wd->o_textblock = o; evas_object_event_callback_add(wd->o_scrollframe, EVAS_CALLBACK_RESIZE, _e_wid_cb_scrollframe_resize, wd); evas_object_event_callback_add(wd->o_textblock, EVAS_CALLBACK_RESIZE, _e_wid_cb_scrollframe_resize, wd); @@ -75,8 +75,8 @@ e_widget_textblock_plain_set(Evas_Object *obj, const char *text) if (!text) { - e_widget_textblock_markup_set(obj, NULL); - return; + e_widget_textblock_markup_set(obj, NULL); + return; } mlen = strlen(text); /* need to look for these and replace with a new string (on the right) @@ -88,49 +88,52 @@ e_widget_textblock_plain_set(Evas_Object *obj, const char *text) */ for (p = text; *p != 0; p++) { - if (*p == '\n') mlen += 4 - 1; - else if (*p == '\t') mlen += 8 - 1; - else if (*p == '<') mlen += 4 - 1; - else if (*p == '>') mlen += 4 - 1; - else if (*p == '&') mlen += 5 - 1; + if (*p == '\n') mlen += 4 - 1; + else if (*p == '\t') + mlen += 8 - 1; + else if (*p == '<') + mlen += 4 - 1; + else if (*p == '>') + mlen += 4 - 1; + else if (*p == '&') + mlen += 5 - 1; } markup = alloca(mlen + 1); if (!markup) return; markup[0] = 0; for (d = markup, p = text; *p != 0; p++, d++) { - if (*p == '\n') - { - strcpy(d, "
"); - d += 4 - 1; - } - else if (*p == '\t') - { - strcpy(d, " "); - d += 8 - 1; - } - else if (*p == '<') - { - strcpy(d, "<"); - d += 4 - 1; - } - else if (*p == '>') - { - strcpy(d, ">"); - d += 4 - 1; - } - else if (*p == '&') - { - strcpy(d, "&"); - d += 5 - 1; - } - else *d = *p; + if (*p == '\n') + { + strcpy(d, "
"); + d += 4 - 1; + } + else if (*p == '\t') + { + strcpy(d, " "); + d += 8 - 1; + } + else if (*p == '<') + { + strcpy(d, "<"); + d += 4 - 1; + } + else if (*p == '>') + { + strcpy(d, ">"); + d += 4 - 1; + } + else if (*p == '&') + { + strcpy(d, "&"); + d += 5 - 1; + } + else *d = *p; } *d = 0; e_widget_textblock_markup_set(obj, markup); } - static void _e_wid_del_hook(Evas_Object *obj) { @@ -148,13 +151,13 @@ _e_wid_focus_hook(Evas_Object *obj) wd = e_widget_data_get(obj); if (e_widget_focus_get(obj)) { - edje_object_signal_emit(e_scrollframe_edje_object_get(wd->o_scrollframe), "e,state,focused", "e"); - evas_object_focus_set(wd->o_scrollframe, 1); + edje_object_signal_emit(e_scrollframe_edje_object_get(wd->o_scrollframe), "e,state,focused", "e"); + evas_object_focus_set(wd->o_scrollframe, 1); } else { - edje_object_signal_emit(e_scrollframe_edje_object_get(wd->o_scrollframe), "e,state,unfocused", "e"); - evas_object_focus_set(wd->o_scrollframe, 0); + edje_object_signal_emit(e_scrollframe_edje_object_get(wd->o_scrollframe), "e,state,unfocused", "e"); + evas_object_focus_set(wd->o_scrollframe, 0); } } @@ -177,3 +180,4 @@ _e_wid_focus_steal(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, { e_widget_focus_steal(data); } + diff --git a/src/bin/e_widget_toolbar.c b/src/bin/e_widget_toolbar.c index 8008ea1e9..c43204410 100644 --- a/src/bin/e_widget_toolbar.c +++ b/src/bin/e_widget_toolbar.c @@ -1,22 +1,22 @@ #include "e.h" typedef struct _E_Widget_Data E_Widget_Data; -typedef struct _Item Item; +typedef struct _Item Item; struct _E_Widget_Data { Evas_Object *o_base, *o_box; - int icon_w, icon_h; - Eina_List *items; - Eina_Bool scrollable : 1; - Eina_Bool focus_steal : 1; + int icon_w, icon_h; + Eina_List *items; + Eina_Bool scrollable : 1; + Eina_Bool focus_steal : 1; }; struct _Item { Evas_Object *o_toolbar, *o_base, *o_icon; - void (*func) (void *data1, void *data2); - const void *data1, *data2; - Eina_Bool selected : 1; + void (*func)(void *data1, void *data2); + const void *data1, *data2; + Eina_Bool selected : 1; }; static void _e_wid_del_hook(Evas_Object *obj); @@ -122,7 +122,7 @@ e_widget_toolbar_item_label_get(void *item) } EAPI void -e_widget_toolbar_item_append(Evas_Object *obj, Evas_Object *icon, const char *label, void (*func) (void *data1, void *data2), const void *data1, const void *data2) +e_widget_toolbar_item_append(Evas_Object *obj, Evas_Object *icon, const char *label, void (*func)(void *data1, void *data2), const void *data1, const void *data2) { E_Widget_Data *wd; Evas_Object *o; @@ -160,12 +160,12 @@ e_widget_toolbar_item_append(Evas_Object *obj, Evas_Object *icon, const char *la e_widget_sub_object_add(obj, o); e_box_pack_end(wd->o_box, o); e_box_pack_options_set(o, - 1, 1, /* fill */ - 0, 0, /* expand */ - 0.5, 0.5, /* align */ - mw, mh, /* min */ - 9999, 9999 /* max */ - ); + 1, 1, /* fill */ + 0, 0, /* expand */ + 0.5, 0.5, /* align */ + mw, mh, /* min */ + 9999, 9999 /* max */ + ); evas_object_show(o); e_box_size_min_get(wd->o_box, &mw, &mh); evas_object_resize(wd->o_box, mw, mh); @@ -189,10 +189,10 @@ e_widget_toolbar_item_remove(Evas_Object *obj, int num) it = eina_list_nth(wd->items, num); if (it) { - evas_object_del(it->o_base); - if (it->o_icon) evas_object_del(it->o_icon); - wd->items = eina_list_remove(wd->items, it); - E_FREE(it); + evas_object_del(it->o_base); + if (it->o_icon) evas_object_del(it->o_icon); + wd->items = eina_list_remove(wd->items, it); + E_FREE(it); } } @@ -216,7 +216,7 @@ e_widget_toolbar_item_select(Evas_Object *obj, int num) { if (it->selected) _item_unselect(it); } - i++; + i++; } } @@ -231,17 +231,17 @@ e_widget_toolbar_item_label_set(Evas_Object *obj, int num, const char *label) it = eina_list_nth(wd->items, num); if (it) { - int mw, mh; + int mw, mh; - edje_object_part_text_set(it->o_base, "e.text.label", label); - edje_object_size_min_calc(it->o_base, &mw, &mh); - e_box_pack_options_set(it->o_base, - 1, 1, /* fill */ - 0, 0, /* expand */ - 0.5, 0.5, /* align */ - mw, mh, /* min */ - 9999, 9999 /* max */ - ); + edje_object_part_text_set(it->o_base, "e.text.label", label); + edje_object_size_min_calc(it->o_base, &mw, &mh); + e_box_pack_options_set(it->o_base, + 1, 1, /* fill */ + 0, 0, /* expand */ + 0.5, 0.5, /* align */ + mw, mh, /* min */ + 9999, 9999 /* max */ + ); } } @@ -275,17 +275,17 @@ e_widget_toolbar_focus_steal_set(Evas_Object *obj, Eina_Bool steal) if (wd->focus_steal == steal) return; if (steal) { - evas_object_event_callback_add(e_scrollframe_edje_object_get(wd->o_base), - EVAS_CALLBACK_MOUSE_DOWN, - _e_wid_focus_steal, obj); - wd->focus_steal = EINA_TRUE; + evas_object_event_callback_add(e_scrollframe_edje_object_get(wd->o_base), + EVAS_CALLBACK_MOUSE_DOWN, + _e_wid_focus_steal, obj); + wd->focus_steal = EINA_TRUE; } else { - evas_object_event_callback_del(e_scrollframe_edje_object_get(wd->o_base), - EVAS_CALLBACK_MOUSE_DOWN, - _e_wid_focus_steal); - wd->focus_steal = EINA_FALSE; + evas_object_event_callback_del(e_scrollframe_edje_object_get(wd->o_base), + EVAS_CALLBACK_MOUSE_DOWN, + _e_wid_focus_steal); + wd->focus_steal = EINA_FALSE; } } @@ -397,8 +397,8 @@ _e_wid_signal_prev(void *data, Evas_Object *obj __UNUSED__, const char *emission } if ((it) && (it2) && (it != it2)) { - _item_unselect(it); - _item_select(it2); + _item_unselect(it); + _item_select(it2); } } @@ -422,8 +422,8 @@ _e_wid_signal_next(void *data, Evas_Object *obj __UNUSED__, const char *emission } if ((it) && (it2) && (it != it2)) { - _item_unselect(it); - _item_select(it2); + _item_unselect(it); + _item_select(it2); } } @@ -469,11 +469,11 @@ _e_wid_cb_key_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED_ if ((!strcmp(ev->keyname, "Up")) || (!strcmp(ev->keyname, "KP_Up")) || (!strcmp(ev->keyname, "Left")) || (!strcmp(ev->keyname, "KP_Left"))) { - EINA_LIST_FOREACH(wd->items, l, it) + EINA_LIST_FOREACH(wd->items, l, it) { if (it->selected) { - l2 = eina_list_prev(l); + l2 = eina_list_prev(l); if (l2) it2 = eina_list_data_get(l2); break; } @@ -484,11 +484,11 @@ _e_wid_cb_key_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED_ (!strcmp(ev->keyname, "Right")) || (!strcmp(ev->keyname, "KP_Right"))) { - EINA_LIST_FOREACH(wd->items, l, it) + EINA_LIST_FOREACH(wd->items, l, it) { if (it->selected) { - l2 = eina_list_next(l); + l2 = eina_list_next(l); if (l2) it2 = eina_list_data_get(l2); break; } @@ -497,30 +497,30 @@ _e_wid_cb_key_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED_ else if ((!strcmp(ev->keyname, "Home")) || (!strcmp(ev->keyname, "KP_Home"))) { - EINA_LIST_FOREACH(wd->items, l, it) - { - if (it->selected) - { - it2 = eina_list_data_get(wd->items); - break; - } - } + EINA_LIST_FOREACH(wd->items, l, it) + { + if (it->selected) + { + it2 = eina_list_data_get(wd->items); + break; + } + } } else if ((!strcmp(ev->keyname, "End")) || (!strcmp(ev->keyname, "KP_End"))) { EINA_LIST_FOREACH(wd->items, l, it) { - if (it->selected) - { - it2 = eina_list_last_data_get(wd->items); - break; - } + if (it->selected) + { + it2 = eina_list_last_data_get(wd->items); + break; + } } } if ((it) && (it2) && (it != it2)) { - _item_unselect(it); - _item_select(it2); + _item_unselect(it); + _item_select(it2); } } @@ -590,3 +590,4 @@ _item_unselect(Item *it) e_icon_selected_set(it->o_icon, EINA_FALSE); } } + diff --git a/src/bin/e_widget_toolbook.c b/src/bin/e_widget_toolbook.c index e16929e20..115b455b4 100644 --- a/src/bin/e_widget_toolbook.c +++ b/src/bin/e_widget_toolbook.c @@ -4,7 +4,7 @@ typedef struct _E_Widget_Data E_Widget_Data; struct _E_Widget_Data { Evas_Object *o_widget, *o_tb, *o_bar; - Eina_List *content; + Eina_List *content; }; static void _e_wid_del_hook(Evas_Object *obj); @@ -94,3 +94,4 @@ _item_sel(void *data1, void *data2) else evas_object_hide(o); } } + diff --git a/src/bin/e_win.c b/src/bin/e_win.c index 25ac750ea..430706e31 100644 --- a/src/bin/e_win.c +++ b/src/bin/e_win.c @@ -20,22 +20,22 @@ static Eina_List *wins = NULL; typedef struct _Elm_Win_Trap_Ctx { - E_Border *border; + E_Border *border; Ecore_X_Window xwin; - Eina_Bool centered:1; - Eina_Bool placed:1; + Eina_Bool centered : 1; + Eina_Bool placed : 1; } Elm_Win_Trap_Ctx; static void _elm_win_prop_update(Elm_Win_Trap_Ctx *ctx) { ecore_x_icccm_size_pos_hints_set(ctx->xwin, - ctx->border->placed, ctx->border->client.icccm.gravity, - ctx->border->client.icccm.min_w, ctx->border->client.icccm.min_h, - ctx->border->client.icccm.max_w, ctx->border->client.icccm.max_h, - ctx->border->client.icccm.base_w, ctx->border->client.icccm.base_h, - ctx->border->client.icccm.step_w, ctx->border->client.icccm.step_h, - ctx->border->client.icccm.min_aspect, ctx->border->client.icccm.max_aspect); + ctx->border->placed, ctx->border->client.icccm.gravity, + ctx->border->client.icccm.min_w, ctx->border->client.icccm.min_h, + ctx->border->client.icccm.max_w, ctx->border->client.icccm.max_h, + ctx->border->client.icccm.base_w, ctx->border->client.icccm.base_h, + ctx->border->client.icccm.step_w, ctx->border->client.icccm.step_h, + ctx->border->client.icccm.min_aspect, ctx->border->client.icccm.max_aspect); } static void * @@ -102,7 +102,7 @@ _elm_win_trap_show(void *data, Evas_Object *o) eina_stringshare_replace(&ctx->border->bordername, "borderless"); ctx->border->client.border.changed = 1; ctx->border->client.netwm.state.skip_pager = - ctx->border->client.netwm.state.skip_taskbar = 1; + ctx->border->client.netwm.state.skip_taskbar = 1; ctx->border->client.icccm.accepts_focus = 0; } } @@ -196,44 +196,44 @@ _elm_win_trap_size_base_set(void *data, Evas_Object *o __UNUSED__, int w, int h) } static const Elm_Win_Trap _elm_win_trap = { - ELM_WIN_TRAP_VERSION, - _elm_win_trap_add, - _elm_win_trap_del, - _elm_win_trap_hide, - _elm_win_trap_show, - _elm_win_trap_move, - _elm_win_trap_resize, - _elm_win_trap_center, - _elm_win_trap_lower, - _elm_win_trap_raise, - _elm_win_trap_activate, - /* alpha_set */ NULL, - /* aspect_set */ NULL, - /* avoid_damage_set */ NULL, - /* borderless_set */ NULL, - /* demand_attention_set */ NULL, - /* focus_skip_set */ NULL, - /* fullscreen_set */ NULL, - /* iconified_set */ NULL, - /* layer_set */ NULL, - /* manual_render_set */ NULL, - /* maximized_set */ NULL, - /* modal_set */ NULL, - /* name_class_set */ NULL, - /* object_cursor_set */ NULL, - /* override_set */ NULL, - /* rotation_set */ NULL, - /* rotation_with_resize_set */ NULL, - /* shaped_set */ NULL, - _elm_win_trap_size_base_set, - /* size_step_set */ NULL, - /* size_min_set */ NULL, - /* size_max_set */ NULL, - /* sticky_set */ NULL, - /* title_set */ NULL, - /* urgent_set */ NULL, - /* withdrawn_set */ NULL - }; + ELM_WIN_TRAP_VERSION, + _elm_win_trap_add, + _elm_win_trap_del, + _elm_win_trap_hide, + _elm_win_trap_show, + _elm_win_trap_move, + _elm_win_trap_resize, + _elm_win_trap_center, + _elm_win_trap_lower, + _elm_win_trap_raise, + _elm_win_trap_activate, + /* alpha_set */ NULL, + /* aspect_set */ NULL, + /* avoid_damage_set */ NULL, + /* borderless_set */ NULL, + /* demand_attention_set */ NULL, + /* focus_skip_set */ NULL, + /* fullscreen_set */ NULL, + /* iconified_set */ NULL, + /* layer_set */ NULL, + /* manual_render_set */ NULL, + /* maximized_set */ NULL, + /* modal_set */ NULL, + /* name_class_set */ NULL, + /* object_cursor_set */ NULL, + /* override_set */ NULL, + /* rotation_set */ NULL, + /* rotation_with_resize_set */ NULL, + /* shaped_set */ NULL, + _elm_win_trap_size_base_set, + /* size_step_set */ NULL, + /* size_min_set */ NULL, + /* size_max_set */ NULL, + /* sticky_set */ NULL, + /* title_set */ NULL, + /* urgent_set */ NULL, + /* withdrawn_set */ NULL +}; #endif /* externally accessible functions */ @@ -771,3 +771,4 @@ _e_win_cb_state(Ecore_Evas *ee) if (!win->border) return; win->border->changed = win->border->changes.size = 1; } + diff --git a/src/bin/e_xinerama.c b/src/bin/e_xinerama.c index 91b077bb6..487465786 100644 --- a/src/bin/e_xinerama.c +++ b/src/bin/e_xinerama.c @@ -120,7 +120,7 @@ _e_xinerama_update(void) E_Screen *screen; INF("E17 INIT: XINERAMA SCREEN: [%i][%i], %ix%i+%i+%i", - i, i, w, h, x, y); + i, i, w, h, x, y); /* add it to our list */ screen = E_NEW(E_Screen, 1); screen->screen = i; @@ -135,7 +135,7 @@ _e_xinerama_update(void) } } /* now go through all_screens... and build a list of chosen screens */ - EINA_LIST_FOREACH (all_screens, l, scr) + EINA_LIST_FOREACH(all_screens, l, scr) { Eina_List *ll; E_Screen *scr2; @@ -181,7 +181,7 @@ _e_xinerama_update(void) { scr->escreen = n; INF("E17 INIT: XINERAMA CHOSEN: [%i][%i], %ix%i+%i+%i", - scr->screen, scr->escreen, scr->w, scr->h, scr->x, scr->y); + scr->screen, scr->escreen, scr->w, scr->h, scr->x, scr->y); n++; } } @@ -205,3 +205,4 @@ _e_xinerama_cb_screen_sort(const void *data1, const void *data2) } return dif; } + diff --git a/src/bin/e_xsettings.c b/src/bin/e_xsettings.c index 14b7609ae..9f96d1e8c 100644 --- a/src/bin/e_xsettings.c +++ b/src/bin/e_xsettings.c @@ -7,41 +7,50 @@ //#include /* For CARD16 */ // define here to avoid needing x includes directly. -#define C16 unsigned short -#define C32 unsigned long +#define C16 unsigned short +#define C32 unsigned long -#define RETRY_TIMEOUT 2.0 +#define RETRY_TIMEOUT 2.0 -#define SETTING_TYPE_INT 0 -#define SETTING_TYPE_STRING 1 -#define SETTING_TYPE_COLOR 2 +#define SETTING_TYPE_INT 0 +#define SETTING_TYPE_STRING 1 +#define SETTING_TYPE_COLOR 2 #define OFFSET_ADD(n) ((n + 4 - 1) & (~(4 - 1))) typedef struct _Settings_Manger Settings_Manager; -typedef struct _Setting Setting; +typedef struct _Setting Setting; struct _Settings_Manger { - E_Manager *man; + E_Manager *man; Ecore_X_Window selection; - Ecore_Timer *timer_retry; - unsigned long serial; - Ecore_X_Atom _atom_xsettings_screen; + Ecore_Timer *timer_retry; + unsigned long serial; + Ecore_X_Atom _atom_xsettings_screen; }; struct _Setting { - unsigned short type; + unsigned short type; - const char *name; + const char *name; - struct { const char *value; } s; - struct { int value; } i; - struct { unsigned short red, green, blue, alpha; } c; + struct + { + const char *value; + } s; + struct + { + int value; + } i; + struct + { + unsigned short red, green, blue, alpha; + } c; - unsigned long length; - unsigned long last_change; + unsigned long length; + unsigned long last_change; }; static void _e_xsettings_apply(Settings_Manager *sm); @@ -57,9 +66,9 @@ static Eio_File *eio_op = NULL; static Eina_Bool setting = EINA_FALSE; static Eina_Bool reset = EINA_FALSE; static const char _setting_icon_theme_name[] = "Net/IconThemeName"; -static const char _setting_theme_name[] = "Net/ThemeName"; -static const char _setting_font_name[] = "Gtk/FontName"; -static const char _setting_xft_dpi[] = "Xft/DPI"; +static const char _setting_theme_name[] = "Net/ThemeName"; +static const char _setting_font_name[] = "Gtk/FontName"; +static const char _setting_xft_dpi[] = "Xft/DPI"; static const char *_setting_theme = NULL; static unsigned int event_ignore = 0; @@ -88,7 +97,7 @@ _e_xsettings_selection_owner_set(Settings_Manager *sm) ret = (cur_selection == sm->selection); if (!ret) ERR("XSETTINGS: tried to set selection to %#x, but got %#x", - sm->selection, cur_selection); + sm->selection, cur_selection); return ret; } @@ -165,7 +174,7 @@ _e_xsettings_retry(Settings_Manager *sm) { if (sm->timer_retry) return; sm->timer_retry = ecore_timer_add - (RETRY_TIMEOUT, _e_xsettings_activate_retry, sm); + (RETRY_TIMEOUT, _e_xsettings_activate_retry, sm); } static void @@ -263,6 +272,7 @@ _e_xsettings_int_set(const char *name, int value, Eina_Bool set) s->length = 12; s->length += OFFSET_ADD(strlen(name)); } + #endif static unsigned char * @@ -292,30 +302,30 @@ _e_xsettings_copy(unsigned char *buffer, Setting *s) switch (s->type) { case SETTING_TYPE_INT: - *(C32 *)(buffer) = s->i.value; - buffer += 4; - break; + *(C32 *)(buffer) = s->i.value; + buffer += 4; + break; case SETTING_TYPE_STRING: - str_len = strlen (s->s.value); - *(C32 *)(buffer) = str_len; - buffer += 4; + str_len = strlen(s->s.value); + *(C32 *)(buffer) = str_len; + buffer += 4; - memcpy(buffer, s->s.value, str_len); - buffer += str_len; + memcpy(buffer, s->s.value, str_len); + buffer += str_len; - len = OFFSET_ADD(str_len) - str_len; - memset(buffer, 0, len); - buffer += len; - break; + len = OFFSET_ADD(str_len) - str_len; + memset(buffer, 0, len); + buffer += len; + break; case SETTING_TYPE_COLOR: - *(C16 *)(buffer) = s->c.red; - *(C16 *)(buffer + 2) = s->c.green; - *(C16 *)(buffer + 4) = s->c.blue; - *(C16 *)(buffer + 6) = s->c.alpha; - buffer += 8; - break; + *(C16 *)(buffer) = s->c.red; + *(C16 *)(buffer + 2) = s->c.green; + *(C16 *)(buffer + 4) = s->c.blue; + *(C16 *)(buffer + 6) = s->c.alpha; + buffer += 8; + break; } return buffer; @@ -337,15 +347,15 @@ _e_xsettings_apply(Settings_Manager *sm) if (!data) return; #if __BYTE_ORDER == __LITTLE_ENDIAN - *pos = 0;//LSBFirst + *pos = 0; //LSBFirst #else - *pos = 1;//MSBFirst + *pos = 1; //MSBFirst #endif pos += 4; - *(C32*)pos = sm->serial++; + *(C32 *)pos = sm->serial++; pos += 4; - *(C32*)pos = eina_list_count(settings); + *(C32 *)pos = eina_list_count(settings); pos += 4; EINA_LIST_FOREACH(settings, l, s) @@ -401,7 +411,7 @@ _e_xsettings_icon_theme_set(void) if (e_config->xsettings.net_icon_theme_name) { _e_xsettings_string_set(_setting_icon_theme_name, - e_config->xsettings.net_icon_theme_name); + e_config->xsettings.net_icon_theme_name); return; } @@ -416,11 +426,12 @@ _e_xsettings_error_cb(void *data, Eio_File *handler __UNUSED__, int error __UNUS { char buf[PATH_MAX]; if (reset || (!l)) l = efreet_data_dirs_get(); - else if (l) l = l->next; + else if (l) + l = l->next; reset = EINA_FALSE; if (l) { - snprintf(buf, sizeof(buf), "%s/themes/%s", (char*)eina_list_data_get(l), _setting_theme); + snprintf(buf, sizeof(buf), "%s/themes/%s", (char *)eina_list_data_get(l), _setting_theme); eio_op = eio_file_direct_stat(buf, _e_xsettings_done_cb, _e_xsettings_error_cb, l); return; } @@ -477,7 +488,7 @@ _e_xsettings_theme_set(void) if (e_config->xsettings.net_theme_name) { _e_xsettings_string_set(_setting_theme_name, - e_config->xsettings.net_theme_name); + e_config->xsettings.net_theme_name); return; } @@ -534,13 +545,12 @@ _e_xsettings_font_set(void) static void _e_xsettings_xft_set(void) { - if (e_config->scale.use_dpi) _e_xsettings_int_set(_setting_xft_dpi, e_config->scale.base_dpi, EINA_TRUE); else _e_xsettings_int_set(_setting_xft_dpi, 0, EINA_FALSE); - } + #endif static void @@ -555,16 +565,16 @@ _e_xsettings_cursor_path_set(void) path = getenv("XCURSOR_PATH"); if (path) { - if (!strstr(path, buf)) - { - snprintf(env, sizeof(env), "%s:%s", buf, path); - path = env; - } + if (!strstr(path, buf)) + { + snprintf(env, sizeof(env), "%s:%s", buf, path); + path = env; + } } else { - snprintf(env, sizeof(env), "%s:%s", buf, "/usr/share/icons"); - path = env; + snprintf(env, sizeof(env), "%s:%s", buf, "/usr/share/icons"); + path = env; } e_env_set("XCURSOR_PATH", path); } @@ -677,3 +687,4 @@ e_xsettings_config_update(void) } event_ignore++; } + diff --git a/src/bin/e_zone.c b/src/bin/e_zone.c index c7f372b11..63dceef82 100644 --- a/src/bin/e_zone.c +++ b/src/bin/e_zone.c @@ -4,35 +4,35 @@ * in a xinerama setup. Each zone has one or more desktops. */ -static void _e_zone_free(E_Zone *zone); -static void _e_zone_cb_bg_mouse_down(void *data, - Evas *evas, - Evas_Object *obj, - void *event_info); -static void _e_zone_cb_bg_mouse_up(void *data, - Evas *evas, - Evas_Object *obj, - void *event_info); -static void _e_zone_event_zone_desk_count_set_free(void *data, - void *ev); -static Eina_Bool _e_zone_cb_mouse_in(void *data, - int type, - void *event); -static Eina_Bool _e_zone_cb_mouse_out(void *data, - int type, - void *event); -static Eina_Bool _e_zone_cb_mouse_down(void *data, - int type, +static void _e_zone_free(E_Zone *zone); +static void _e_zone_cb_bg_mouse_down(void *data, + Evas *evas, + Evas_Object *obj, + void *event_info); +static void _e_zone_cb_bg_mouse_up(void *data, + Evas *evas, + Evas_Object *obj, + void *event_info); +static void _e_zone_event_zone_desk_count_set_free(void *data, + void *ev); +static Eina_Bool _e_zone_cb_mouse_in(void *data, + int type, void *event); -static Eina_Bool _e_zone_cb_mouse_up(void *data, - int type, - void *event); -static Eina_Bool _e_zone_cb_mouse_move(void *data, - int type, +static Eina_Bool _e_zone_cb_mouse_out(void *data, + int type, + void *event); +static Eina_Bool _e_zone_cb_mouse_down(void *data, + int type, + void *event); +static Eina_Bool _e_zone_cb_mouse_up(void *data, + int type, void *event); -static Eina_Bool _e_zone_cb_desk_after_show(void *data, - int type, - void *event); +static Eina_Bool _e_zone_cb_mouse_move(void *data, + int type, + void *event); +static Eina_Bool _e_zone_cb_desk_after_show(void *data, + int type, + void *event); static Eina_Bool _e_zone_cb_edge_timer(void *data); static void _e_zone_event_move_resize_free(void *data, void *ev); @@ -41,7 +41,7 @@ static void _e_zone_event_add_free(void *data, static void _e_zone_event_del_free(void *data, void *ev); static void _e_zone_object_del_attach(void *o); -static E_Zone_Edge _e_zone_detect_edge(E_Zone *zone, +static E_Zone_Edge _e_zone_detect_edge(E_Zone *zone, Ecore_X_Window win); static void _e_zone_edge_move_resize(E_Zone *zone); static void _e_zone_border_geometry_update(E_Zone *zone); @@ -163,12 +163,12 @@ _e_zone_black_unget(E_Zone *zone) EAPI E_Zone * e_zone_new(E_Container *con, - int num, - int id, - int x, - int y, - int w, - int h) + int num, + int id, + int x, + int y, + int w, + int h) { E_Zone *zone; Evas_Object *o; @@ -261,7 +261,7 @@ e_zone_new(E_Container *con, } EAPI void -e_zone_name_set(E_Zone *zone, +e_zone_name_set(E_Zone *zone, const char *name) { E_OBJECT_CHECK(zone); @@ -273,8 +273,8 @@ e_zone_name_set(E_Zone *zone, EAPI void e_zone_move(E_Zone *zone, - int x, - int y) + int x, + int y) { E_Event_Zone_Move_Resize *ev; @@ -305,8 +305,8 @@ e_zone_move(E_Zone *zone, EAPI void e_zone_resize(E_Zone *zone, - int w, - int h) + int w, + int h) { E_Event_Zone_Move_Resize *ev; @@ -338,10 +338,10 @@ e_zone_resize(E_Zone *zone, EAPI void e_zone_move_resize(E_Zone *zone, - int x, - int y, - int w, - int h) + int x, + int y, + int w, + int h) { E_Event_Zone_Move_Resize *ev; @@ -382,7 +382,7 @@ e_zone_move_resize(E_Zone *zone, EAPI void e_zone_fullscreen_set(E_Zone *zone, - int on) + int on) { E_OBJECT_CHECK(zone); E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE); @@ -436,8 +436,8 @@ e_zone_bg_reconfigure(E_Zone *zone) EAPI void e_zone_flip_coords_handle(E_Zone *zone, - int x, - int y) + int x, + int y) { E_Event_Zone_Edge *zev; E_Binding_Edge *binding; @@ -575,8 +575,8 @@ noflip: EAPI void e_zone_desk_count_set(E_Zone *zone, - int x_count, - int y_count) + int x_count, + int y_count) { E_Desk **new_desks; E_Desk *desk, *new_desk; @@ -692,8 +692,8 @@ e_zone_desk_count_set(E_Zone *zone, EAPI void e_zone_desk_count_get(E_Zone *zone, - int *x_count, - int *y_count) + int *x_count, + int *y_count) { E_OBJECT_CHECK(zone); E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE); @@ -704,8 +704,8 @@ e_zone_desk_count_get(E_Zone *zone, EAPI void e_zone_desk_flip_by(E_Zone *zone, - int dx, - int dy) + int dx, + int dy) { E_OBJECT_CHECK(zone); E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE); @@ -718,8 +718,8 @@ e_zone_desk_flip_by(E_Zone *zone, EAPI void e_zone_desk_flip_to(E_Zone *zone, - int x, - int y) + int x, + int y) { E_Desk *desk; @@ -750,7 +750,7 @@ e_zone_desk_flip_to(E_Zone *zone, EAPI void e_zone_desk_linear_flip_by(E_Zone *zone, - int dx) + int dx) { E_OBJECT_CHECK(zone); E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE); @@ -765,7 +765,7 @@ e_zone_desk_linear_flip_by(E_Zone *zone, EAPI void e_zone_desk_linear_flip_to(E_Zone *zone, - int x) + int x) { int y; @@ -844,47 +844,49 @@ EAPI void e_zone_edges_desk_flip_capable(E_Zone *zone, Eina_Bool l, Eina_Bool r, Eina_Bool t, Eina_Bool b) { #define NEED_FLIP_EDGE(x) \ - (e_bindings_edge_flippable_get(x) || e_bindings_edge_non_flippable_get(x)) + (e_bindings_edge_flippable_get(x) || e_bindings_edge_non_flippable_get(x)) #define NEED_EDGE(x) \ - (e_bindings_edge_non_flippable_get(x)) -#define CHECK_EDGE(v, ed, win) \ - do { \ - if (v) { \ - if (NEED_FLIP_EDGE(ed)) { if (zone->edge.win) ecore_x_window_show(zone->edge.win); } \ - else if (zone->edge.win) ecore_x_window_hide(zone->edge.win); \ - } \ - else { \ - if (NEED_EDGE(ed)) { if (zone->edge.win) ecore_x_window_show(zone->edge.win); } \ - else if (zone->edge.win) ecore_x_window_hide(zone->edge.win); \ - } \ - } while (0) + (e_bindings_edge_non_flippable_get(x)) +#define CHECK_EDGE(v, ed, win) \ + do { \ + if (v) { \ + if (NEED_FLIP_EDGE(ed)) { if (zone->edge.win) ecore_x_window_show(zone->edge.win); } \ + else if (zone->edge.win) \ + ecore_x_window_hide(zone->edge.win); \ + } \ + else { \ + if (NEED_EDGE(ed)) { if (zone->edge.win) ecore_x_window_show(zone->edge.win); } \ + else if (zone->edge.win) \ + ecore_x_window_hide(zone->edge.win); \ + } \ + } while (0) CHECK_EDGE(l, E_ZONE_EDGE_LEFT, left); CHECK_EDGE(r, E_ZONE_EDGE_RIGHT, right); CHECK_EDGE(t, E_ZONE_EDGE_TOP, top); CHECK_EDGE(b, E_ZONE_EDGE_BOTTOM, bottom); -#define CHECK_CORNER(v1, v2, ed, win1, win2) \ - if ((!v1) && (!v2)) { \ - if (NEED_EDGE(ed)) { \ - if (zone->corner.win1) ecore_x_window_show(zone->corner.win1); \ - if (zone->corner.win2) ecore_x_window_show(zone->corner.win2); \ - } \ - else { \ - if (zone->corner.win1) ecore_x_window_hide(zone->corner.win1); \ - if (zone->corner.win2) ecore_x_window_hide(zone->corner.win2); \ - } \ - } \ - else { \ - if (NEED_FLIP_EDGE(ed)) { \ - if (zone->corner.win1) ecore_x_window_show(zone->corner.win1); \ - if (zone->corner.win2) ecore_x_window_show(zone->corner.win2); \ - } \ - else { \ - if (zone->corner.win1) ecore_x_window_hide(zone->corner.win1); \ - if (zone->corner.win2) ecore_x_window_hide(zone->corner.win2); \ - } \ - } +#define CHECK_CORNER(v1, v2, ed, win1, win2) \ + if ((!v1) && (!v2)) { \ + if (NEED_EDGE(ed)) { \ + if (zone->corner.win1) ecore_x_window_show(zone->corner.win1); \ + if (zone->corner.win2) ecore_x_window_show(zone->corner.win2); \ + } \ + else { \ + if (zone->corner.win1) ecore_x_window_hide(zone->corner.win1); \ + if (zone->corner.win2) ecore_x_window_hide(zone->corner.win2); \ + } \ + } \ + else { \ + if (NEED_FLIP_EDGE(ed)) { \ + if (zone->corner.win1) ecore_x_window_show(zone->corner.win1); \ + if (zone->corner.win2) ecore_x_window_show(zone->corner.win2); \ + } \ + else { \ + if (zone->corner.win1) ecore_x_window_hide(zone->corner.win1); \ + if (zone->corner.win2) ecore_x_window_hide(zone->corner.win2); \ + } \ + } CHECK_CORNER(l, t, E_ZONE_EDGE_TOP_LEFT, left_top, top_left); CHECK_CORNER(r, t, E_ZONE_EDGE_TOP_RIGHT, right_top, top_right); @@ -909,31 +911,33 @@ e_zone_exists_direction(E_Zone *zone, E_Zone_Edge edge) (z2->y < zone->y)) || ((E_SPANS_COMMON(0, zone->y + zone->h, z2->y, z2->h)) && (z2->x < zone->x))) - return EINA_TRUE; + return EINA_TRUE; break; + case E_ZONE_EDGE_TOP: if ((E_SPANS_COMMON(zone->x, zone->w, z2->x, z2->w)) && (z2->y < zone->y)) - return EINA_TRUE; + return EINA_TRUE; break; + case E_ZONE_EDGE_TOP_RIGHT: if (((E_SPANS_COMMON(zone->x, 99999, z2->x, z2->w)) && (z2->y < zone->y)) || ((E_SPANS_COMMON(0, zone->y + zone->h, z2->y, z2->h)) && (z2->x >= (zone->x + zone->w)))) - return EINA_TRUE; + return EINA_TRUE; break; case E_ZONE_EDGE_LEFT: if ((E_SPANS_COMMON(zone->y, zone->h, z2->y, z2->h)) && (z2->x < zone->x)) - return EINA_TRUE; + return EINA_TRUE; break; case E_ZONE_EDGE_RIGHT: if ((E_SPANS_COMMON(zone->y, zone->h, z2->y, z2->h)) && (z2->x >= (zone->x + zone->w))) - return EINA_TRUE; + return EINA_TRUE; break; case E_ZONE_EDGE_BOTTOM_LEFT: @@ -941,19 +945,21 @@ e_zone_exists_direction(E_Zone *zone, E_Zone_Edge edge) (z2->y >= (zone->y + zone->h))) || ((E_SPANS_COMMON(zone->y, 99999, z2->y, z2->h)) && (z2->x < zone->x))) - return EINA_TRUE; + return EINA_TRUE; break; + case E_ZONE_EDGE_BOTTOM: if ((E_SPANS_COMMON(zone->x, zone->w, z2->x, z2->w)) && (z2->y >= (zone->y + zone->h))) - return EINA_TRUE; + return EINA_TRUE; break; + case E_ZONE_EDGE_BOTTOM_RIGHT: if (((E_SPANS_COMMON(zone->x, 99999, z2->x, z2->w)) && (z2->y >= (zone->y + zone->h))) || ((E_SPANS_COMMON(zone->y, 99999, z2->y, z2->h)) && (z2->x < zone->x))) - return EINA_TRUE; + return EINA_TRUE; break; default: @@ -964,7 +970,6 @@ e_zone_exists_direction(E_Zone *zone, E_Zone_Edge edge) return EINA_FALSE; } - EAPI void e_zone_edge_flip_eval(E_Zone *zone) { @@ -1206,8 +1211,8 @@ e_zone_edge_free(E_Zone_Edge edge) } EAPI void -e_zone_edge_win_layer_set(E_Zone *zone, - E_Layer layer) +e_zone_edge_win_layer_set(E_Zone *zone, + E_Layer layer) { if (zone->corner.left_bottom) e_container_window_raise(zone->container, zone->corner.left_bottom, layer); if (zone->corner.left_top) e_container_window_raise(zone->container, zone->corner.left_top, layer); @@ -1276,41 +1281,42 @@ _e_zone_useful_geometry_calc(E_Zone *zone) switch (orient) { - /* these are non-edje orientations */ - case E_GADCON_ORIENT_FLOAT: - case E_GADCON_ORIENT_HORIZ: - case E_GADCON_ORIENT_VERT: - break; + /* these are non-edje orientations */ + case E_GADCON_ORIENT_FLOAT: + case E_GADCON_ORIENT_HORIZ: + case E_GADCON_ORIENT_VERT: + break; - case E_GADCON_ORIENT_TOP: - case E_GADCON_ORIENT_CORNER_TL: - case E_GADCON_ORIENT_CORNER_TR: - if (yy0 < shelf->h) - yy0 = shelf->h; - break; + case E_GADCON_ORIENT_TOP: + case E_GADCON_ORIENT_CORNER_TL: + case E_GADCON_ORIENT_CORNER_TR: + if (yy0 < shelf->h) + yy0 = shelf->h; + break; - case E_GADCON_ORIENT_BOTTOM: - case E_GADCON_ORIENT_CORNER_BL: - case E_GADCON_ORIENT_CORNER_BR: - if (yy1 > zone->h - shelf->h) - yy1 = zone->h - shelf->h; - break; + case E_GADCON_ORIENT_BOTTOM: + case E_GADCON_ORIENT_CORNER_BL: + case E_GADCON_ORIENT_CORNER_BR: + if (yy1 > zone->h - shelf->h) + yy1 = zone->h - shelf->h; + break; - case E_GADCON_ORIENT_LEFT: - case E_GADCON_ORIENT_CORNER_LT: - case E_GADCON_ORIENT_CORNER_LB: - if (x0 < shelf->w) - x0 = shelf->w; - break; + case E_GADCON_ORIENT_LEFT: + case E_GADCON_ORIENT_CORNER_LT: + case E_GADCON_ORIENT_CORNER_LB: + if (x0 < shelf->w) + x0 = shelf->w; + break; - case E_GADCON_ORIENT_RIGHT: - case E_GADCON_ORIENT_CORNER_RT: - case E_GADCON_ORIENT_CORNER_RB: - if (x1 > zone->w - shelf->w) - x1 = zone->w - shelf->w; - break; - default: - break; + case E_GADCON_ORIENT_RIGHT: + case E_GADCON_ORIENT_CORNER_RT: + case E_GADCON_ORIENT_CORNER_RB: + if (x1 > zone->w - shelf->w) + x1 = zone->w - shelf->w; + break; + + default: + break; } } @@ -1326,10 +1332,10 @@ _e_zone_useful_geometry_calc(E_Zone *zone) */ EAPI void e_zone_useful_geometry_get(E_Zone *zone, - int *x, - int *y, - int *w, - int *h) + int *x, + int *y, + int *w, + int *h) { Eina_List *l; E_Shelf *shelf; @@ -1451,7 +1457,7 @@ _e_zone_free(E_Zone *zone) } static void -_e_zone_cb_bg_mouse_down(void *data, +_e_zone_cb_bg_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) @@ -1484,7 +1490,7 @@ _e_zone_cb_bg_mouse_down(void *data, } static void -_e_zone_cb_bg_mouse_up(void *data, +_e_zone_cb_bg_mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) @@ -1522,7 +1528,7 @@ _e_zone_cb_bg_mouse_up(void *data, static void _e_zone_event_zone_desk_count_set_free(void *data __UNUSED__, - void *ev) + void *ev) { E_Event_Zone_Desk_Count_Set *e; @@ -1532,9 +1538,9 @@ _e_zone_event_zone_desk_count_set_free(void *data __UNUSED__, } static Eina_Bool -_e_zone_cb_mouse_in(void *data, +_e_zone_cb_mouse_in(void *data, int type __UNUSED__, - void *event) + void *event) { Ecore_X_Event_Mouse_In *ev; E_Event_Zone_Edge *zev; @@ -1560,9 +1566,9 @@ _e_zone_cb_mouse_in(void *data, } static Eina_Bool -_e_zone_cb_mouse_out(void *data, +_e_zone_cb_mouse_out(void *data, int type __UNUSED__, - void *event) + void *event) { Ecore_X_Event_Mouse_Out *ev; E_Event_Zone_Edge *zev; @@ -1587,9 +1593,9 @@ _e_zone_cb_mouse_out(void *data, } static Eina_Bool -_e_zone_cb_mouse_down(void *data, +_e_zone_cb_mouse_down(void *data, int type __UNUSED__, - void *event) + void *event) { Ecore_Event_Mouse_Button *ev; E_Event_Zone_Edge *zev; @@ -1615,9 +1621,9 @@ _e_zone_cb_mouse_down(void *data, } static Eina_Bool -_e_zone_cb_mouse_up(void *data, +_e_zone_cb_mouse_up(void *data, int type __UNUSED__, - void *event) + void *event) { Ecore_Event_Mouse_Button *ev; E_Event_Zone_Edge *zev; @@ -1643,9 +1649,9 @@ _e_zone_cb_mouse_up(void *data, } static Eina_Bool -_e_zone_cb_mouse_move(void *data, +_e_zone_cb_mouse_move(void *data, int type __UNUSED__, - void *event) + void *event) { Ecore_Event_Mouse_Move *ev; E_Event_Zone_Edge *zev; @@ -1669,9 +1675,9 @@ _e_zone_cb_mouse_move(void *data, } static Eina_Bool -_e_zone_cb_desk_after_show(void *data, +_e_zone_cb_desk_after_show(void *data, int type __UNUSED__, - void *event) + void *event) { E_Event_Desk_Show *ev; E_Zone *zone; @@ -1711,7 +1717,7 @@ _e_zone_cb_edge_timer(void *data) static void _e_zone_event_move_resize_free(void *data __UNUSED__, - void *ev) + void *ev) { E_Event_Zone_Move_Resize *e; @@ -1722,7 +1728,7 @@ _e_zone_event_move_resize_free(void *data __UNUSED__, static void _e_zone_event_add_free(void *data __UNUSED__, - void *ev) + void *ev) { E_Event_Zone_Add *e; @@ -1733,7 +1739,7 @@ _e_zone_event_add_free(void *data __UNUSED__, static void _e_zone_event_del_free(void *data __UNUSED__, - void *ev) + void *ev) { E_Event_Zone_Del *e; @@ -1756,7 +1762,7 @@ _e_zone_object_del_attach(void *o) } static E_Zone_Edge -_e_zone_detect_edge(E_Zone *zone, +_e_zone_detect_edge(E_Zone *zone, Ecore_X_Window win) { E_Zone_Edge edge = E_ZONE_EDGE_NONE; @@ -1840,7 +1846,7 @@ _e_zone_border_geometry_update(E_Zone *zone) Eina_List *borders, *l; E_Border *bd; unsigned int zgeom[4]; - + zgeom[0] = zone->x; zgeom[1] = zone->y; zgeom[2] = zone->w; @@ -1849,8 +1855,8 @@ _e_zone_border_geometry_update(E_Zone *zone) EINA_LIST_FOREACH(borders, l, bd) { if (bd->zone == zone) - ecore_x_window_prop_card32_set(bd->client.win, - E_ATOM_ZONE_GEOMETRY, + ecore_x_window_prop_card32_set(bd->client.win, + E_ATOM_ZONE_GEOMETRY, zgeom, 4); } }