Change memo menu icon
[apps/home/memo.git] / extend / supplement.c
1 /*
2 *
3 * Copyright 2012  Samsung Electronics Co., Ltd
4 *
5 * Licensed under the Flora License, Version 1.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 *    http://www.tizenopensource.org/license
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 */
18
19 #include <dlog.h>
20 #include <gravel.h>
21 #include <supplement.h>
22
23 static bool _service_iterate_dump_cb(service_h service, const char *key, void *user_data)
24 {
25     LOGD("%s -> %s\n", key, user_data);
26     return 0;
27 }
28
29 void service_dump(service_h service)
30 {
31     if (service != NULL) {
32         service_foreach_extra_data(service, _service_iterate_dump_cb, NULL);
33     }
34 }
35
36 Eina_Bool service_key_check(service_h service, const char *key, const char *val)
37 {
38         char *str = NULL;
39         service_get_extra_data(service, key, &str);
40         if (str != NULL) {
41                 if (strcmp(str, val) == 0) {
42                         SFREE(str);
43                         return EINA_TRUE;
44                 }
45                 SFREE(str);
46         }
47         return EINA_FALSE;
48 }
49
50 void evas_object_geometry_dump(Evas_Object *eo)
51 {
52     Evas_Coord x, y, w, h;
53     evas_object_geometry_get(eo, &x, &y, &w, &h);
54     LOGD("[evas_object_geometry_dump] geometry of %x : %d %d %d %d\n", eo, x, y, w, h);
55 }
56
57 void evas_object_event_hit(void *data, Evas *e, Evas_Object *obj, void *event_info)
58 {
59     LOGD("[%s] %x : %s\n", __func__, obj, (char *)data);
60 }
61
62 void evas_object_smart_event_hit(void *data, Evas_Object *obj, void *event_info)
63 {
64     LOGD("[%s] %x : %s\n", __func__, obj, (char *)data);
65 }
66
67 typedef struct __rf_data_t {
68     Evas_Smart_Cb cb;
69     void *data;
70 }rf_data_t;
71
72 static void _render_flush_post_cb(void *data, Evas *e, void *event_info)
73 {
74     rf_data_t *rf = (rf_data_t *)data;
75     rf->cb(rf->data, NULL, NULL);
76     evas_event_callback_del(e, EVAS_CALLBACK_RENDER_FLUSH_POST, _render_flush_post_cb);
77     SFREE(rf);
78 }
79
80 void evas_object_render_flush_hook(Evas_Object *obj, Evas_Smart_Cb cb, void *data)
81 {
82     RETIF(obj==NULL);
83     Evas *e = evas_object_evas_get(obj);
84     rf_data_t *rf = SMALLOC(rf_data_t);
85     RETIF(rf==NULL);
86     rf->cb = cb;
87     rf->data = data;
88     evas_event_callback_add(e, EVAS_CALLBACK_RENDER_FLUSH_POST, _render_flush_post_cb, rf);
89 }
90