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>
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
38 #include "dacollection.h"
40 #include "tizen_probe.h"
44 using namespace Tizen::Ui;
45 using namespace Tizen::Ui::Controls;
46 using namespace Tizen::Ui::Animations;
48 extern IFrameAnimatorEventListener& GetFrameAnimatorEventListener();
50 bool IsRegisteredFrameAnimatorEventListener = false;
52 static enum DaOptions _sopt = OPT_UI;
54 #define BEFORE_ORIGINAL_TIZEN_UI(FUNCNAME, FUNCTIONPOINTER) \
55 DECLARE_VARIABLE_STANDARD_NORET; \
56 GET_REAL_FUNC_TIZEN(FUNCNAME, LIBOSP_UIFW, FUNCTIONPOINTER)
58 namespace Tizen { namespace App {
60 result UiApp::AddFrame(const Tizen::Ui::Controls::Frame& frame)
62 typedef result (UiApp::*methodType)(const Tizen::Ui::Controls::Frame& frame);
63 static methodType uiapp_addframep;
66 BEFORE_ORIGINAL_TIZEN_UI(_ZN5Tizen3App5UiApp8AddFrameERKNS_2Ui8Controls5FrameE, uiapp_addframep);
69 ret = (this->*uiapp_addframep)(frame);
71 POST_PACK_PROBEBLOCK_BEGIN();
74 frame.IsInTouchMode();
76 Control* parent = NULL;
77 setProbePoint(&probeInfo);
80 PACK_COMMON_BEGIN(MSG_PROBE_UICONTROL,
81 API_ID_result_UiApp__AddFrame_const_Tizen__Ui__Controls__Frame__frame_,
82 "p", voidp_to_uint64(&frame));
83 PACK_COMMON_END('x', ret, 0, 0);
84 PACK_UICONTROL(parent);
85 PACK_UICONTROL(&frame);
88 POST_PACK_PROBEBLOCK_END();
93 result UiApp::RemoveFrame(const Tizen::Ui::Controls::Frame &frame)
95 typedef result (UiApp::*methodType)(const Tizen::Ui::Controls::Frame& frame);
96 static methodType uiapp_removeframep;
99 BEFORE_ORIGINAL_TIZEN_UI(_ZN5Tizen3App5UiApp11RemoveFrameERKNS_2Ui8Controls5FrameE, uiapp_removeframep);
103 PRE_PROBEBLOCK_BEGIN();
104 Control *parent = NULL;
106 PACK_COMMON_BEGIN(MSG_PROBE_UICONTROL,
107 API_ID_result_UiApp__RemoveFrame_const_Tizen__Ui__Controls__Frame__frame_,
108 "p", voidp_to_uint64(&frame));
109 PACK_COMMON_END('x', ret, 0, 0);
110 PACK_UICONTROL(parent);
111 PACK_UICONTROL(&frame);
112 PRE_PROBEBLOCK_END();
114 frame.IsInTouchMode();
116 ret = (this->*uiapp_removeframep)(frame);
118 POST_PACK_PROBEBLOCK_BEGIN();
119 PACK_RETURN_END('x', ret);
121 POST_PACK_PROBEBLOCK_END();
127 } } // end of namespce Tizen::App
130 namespace Tizen { namespace Ui {
132 bool Control::IsInTouchMode(void) const
134 typedef bool (Control::*methodType)(void) const;
135 static methodType control_isintouchmodep;
137 GET_REAL_FUNC_TIZEN(_ZNK5Tizen2Ui7Control13IsInTouchModeEv, LIBOSP_UIFW, control_isintouchmodep);
140 add_object_hash_class((void*)(this), typeid(*this).name());
143 return (this->*control_isintouchmodep)();
146 void Control::SetName(const Tizen::Base::String &name)
148 typedef void (Control::*methodType)(const Tizen::Base::String &name);
149 static methodType control_setnamep;
151 BEFORE_ORIGINAL_TIZEN_UI(_ZN5Tizen2Ui7Control7SetNameERKNS_4Base6StringE, control_setnamep);
154 (this->*control_setnamep)(name);
156 POST_PACK_PROBEBLOCK_BEGIN();
159 Control* parent = NULL;
162 PACK_COMMON_BEGIN(MSG_PROBE_UICONTROL,
163 API_ID_void_Control__SetName_const_Tizen__Base__String__name_,
164 "p", voidp_to_uint64(&name));
165 PACK_COMMON_END('v', 0, 0, 0);
166 PACK_UICONTROL(this);
167 PACK_UICONTROL(parent);
170 POST_PACK_PROBEBLOCK_END();
173 result Container::AddControl(const Control &control)
175 typedef result (Container::*methodType)(const Control &control);
176 static methodType container_addcontrolp;
179 BEFORE_ORIGINAL_TIZEN_UI(_ZN5Tizen2Ui9Container10AddControlERKNS0_7ControlE, container_addcontrolp);
182 PRE_PROBEBLOCK_BEGIN();
183 if(unlikely(IsRegisteredFrameAnimatorEventListener == false))
185 char *type = NULL, *classname = NULL;
186 if(likely(find_object_hash((void*)this, &type, &classname) == 1)) // there is entry in object hash
188 if(strcmp(type, "Frame") == 0)
190 FrameAnimator* fa = ((Frame*)this)->GetFrameAnimator();
193 fa->AddFrameAnimatorEventListener(GetFrameAnimatorEventListener());
194 IsRegisteredFrameAnimatorEventListener = true;
196 else // frame is not yet constructed
202 PRE_PROBEBLOCK_END();
204 ret = (this->*container_addcontrolp)(control);
206 POST_PACK_PROBEBLOCK_BEGIN();
210 control.IsInTouchMode();
213 PACK_COMMON_BEGIN(MSG_PROBE_UICONTROL,
214 API_ID_result_Container__AddControl_const_Control__control_,
215 "p", voidp_to_uint64(&control));
216 PACK_COMMON_END('x', ret, 0, 0);
217 PACK_UICONTROL(this);
218 PACK_UICONTROL(&control);
221 POST_PACK_PROBEBLOCK_END();
226 result Container::AddControl(Control* control)
228 typedef result (Container::*methodType)(Control* control);
229 static methodType container_addcontrolp;
232 BEFORE_ORIGINAL_TIZEN_UI(_ZN5Tizen2Ui9Container10AddControlEPNS0_7ControlE, container_addcontrolp);
235 PRE_PROBEBLOCK_BEGIN();
236 if(unlikely(IsRegisteredFrameAnimatorEventListener == false))
238 char *type = NULL, *classname = NULL;
239 if(likely(find_object_hash((void*)this, &type, &classname) == 1)) // there is entry in object hash
241 if(strcmp(type, "Frame") == 0)
243 FrameAnimator* fa = ((Frame*)this)->GetFrameAnimator();
246 fa->AddFrameAnimatorEventListener(GetFrameAnimatorEventListener());
247 IsRegisteredFrameAnimatorEventListener = true;
249 else // frame is not yet constructed
255 PRE_PROBEBLOCK_END();
257 ret = (this->*container_addcontrolp)(control);
259 POST_PACK_PROBEBLOCK_BEGIN();
263 control->IsInTouchMode();
266 PACK_COMMON_BEGIN(MSG_PROBE_UICONTROL,
267 API_ID_result_Container__AddControl_Control__control_,
268 "p", voidp_to_uint64(control));
269 PACK_COMMON_END('x', ret, 0, 0);
270 PACK_UICONTROL(this);
271 PACK_UICONTROL(control);
274 POST_PACK_PROBEBLOCK_END();
279 result Container::RemoveControl(const Control &control)
281 typedef result (Container::*methodType)(const Control &control);
282 static methodType container_removecontrolp;
285 BEFORE_ORIGINAL_TIZEN_UI(_ZN5Tizen2Ui9Container13RemoveControlERKNS0_7ControlE, container_removecontrolp);
290 control.IsInTouchMode();
292 PRE_PROBEBLOCK_BEGIN();
293 PACK_COMMON_BEGIN(MSG_PROBE_UICONTROL,
294 API_ID_result_Container__RemoveControl_const_Control__control_,
295 "p", voidp_to_uint64(&control));
296 PACK_COMMON_END('x', ret, 0, 0);
297 PACK_UICONTROL(this);
298 PACK_UICONTROL(&control);
299 PRE_PROBEBLOCK_END();
301 ret = (this->*container_removecontrolp)(control);
303 POST_PACK_PROBEBLOCK_BEGIN();
304 PACK_RETURN_END('x', ret);
306 POST_PACK_PROBEBLOCK_END();
311 result Container::RemoveControl(Control* control)
313 typedef result (Container::*methodType)(Control* control);
314 static methodType container_removecontrolp;
317 BEFORE_ORIGINAL_TIZEN_UI(_ZN5Tizen2Ui9Container13RemoveControlEPNS0_7ControlE, container_removecontrolp);
322 PRE_PROBEBLOCK_BEGIN();
324 control->IsInTouchMode();
326 PACK_COMMON_BEGIN(MSG_PROBE_UICONTROL,
327 API_ID_result_Container__RemoveControl_Control__control_,
328 "p", voidp_to_uint64(control));
329 PACK_COMMON_END('x', ret, 0, 0);
330 PACK_UICONTROL(this);
331 PACK_UICONTROL(control);
333 PRE_PROBEBLOCK_END();
335 ret = (this->*container_removecontrolp)(control);
337 POST_PACK_PROBEBLOCK_BEGIN();
338 PACK_RETURN_END('x', ret);
340 POST_PACK_PROBEBLOCK_END();
345 result Container::RemoveControl(int index)
347 typedef result (Container::*methodType)(int index);
348 static methodType container_removecontrolip;
350 Control *pcontrol = NULL;
352 BEFORE_ORIGINAL_TIZEN_UI(_ZN5Tizen2Ui9Container13RemoveControlEi, container_removecontrolip);
357 PRE_PROBEBLOCK_BEGIN();
359 pcontrol = GetControl(index);
360 pcontrol->IsInTouchMode();
362 PACK_COMMON_BEGIN(MSG_PROBE_UICONTROL,
363 API_ID_result_Container__RemoveControl_int_index_,
365 PACK_COMMON_END('x', ret, 0, 0);
366 PACK_UICONTROL(this);
367 PACK_UICONTROL(pcontrol);
368 PRE_PROBEBLOCK_END();
370 ret = (this->*container_removecontrolip)(index);
372 POST_PACK_PROBEBLOCK_BEGIN();
373 PACK_RETURN_END('x', ret);
375 POST_PACK_PROBEBLOCK_END();
380 void Container::RemoveAllControls(void)
382 typedef void (Container::*methodType)(void);
383 static methodType container_removeallcontrolp;
385 BEFORE_ORIGINAL_TIZEN_UI(_ZN5Tizen2Ui9Container17RemoveAllControlsEv, container_removeallcontrolp);
388 PRE_PROBEBLOCK_BEGIN();
390 Control* pcontrol = NULL;
393 PACK_COMMON_BEGIN(MSG_PROBE_UICONTROL,
394 API_ID_void_Container__RemoveAllControls_void_,
396 PACK_COMMON_END('v', 0, 0, 0);
397 PACK_UICONTROL(this);
398 PACK_UICONTROL(pcontrol);
400 PRE_PROBEBLOCK_END();
402 (this->*container_removeallcontrolp)();
404 POST_PACK_PROBEBLOCK_BEGIN();
405 POST_PACK_PROBEBLOCK_END();
409 } } // end of namespace Tizen::Ui