[EGIT] [tools/eflete] master 01/02: main: use widget option when the file is edj
jaehwan pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=4c00f9c64e95c50209f8e315b31fb81177fa1491 commit 4c00f9c64e95c50209f8e315b31fb81177fa1491 Author: Jaehwan Kim <jae.hwan@samsung.com> Date: Mon Apr 25 17:18:52 2016 +0900 main: use widget option when the file is edj --- src/bin/main.c | 8 src/bin/ui/tab_home_import_edj.c | 42 +++- src/bin/ui/tabs.c| 4 ++-- src/bin/ui/tabs.h| 2 +- src/bin/ui/tabs_private.h| 2 +- 5 files changed, 49 insertions(+), 9 deletions(-) diff --git a/src/bin/main.c b/src/bin/main.c index 2bc4713..7fcf98b 100644 --- a/src/bin/main.c +++ b/src/bin/main.c @@ -120,13 +120,13 @@ _import_edj(void *data __UNUSED__) Eina_Tmpstr *proj_name; if (pro_name) { -tabs_menu_import_edj_data_set(pro_name, pro_path, file); +tabs_menu_import_edj_data_set(pro_name, pro_path, file, widgets); } else { name = ecore_file_file_get(file); proj_name = eina_tmpstr_add_length(name, strlen(name) - 4); -tabs_menu_import_edj_data_set(proj_name, pro_path, file); +tabs_menu_import_edj_data_set(proj_name, pro_path, file, widgets); eina_tmpstr_del(proj_name); } tabs_menu_tab_open(TAB_HOME_IMPORT_EDJ); @@ -255,8 +255,6 @@ elm_main(int argc, char **argv) _ERR_EXIT(_("File '%s' doesn't exists."), file); if (ecore_file_is_dir(file)) _ERR_EXIT(_("'%s' is a directory."), file); - if (widgets) - _ERR_EXIT(_("widgets can be added only to new project.")); if (eina_str_has_suffix(file, ".pro")) { @@ -272,6 +270,8 @@ elm_main(int argc, char **argv) _ERR_EXIT(_("*.pro file is given but --fd specified.")); if (data_dirs) _ERR_EXIT(_("*.pro file is given but --dd specified.")); + if (widgets) +_ERR_EXIT(_("widgets can be added only to new project.")); ecore_job_add(_open_project, NULL); goto run; diff --git a/src/bin/ui/tab_home_import_edj.c b/src/bin/ui/tab_home_import_edj.c index 68a1e73..4a07d5a 100644 --- a/src/bin/ui/tab_home_import_edj.c +++ b/src/bin/ui/tab_home_import_edj.c @@ -467,9 +467,23 @@ _tab_import_edj_add(void) return tab_edj.layout; } +static void +_delayed_popup(void *data) +{ + char *msg = data; + popup_want_action(_("Import edj-file"), msg, NULL, NULL, BTN_OK, NULL, NULL); + free(msg); +} + void -_tab_import_edj_data_set(const char *name, const char *path, const char *edj) +_tab_import_edj_data_set(const char *name, const char *path, const char *edj, const Eina_List *widgets) { + const Eina_List *l; + const char *str; + Widget_Item_Data *widget_item_data_iterator; + Eina_Strbuf *buf = eina_strbuf_new(); + Eina_Bool first_not_found = true; + assert(tab_edj.layout != NULL); elm_entry_entry_set(tab_edj.name, name); @@ -478,4 +492,30 @@ _tab_import_edj_data_set(const char *name, const char *path, const char *edj) else elm_entry_entry_set(tab_edj.path, profile_get()->general.projects_folder); elm_entry_entry_set(tab_edj.edj, edj); + + EINA_LIST_FOREACH(widgets, l, str) + { +widget_item_data_iterator = widget_item_data; +while (widget_item_data_iterator->name) + { + if (!strcasecmp(str, widget_item_data_iterator->name)) + break; + widget_item_data_iterator++; + } +if (widget_item_data_iterator->name) + widget_item_data_iterator->check = true; +else + { + eina_strbuf_append_printf(buf, first_not_found ? "%s" : ", %s", str); + first_not_found = false; + } + } + elm_genlist_realized_items_update(tab_edj.genlist); + if (eina_strbuf_length_get(buf)) + { +eina_strbuf_prepend(buf, _("Following widgets were not found and ignored: ")); +ERR("%s", eina_strbuf_string_get(buf)); +ecore_job_add(_delayed_popup, eina_strbuf_string_steal(buf)); + } + eina_strbuf_free(buf); } diff --git a/src/bin/ui/tabs.c b/src/bin/ui/tabs.c index 23d2e55..7ab4dfb 100644 --- a/src/bin/ui/tabs.c +++ b/src/bin/ui/tabs.c @@ -1112,9 +1112,9 @@ tabs_menu_tab_open(Tabs_Menu view) } void -tabs_menu_import_edj_data_set(const char *name, const char *path, const char *edj) +tabs_menu_import_edj_data_set(const char *name, const char *path, const char *edj, const Eina_List *widgets) { - _tab_import_edj_data_set(name, path, edj); + _tab_import_edj_data_set(name, path, edj, widgets); } void diff --git a/src/bin/ui/tabs.h b/src/bin/ui/tabs.h index a6ad43a..bfe9
[EGIT] [tools/eflete] master 02/02: import_edj: compose the widget list by existing widget in edj
jaehwan pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=89bf1d6eaed56507eafae9ee57df56f8100b7be4 commit 89bf1d6eaed56507eafae9ee57df56f8100b7be4 Author: Jaehwan Kim <jae.hwan@samsung.com> Date: Wed Apr 27 19:54:26 2016 +0900 import_edj: compose the widget list by existing widget in edj When the edj path is set, it reads widget list from edj. If the widget list doesn't exist, it can create without checking the widget. But if not, it should be chosen at least one widget. --- src/bin/common/string_common.c | 22 +++ src/bin/common/string_common.h | 3 + src/bin/project_manager/group_manager.c | 24 +--- src/bin/ui/tab_home_import_edj.c| 248 +--- 4 files changed, 155 insertions(+), 142 deletions(-) diff --git a/src/bin/common/string_common.c b/src/bin/common/string_common.c index d5de437..ea14527 100644 --- a/src/bin/common/string_common.c +++ b/src/bin/common/string_common.c @@ -59,3 +59,25 @@ string_char_replace(char *str, char src, char rep) str++; } } + +const char * +widget_name_get(const Eina_Stringshare *group_name) +{ +int len = strlen(group_name); +int i; +char str[32]; + +if (group_name[0] != 'e') return NULL; +if (group_name[1] != 'l') return NULL; +if (group_name[2] != 'm') return NULL; +if (group_name[3] != '/') return NULL; + +for (i = 4; i < len; i++) +{ +if (group_name[i] == '/') break; +str[i - 4] = group_name[i]; +} +str[i - 4] = '\0'; + +return strdup(str); +} diff --git a/src/bin/common/string_common.h b/src/bin/common/string_common.h index f49b20b..47e2058 100644 --- a/src/bin/common/string_common.h +++ b/src/bin/common/string_common.h @@ -58,4 +58,7 @@ state_name_split(Eina_Stringshare *name, Eina_Stringshare **name_out, double *va void string_char_replace(char *str, char src, char rep); +const char * +widget_name_get(const Eina_Stringshare *group_name); + #endif /* STRING_MACRO_H */ diff --git a/src/bin/project_manager/group_manager.c b/src/bin/project_manager/group_manager.c index c9bdb00..4eb7d21 100644 --- a/src/bin/project_manager/group_manager.c +++ b/src/bin/project_manager/group_manager.c @@ -425,28 +425,6 @@ gm_group_del(Project *pro, Group *group) free(group); } -char * -_get_widget_name(const Eina_Stringshare *group_name) -{ -int len = strlen(group_name); -int i; -char str[32]; - -if (group_name[0] != 'e') return NULL; -if (group_name[1] != 'l') return NULL; -if (group_name[2] != 'm') return NULL; -if (group_name[3] != '/') return NULL; - -for (i = 4; i < len; i++) -{ -if (group_name[i] == '/') break; -str[i - 4] = group_name[i]; -} -str[i - 4] = '\0'; - -return strdup(str); -} - void gm_groups_load(Project *pro) { @@ -473,7 +451,7 @@ gm_groups_load(Project *pro) if (pro->widgets) { - widget_name = _get_widget_name(group_name); + widget_name = widget_name_get(group_name); if (!widget_name) continue; EINA_LIST_FOREACH(pro->widgets, wl, checked_widget) { diff --git a/src/bin/ui/tab_home_import_edj.c b/src/bin/ui/tab_home_import_edj.c index 4a07d5a..9221974 100644 --- a/src/bin/ui/tab_home_import_edj.c +++ b/src/bin/ui/tab_home_import_edj.c @@ -33,64 +33,8 @@ struct _Widget_Item_Data }; typedef struct _Widget_Item_Data Widget_Item_Data; -static Widget_Item_Data widget_item_data[] = - { - { N_("access"), false }, - { N_("actionslider"), false }, - { N_("bg"), false }, - { N_("border"), false }, - { N_("bubble"), false }, - { N_("button"), false }, - { N_("calendar"), false }, - { N_("check"),false }, - { N_("clock"),false }, - { N_("colorsel"), false }, - { N_("conform"), false }, - { N_("ctxpopup"), false }, - { N_("cursor"), false }, - { N_("datetime"), false }, - { N_("dayselector"), false }, - { N_("diskselector"), false }, - { N_("entry"),false }, - { N_("fileselector"), false }, - { N_("flipselector"), false }, - { N_("focus"),false }, - { N_("frame"),false }, - { N_("gengrid"), false }, - { N_("genlist"), false }, - { N_("hover"),false }, - { N_("icon"), false }, - { N_("index"),false }, - { N_("label"),false }, - { N_("layout"),
[EGIT] [tools/eflete] master 01/02: import_edj: widget can be customized by using edj template theme file.
jaehwan pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=514ddf88cce7115b5514543da320b4d9be0d8ca8 commit 514ddf88cce7115b5514543da320b4d9be0d8ca8 Author: Jaehwan Kim <jae.hwan@samsung.com> Date: Wed Mar 30 11:04:02 2016 +0900 import_edj: widget can be customized by using edj template theme file. When the template file is changed, edj file is more easy to change. It just reads another edj file. Then eflete loads and shows just checked widgets. Conflicts: src/bin/ui/tab_home_import_edj.c Change-Id: I059c6c6a55a092302aea8c59f644673df8e45868 --- configure.ac | 1 + data/Makefile.am | 6 +- data/themes/default/widgets/layouts/tabs.edc | 360 +-- src/bin/project_manager/group_manager.c | 48 +++- src/bin/project_manager/project_manager.c| 26 +- src/bin/project_manager/project_manager.h| 4 + src/bin/ui/tab_home_import_edj.c | 249 +- 7 files changed, 315 insertions(+), 379 deletions(-) diff --git a/configure.ac b/configure.ac index 5841135..d7ed0e0 100644 --- a/configure.ac +++ b/configure.ac @@ -193,6 +193,7 @@ EFLETE_DEFINE=" -DEFLETE_EDJ=\\\"${datadir}/eflete/layouts/eflete.edj\\\" " EFLETE_DEFINE+=" -DEFLETE_THEME=\\\"${datadir}/eflete/themes/default/eflete_elm.edj\\\" " EFLETE_DEFINE+=" -DEFLETE_EDJ_PATH=\\\"${datadir}/eflete/themes/default/\\\" " EFLETE_DEFINE+=" -DEFLETE_IMG_PATH=\\\"${datadir}/eflete/images/\\\" " +EFLETE_DEFINE+=" -DEFLETE_TEMPLATE_EDJ_PATH=\\\"${datadir}/eflete/themes/default/template/edj\\\" " EFLETE_DEFINE+=" -DEFLETE_TEMPLATE_EDC_PATH=\\\"${datadir}/eflete/themes/default/template/edc\\\" " EFLETE_DEFINE+=" -DEFLETE_TEMPLATE_IMAGES_PATH=\\\"${datadir}/eflete/themes/default/template/images\\\" " EFLETE_DEFINE+=" -DEFLETE_TEMPLATE_SOUNDS_PATH=\\\"${datadir}/eflete/themes/default/template/sounds\\\" " diff --git a/data/Makefile.am b/data/Makefile.am index 7d80a03..20b0966 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -15,6 +15,10 @@ EDJE_FLAGS_RESOURCES = -id $(top_srcdir)/data/resources/images filesdir = $(datadir)/eflete/themes/default files_DATA = eflete_elm.edj +template_edjdir = $(datadir)/eflete/themes/default/template/edj +template_edj_DATA = \ + $(top_srcdir)/data/template/edj/*.edj + template_edcdir = $(datadir)/eflete/themes/default/template/edc template_edc_DATA = \ $(top_srcdir)/data/template/widgets/*.edc \ @@ -105,4 +109,4 @@ clean-local: rm -f *.edj *.eet EXTRA_DIST = $(aimages_DATA) $(ewe_deps) $(eflete_deps) $(eflete_elm_deps) \ - $(color_eet_deps) $(template_edc_DATA) $(template_img_DATA) $(template_snd_DATA) + $(color_eet_deps) $(template_edj_DATA) $(template_edc_DATA) $(template_img_DATA) $(template_snd_DATA) diff --git a/data/themes/default/widgets/layouts/tabs.edc b/data/themes/default/widgets/layouts/tabs.edc index 384f7b5..cfdc8ad 100644 --- a/data/themes/default/widgets/layouts/tabs.edc +++ b/data/themes/default/widgets/layouts/tabs.edc @@ -654,153 +654,14 @@ group { name: "elm/layout/tab_home/new_project"; } } } - group { name: "elm/layout/tab_home/import_edj"; - images { - image: "separator-vertical.png" COMP; - image: "separator-horizontal.png" COMP; - } + inherit: "elm/layout/tab_home/new_project"; parts { - part { name: "elm.swallow.btn_create"; - type: SWALLOW; - description { -align: 1.0 1.0; -fixed: 1 1; -rel1 { - relative: 1.0 1.0; -} -rel2 { - relative: 1.0 1.0; -} - } - } - part { name: "separator_hor"; - type: IMAGE; - description { state: "default" 0.0; -min: 0 2; -max: -1 2; -align: 0.5 1.0; -image { - normal: "separator-horizontal.png"; - middle: DEFAULT; -} -rel2 { - to: "elm.swallow.btn_create"; - relative: 1.0 0.0; - offset: -1 -7; -} - } - } - part { name: "separator"; - type: IMAGE; - description { state: "default" 0.0; -min: 2 0; -max: 2 -1; -image { - normal: "separator-vertical.png"; - middle: DEFAULT; -} -rel2 { - to: "separator_hor"; - relative: 1.0 0.0; - offset: -1 -7; -} - } - } - part { name: "area.proje
[EGIT] [tools/eflete] master 02/02: add combobox to change the template themes.
jaehwan pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=b7a62a1c700c7719736b62b83e8b71a51d6ea3d0 commit b7a62a1c700c7719736b62b83e8b71a51d6ea3d0 Author: Jaehwan Kim <jae.hwan@samsung.com> Date: Thu Mar 31 18:03:06 2016 +0900 add combobox to change the template themes. Conflicts: data/themes/default/widgets/layouts/tabs.edc Change-Id: I9b7fdb0870e8b13f24df29e158fc859cbf347e27 --- data/template/edj/default.edj| Bin 0 -> 5991443 bytes data/themes/default/widgets/layouts/tabs.edc | 25 + src/bin/ui/tab_home_import_edj.c | 32 ++- 3 files changed, 56 insertions(+), 1 deletion(-) diff --git a/data/template/edj/default.edj b/data/template/edj/default.edj new file mode 100644 index 000..0f3ea68 Binary files /dev/null and b/data/template/edj/default.edj differ diff --git a/data/themes/default/widgets/layouts/tabs.edc b/data/themes/default/widgets/layouts/tabs.edc index cfdc8ad..7d8fefc 100644 --- a/data/themes/default/widgets/layouts/tabs.edc +++ b/data/themes/default/widgets/layouts/tabs.edc @@ -707,6 +707,31 @@ group { name: "elm/layout/tab_home/import_edj"; rel1.to_y: "swallow.meta_version"; } } + part { name: "label.widgets"; + description { state: "default" 0.0; +rel2 { +relative: 0.0 1.0; +to_x: "swallow.all_widgets_check"; +} +text.min: 1 0; +text.ellipsis: -1; + } + } + part { name: "swallow.template_themes"; + type: SWALLOW; + insert_after: "label.widgets"; + description { state: "default" 0.0; +rel1 { + relative: 1 0.0; + to: "label.widgets"; + offset: 6 0; +} +rel2 { + to_x: "area.widgets_info"; + to_y: "label.widgets"; +} + } + } } } diff --git a/src/bin/ui/tab_home_import_edj.c b/src/bin/ui/tab_home_import_edj.c index 8ccca06..e193c1f 100644 --- a/src/bin/ui/tab_home_import_edj.c +++ b/src/bin/ui/tab_home_import_edj.c @@ -104,6 +104,7 @@ struct _Tab_Home_Edj Meta_Data_Controls meta; Evas_Object *ch_all; + Evas_Object *themes; Evas_Object *genlist; }; @@ -159,7 +160,16 @@ _edj_set() { Eina_Bool checked = _checked_get(); - if (checked) elm_entry_entry_set(tab_edj.edj, EFLETE_TEMPLATE_EDJ_PATH"/default.edj"); + if (checked) + { +Ewe_Combobox_Item *item = ewe_combobox_select_item_get(tab_edj.themes); +char buf[256]; +if (item) + { + snprintf(buf, sizeof(buf), "%s/%s", EFLETE_TEMPLATE_EDJ_PATH, item->title); + elm_entry_entry_set(tab_edj.edj, buf); + } + } else elm_entry_entry_set(tab_edj.edj, ""); elm_object_disabled_set(tab_edj.edj, checked); @@ -231,6 +241,15 @@ _on_item_activated(void *data __UNUSED__, } static void +_template_theme_changed(void *data __UNUSED__, +Evas_Object *obj __UNUSED__, +void *event_info __UNUSED__) +{ + _edj_set(); + +} + +static void _progress_end(void *data, PM_Project_Result result) { if (PM_PROJECT_SUCCESS == result) @@ -365,6 +384,8 @@ _tab_import_edj_add(void) { Elm_Genlist_Item_Class *itc = NULL; Widget_Item_Data *widget_item_data_iterator = widget_item_data; + Eina_List *themes = NULL, *l = NULL; + char *theme; tab_edj.name_validator = elm_validator_regexp_new(NAME_REGEX, NULL); @@ -406,6 +427,15 @@ _tab_import_edj_add(void) elm_object_part_content_set(tab_edj.layout, "swallow.all_widgets_check", tab_edj.ch_all); elm_object_part_text_set(tab_edj.layout, "label.widgets", _("Widgets:")); + /* template themes */ + EWE_COMBOBOX_ADD(tab_edj.layout, tab_edj.themes); + elm_object_part_content_set(tab_edj.layout, "swallow.template_themes", tab_edj.themes); + ewe_combobox_text_set(tab_edj.themes, "template themes"); + themes = ecore_file_ls(EFLETE_TEMPLATE_EDJ_PATH); + EINA_LIST_FOREACH(themes, l, theme) + ewe_combobox_item_add(tab_edj.themes, theme); + evas_object_smart_callback_add(tab_edj.themes, "selected", _template_theme_changed, NULL); + /* genlist */ tab_edj.genlist = elm_genlist_add(ap.win); evas_object_smart_callback_add(tab_edj.genlist, "activated", _on_item_activated, NULL); --
[EGIT] [tools/eflete] master 01/01: Fix build errors
jaehwan pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=a6eda079f435841a90cfb3bd0c7781da4ab8521b commit a6eda079f435841a90cfb3bd0c7781da4ab8521b Author: Jaehwan Kim <jae.hwan@samsung.com> Date: Tue Mar 8 17:52:21 2016 +0900 Fix build errors --- src/bin/ui/colorclass_manager.c| 2 +- src/bin/ui/editors/animator.c | 3 +- src/bin/ui/project_navigator.c | 2 +- src/bin/ui/property_group.c| 2 +- src/bin/ui/property_macros.h | 2 +- src/bin/ui/property_sound.c| 50 +- src/bin/ui/sound_manager.c | 4 +-- src/bin/ui/style_manager.c | 4 +-- src/bin/ui/tab_home_import_edc.c | 2 +- src/bin/ui/tab_home_import_edj.c | 2 +- src/bin/ui/tab_home_new.c | 2 +- src/bin/ui/workspace/group_navigator.c | 14 +- src/lib/ewe_combobox.c | 17 ++-- src/lib/ewe_ruler.c| 17 ++-- 14 files changed, 60 insertions(+), 63 deletions(-) diff --git a/src/bin/ui/colorclass_manager.c b/src/bin/ui/colorclass_manager.c index 6a80ee6..1579ed6 100644 --- a/src/bin/ui/colorclass_manager.c +++ b/src/bin/ui/colorclass_manager.c @@ -79,7 +79,7 @@ _on_button_add_clicked_cb(void *data __UNUSED__, resource_name_validator_list_set(edit->name_validator, >colorclasses, true); LAYOUT_PROP_ADD(ap.win, _("Color class name: "), "property", "1swallow") ENTRY_ADD(item, edit->entry, true); - eo_do(edit->entry, eo_event_callback_add(ELM_ENTRY_EVENT_VALIDATE, resource_name_validator_helper, edit->name_validator)); + eo_event_callback_add(edit->entry, ELM_ENTRY_EVENT_VALIDATE, resource_name_validator_helper, edit->name_validator); evas_object_smart_callback_add(edit->entry, "changed", _validation, edit); elm_object_part_text_set(edit->entry, "guide", _("Type new color class name here")); elm_object_part_content_set(item, "elm.swallow.content", edit->entry); diff --git a/src/bin/ui/editors/animator.c b/src/bin/ui/editors/animator.c index 1dd935d..26fd9a5 100644 --- a/src/bin/ui/editors/animator.c +++ b/src/bin/ui/editors/animator.c @@ -364,8 +364,7 @@ _on_bt_prog_add(void *data, animator->popup.name_validator = elm_validator_regexp_new(NAME_REGEX, NULL); LAYOUT_PROP_ADD(animator->popup.popup, _("Frequency:"), "property", "1swallow") ENTRY_ADD(item, animator->popup.entry, true) - eo_do(animator->popup.entry, - eo_event_callback_add(ELM_ENTRY_EVENT_VALIDATE, elm_validator_regexp_helper, animator->popup.name_validator)); + eo_event_callback_add(animator->popup.entry, ELM_ENTRY_EVENT_VALIDATE, elm_validator_regexp_helper, animator->popup.name_validator); evas_object_smart_callback_add(animator->popup.entry, "changed", _validation, animator); elm_object_part_content_set(item, "elm.swallow.content", animator->popup.entry); diff --git a/src/bin/ui/project_navigator.c b/src/bin/ui/project_navigator.c index 7ae285d..c0eb8cb 100644 --- a/src/bin/ui/project_navigator.c +++ b/src/bin/ui/project_navigator.c @@ -437,7 +437,7 @@ _btn_add_group_cb(void *data __UNUSED__, LAYOUT_PROP_ADD(layout_p.box, _("name"), "property", "1swallow") ENTRY_ADD(layout_p.box, layout_p.entry, true) evas_object_smart_callback_add(layout_p.entry, "changed", _group_validate, NULL); - eo_do(layout_p.entry, eo_event_callback_add(ELM_ENTRY_EVENT_VALIDATE, resource_name_validator_helper, validator)); + eo_event_callback_add(layout_p.entry, ELM_ENTRY_EVENT_VALIDATE, resource_name_validator_helper, validator); elm_layout_content_set(item, NULL, layout_p.entry); elm_box_pack_end(layout_p.box, item); glit = elm_genlist_selected_item_get(project_navigator.genlist); diff --git a/src/bin/ui/property_group.c b/src/bin/ui/property_group.c index 1a6d93c..32f817a 100644 --- a/src/bin/ui/property_group.c +++ b/src/bin/ui/property_group.c @@ -1515,7 +1515,7 @@ prop_part_name_add(Evas_Object *parent, Group_Prop_Data *pd) PROPERTY_ITEM_ADD(parent, _("name"), "1swallow"); ENTRY_ADD(parent, pd->attributes.part.name, true); - eo_do(pd->attributes.part.name, eo_event_callback_add(ELM_ENTRY_EVENT_VALIDATE, resource_name_validator_helper, pd->attributes.part.validator)); + eo_event_callback_add(pd->attributes.part.name, ELM_ENTRY_EVENT_VALIDATE, resource_name_validator_helper, pd->attributes.part.validator); resource_name_validator_list_set(pd->attributes.part.validator, >part->group->parts, false); resource_name_validator_resource_set(pd->attributes.part.validator, (Resource *)pd->part); elm_entry_entry_set(pd->attributes.part.name, pd->part->nam
[EGIT] [core/elementary] master 01/01: panes: add the style to fold by clicking
jaehwan pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=af45e5580ef74be3ffc5a9f1120f8d830f2f commit af45e5580ef74be3ffc5a9f1120f8d830f2f Author: Jaehwan Kim <jae.hwan@samsung.com> Date: Thu Feb 25 13:46:53 2016 +0900 panes: add the style to fold by clicking Some area that is split by this style panes can be folded by clicking. The styles are "left-fold", "right-fold", "up-fold", "down-fold". @feature --- data/themes/edc/elm/panes.edc | 252 ++ 1 file changed, 252 insertions(+) diff --git a/data/themes/edc/elm/panes.edc b/data/themes/edc/elm/panes.edc index 45b6d4a..9009123 100644 --- a/data/themes/edc/elm/panes.edc +++ b/data/themes/edc/elm/panes.edc @@ -743,3 +743,255 @@ group { name: "elm/panes/horizontal/flush"; } } } + +group { name: "elm/panes/vertical/left-fold"; + inherit: "elm/panes/vertical/default"; + images.image: "icon_arrow_left.png" COMP; + images.image: "icon_arrow_right.png" COMP; + script { + public open; + public drag_x; + public drag_y; + } + parts { + spacer { "sub_whole"; + desc { "default"; +rel1.offset: 3 0; + } + } + image { "dots"; + desc { "default"; +image.normal: "icon_arrow_left.png"; +FIXED_SIZE(14, 14) + } + desc { "closed"; +inherit: "default" 0.0; +image.normal: "icon_arrow_right.png"; + } + } + rect { "event"; + repeat; + desc { "default"; +rel1.to: "dots"; +rel2.to: "dots"; +color: 0 0 0 0; + } + } + } + programs { + program { signal: "load"; source: ""; + script { +set_int(open, 1); + } + } + program { signal: "mouse,clicked,1"; source: "event"; + script { +if (get_int(open) == 1) +{ + new Float: dx; + new Float: dy; + set_int(open, 0); + get_drag(PART:"elm.bar", dx, dy); + set_float(drag_x, dx); + set_drag(PART:"elm.bar", 0.0, 0.5); + set_state(PART:"dots", "closed", 0.0); +} +else if (get_int(open) == 0) +{ + set_int(open, 1); + set_drag(PART:"elm.bar", get_float(drag_x), 0.5); + set_state(PART:"dots", "default", 0.0); +} + } + } + } +} + +group { name: "elm/panes/vertical/right-fold"; + inherit: "elm/panes/vertical/default"; + images.image: "icon_arrow_left.png" COMP; + images.image: "icon_arrow_right.png" COMP; + script { + public open; + public drag_x; + public drag_y; + } + parts { + spacer { "sub_whole"; + desc { "default"; +rel2.offset: -4 0; + } + } + image { "dots"; + desc { "default"; +image.normal: "icon_arrow_right.png"; +FIXED_SIZE(14, 17) + } + desc { "closed"; +inherit: "default" 0.0; +image.normal: "icon_arrow_left.png"; + } + } + rect { "event"; + repeat; + desc { "default"; +rel1.to: "dots"; +rel2.to: "dots"; +color: 0 0 0 0; + } + } + } + programs { + program { signal: "load"; source: ""; + script { +set_int(open, 1); + } + } + program { signal: "mouse,clicked,1"; source: "event"; + script { +if (get_int(open) == 1) +{ + new Float: dx; + new Float: dy; + set_int(open, 0); + get_drag(PART:"elm.bar", dx, dy); + set_float(drag_x, dx); + set_drag(PART:"elm.bar", 1.0, 0.5); + set_state(PART:"dots", "closed", 0.0); +} +else if (get_int(open) == 0) +{ + set_int(open, 1); + set_drag(PART:"elm.bar", get_float(drag_x), 0.5); + set_state(PART:"dots", "default", 0.0); +} + } + } + } +} + +group { name: "elm/panes/horizontal/up-fold"; + inherit: "elm/panes/horizontal/default"; + images.image: "icon_arrow_up.png&
[EGIT] [core/efl] master 01/01: embryo: change the log catagory of printf in embryo
jaehwan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a20f9b8087b85728cb03a2bcd3c6174fc05aa20b commit a20f9b8087b85728cb03a2bcd3c6174fc05aa20b Author: Jaehwan Kim <jae.hwan@samsung.com> Date: Mon Jan 18 16:54:52 2016 +0900 embryo: change the log catagory of printf in embryo If the catagory is DBG, we should rebuild efl to print the message by using printf in edc. So change it to use it more convenient. @fix --- src/lib/embryo/embryo_str.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/embryo/embryo_str.c b/src/lib/embryo/embryo_str.c index e428179..649bd49 100644 --- a/src/lib/embryo/embryo_str.c +++ b/src/lib/embryo/embryo_str.c @@ -445,7 +445,7 @@ _embryo_str_printf(Embryo_Program *ep, Embryo_Cell *params) _str_snprintf(ep, s1, s2, max_len, pnum, [2]); - DBG("%s", s2); + INF("%s", s2); return o; } --
[EGIT] [core/efl] master 01/01: Revert "edje: add edje signal emit about swallow, text"
jaehwan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=21dc4443a58e3ffd0f46bfa7256c0fb15fb6730b commit 21dc4443a58e3ffd0f46bfa7256c0fb15fb6730b Author: Jaehwan Kim <jae.hwan@samsung.com> Date: Thu Oct 22 09:36:35 2015 +0900 Revert "edje: add edje signal emit about swallow, text" This reverts commit b1fa1c5aadc71881cb1e4e264d680ea5efa79a69. This feature will be commited to the next version. --- src/lib/edje/edje_util.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c index 6ef5d60..aa77208 100644 --- a/src/lib/edje/edje_util.c +++ b/src/lib/edje/edje_util.c @@ -1442,10 +1442,6 @@ _edje_object_part_text_raw_set(Edje *ed, Evas_Object *obj, Edje_Real_Part *rp, c _edje_recalc(ed); if (ed->text_change.func) ed->text_change.func(ed->text_change.data, obj, part); - if (text) - _edje_emit(ed, "text,set", rp->part->name); - else - _edje_emit(ed, "text,unset", rp->part->name); return EINA_TRUE; } @@ -2890,7 +2886,6 @@ _edje_object_part_swallow(Eo *obj EINA_UNUSED, Edje *ed, const char *part, Evas_ eud->u.swallow.child = obj_swallow; } } - _edje_emit(ed, "swallow", rp->part->name); return EINA_TRUE; } @@ -3167,7 +3162,6 @@ _edje_object_part_unswallow(Eo *obj EINA_UNUSED, Edje *ed, Evas_Object *obj_swal if (eud->type == EDJE_USER_SWALLOW && eud->u.swallow.child == obj_swallow) { _edje_user_definition_free(eud); - _edje_emit(ed, "unswallow", rp->part->name); return; } } @@ -3188,7 +3182,6 @@ _edje_object_part_unswallow(Eo *obj EINA_UNUSED, Edje *ed, Evas_Object *obj_swal * -zmike, 6 April 2015 */ //_edje_recalc_do(ed); -_edje_emit(ed, "unswallow", rp->part->name); return; } } --
[EGIT] [core/efl] master 01/01: edje: add edje signal emit about swallow, text
jaehwan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b1fa1c5aadc71881cb1e4e264d680ea5efa79a69 commit b1fa1c5aadc71881cb1e4e264d680ea5efa79a69 Author: Jaehwan Kim <jae.hwan@samsung.com> Date: Wed Oct 21 21:51:54 2015 +0900 edje: add edje signal emit about swallow, text Add the edje signal "swallow", "unswallow", "text,set", "text,unset". In edc file, the part name take a role of source. If the layout should be changed when any object is swallowed or any text is set, use this signal. @feature --- src/lib/edje/edje_util.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c index aa77208..6ef5d60 100644 --- a/src/lib/edje/edje_util.c +++ b/src/lib/edje/edje_util.c @@ -1442,6 +1442,10 @@ _edje_object_part_text_raw_set(Edje *ed, Evas_Object *obj, Edje_Real_Part *rp, c _edje_recalc(ed); if (ed->text_change.func) ed->text_change.func(ed->text_change.data, obj, part); + if (text) + _edje_emit(ed, "text,set", rp->part->name); + else + _edje_emit(ed, "text,unset", rp->part->name); return EINA_TRUE; } @@ -2886,6 +2890,7 @@ _edje_object_part_swallow(Eo *obj EINA_UNUSED, Edje *ed, const char *part, Evas_ eud->u.swallow.child = obj_swallow; } } + _edje_emit(ed, "swallow", rp->part->name); return EINA_TRUE; } @@ -3162,6 +3167,7 @@ _edje_object_part_unswallow(Eo *obj EINA_UNUSED, Edje *ed, Evas_Object *obj_swal if (eud->type == EDJE_USER_SWALLOW && eud->u.swallow.child == obj_swallow) { _edje_user_definition_free(eud); + _edje_emit(ed, "unswallow", rp->part->name); return; } } @@ -3182,6 +3188,7 @@ _edje_object_part_unswallow(Eo *obj EINA_UNUSED, Edje *ed, Evas_Object *obj_swal * -zmike, 6 April 2015 */ //_edje_recalc_do(ed); +_edje_emit(ed, "unswallow", rp->part->name); return; } } --
[EGIT] [core/elementary] master 02/02: focus: change the focus don't stay to scroller.
jaehwan pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=7d05d9785143694d445d6af81509bf265ed3d07a commit 7d05d9785143694d445d6af81509bf265ed3d07a Author: Jaehwan Kim <jae.hwan@samsung.com> Date: Fri Sep 25 15:34:34 2015 +0900 focus: change the focus don't stay to scroller. The focus go to scroller only when it needs. If the focusable object isn't in the current viewport of the scroller, the scroller should have the focus. If not, the focus move to the focusable object in the scroller. @feature. --- src/lib/elm_scroller.c | 111 +--- src/lib/elm_scroller.eo | 1 + 2 files changed, 88 insertions(+), 24 deletions(-) diff --git a/src/lib/elm_scroller.c b/src/lib/elm_scroller.c index 59c9a4a..1b5011c 100644 --- a/src/lib/elm_scroller.c +++ b/src/lib/elm_scroller.c @@ -180,23 +180,9 @@ _key_action_move(Evas_Object *obj, const char *params) if (r && new_focus) { - Evas_Coord l_x = 0; - Evas_Coord l_y = 0; - Evas_Coord l_w = 0; - Evas_Coord l_h = 0; - - evas_object_geometry_get(new_focus, _x, _y, _w, _h); - l_x = f_x - c_x - step_x; - l_y = f_y - c_y - step_y; - l_w = f_w + (step_x * 2); - l_h = f_h + (step_y * 2); - - if (ELM_RECTS_INTERSECT(x, y, v_w, v_h, l_x, l_y, l_w, l_h)) - { - elm_widget_focus_steal(new_focus, new_focus_item); - eina_list_free(can_focus_list); - return EINA_TRUE; - } + elm_widget_focus_steal(new_focus, new_focus_item); + eina_list_free(can_focus_list); + return EINA_TRUE; } } @@ -435,13 +421,33 @@ _elm_scroller_elm_widget_focus_next(Eo *obj EINA_UNUSED, Elm_Scroller_Data *sd, } /* Try focus cycle in subitem */ - if (elm_widget_focus_get(obj)) + if ((elm_widget_can_focus_get(cur)) || + (elm_widget_child_can_focus_get(cur))) { -if ((elm_widget_can_focus_get(cur)) || -(elm_widget_child_can_focus_get(cur))) - { - return elm_widget_focus_next_get(cur, dir, next, next_item); - } +Eina_Bool ret = EINA_FALSE; +Evas_Coord x = 0, y = 0; +Evas_Coord v_w = 0, v_h = 0; +Evas_Coord c_x = 0, c_y = 0; +Evas_Coord f_x = 0, f_y = 0, f_w = 0, f_h = 0; +Evas_Coord l_x = 0, l_y = 0, l_w = 0, l_h = 0; +Evas_Coord step_x = 0, step_y = 0; + +ret = elm_widget_focus_next_get(cur, dir, next, next_item); + +eo_do(obj, + elm_interface_scrollable_content_pos_get(, ), + elm_interface_scrollable_step_size_get(_x, _y), + elm_interface_scrollable_content_viewport_geometry_get + (NULL, NULL, _w, _h)); +evas_object_geometry_get(sd->content, _x, _y, NULL, NULL); +evas_object_geometry_get(*next, _x, _y, _w, _h); +l_x = f_x - c_x - step_x; +l_y = f_y - c_y - step_y; +l_w = f_w + (step_x * 2); +l_h = f_h + (step_y * 2); + +if (!ret || ELM_RECTS_INTERSECT(x, y, v_w, v_h, l_x, l_y, l_w, l_h)) + return ret; } /* Return */ @@ -453,7 +459,64 @@ _elm_scroller_elm_widget_focus_next(Eo *obj EINA_UNUSED, Elm_Scroller_Data *sd, EOLIAN static Eina_Bool _elm_scroller_elm_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, Elm_Scroller_Data *_pd EINA_UNUSED) { - return EINA_FALSE; + return EINA_TRUE; +} + +EOLIAN static Eina_Bool +_elm_scroller_elm_widget_focus_direction(Eo *obj, Elm_Scroller_Data *sd, const Evas_Object *base, double degree, Evas_Object **direction, Elm_Object_Item **direction_item, double *weight) +{ + Evas_Object *cur; + + if (!sd->content) return EINA_FALSE; + + cur = sd->content; + + /* access */ + if (_elm_config->access_mode) + { +if ((elm_widget_can_focus_get(cur)) || +(elm_widget_child_can_focus_get(cur))) + { + return elm_widget_focus_direction_get(cur, base, degree, direction, direction_item, weight); + } + +return EINA_FALSE; + } + + /* Try focus cycle in subitem */ + if ((elm_widget_can_focus_get(cur)) || + (elm_widget_child_can_focus_get(cur))) + { +Eina_Bool ret = EINA_FALSE; +Evas_Coord x = 0, y = 0; +Evas_Coord v_w = 0, v_h = 0; +Evas_Coord c_x = 0, c_y = 0; +Evas_Coord f_x = 0, f_y = 0, f_w = 0, f_h = 0; +Evas_Coord l_x = 0, l_y = 0, l_w = 0, l_h = 0; +Evas_Coord step_x = 0, step_y = 0; + +ret = elm_widget_focus_direction_get(cur, base, degree, direction, direction_item, weight); + +eo_do(obj, + elm_interface_scrollable_content_pos_get(, ), + elm_interface_scrol
[EGIT] [core/elementary] master 01/02: focus: add the focus_direction feature about item.
jaehwan pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=34e06a05e0cba7f70c4ad3ffc1e3c19eb4fb9ba7 commit 34e06a05e0cba7f70c4ad3ffc1e3c19eb4fb9ba7 Author: Jaehwan Kim <jae.hwan@samsung.com> Date: Fri Sep 25 15:24:53 2015 +0900 focus: add the focus_direction feature about item. When the focus is moved, it uses focus_direction instead of focus_origin. It can get the focus by using the geometry of previous focused object or item @feature --- src/lib/elc_ctxpopup.c | 4 +- src/lib/elc_fileselector.c | 4 +- src/lib/elc_naviframe.c| 4 +- src/lib/elc_popup.c| 4 +- src/lib/elm_box.c | 4 +- src/lib/elm_bubble.c | 4 +- src/lib/elm_flip.c | 4 +- src/lib/elm_frame.c| 4 +- src/lib/elm_general.eot| 2 - src/lib/elm_gengrid.c | 98 ++ src/lib/elm_gengrid.eo | 1 + src/lib/elm_grid.c | 4 +- src/lib/elm_layout.c | 4 +- src/lib/elm_notify.c | 4 +- src/lib/elm_spinner.c | 4 +- src/lib/elm_table.c| 4 +- src/lib/elm_widget.c | 26 +--- src/lib/elm_widget.eo | 9 ++--- src/lib/elm_widget.h | 9 +++-- src/lib/elm_win.c | 4 +- 20 files changed, 93 insertions(+), 108 deletions(-) diff --git a/src/lib/elc_ctxpopup.c b/src/lib/elc_ctxpopup.c index f23f588..df95f08 100644 --- a/src/lib/elc_ctxpopup.c +++ b/src/lib/elc_ctxpopup.c @@ -86,7 +86,7 @@ _elm_ctxpopup_elm_widget_focus_next(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd, } EOLIAN static Eina_Bool -_elm_ctxpopup_elm_widget_focus_direction(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd, const Evas_Object *base, double degree, Evas_Object **direction, double *weight) +_elm_ctxpopup_elm_widget_focus_direction(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd, const Evas_Object *base, double degree, Evas_Object **direction, Elm_Object_Item **direction_item, double *weight) { Eina_Bool int_ret; @@ -101,7 +101,7 @@ _elm_ctxpopup_elm_widget_focus_direction(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data l = eina_list_append(l, sd->box); int_ret = elm_widget_focus_list_direction_get -(obj, base, l, list_data_get, degree, direction, weight); +(obj, base, l, list_data_get, degree, direction, direction_item, weight); eina_list_free(l); return int_ret; diff --git a/src/lib/elc_fileselector.c b/src/lib/elc_fileselector.c index 74fee66..342c235 100644 --- a/src/lib/elc_fileselector.c +++ b/src/lib/elc_fileselector.c @@ -2442,7 +2442,7 @@ _elm_fileselector_elm_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, Elm } EOLIAN static Eina_Bool -_elm_fileselector_elm_widget_focus_direction(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd, const Evas_Object *base, double degree, Evas_Object **direction, double *weight) +_elm_fileselector_elm_widget_focus_direction(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd, const Evas_Object *base, double degree, Evas_Object **direction, Elm_Object_Item **direction_item, double *weight) { Eina_List *items = NULL; @@ -2455,7 +2455,7 @@ _elm_fileselector_elm_widget_focus_direction(Eo *obj EINA_UNUSED, Elm_Fileselect if (sd->ok_button) items = eina_list_append(items, sd->ok_button); elm_widget_focus_list_direction_get - (obj, base, items, eina_list_data_get, degree, direction, weight); + (obj, base, items, eina_list_data_get, degree, direction, direction_item, weight); eina_list_free(items); diff --git a/src/lib/elc_naviframe.c b/src/lib/elc_naviframe.c index f1830ab..4273480 100644 --- a/src/lib/elc_naviframe.c +++ b/src/lib/elc_naviframe.c @@ -1351,7 +1351,7 @@ _elm_naviframe_elm_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, Elm_Na } EOLIAN static Eina_Bool -_elm_naviframe_elm_widget_focus_direction(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd EINA_UNUSED, const Evas_Object *base, double degree, Evas_Object **direction, double *weight) +_elm_naviframe_elm_widget_focus_direction(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd EINA_UNUSED, const Evas_Object *base, double degree, Evas_Object **direction, Elm_Object_Item **direction_item, double *weight) { Eina_Bool int_ret; @@ -1368,7 +1368,7 @@ _elm_naviframe_elm_widget_focus_direction(Eo *obj EINA_UNUSED, Elm_Naviframe_Dat l = eina_list_append(l, VIEW(top_it)); int_ret = elm_widget_focus_list_direction_get -(obj, base, l, list_data_get, degree, direction, weight); +(obj, base, l, list_data_get, degree, direction, direction_item, weight); eina_list_free(l); diff --git a/src/lib/elc_popup.c b/src/lib/elc_popup.c index a1d7849..9e8d041 100644 --- a/src/lib/elc_popup.c +++ b/src/lib/elc_popup.c @@ -1393,7 +1393,7 @@ _elm_popup_elm_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, Elm_Popup_ } EOLIAN static Eina_Bool -_elm_popup_elm_widget_focus_direction(Eo *
[EGIT] [core/efl] master 01/01: edje_edit: remove a redundant API declaration.
jaehwan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3e5fddd72bcc6759e836bf7de80917f6bc0bf4d8 commit 3e5fddd72bcc6759e836bf7de80917f6bc0bf4d8 Author: Jaehwan Kim <jae.hwan@samsung.com> Date: Wed Sep 23 15:22:44 2015 +0900 edje_edit: remove a redundant API declaration. edje_edit_state_font_get has twice declaration in same header file. --- src/lib/edje/Edje_Edit.h | 16 ++-- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h index 448d27a..7a5ae05 100644 --- a/src/lib/edje/Edje_Edit.h +++ b/src/lib/edje/Edje_Edit.h @@ -4663,6 +4663,8 @@ EAPI Eina_Bool edje_edit_state_text_set(Evas_Object *obj, const char *part, cons /** Get font name for a given part state. * + * Remember to free the returned string using edje_edit_string_free(). + * * @param obj Object being edited. * @param part The name of the part to get the font of. * @param state The state of the part to get the font of. @@ -5131,20 +5133,6 @@ EAPI Eina_Bool edje_edit_font_del(Evas_Object *obj, const char* alias); */ EAPI const char *edje_edit_font_path_get(Evas_Object *obj, const char *alias); - -/** Get font name for a given part state. - * - * Remember to free the returned string using edje_edit_string_free(). - * - * @param obj Object being edited. - * @param part Part that contain state. - * @param state The name of the state to get the name of the font used (not including the state value). - * @param value The state value. - * - * @return The name of the font used in the given part state. - */ -EAPI const char * edje_edit_state_font_get(Evas_Object *obj, const char *part, const char *state, double value); - //@} /**/ /** IMAGES API / --
[EGIT] [core/elementary] master 01/01: focus: remove checking the focus origin in highlight job.
jaehwan pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=2c362ba7c2f8bbad9b4db97284f4e6e27cb2405b commit 2c362ba7c2f8bbad9b4db97284f4e6e27cb2405b Author: Jaehwan Kim <jae.hwan@samsung.com> Date: Fri Sep 18 16:49:14 2015 +0900 focus: remove checking the focus origin in highlight job. In some case, it can take misoperation. @fix --- src/lib/elm_win.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c index 9d4fecc..8ca3b0b 100644 --- a/src/lib/elm_win.c +++ b/src/lib/elm_win.c @@ -1002,11 +1002,7 @@ _elm_win_focus_highlight_reconfigure_job(void *data) if ((!target) || (!common_visible) || (sd->focus_highlight.cur.in_theme)) { if (target) - { - Elm_Focus_Direction focus_origin = elm_widget_focus_origin_get(target); - if (focus_origin >= ELM_FOCUS_UP && focus_origin <= ELM_FOCUS_LEFT) - _elm_win_focus_highlight_simple_setup(sd, fobj); - } + _elm_win_focus_highlight_simple_setup(sd, fobj); goto the_end; } --
[EGIT] [core/elementary] master 01/01: gengrid: remove EINA_UNUSED
jaehwan pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=2dde695b6d097c58d25a5a5eab6a211711d7bfc2 commit 2dde695b6d097c58d25a5a5eab6a211711d7bfc2 Author: Jaehwan Kim <jae.hwan@samsung.com> Date: Wed Sep 16 18:46:10 2015 +0900 gengrid: remove EINA_UNUSED --- src/lib/elm_gengrid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c index d6786f1..c55fd3f 100644 --- a/src/lib/elm_gengrid.c +++ b/src/lib/elm_gengrid.c @@ -3637,7 +3637,7 @@ _elm_gengrid_direction_item_get(Evas_Object *obj, Elm_Focus_Direction dir) } EOLIAN static Eina_Bool -_elm_gengrid_elm_widget_on_focus(Eo *obj, Elm_Gengrid_Data *sd, Elm_Object_Item *item EINA_UNUSED) +_elm_gengrid_elm_widget_on_focus(Eo *obj, Elm_Gengrid_Data *sd, Elm_Object_Item *item) { Eina_Bool int_ret = EINA_FALSE; Elm_Object_Item *eo_it = NULL; --
[EGIT] [core/elementary] elementary-1.15 02/03: gengird: change focus move mechanism in gengrid.
ami pushed a commit to branch elementary-1.15. http://git.enlightenment.org/core/elementary.git/commit/?id=1ad41b10dc77899c25f2c7d4b0164f338ea9a3d7 commit 1ad41b10dc77899c25f2c7d4b0164f338ea9a3d7 Author: Jaehwan Kim jae.hwan@samsung.com Date: Wed Aug 12 11:09:14 2015 +0900 gengird: change focus move mechanism in gengrid. This commit is related to 4d553d2bcf2157053433994ca3facb56bd670da9. It doesn't work if item_select_on_focus_disable is 1. So _item_focus_down is changed like _item_single_select_down. @fix --- src/lib/elm_gengrid.c | 38 +++--- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c index 64ac254..0d850d0 100644 --- a/src/lib/elm_gengrid.c +++ b/src/lib/elm_gengrid.c @@ -2094,32 +2094,40 @@ _item_focus_up(Elm_Gengrid_Data *sd) static Eina_Bool _item_focus_down(Elm_Gengrid_Data *sd) { - unsigned int i; + unsigned int i, idx; Elm_Gen_Item *next = NULL; + Elm_Object_Item *eo_tmp = NULL; if (!sd-focused_item) { next = ELM_GEN_ITEM_FROM_INLIST(sd-items); while ((next) (next-generation sd-generation)) next = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)-next); - -elm_object_item_focus_set(EO_OBJ(next), EINA_TRUE); -return EINA_TRUE; } else { -Elm_Object_Item *eo_next = elm_gengrid_item_next_get(sd-focused_item); -if (!eo_next) return EINA_FALSE; -next = eo_data_scope_get(eo_next, ELM_GENGRID_ITEM_CLASS); -if (eo_next == sd-focused_item) return EINA_FALSE; - } - for (i = 1; i sd-nmax; i++) - { -Elm_Object_Item *eo_tmp = - elm_gengrid_item_next_get(EO_OBJ(next)); -if (!eo_tmp) return EINA_FALSE; -next = eo_data_scope_get(eo_tmp, ELM_GENGRID_ITEM_CLASS); +idx = elm_gengrid_item_index_get(sd-focused_item); + +if (idx sd-item_count - +((sd-item_count % sd-nmax) == 0 ? + sd-nmax : (sd-item_count % sd-nmax))) + return EINA_FALSE; +if (idx sd-item_count - sd-nmax) + { + eo_tmp = elm_gengrid_last_item_get(sd-obj); + next = eo_data_scope_get(eo_tmp, ELM_GENGRID_ITEM_CLASS); + } +else + { + next = eo_data_scope_get(sd-focused_item, ELM_GENGRID_ITEM_CLASS); + for (i = 0; i sd-nmax; i++) + { + eo_tmp = elm_gengrid_item_next_get(EO_OBJ(next)); + if (!eo_tmp) return EINA_FALSE; + next = eo_data_scope_get(eo_tmp, ELM_GENGRID_ITEM_CLASS); + } + } } elm_object_item_focus_set(EO_OBJ(next), EINA_TRUE); --
[EGIT] [core/elementary] elementary-1.15 02/02: scroller: fix the misstake. change - ||
jaehwan pushed a commit to branch elementary-1.15. http://git.enlightenment.org/core/elementary.git/commit/?id=2dec568457c20574a925fff46abb19f34a1f92cf commit 2dec568457c20574a925fff46abb19f34a1f92cf Author: Jaehwan Kim jae.hwan@samsung.com Date: Mon Aug 24 13:38:08 2015 +0900 scroller: fix the misstake. change - || @fix --- src/lib/elm_scroller.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/elm_scroller.c b/src/lib/elm_scroller.c index 5243f8a..4d45fd4 100644 --- a/src/lib/elm_scroller.c +++ b/src/lib/elm_scroller.c @@ -120,10 +120,10 @@ _key_action_move(Evas_Object *obj, const char *params) if ((current_focus == obj) || ((!ELM_RECTS_INTERSECT (x, y, v_w, v_h, (f_x - c_x), (f_y - c_y), f_w, f_h)) -(!strcmp(dir, left) (f_x v_x)) -(!strcmp(dir, right) (f_x + f_w v_x + v_w)) -(!strcmp(dir, up) (f_y v_y)) -(!strcmp(dir, down) (f_y + f_h v_y + v_h +((!strcmp(dir, left) (f_x v_x)) || +(!strcmp(dir, right) (f_x + f_w v_x + v_w)) || +(!strcmp(dir, up) (f_y v_y)) || +(!strcmp(dir, down) (f_y + f_h v_y + v_h) { Eina_List *l; Evas_Object *cur; --
[EGIT] [core/elementary] master 01/01: scroller: fix the misstake. change - ||
jaehwan pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=a920d06b7813a6eb0fc93a39cd9471eb9cbfa70e commit a920d06b7813a6eb0fc93a39cd9471eb9cbfa70e Author: Jaehwan Kim jae.hwan@samsung.com Date: Mon Aug 24 13:38:08 2015 +0900 scroller: fix the misstake. change - || @fix --- src/lib/elm_scroller.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/elm_scroller.c b/src/lib/elm_scroller.c index 5243f8a..4d45fd4 100644 --- a/src/lib/elm_scroller.c +++ b/src/lib/elm_scroller.c @@ -120,10 +120,10 @@ _key_action_move(Evas_Object *obj, const char *params) if ((current_focus == obj) || ((!ELM_RECTS_INTERSECT (x, y, v_w, v_h, (f_x - c_x), (f_y - c_y), f_w, f_h)) -(!strcmp(dir, left) (f_x v_x)) -(!strcmp(dir, right) (f_x + f_w v_x + v_w)) -(!strcmp(dir, up) (f_y v_y)) -(!strcmp(dir, down) (f_y + f_h v_y + v_h +((!strcmp(dir, left) (f_x v_x)) || +(!strcmp(dir, right) (f_x + f_w v_x + v_w)) || +(!strcmp(dir, up) (f_y v_y)) || +(!strcmp(dir, down) (f_y + f_h v_y + v_h) { Eina_List *l; Evas_Object *cur; --
[EGIT] [core/elementary] elementary-1.15 01/02: scroller: fix the focus move bug in scroller.
jaehwan pushed a commit to branch elementary-1.15. http://git.enlightenment.org/core/elementary.git/commit/?id=e0e7d85a9f6c7e981bbc4dde0aca34c8d151dc1f commit e0e7d85a9f6c7e981bbc4dde0aca34c8d151dc1f Author: Jaehwan Kim jae.hwan@samsung.com Date: Tue Aug 11 18:56:52 2015 +0900 scroller: fix the focus move bug in scroller. When the focused object is out of the viewport and the key direction is only the direction focus is out, it should find the next focus. @fix --- src/lib/elm_scroller.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lib/elm_scroller.c b/src/lib/elm_scroller.c index 31b9191..5243f8a 100644 --- a/src/lib/elm_scroller.c +++ b/src/lib/elm_scroller.c @@ -87,6 +87,8 @@ _key_action_move(Evas_Object *obj, const char *params) Evas_Coord y = 0; Evas_Coord c_x = 0; Evas_Coord c_y = 0; + Evas_Coord v_x = 0; + Evas_Coord v_y = 0; Evas_Coord v_w = 0; Evas_Coord v_h = 0; Evas_Coord max_x = 0; @@ -108,7 +110,7 @@ _key_action_move(Evas_Object *obj, const char *params) elm_interface_scrollable_step_size_get(step_x, step_y), elm_interface_scrollable_page_size_get(page_x, page_y), elm_interface_scrollable_content_viewport_geometry_get - (NULL, NULL, v_w, v_h)); + (v_x, v_y, v_w, v_h)); evas_object_geometry_get(sd-content, c_x, c_y, max_x, max_y); current_focus = elm_widget_focused_object_get(obj); @@ -116,8 +118,12 @@ _key_action_move(Evas_Object *obj, const char *params) can_focus_list = elm_widget_can_focus_child_list_get(obj); if ((current_focus == obj) || - (!ELM_RECTS_INTERSECT -(x, y, v_w, v_h, (f_x - c_x), (f_y - c_y), f_w, f_h))) + ((!ELM_RECTS_INTERSECT + (x, y, v_w, v_h, (f_x - c_x), (f_y - c_y), f_w, f_h)) +(!strcmp(dir, left) (f_x v_x)) +(!strcmp(dir, right) (f_x + f_w v_x + v_w)) +(!strcmp(dir, up) (f_y v_y)) +(!strcmp(dir, down) (f_y + f_h v_y + v_h { Eina_List *l; Evas_Object *cur; --
[EGIT] [core/elementary] master 01/01: focus: add the comment about focus origin property.
jaehwan pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=6cd4d0918fd1846625d925a2129efa24568516d9 commit 6cd4d0918fd1846625d925a2129efa24568516d9 Author: Jaehwan Kim jae.hwan@samsung.com Date: Fri Aug 14 23:59:06 2015 +0900 focus: add the comment about focus origin property. --- src/lib/elm_widget.eo | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/elm_widget.eo b/src/lib/elm_widget.eo index 8520c9b..808a348 100644 --- a/src/lib/elm_widget.eo +++ b/src/lib/elm_widget.eo @@ -366,6 +366,7 @@ abstract Elm.Widget (Evas.Object_Smart, Elm_Interface_Atspi_Accessible, Elm_Inte } @property focus_origin { get { +[[Get the origination of the focus. Arrow key, tab key, mouse or deletion of an object.]] return: Elm_Focus_Direction; } } --
[EGIT] [core/elementary] master 01/01: focus: item focus moves by geometry.
jaehwan pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=f6712f962367dc2930eb376e8d98d7130e8ccdf6 commit f6712f962367dc2930eb376e8d98d7130e8ccdf6 Author: Jaehwan Kim jae.hwan@samsung.com Date: Thu Aug 13 13:45:21 2015 +0900 focus: item focus moves by geometry. In the widget code, focus origin is added. It can know the focus movement is originated by which action. The widgets can choose the item focus moves to last focused item or geometrically nearby item by focus origin. In gengrid, focus moves to last focused item if focus origin is ELM_FOCUS_REVERT. It moves to nearby item if focus origin is from ELM_FOCUS_UP to ELM_FOCUS_LEFT. TODO: widgets have items should add the direction feature if it want the focus to move to nearby item. @feature --- src/lib/elm_focus.h | 4 +++- src/lib/elm_gengrid.c | 40 +++- src/lib/elm_widget.c | 26 +++--- src/lib/elm_widget.eo | 5 + src/lib/elm_widget.h | 4 src/lib/elm_win.c | 18 +- 6 files changed, 91 insertions(+), 6 deletions(-) diff --git a/src/lib/elm_focus.h b/src/lib/elm_focus.h index fcc6aa1..5bb4f89 100644 --- a/src/lib/elm_focus.h +++ b/src/lib/elm_focus.h @@ -45,7 +45,9 @@ typedef enum ELM_FOCUS_UP, /** up direction */ ELM_FOCUS_DOWN, /** down direction */ ELM_FOCUS_RIGHT,/** right direction */ - ELM_FOCUS_LEFT /** left direction */ + ELM_FOCUS_LEFT, /** left direction */ + ELM_FOCUS_MOUSE, /** direction is from mouse */ + ELM_FOCUS_REVERT /** direction is from focus revert */ } Elm_Focus_Direction; /** diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c index 26a4953..65783c6 100644 --- a/src/lib/elm_gengrid.c +++ b/src/lib/elm_gengrid.c @@ -3524,12 +3524,47 @@ _elm_gengrid_nearest_visible_item_get(Evas_Object *obj, Elm_Object_Item *eo_it) return eo_it; } +static Elm_Object_Item * +_elm_gengrid_direction_item_get(Evas_Object *obj, Elm_Focus_Direction dir) +{ + double max_weight = 0.0, weight = 0.0; + Eina_List *item_list = NULL, *l = NULL; + Elm_Object_Item *eo_item = NULL, *best_item = NULL; + Evas_Object *fobj = _elm_widget_focus_highlight_object_get(obj); + + double degree = 0.0; + if (dir == ELM_FOCUS_UP) degree = 0.0; + else if (dir == ELM_FOCUS_DOWN) degree = 180.0; + else if (dir == ELM_FOCUS_RIGHT) degree = 90.0; + else if (dir == ELM_FOCUS_LEFT) degree = 270.0; + + item_list = elm_gengrid_realized_items_get(obj); + best_item = elm_gengrid_first_item_get(obj); + + EINA_LIST_FOREACH(item_list, l, eo_item) + { +ELM_GENGRID_ITEM_DATA_GET(eo_item, item); +weight = _elm_widget_focus_direction_weight_get(fobj, VIEW(item), degree); +if ((weight == -1.0) || +((weight != 0.0) (max_weight != -1.0) + ((int)(max_weight * 1) (int)(weight * 1 + { + best_item = eo_item; + max_weight = weight; + } + } + eina_list_free(item_list); + + return best_item; +} + EOLIAN static Eina_Bool _elm_gengrid_elm_widget_on_focus(Eo *obj, Elm_Gengrid_Data *sd) { Eina_Bool int_ret = EINA_FALSE; Elm_Object_Item *eo_it = NULL; Eina_Bool is_sel = EINA_FALSE; + Elm_Focus_Direction focus_origin; eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_on_focus()); if (!int_ret) return EINA_FALSE; @@ -3543,7 +3578,10 @@ _elm_gengrid_elm_widget_on_focus(Eo *obj, Elm_Gengrid_Data *sd) if (elm_widget_focus_get(obj) !sd-mouse_down) { -if (sd-last_focused_item) +focus_origin = elm_widget_focus_origin_get(obj); +if (focus_origin = ELM_FOCUS_UP focus_origin = ELM_FOCUS_LEFT) + eo_it = _elm_gengrid_direction_item_get(obj, focus_origin); +else if (sd-last_focused_item) eo_it = sd-last_focused_item; else if (sd-last_selected_item) eo_it = sd-last_selected_item; diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c index 0bb9f0f..db963b7 100644 --- a/src/lib/elm_widget.c +++ b/src/lib/elm_widget.c @@ -63,6 +63,7 @@ struct _Elm_Translate_String_Data /* local subsystem globals */ static unsigned int focus_order = 0; +Elm_Focus_Direction focus_origin = -1; static inline Eina_Bool _elm_widget_is(const Evas_Object *obj) @@ -173,6 +174,16 @@ _elm_widget_focus_highlight_start(const Evas_Object *obj) _elm_win_focus_highlight_start(top); } +Evas_Object * +_elm_widget_focus_highlight_object_get(const Evas_Object *obj) +{ + Evas_Object *top = elm_widget_top_get(obj); + + if (top eo_isa(top, ELM_WIN_CLASS)) + return _elm_win_focus_highlight_object_get(top); + return NULL; +} + EAPI Eina_Bool elm_widget_focus_highlight_enabled_get(const Evas_Object *obj) { @@ -385,6 +396,7 @@ _if_focused_revert(Evas_Object *obj, if (!sd-focused) return
[EGIT] [core/elementary] master 01/01: test_gengrid: change the min size of gengrid
jaehwan pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=fdca39ae16968f41aee14b12fe9d07d3071c288e commit fdca39ae16968f41aee14b12fe9d07d3071c288e Author: Jaehwan Kim jae.hwan@samsung.com Date: Thu Aug 13 13:32:43 2015 +0900 test_gengrid: change the min size of gengrid --- src/bin/test_gengrid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/test_gengrid.c b/src/bin/test_gengrid.c index 7e7c982..1de161a 100644 --- a/src/bin/test_gengrid.c +++ b/src/bin/test_gengrid.c @@ -1743,7 +1743,7 @@ test_gengrid_focus(void *data EINA_UNUSED, ELM_SCALE_SIZE(150)); evas_object_size_hint_weight_set(gengrid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(gengrid, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_min_set(gengrid, 0, ELM_SCALE_SIZE(600)); + evas_object_size_hint_min_set(gengrid, 0, ELM_SCALE_SIZE(620)); elm_box_pack_end(in_bx, gengrid); evas_object_show(gengrid); evas_object_smart_callback_add(gengrid, item,focused, _gengrid_focus_item_cb, item,focused); @@ -1761,7 +1761,7 @@ test_gengrid_focus(void *data EINA_UNUSED, ELM_SCALE_SIZE(150)); evas_object_size_hint_weight_set(gengrid2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(gengrid2, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_min_set(gengrid2, 0, ELM_SCALE_SIZE(600)); + evas_object_size_hint_min_set(gengrid2, 0, ELM_SCALE_SIZE(620)); elm_box_pack_end(in_bx, gengrid2); evas_object_show(gengrid2); evas_object_smart_callback_add(gengrid2, item,focused, _gengrid_focus_item_cb, item,focused); --
[EGIT] [core/elementary] master 01/01: scroller: fix the focus move bug in scroller.
jaehwan pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=71bff55b619ec7dfaaf973a091738a2b6a526649 commit 71bff55b619ec7dfaaf973a091738a2b6a526649 Author: Jaehwan Kim jae.hwan@samsung.com Date: Tue Aug 11 18:56:52 2015 +0900 scroller: fix the focus move bug in scroller. When the focused object is out of the viewport and the key direction is only the direction focus is out, it should find the next focus. @fix --- src/lib/elm_scroller.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lib/elm_scroller.c b/src/lib/elm_scroller.c index 31b9191..5243f8a 100644 --- a/src/lib/elm_scroller.c +++ b/src/lib/elm_scroller.c @@ -87,6 +87,8 @@ _key_action_move(Evas_Object *obj, const char *params) Evas_Coord y = 0; Evas_Coord c_x = 0; Evas_Coord c_y = 0; + Evas_Coord v_x = 0; + Evas_Coord v_y = 0; Evas_Coord v_w = 0; Evas_Coord v_h = 0; Evas_Coord max_x = 0; @@ -108,7 +110,7 @@ _key_action_move(Evas_Object *obj, const char *params) elm_interface_scrollable_step_size_get(step_x, step_y), elm_interface_scrollable_page_size_get(page_x, page_y), elm_interface_scrollable_content_viewport_geometry_get - (NULL, NULL, v_w, v_h)); + (v_x, v_y, v_w, v_h)); evas_object_geometry_get(sd-content, c_x, c_y, max_x, max_y); current_focus = elm_widget_focused_object_get(obj); @@ -116,8 +118,12 @@ _key_action_move(Evas_Object *obj, const char *params) can_focus_list = elm_widget_can_focus_child_list_get(obj); if ((current_focus == obj) || - (!ELM_RECTS_INTERSECT -(x, y, v_w, v_h, (f_x - c_x), (f_y - c_y), f_w, f_h))) + ((!ELM_RECTS_INTERSECT + (x, y, v_w, v_h, (f_x - c_x), (f_y - c_y), f_w, f_h)) +(!strcmp(dir, left) (f_x v_x)) +(!strcmp(dir, right) (f_x + f_w v_x + v_w)) +(!strcmp(dir, up) (f_y v_y)) +(!strcmp(dir, down) (f_y + f_h v_y + v_h { Eina_List *l; Evas_Object *cur; --
[EGIT] [core/elementary] master 01/01: gengird: change focus move mechanism in gengrid.
jaehwan pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=d0ff54940c9df84e229d91060d826bf7bc8b7e3a commit d0ff54940c9df84e229d91060d826bf7bc8b7e3a Author: Jaehwan Kim jae.hwan@samsung.com Date: Wed Aug 12 11:09:14 2015 +0900 gengird: change focus move mechanism in gengrid. This commit is related to 4d553d2bcf2157053433994ca3facb56bd670da9. It doesn't work if item_select_on_focus_disable is 1. So _item_focus_down is changed like _item_single_select_down. @fix --- src/lib/elm_gengrid.c | 38 +++--- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c index 5cbda41..ed5599f 100644 --- a/src/lib/elm_gengrid.c +++ b/src/lib/elm_gengrid.c @@ -2094,32 +2094,40 @@ _item_focus_up(Elm_Gengrid_Data *sd) static Eina_Bool _item_focus_down(Elm_Gengrid_Data *sd) { - unsigned int i; + unsigned int i, idx; Elm_Gen_Item *next = NULL; + Elm_Object_Item *eo_tmp = NULL; if (!sd-focused_item) { next = ELM_GEN_ITEM_FROM_INLIST(sd-items); while ((next) (next-generation sd-generation)) next = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)-next); - -elm_object_item_focus_set(EO_OBJ(next), EINA_TRUE); -return EINA_TRUE; } else { -Elm_Object_Item *eo_next = elm_gengrid_item_next_get(sd-focused_item); -if (!eo_next) return EINA_FALSE; -next = eo_data_scope_get(eo_next, ELM_GENGRID_ITEM_CLASS); -if (eo_next == sd-focused_item) return EINA_FALSE; - } - for (i = 1; i sd-nmax; i++) - { -Elm_Object_Item *eo_tmp = - elm_gengrid_item_next_get(EO_OBJ(next)); -if (!eo_tmp) return EINA_FALSE; -next = eo_data_scope_get(eo_tmp, ELM_GENGRID_ITEM_CLASS); +idx = elm_gengrid_item_index_get(sd-focused_item); + +if (idx sd-item_count - +((sd-item_count % sd-nmax) == 0 ? + sd-nmax : (sd-item_count % sd-nmax))) + return EINA_FALSE; +if (idx sd-item_count - sd-nmax) + { + eo_tmp = elm_gengrid_last_item_get(sd-obj); + next = eo_data_scope_get(eo_tmp, ELM_GENGRID_ITEM_CLASS); + } +else + { + next = eo_data_scope_get(sd-focused_item, ELM_GENGRID_ITEM_CLASS); + for (i = 0; i sd-nmax; i++) + { + eo_tmp = elm_gengrid_item_next_get(EO_OBJ(next)); + if (!eo_tmp) return EINA_FALSE; + next = eo_data_scope_get(eo_tmp, ELM_GENGRID_ITEM_CLASS); + } + } } elm_object_item_focus_set(EO_OBJ(next), EINA_TRUE); --
[EGIT] [core/elementary] master 01/01: focus: add del callback always.
jaehwan pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=5c8d643271879db3747e3745382ba2f88bd28c55 commit 5c8d643271879db3747e3745382ba2f88bd28c55 Author: Jaehwan Kim jae.hwan@samsung.com Date: Wed Aug 5 14:46:01 2015 +0900 focus: add del callback always. When the window treats focused object, it should always check that it is deleted. @fix --- src/lib/elm_win.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c index 9c0b315..5c0d807 100644 --- a/src/lib/elm_win.c +++ b/src/lib/elm_win.c @@ -1691,8 +1691,6 @@ _elm_win_focus_target_callbacks_add(Elm_Win_Data *sd) (obj, EVAS_CALLBACK_MOVE, _elm_win_focus_target_move, sd-obj); evas_object_event_callback_add (obj, EVAS_CALLBACK_RESIZE, _elm_win_focus_target_resize, sd-obj); - evas_object_event_callback_add - (obj, EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd-obj); } static void @@ -1704,8 +1702,6 @@ _elm_win_focus_target_callbacks_del(Elm_Win_Data *sd) (obj, EVAS_CALLBACK_MOVE, _elm_win_focus_target_move, sd-obj); evas_object_event_callback_del_full (obj, EVAS_CALLBACK_RESIZE, _elm_win_focus_target_resize, sd-obj); - evas_object_event_callback_del_full - (obj, EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd-obj); } static void @@ -1726,6 +1722,9 @@ _elm_win_object_focus_in(void *data, else _elm_win_focus_target_callbacks_add(sd); + evas_object_event_callback_add + (target, EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd-obj); + _elm_win_focus_highlight_reconfigure_job_start(sd); } @@ -1742,6 +1741,10 @@ _elm_win_object_focus_out(void *data, if (!sd-focus_highlight.cur.in_theme) _elm_win_focus_target_callbacks_del(sd); + evas_object_event_callback_del_full + (sd-focus_highlight.cur.target, + EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd-obj); + sd-focus_highlight.cur.target = NULL; sd-focus_highlight.cur.in_theme = EINA_FALSE; @@ -1757,6 +1760,9 @@ _elm_win_focus_highlight_shutdown(Elm_Win_Data *sd) elm_widget_signal_emit(sd-focus_highlight.cur.target, elm,action,focus_highlight,hide, elm); _elm_win_focus_target_callbacks_del(sd); +evas_object_event_callback_del_full + (sd-focus_highlight.cur.target, +EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd-obj); sd-focus_highlight.cur.target = NULL; } ELM_SAFE_FREE(sd-focus_highlight.fobj, evas_object_del); @@ -2562,6 +2568,10 @@ _elm_win_focus_highlight_init(Elm_Win_Data *sd) sd-focus_highlight.cur.in_theme = EINA_TRUE; else _elm_win_focus_target_callbacks_add(sd); + +evas_object_event_callback_add + (sd-focus_highlight.cur.target, +EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd-obj); } sd-focus_highlight.prev.target = NULL; --
[EGIT] [core/elementary] elementary-1.15 01/01: focus: add del callback always.
jaehwan pushed a commit to branch elementary-1.15. http://git.enlightenment.org/core/elementary.git/commit/?id=d2d883c0ac79e8dae5600ed173a4180b56540576 commit d2d883c0ac79e8dae5600ed173a4180b56540576 Author: Jaehwan Kim jae.hwan@samsung.com Date: Wed Aug 5 14:46:01 2015 +0900 focus: add del callback always. When the window treats focused object, it should always check that it is deleted. @fix --- src/lib/elm_win.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c index 9c0b315..5c0d807 100644 --- a/src/lib/elm_win.c +++ b/src/lib/elm_win.c @@ -1691,8 +1691,6 @@ _elm_win_focus_target_callbacks_add(Elm_Win_Data *sd) (obj, EVAS_CALLBACK_MOVE, _elm_win_focus_target_move, sd-obj); evas_object_event_callback_add (obj, EVAS_CALLBACK_RESIZE, _elm_win_focus_target_resize, sd-obj); - evas_object_event_callback_add - (obj, EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd-obj); } static void @@ -1704,8 +1702,6 @@ _elm_win_focus_target_callbacks_del(Elm_Win_Data *sd) (obj, EVAS_CALLBACK_MOVE, _elm_win_focus_target_move, sd-obj); evas_object_event_callback_del_full (obj, EVAS_CALLBACK_RESIZE, _elm_win_focus_target_resize, sd-obj); - evas_object_event_callback_del_full - (obj, EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd-obj); } static void @@ -1726,6 +1722,9 @@ _elm_win_object_focus_in(void *data, else _elm_win_focus_target_callbacks_add(sd); + evas_object_event_callback_add + (target, EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd-obj); + _elm_win_focus_highlight_reconfigure_job_start(sd); } @@ -1742,6 +1741,10 @@ _elm_win_object_focus_out(void *data, if (!sd-focus_highlight.cur.in_theme) _elm_win_focus_target_callbacks_del(sd); + evas_object_event_callback_del_full + (sd-focus_highlight.cur.target, + EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd-obj); + sd-focus_highlight.cur.target = NULL; sd-focus_highlight.cur.in_theme = EINA_FALSE; @@ -1757,6 +1760,9 @@ _elm_win_focus_highlight_shutdown(Elm_Win_Data *sd) elm_widget_signal_emit(sd-focus_highlight.cur.target, elm,action,focus_highlight,hide, elm); _elm_win_focus_target_callbacks_del(sd); +evas_object_event_callback_del_full + (sd-focus_highlight.cur.target, +EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd-obj); sd-focus_highlight.cur.target = NULL; } ELM_SAFE_FREE(sd-focus_highlight.fobj, evas_object_del); @@ -2562,6 +2568,10 @@ _elm_win_focus_highlight_init(Elm_Win_Data *sd) sd-focus_highlight.cur.in_theme = EINA_TRUE; else _elm_win_focus_target_callbacks_add(sd); + +evas_object_event_callback_add + (sd-focus_highlight.cur.target, +EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd-obj); } sd-focus_highlight.prev.target = NULL; --
[EGIT] [core/efl] master 01/01: evas engine: add null point exception.
jaehwan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8f9eb82991384f4edcbb1cdf13febecf30c382dd commit 8f9eb82991384f4edcbb1cdf13febecf30c382dd Author: Jaehwan Kim jae.hwan@samsung.com Date: Thu Jul 30 11:08:39 2015 +0900 evas engine: add null point exception. Sometimes the data parameter can be null. It makes a segment fault. test: evas_new add method_output as buffer evas_free @fix --- src/modules/evas/engines/buffer/evas_engine.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/modules/evas/engines/buffer/evas_engine.c b/src/modules/evas/engines/buffer/evas_engine.c index e12381b..21dff7d 100644 --- a/src/modules/evas/engines/buffer/evas_engine.c +++ b/src/modules/evas/engines/buffer/evas_engine.c @@ -169,9 +169,11 @@ eng_output_free(void *data) { Render_Engine *re; - re = (Render_Engine *)data; - evas_render_engine_software_generic_clean(re-generic); - free(re); + if ((re = (Render_Engine *)data)) + { +evas_render_engine_software_generic_clean(re-generic); +free(re); + } evas_common_shutdown(); } @@ -181,9 +183,9 @@ eng_canvas_alpha_get(void *data, void *context EINA_UNUSED) { Render_Engine *re; - re = (Render_Engine *)data; - if (re-generic.ob-priv.back_buf) - return re-generic.ob-priv.back_buf-cache_entry.flags.alpha; + if ((re = (Render_Engine *)data)) + if (re-generic.ob-priv.back_buf) + return re-generic.ob-priv.back_buf-cache_entry.flags.alpha; return EINA_TRUE; } --
[EGIT] [core/elementary] master 01/01: elm_macro: add cast.
jaehwan pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=794a1ba5ff1f5dc874815efeb3a48c6339883013 commit 794a1ba5ff1f5dc874815efeb3a48c6339883013 Author: Jaehwan Kim jae.hwan@samsung.com Date: Wed Jul 15 16:21:06 2015 +0900 elm_macro: add cast. It is used by pixel calculation. It should be changed to int. --- src/lib/elm_macros.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elm_macros.h b/src/lib/elm_macros.h index 2f62003..c786c68 100644 --- a/src/lib/elm_macros.h +++ b/src/lib/elm_macros.h @@ -1,7 +1,7 @@ /* handy macros */ #define ELM_RECTS_INTERSECT(x, y, w, h, xx, yy, ww, hh) (((x) ((xx) + (ww))) ((y) ((yy) + (hh))) (((x) + (w)) (xx)) (((y) + (h)) (yy))) #define ELM_PI 3.14159265358979323846 -#define ELM_SCALE_SIZE(x) (((x) / elm_app_base_scale_get()) * elm_config_scale_get()) +#define ELM_SCALE_SIZE(x) (int)(((double)(x) / elm_app_base_scale_get()) * elm_config_scale_get()) // checks if the point(xx, yy) stays out of the rectangle(x, y, w, h) area. #define ELM_RECTS_POINT_OUT(x, y, w, h, xx, yy) (((xx) (x)) || ((yy) (y)) || ((xx) ((x) + (w))) || ((yy) ((y) + (h --
[EGIT] [core/elementary] master 01/01: config: fix the flush file path.
jaehwan pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=44dad9fabb718e2d75c2909b89e53cdf1b4e1b13 commit 44dad9fabb718e2d75c2909b89e53cdf1b4e1b13 Author: Jaehwan Kim jae.hwan@samsung.com Date: Tue Jun 23 22:56:17 2015 +0900 config: fix the flush file path. @fix --- src/lib/elm_config.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c index b823346..676137f 100644 --- a/src/lib/elm_config.c +++ b/src/lib/elm_config.c @@ -3065,8 +3065,7 @@ elm_config_all_flush(void) FILE *f; char buf[PATH_MAX]; - _elm_config_user_dir_snprintf(buf, sizeof(buf), config/%s/flush, - _elm_profile); + _elm_config_user_dir_snprintf(buf, sizeof(buf), config/flush); f = fopen(buf, w+); if (f) { --
[EGIT] [core/efl] efl-1.13 01/01: ecore_timer: fix the default return value.
jaehwan pushed a commit to branch efl-1.13. http://git.enlightenment.org/core/efl.git/commit/?id=ffdd54df345f815c7b650813a1a08d1e77f7e165 commit ffdd54df345f815c7b650813a1a08d1e77f7e165 Author: Jaehwan Kim jae.hwan@samsung.com Date: Wed Apr 22 18:01:14 2015 +0900 ecore_timer: fix the default return value. When this function fails to get the interval value, it should return -1.0. Currently, the value can be integer(-1.0 has an Error). Maybe it should be fixed. @fix --- src/lib/ecore/ecore_timer.eo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ecore/ecore_timer.eo b/src/lib/ecore/ecore_timer.eo index f1c0403..dac06f5 100644 --- a/src/lib/ecore/ecore_timer.eo +++ b/src/lib/ecore/ecore_timer.eo @@ -19,7 +19,7 @@ class Ecore.Timer (Eo.Base) /*@ Get the interval the timer ticks on. */ } values { -double in; /*@ The new interval in seconds */ +double in(-1); /*@ The new interval in seconds */ } } pending { --