forked from enlightenment/efl
Add missing object type checkers.
The test test_decl now warn about missing API_ENTRY or ELM_CHECK_WIDTYPE. SVN revision: 53956
This commit is contained in:
parent
ef82b1451c
commit
d938999c78
|
@ -724,6 +724,7 @@ elm_fileselector_expandable_get(const Evas_Object *obj)
|
|||
EAPI void
|
||||
elm_fileselector_path_set(Evas_Object *obj, const char *path)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
_populate(obj, path, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -651,6 +651,7 @@ elm_box_unpack_all(Evas_Object *obj)
|
|||
EAPI void
|
||||
elm_box_layout_set(Evas_Object *obj, Evas_Object_Box_Layout cb, const void *data, void (*free_data)(void *data))
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
|
||||
|
@ -683,6 +684,7 @@ elm_box_layout_set(Evas_Object *obj, Evas_Object_Box_Layout cb, const void *data
|
|||
EAPI void
|
||||
elm_box_layout_transition(Evas_Object *obj, Evas_Object_Box_Data *priv, void *data)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Elm_Box_Transition *box_data = data;
|
||||
const double curtime = ecore_loop_time_get();
|
||||
|
||||
|
|
|
@ -1020,6 +1020,7 @@ elm_slider_end_get(const Evas_Object *obj)
|
|||
EAPI void
|
||||
elm_slider_indicator_show_set(Evas_Object *obj, Eina_Bool show)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (show) {
|
||||
wd->indicator_show = EINA_TRUE;
|
||||
|
|
|
@ -1019,6 +1019,8 @@ EAPI void
|
|||
elm_widget_focus_cycle(Evas_Object *obj, Elm_Focus_Direction dir)
|
||||
{
|
||||
Evas_Object *target = NULL;
|
||||
if (!_elm_widget_is(obj))
|
||||
return;
|
||||
elm_widget_focus_next_get(obj, dir, &target);
|
||||
if (target)
|
||||
elm_widget_focus_steal(target);
|
||||
|
@ -1938,6 +1940,9 @@ elm_widget_stringlist_free(Eina_List *list)
|
|||
EAPI Elm_Widget_Item *
|
||||
_elm_widget_item_new(Evas_Object *widget, size_t alloc_size)
|
||||
{
|
||||
if (!_elm_widget_is(widget))
|
||||
return NULL;
|
||||
|
||||
Elm_Widget_Item *item;
|
||||
|
||||
EINA_SAFETY_ON_TRUE_RETURN_VAL(alloc_size < sizeof(Elm_Widget_Item), NULL);
|
||||
|
@ -2661,6 +2666,8 @@ EAPI void
|
|||
elm_widget_tree_dot_dump(const Evas_Object *top, FILE *output)
|
||||
{
|
||||
#ifdef ELM_DEBUG
|
||||
if (!_elm_widget_is(top))
|
||||
return;
|
||||
fprintf(output, "graph "" { node [shape=record];\n");
|
||||
_sub_obj_tree_dot_dump(top, output);
|
||||
fprintf(output, "}\n");
|
||||
|
|
|
@ -4,21 +4,58 @@ ret=0
|
|||
check(){
|
||||
i=$1
|
||||
shift
|
||||
sed -n "/^$i(/{g;1!p;};h" $@ >eapi.decl
|
||||
lines=$(wc -l eapi.decl|cut -f1 -d' ')
|
||||
if [ $lines == 0 ]; then
|
||||
grep -h -B1 -10 -e "^$i(" $@ >eapi.decl
|
||||
if [ $? != 0 ]; then
|
||||
echo -e "\e[31;1mNOT IMPLEMENTED\e[m\t $i"
|
||||
ret=1
|
||||
elif [ $lines != 1 ]; then
|
||||
echo -e "\e[31;1mMULTI IMPLEMENTED\e[m\t $i"
|
||||
return
|
||||
fi
|
||||
grep -qe "^--$" eapi.decl
|
||||
if [ $? == 0 ]; then
|
||||
echo -e "\e[31;1mMULTI IMPLEMENT\e[m\t $i"
|
||||
ret=1
|
||||
else
|
||||
cat eapi.decl | grep -qe '^EAPI'
|
||||
return
|
||||
fi
|
||||
|
||||
head -1 eapi.decl | grep -qe '^EAPI'
|
||||
if [ $? != 0 ];then
|
||||
echo -e "\e[31;1mMISSING EAPI\e[m\t $i"
|
||||
ret=1
|
||||
fi
|
||||
|
||||
func=$(echo $i | grep -oe 'elm_\w\+')
|
||||
|
||||
sed '2q;d' eapi.decl | grep -qe "elm_widget\w\+(\(const \)\?Evas_Object \*"
|
||||
if [ $? == 0 ];then
|
||||
tail -n9 eapi.decl | grep -q "\(API_ENTRY\|_elm_widget_is\)"
|
||||
if [ $? != 0 ];then
|
||||
echo -e "\e[31;1mMISSING EAPI\e[m\t $i"
|
||||
echo -e "\e[31;1mMISSING CHECKER\e[m\t $i"
|
||||
ret=1
|
||||
fi
|
||||
return
|
||||
fi
|
||||
|
||||
sed '2q;d' eapi.decl | grep -qe "elm_object_\w\+("
|
||||
if [ $? == 0 ];then
|
||||
rm eapi.decl
|
||||
return
|
||||
fi
|
||||
|
||||
sed '2q;d' eapi.decl | grep -qe "elm_\w\+_add("
|
||||
if [ $? == 0 ];then
|
||||
rm eapi.decl
|
||||
return
|
||||
fi
|
||||
|
||||
sed '2q;d' eapi.decl | grep -qe "elm_\w\+(\(const \)\?Evas_Object \*"
|
||||
if [ $? == 0 ];then
|
||||
tail -n9 eapi.decl | grep -q "ELM_CHECK_WIDTYPE"
|
||||
if [ $? != 0 ];then
|
||||
echo -e "\e[31;1mMISSING CHECKER\e[m\t $i"
|
||||
ret=1
|
||||
fi
|
||||
fi
|
||||
|
||||
rm eapi.decl
|
||||
}
|
||||
|
||||
|
@ -40,5 +77,6 @@ for i in $(cat eapi.list); do
|
|||
check $i src/lib/elm_widget.c
|
||||
done
|
||||
|
||||
rm -f eapi.decl
|
||||
rm eapi.list
|
||||
exit $ret
|
||||
|
|
Loading…
Reference in New Issue