2 * Copyright 2012 Samsung Electronics Co., Ltd
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
8 * http://floralicense.org/license/
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.
17 #ifndef __HOME_SCREEN_UTIL_H__
18 #define __HOME_SCREEN_UTIL_H__
21 #include <Elementary.h>
28 #define _(str) gettext(str)
32 #define HAPI __attribute__((visibility("hidden")))
35 ((sizeof(x)/sizeof(0[x])) / ((size_t)(!(sizeof(x) % sizeof(0[x])))))
39 * @brief Creates elm_layout widget and load edje file to it.
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.
46 extern Evas_Object *util_create_edje_layout(
47 Evas_Object *win, const char* edje_filename, const char* edje_group);
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);
59 * @brief Function returns Eina list of evas objects visible in gengrid
61 * @param gengrid Evas_Object pointer to elm_gengrid
62 * @return Eina_List pointer which Evas_Objects
64 extern Eina_List *elm_gengrid_get_evas_objects_from_items(Evas_Object *gengrid);
67 * @brief Function returns pointer to elm_object_item placed in gengrid
68 * at specified position
69 * @param gengrid Pointer to elm_gengrid_widget;
71 * @return Pointer to elm_object_item
73 Elm_Object_Item *elm_gengrid_get_item_at_index(Evas_Object *gengrid, int idx);
76 * @brief Application sub-directories type.
83 APP_DIR_SHARED_RESOURCE,
84 APP_DIR_SHARED_TRUSTED,
85 APP_DIR_EXTERNAL_DATA,
86 APP_DIR_EXTERNAL_CACHE,
87 APP_DIR_EXTERNAL_SHARED_DATA,
91 * @brief Returns absolute path to resource file located in applications directory.
93 * @param subdir type of subdirectory
94 * @param relative path of resource from starting from "data" dir.
95 * eg. for DATA_DIR subdir and relative "database.db" => "/home/owner/apps/org.tizen.homescreen-efl/data/database.db"
96 * @return absolute path string.
98 const char *util_get_file_path(enum app_subdir dir, const char *relative);
101 * @brief Convinience macros
103 #define util_get_data_file_path(x) util_get_file_path(APP_DIR_DATA, (x))
104 #define util_get_cache_file_path(x) util_get_file_path(APP_DIR_CACHE, (x))
105 #define util_get_res_file_path(x) util_get_file_path(APP_DIR_RESOURCE, (x))
106 #define util_get_shared_data_file_path(x) util_get_file_path(APP_DIR_SHARED_DATA, (x))
107 #define util_get_shared_res_file_path(x) util_get_file_path(APP_DIR_SHARED_RESOURCE, (x))
108 #define util_get_trusted_file_path(x) util_get_file_path(APP_DIR_SHARED_TRUSTED, (x))
109 #define util_get_external_data_file_path(x) util_get_file_path(APP_DIR_EXTERNAL_DATA, (x))
110 #define util_get_external_cache_file_path(x) util_get_file_path(APP_DIR_EXTERNAL_CACHE, (x))
111 #define util_get_external_shared_data_file_path(x) util_get_file_path(APP_DIR_EXTERNAL_SHARED_DATA, (x))
113 #endif /* __HOME_SCREEN_UTIL_H__ */