4 * Copyright (c) 2000 - 2011 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
36 #include "dacollection.h"
38 #include "osp_probe.h"
40 using namespace Tizen::Ui;
41 using namespace Tizen::Ui::Controls;
42 using namespace Tizen::Ui::Animations;
44 #define APPEND_LOG_CONTROL_OSP(CONTROL) \
46 if(unlikely(CONTROL == NULL)) { \
47 log.length += sprintf(log.data + log.length, "`,`,`,"); \
49 char *type = NULL, *name = NULL; \
50 if(find_object_hash((void*)(CONTROL), &type, &name) == 1) { \
51 log.length += sprintf(log.data + log.length, "`,%s`,%s", type, name); \
53 log.length += sprintf(log.data + log.length, "`,`,"); \
55 log.length += sprintf(log.data + log.length, "`,%p", \
60 extern IFrameAnimatorEventListener& GetFrameAnimatorEventListener();
62 bool IsRegisteredFrameAnimatorEventListener = false;
64 namespace Tizen { namespace App {
66 result UiApp::AddFrame(const Tizen::Ui::Controls::Frame& frame)
68 typedef result (UiApp::*methodType)(const Tizen::Ui::Controls::Frame& frame);
69 static methodType uiapp_addframep;
70 DECLARE_COMMON_VARIABLE;
73 GET_REAL_FUNC_OSP(_ZN5Tizen3App5UiApp8AddFrameERKNS_2Ui8Controls5FrameE, LIBOSP_UIFW, uiapp_addframep);
75 ret = (this->*uiapp_addframep)(frame);
80 frame.IsInTouchMode();
82 if(isOptionEnabled(OPT_UI))
84 Control* parent = NULL;
85 setProbePoint(&probeInfo);
87 APPEND_LOG_BASIC_NAME(LC_UICREATE, "AddFrame");
88 APPEND_LOG_COMMON_NONE(CALLER_ADDRESS);
89 APPEND_LOG_CONTROL_OSP(parent);
90 APPEND_LOG_CONTROL_OSP(&frame);
91 printLog(&log, MSG_LOG);
99 result UiApp::RemoveFrame(const Tizen::Ui::Controls::Frame &frame)
101 typedef result (UiApp::*methodType)(const Tizen::Ui::Controls::Frame& frame);
102 static methodType uiapp_removeframep;
103 DECLARE_COMMON_VARIABLE;
107 GET_REAL_FUNC_OSP(_ZN5Tizen3App5UiApp11RemoveFrameERKNS_2Ui8Controls5FrameE, LIBOSP_UIFW, uiapp_removeframep);
110 frame.IsInTouchMode();
112 if((bOption = isOptionEnabled(OPT_UI)))
114 Control* parent = NULL;
115 setProbePoint(&probeInfo);
117 APPEND_LOG_BASIC_NAME(LC_UICREATE, "RemoveFrame");
118 APPEND_LOG_COMMON_NONE(CALLER_ADDRESS);
119 APPEND_LOG_CONTROL_OSP(parent);
120 APPEND_LOG_CONTROL_OSP(&frame);
124 ret = (this->*uiapp_removeframep)(frame);
130 printLog(&log, MSG_LOG);
137 } } // end of namespce Tizen::App
140 namespace Tizen { namespace Ui {
142 bool Control::IsInTouchMode(void) const
144 typedef bool (Control::*methodType)(void) const;
145 static methodType control_isintouchmodep;
147 GET_REAL_FUNC_OSP(_ZNK5Tizen2Ui7Control13IsInTouchModeEv, LIBOSP_UIFW, control_isintouchmodep);
150 add_object_hash_class((void*)(this), typeid(*this).name());
153 return (this->*control_isintouchmodep)();
156 void Control::SetName(const Tizen::Base::String &name)
158 typedef void (Control::*methodType)(const Tizen::Base::String &name);
159 static methodType control_setnamep;
160 DECLARE_COMMON_VARIABLE;
162 GET_REAL_FUNC_OSP(_ZN5Tizen2Ui7Control7SetNameERKNS_4Base6StringE, LIBOSP_UIFW, control_setnamep);
164 (this->*control_setnamep)(name);
169 if(isOptionEnabled(OPT_UI))
171 Control* parent = NULL;
172 setProbePoint(&probeInfo);
174 APPEND_LOG_BASIC_NAME(LC_UICREATE, "SetName");
175 APPEND_LOG_COMMON_NONE(CALLER_ADDRESS);
176 APPEND_LOG_CONTROL_OSP(this);
177 APPEND_LOG_CONTROL_OSP(parent);
178 printLog(&log, MSG_LOG);
183 result Container::AddControl(const Control &control)
185 typedef result (Container::*methodType)(const Control &control);
186 static methodType container_addcontrolp;
187 DECLARE_COMMON_VARIABLE;
190 GET_REAL_FUNC_OSP(_ZN5Tizen2Ui9Container10AddControlERKNS0_7ControlE, LIBOSP_UIFW, container_addcontrolp);
193 if(unlikely(IsRegisteredFrameAnimatorEventListener == false))
195 char *type = NULL, *classname = NULL;
196 if(likely(find_object_hash((void*)this, &type, &classname) == 1)) // there is entry in object hash
198 if(strcmp(type, "Frame") == 0)
200 FrameAnimator* fa = ((Frame*)this)->GetFrameAnimator();
203 fa->AddFrameAnimatorEventListener(GetFrameAnimatorEventListener());
204 IsRegisteredFrameAnimatorEventListener = true;
206 else // frame is not yet constructed
214 ret = (this->*container_addcontrolp)(control);
220 control.IsInTouchMode();
222 if(isOptionEnabled(OPT_UI))
224 setProbePoint(&probeInfo);
226 APPEND_LOG_BASIC_NAME(LC_UICREATE, "AddControl");
227 APPEND_LOG_COMMON_NONE(CALLER_ADDRESS);
228 APPEND_LOG_CONTROL_OSP(this);
229 APPEND_LOG_CONTROL_OSP(&control);
230 printLog(&log, MSG_LOG);
238 result Container::RemoveControl(const Control &control)
240 typedef result (Container::*methodType)(const Control &control);
241 static methodType container_removecontrolp;
242 DECLARE_COMMON_VARIABLE;
246 GET_REAL_FUNC_OSP(_ZN5Tizen2Ui9Container13RemoveControlERKNS0_7ControlE, LIBOSP_UIFW, container_removecontrolp);
249 control.IsInTouchMode();
251 if((bOption = isOptionEnabled(OPT_UI)))
253 setProbePoint(&probeInfo);
255 APPEND_LOG_BASIC_NAME(LC_UICREATE, "RemoveControl");
256 APPEND_LOG_COMMON_NONE(CALLER_ADDRESS);
257 APPEND_LOG_CONTROL_OSP(this);
258 APPEND_LOG_CONTROL_OSP(&control);
262 ret = (this->*container_removecontrolp)(control);
268 printLog(&log, MSG_LOG);
275 result Container::RemoveControl(int index)
277 typedef result (Container::*methodType)(int index);
278 static methodType container_removecontrolip;
279 DECLARE_COMMON_VARIABLE;
283 GET_REAL_FUNC_OSP(_ZN5Tizen2Ui9Container13RemoveControlEi, LIBOSP_UIFW, container_removecontrolip);
286 Control* pcontrol = GetControl(index);
287 pcontrol->IsInTouchMode();
289 if((bOption = isOptionEnabled(OPT_UI)))
291 setProbePoint(&probeInfo);
293 APPEND_LOG_BASIC_NAME(LC_UICREATE, "RemoveControl");
294 APPEND_LOG_COMMON_NONE(CALLER_ADDRESS);
295 APPEND_LOG_CONTROL_OSP(this);
296 APPEND_LOG_CONTROL_OSP(pcontrol);
300 ret = (this->*container_removecontrolip)(index);
306 printLog(&log, MSG_LOG);
313 void Container::RemoveAllControls(void)
315 typedef void (Container::*methodType)(void);
316 static methodType container_removeallcontrolp;
317 DECLARE_COMMON_VARIABLE;
319 GET_REAL_FUNC_OSP(_ZN5Tizen2Ui9Container17RemoveAllControlsEv, LIBOSP_UIFW, container_removeallcontrolp);
322 if(isOptionEnabled(OPT_UI))
324 Control* pcontrol = NULL;
325 setProbePoint(&probeInfo);
327 APPEND_LOG_BASIC_NAME(LC_UICREATE, "RemoveAllControl");
328 APPEND_LOG_COMMON_NONE(CALLER_ADDRESS);
329 APPEND_LOG_CONTROL_OSP(this);
330 APPEND_LOG_CONTROL_OSP(pcontrol);
331 printLog(&log, MSG_LOG);
335 (this->*container_removeallcontrolp)();
338 } } // end of namespace Tizen::Ui