Also the summary line is a bit too long. :) On 09/06/15 14:15, Daniel Kolesa wrote: > On Tue, Jun 9, 2015 at 2:11 PM, Tom Hacohen <t...@osg.samsung.com> wrote: >> Sorry for pushing this. Violates our commit guidelines. :( >> >> I haven't noticed that for some reason. > > No big deal, just wrong "namespace syntax"... > >> >> -- >> Tom. >> >> On 09/06/15 14:07, Shinwoo Kim wrote: >>> tasn pushed a commit to branch master. >>> >>> http://git.enlightenment.org/core/elementary.git/commit/?id=0e126b7091edcd9bd905fdbbe5b4f7d04f569586 >>> >>> commit 0e126b7091edcd9bd905fdbbe5b4f7d04f569586 >>> Author: Shinwoo Kim <cinoo....@samsung.com> >>> Date: Tue Jun 9 14:05:58 2015 +0100 >>> >>> [layout] support mirrored set for layout which is using >>> elm_layout_file_set() >>> >>> Summary: mirroed mode does not work, if layout uses >>> elm_layout_file_set(). >>> >>> Test Plan: >>> the following is test code. >>> [test.edc] >>> collections { >>> >>> group { >>> name: "layout/test"; >>> >>> parts { >>> >>> part { >>> name: "bg"; >>> type: RECT; >>> description { >>> state: "default" 0.0; >>> color: 255 255 0 100; >>> } >>> } >>> >>> part { >>> name: "test.rect"; >>> type: RECT; >>> description { >>> state: "default" 0.0; >>> color: 255 0 0 255; >>> rel1.to: bg; >>> rel1.relative: 0.2 0.1; >>> rel2.to: bg; >>> rel2.relative: 0.5 0.2; >>> } >>> } >>> >>> } /* parts */ >>> } /* group */ >>> } /* collections */ >>> >>> [test.c] >>> //Compile with: >>> //gcc -g test.c -o test `pkg-config --cflags --libs elementary` >>> >>> #include <Elementary.h> >>> #include <Ecore_X.h> >>> >>> static void >>> _bt_click(void *data, Evas_Object *obj, void *event_info) >>> { >>> Eina_Bool mirrored; >>> Evas_Object *layout; >>> >>> layout = data; >>> >>> mirrored = elm_config_mirrored_get(); >>> mirrored = !mirrored; >>> printf("mirred: %d\n", mirrored); >>> elm_config_mirrored_set(mirrored); >>> } >>> >>> EAPI_MAIN int >>> elm_main(int argc, char **argv) >>> { >>> Evas_Object *win, *box, *layout, *bt, *check; >>> char buf[PATH_MAX]; >>> >>> elm_app_info_set(elm_main, "elementary", "./test.edj"); >>> elm_policy_set(ELM_POLICY_QUIT, >>> ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); >>> >>> win = elm_win_add(NULL, "Layout", ELM_WIN_BASIC); >>> elm_win_autodel_set(win, EINA_TRUE); >>> >>> box = elm_box_add(win); >>> evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, >>> EVAS_HINT_EXPAND); >>> elm_win_resize_object_add(win, box); >>> evas_object_show(box); >>> >>> // Adding layout and filling it with widgets >>> layout = elm_layout_add(win); >>> evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, >>> EVAS_HINT_EXPAND); >>> evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, >>> EVAS_HINT_FILL); >>> snprintf(buf, sizeof(buf), "./test.edj"); >>> elm_layout_file_set(layout, buf, "layout/test"); >>> elm_box_pack_end(box, layout); >>> evas_object_show(layout); >>> >>> bt = elm_button_add(win); >>> elm_object_text_set(bt, "mirrored"); >>> evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, >>> EVAS_HINT_EXPAND); >>> evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, >>> EVAS_HINT_FILL); >>> evas_object_smart_callback_add(bt, "clicked", _bt_click, layout); >>> elm_box_pack_end(box, bt); >>> evas_object_show(bt); >>> >>> check = elm_check_add(win); >>> elm_object_text_set(check, "test"); >>> evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, >>> EVAS_HINT_EXPAND); >>> evas_object_size_hint_align_set(check, EVAS_HINT_FILL, >>> EVAS_HINT_FILL); >>> elm_box_pack_end(box, check); >>> evas_object_show(check); >>> >>> evas_object_resize(win, 500, 500); >>> evas_object_show(win); >>> >>> elm_run(); >>> elm_shutdown(); >>> >>> return 0; >>> } >>> ELM_MAIN() >>> >>> Reviewers: seoz, raster, tasn, Hermet >>> >>> Subscribers: seoz, cedric >>> >>> Differential Revision: https://phab.enlightenment.org/D2142 >>> --- >>> src/lib/elm_layout.c | 21 +++++++++++++++------ >>> src/lib/elm_theme.c | 1 - >>> src/lib/elm_widget_layout.h | 1 + >>> 3 files changed, 16 insertions(+), 7 deletions(-) >>> >>> diff --git a/src/lib/elm_layout.c b/src/lib/elm_layout.c >>> index 991112b..f49d158 100644 >>> --- a/src/lib/elm_layout.c >>> +++ b/src/lib/elm_layout.c >>> @@ -359,13 +359,17 @@ _elm_layout_theme_internal(Eo *obj, >>> Elm_Layout_Smart_Data *sd) >>> ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); >>> >>> /* function already prints error messages, if any */ >>> - if (!elm_widget_theme_object_set(obj, wd->resize_obj, sd->klass, >>> sd->group, >>> - elm_widget_style_get(obj))) >>> - return EINA_FALSE; >>> + if (!sd->file_set) >>> + { >>> + ret = elm_widget_theme_object_set >>> + (obj, wd->resize_obj, sd->klass, sd->group, >>> + elm_widget_style_get(obj)); >>> + } >>> >>> - ret = _visuals_refresh(obj, sd); >>> + if (ret) >>> + evas_object_smart_callback_call(obj, SIG_THEME_CHANGED, NULL); >>> >>> - evas_object_smart_callback_call(obj, SIG_THEME_CHANGED, NULL); >>> + ret = _visuals_refresh(obj, sd) && ret; >>> >>> return ret; >>> } >>> @@ -852,7 +856,11 @@ _elm_layout_efl_file_file_set(Eo *obj, >>> Elm_Layout_Smart_Data *sd, const char *fi >>> int_ret = >>> edje_object_file_set(wd->resize_obj, file, group); >>> >>> - if (int_ret) _visuals_refresh(obj, sd); >>> + if (int_ret) >>> + { >>> + sd->file_set = EINA_TRUE; >>> + _visuals_refresh(obj, sd); >>> + } >>> else >>> ERR("failed to set edje file '%s', group '%s': %s", >>> file, group, >>> @@ -874,6 +882,7 @@ _elm_layout_theme_set(Eo *obj, Elm_Layout_Smart_Data >>> *sd, const char *klass, con >>> { >>> ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); >>> >>> + if (sd->file_set) sd->file_set = EINA_FALSE; >>> eina_stringshare_replace(&(sd->klass), klass); >>> eina_stringshare_replace(&(sd->group), group); >>> eina_stringshare_replace(&(wd->style), style); >>> diff --git a/src/lib/elm_theme.c b/src/lib/elm_theme.c >>> index e2db509..8fa383e 100644 >>> --- a/src/lib/elm_theme.c >>> +++ b/src/lib/elm_theme.c >>> @@ -293,7 +293,6 @@ _elm_theme_set(Elm_Theme *th, Evas_Object *o, const >>> char *clas, const char *grou >>> >>> if ((!clas) || (!group) || (!style)) return EINA_FALSE; >>> if (!th) th = &(theme_default); >>> - >>> snprintf(buf2, sizeof(buf2), "elm/%s/%s/%s", clas, group, style); >>> if (!eina_hash_find(th->cache_style_load_failed, buf2)) >>> { >>> diff --git a/src/lib/elm_widget_layout.h b/src/lib/elm_widget_layout.h >>> index f109da6..0e0871c 100644 >>> --- a/src/lib/elm_widget_layout.h >>> +++ b/src/lib/elm_widget_layout.h >>> @@ -84,6 +84,7 @@ typedef struct _Elm_Layout_Smart_Data >>> Eina_Bool restricted_calc_h : 1; >>> Eina_Bool can_access : 1; /**< This is true when all >>> text(including textblock) parts can be accessible by accessibility. */ >>> Eina_Bool destructed_is : 1; /**< This flag indicates if >>> Elm_Layout destructor was called */ >>> + Eina_Bool file_set : 1; /**< This flag indicates if >>> Elm_Layout source file is set */ >>> } Elm_Layout_Smart_Data; >>> >>> /** >>> >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> enlightenment-devel mailing list >> enlightenment-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > > ------------------------------------------------------------------------------ > _______________________________________________ > enlightenment-devel mailing list > enlightenment-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel >
------------------------------------------------------------------------------ _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel