summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyuan Choi <ryuan.choi@gmail.com>2013-10-19 00:06:25 +0900
committerRyuan Choi <ryuan.choi@gmail.com>2013-10-19 00:14:57 +0900
commita589b93e6dfae2d59ff36d9e9981c03cdd51e600 (patch)
tree08d96ce250759b4eaf3ca93e827a6876ba2327d9
parent4a990e0c6d24150510758ff9a4272023a2d13365 (diff)
gengrid: adopted ELM_PRIV_XXX_SIGNALS to reduce human mistake.
"index,update" signal is missing in signal description. So, This patch refactored signal declarations to avoid mistakes. It was introduced since b430c07ca1f1.
-rw-r--r--src/lib/elm_gengrid.c97
1 files changed, 36 insertions, 61 deletions
diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c
index f049aa5e9..c63e3e14e 100644
--- a/src/lib/elm_gengrid.c
+++ b/src/lib/elm_gengrid.c
@@ -36,74 +36,49 @@ EAPI const char ELM_GENGRID_PAN_SMART_NAME[] = "elm_gengrid_pan";
36 36
37#define GG_IT(_it) (_it->item) 37#define GG_IT(_it) (_it->item)
38 38
39static const char SIG_ACTIVATED[] = "activated"; 39#define ELM_PRIV_GENGRID_SIGNALS(cmd) \
40static const char SIG_CLICKED_DOUBLE[] = "clicked,double"; 40 cmd(SIG_ACTIVATED, "activated", "") \
41static const char SIG_LONGPRESSED[] = "longpressed"; 41 cmd(SIG_CLICKED_DOUBLE, "clicked,double", "") \
42static const char SIG_SELECTED[] = "selected"; 42 cmd(SIG_LONGPRESSED, "longpressed", "") \
43static const char SIG_UNSELECTED[] = "unselected"; 43 cmd(SIG_SELECTED, "selected", "") \
44static const char SIG_REALIZED[] = "realized"; 44 cmd(SIG_UNSELECTED, "unselected", "") \
45static const char SIG_UNREALIZED[] = "unrealized"; 45 cmd(SIG_REALIZED, "realized", "") \
46static const char SIG_CHANGED[] = "changed"; 46 cmd(SIG_UNREALIZED, "unrealized", "") \
47static const char SIG_DRAG_START_UP[] = "drag,start,up"; 47 cmd(SIG_CHANGED, "changed", "") \
48static const char SIG_DRAG_START_DOWN[] = "drag,start,down"; 48 cmd(SIG_DRAG_START_UP, "drag,start,up", "") \
49static const char SIG_DRAG_START_LEFT[] = "drag,start,left"; 49 cmd(SIG_DRAG_START_DOWN, "drag,start,down", "") \
50static const char SIG_DRAG_START_RIGHT[] = "drag,start,right"; 50 cmd(SIG_DRAG_START_LEFT, "drag,start,left", "") \
51static const char SIG_DRAG_STOP[] = "drag,stop"; 51 cmd(SIG_DRAG_START_RIGHT, "drag,start,right", "") \
52static const char SIG_DRAG[] = "drag"; 52 cmd(SIG_DRAG_STOP, "drag,stop", "") \
53static const char SIG_SCROLL[] = "scroll"; 53 cmd(SIG_DRAG, "drag", "") \
54static const char SIG_SCROLL_ANIM_START[] = "scroll,anim,start"; 54 cmd(SIG_SCROLL, "scroll", "") \
55static const char SIG_SCROLL_ANIM_STOP[] = "scroll,anim,stop"; 55 cmd(SIG_SCROLL_ANIM_START, "scroll,anim,start", "") \
56static const char SIG_SCROLL_DRAG_START[] = "scroll,drag,start"; 56 cmd(SIG_SCROLL_ANIM_STOP, "scroll,anim,stop", "") \
57static const char SIG_SCROLL_DRAG_STOP[] = "scroll,drag,stop"; 57 cmd(SIG_SCROLL_DRAG_START, "scroll,drag,start", "") \
58static const char SIG_SCROLL_PAGE_CHANGE[] = "scroll,page,changed"; 58 cmd(SIG_SCROLL_DRAG_STOP, "scroll,drag,stop", "") \
59static const char SIG_EDGE_TOP[] = "edge,top"; 59 cmd(SIG_SCROLL_PAGE_CHANGE, "scroll,page,changed", "") \
60static const char SIG_EDGE_BOTTOM[] = "edge,bottom"; 60 cmd(SIG_EDGE_TOP, "edge,top", "") \
61static const char SIG_EDGE_LEFT[] = "edge,left"; 61 cmd(SIG_EDGE_BOTTOM, "edge,bottom", "") \
62static const char SIG_EDGE_RIGHT[] = "edge,right"; 62 cmd(SIG_EDGE_LEFT, "edge,left", "") \
63static const char SIG_MOVED[] = "moved"; 63 cmd(SIG_EDGE_RIGHT, "edge,right", "") \
64static const char SIG_INDEX_UPDATE[] = "index,update"; 64 cmd(SIG_MOVED, "moved", "") \
65static const char SIG_HIGHLIGHTED[] = "highlighted"; 65 cmd(SIG_INDEX_UPDATE, "index,update", "") \
66static const char SIG_UNHIGHLIGHTED[] = "unhighlighted"; 66 cmd(SIG_HIGHLIGHTED, "highlighted", "") \
67static const char SIG_LANG_CHANGED[] = "language,changed"; 67 cmd(SIG_UNHIGHLIGHTED, "unhighlighted", "") \
68static const char SIG_PRESSED[] = "pressed"; 68 cmd(SIG_LANG_CHANGED, "language,changed", "") \
69static const char SIG_RELEASED[] = "released"; 69 cmd(SIG_PRESSED, "pressed", "") \
70 cmd(SIG_RELEASED, "released", "")
71
72ELM_PRIV_GENGRID_SIGNALS(ELM_PRIV_STATIC_VARIABLE_DECLARE);
70 73
71static const Evas_Smart_Cb_Description _smart_callbacks[] = { 74static const Evas_Smart_Cb_Description _smart_callbacks[] = {
72 {SIG_ACTIVATED, ""}, 75 ELM_PRIV_GENGRID_SIGNALS(ELM_PRIV_SMART_CALLBACKS_DESC)
73 {SIG_CLICKED_DOUBLE, ""},
74 {SIG_LONGPRESSED, ""},
75 {SIG_SELECTED, ""},
76 {SIG_UNSELECTED, ""},
77 {SIG_REALIZED, ""},
78 {SIG_UNREALIZED, ""},
79 {SIG_CHANGED, ""},
80 {SIG_DRAG_START_UP, ""},
81 {SIG_DRAG_START_DOWN, ""},
82 {SIG_DRAG_START_LEFT, ""},
83 {SIG_DRAG_START_RIGHT, ""},
84 {SIG_DRAG_STOP, ""},
85 {SIG_DRAG, ""},
86 {SIG_SCROLL, ""},
87 {SIG_SCROLL_ANIM_START, ""},
88 {SIG_SCROLL_ANIM_STOP, ""},
89 {SIG_SCROLL_DRAG_START, ""},
90 {SIG_SCROLL_DRAG_STOP, ""},
91 {SIG_EDGE_TOP, ""},
92 {SIG_EDGE_BOTTOM, ""},
93 {SIG_EDGE_LEFT, ""},
94 {SIG_EDGE_RIGHT, ""},
95 {SIG_MOVED, ""},
96 {SIG_HIGHLIGHTED, ""},
97 {SIG_UNHIGHLIGHTED, ""},
98 {SIG_LANG_CHANGED, ""},
99 {SIG_PRESSED, ""},
100 {SIG_RELEASED, ""},
101 {SIG_SCROLL_PAGE_CHANGE, ""},
102 {"focused", ""}, /**< handled by elm_widget */ 76 {"focused", ""}, /**< handled by elm_widget */
103 {"unfocused", ""}, /**< handled by elm_widget */ 77 {"unfocused", ""}, /**< handled by elm_widget */
104 78
105 {NULL, NULL} 79 {NULL, NULL}
106}; 80};
81#undef ELM_PRIV_GENGRID_SIGNALS
107 82
108static void 83static void
109_elm_gengrid_smart_translate(Eo *obj, void *_pd EINA_UNUSED, va_list *list) 84_elm_gengrid_smart_translate(Eo *obj, void *_pd EINA_UNUSED, va_list *list)