The source code moved from the SPIN with license changed to Flora 1.1
[apps/native/home/homescreen-efl.git] / inc / util.h
1 /*
2  * Copyright 2012  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 #ifndef __HOME_SCREEN_UTIL_H__
18 #define __HOME_SCREEN_UTIL_H__
19
20 #include <dlog.h>
21 #include <Elementary.h>
22 #include <stdbool.h>
23
24 #define BUF_SIZE 64
25
26 /* Multi-language */
27 #ifndef _
28 #define _(str) gettext(str)
29 #endif
30
31 /* Build */
32 #define HAPI __attribute__((visibility("hidden")))
33
34 #define COUNT_OF(x) \
35 ((sizeof(x)/sizeof(0[x])) / ((size_t)(!(sizeof(x) % sizeof(0[x])))))
36
37
38 /**
39  * @brief Creates elm_layout widget and load edje file to it.
40  *
41  * @param win Homescreen efl window pointer.
42  * @param edje_filename  name of the edje file
43  * @param edje_group group name from the edje file
44  * @return elm_layout Evas_Object pointer.
45  */
46 extern Evas_Object *util_create_edje_layout(
47         Evas_Object *win, const char* edje_filename, const char* edje_group);
48
49 /*DBG callbacks set. Please use it if new objects are not visible .etc*/
50 extern void tst_resize_cb(void *data, Evas *e, Evas_Object *obj, void *ei);
51 extern void tst_show_cb(void *data, Evas *e, Evas_Object *obj, void *ei);
52 extern void tst_hide_cb(void *data, Evas *e, Evas_Object *obj, void *ei);
53 extern void tst_move_cb(void *data, Evas *e, Evas_Object *obj, void *ei);
54 extern void tst_del_cb(void *data, Evas *e, Evas_Object *obj, void *ei);
55
56
57
58 /**
59  * @brief Function returns Eina list of evas objects visible in gengrid
60  *
61  * @param gengrid Evas_Object pointer to elm_gengrid
62  * @return Eina_List pointer which Evas_Objects
63  */
64 extern Eina_List *elm_gengrid_get_evas_objects_from_items(Evas_Object *gengrid);
65
66 /**
67  * @brief Function returns pointer to elm_object_item placed in gengrid
68  * at specified position
69  * @param gengrid Pointer to elm_gengrid_widget;
70  * @param idx
71  * @return Pointer to elm_object_item
72  */
73 Elm_Object_Item *elm_gengrid_get_item_at_index(Evas_Object *gengrid, int idx);
74
75 #endif /* __HOME_SCREEN_UTIL_H__ */