elementary - use the focused/unfocused string in widget defined.

Now, it will share the strings so that reduce the binary size also user uses it in one way.
This commit is contained in:
ChunEon Park 2014-01-23 17:24:19 +09:00
parent 9b0b34e801
commit aebdcff513
35 changed files with 73 additions and 68 deletions

View File

@ -24,8 +24,8 @@ ELM_PRIV_CTXPOPUP_SIGNALS(ELM_PRIV_STATIC_VARIABLE_DECLARE);
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
ELM_PRIV_CTXPOPUP_SIGNALS(ELM_PRIV_SMART_CALLBACKS_DESC)
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};
#undef ELM_PRIV_CTXPOPUP_SIGNALS

View File

@ -38,8 +38,8 @@ ELM_PRIV_FILESELECTOR_SIGNALS(ELM_PRIV_STATIC_VARIABLE_DECLARE);
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
ELM_PRIV_FILESELECTOR_SIGNALS(ELM_PRIV_SMART_CALLBACKS_DESC)
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};
#undef ELM_PRIV_FILESELECTOR_SIGNALS

View File

@ -24,8 +24,8 @@ ELM_PRIV_FILESELECTOR_BUTTON_SIGNALS(ELM_PRIV_STATIC_VARIABLE_DECLARE);
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
ELM_PRIV_FILESELECTOR_BUTTON_SIGNALS(ELM_PRIV_SMART_CALLBACKS_DESC)
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};
#undef ELM_PRIV_FILESELECTOR_BUTTON_SIGNALS

View File

@ -30,8 +30,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_TRANSITION_FINISHED, ""},
{SIG_TITLE_TRANSITION_FINISHED, ""},
{SIG_TITLE_CLICKED, ""},
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};

View File

@ -50,8 +50,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{ SIG_EJECT_CLICKED, "" },
{ SIG_VOLUME_CLICKED, "" },
{ SIG_MUTE_CLICKED, "" },
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{ SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{ SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{ NULL, NULL }
};

View File

@ -29,8 +29,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_BLOCK_CLICKED, ""},
{SIG_TIMEOUT, ""},
{SIG_LANG_CHANGED, ""},
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};

View File

@ -19,8 +19,8 @@ static const char SIG_CLICKED[] = "clicked";
static const Evas_Smart_Cb_Description _smart_callbacks[] =
{
{SIG_CLICKED, ""},
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};

View File

@ -26,8 +26,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_REPEATED, ""},
{SIG_PRESSED, ""},
{SIG_UNPRESSED, ""},
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};

View File

@ -19,8 +19,8 @@ static const char SIG_DISPLAY_CHANGED[] = "display,changed";
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_CHANGED, ""},
{SIG_DISPLAY_CHANGED, ""},
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};

View File

@ -33,8 +33,8 @@ static const char SIG_CHANGED[] = "changed";
/* smart callbacks coming from elm check objects: */
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_CHANGED, ""},
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};

View File

@ -20,8 +20,8 @@ static const char SIG_CHANGED[] = "changed";
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_CHANGED, ""},
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};

View File

@ -29,8 +29,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] =
{SIG_COLOR_ITEM_SELECTED, ""},
{SIG_COLOR_ITEM_LONGPRESSED, ""},
{SIG_CHANGED, ""},
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};

View File

@ -67,8 +67,8 @@ static const char SIG_LANG_CHANGED[] = "language,changed";
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_CHANGED, ""},
{SIG_LANG_CHANGED, ""},
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};

View File

@ -38,8 +38,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_SCROLL_ANIM_STOP, ""},
{SIG_SCROLL_DRAG_START, ""},
{SIG_SCROLL_DRAG_STOP, ""},
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};

View File

@ -42,8 +42,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_SELECTED, ""},
{SIG_UNDERFLOWED, ""},
{SIG_OVERFLOWED, ""},
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};

View File

@ -75,8 +75,8 @@ ELM_PRIV_GENGRID_SIGNALS(ELM_PRIV_STATIC_VARIABLE_DECLARE);
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
ELM_PRIV_GENGRID_SIGNALS(ELM_PRIV_SMART_CALLBACKS_DESC)
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};

View File

@ -94,8 +94,8 @@ ELM_PRIV_GENLIST_SIGNALS(ELM_PRIV_STATIC_VARIABLE_DECLARE);
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
ELM_PRIV_GENLIST_SIGNALS(ELM_PRIV_SMART_CALLBACKS_DESC)
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};

View File

@ -54,8 +54,8 @@ ELM_PRIV_HOVER_SIGNALS(ELM_PRIV_STATIC_VARIABLE_DECLARE);
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
ELM_PRIV_HOVER_SIGNALS(ELM_PRIV_SMART_CALLBACKS_DESC)
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};
#undef ELM_PRIV_HOVER_SIGNALS

View File

@ -32,8 +32,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_LEVEL_UP, ""},
{SIG_LEVEL_DOWN, ""},
{SIG_LANG_CHANGED, ""},
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};

View File

