(Circle) System Settings / src /

view.c

  1. /*
  2. * Copyright (c) 2015 Samsung Electronics Co., Ltd
  3. *
  4. * Licensed under the Flora License, Version 1.1 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://floralicense.org/license/
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16.  
  17. #include <tizen.h>
  18. #include <dlog.h>
  19. #include <efl_extension.h>
  20. #include <Elementary.h>
  21. #include <app.h>
  22.  
  23. #include "$(appName).h"
  24. #include "view.h"
  25. #include "data.h"
  26.  
  27. static struct view_info {
  28. Evas_Object *win;
  29. Evas_Object *conform;
  30. Evas_Object *layout;
  31. Evas_Object *nf;
  32. Evas_Object *genlist;
  33. Eext_Circle_Surface *circle_surface;
  34. } s_info = {
  35. .win = NULL,
  36. .conform = NULL,
  37. .layout = NULL,
  38. .nf = NULL,
  39. .genlist = NULL,
  40. .circle_surface = NULL,
  41. };
  42.  
  43. static Elm_Genlist_Item_Class *_set_genlist_item_class(const char *style);
  44. static void _win_delete_request_cb(void *data, Evas_Object *obj, void *event_info);
  45. static void _gl_selected_cb(void *data, Evas_Object *obj, void *event_info);
  46.  
  47. /*
  48. * Static functions related Setting menu
  49. */
  50. static Evas_Object* _get_menu_icon(void *data, Evas_Object *obj, const char *part);
  51. static Evas_Object *_add_icon(Evas_Object *parent, char *icon_path);
  52.  
  53. /*
  54. * Static functions related Display menu
  55. */
  56. static Evas_Object* _get_display_icon(void *data, Evas_Object *obj, const char *part);
  57. static void _icon_clicked_cb(void *data, Evas_Object *obj, void *event_info);
  58.  
  59.  
  60. /*
  61. * @brief: Get naviframe
  62. */
  63. Evas_Object *view_get_naviframe(void)
  64. {
  65. return s_info.nf;
  66. }
  67.  
  68. /*
  69. * @brief: Get genlist
  70. */
  71. Evas_Object *view_get_genlist(void)
  72. {
  73. return s_info.genlist;
  74. }
  75.  
  76. /*
  77. * @brief: Set genlist
  78. * @param[genlist]: Genlist will be stored in view_info
  79. */
  80. void view_set_genlist(Evas_Object *genlist)
  81. {
  82. s_info.genlist = genlist;
  83. }
  84.  
  85. /*
  86. * @brief: Create Essential Object window, conformant and layout
  87. */
  88. void view_create(void)
  89. {
  90. /* Create window */
  91. s_info.win = view_create_win(PACKAGE);
  92. if (s_info.win == NULL) {
  93. dlog_print(DLOG_ERROR, LOG_TAG, "failed to create a window.");
  94. return;
  95. }
  96.  
  97. /* Create conformant */
  98. s_info.conform = view_create_conformant_without_indicator(s_info.win);
  99. if (s_info.conform == NULL) {
  100. dlog_print(DLOG_ERROR, LOG_TAG, "failed to create a conformant");
  101. evas_object_del(s_info.win);
  102. return;
  103. }
  104.  
  105. /*
  106. * Eext Circle Surface Creation
  107. */
  108. s_info.circle_surface = eext_circle_surface_conformant_add(s_info.conform);
  109.  
  110. s_info.layout = view_create_layout_for_conformant(s_info.conform, NULL, NULL, NULL, NULL);
  111.  
  112. s_info.nf = view_create_naviframe(s_info.layout);
  113. if (s_info.nf == NULL) {
  114. dlog_print(DLOG_ERROR, LOG_TAG, "failed to create a naviframe.");
  115. evas_object_del(s_info.win);
  116. return;
  117. }
  118.  
  119. /* Show window after main view is set up */
  120. evas_object_show(s_info.win);
  121. }
  122.  
  123. /*
  124. * @brief: Make a basic window named package name.
  125. * @param[pkg_name]: Name of the window
  126. */
  127. Evas_Object *view_create_win(const char *pkg_name)
  128. {
  129. Evas_Object *win = NULL;
  130.  
  131. /*
  132. * Window
  133. * Create and initialize elm_win.
  134. * elm_win is mandatory to manipulate window.
  135. */
  136.  
  137. win = elm_win_util_standard_add(pkg_name, pkg_name);
  138. elm_win_conformant_set(win, EINA_TRUE);
  139. elm_win_autodel_set(win, EINA_TRUE);
  140.  
  141. if (elm_win_wm_rotation_supported_get(win)) {
  142. int rots[4] = { 0, 90, 180, 270 };
  143. elm_win_wm_rotation_available_rotations_set(win, (const int *)(&rots), 4);
  144. }
  145.  
  146. evas_object_smart_callback_add(win, "delete,request", _win_delete_request_cb, NULL);
  147.  
  148. return win;
  149. }
  150.  
  151. /*
  152. * @brief: Make conformant without indicator for wearable app.
  153. * @param[win]: Window to which you want to set this conformant
  154. */
  155. Evas_Object *view_create_conformant_without_indicator(Evas_Object *win)
  156. {
  157. Evas_Object *conform = NULL;
  158.  
  159. /* Conformant
  160. * Create and initialize elm_conformant.
  161. * elm_conformant is mandatory for base GUI to have proper size
  162. * when indicator or virtual keypad is visible.
  163. */
  164.  
  165. if (win == NULL) {
  166. dlog_print(DLOG_ERROR, LOG_TAG, "window is NULL.");
  167. return NULL;
  168. }
  169.  
  170. conform = elm_conformant_add(win);
  171. evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
  172. elm_win_resize_object_add(win, conform);
  173. evas_object_show(conform);
  174.  
  175. return conform;
  176. }
  177.  
  178. /*
  179. * @brief: Make a layout to target parent object with edje file
  180. * @param[parent]: The object to which you want to add this layout
  181. * @param[file_path]: File path of EDJ file will be used
  182. * @param[group_name]: Name of group in EDJ you want to set to
  183. * @param[cb_function]: The function will be called when back event is detected
  184. * @param[user_data]: The user data to be passed to the callback functions
  185. */
  186. Evas_Object *view_create_layout(Evas_Object *parent, const char *file_path, const char *group_name, Eext_Event_Cb cb_function, void *user_data)
  187. {
  188. Evas_Object *layout = NULL;
  189.  
  190. if (parent == NULL) {
  191. dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
  192. return NULL;
  193. }
  194.  
  195. layout = elm_layout_add(parent);
  196. elm_layout_file_set(layout, file_path, group_name);
  197.  
  198. evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
  199.  
  200. if (cb_function)
  201. eext_object_event_callback_add(layout, EEXT_CALLBACK_BACK, cb_function, user_data);
  202.  
  203. evas_object_show(layout);
  204.  
  205. return layout;
  206. }
  207.  
  208. /*
  209. * @brief: Make a layout with theme.
  210. * @param[parent]: Object to which you want to add this layout
  211. * @param[classname]: The class of the group
  212. * @param[group]: Group name in EDJ you want to set to layout
  213. * @param[style]: The style to use
  214. */
  215. Evas_Object *view_create_layout_by_theme(Evas_Object *parent, const char *classname, const char *group, const char *style)
  216. {
  217. Evas_Object *layout = NULL;
  218.  
  219. /*
  220. * Layout
  221. * Create and initialize elm_layout.
  222. * view_create_layout_by_theme() is used to create layout by using pre-made edje file.
  223. */
  224.  
  225. if (parent == NULL) {
  226. dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
  227. return NULL;
  228. }
  229.  
  230. layout = elm_layout_add(parent);
  231. elm_layout_theme_set(layout, classname, group, style);
  232. evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
  233.  
  234. evas_object_show(layout);
  235.  
  236. return layout;
  237. }
  238.  
  239. /*
  240. * @brief: Make and set a layout to conformant
  241. * @param[parent]: Target conformant object
  242. * @param[file_name]: File path of EDJ used
  243. * @param[group_name]: Group name in EDJ you want to set to layout
  244. * @param[cb_function]: Callback for back event handling
  245. * @param[user_data]: The user data to be passed to the callback functions
  246. */
  247. Evas_Object *view_create_layout_for_conformant(Evas_Object *parent, const char *file_name, const char *group_name, Eext_Event_Cb cb_function, void *user_data)
  248. {
  249. Evas_Object *layout = NULL;
  250.  
  251. if (parent == NULL) {
  252. dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
  253. return NULL;
  254. }
  255.  
  256. if (file_name == NULL) {
  257. layout = view_create_layout_by_theme(parent, "layout", "application", "default");
  258. } else {
  259. layout = view_create_layout(parent, file_name, group_name, cb_function, user_data);
  260. }
  261.  
  262. if (layout == NULL) {
  263. dlog_print(DLOG_ERROR, LOG_TAG, "layout is NULL.");
  264. return NULL;
  265. }
  266.  
  267. elm_object_content_set(parent, layout);
  268.  
  269. return layout;
  270. }
  271.  
  272. /*
  273. * @brief: Destroy window and free important data to finish this application
  274. */
  275. void view_destroy(void)
  276. {
  277. if (s_info.win == NULL) {
  278. dlog_print(DLOG_ERROR, LOG_TAG, "window is NULL.");
  279. return;
  280. }
  281.  
  282. evas_object_del(s_info.win);
  283. }
  284.  
  285. /*
  286. * @brief: Set image to given part
  287. * @param[parent]: Object has part to which you want to set this image
  288. * @param[part_name]: Part name to which you want to set this image
  289. * @param[image_path]: Path of the image file
  290. */
  291. void view_set_image(Evas_Object *parent, const char *part_name, const char *image_path)
  292. {
  293. Evas_Object *image = NULL;
  294.  
  295. if (parent == NULL) {
  296. dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
  297. return;
  298. }
  299.  
  300. image = elm_object_part_content_get(parent, part_name);
  301. if (image == NULL) {
  302. image = elm_image_add(parent);
  303. if (image == NULL) {
  304. dlog_print(DLOG_ERROR, LOG_TAG, "failed to create an image object.");
  305. return;
  306. }
  307.  
  308. elm_object_part_content_set(parent, part_name, image);
  309. }
  310.  
  311. if (EINA_FALSE == elm_image_file_set(image, image_path, NULL)) {
  312. dlog_print(DLOG_ERROR, LOG_TAG, "failed to set image.");
  313. return;
  314. }
  315.  
  316. evas_object_show(image);
  317.  
  318. return;
  319. }
  320.  
  321. /*
  322. * @brief: Set color of the part
  323. * @param[parent]: Object has part to which you want to set color
  324. * @param[part_name]: Name of part to which you want to set color
  325. * @param[r]: R of RGBA you want to set to the part
  326. * @param[g]: G of RGBA you want to set to the part
  327. * @param[b]: B of RGBA you want to set to the part
  328. * @param[a]: A of RGBA you want to set to the part
  329. */
  330. void view_set_color(Evas_Object *parent, const char *part_name, int r, int g, int b, int a)
  331. {
  332. Evas_Object *obj = NULL;
  333.  
  334. if (parent == NULL) {
  335. dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
  336. return;
  337. }
  338.  
  339. obj = elm_object_part_content_get(parent, part_name);
  340. if (obj == NULL) {
  341. dlog_print(DLOG_ERROR, LOG_TAG, "failed to get parent.");
  342. return;
  343. }
  344.  
  345. /* Set color of target part object */
  346. evas_object_color_set(obj, r, g, b, a);
  347. }
  348.  
  349. /*
  350. * @brief: Make a naviframe and set to parent
  351. * @param[parent]: Object to which you want to set naviframe
  352. */
  353. Evas_Object *view_create_naviframe(Evas_Object *parent)
  354. {
  355. Evas_Object *nf = NULL;
  356.  
  357. if (parent == NULL) {
  358. dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
  359. return NULL;
  360. }
  361.  
  362. nf = elm_naviframe_add(parent);
  363.  
  364. elm_object_part_content_set(parent, "elm.swallow.content", nf);
  365. eext_object_event_callback_add(nf, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, NULL);
  366. eext_object_event_callback_add(nf, EEXT_CALLBACK_MORE, eext_naviframe_more_cb, NULL);
  367.  
  368. evas_object_show(nf);
  369.  
  370. return nf;
  371. }
  372.  
  373. /*
  374. * @brief: Push item to naviframe
  375. * @param[nf]: Naviframe that item will be added to
  376. * @param[item]: Object will be added to naviframe
  377. * @param[_pop_cb]: Function will be operated when this item is popped from naviframe
  378. * @param[cb_data]: Data needed to operate '_pop_cb' function
  379. */
  380. Elm_Object_Item *view_push_item_to_naviframe(Evas_Object *nf, Evas_Object *item, Elm_Naviframe_Item_Pop_Cb _pop_cb, void *cb_data)
  381. {
  382. Elm_Object_Item* nf_it = NULL;
  383.  
  384. if (nf == NULL) {
  385. dlog_print(DLOG_ERROR, LOG_TAG, "naviframe is NULL.");
  386. return NULL;
  387. }
  388.  
  389. if (item == NULL) {
  390. dlog_print(DLOG_ERROR, LOG_TAG, "item is NULL.");
  391. return NULL;
  392. }
  393.  
  394. /*
  395. * Sixth parameter
  396. * @param[item_style] item style name. "empty" style has no button like prev_button and next_button.
  397. */
  398. nf_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, item, "empty");
  399. elm_naviframe_item_pop_cb_set(nf_it, _pop_cb, cb_data);
  400.  
  401. return nf_it;
  402. }
  403.  
  404. /*
  405. * @brief: Make genlist for circular shape.
  406. * @param[parent]: Object to which you want to set genlist
  407. */
  408. Evas_Object *view_create_circle_genlist(Evas_Object *parent)
  409. {
  410. Evas_Object *genlist = NULL;
  411. Evas_Object *circle_genlist = NULL;
  412.  
  413. if (parent == NULL) {
  414. dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
  415. return NULL;
  416. }
  417.  
  418. if (s_info.circle_surface == NULL) {
  419. dlog_print(DLOG_ERROR, LOG_TAG, "circle surface is NULL.");
  420. return NULL;
  421. }
  422.  
  423. genlist = elm_genlist_add(parent);
  424. /*
  425. * This make selected list item is shown compressed.
  426. */
  427. elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
  428. evas_object_smart_callback_add(genlist, "selected", _gl_selected_cb, NULL);
  429.  
  430. /*
  431. * This make genlist style circular.
  432. */
  433. circle_genlist = eext_circle_object_genlist_add(genlist, s_info.circle_surface);
  434. eext_circle_object_genlist_scroller_policy_set(circle_genlist, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
  435. eext_rotary_object_event_activated_set(circle_genlist, EINA_TRUE);
  436.  
  437. evas_object_show(genlist);
  438.  
  439. return genlist;
  440. }
  441.  
  442. /*
  443. * @brief: Add item to genlist.
  444. * @param[genlist]: Genlist that item will be added to
  445. * @param[style]: Style of item determine how to show this item, such as "1text", "1text1icon" and so on
  446. * @param[data]: Item data that use item's callback function
  447. * @param[_clicked_cb]: Function will be operated when the item is clicked
  448. * @param[cb_data]: Data needed in '_clicked_cb' function
  449. */
  450. Elm_Object_Item *view_append_item_to_genlist(Evas_Object *genlist, const char *style,
  451. const void *data, Evas_Smart_Cb _clicked_cb, const void *cb_data)
  452. {
  453. Elm_Genlist_Item_Class *item_class;
  454. Elm_Object_Item *item;
  455.  
  456. if (genlist == NULL) {
  457. dlog_print(DLOG_ERROR, LOG_TAG, "genlist is NULL.");
  458. return NULL;
  459. }
  460.  
  461. if (style == NULL) {
  462. dlog_print(DLOG_ERROR, LOG_TAG, "item style is NULL.");
  463. return NULL;
  464. }
  465.  
  466. item_class = _set_genlist_item_class(style);
  467.  
  468. item = elm_genlist_item_append(genlist, item_class, data, NULL, ELM_GENLIST_ITEM_NONE, _clicked_cb, cb_data);
  469.  
  470. elm_genlist_item_class_free(item_class);
  471.  
  472. return item;
  473. }
  474.  
  475. /*
  476. * @brief: Create check box
  477. * @param[parent]: Object to which you want to add check
  478. * @param[event]: Event's name
  479. * @param[cb_func]: Callback function
  480. * @param[data]: Data needed in this function
  481. */
  482. Evas_Object *view_create_checkbox(Evas_Object *parent, const char *event, Evas_Smart_Cb cb_func, void *data)
  483. {
  484. Evas_Object *check;
  485.  
  486. if (parent == NULL) {
  487. dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
  488. return NULL;
  489. }
  490.  
  491. check = elm_check_add(parent);
  492.  
  493. evas_object_smart_callback_add(check, event, cb_func, data);
  494. evas_object_show(check);
  495.  
  496. return check;
  497. }
  498.  
  499. /*
  500. * @note
  501. * Below functions are static functions.
  502. */
  503.  
  504. /*
  505. * @brief: Set functions will be operated when this item is shown on the screen according to the style.
  506. * @param[style]: Style of item.
  507. */
  508. static Elm_Genlist_Item_Class *_set_genlist_item_class(const char *style)
  509. {
  510. Elm_Genlist_Item_Class *item_class = NULL;
  511.  
  512. if (style == NULL) {
  513. dlog_print(DLOG_ERROR, LOG_TAG, "style is NULL.");
  514. return NULL;
  515. }
  516.  
  517. item_class = elm_genlist_item_class_new();
  518.  
  519. /*
  520. * If you want to add the item class of genlist, you should be add below.
  521. * To see more genlist's styles click on the link below.
  522. * https://developer.tizen.org/development/ui-practices/native-application/efl/ui-components/wearable-ui-components
  523. */
  524. if (!strcmp(style, "menu.title")) {
  525. /*
  526. * This function will be operated when this item is shown on the screen to get the title.
  527. */
  528. item_class->item_style = "title";
  529. item_class->func.text_get = data_get_menu_title_text;
  530. } else if (!strcmp(style, "display.title")) {
  531. item_class->item_style = "title";
  532. item_class->func.text_get = data_get_display_title_text;
  533. } else if (!strcmp(style, "1text")) {
  534. item_class->item_style = "1text";
  535. item_class->func.text_get = data_get_display_text;
  536. } else if (!strcmp(style, "1text.1icon")) {
  537. item_class->item_style = "1text.1icon";
  538. item_class->func.text_get = data_get_menu_text;
  539. item_class->func.content_get = _get_menu_icon;
  540. } else if (!strcmp(style, "1text.1icon.1")) {
  541. item_class->item_style = "1text.1icon.1";
  542. item_class->func.text_get = data_get_display_text;
  543. item_class->func.content_get = _get_display_icon;
  544. } else if (!strcmp(style, "2text")) {
  545. item_class->item_style = "2text";
  546. item_class->func.text_get = data_get_display_text;
  547. } else if (!strcmp(style, "padding")) {
  548. /*
  549. * "padding" style does nothing.
  550. * But it makes genlist's item placed in the middle of the screen.
  551. */
  552. }
  553.  
  554. return item_class;
  555. }
  556.  
  557. /*
  558. * @brief: Function will be operated when window is deleted.
  559. * @param[data]: Data needed in this function
  560. * @param[obj]: Smart object
  561. * @param[event_info]: Information of event
  562. */
  563. static void _win_delete_request_cb(void *data, Evas_Object *obj, void *event_info)
  564. {
  565. ui_app_exit();
  566. }
  567.  
  568. /*
  569. * @brief: Function will be operated when genlist's item is selected.
  570. * @param[data]: Data needed in this function
  571. * @param[obj]: Genlist
  572. * @param[event_info]: Selected item
  573. */
  574. static void _gl_selected_cb(void *data, Evas_Object *obj, void *event_info)
  575. {
  576. Elm_Object_Item *it = (Elm_Object_Item *)event_info;
  577.  
  578. elm_genlist_item_selected_set(it, EINA_FALSE);
  579. }
  580.  
  581. /*
  582. * @brief: Function will be operated when the item is shown to genlist.
  583. * @param[data]: Data passed from 'elm_genlist_item_append' as third parameter
  584. * @param[obj]: Genlist
  585. * @param[part]: Name string of one of the existing text parts in the EDJ group implementing the item's theme
  586. */
  587. static Evas_Object* _get_menu_icon(void *data, Evas_Object *obj, const char *part)
  588. {
  589. int index = (int)data;
  590. Evas_Object *icon_layout = NULL;
  591. char *icon_name = NULL;
  592. char icon_path[BUF_LEN] = {0, };
  593.  
  594. if (strcmp(part, "elm.icon")) return NULL;
  595.  
  596. icon_name = data_get_icon_name(index);
  597. data_get_resource_path(icon_name, icon_path, sizeof(icon_path));
  598. icon_layout = _add_icon(obj, icon_path);
  599.  
  600. return icon_layout;
  601. }
  602.  
  603. /*
  604. * @brief: Add icon to genlist
  605. * @param[parent]: Genlist
  606. * @param[icon_path]: Image file path of icon
  607. */
  608. static Evas_Object *_add_icon(Evas_Object *parent, char *icon_path)
  609. {
  610. Evas_Object *icon_layout = NULL;
  611. char file_path[128] = {0, };
  612.  
  613. data_get_resource_path("edje/main.edj", file_path, sizeof(file_path));
  614. icon_layout = view_create_layout(parent, file_path, "icon", NULL, NULL);
  615.  
  616. if (icon_layout == NULL) {
  617. dlog_print(DLOG_ERROR, LOG_TAG, "failed to create icon layout.");
  618. return NULL;
  619. }
  620.  
  621. view_set_image(icon_layout, "icon.img", icon_path);
  622. view_set_color(icon_layout, "icon.img", 0, 0, 0, 255);
  623.  
  624. return icon_layout;
  625. }
  626.  
  627. /*
  628. * @brief: Function will be operated when the item is shown to genlist.
  629. * @param[data]: Data passed from 'elm_genlist_item_append' as third parameter
  630. * @param[obj]: Genlist
  631. * @param[part]: Name string of one of the existing text parts in the EDJ group implementing the item's theme
  632. */
  633. static Evas_Object* _get_display_icon(void *data, Evas_Object *obj, const char *part)
  634. {
  635. Evas_Object *content = NULL;
  636. int state;
  637.  
  638. if (strcmp(part, "elm.icon")) return NULL;
  639.  
  640.  
  641. content = view_create_checkbox(obj, "changed", _icon_clicked_cb, data);
  642.  
  643. data_get_display_int_value((int)data, &state);
  644. elm_check_state_set(content, !!state);
  645.  
  646. return content;
  647. }
  648.  
  649. /*
  650. * @brief: Function will be operated when check object is clicked.
  651. * @param[data]: Data needed in this function
  652. * @param[obj]: Check
  653. * @param[event_info]: Information of event
  654. */
  655. static void _icon_clicked_cb(void *data, Evas_Object *obj, void *event_info)
  656. {
  657. Eina_Bool state = elm_check_state_get(obj);
  658.  
  659. dlog_print(DLOG_INFO, LOG_TAG, "check state [%d]", state);
  660.  
  661. if (state == EINA_TRUE) {
  662. elm_check_state_set(obj, EINA_FALSE);
  663. data_set_display_int_value((int)data, EINA_FALSE);
  664. } else {
  665. elm_check_state_set(obj, EINA_TRUE);
  666. data_set_display_int_value((int)data, EINA_TRUE);
  667. }
  668.  
  669. /*
  670. * @note
  671. * Do something when the icon is clicked.
  672. */
  673. }
  674.  
  675. /* End of file */