summaryrefslogtreecommitdiff
path: root/src/examples/gengrid_example.c
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2012-03-28 08:42:20 +0000
committerDaniel Juyung Seo <seojuyung2@gmail.com>2012-03-28 08:42:20 +0000
commitf84b3cda618180232412b72ad849a5d23b80dbcd (patch)
treeaeab1f71b33113d0a58cfb2f723f2699445e9408 /src/examples/gengrid_example.c
parentd420f31b9c07d7529117519eda05471a95ea455f (diff)
elm examples: I removed __UNUSED__ and config header inclusion. This code is an example for other developers so we don't need that extra macros. But how can I ignore this warning while building elementary?
SVN revision: 69698
Diffstat (limited to 'src/examples/gengrid_example.c')
-rw-r--r--src/examples/gengrid_example.c93
1 files changed, 44 insertions, 49 deletions
diff --git a/src/examples/gengrid_example.c b/src/examples/gengrid_example.c
index b85378b46..7315d4c89 100644
--- a/src/examples/gengrid_example.c
+++ b/src/examples/gengrid_example.c
@@ -10,12 +10,7 @@
10 */ 10 */
11 11
12#include <Elementary.h> 12#include <Elementary.h>
13#ifdef HAVE_CONFIG_H 13#define PACKAGE_DATA_DIR "../../data"
14# include "elementary_config.h"
15#else
16# define __UNUSED__
17# define PACKAGE_DATA_DIR "../../data"
18#endif
19 14
20typedef struct _Example_Item 15typedef struct _Example_Item
21{ 16{
@@ -39,9 +34,9 @@ static Elm_Gengrid_Item_Class *gic = NULL;
39static Evas_Object *before_bt, *after_bt; 34static Evas_Object *before_bt, *after_bt;
40 35
41static void 36static void
42_on_done(void *data __UNUSED__, 37_on_done(void *data,
43 Evas_Object *obj __UNUSED__, 38 Evas_Object *obj,
44 void *event_info __UNUSED__) 39 void *event_info)
45{ 40{
46 elm_exit(); 41 elm_exit();
47} 42}
@@ -50,7 +45,7 @@ _on_done(void *data __UNUSED__,
50static void 45static void
51_horizontal_grid(void *data, 46_horizontal_grid(void *data,
52 Evas_Object *obj, 47 Evas_Object *obj,
53 void *event_info __UNUSED__) 48 void *event_info)
54{ 49{
55 Evas_Object *grid = data; 50 Evas_Object *grid = data;
56 51
@@ -61,7 +56,7 @@ _horizontal_grid(void *data,
61static void 56static void
62_always_select_change(void *data, 57_always_select_change(void *data,
63 Evas_Object *obj, 58 Evas_Object *obj,
64 void *event_info __UNUSED__) 59 void *event_info)
65{ 60{
66 Evas_Object *grid = data; 61 Evas_Object *grid = data;
67 Eina_Bool always = elm_check_state_get(obj); 62 Eina_Bool always = elm_check_state_get(obj);
@@ -79,7 +74,7 @@ _always_select_change(void *data,
79static void 74static void
80_bouncing_change(void *data, 75_bouncing_change(void *data,
81 Evas_Object *obj, 76 Evas_Object *obj,
82 void *event_info __UNUSED__) 77 void *event_info)
83{ 78{
84 Evas_Object *grid = data; 79 Evas_Object *grid = data;
85 Eina_Bool bounce = elm_check_state_get(obj); 80 Eina_Bool bounce = elm_check_state_get(obj);
@@ -94,7 +89,7 @@ _bouncing_change(void *data,
94static void 89static void
95_multi_change(void *data, 90_multi_change(void *data,
96 Evas_Object *obj, 91 Evas_Object *obj,
97 void *event_info __UNUSED__) 92 void *event_info)
98{ 93{
99 Evas_Object *grid = data; 94 Evas_Object *grid = data;
100 Eina_Bool multi = elm_check_state_get(obj); 95 Eina_Bool multi = elm_check_state_get(obj);
@@ -120,7 +115,7 @@ _multi_change(void *data,
120static void 115static void
121_no_sel_change(void *data, 116_no_sel_change(void *data,
122 Evas_Object *obj, 117 Evas_Object *obj,
123 void *event_info __UNUSED__) 118 void *event_info)
124{ 119{
125 Evas_Object *grid = data; 120 Evas_Object *grid = data;
126 Eina_Bool no_sel = elm_check_state_get(obj); 121 Eina_Bool no_sel = elm_check_state_get(obj);
@@ -137,7 +132,7 @@ _no_sel_change(void *data,
137/* item selection callback */ 132/* item selection callback */
138static void 133static void
139_grid_sel(void *data, 134_grid_sel(void *data,
140 Evas_Object *obj __UNUSED__, 135 Evas_Object *obj,
141 void *event_info) 136 void *event_info)
142{ 137{
143 unsigned int x, y; 138 unsigned int x, y;
@@ -164,8 +159,8 @@ _item_new(void)
164/* "insert before" callback */ 159/* "insert before" callback */
165static void 160static void
166_before_bt_clicked(void *data, 161_before_bt_clicked(void *data,
167 Evas_Object *obj __UNUSED__, 162 Evas_Object *obj,
168 void *event_info __UNUSED__) 163 void *event_info)
169{ 164{
170 Example_Item *it; 165 Example_Item *it;
171 Evas_Object *grid = data; 166 Evas_Object *grid = data;
@@ -182,8 +177,8 @@ _before_bt_clicked(void *data,
182/* "insert after" callback */ 177/* "insert after" callback */
183static void 178static void
184_after_bt_clicked(void *data, 179_after_bt_clicked(void *data,
185 Evas_Object *obj __UNUSED__, 180 Evas_Object *obj,
186 void *event_info __UNUSED__) 181 void *event_info)
187{ 182{
188 Example_Item *it; 183 Example_Item *it;
189 Evas_Object *grid = data; 184 Evas_Object *grid = data;
@@ -200,8 +195,8 @@ _after_bt_clicked(void *data,
200/* prepend an item */ 195/* prepend an item */
201static void 196static void
202_prepend_bt_clicked(void *data, 197_prepend_bt_clicked(void *data,
203 Evas_Object *obj __UNUSED__, 198 Evas_Object *obj,
204 void *event_info __UNUSED__) 199 void *event_info)
205{ 200{
206 Example_Item *it; 201 Example_Item *it;
207 Evas_Object *grid = data; 202 Evas_Object *grid = data;
@@ -213,8 +208,8 @@ _prepend_bt_clicked(void *data,
213/* append an item */ 208/* append an item */
214static void 209static void
215_append_bt_clicked(void *data, 210_append_bt_clicked(void *data,
216 Evas_Object *obj __UNUSED__, 211 Evas_Object *obj,
217 void *event_info __UNUSED__) 212 void *event_info)
218{ 213{
219 Evas_Object *grid = data; 214 Evas_Object *grid = data;
220 Example_Item *it = _item_new(); 215 Example_Item *it = _item_new();
@@ -225,8 +220,8 @@ _append_bt_clicked(void *data,
225/* delete items */ 220/* delete items */
226static void 221static void
227_clear_cb(void *data, 222_clear_cb(void *data,
228 Evas_Object *obj __UNUSED__, 223 Evas_Object *obj,
229 void *event_info __UNUSED__) 224 void *event_info)
230{ 225{
231 elm_gengrid_clear(data); 226 elm_gengrid_clear(data);
232 227
@@ -236,8 +231,8 @@ _clear_cb(void *data,
236/* bring in 1st item */ 231/* bring in 1st item */
237static void 232static void
238_bring_1st_clicked(void *data, 233_bring_1st_clicked(void *data,
239 Evas_Object *obj __UNUSED__, 234 Evas_Object *obj,
240 void *event_info __UNUSED__) 235 void *event_info)
241{ 236{
242 Elm_Object_Item *gg_it = elm_gengrid_first_item_get(data); 237 Elm_Object_Item *gg_it = elm_gengrid_first_item_get(data);
243 238
@@ -249,8 +244,8 @@ _bring_1st_clicked(void *data,
249/* show last item */ 244/* show last item */
250static void 245static void
251_show_last_clicked(void *data, 246_show_last_clicked(void *data,
252 Evas_Object *obj __UNUSED__, 247 Evas_Object *obj,
253 void *event_info __UNUSED__) 248 void *event_info)
254{ 249{
255 Elm_Object_Item *gg_it = elm_gengrid_last_item_get(data); 250 Elm_Object_Item *gg_it = elm_gengrid_last_item_get(data);
256 251
@@ -262,8 +257,8 @@ _show_last_clicked(void *data,
262/* disable selected item */ 257/* disable selected item */
263static void 258static void
264_toggle_disabled_cb(void *data, 259_toggle_disabled_cb(void *data,
265 Evas_Object *obj __UNUSED__, 260 Evas_Object *obj,
266 void *event_info __UNUSED__) 261 void *event_info)
267{ 262{
268 Elm_Object_Item *gg_it = elm_gengrid_selected_item_get(data); 263 Elm_Object_Item *gg_it = elm_gengrid_selected_item_get(data);
269 264
@@ -277,7 +272,7 @@ _toggle_disabled_cb(void *data,
277static void 272static void
278_size_changed(void *data, 273_size_changed(void *data,
279 Evas_Object *obj, 274 Evas_Object *obj,
280 void *event_info __UNUSED__) 275 void *event_info)
281{ 276{
282 Evas_Object *grid = data; 277 Evas_Object *grid = data;
283 int size = elm_spinner_value_get(obj); 278 int size = elm_spinner_value_get(obj);
@@ -287,8 +282,8 @@ _size_changed(void *data,
287 282
288/* item double click callback */ 283/* item double click callback */
289static void 284static void
290_double_click(void *data __UNUSED__, 285_double_click(void *data,
291 Evas_Object *obj __UNUSED__, 286 Evas_Object *obj,
292 void *event_info) 287 void *event_info)
293{ 288{
294 fprintf(stdout, "Double click on item with handle %p\n", event_info); 289 fprintf(stdout, "Double click on item with handle %p\n", event_info);
@@ -296,8 +291,8 @@ _double_click(void *data __UNUSED__,
296 291
297/* item long press callback */ 292/* item long press callback */
298static void 293static void
299_long_pressed(void *data __UNUSED__, 294_long_pressed(void *data,
300 Evas_Object *obj __UNUSED__, 295 Evas_Object *obj,
301 void *event_info) 296 void *event_info)
302{ 297{
303 fprintf(stdout, "Long press on item with handle %p\n", event_info); 298 fprintf(stdout, "Long press on item with handle %p\n", event_info);
@@ -307,8 +302,8 @@ _long_pressed(void *data __UNUSED__,
307/* label fetching callback */ 302/* label fetching callback */
308static char * 303static char *
309_grid_label_get(void *data, 304_grid_label_get(void *data,
310 Evas_Object *obj __UNUSED__, 305 Evas_Object *obj,
311 const char *part __UNUSED__) 306 const char *part)
312{ 307{
313 const Example_Item *it = data; 308 const Example_Item *it = data;
314 char buf[256]; 309 char buf[256];
@@ -353,9 +348,9 @@ _grid_content_get(void *data,
353 348
354/* state fetching callback */ 349/* state fetching callback */
355static Eina_Bool 350static Eina_Bool
356_grid_state_get(void *data __UNUSED__, 351_grid_state_get(void *data,
357 Evas_Object *obj __UNUSED__, 352 Evas_Object *obj,
358 const char *part __UNUSED__) 353 const char *part)
359{ 354{
360 return EINA_FALSE; 355 return EINA_FALSE;
361} 356}
@@ -363,7 +358,7 @@ _grid_state_get(void *data __UNUSED__,
363/* deletion callback */ 358/* deletion callback */
364static void 359static void
365_grid_del(void *data, 360_grid_del(void *data,
366 Evas_Object *obj __UNUSED__) 361 Evas_Object *obj)
367{ 362{
368 Example_Item *it = data; 363 Example_Item *it = data;
369 364
@@ -373,9 +368,9 @@ _grid_del(void *data,
373 368
374/* scrolling animation stopped callback */ 369/* scrolling animation stopped callback */
375static void 370static void
376_grid_scroll_stopped_cb(void *data __UNUSED__, 371_grid_scroll_stopped_cb(void *data,
377 Evas_Object *obj, 372 Evas_Object *obj,
378 void *event_info __UNUSED__) 373 void *event_info)
379{ 374{
380 int h_pagenumber = 0, v_pagenumber = 0; 375 int h_pagenumber = 0, v_pagenumber = 0;
381 elm_gengrid_current_page_get(obj, &h_pagenumber, &v_pagenumber); 376 elm_gengrid_current_page_get(obj, &h_pagenumber, &v_pagenumber);
@@ -387,7 +382,7 @@ _grid_scroll_stopped_cb(void *data __UNUSED__,
387static void 382static void
388_h_align_change_cb(void *data, 383_h_align_change_cb(void *data,
389 Evas_Object *obj, 384 Evas_Object *obj,
390 void *event_info __UNUSED__) 385 void *event_info)
391{ 386{
392 double v_align; 387 double v_align;
393 double val = elm_slider_value_get(obj); 388 double val = elm_slider_value_get(obj);
@@ -401,7 +396,7 @@ _h_align_change_cb(void *data,
401static void 396static void
402_v_align_change_cb(void *data, 397_v_align_change_cb(void *data,
403 Evas_Object *obj, 398 Evas_Object *obj,
404 void *event_info __UNUSED__) 399 void *event_info)
405{ 400{
406 double h_align; 401 double h_align;
407 double val = elm_slider_value_get(obj); 402 double val = elm_slider_value_get(obj);
@@ -416,7 +411,7 @@ _v_align_change_cb(void *data,
416static void 411static void
417_page_change_cb(void *data, 412_page_change_cb(void *data,
418 Evas_Object *obj, 413 Evas_Object *obj,
419 void *event_info __UNUSED__) 414 void *event_info)
420{ 415{
421 double val = elm_slider_value_get(obj); 416 double val = elm_slider_value_get(obj);
422 417
@@ -426,8 +421,8 @@ _page_change_cb(void *data,
426} 421}
427 422
428EAPI_MAIN int 423EAPI_MAIN int
429elm_main(int argc __UNUSED__, 424elm_main(int argc,
430 char **argv __UNUSED__) 425 char **argv)
431{ 426{
432 Evas_Object *win, *bg, *grid, *bx, *hbx_1, *hbx_2, *hbx_3, *bt, *ck, *sl, 427 Evas_Object *win, *bg, *grid, *bx, *hbx_1, *hbx_2, *hbx_3, *bt, *ck, *sl,
433 *sp; 428 *sp;