summaryrefslogtreecommitdiff
path: root/src/modules/prefs
diff options
context:
space:
mode:
authorVivek Ellur <vivek.ellur@samsung.com>2015-08-28 16:30:27 +0900
committerChunEon Park <hermet@hermet.pe.kr>2015-08-28 16:30:27 +0900
commitd040f90d15a69f394e17ab19119e541d95bf9c4c (patch)
tree32e500dd71b5a7f7a1bc6c8e987795709cbd0ccf /src/modules/prefs
parent97a3144827ce65296c8a19fef0209b767db497c6 (diff)
elementary: Port evas object smart callbacks to use eo event callbacks
Summary: Changed evas_object_smart_callback_add APIs to use eo_event_callback_add API Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com> Reviewers: cedric, Hermet Reviewed By: Hermet Differential Revision: https://phab.enlightenment.org/D2995
Diffstat (limited to 'src/modules/prefs')
-rw-r--r--src/modules/prefs/Makefile.am1
-rw-r--r--src/modules/prefs/elm_button.c8
-rw-r--r--src/modules/prefs/elm_check.c9
-rw-r--r--src/modules/prefs/elm_datetime.c8
-rw-r--r--src/modules/prefs/elm_entry.c13
-rw-r--r--src/modules/prefs/elm_slider.c9
-rw-r--r--src/modules/prefs/elm_spinner.c8
7 files changed, 34 insertions, 22 deletions
diff --git a/src/modules/prefs/Makefile.am b/src/modules/prefs/Makefile.am
index c7b475951..d7280cb13 100644
--- a/src/modules/prefs/Makefile.am
+++ b/src/modules/prefs/Makefile.am
@@ -14,6 +14,7 @@ elm_prefs_swallow.edj: Makefile elm_prefs_swallow.edc
14 $(top_builddir)/src/modules/prefs/elm_prefs_swallow.edj 14 $(top_builddir)/src/modules/prefs/elm_prefs_swallow.edj
15 15
16AM_CPPFLAGS = \ 16AM_CPPFLAGS = \
17-DELM_INTERNAL_API_ARGESFSDFEFC=1 \
17-I. \ 18-I. \
18-I$(top_builddir) \ 19-I$(top_builddir) \
19-I$(top_srcdir) \ 20-I$(top_srcdir) \
diff --git a/src/modules/prefs/elm_button.c b/src/modules/prefs/elm_button.c
index 53c03f3f9..cff42e32b 100644
--- a/src/modules/prefs/elm_button.c
+++ b/src/modules/prefs/elm_button.c
@@ -8,14 +8,15 @@ static Elm_Prefs_Item_Type supported_types[] =
8 ELM_PREFS_TYPE_UNKNOWN 8 ELM_PREFS_TYPE_UNKNOWN
9}; 9};
10 10
11static void 11static Eina_Bool
12_item_changed_cb(void *data, 12_item_changed_cb(void *data,
13 Evas_Object *obj, 13 Eo *obj, const Eo_Event_Description *desc EINA_UNUSED,
14 void *event_info EINA_UNUSED) 14 void *event_info EINA_UNUSED)
15{ 15{
16 Elm_Prefs_Item_Changed_Cb prefs_it_changed_cb = data; 16 Elm_Prefs_Item_Changed_Cb prefs_it_changed_cb = data;
17 17
18 prefs_it_changed_cb(obj); 18 prefs_it_changed_cb(obj);
19 return EINA_TRUE;
19} 20}
20 21
21static Evas_Object * 22static Evas_Object *
@@ -27,7 +28,8 @@ elm_prefs_button_add(const Elm_Prefs_Item_Iface *iface EINA_UNUSED,
27{ 28{
28 Evas_Object *obj = elm_button_add(prefs); 29 Evas_Object *obj = elm_button_add(prefs);
29 30
30 evas_object_smart_callback_add(obj, "clicked", _item_changed_cb, cb); 31 eo_do(obj, eo_event_callback_add
32 (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _item_changed_cb, cb));
31 33
32 return obj; 34 return obj;
33} 35}
diff --git a/src/modules/prefs/elm_check.c b/src/modules/prefs/elm_check.c
index 8940c3bbb..b41243ea3 100644
--- a/src/modules/prefs/elm_check.c
+++ b/src/modules/prefs/elm_check.c
@@ -6,14 +6,15 @@ static Elm_Prefs_Item_Type supported_types[] =
6 ELM_PREFS_TYPE_UNKNOWN 6 ELM_PREFS_TYPE_UNKNOWN
7}; 7};
8 8
9static void 9static Eina_Bool
10_item_changed_cb(void *data, 10_item_changed_cb(void *data,
11 Evas_Object *obj, 11 Eo *obj, const Eo_Event_Description *desc EINA_UNUSED,
12 void *event_info EINA_UNUSED) 12 void *event_info EINA_UNUSED)
13{ 13{
14 Elm_Prefs_Item_Changed_Cb prefs_it_changed_cb = data; 14 Elm_Prefs_Item_Changed_Cb prefs_it_changed_cb = data;
15 15
16 prefs_it_changed_cb(obj); 16 prefs_it_changed_cb(obj);
17 return EINA_TRUE;
17} 18}
18 19
19static Evas_Object * 20static Evas_Object *
@@ -25,8 +26,8 @@ elm_prefs_check_add(const Elm_Prefs_Item_Iface *iface EINA_UNUSED,
25{ 26{
26 Evas_Object *obj = elm_check_add(prefs); 27 Evas_Object *obj = elm_check_add(prefs);
27 28
28 evas_object_smart_callback_add(obj, "changed", _item_changed_cb, cb); 29 eo_do(obj, eo_event_callback_add
29 30 (ELM_CHECK_EVENT_CHANGED, _item_changed_cb, cb));
30 elm_check_state_set(obj, spec.b.def); 31 elm_check_state_set(obj, spec.b.def);
31 32
32 return obj; 33 return obj;
diff --git a/src/modules/prefs/elm_datetime.c b/src/modules/prefs/elm_datetime.c
index 72c9f791f..3637e9193 100644
--- a/src/modules/prefs/elm_datetime.c
+++ b/src/modules/prefs/elm_datetime.c
@@ -6,14 +6,15 @@ static Elm_Prefs_Item_Type supported_types[] =
6 ELM_PREFS_TYPE_UNKNOWN 6 ELM_PREFS_TYPE_UNKNOWN
7}; 7};
8 8
9static void 9static Eina_Bool
10_item_changed_cb(void *data, 10_item_changed_cb(void *data,
11 Evas_Object *obj, 11 Eo *obj, const Eo_Event_Description *desc EINA_UNUSED,
12 void *event_info EINA_UNUSED) 12 void *event_info EINA_UNUSED)
13{ 13{
14 Elm_Prefs_Item_Changed_Cb prefs_it_changed_cb = data; 14 Elm_Prefs_Item_Changed_Cb prefs_it_changed_cb = data;
15 15
16 prefs_it_changed_cb(obj); 16 prefs_it_changed_cb(obj);
17 return EINA_TRUE;
17} 18}
18 19
19static Evas_Object * 20static Evas_Object *
@@ -32,7 +33,8 @@ elm_prefs_datetime_add(const Elm_Prefs_Item_Iface *iface EINA_UNUSED,
32 elm_datetime_field_visible_set(obj, ELM_DATETIME_MINUTE, EINA_FALSE); 33 elm_datetime_field_visible_set(obj, ELM_DATETIME_MINUTE, EINA_FALSE);
33 elm_datetime_field_visible_set(obj, ELM_DATETIME_AMPM, EINA_FALSE); 34 elm_datetime_field_visible_set(obj, ELM_DATETIME_AMPM, EINA_FALSE);
34 35
35 evas_object_smart_callback_add(obj, "changed", _item_changed_cb, cb); 36 eo_do(obj, eo_event_callback_add
37 (ELM_DATETIME_EVENT_CHANGED, _item_changed_cb, cb));
36 38
37 t.tm_year = spec.d.min.y - 1900; 39 t.tm_year = spec.d.min.y - 1900;
38 t.tm_mon = spec.d.min.m - 1; 40 t.tm_mon = spec.d.min.m - 1;
diff --git a/src/modules/prefs/elm_entry.c b/src/modules/prefs/elm_entry.c
index e6cf68f14..301842d41 100644
--- a/src/modules/prefs/elm_entry.c
+++ b/src/modules/prefs/elm_entry.c
@@ -1,4 +1,5 @@
1#include "private.h" 1#include "private.h"
2#include "elm_widget.h"
2#include <sys/types.h> 3#include <sys/types.h>
3#include <regex.h> 4#include <regex.h>
4 5
@@ -93,14 +94,15 @@ mismatch:
93 return EINA_FALSE; 94 return EINA_FALSE;
94} 95}
95 96
96static void 97static Eina_Bool
97_item_changed_cb(void *data, 98_item_changed_cb(void *data,
98 Evas_Object *obj, 99 Eo *obj, const Eo_Event_Description *desc EINA_UNUSED,
99 void *event_info EINA_UNUSED) 100 void *event_info EINA_UNUSED)
100{ 101{
101 Elm_Prefs_Item_Changed_Cb prefs_it_changed_cb = data; 102 Elm_Prefs_Item_Changed_Cb prefs_it_changed_cb = data;
102 103
103 prefs_it_changed_cb(obj); 104 prefs_it_changed_cb(obj);
105 return EINA_TRUE;
104} 106}
105 107
106static void 108static void
@@ -148,9 +150,10 @@ elm_prefs_entry_add(const Elm_Prefs_Item_Iface *iface EINA_UNUSED,
148 150
149 /* FIXME: is it worth to ERR with the item's name, too, here? */ 151 /* FIXME: is it worth to ERR with the item's name, too, here? */
150 152
151 evas_object_smart_callback_add(obj, "activated", _item_changed_cb, cb); 153 eo_do(obj, eo_event_callback_add
152 evas_object_smart_callback_add(obj, "unfocused", _item_changed_cb, cb); 154 (ELM_ENTRY_EVENT_ACTIVATED, _item_changed_cb, cb));
153 155 eo_do(obj, eo_event_callback_add
156 (ELM_WIDGET_EVENT_UNFOCUSED, _item_changed_cb, cb));
154 if (spec.s.accept) 157 if (spec.s.accept)
155 { 158 {
156 int ret; 159 int ret;
diff --git a/src/modules/prefs/elm_slider.c b/src/modules/prefs/elm_slider.c
index 09515df89..bc6463530 100644
--- a/src/modules/prefs/elm_slider.c
+++ b/src/modules/prefs/elm_slider.c
@@ -7,14 +7,15 @@ static Elm_Prefs_Item_Type supported_types[] =
7 ELM_PREFS_TYPE_UNKNOWN 7 ELM_PREFS_TYPE_UNKNOWN
8}; 8};
9 9
10static void 10static Eina_Bool
11_item_changed_cb(void *data, 11_item_changed_cb(void *data,
12 Evas_Object *obj, 12 Eo *obj, const Eo_Event_Description *desc EINA_UNUSED,
13 void *event_info EINA_UNUSED) 13 void *event_info EINA_UNUSED)
14{ 14{
15 Elm_Prefs_Item_Changed_Cb prefs_it_changed_cb = data; 15 Elm_Prefs_Item_Changed_Cb prefs_it_changed_cb = data;
16 16
17 prefs_it_changed_cb(obj); 17 prefs_it_changed_cb(obj);
18 return EINA_TRUE;
18} 19}
19 20
20static Evas_Object * 21static Evas_Object *
@@ -28,8 +29,8 @@ elm_prefs_slider_add(const Elm_Prefs_Item_Iface *iface EINA_UNUSED,
28 29
29 evas_object_data_set(obj, "prefs_type", (void *)type); 30 evas_object_data_set(obj, "prefs_type", (void *)type);
30 31
31 evas_object_smart_callback_add(obj, "changed", _item_changed_cb, cb); 32 eo_do(obj, eo_event_callback_add
32 33 (ELM_SLIDER_EVENT_CHANGED, _item_changed_cb, cb));
33 if (type == ELM_PREFS_TYPE_INT) 34 if (type == ELM_PREFS_TYPE_INT)
34 { 35 {
35 elm_slider_unit_format_set(obj, "%1.0f"); 36 elm_slider_unit_format_set(obj, "%1.0f");
diff --git a/src/modules/prefs/elm_spinner.c b/src/modules/prefs/elm_spinner.c
index 486dc9812..6617e33c4 100644
--- a/src/modules/prefs/elm_spinner.c
+++ b/src/modules/prefs/elm_spinner.c
@@ -7,14 +7,15 @@ static Elm_Prefs_Item_Type supported_types[] =
7 ELM_PREFS_TYPE_UNKNOWN 7 ELM_PREFS_TYPE_UNKNOWN
8}; 8};
9 9
10static void 10static Eina_Bool
11_item_changed_cb(void *data, 11_item_changed_cb(void *data,
12 Evas_Object *obj, 12 Eo *obj, const Eo_Event_Description *desc EINA_UNUSED,
13 void *event_info EINA_UNUSED) 13 void *event_info EINA_UNUSED)
14{ 14{
15 Elm_Prefs_Item_Changed_Cb prefs_it_changed_cb = data; 15 Elm_Prefs_Item_Changed_Cb prefs_it_changed_cb = data;
16 16
17 prefs_it_changed_cb(obj); 17 prefs_it_changed_cb(obj);
18 return EINA_TRUE;
18} 19}
19 20
20static Evas_Object * 21static Evas_Object *
@@ -28,7 +29,8 @@ elm_prefs_spinner_add(const Elm_Prefs_Item_Iface *iface EINA_UNUSED,
28 29
29 evas_object_data_set(obj, "prefs_type", (void *)type); 30 evas_object_data_set(obj, "prefs_type", (void *)type);
30 31
31 evas_object_smart_callback_add(obj, "changed", _item_changed_cb, cb); 32 eo_do(obj, eo_event_callback_add
33 (ELM_SPINNER_EVENT_CHANGED, _item_changed_cb, cb));
32 34
33 if (type == ELM_PREFS_TYPE_INT) 35 if (type == ELM_PREFS_TYPE_INT)
34 { 36 {