summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael BOUCHAUD <michael.bouchaud@gmail.com>2012-04-19 21:48:44 +0000
committerMichael BOUCHAUD <michael.bouchaud@gmail.com>2012-04-19 21:48:44 +0000
commit74cf4448189cf3e954c59cfe65301bf207650dff (patch)
treecfccdc75bf4d2874ad520f28d1aea8fa47db8c39 /src
parentcfdf6974b7790bcd1d6c7d9e86a93fcc953849f6 (diff)
elementary: remove unused file (datepicker)
SVN revision: 70340
Diffstat (limited to 'src')
-rw-r--r--src/edje_externals/elm_datepicker.c188
1 files changed, 0 insertions, 188 deletions
diff --git a/src/edje_externals/elm_datepicker.c b/src/edje_externals/elm_datepicker.c
deleted file mode 100644
index e96beaa43..000000000
--- a/src/edje_externals/elm_datepicker.c
+++ /dev/null
@@ -1,188 +0,0 @@
1#include "private.h"
2
3typedef struct _Elm_Params_Datepicker
4{
5 const char *format;
6 int year;
7 int mon;
8 int day;
9 Eina_Bool year_exists:1;
10 Eina_Bool mon_exists:1;
11 Eina_Bool day_exists:1;
12} Elm_Params_Datepicker;
13
14static void
15external_datepicker_state_set(void *data __UNUSED__, Evas_Object *obj, const void *from_params, const void *to_params, float pos __UNUSED__)
16{
17 const Elm_Params_Datepicker *p;
18
19 if (to_params) p = to_params;
20 else if (from_params) p = from_params;
21 else return;
22
23 if (p->format) elm_datepicker_date_format_set(obj, p->format);
24 if ((p->year_exists) || (p->mon_exists) || (p->day_exists))
25 {
26 int year, mon, day;
27 elm_datepicker_date_get(obj, &year, &mon, &day);
28
29 if (p->year_exists) year = p->year;
30 if (p->mon_exists) mon = p->mon;
31 if (p->day_exists) day = p->day;
32 elm_datepicker_date_set(obj, year, mon, day);
33 }
34}
35
36static Eina_Bool
37external_datepicker_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_External_Param *param)
38{
39 if (!strcmp(param->name, "format"))
40 {
41 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
42 {
43 elm_datepicker_date_format_set(obj, param->s);
44 return EINA_TRUE;
45 }
46 }
47 else if (!strcmp(param->name, "years"))
48 {
49 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
50 {
51 int mon, day;
52 elm_datepicker_date_get(obj, NULL, &mon, &day);
53 elm_datepicker_date_set(obj, param->i, mon, day);
54 return EINA_TRUE;
55 }
56 }
57 else if (!strcmp(param->name, "months"))
58 {
59 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
60 {
61 int year, day;
62 elm_datepicker_date_get(obj, &year, NULL, &day);
63 elm_datepicker_date_set(obj, year, param->i, day);
64 return EINA_TRUE;
65 }
66 }
67 else if (!strcmp(param->name, "days"))
68 {
69 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
70 {
71 int year, mon;
72 elm_datepicker_date_get(obj, &year, &mon, NULL);
73 elm_datepicker_date_set(obj, year, mon, param->i);
74 return EINA_TRUE;
75 }
76 }
77
78 ERR("unknown parameter '%s' of type '%s'",
79 param->name, edje_external_param_type_str(param->type));
80
81 return EINA_FALSE;
82}
83
84static Eina_Bool
85external_datepicker_param_get(void *data __UNUSED__, const Evas_Object *obj, Edje_External_Param *param)
86{
87 if (!strcmp(param->name, "format"))
88 {
89 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
90 {
91 param->s = elm_datepicker_date_format_get(obj);
92 return EINA_TRUE;
93 }
94 }
95 else if (!strcmp(param->name, "years"))
96 {
97 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
98 {
99 elm_datepicker_date_get(obj, &(param->i), NULL, NULL);
100 return EINA_TRUE;
101 }
102 }
103 else if (!strcmp(param->name, "months"))
104 {
105 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
106 {
107 elm_datepicker_date_get(obj, NULL, &(param->i), NULL);
108 return EINA_TRUE;
109 }
110 }
111 else if (!strcmp(param->name, "days"))
112 {
113 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
114 {
115 elm_datepicker_date_get(obj, NULL, NULL, &(param->i));
116 return EINA_TRUE;
117 }
118 }
119
120 ERR("unknown parameter '%s' of type '%s'",
121 param->name, edje_external_param_type_str(param->type));
122
123 return EINA_FALSE;
124}
125
126static void *
127external_datepicker_params_parse(void *data, Evas_Object *obj, const Eina_List *params)
128{
129 Elm_Params_Datepicker *mem;
130 Edje_External_Param *param;
131 const Eina_List *l;
132
133 mem = calloc(1, sizeof(Elm_Params_Datepicker));
134 if (!mem)
135 return NULL;
136
137 EINA_LIST_FOREACH(params, l, param)
138 {
139 if (!strcmp(param->name, "format"))
140 mem->format = eina_stringshare_add(param->s);
141 else if (!strcmp(param->name, "years"))
142 {
143 mem->year = param->i;
144 mem->year_exists = EINA_TRUE;
145 }
146 else if (!strcmp(param->name, "months"))
147 {
148 mem->mon = param->i;
149 mem->mon_exists = EINA_TRUE;
150 }
151 else if (!strcmp(param->name, "days"))
152 {
153 mem->day = param->i;
154 mem->day_exists = EINA_TRUE;
155 }
156 }
157
158 return mem;
159}
160
161static Evas_Object *external_datepicker_content_get(void *data __UNUSED__,
162 const Evas_Object *obj, const char *content)
163{
164 ERR("so content");
165 return NULL;
166}
167
168static void
169external_datepicker_params_free(void *params)
170{
171 Elm_Params_Datepicker *mem = params;
172
173 if (mem->format)
174 eina_stringshare_del(mem->format);
175
176 free(mem);
177}
178
179static Edje_External_Param_Info external_datepicker_params[] = {
180 EDJE_EXTERNAL_PARAM_INFO_STRING("format"),
181 EDJE_EXTERNAL_PARAM_INFO_INT_DEFAULT("years", 1900),
182 EDJE_EXTERNAL_PARAM_INFO_INT_DEFAULT("months", 1),
183 EDJE_EXTERNAL_PARAM_INFO_INT_DEFAULT("days", 1),
184 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
185};
186
187DEFINE_EXTERNAL_ICON_ADD(datepicker, "datepicker");
188DEFINE_EXTERNAL_TYPE_SIMPLE(datepicker, "Datepicker");