4 * Copyright (File::*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>
11 * Anastasia Lyupa <a.lyupa@samsung.com>
13 * This library is free software; you can redistribute it and/or modify it under
14 * the terms of the GNU Lesser General Public License as published by the
15 * Free Software Foundation; either version 2.1 of the License, or (at your option)
18 * This library is distributed in the hope that it will be useful, but WITHOUT ANY
19 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
21 * License for more details.
23 * You should have received a copy of the GNU Lesser General Public License
24 * along with this library; if not, write to the Free Software Foundation, Inc., 51
25 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
29 * - Samsung RnD Institute Russia
40 #include "probeinfo.h"
41 #include "osp_probe.h"
46 Ecore_Event_Handler* register_orientation_event_listener();
47 void unregister_orientation_event_listener(Ecore_Event_Handler* handler);
50 using namespace Tizen::Base;
51 using namespace Tizen::Base::Collection;
53 namespace Tizen { namespace App
58 // virtual void OnDeviceOrientationChanged(app_device_orientation_e orientation) = 0;
63 static void OnTerminate(void* user_data);
64 // static void OnDeviceOrientationChanged(app_device_orientation_e orientation, void* user_data);
68 // : public Tizen::Base::Object
71 void OnBackground(void);
72 void OnForeground(void);
73 // virtual void OnDeviceOrientationChanged(app_device_orientation_e orientation);
78 static void SetAppState(AppState appstate);
81 result UiApp::Execute(UiAppInstanceFactory pUiAppFactory,
82 const IList* pArguments)
84 typedef result (*methodType)(UiAppInstanceFactory pFactory, const IList* pArgs);
85 static methodType uiapp_executep;
86 probeInfo_t probeInfo;
87 int __attribute__((unused)) ret;
88 Ecore_Event_Handler* handler;
90 GET_REAL_FUNC_OSP(_ZN5Tizen3App5UiApp7ExecuteEPFPS1_vEPKNS_4Base10Collection5IListE,
91 LIBOSP_UIFW, uiapp_executep);
94 handler = register_orientation_event_listener();
95 if(gTraceInfo.exec_map.map_start == NULL)
97 get_map_address(CALLER_ADDRESS, &(gTraceInfo.exec_map.map_start),
98 &(gTraceInfo.exec_map.map_end));
100 setProbePoint(&probeInfo);
103 ret = uiapp_executep(pUiAppFactory, pArguments);
108 PACK_COMMON_BEGIN(MSG_PROBE_LIFECYCLE,
109 API_ID_result_UiApp__Execute_UiAppInstanceFactory_pUiAppFactory__const_IList__pArguments_,
110 "pp", pUiAppFactory, pArguments);
111 PACK_COMMON_END(ret, 0, 0);
114 unregister_orientation_event_listener(handler);
120 void _AppImpl::OnTerminate(void* user_data)
122 typedef void (*methodType)(void*);
123 static methodType appimpl_onterminatep;
124 probeInfo_t probeInfo;
126 GET_REAL_FUNC_OSP(_ZN5Tizen3App8_AppImpl11OnTerminateEPv, LIBOSP_APPFW, appimpl_onterminatep);
129 setProbePoint(&probeInfo);
132 PACK_COMMON_BEGIN(MSG_PROBE_LIFECYCLE,
133 API_ID_void__AppImpl__OnTerminate_void__user_data_,
135 PACK_COMMON_END(0, 0, 0);
140 appimpl_onterminatep(user_data);
143 void _AppImpl::OnDeviceOrientationChanged(app_device_orientation_e orientation, void* user_data)
145 typedef void (*methodType)(app_device_orientation_e, void*);
146 static methodType appimpl_ondeviceorientationchangedp;
148 GET_REAL_FUNC_OSP(_ZN5Tizen3App8_AppImpl26OnDeviceOrientationChangedE24app_device_orientation_ePv,
149 LIBOSP_APPFW, appimpl_ondeviceorientationchangedp);
152 on_orientation_changed((int)orientation, false);
155 appimpl_ondeviceorientationchangedp(orientation, user_data);
158 void _AppInfo::SetAppState(AppState appState)
160 typedef void (*methodType)(AppState appstate);
161 static methodType appinfo_setappstatep;
162 probeInfo_t probeInfo;
164 GET_REAL_FUNC_OSP(_ZN5Tizen3App8_AppInfo11SetAppStateENS0_8AppStateE, LIBOSP_APPFW, appinfo_setappstatep);
167 if(appState == RUNNING)
169 setProbePoint(&probeInfo);
172 PACK_COMMON_BEGIN(MSG_PROBE_LIFECYCLE,
173 API_ID_void__AppInfo__SetAppState_AppState_appState_,
175 PACK_COMMON_END(0, 0, 0);
180 appinfo_setappstatep(appState);
183 void _UiAppImpl::OnBackground(void)
185 typedef void (_UiAppImpl::*methodType)(void);
186 static methodType uiappimpl_onbackgroundp;
187 probeInfo_t probeInfo;
189 GET_REAL_FUNC_OSP(_ZN5Tizen3App10_UiAppImpl12OnBackgroundEv, LIBOSP_UIFW, uiappimpl_onbackgroundp);
193 setProbePoint(&probeInfo);
196 PACK_COMMON_BEGIN(MSG_PROBE_LIFECYCLE,
197 API_ID_void__UiAppImpl__OnBackground_void_,
199 PACK_COMMON_END(0, 0, 0);
204 (this->*uiappimpl_onbackgroundp)();
207 void _UiAppImpl::OnForeground(void)
209 typedef void (_UiAppImpl::*methodType)(void);
210 static methodType uiappimpl_onforegroundp;
211 probeInfo_t probeInfo;
213 GET_REAL_FUNC_OSP(_ZN5Tizen3App10_UiAppImpl12OnForegroundEv, LIBOSP_UIFW, uiappimpl_onforegroundp);
216 setProbePoint(&probeInfo);
219 PACK_COMMON_BEGIN(MSG_PROBE_LIFECYCLE,
220 API_ID_void__UiAppImpl__OnForeground_void_,
222 PACK_COMMON_END(0, 0, 0);
226 // SCREENSHOT_DONE();
229 (this->*uiappimpl_onforegroundp)();
233 void _UiAppImpl::OnDeviceOrientationChanged(app_device_orientation_e orientation)
235 typedef void (*methodType)(_UiAppImpl* th, app_device_orientation_e orientation);
236 static methodType uiappimpl_ondeviceorientationchangedp;
238 GET_REAL_FUNC_OSP(_ZThn4_N5Tizen3App10_UiAppImpl26OnDeviceOrientationChangedE24app_device_orientation_e,
239 LIBOSP_UIFW, uiappimpl_ondeviceorientationchangedp);
242 on_orientation_changed((int)orientation, false);
245 uiappimpl_ondeviceorientationchangedp(static_cast<_UiAppImpl*>(dynamic_cast<_IAppImpl*>(this)), orientation);
248 } } // end of namespace