4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
24 #ifndef __APPCORE_INTERNAL_H__
25 #define __APPCORE_INTERNAL_H__
27 #define LOG_TAG "APP_CORE"
32 #include "appcore-common.h"
36 # define EXPORT_API __attribute__ ((visibility("default")))
40 # define _ERR(fmt, arg...) \
41 do { fprintf(stderr, "appcore: "fmt"\n", ##arg); } while (0)
43 # define _INFO(fmt, arg...) \
44 do { fprintf(stdout, fmt"\n", ##arg); } while (0)
46 # define _DBG(fmt, arg...) \
48 if (getenv("APPCORE_DEBUG")) { \
49 fprintf(stdout, fmt"\n", ##arg); \
53 # define _ERR(fmt, arg...) \
55 fprintf(stderr, "appcore: "fmt"\n", ##arg); \
58 # define _INFO(...) LOGI(__VA_ARGS__)
59 # define _DBG(...) LOGD(__VA_ARGS__)
62 #define _warn_if(expr, fmt, arg...) do { \
68 #define _ret_if(expr) do { \
74 #define _retv_if(expr, val) do { \
80 #define _retm_if(expr, fmt, arg...) do { \
87 #define _retvm_if(expr, val, fmt, arg...) do { \
95 * Appcore internal state
106 * Appcore internal event
125 * Appcore internal system event
139 * Appcore system event operation
142 int (*func) (void *, void *);
147 * Appcore internal structure
152 bool suspended_state;
155 const struct ui_ops *ops;
156 struct sys_op sops[SE_MAX];
160 * Appcore UI operation
164 void (*cb_app) (enum app_event evnt, void *data, bundle *b);
168 extern void update_lang(void);
169 extern int set_i18n(const char *domainname, const char *dirname);
170 void update_region(void);
174 extern int x_raise_win(pid_t pid);
175 extern int x_pause_win(pid_t pid);
178 /* extern void stack_trim(void);*/
180 int appcore_pause_rotation_cb(void);
181 int appcore_resume_rotation_cb(void);
183 struct ui_wm_rotate {
184 int (*set_rotation_cb) (int (*cb)(void *event_info, enum appcore_rm, void *), void *data);
185 int (*unset_rotation_cb) (void);
186 int (*get_rotation_state) (enum appcore_rm *curr);
187 int (*pause_rotation_cb) (void);
188 int (*resume_rotation_cb) (void);
190 int appcore_set_wm_rotation(struct ui_wm_rotate* wm_rotate);
192 void appcore_group_attach();
193 void appcore_group_lower();
194 unsigned int appcore_get_main_window(void);
196 unsigned int appcore_get_main_surface(void);
198 void appcore_get_app_core(struct appcore **ac);
200 #define ENV_START "APP_START_TIME"
202 #define MEMORY_FLUSH_ACTIVATE
205 TIZEN_PROFILE_UNKNOWN = 0,
206 TIZEN_PROFILE_MOBILE = 0x1,
207 TIZEN_PROFILE_WEARABLE = 0x2,
208 TIZEN_PROFILE_TV = 0x4,
209 TIZEN_PROFILE_IVI = 0x8,
210 TIZEN_PROFILE_COMMON = 0x10,
212 extern tizen_profile_t _get_tizen_profile();
214 #define _APPFW_FEATURE_BACKGROUND_MANAGEMENT (_get_tizen_profile() & (TIZEN_PROFILE_WEARABLE | TIZEN_PROFILE_MOBILE))
216 #endif /* __APPCORE_INTERNAL_H__ */