static Evas_Smart_Class _pan_sc = EVAS_SMART_CLASS_INIT_VERSION;
+static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
+static const char SIG_SELECTED[] = "selected";
+static const char SIG_UNSELECTED[] = "unselected";
+static const char SIG_EXPANDED[] = "expanded";
+static const char SIG_CONTRACTED[] = "contracted";
+static const char SIG_EXPAND_REQUEST[] = "expand,request";
+static const char SIG_CONTRACT_REQUEST[] = "contract,request";
+static const char SIG_REALIZED[] = "realized";
+static const char SIG_UNREALIZED[] = "unrealized";
+static const char SIG_DRAG_START_UP[] = "drag,start,up";
+static const char SIG_DRAG_START_DOWN[] = "drag,start,down";
+static const char SIG_DRAG_START_LEFT[] = "drag,start,left";
+static const char SIG_DRAG_START_RIGHT[] = "drag,start,right";
+static const char SIG_DRAG_STOP[] = "drag,stop";
+static const char SIG_DRAG[] = "drag";
+static const char SIG_LONGPRESSED[] = "longpressed";
+static const char SIG_SCROLL_EDGE_TOP[] = "scroll,edge,top";
+static const char SIG_SCROLL_EDGE_BOTTOM[] = "scroll,edge,bottom";
+static const char SIG_SCROLL_EDGE_LEFT[] = "scroll,edge,left";
+static const char SIG_SCROLL_EDGE_RIGHT[] = "scroll,edge,right";
+static const char SIG_MULTI_SWIPE_LEFT[] = "multi,swipe,left";
+static const char SIG_MULTI_SWIPE_RIGHT[] = "multi,swipe,right";
+static const char SIG_MULTI_SWIPE_UP[] = "multi,swipe,up";
+static const char SIG_MULTI_SWIPE_DOWN[] = "multi,swipe,down";
+static const char SIG_MULTI_PINCH_OUT[] = "multi,pinch,out";
+static const char SIG_MULTI_PINCH_IN[] = "multi,pinch,in";
+static const char SIG_SWIPE[] = "swipe";
+
+static const Evas_Smart_Cb_Description _signals[] = {
+ {SIG_CLICKED_DOUBLE, ""},
+ {SIG_SELECTED, ""},
+ {SIG_UNSELECTED, ""},
+ {SIG_EXPANDED, ""},
+ {SIG_CONTRACTED, ""},
+ {SIG_EXPAND_REQUEST, ""},
+ {SIG_CONTRACT_REQUEST, ""},
+ {SIG_REALIZED, ""},
+ {SIG_UNREALIZED, ""},
+ {SIG_DRAG_START_UP, ""},
+ {SIG_DRAG_START_DOWN, ""},
+ {SIG_DRAG_START_LEFT, ""},
+ {SIG_DRAG_START_RIGHT, ""},
+ {SIG_DRAG_STOP, ""},
+ {SIG_DRAG, ""},
+ {SIG_LONGPRESSED, ""},
+ {SIG_SCROLL_EDGE_TOP, ""},
+ {SIG_SCROLL_EDGE_BOTTOM, ""},
+ {SIG_SCROLL_EDGE_LEFT, ""},
+ {SIG_SCROLL_EDGE_RIGHT, ""},
+ {SIG_MULTI_SWIPE_LEFT, ""},
+ {SIG_MULTI_SWIPE_RIGHT, ""},
+ {SIG_MULTI_SWIPE_UP, ""},
+ {SIG_MULTI_SWIPE_DOWN, ""},
+ {SIG_MULTI_PINCH_OUT, ""},
+ {SIG_MULTI_PINCH_IN, ""},
+ {SIG_SWIPE, ""},
+ {NULL, NULL}
+};
+
static Eina_Bool
_event_hook(Evas_Object *obj,
Evas_Object *src __UNUSED__,
it->wd->walking++;
if (it->func.func) it->func.func((void *)it->func.data, it->base.widget, it);
if (!it->delete_me)
- evas_object_smart_callback_call(it->base.widget, "selected", it);
+ evas_object_smart_callback_call(it->base.widget, SIG_SELECTED, it);
it->walking--;
it->wd->walking--;
if ((it->wd->clear_me) && (!it->wd->walking))
{
it->selected = EINA_FALSE;
it->wd->selected = eina_list_remove(it->wd->selected, it);
- evas_object_smart_callback_call(it->base.widget, "unselected", it);
+ evas_object_smart_callback_call(it->base.widget, SIG_UNSELECTED, it);
}
}
ecore_timer_del(it->long_timer);
it->long_timer = NULL;
}
- evas_object_smart_callback_call(it->base.widget, "drag", it);
+ evas_object_smart_callback_call(it->base.widget, SIG_DRAG, it);
return;
}
if ((!it->down) /* || (it->wd->on_hold)*/ || (it->wd->longpressed))
{
if (ady > adx)
evas_object_smart_callback_call(it->base.widget,
- "drag,start,up", it);
+ SIG_DRAG_START_UP, it);
else
{
if (dx < 0)
evas_object_smart_callback_call(it->base.widget,
- "drag,start,left", it);
+ SIG_DRAG_START_LEFT, it);
else
evas_object_smart_callback_call(it->base.widget,
- "drag,start,right", it);
+ SIG_DRAG_START_RIGHT, it);
}
}
else
{
if (ady > adx)
evas_object_smart_callback_call(it->base.widget,
- "drag,start,down", it);
+ SIG_DRAG_START_DOWN, it);
else
{
if (dx < 0)
evas_object_smart_callback_call(it->base.widget,
- "drag,start,left", it);
+ SIG_DRAG_START_LEFT, it);
else
evas_object_smart_callback_call(it->base.widget,
- "drag,start,right", it);
+ SIG_DRAG_START_RIGHT, it);
}
}
}
if ((it->disabled) || (it->dragging) || (it->display_only))
return ECORE_CALLBACK_CANCEL;
it->wd->longpressed = EINA_TRUE;
- evas_object_smart_callback_call(it->base.widget, "longpressed", it);
+ evas_object_smart_callback_call(it->base.widget, SIG_LONGPRESSED, it);
return ECORE_CALLBACK_CANCEL;
}
sum /= it->wd->movements;
if (abs(sum - it->wd->history[0].x) <= 10) return;
- evas_object_smart_callback_call(it->base.widget, "swipe", it);
+ evas_object_smart_callback_call(it->base.widget, SIG_SWIPE, it);
}
static Eina_Bool
{
if ((it->wd->cur_x > it->wd->prev_x) && (it->wd->cur_mx > it->wd->prev_mx))
evas_object_smart_callback_call(it->base.widget,
- "multi,swipe,right", it);
+ SIG_MULTI_SWIPE_RIGHT, it);
else if ((it->wd->cur_x < it->wd->prev_x) && (it->wd->cur_mx < it->wd->prev_mx))
evas_object_smart_callback_call(it->base.widget,
- "multi,swipe,left", it);
+ SIG_MULTI_SWIPE_LEFT, it);
else if (abs(it->wd->cur_x - it->wd->cur_mx) > abs(it->wd->prev_x - it->wd->prev_mx))
evas_object_smart_callback_call(it->base.widget,
- "multi,pinch,out", it);
+ SIG_MULTI_PINCH_OUT, it);
else
evas_object_smart_callback_call(it->base.widget,
- "multi,pinch,in", it);
+ SIG_MULTI_PINCH_IN, it);
}
else
{
if ((it->wd->cur_y > it->wd->prev_y) && (it->wd->cur_my > it->wd->prev_my))
evas_object_smart_callback_call(it->base.widget,
- "multi,swipe,down", it);
+ SIG_MULTI_SWIPE_DOWN, it);
else if ((it->wd->cur_y < it->wd->prev_y) && (it->wd->cur_my < it->wd->prev_my))
evas_object_smart_callback_call(it->base.widget,
- "multi,swipe,up", it);
+ SIG_MULTI_SWIPE_UP, it);
else if (abs(it->wd->cur_y - it->wd->cur_my) > abs(it->wd->prev_y - it->wd->prev_my))
evas_object_smart_callback_call(it->base.widget,
- "multi,pinch,out", it);
+ SIG_MULTI_PINCH_OUT, it);
else
evas_object_smart_callback_call(it->base.widget,
- "multi,pinch,in", it);
+ SIG_MULTI_PINCH_IN, it);
}
}
it->wd->multi_timeout = EINA_FALSE;
if (it->dragging)
{
it->dragging = EINA_FALSE;
- evas_object_smart_callback_call(it->base.widget, "drag,stop", it);
+ evas_object_smart_callback_call(it->base.widget, SIG_DRAG_STOP, it);
}
if (it->swipe_timer)
{
if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
if ((!it->disabled) && (!it->display_only))
{
- evas_object_smart_callback_call(it->base.widget, "clicked,double", it);
+ evas_object_smart_callback_call(it->base.widget, SIG_CLICKED_DOUBLE, it);
evas_object_smart_callback_call(it->base.widget, "clicked", it); // will be removed
}
if (it->long_timer) ecore_timer_del(it->long_timer);
if (it->dragging)
{
it->dragging = EINA_FALSE;
- evas_object_smart_callback_call(it->base.widget, "drag,stop", it);
+ evas_object_smart_callback_call(it->base.widget, SIG_DRAG_STOP, it);
dragged = 1;
}
if (it->swipe_timer)
Elm_Genlist_Item *it = data;
if (it->expanded)
- evas_object_smart_callback_call(it->base.widget, "contract,request", it);
+ evas_object_smart_callback_call(it->base.widget, SIG_CONTRACT_REQUEST, it);
else
- evas_object_smart_callback_call(it->base.widget, "expand,request", it);
+ evas_object_smart_callback_call(it->base.widget, SIG_EXPAND_REQUEST, it);
}
static void
Elm_Genlist_Item *it = data;
if (!it->expanded)
- evas_object_smart_callback_call(it->base.widget, "expand,request", it);
+ evas_object_smart_callback_call(it->base.widget, SIG_EXPAND_REQUEST, it);
}
static void
Elm_Genlist_Item *it = data;
if (it->expanded)
- evas_object_smart_callback_call(it->base.widget, "contract,request", it);
+ evas_object_smart_callback_call(it->base.widget, SIG_CONTRACT_REQUEST, it);
}
static Eina_Bool
it->want_unrealize = EINA_FALSE;
if (itc) _item_cache_free(itc);
- if (!calc) evas_object_smart_callback_call(it->base.widget, "realized", it);
+ if (!calc) evas_object_smart_callback_call(it->base.widget, SIG_REALIZED, it);
}
static void
Evas_Object *icon;
if (!it->realized) return;
- if (!calc) evas_object_smart_callback_call(it->base.widget, "unrealized", it);
+ if (!calc) evas_object_smart_callback_call(it->base.widget, SIG_UNREALIZED, it);
if (it->long_timer)
{
ecore_timer_del(it->long_timer);
void *event_info __UNUSED__)
{
Evas_Object *obj = data;
- evas_object_smart_callback_call(obj, "scroll,edge,left", NULL);
+ evas_object_smart_callback_call(obj, SIG_SCROLL_EDGE_LEFT, NULL);
}
static void
void *event_info __UNUSED__)
{
Evas_Object *obj = data;
- evas_object_smart_callback_call(obj, "scroll,edge,right", NULL);
+ evas_object_smart_callback_call(obj, SIG_SCROLL_EDGE_RIGHT, NULL);
}
static void
void *event_info __UNUSED__)
{
Evas_Object *obj = data;
- evas_object_smart_callback_call(obj, "scroll,edge,top", NULL);
+ evas_object_smart_callback_call(obj, SIG_SCROLL_EDGE_TOP, NULL);
}
static void
void *event_info __UNUSED__)
{
Evas_Object *obj = data;
- evas_object_smart_callback_call(obj, "scroll,edge,bottom", NULL);
+ evas_object_smart_callback_call(obj, SIG_SCROLL_EDGE_BOTTOM, NULL);
}
static void
&minw, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
+ evas_object_smart_callbacks_descriptions_set(obj, _signals);
+
_mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
return obj;
{
if (it->realized)
edje_object_signal_emit(it->base.view, "elm,state,expanded", "elm");
- evas_object_smart_callback_call(it->base.widget, "expanded", it);
+ evas_object_smart_callback_call(it->base.widget, SIG_EXPANDED, it);
}
else
{
if (it->realized)
edje_object_signal_emit(it->base.view, "elm,state,contracted", "elm");
- evas_object_smart_callback_call(it->base.widget, "contracted", it);
+ evas_object_smart_callback_call(it->base.widget, SIG_CONTRACTED, it);
}
}