From: Daniel Juyung Seo Date: Wed, 11 Aug 2010 04:25:50 +0000 (+0900) Subject: Modified WIDTYPE check routine. (from SVN rev.50980) X-Git-Tag: beat-winset-test_0.1.1-40~68^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=760635a21bc92ca474719c79d0d0bc14e3953dc4;p=framework%2Fuifw%2Felementary.git Modified WIDTYPE check routine. (from SVN rev.50980) --- diff --git a/src/lib/elm_main.c b/src/lib/elm_main.c index 9faafb7..8cb9dab 100644 --- a/src/lib/elm_main.c +++ b/src/lib/elm_main.c @@ -289,6 +289,26 @@ _elm_rescale(void) _elm_win_rescale(); } +static Eina_List *widtypes = NULL; + +void +_elm_widtype_register(const char **ptr) +{ + widtypes = eina_list_append(widtypes, (void *)ptr); +} + +static void +_elm_widtype_clear(void) +{ + const char **ptr; + + EINA_LIST_FREE(widtypes, ptr) + { + eina_stringshare_del(*ptr); + *ptr = NULL; + } +} + static void _set_elm_module() { @@ -576,6 +596,8 @@ elm_quicklaunch_shutdown(void) _elm_log_dom = -1; } + _elm_widtype_clear(); + eina_shutdown(); } diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h index aeae950..0674da3 100644 --- a/src/lib/elm_priv.h +++ b/src/lib/elm_priv.h @@ -206,7 +206,17 @@ Eina_Bool elm_selection_set(enum _elm_sel_type selection, Evas_Object *widge Eina_Bool elm_selection_clear(enum _elm_sel_type selection, Evas_Object *widget); Eina_Bool elm_selection_get(enum _elm_sel_type selection, enum _elm_sel_format format, Evas_Object *widget); -#define ELM_SET_WIDTYPE(widtype, type) if (!widtype) widtype = eina_stringshare_add(type) +void _elm_widtype_register(const char **ptr); + + +#define ELM_SET_WIDTYPE(widtype, type) \ + do { \ + if (!widtype) { \ + widtype = eina_stringshare_add(type); \ + _elm_widtype_register(&widtype); \ + } \ + } while (0) + //#define ELM_CHECK_WIDTYPE(obj, widtype) if (elm_widget_type_get(obj) != widtype) return #define ELM_CHECK_WIDTYPE(obj, widtype) if (!_elm_widget_type_check((obj), (widtype))) return