4 * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
8 * Jaewon Lim <jaewon81.lim@samsung.com>
9 * Woojin Jung <woojin2.jung@samsung.com>
10 * Juyoung Kim <j0.kim@samsung.com>
12 * This library is free software; you can redistribute it and/or modify it under
13 * the terms of the GNU Lesser General Public License as published by the
14 * Free Software Foundation; either version 2.1 of the License, or (at your option)
17 * This library is distributed in the hope that it will be useful, but WITHOUT ANY
18 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
20 * License for more details.
22 * You should have received a copy of the GNU Lesser General Public License
23 * along with this library; if not, write to the Free Software Foundation, Inc., 51
24 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
35 #include <pthread.h> // for pthread_mutex_t
45 extern int app_efl_main_flg;
47 #define MAX_PATH_LENGTH 256
48 #define MAX_STACK_DEPTH 128
49 #define TRIM_STACK_DEPTH 2
52 #define WIN_RENDER_POST 0
53 #define CONTROLBAR_RENDER_POST 1
54 #define NAVIFRAME_RENDER_POST 2
55 #define PAGER_RENDER_POST 3
56 #define RENDER_POST_COUNT 4
58 #define SNAPSHOT_WAIT_TIME_MAX 10000
61 #define ENABLE_INTERNAL_MALLOC 0x0001
62 #define ENABLE_SNAPSHOT 0x0002
64 #define SCREENSHOT_LOCK() \
67 pthread_mutex_lock(&(gTraceInfo.screenshot.ssMutex)); \
68 old = gTraceInfo.screenshot.state; \
69 gTraceInfo.screenshot.state = -1; \
70 pthread_mutex_unlock(&(gTraceInfo.screenshot.ssMutex)); \
72 if(isOptionEnabled(OPT_SNAPSHOT)) \
77 #define SCREENSHOT_UNLOCK() \
79 pthread_mutex_lock(&(gTraceInfo.screenshot.ssMutex)); \
80 if(gTraceInfo.screenshot.state < 0) \
81 gTraceInfo.screenshot.state = 1; \
82 pthread_mutex_unlock(&(gTraceInfo.screenshot.ssMutex)); \
85 #define SCREENSHOT_SET() \
88 pthread_mutex_lock(&(gTraceInfo.screenshot.ssMutex)); \
89 old = gTraceInfo.screenshot.state; \
90 if(gTraceInfo.screenshot.state >= 0) \
91 gTraceInfo.screenshot.state = 1; \
92 pthread_mutex_unlock(&(gTraceInfo.screenshot.ssMutex)); \
94 if(isOptionEnabled(OPT_SNAPSHOT)) \
99 #define SCREENSHOT_UNSET() \
101 pthread_mutex_lock(&(gTraceInfo.screenshot.ssMutex)); \
102 if(gTraceInfo.screenshot.state >= 0) \
103 gTraceInfo.screenshot.state = 0; \
104 pthread_mutex_unlock(&(gTraceInfo.screenshot.ssMutex)); \
107 #define SCREENSHOT_DONE() \
110 pthread_mutex_lock(&(gTraceInfo.screenshot.ssMutex)); \
111 old = gTraceInfo.screenshot.state; \
112 if(gTraceInfo.screenshot.state == 1) \
113 gTraceInfo.screenshot.state = 2; \
114 pthread_mutex_unlock(&(gTraceInfo.screenshot.ssMutex)); \
116 activateCaptureTimer(); \
120 #define SCREENSHOT_TIMEOUT() \
123 pthread_mutex_lock(&(gTraceInfo.screenshot.ssMutex)); \
124 old = gTraceInfo.screenshot.state; \
125 if(gTraceInfo.screenshot.state == 2) \
126 gTraceInfo.screenshot.state = 1; \
127 pthread_mutex_unlock(&(gTraceInfo.screenshot.ssMutex)); \
129 if(isOptionEnabled(OPT_SNAPSHOT)) \
134 #define NUM_ORIGINAL_LIBRARY 9
142 LIBECORE_INPUT_EVAS = 3,
144 LIBCAPI_APPFW_APPLICATION = 5,
150 extern const char *lib_string[NUM_ORIGINAL_LIBRARY];
151 extern void *lib_handle[NUM_ORIGINAL_LIBRARY];
153 // type definition for global variable
157 pthread_mutex_t eventMutex;
163 pthread_mutex_t sockMutex;
175 pthread_mutex_t ssMutex;
189 __screenshotInfo screenshot;
193 int custom_chart_callback_count;
197 extern __traceInfo gTraceInfo;
199 int get_map_address(void* symbol, void** map_start, void** map_end);
200 char** da_backtrace_symbols (void* const* array, int size);
201 char** cached_backtrace_symbols (void* const* array, int size);
206 extern void reset_pid_tid();
209 int __profil(int mode);
212 void WcharToChar(char* pstrDest, const wchar_t* pwstrSrc);
213 char *absolutize_filepath(const char *fname, char *buf, size_t bufsiz);
215 /* returns the real absolute file path (resolves symlinks) */
216 char *real_abs_path(int fd, char *buffer, size_t bufsiz);
218 // screen capture functions
219 int initialize_screencapture();
220 int finalize_screencapture();
222 int activateCaptureTimer();
223 void _cb_render_post(void* data, Evas* e, void* eventinfo);
225 // event related functions
226 int initialize_event();
227 int finalize_event();
228 int getOrientation();
229 void on_orientation_changed(int angle, bool capi);
231 int remove_indir(const char* dirname);
234 #define isOptionEnabled(OPT) ((gTraceInfo.optionflag & OPT) != 0)
240 #endif // _DAHELPER_H_