@ -42,8 +42,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_SWIPE, ""},
{SIG_HIGHLIGHTED, ""},
{SIG_UNHIGHLIGHTED, ""},
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};

View File

@ -338,8 +338,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_OVERLAY_CLICKED, ""},
{SIG_OVERLAY_DEL, ""},
{SIG_LANG_CHANGED, ""},
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};

View File

@ -15,8 +15,8 @@ EAPI Eo_Op ELM_OBJ_PANEL_BASE_ID = EO_NOOP;
#define MY_CLASS_NAME_LEGACY "elm_panel"
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};

View File

@ -72,8 +72,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_DOWNLOAD_PROGRESS, ""},
{SIG_DOWNLOAD_DONE, ""},
{SIG_DOWNLOAD_ERROR, ""},
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};

View File

@ -487,6 +487,8 @@ extern int _elm_log_dom;
extern Eina_List *_elm_win_list;
extern int _elm_win_deferred_free;
extern const char *_elm_preferred_engine;
extern const char SIG_WIDGET_FOCUSED[];
extern const char SIG_WIDGET_UNFOCUSED[];
#ifdef ENABLE_NLS
/* Our gettext wrapper, used to disable translation of elm if the app

View File

@ -24,8 +24,8 @@ static const char SIG_CHANGED[] = "changed";
* ones coming from elm layout): */
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_CHANGED, ""},
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};

View File

@ -30,8 +30,8 @@ static const Elm_Layout_Part_Alias_Description _text_aliases[] =
static const char SIG_CHANGED[] = "changed";
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_CHANGED, ""},
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};

View File

@ -42,8 +42,8 @@ ELM_PRIV_SCROLLER_SIGNALS(ELM_PRIV_STATIC_VARIABLE_DECLARE);
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
ELM_PRIV_SCROLLER_SIGNALS(ELM_PRIV_SMART_CALLBACKS_DESC)
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};
#undef ELM_PRIV_SCROLLER_SIGNALS

View File

@ -39,8 +39,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_DELAY_CHANGED, ""},
{SIG_DRAG_START, ""},
{SIG_DRAG_STOP, ""},
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};

View File

@ -20,8 +20,8 @@ static const char SIG_TRANSITION_END[] = "transition,end";
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_CHANGED, ""},
{SIG_TRANSITION_END, ""},
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};

View File

@ -31,8 +31,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_LANG_CHANGED, ""},
{SIG_DRAG_START, ""},
{SIG_DRAG_STOP, ""},
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};

View File

@ -36,8 +36,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_LONGPRESSED, ""},
{SIG_CLICKED_DOUBLE, ""},
{SIG_LANG_CHANGED, ""},
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};

View File

@ -21,8 +21,8 @@ EAPI Eo_Op ELM_OBJ_VIDEO_BASE_ID = EO_NOOP;
#define MY_CLASS_NAME_LEGACY "elm_video"
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{NULL, NULL}
};

View File

@ -74,8 +74,8 @@ static const Evas_Smart_Cb_Description _elm_web_smart_callbacks[] = {
{ "view,resized", "" },
{ "windows,close,request", ""},
{ "zoom,animated,end", "" },
{ "focused", ""}, /**< handled by elm_widget */
{ "unfocused", ""}, /**< handled by elm_widget */
{ SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{ SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{ NULL, NULL }
};

View File

@ -26,8 +26,8 @@ static const char SIG_URL_CHANGED[] = "url,changed";
static const Evas_Smart_Cb_Description _elm_web_smart_callbacks[] = {
{ SIG_URI_CHANGED, "s" },
{ SIG_URL_CHANGED, "s" },
{ "focused", ""}, /**< handled by elm_widget */
{ "unfocused", ""}, /**< handled by elm_widget */
{ SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
{ SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{ NULL, NULL }
};

View File

@ -29,6 +29,9 @@ EAPI Eo_Op ELM_WIDGET_BASE_ID = EO_NOOP;
((_elm_access_auto_highlight_get()) ? (elm_widget_highlight_get(obj)) : \
(elm_widget_focus_get(obj)))
const char SIG_WIDGET_FOCUSED[] = "focused";
const char SIG_WIDGET_UNFOCUSED[] = "unfocused";
typedef struct _Elm_Event_Cb_Data Elm_Event_Cb_Data;
typedef struct _Elm_Label_Data Elm_Label_Data;
typedef struct _Elm_Translate_String_Data Elm_Translate_String_Data;
@ -6235,13 +6238,13 @@ _elm_widget_on_focus(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
if (!sd->resize_obj)
evas_object_focus_set(obj, EINA_TRUE);
evas_object_smart_callback_call(obj, "focused", NULL);
evas_object_smart_callback_call(obj, SIG_WIDGET_FOCUSED, NULL);
}
else
{
if (!sd->resize_obj)
evas_object_focus_set(obj, EINA_FALSE);
evas_object_smart_callback_call(obj, "unfocused", NULL);
evas_object_smart_callback_call(obj, SIG_WIDGET_UNFOCUSED, NULL);
}
}
else