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 "osp_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 namespace Tizen { namespace App {
54 result UiApp::AddFrame(const Tizen::Ui::Controls::Frame& frame)
56 typedef result (UiApp::*methodType)(const Tizen::Ui::Controls::Frame& frame);
57 static methodType uiapp_addframep;
58 probeInfo_t probeInfo;
61 GET_REAL_FUNC_OSP(_ZN5Tizen3App5UiApp8AddFrameERKNS_2Ui8Controls5FrameE, LIBOSP_UIFW, uiapp_addframep);
63 ret = (this->*uiapp_addframep)(frame);
68 frame.IsInTouchMode();
70 if(isOptionEnabled(OPT_UI))
72 Control* parent = NULL;
73 setProbePoint(&probeInfo);
76 PACK_COMMON_BEGIN(MSG_PROBE_UICONTROL,
77 API_ID_result_UiApp__AddFrame_const_Tizen__Ui__Controls__Frame__frame_,
79 PACK_COMMON_END(ret, 0, 0);
80 PACK_UICONTROL(parent);
81 PACK_UICONTROL(&frame);
90 result UiApp::RemoveFrame(const Tizen::Ui::Controls::Frame &frame)
92 typedef result (UiApp::*methodType)(const Tizen::Ui::Controls::Frame& frame);
93 static methodType uiapp_removeframep;
94 probeInfo_t probeInfo;
98 GET_REAL_FUNC_OSP(_ZN5Tizen3App5UiApp11RemoveFrameERKNS_2Ui8Controls5FrameE, LIBOSP_UIFW, uiapp_removeframep);
104 frame.IsInTouchMode();
106 if((bOption = isOptionEnabled(OPT_UI)))
108 Control* parent = NULL;
109 setProbePoint(&probeInfo);
111 PACK_COMMON_BEGIN(MSG_PROBE_UICONTROL,
112 API_ID_result_UiApp__RemoveFrame_const_Tizen__Ui__Controls__Frame__frame_,
114 PACK_COMMON_END(0, 0, 0);
115 PACK_UICONTROL(parent);
116 PACK_UICONTROL(&frame);
120 ret = (this->*uiapp_removeframep)(frame);
126 PACK_RETURN_END(ret);
136 } } // end of namespce Tizen::App
139 namespace Tizen { namespace Ui {
141 bool Control::IsInTouchMode(void) const
143 typedef bool (Control::*methodType)(void) const;
144 static methodType control_isintouchmodep;
146 GET_REAL_FUNC_OSP(_ZNK5Tizen2Ui7Control13IsInTouchModeEv, LIBOSP_UIFW, control_isintouchmodep);
149 add_object_hash_class((void*)(this), typeid(*this).name());
152 return (this->*control_isintouchmodep)();
155 void Control::SetName(const Tizen::Base::String &name)
157 typedef void (Control::*methodType)(const Tizen::Base::String &name);
158 static methodType control_setnamep;
159 probeInfo_t probeInfo;
161 GET_REAL_FUNC_OSP(_ZN5Tizen2Ui7Control7SetNameERKNS_4Base6StringE, LIBOSP_UIFW, control_setnamep);
163 (this->*control_setnamep)(name);
168 if(isOptionEnabled(OPT_UI))
170 Control* parent = NULL;
171 setProbePoint(&probeInfo);
174 PACK_COMMON_BEGIN(MSG_PROBE_UICONTROL,
175 API_ID_void_Control__SetName_const_Tizen__Base__String__name_,
177 PACK_COMMON_END(0, 0, 0);
178 PACK_UICONTROL(this);
179 PACK_UICONTROL(parent);
185 result Container::AddControl(const Control &control)
187 typedef result (Container::*methodType)(const Control &control);
188 static methodType container_addcontrolp;
189 probeInfo_t probeInfo;
192 GET_REAL_FUNC_OSP(_ZN5Tizen2Ui9Container10AddControlERKNS0_7ControlE, LIBOSP_UIFW, container_addcontrolp);
195 if(unlikely(IsRegisteredFrameAnimatorEventListener == false))
197 char *type = NULL, *classname = NULL;
198 if(likely(find_object_hash((void*)this, &type, &classname) == 1)) // there is entry in object hash
200 if(strcmp(type, "Frame") == 0)
202 FrameAnimator* fa = ((Frame*)this)->GetFrameAnimator();
205 fa->AddFrameAnimatorEventListener(GetFrameAnimatorEventListener());
206 IsRegisteredFrameAnimatorEventListener = true;
208 else // frame is not yet constructed
216 ret = (this->*container_addcontrolp)(control);
222 control.IsInTouchMode();
224 if(isOptionEnabled(OPT_UI))
226 setProbePoint(&probeInfo);
229 PACK_COMMON_BEGIN(MSG_PROBE_UICONTROL,
230 API_ID_result_Container__AddControl_const_Control__control_,
232 PACK_COMMON_END(ret, 0, 0);
233 PACK_UICONTROL(this);
234 PACK_UICONTROL(&control);
243 result Container::RemoveControl(const Control &control)
245 typedef result (Container::*methodType)(const Control &control);
246 static methodType container_removecontrolp;
247 probeInfo_t probeInfo;
251 GET_REAL_FUNC_OSP(_ZN5Tizen2Ui9Container13RemoveControlERKNS0_7ControlE, LIBOSP_UIFW, container_removecontrolp);
257 control.IsInTouchMode();
259 if((bOption = isOptionEnabled(OPT_UI)))
261 setProbePoint(&probeInfo);
263 PACK_COMMON_BEGIN(MSG_PROBE_UICONTROL,
264 API_ID_result_Container__RemoveControl_const_Control__control_,
266 PACK_COMMON_END(0, 0, 0);
267 PACK_UICONTROL(this);
268 PACK_UICONTROL(&control);
272 ret = (this->*container_removecontrolp)(control);
278 PACK_RETURN_END(ret);
288 result Container::RemoveControl(int index)
290 typedef result (Container::*methodType)(int index);
291 static methodType container_removecontrolip;
292 probeInfo_t probeInfo;
296 GET_REAL_FUNC_OSP(_ZN5Tizen2Ui9Container13RemoveControlEi, LIBOSP_UIFW, container_removecontrolip);
302 Control* pcontrol = GetControl(index);
303 pcontrol->IsInTouchMode();
305 if((bOption = isOptionEnabled(OPT_UI)))
307 setProbePoint(&probeInfo);
309 PACK_COMMON_BEGIN(MSG_PROBE_UICONTROL,
310 API_ID_result_Container__RemoveControl_int_index_,
312 PACK_COMMON_END(0, 0, 0);
313 PACK_UICONTROL(this);
314 PACK_UICONTROL(pcontrol);
318 ret = (this->*container_removecontrolip)(index);
324 PACK_RETURN_END(ret);
334 void Container::RemoveAllControls(void)
336 typedef void (Container::*methodType)(void);
337 static methodType container_removeallcontrolp;
338 probeInfo_t probeInfo;
340 GET_REAL_FUNC_OSP(_ZN5Tizen2Ui9Container17RemoveAllControlsEv, LIBOSP_UIFW, container_removeallcontrolp);
343 if(isOptionEnabled(OPT_UI))
345 Control* pcontrol = NULL;
346 setProbePoint(&probeInfo);
349 PACK_COMMON_BEGIN(MSG_PROBE_UICONTROL,
350 API_ID_void_Container__RemoveAllControls_void_,
352 PACK_COMMON_END(0, 0, 0);
353 PACK_UICONTROL(this);
354 PACK_UICONTROL(pcontrol);
359 (this->*container_removeallcontrolp)();
362 } } // end of namespace Tizen::Ui