Review type checkers in main and widget

SVN revision: 53732
This commit is contained in:
Tiago Rezende Campos Falcao 2010-10-21 18:58:40 +00:00
parent 0fd89213af
commit ece2114120
4 changed files with 21 additions and 29 deletions

View File

@ -339,7 +339,7 @@ extern "C" {
EAPI Eina_Bool elm_focus_highlight_animate_get(void);
EAPI void elm_focus_highlight_animate_set(Eina_Bool animate);
EAPI Eina_Bool elm_object_focus_get(Evas_Object *obj);
EAPI Eina_Bool elm_object_focus_get(const Evas_Object *obj);
EAPI void elm_object_focus(Evas_Object *obj);
EAPI void elm_object_unfocus(Evas_Object *obj);
EAPI void elm_object_focus_allow_set(Evas_Object *obj, Eina_Bool enable);

View File

@ -524,7 +524,7 @@ elm_quicklaunch_init(int argc, char **argv)
#endif
if (!_elm_data_dir)
_elm_data_dir = eina_stringshare_add(PACKAGE_DATA_DIR);
if (!_elm_data_dir)
if (!_elm_data_dir)
_elm_data_dir = eina_stringshare_add("/");
if (!_elm_lib_dir)
_elm_lib_dir = eina_stringshare_add(PACKAGE_LIB_DIR);
@ -1350,7 +1350,7 @@ elm_coords_finger_size_adjust(int times_w, Evas_Coord *w, int times_h, Evas_Coor
* @ingroup Focus
*/
EAPI Eina_Bool
elm_object_focus_get(Evas_Object *obj)
elm_object_focus_get(const Evas_Object *obj)
{
return elm_widget_focus_get(obj);
}
@ -1369,10 +1369,7 @@ elm_object_focus(Evas_Object *obj)
if (elm_widget_focus_get(obj))
return;
if (!elm_widget_can_focus_get(obj))
elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
else
elm_widget_focus_steal(obj);
elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
}
/**

View File

@ -731,26 +731,9 @@ elm_widget_focused_object_get(const Evas_Object *obj)
EAPI Evas_Object *
elm_widget_top_get(const Evas_Object *obj)
{
#if 1 // strict way
API_ENTRY return NULL;
if (sd->parent_obj) return elm_widget_top_get(sd->parent_obj);
return (Evas_Object *)obj;
#else // loose way
Smart_Data *sd = evas_object_smart_data_get(obj);
Evas_Object *par;
if (!obj) return NULL;
if ((sd) && _elm_widget_is(obj))
{
if ((sd->type) && (!strcmp(sd->type, "win")))
return (Evas_Object *)obj;
if (sd->parent_obj)
return elm_widget_top_get(sd->parent_obj);
}
par = evas_object_smart_parent_get(obj);
if (!par) return (Evas_Object *)obj;
return elm_widget_top_get(par);
#endif
}
EAPI Eina_Bool
@ -1047,6 +1030,9 @@ elm_widget_focus_list_next_get(const Evas_Object *obj, const Eina_List *items, v
return EINA_FALSE;
*next = NULL;
if ((!_elm_widget_is(obj)) || elm_widget_child_can_focus_get(obj))
return EINA_FALSE;
if (!items)
return EINA_FALSE;
@ -1651,7 +1637,7 @@ elm_widget_style_set(Evas_Object *obj, const char *style)
EAPI const char *
elm_widget_style_get(const Evas_Object *obj)
{
API_ENTRY return "";
API_ENTRY return NULL;
if (sd->style) return sd->style;
return "default";
}
@ -1666,7 +1652,7 @@ elm_widget_type_set(Evas_Object *obj, const char *type)
EAPI const char *
elm_widget_type_get(const Evas_Object *obj)
{
API_ENTRY return "";
API_ENTRY return NULL;
if (sd->type) return sd->type;
return "";
}
@ -1747,9 +1733,10 @@ elm_widget_drag_child_locked_y_get(const Evas_Object *obj)
return sd->child_drag_y_locked;
}
EAPI int
EAPI Eina_Bool
elm_widget_theme_object_set(Evas_Object *obj, Evas_Object *edj, const char *wname, const char *welement, const char *wstyle)
{
API_ENTRY return EINA_FALSE;
return _elm_theme_object_set(obj, edj, wname, welement, wstyle);
}
@ -1777,6 +1764,14 @@ elm_widget_type_check(const Evas_Object *obj, const char *type)
return EINA_FALSE;
}
/**
* Split string in words
*
* @param str Source string
* @return List of const words
*
* @see elm_widget_stringlist_free()
*/
EAPI Eina_List *
elm_widget_stringlist_get(const char *str)
{
@ -1991,7 +1986,7 @@ _elm_widget_item_tooltip_label_del_cb(void *data, Evas_Object *obj __UNUSED__, v
EAPI void
_elm_widget_item_tooltip_text_set(Elm_Widget_Item *item, const char *text)
{
EINA_SAFETY_ON_NULL_RETURN(item);
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
EINA_SAFETY_ON_NULL_RETURN(text);
text = eina_stringshare_add(text);

View File

@ -289,7 +289,7 @@ EAPI Eina_Bool elm_widget_drag_lock_x_get(const Evas_Object *obj);
EAPI Eina_Bool elm_widget_drag_lock_y_get(const Evas_Object *obj);
EAPI int elm_widget_drag_child_locked_x_get(const Evas_Object *obj);
EAPI int elm_widget_drag_child_locked_y_get(const Evas_Object *obj);
EAPI int elm_widget_theme_object_set(Evas_Object *obj, Evas_Object *edj, const char *wname, const char *welement, const char *wstyle);
EAPI Eina_Bool elm_widget_theme_object_set(Evas_Object *obj, Evas_Object *edj, const char *wname, const char *welement, const char *wstyle);
EAPI void elm_widget_type_register(const char **ptr);
EAPI Eina_Bool elm_widget_type_check(const Evas_Object *obj, const char *type);
EAPI Eina_List *elm_widget_stringlist_get(const char *str);