Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / animations / FUiAnim_Debug.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://floralicense.org/license/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file        FUiAnim_Debug.cpp
20  * @brief       This file contains implementation of _VeDebug class
21  *
22  * This file contains implementation _VeDebug class.
23  */
24
25 #ifdef VE_DEBUG_MODULE
26 #include <Evas.h>
27 #endif
28
29 #include <dlog.h>
30 #include <FBaseString.h>
31 #include <FBaseSysLog.h>
32 #include <FBase_Log.h>
33 #include <FBaseByteBuffer.h>
34 #include <FBaseUtilStringUtil.h>
35
36 #ifndef VE_SIMULATOR
37 #include <FUiCtrlHeader.h>
38 #include <FUiCtrlFooter.h>
39 #endif
40
41 #include "FUiAnim_VisualElementImpl.h"
42 #include "FUiAnim_RootVisualElement.h"
43 #include "FUiAnim_VisualElementSharedData.h"
44 #include "FUiAnim_VisualElementSurfaceImpl.h"
45 #include "FUiAnim_Debug.h"
46
47 #ifdef VE_DEBUG_MODULE
48
49 #ifndef VE_SIMULATOR
50 #include "FUi_ControlImpl.h"
51 #include "FUiCtrl_Label.h"
52 #include "FUiCtrl_Button.h"
53 #include "FUiCtrl_Edit.h"
54 #include "FUiCtrl_Popup.h"
55 #endif
56
57 #include "FUiAnim_EflNode.h"
58 #include "FUiAnim_AnimationManager.h"
59 #include "FUiAnim_DisplayManager.h"
60
61 #include "FUi_EcoreEvas.h"
62 #include "FUi_EcoreEvasMgr.h"
63
64
65 using namespace Tizen::Base;
66
67 namespace Tizen { namespace Ui { namespace Animations
68 {
69
70 #ifdef  _OSP_PERF_
71 int _ElapsedTime::depth = 0;
72 char _ElapsedTime::logs[500][256];
73 int _ElapsedTime::maxdepth = 0;
74 int _ElapsedTime::count = 0;
75 #endif
76
77 #define DIGITATPOSITION(number, digit) static_cast< int >((number % static_cast< int >(powf(10.0f, (digit)))) / powf(10.0f, (digit - 1)))
78
79 bool _VeDebug::__veDebugEnabled = false;
80
81 void
82 _VeDebug::SetDebugEnabled(bool enable)
83 {
84         __veDebugEnabled = enable;
85 }
86
87 bool
88 _VeDebug::IsDebugEnabled(void)
89 {
90         return __veDebugEnabled;
91 }
92
93 void
94 _VeDebug::DumpVisualElement(_VisualElementImpl* pElement, const char* func, int line, const char* fmt, ...)
95 {
96         static int count = 0;
97         int len = 0;
98         int depth = 0;
99         int nativeVisible = -1;
100         _VisualElementImpl* pDepth = null;
101         _VisualElementImpl* pModel = null;
102         _VisualElementImpl* pPresentation = null;
103         char logPlaceMessage[LOG_LEN_MAX] = { 0, };
104         char logMessage[LOG_LEN_MAX] = {0, };
105         char logSpaces[LOG_LEN_MAX] = { 0, };
106         va_list args;
107
108         if (!pElement)
109         {
110                 return;
111         }
112
113         depth = -1;
114         pDepth = pElement;
115         while (pDepth)
116         {
117                 depth++;
118                 pDepth = pDepth->__pParent;
119         }
120
121         if (pElement->GetModel() == pElement) // presenter
122         {
123                 pModel = pElement->GetModel();
124                 pPresentation = pElement->GetPresentation();
125         }
126         else
127         {
128                 pModel = null;
129                 pPresentation = pElement;
130         }
131
132         if (pPresentation && pPresentation->__pSharedData->pNativeNode)
133         {
134                 VisualElementSurface* pSurface = dynamic_cast< VisualElementSurface* >(pPresentation->__pSharedData->pNativeNode->GetSurface());
135                 if (pSurface && _VisualElementSurfaceImpl::GetInstance(*pSurface))
136                 {
137                         nativeVisible = evas_object_visible_get(reinterpret_cast< Evas_Object* >(_VisualElementSurfaceImpl::GetInstance(*pSurface)->GetNativeHandle()));
138                 }
139         }
140
141         if (func)
142         {
143                 snprintf(logPlaceMessage, sizeof(logPlaceMessage), "(%s:%4d)", func, line);
144         }
145
146         snprintf(logSpaces, sizeof(logSpaces), "%*s", depth * 3, " ");
147
148         Tizen::Base::String name = pElement->GetSharedData().name;
149
150 #ifndef VE_SIMULATOR
151         Tizen::Ui::_Control* pControl = null;
152         Tizen::Ui::_ControlImpl* pCtrlImpl = null;
153
154         pControl = dynamic_cast< Tizen::Ui::_Control* >(static_cast< Tizen::Ui::_Control* >(pElement->GetUserData()));
155         if (pControl)
156         {
157                 pCtrlImpl = dynamic_cast< Tizen::Ui::_ControlImpl* >(static_cast< Tizen::Ui::_ControlImpl* >(pControl->GetUserData()));
158                 if (pCtrlImpl)
159                 {
160                         name = name + L", " + pCtrlImpl->GetPublicClassName();
161                 }
162
163                 Tizen::Ui::Controls::_Label* pLabel = null;
164                 Tizen::Ui::Controls::_Edit* pEdit = null;
165                 Tizen::Ui::Controls::_Button* pButton = null;
166                 Tizen::Ui::Controls::_Popup* pPopup = null;
167                 Tizen::Ui::Controls::Form* pForm = null;
168                 Tizen::Ui::Controls::Header* pHeader = null;
169                 Tizen::Ui::_Window* pWindow = null;
170
171                 pLabel = dynamic_cast< Tizen::Ui::Controls::_Label* >(pControl);
172                 if (pLabel)
173                 {
174                         name = name + L", '" + pLabel->GetText() + L"'";
175                 }
176
177                 pEdit = dynamic_cast< Tizen::Ui::Controls::_Edit* >(pControl);
178                 if (pEdit)
179                 {
180                         name = name + L", '" + pEdit->GetText() + L"'";
181                 }
182
183                 pButton = dynamic_cast< Tizen::Ui::Controls::_Button* >(pControl);
184                 if (pButton)
185                 {
186                         name = name + L", '" + pButton->GetText() + L"'";
187                 }
188
189                 pPopup = dynamic_cast< Tizen::Ui::Controls::_Popup* >(pControl);
190                 if (pPopup)
191                 {
192                         name = name + L", '" + pPopup->GetTitleText() + L"'";
193                 }
194
195                 pWindow = dynamic_cast< Tizen::Ui::_Window* >(pControl);
196                 if (pWindow)
197                 {
198                         name = name + L", '_Window'";
199                 }
200
201                 pForm = dynamic_cast< Tizen::Ui::Controls::Form* >(pControl);
202                 if (pForm)
203                 {
204                         name = name + L", '" + pForm->GetTitleText() + L"'";
205                 }
206
207                 pHeader = dynamic_cast< Tizen::Ui::Controls::Header* >(pControl);
208                 if (pHeader)
209                 {
210                         name = name + L", '" + pHeader->GetTitleText() + L"'";
211                 }
212         }
213 #endif
214
215
216 #define TERMCOLOR_FMT //"%c[%d;%d;%dm"
217
218         len = snprintf(logMessage, sizeof(logMessage),
219                 TERMCOLOR_FMT "\n%4d = %2d%s:" TERMCOLOR_FMT "\n%s - [VE(%ls): 0x%08lx->0x%08lx]%s\n%s - [show:%s, %s, %d] [op=%.1f, %.1f, %.1f, %.1f] [%s] [0x%x, "
220                                 "0x%x, 0x%x %s=%p]\n%s - bounds=" VELOGRECTTAG " invRect=" VELOGRECTTAG " vRect=" VELOGRECTTAG,
221                 /*0x1B, 1, 31, 10,*/
222                 count, depth,
223                 (pElement != pElement->__pModel ? "P" : " "),
224                 /*0x1B, 0, 0, 10,*/
225                 logSpaces,
226                 name.GetPointer(), //(pElement->__pSharedData ? pElement->__pSharedData->name.GetPointer() : L" "),
227                 (unsigned long) pModel, (unsigned long) pPresentation,
228                 logPlaceMessage,
229                 logSpaces,
230                 (pElement->GetShowState() ? "show" : "hide"), (pElement->IsVisible() ? "  visible" : "invisible"), nativeVisible,
231                 pElement->__showOpacity, pElement->__opacity, pElement->__contentOpacity, pElement->GetOpacityFromRoot(),
232                 (pElement->__pSharedData->pSurface ? "  sfc" : "nosfc"),
233                 pElement->__invalidatedProps,
234                 pElement->__childrenNeedsUpdateProps,
235                 pElement->__pSharedData->invalidatedNativeProps, (pElement->__isClipChildren ? "CS" : "NOCS"),
236                 pElement->__pClipSource,
237                 logSpaces,
238                 VELOGRECT(pElement->__bounds),
239                 VELOGRECT(pElement->__pSharedData->invalidatedRegion),
240                 VELOGRECT(pElement->__visibleRect)
241         );
242
243 #undef  TERMCOLOR_FMT
244
245         va_start(args, fmt);
246         vsnprintf(&logMessage[len], sizeof(logMessage) - len, fmt, args);
247         va_end(args);
248
249         //VeLog(NID_UI_ANIM, "%s", logMessage);
250
251
252         if (pElement == pPresentation && pElement->__pSharedData->pNativeNode)
253         {
254                 _EflNode* pNativeNode = dynamic_cast< _EflNode* >(pPresentation->__pSharedData->pNativeNode);
255                 if (pNativeNode)
256                 {
257                         Evas_Object* pEvasObject = null;
258
259                         if (pNativeNode->GetSurface() && _VisualElementSurfaceImpl::GetInstance(*pNativeNode->GetSurface()))
260                         {
261                                 pEvasObject = reinterpret_cast< Evas_Object* >(_VisualElementSurfaceImpl::GetInstance(*pNativeNode->GetSurface())->GetNativeHandle());
262                         }
263                         else
264                         {
265                                 pEvasObject = pNativeNode->__pRectangleObject;
266                         }
267
268                         if (pEvasObject)
269                         {
270                                 int iw = 0;
271                                 int ih = 0;
272                                 int ox = 0;
273                                 int oy = 0;
274                                 int ow = 0;
275                                 int oh = 0;
276                                 int fx = 0;
277                                 int fy = 0;
278                                 int fw = 0;
279                                 int fh = 0;
280                                 int red = 0;
281                                 int green = 0;
282                                 int blue = 0;
283                                 int alpha = 0;
284                                 int argb = 0;
285                                 const char* eoType = evas_object_type_get(pEvasObject);
286
287                                 if (!pElement->GetName().IsEmpty())
288                                 {
289                                         ByteBuffer* pByteBuffer(Tizen::Base::Utility::StringUtil::StringToUtf8N(pElement->GetName()));
290                                         evas_object_name_set(pEvasObject, (const char*)pByteBuffer->GetPointer());
291                                         delete pByteBuffer;
292                                 }
293
294
295                                 if (!strcmp(eoType, "image"))
296                                 {
297                                         if (evas_object_image_source_get(pEvasObject))
298                                         {
299                                                 evas_object_image_size_get(evas_object_image_source_get(pEvasObject), &iw, &ih);
300                                         }
301                                         else
302                                         {
303                                                 evas_object_image_size_get(pEvasObject, &iw, &ih);
304                                         }
305                                         evas_object_image_fill_get(pEvasObject, &fx, &fy, &fw, &fh);
306                                 }
307
308                                 evas_object_geometry_get(pEvasObject, &ox, &oy, &ow, &oh);
309                                 evas_object_color_get(pEvasObject, &red, &green, &blue, &alpha);
310                                 argb = (((alpha << 24) & 0xff000000) | ((red << 16) & 0x00ff0000) | ((green << 8) & 0x0000ff00) | (blue & 0x000000ff));
311                                 bool showState = evas_object_visible_get(pEvasObject);
312
313                                 len = strlen(logMessage);
314                                 snprintf(&logMessage[len], sizeof(logMessage) - len, "%s - type=%s[%p] bounds=[%d:%d ~ %d:%d] fill=[%d:%d ~ %d:%d] imgsize=[%d:%d] show=%s color=%08X",
315                                         logSpaces, evas_object_type_get(pEvasObject), pEvasObject, ox, oy, ox + ow, oy + oh, fx, fy, fx + fw, fy + fh, iw, ih, (showState ? "visible" : "invisible"), argb);
316
317                                 //VeLog(NID_UI_ANIM, "%s", logMessage);
318                         }
319                 }
320         }
321
322         VeLog(NID_UI_ANIM, "%s", logMessage);
323
324         count++;
325 }
326
327 void
328 _VeDebug::DumpVeTree(_VisualElementImpl* pElement, int indent)
329 {
330         if (!pElement)
331         {
332                 _DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
333                 if (pDisplayManager != null && pDisplayManager->GetRoot(0))
334                 {
335                         pElement = _VisualElementImpl::GetInstance(*pDisplayManager->GetRoot(0));
336                 }
337         }
338
339         bool prevDebugEnabled = IsDebugEnabled();
340         SetDebugEnabled(true);
341
342         if (pElement)
343         {
344                 if (indent == 0)
345                 {
346                         VeLog(NID_UI_ANIM, "--------------------------[VE DUMP START]---------------------------");
347                 }
348
349                 VELOGEX_NOFUNCTION(pElement, "");
350                 VELOGEX_NOFUNCTION(pElement->__pPresentation, "\n");
351
352                 int count = pElement->__children.GetCount();
353                 for (int i = 0; i < count; i++)
354                 {
355                         _VeDebug::DumpVeTree(pElement->__children.GetChildAt(i), indent + 3);
356                 }
357
358                 if (indent == 0)
359                 {
360                         VeLog(NID_UI_ANIM, "--------------------------[VE DUMP END]-----------------------------");
361 #if 0
362                         extern int sfc_memory_usage;
363                         VeLog(NID_UI_ANIM, "--------------------------[IMAGE SIZE=%d KB]-----------------------------", sfc_memory_usage / 1024);
364 #endif
365                 }
366         }
367
368         SetDebugEnabled(prevDebugEnabled);
369
370         return;
371 }
372
373
374 void
375 _VeDebug::DumpEvasTree(_VisualElementImpl* pElement, int indent)
376 {
377         if (!pElement)
378         {
379                 _DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
380                 if (pDisplayManager != null && pDisplayManager->GetRoot(0))
381                 {
382                         pElement = _VisualElementImpl::GetInstance(*pDisplayManager->GetRoot(0));
383                 }
384         }
385
386         bool prevDebugEnabled = IsDebugEnabled();
387         SetDebugEnabled(true);
388
389         if (pElement)
390         {
391                 if (indent == 0)
392                 {
393                         VeLog(NID_UI_ANIM, "--------------------------[EVAS DUMP START]---------------------------");
394                 }
395
396                 //VELOGEX_NOFUNCTION(pElement, "");
397                 //VELOGEX_NOFUNCTION(pElement->__pPresentation, "\n");
398
399                 DumpEvasTreeI((Evas_Object*)((_EflNode*)pElement->__pSharedData->pNativeNode)->GetGroupContainer(), indent);
400
401                 if (indent == 0)
402                 {
403                         VeLog(NID_UI_ANIM, "--------------------------[EVAS DUMP END]-----------------------------");
404                 }
405         }
406
407         SetDebugEnabled(prevDebugEnabled);
408
409         return;
410 }
411
412
413 void
414 _VeDebug::DumpEvasTreeI(Evas_Object* pParent, int indent)
415 {
416         if (!pParent)
417         {
418                 return;
419         }
420
421         bool prevDebugEnabled = IsDebugEnabled();
422         SetDebugEnabled(true);
423
424         char logMessage1[LOG_LEN_MAX] = { 0, };
425         char logMessage2[LOG_LEN_MAX] = { 0, };
426         char logSpaces[LOG_LEN_MAX] = { 0, };
427
428         int iw = 0;
429         int ih = 0;
430         int mox = 0;
431         int moy = 0;
432         int mow = 0;
433         int moh = 0;
434         int sox = 0;
435         int soy = 0;
436         int sow = 0;
437         int soh = 0;
438         int mfx = 0;
439         int mfy = 0;
440         int mfw = 0;
441         int mfh = 0;
442         int sfx = 0;
443         int sfy = 0;
444         int sfw = 0;
445         int sfh = 0;
446         int red = 0;
447         int green = 0;
448         int blue = 0;
449         int alpha = 0;
450         int argb = 0;
451         int renderOperation = 0;
452         bool mshowState = false;
453         bool sshowState = false;
454         void* pBuffer = null;
455         Tizen::Base::String type(evas_object_type_get(pParent));
456         evas_object_geometry_get(pParent, &mox, &moy, &mow, &moh);
457
458         // color & show state
459         renderOperation = evas_object_render_op_get(pParent);
460         evas_object_color_get(pParent, &red, &green, &blue, &alpha);
461         argb = (((alpha << 24) & 0xff000000) | ((red << 16) & 0x00ff0000) | ((green << 8) & 0x0000ff00) | (blue & 0x000000ff));
462         mshowState = evas_object_visible_get(pParent);
463
464         if (type != "visual_element")// && argb != 0)
465         {
466                 bool clip = evas_object_clip_get(pParent) ? true : false;
467                 char source = ' ';
468
469                 snprintf(logSpaces, sizeof(logSpaces), "%*s", indent, " ");
470                 if (type == "image")
471                 {
472                         source = 'P';
473                 }
474
475                 if (evas_object_clipees_get(pParent))
476                 {
477                         type = "cliper";
478                 }
479
480                 snprintf(logMessage1, sizeof(logMessage1),
481                         "%s[%#x][%c] : %ls(%s) fill(%d,%d,%d,%d) bounds(%d,%d,%d,%d) argb(0x%08x) %s clip=%s show=%s",
482                         logSpaces, (unsigned int)pParent, source, type.GetPointer(), evas_object_name_get(pParent), mfx, mfy, mfw, mfh, mox, moy, mow, moh,
483                         (unsigned int)argb, (renderOperation ? "COPY" : "BLEND"), (clip ? "true" : "false"), (mshowState ? "true" : "false")
484                         );
485
486                 VeLog(NID_UI_ANIM, "%s", logMessage1);
487
488                 if (type == "image")
489                 {
490                         source = 'S';
491                         evas_object_image_fill_get(pParent, &mfx, &mfy, &mfw, &mfh);
492
493                         // image
494                         Evas_Object* pSource = evas_object_image_source_get(pParent);
495                         pSource = pSource ? pSource : pParent;
496
497                         evas_object_image_size_get(pSource, &iw, &ih);
498                         pBuffer = (void*)evas_object_image_data_get(pSource, EINA_FALSE);
499                         evas_object_geometry_get(pSource, &sox, &soy, &sow, &soh);
500                         evas_object_image_fill_get(pSource, &sfx, &sfy, &sfw, &sfh);
501                         sshowState = evas_object_visible_get(pSource);
502
503                         snprintf(logMessage2, sizeof(logMessage2),
504                                 "%s[%#x][%c] : %ls(%s:%#x %d,%d) fill(%d,%d,%d,%d) bounds(%d,%d,%d,%d) argb(0x%08x) %s show=%s",
505                                 logSpaces, (unsigned int)pSource, source, type.GetPointer(), evas_object_name_get(pParent), (unsigned int)pBuffer, iw, ih, sfx, sfy, sfw, sfh, sox, soy, sow, soh,
506                                 (unsigned int)argb, (renderOperation ? "COPY" : "BLEND"), (sshowState ? "true" : "false")
507                                 );
508
509                         VeLog(NID_UI_ANIM, "%s", logMessage2);
510                 }
511         }
512
513
514         void* pObject = null;
515         Eina_List* pList = evas_object_smart_members_get(pParent);
516         EINA_LIST_FREE(pList, pObject)
517         {
518                 if (pObject)
519                 {
520                         DumpEvasTreeI((Evas_Object*)pObject, indent+2);
521                 }
522         }
523
524         SetDebugEnabled(prevDebugEnabled);
525
526         return;
527 }
528
529 void
530 _VeDebug::DumpEvasObjectForGraphI(FILE* pFile, Evas_Object* pEvasObject, int depth, int pos)
531 {
532         if (!pEvasObject)
533         {
534                 return;
535         }
536
537         Tizen::Base::String typeName(evas_object_type_get(pEvasObject));
538
539         int objX = 0;
540         int objY = 0;
541         int objW = 0;
542         int objH = 0;
543         evas_object_geometry_get(pEvasObject, &objX, &objY, &objW, &objH);
544
545         Evas_Object* pClipper = evas_object_clip_get(pEvasObject);
546         const Evas_Map* pMap = evas_object_map_get(pEvasObject);
547         Evas_Render_Op renderOp = evas_object_render_op_get(pEvasObject);
548
549         int r = 0;
550         int g = 0;
551         int b = 0;
552         int a = 0;
553         evas_object_color_get(pEvasObject, &r, &g, &b, &a);
554
555         int visible = evas_object_visible_get(pEvasObject);
556
557         Tizen::Base::String output;
558         Tizen::Base::String label;
559         Tizen::Base::String common;
560         Tizen::Base::String type;
561         Tizen::Base::String order;
562         Tizen::Base::String clipper;
563         Tizen::Base::String map;
564         Tizen::Base::String bounds;
565         Tizen::Base::String showState;
566         Tizen::Base::String rop;
567         Tizen::Base::String color;
568         Tizen::Base::String imageSize;
569         Tizen::Base::String imageFill;
570         Tizen::Base::String imageSource;
571
572
573         type.Format(256, L"<TD>type</TD> <TD>%ls</TD>", typeName.GetPointer());
574         order.Format(256, L"<TD>order</TD> <TD>%d-%d</TD>", depth, pos);
575         clipper.Format(256, L"<TD>clipper</TD> <TD PORT=\"clipper\">%x</TD>", pClipper);
576         map.Format(256, L"<TD>map</TD> <TD>%ls</TD>", (pMap ? L"used" : L"unused"));
577         bounds.Format(256, L"<TD>bounds</TD> <TD>%d : %d ~ %d : %d</TD>", objX, objY, objX + objW, objY + objH);
578         showState.Format(256, L"<TD>showState</TD> <TD>%ls</TD>", (visible ? L"show" : L"hidden"));
579         rop.Format(256, L"<TD>rop</TD> <TD>%d</TD>", renderOp);
580         color.Format(256, L"<TD>color</TD> <TD>0x%08x</TD>", (a << 24) | (r << 16) | (g << 8) | b);
581
582
583         if (typeName == "image")
584         {
585                 int iw = 0;
586                 int ih = 0;
587                 evas_object_image_size_get(pEvasObject, &iw, &ih);
588                 int fillX = 0;
589                 int fillY = 0;
590                 int fillW = 0;
591                 int fillH = 0;
592                 evas_object_image_fill_get(pEvasObject, &fillX, &fillY, &fillW, &fillH);
593                 Evas_Object* pSource = evas_object_image_source_get(pEvasObject);
594
595                 imageSize.Format(256, L"<TD>imageSize</TD> <TD>%d:%d</TD>", iw, ih);
596                 imageFill.Format(256, L"<TD>fill</TD> <TD>%d : %d ~ %d : %d</TD>", fillX, fillY, fillX + fillW, fillY + fillH);
597                 imageSource.Format(256, L"<TD PORT=\"proxy\">source</TD> <TD>N%lx</TD>", pSource);
598
599                 if (pSource)
600                 {
601                         DumpEvasObjectForGraphI(pFile, pSource, depth, pos);
602                         fprintf(pFile, "N%lx:proxy -> N%lx [style=dashed, label=source];\n", (unsigned long)pEvasObject, (unsigned long)pSource);
603                 }
604         }
605
606
607         label = L"<TR>" + type + L"</TR>";
608         label += L"<TR>" + order + L"</TR>";
609         label += L"<TR>" + clipper + L"</TR>";
610         label += L"<TR>" + map + L"</TR>";
611         label += L"<TR>" + bounds + L"</TR>";
612         label += L"<TR>" + showState + L"</TR>";
613         label += L"<TR>" + rop + L"</TR>";
614         label += L"<TR>" + color + L"</TR>";
615
616         if (!imageSize.IsEmpty())
617         {
618                 label += L"<TR>" + imageSize + L"</TR>";
619         }
620
621         if (!imageFill.IsEmpty())
622         {
623                 label += L"<TR>" + imageFill + L"</TR>";
624         }
625
626         if (!imageSource.IsEmpty())
627         {
628                 label += L"<TR>" + imageSource + L"</TR>";
629         }
630
631         output.Format(1024, L"N%lx [ fillcolor=\"#%06x\", style=filled, label=<<TABLE BORDER=\"0\" CELLBORDER=\"1\" CELLSPACING=\"0\" CELLPADDING=\"3\">%ls</TABLE>>];\n",
632                 (unsigned long)pEvasObject,
633                 0xFAF0E6,
634                 label.GetPointer()
635         );
636
637         fprintf(pFile, "%ls", output.GetPointer());
638
639
640         if (pClipper)
641         {
642                 fprintf(pFile, "N%lx:clipper -> N%lx [style=\"dotted\", label=clipper]; \n",
643                         (unsigned long)pEvasObject,
644                         (unsigned long)pClipper
645                 );
646         }
647 }
648
649 void
650 _VeDebug::DumpEvasTreeGraphI(FILE* pFile, Evas_Object* pObject, int depth, int pos)
651 {
652         if (!pObject)
653         {
654                 return;
655         }
656
657         bool prevDebugEnabled = IsDebugEnabled();
658         SetDebugEnabled(true);
659
660         DumpEvasObjectForGraphI(pFile, pObject, depth, pos);
661
662         pos = 0;
663         void* pChild = null;
664         Eina_List* pList = evas_object_smart_members_get(pObject);
665         EINA_LIST_FREE(pList, pChild)
666         {
667                 if (pChild)
668                 {
669                         DumpEvasTreeGraphI(pFile, (Evas_Object*)pChild, depth + 1, pos++);
670                         fprintf(pFile, "N%lx -> N%lx [style=\"solid,bold\"] \n", (unsigned long)pChild, (unsigned long)pObject);
671                 }
672         }
673
674         SetDebugEnabled(prevDebugEnabled);
675 }
676
677 void
678 _VeDebug::DumpVeObjectForGraphI(FILE* pFile, _VisualElementImpl* pVisualElementImpl, int depth, int pos)
679 {
680         if (!pVisualElementImpl)
681         {
682                 return;
683         }
684
685         bool isModel = (pVisualElementImpl == pVisualElementImpl->__pModel);
686         bool isPresentation = (pVisualElementImpl == pVisualElementImpl->__pPresentation);
687
688         Tizen::Base::String output;
689         Tizen::Base::String label;
690         Tizen::Base::String model;
691         Tizen::Base::String name;
692         Tizen::Base::String order;
693         Tizen::Base::String clip;
694         Tizen::Base::String transformed;
695         Tizen::Base::String show;
696         Tizen::Base::String visible;
697         Tizen::Base::String ror;
698         Tizen::Base::String opacity;
699         Tizen::Base::String showOpacity;
700         Tizen::Base::String opacityFromRoot;
701         Tizen::Base::String bounds;
702         Tizen::Base::String invBounds;
703         Tizen::Base::String rop;
704         const Tizen::Graphics::FloatRectangle& boundsRect = pVisualElementImpl->__bounds;
705         const Tizen::Graphics::FloatRectangle& invBoundsRect = pVisualElementImpl->GetSharedData().invalidatedRegion;
706
707         model.Format(256, L"<TD>type</TD> <TD>%ls</TD>", (isModel ? L"Model" : isPresentation ? L"Presentation" : L"<unknown>"));
708         name.Format(256, L"<TD>name</TD> <TD>%ls</TD>", pVisualElementImpl->GetSharedData().name.GetPointer());
709         order.Format(256, L"<TD>order</TD> <TD>%d-%d</TD>", depth, pos);
710         clip.Format(256, L"<TD>clip</TD> <TD>%ls</TD>", (pVisualElementImpl->__isClipChildren ? L"CS" : L"NO-CS"));
711         transformed.Format(256, L"<TD>xform</TD> <TD>%ls</TD>", (pVisualElementImpl->__needTransform ? L"NO-AA" : L"AA"));
712         show.Format(256, L"<TD>showState</TD> <TD>%ls</TD>", (pVisualElementImpl->GetShowState() ? L"show" : L"hidden"));
713         visible.Format(256, L"<TD>visibility</TD> <TD>%ls</TD>", (pVisualElementImpl->IsVisible() ? L"visible" : L"invisible"));
714         ror.Format(256, L"<TD>redrawOnResize</TD> <TD>%ls</TD>", (pVisualElementImpl->GetRedrawOnResizeEnabled() ? L"ROR" : L"NO-ROR"));
715         opacity.Format(256, L"<TD>opacity</TD> <TD>%3.1f</TD>", pVisualElementImpl->GetOpacity());
716         showOpacity.Format(256, L"<TD>showOpacity</TD> <TD>%3.1f</TD>", pVisualElementImpl->__showOpacity);
717         opacityFromRoot.Format(256, L"<TD>visOpacity</TD> <TD>%3.1f</TD>", pVisualElementImpl->GetOpacityFromRoot());
718         bounds.Format(256, L"<TD>bounds</TD> <TD>%.2f : %.2f ~ %.2f : %.2f</TD>", boundsRect.x, boundsRect.y, boundsRect.x + boundsRect.width, boundsRect.y + boundsRect.height);
719         invBounds.Format(256, L"<TD>invBounds</TD> <TD>%.2f : %.2f ~ %.2f : %.2f</TD>", invBoundsRect.x, invBoundsRect.y, invBoundsRect.x + invBoundsRect.width, invBoundsRect.y + invBoundsRect.height);
720         rop.Format(256, L"<TD>rop</TD> <TD>%d</TD>", pVisualElementImpl->__renderOperation);
721
722
723         long color = (isModel ? 0xF0FFF0 : isPresentation ? 0xE6E6FA : 0x708090);
724
725         label = L"<TR>" + model + L"</TR>";
726         label += L"<TR>" + name + L"</TR>";
727         label += L"<TR>" + order + L"</TR>";
728         label += L"<TR>" + clip + L"</TR>";
729         label += L"<TR>" + transformed + L"</TR>";
730         label += L"<TR>" + show + L"</TR>";
731         label += L"<TR>" + visible + L"</TR>";
732         label += L"<TR>" + ror + L"</TR>";
733         label += L"<TR>" + opacity + L"</TR>";
734         label += L"<TR>" + showOpacity + L"</TR>";
735         label += L"<TR>" + opacityFromRoot + L"</TR>";
736         label += L"<TR>" + bounds + L"</TR>";
737         label += L"<TR>" + invBounds + L"</TR>";
738         label += L"<TR>" + rop + L"</TR>";
739
740         output.Format(1024, L"N%lx [ fillcolor=\"#%06x\", style=filled, label=<<TABLE BORDER=\"0\" CELLBORDER=\"1\" CELLSPACING=\"0\" CELLPADDING=\"3\">%ls</TABLE>>];\n",
741                 (unsigned long)pVisualElementImpl->GetPublic(),
742                 color,
743                 label.GetPointer()
744         );
745
746         fprintf(pFile, "%ls", output.GetPointer());
747
748
749         if (isPresentation)
750         {
751                 _EflNode* pEflNode = static_cast< _EflNode* >(pVisualElementImpl->GetSharedData().pNativeNode);
752                 Evas_Object* pEvasObject = reinterpret_cast< Evas_Object* >(pEflNode->GetGroupContainer());
753
754                 fprintf(pFile, "N%lx -> N%lx [dir=none, style=\"dotted\", label=native]; \n",
755                         (unsigned long)pVisualElementImpl->GetPublic(),
756                         (unsigned long)pEvasObject
757                 );
758
759                 if (pVisualElementImpl->__pModel && pVisualElementImpl->__pModel->GetPublic() &&
760                         pVisualElementImpl->__pPresentation && pVisualElementImpl->__pPresentation->GetPublic())
761                 {
762                         fprintf(pFile, "N%lx -> N%lx [style=\"dotted\"]; \n",
763                                 (unsigned long)pVisualElementImpl->__pModel->GetPublic(),
764                                 (unsigned long)pVisualElementImpl->__pPresentation->GetPublic()
765                         );
766                 }
767         }
768 }
769
770 void
771 _VeDebug::DumpVeTreeGraphI(FILE* pFile, _VisualElementImpl* pVisualElementImpl, int depth, int pos)
772 {
773         if (!pVisualElementImpl)
774         {
775                 return;
776         }
777
778         bool prevDebugEnabled = IsDebugEnabled();
779         SetDebugEnabled(true);
780
781         DumpVeObjectForGraphI(pFile, pVisualElementImpl, depth, pos);
782
783         for (int i = 0; i < pVisualElementImpl->__children.GetCount(); i++)
784         {
785                 _VisualElementImpl* pChild = pVisualElementImpl->__children.GetChildAt(i);
786                 DumpVeTreeGraphI(pFile, pChild, depth + 1, i);
787                 fprintf(pFile, "N%lx -> N%lx [style=\"solid,bold\"] \n",
788                         (unsigned long)pChild->GetPublic(),
789                         (unsigned long)pVisualElementImpl->GetPublic()
790                 );
791         }
792
793         SetDebugEnabled(prevDebugEnabled);
794 }
795
796 void
797 _VeDebug::DumpEvasTreeGraph(const char* pFilePath, VisualElement* pVisualElement)
798 {
799         _VisualElementImpl* pElement = null;
800
801         if (!pVisualElement)
802         {
803                 _DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
804                 if (pDisplayManager != null && pDisplayManager->GetRoot(0))
805                 {
806                         pElement = _VisualElementImpl::GetInstance(*pDisplayManager->GetRoot(0));
807                 }
808         }
809         else
810         {
811                 pElement = _VisualElementImpl::GetInstance(*pVisualElement);
812         }
813
814         if (!pElement)
815         {
816                 return;
817         }
818
819         FILE* pFile = fopen(pFilePath, "wt");
820         if (!pFile)
821         {
822                 return;
823         }
824
825         fprintf(pFile, "digraph VisualElementDump {\n");
826         fprintf(pFile, "node [shape=plaintext, fontsize=10.0];\n");
827         fprintf(pFile, "edge [fontsize=10.0];\n");
828         //fprintf(pFile, "rankdir = TB;\n");
829         fprintf(pFile, "rankdir = BT;\n");
830         fprintf(pFile, "\n");
831
832
833         bool prevDebugEnabled = IsDebugEnabled();
834         SetDebugEnabled(true);
835
836
837         _EflNode* pEflNode = static_cast< _EflNode* >(pElement->GetSharedData().pNativeNode);
838         Evas_Object* pEvasObject = reinterpret_cast< Evas_Object* >(pEflNode->GetGroupContainer());
839
840         fprintf(pFile, "subgraph cluster_evas {\n");
841         fprintf(pFile, "clusterrank = local;\n");
842         fprintf(pFile, "fontsize = 30.0;\n");
843         fprintf(pFile, "label = \"Evas Object\";\n");
844         DumpEvasTreeGraphI(pFile, pEvasObject, 0, 0);
845         fprintf(pFile, "}\n");
846
847         fprintf(pFile, "subgraph cluster_model {\n");
848         fprintf(pFile, "clusterrank = local;\n");
849         fprintf(pFile, "fontsize = 30.0;\n");
850         fprintf(pFile, "label = \"Model\";\n");
851         DumpVeTreeGraphI(pFile, pElement->__pModel, 0, 0);
852         fprintf(pFile, "}\n");
853
854         fprintf(pFile, "subgraph cluster_presentation {\n");
855         fprintf(pFile, "clusterrank = local;\n");
856         fprintf(pFile, "fontsize = 30.0;\n");
857         fprintf(pFile, "label = \"Presentation\";\n");
858         DumpVeTreeGraphI(pFile, pElement->__pPresentation, 0, 0);
859         fprintf(pFile, "}\n");
860
861         fprintf(pFile, "\n");
862
863         SetDebugEnabled(prevDebugEnabled);
864
865         fprintf(pFile, "}\n\n");
866
867         fclose(pFile);
868 }
869
870 void
871 _VeDebug::DumpAllEvas(void)
872 {
873         Eina_List*      pEvasObjects = null;
874         void* pObject = null;
875         Evas_Object* pEvasObject = null;
876 //      int w, h;
877
878         if (GetEcoreEvasMgr() && GetEcoreEvasMgr()->GetEcoreEvas() && GetEcoreEvasMgr()->GetEcoreEvas()->GetEvas())
879         {
880 //              evas_output_size_get(GetEcoreEvasMgr()->GetEcoreEvas()->GetEvas(), &w, &h);
881
882                 pEvasObjects = evas_objects_in_rectangle_get(
883                         GetEcoreEvasMgr()->GetEcoreEvas()->GetEvas(),
884 //                      0, 0, w, h,
885                         -99999, -99999, 99999 * 2, 99999 * 2,
886                         1, 1
887                 );
888         }
889
890         if (!pEvasObjects)
891         {
892                 return;
893         }
894
895         VeLog(NID_UI_ANIM, "--------------------------[EVAS ALL DUMP START]-----------------------------");
896
897         pEvasObject = null;
898         EINA_LIST_FREE(pEvasObjects, pObject)
899         {
900                 if (likely(pObject))
901                 {
902                         pEvasObject = (Evas_Object*)pObject;
903
904                         Tizen::Base::String type(evas_object_type_get(pEvasObject));
905
906                         char logMessage[1024];
907                         int iw = 0;
908                         int ih = 0;
909                         int ox = 0;
910                         int oy = 0;
911                         int ow = 0;
912                         int oh = 0;
913                         int red = 0;
914                         int green = 0;
915                         int blue = 0;
916                         int alpha = 0;
917                         int argb = 0;
918                         Evas_Object* pSource = NULL;
919                         if (type == "image")
920                         {
921                                 pSource = evas_object_image_source_get(pEvasObject);
922                                 evas_object_image_size_get(pEvasObject, &iw, &ih);
923                         }
924                         evas_object_geometry_get(pEvasObject, &ox, &oy, &ow, &oh);
925                         evas_object_color_get(pEvasObject, &red, &green, &blue, &alpha);
926                         argb = (((alpha << 24) & 0xff000000) | ((red << 16) & 0x00ff0000) | ((green << 8) & 0x0000ff00) | (blue & 0x000000ff));
927                         bool showState = evas_object_visible_get(pEvasObject);
928
929                         snprintf(logMessage, sizeof(logMessage), " - type=%ls[%p] bounds=[%d:%d ~ %d:%d] imgsize=[%d:%d] show=%s color=%08X source=%p",
930                                 type.GetPointer(), pEvasObject, ox, oy, ox + ow, oy + oh, iw, ih, (showState ? "visible" : "invisible"), argb, pSource);
931
932                         VeLog(NID_UI_ANIM, "%s", logMessage);
933                 }
934         }
935
936         VeLog(NID_UI_ANIM, "--------------------------[EVAS ALL DUMP END]-----------------------------");
937 }
938
939 void
940 _VeDebug::PrintVeTree(_VisualElementImpl* pElement, int depth, unsigned int remainingChild)
941 {
942         static Tizen::Base::String output = "";
943         Tizen::Base::String item = "";
944         Tizen::Base::String surface = "";
945         Tizen::Base::String name = "";
946
947         if (!pElement)
948         {
949                 _DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
950                 if (pDisplayManager != null && pDisplayManager->GetRoot(0))
951                 {
952                         pElement = _VisualElementImpl::GetInstance(*pDisplayManager->GetRoot(0));
953                 }
954         }
955
956         if (!pElement)
957         {
958                 return;
959         }
960
961
962         bool prevDebugEnabled = IsDebugEnabled();
963         SetDebugEnabled(true);
964
965         if (pElement->GetSharedData().pSurface)
966         {
967                 surface = "(S)";
968         }
969
970         if (pElement->GetName().GetLength() <= 0)
971         {
972                 name.Format(255, L"%ls%#x", surface.GetPointer(), pElement);
973         }
974         else
975         {
976                 name.Format(255, L"%ls%ls", surface.GetPointer(), pElement->GetName().GetPointer());
977         }
978
979         // Print
980         for (int i = 1; i <= depth; i++)
981         {
982                 int childrenCount = 0;
983                 if (pElement->__pParent)
984                 {
985                         childrenCount = pElement->__pParent->__children.GetCount();
986                 }
987
988                 // only one child
989                 if (childrenCount <= 1)
990                 {
991                         if (remainingChild)
992                         {
993                                 remainingChild -= pow(10, depth - 1);
994                         }
995
996                         // Print name
997                         item.Format(255, L"-%-16ls", name.GetPointer());
998                         output.Append(item);
999                         break;
1000                 }
1001                 // first child
1002                 else if (DIGITATPOSITION(remainingChild, depth) == childrenCount)
1003                 {
1004                         remainingChild -= powf(10.0f, depth - 1);
1005
1006                         // Print name
1007                         item.Format(255, L"T%-16ls", name.GetPointer());
1008                         output.Append(item);
1009                         break;
1010                 }
1011                 // last child
1012                 else if (depth == i)
1013                 {
1014                         remainingChild -= powf(10.0f, depth - 1);
1015                         // Print name
1016                         item.Format(255, L"%s%-16ls", (DIGITATPOSITION(remainingChild, i) == 0) ? "L" : "L", name.GetPointer());
1017                         output.Append(item);
1018                 }
1019                 // other
1020                 else
1021                 {
1022                         item.Format(255, L"%s%-16ls", (DIGITATPOSITION(remainingChild, i) > 0) ? "|" : " ", L"");
1023                         output.Append(item);
1024                 }
1025         }
1026
1027         // Print children
1028         int count = pElement->__children.GetCount();
1029         if (count > 0)
1030         {
1031                 for (int i = 0; i < count; i++)
1032                 {
1033                         if (pElement->__children.GetChildAt(i))
1034                         {
1035                                 PrintVeTree(pElement->__children.GetChildAt(i), depth + 1, remainingChild + (count - i) * powf(10.0f, depth));
1036                         }
1037                 }
1038         }
1039         else
1040         {
1041                 //output.Append("\n");
1042                 // Print log
1043                 VeLog(NID_UI_ANIM, "%s", output.GetPointer());
1044                 output = "";
1045         }
1046
1047         SetDebugEnabled(prevDebugEnabled);
1048 }
1049
1050 void
1051 _VeDebug::DumpVeImage(_VisualElementImpl* pElement, const char* pathPrefix)
1052 {
1053         static int count = 0;
1054         char filename[2048] = {0, };
1055
1056         if (!pathPrefix)
1057         {
1058                 pathPrefix = "/tmp/";
1059         }
1060
1061         if (!pElement)
1062         {
1063                 _DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
1064                 if (pDisplayManager != null && pDisplayManager->GetRoot(0))
1065                 {
1066                         pElement = _VisualElementImpl::GetInstance(*pDisplayManager->GetRoot(0));
1067                 }
1068         }
1069
1070         if (!pElement)
1071         {
1072                 return;
1073         }
1074
1075
1076         Tizen::Base::String name = pElement->GetName();
1077         if (name.GetLength() > 0)
1078         {
1079                 sprintf(filename, "%sVE_%d_%ls_%08x.png", pathPrefix, count++, pElement->GetName().GetPointer(), (unsigned int)pElement->GetPresentation());
1080         }
1081         else
1082         {
1083                 sprintf(filename, "%sVE_%d_%08x.png", pathPrefix, count++, (unsigned int)pElement->GetPresentation());
1084         }
1085
1086         VisualElementSurface* pSurface = pElement->__pSharedData->pNativeNode->GetSurface();
1087         if (pSurface && _VisualElementSurfaceImpl::GetInstance(*pSurface))
1088         {
1089                 Evas_Object* pEvasObjectImage = null;
1090                 Evas_Object* pSource = evas_object_image_source_get((Evas_Object*)_VisualElementSurfaceImpl::GetInstance(*pSurface)->GetNativeHandle());
1091                 if (pSource)
1092                 {
1093                         pEvasObjectImage = pSource;
1094                 }
1095                 else
1096                 {
1097                         pEvasObjectImage = (Evas_Object*)_VisualElementSurfaceImpl::GetInstance(*pSurface)->GetNativeHandle();
1098                 }
1099
1100                 if (pEvasObjectImage)
1101                 {
1102                         VeLog(NID_UI_ANIM, "--------------------------[VE DUMP IMAGE START %#08x]---------------------------", pElement);
1103                         if (evas_object_image_save(pEvasObjectImage, filename, NULL, "quality=100 compress=9"))
1104                         {
1105                                 evas_object_image_save(pEvasObjectImage, "/tmp/lastimage.png", NULL, "quality=100 compress=9");
1106                                 VeLog(NID_UI_ANIM, "--------------------------[VE DUMP IMAGE END]-----------------------------");
1107                         }
1108                         else
1109                         {
1110                                 VeLog(NID_UI_ANIM, "--------------------------[VE DUMP IMAGE ERROR!!!]-----------------------------");
1111                         }
1112                 }
1113         }
1114 }
1115
1116 void
1117 _VeDebug::DumpAllVeImages(_VisualElementImpl* pElement, const char* pathPrefix)
1118 {
1119         if (!pElement)
1120         {
1121                 _DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
1122                 if (pDisplayManager != null && pDisplayManager->GetRoot(0))
1123                 {
1124                         pElement = _VisualElementImpl::GetInstance(*pDisplayManager->GetRoot(0));
1125                 }
1126         }
1127
1128         if (pElement == null)
1129         {
1130                 return;
1131         }
1132
1133         DumpVeImage(pElement, pathPrefix);
1134
1135         int count = pElement->__children.GetCount();
1136         for (int i = 0; i < count; i++)
1137         {
1138                 if (pElement->__children.GetChildAt(i))
1139                 {
1140                         DumpAllVeImages(pElement->__children.GetChildAt(i), pathPrefix);
1141                 }
1142         }
1143 }
1144
1145 void
1146 _VeDebug::ReflushAll(_VisualElementImpl* pElement, int depth)
1147 {
1148         pElement->SetFlushNeeded();
1149
1150         int count = pElement->__children.GetCount();
1151         for (int i = 0; i < count; i++)
1152         {
1153                 ReflushAll(pElement->__children.GetChildAt(i), depth + 1);
1154         }
1155
1156         if (depth == 0)
1157         {
1158                 _EflNode* pEflNode = dynamic_cast< _EflNode* >(pElement->__pSharedData->pNativeNode);
1159                 if (pEflNode != null)
1160                 {
1161                         ecore_evas_manual_render(ecore_evas_ecore_evas_get(pEflNode->GetEvas()));
1162                 }
1163         }
1164 }
1165
1166
1167 }}}             // Tizen::Ui::Animations
1168
1169
1170 extern "C" _OSP_EXPORT_ void
1171 DumpVeTree(void)
1172 {
1173         Tizen::Ui::Animations::_DisplayManager* pDisplayManager = Tizen::Ui::Animations::_DisplayManager::GetInstance();
1174
1175         for (int i = 0; i < pDisplayManager->GetRootCount(); i++)
1176         {
1177                 Tizen::Ui::Animations::_VisualElementImpl* pVisualElementImpl = Tizen::Ui::Animations::_VisualElementImpl::GetInstance(*pDisplayManager->GetRoot(i));
1178                 if (pVisualElementImpl)
1179                 {
1180                         Tizen::Ui::Animations::_VeDebug::DumpVeTree(pVisualElementImpl, 0);
1181                 }
1182         }
1183 }
1184
1185 extern "C" _OSP_EXPORT_ void
1186 DumpEvasTree(void)
1187 {
1188         Tizen::Ui::Animations::_DisplayManager* pDisplayManager = Tizen::Ui::Animations::_DisplayManager::GetInstance();
1189
1190         for (int i = 0; i < pDisplayManager->GetRootCount(); i++)
1191         {
1192                 Tizen::Ui::Animations::_VisualElementImpl* pVisualElementImpl = Tizen::Ui::Animations::_VisualElementImpl::GetInstance(*pDisplayManager->GetRoot(i));
1193                 if (pVisualElementImpl)
1194                 {
1195                         Tizen::Ui::Animations::_VeDebug::DumpEvasTree(pVisualElementImpl, 0);
1196                 }
1197         }
1198 }
1199
1200 extern "C" _OSP_EXPORT_ void
1201 DumpAllVeImages(void)
1202 {
1203         Tizen::Ui::Animations::_DisplayManager* pDisplayManager = Tizen::Ui::Animations::_DisplayManager::GetInstance();
1204
1205         for (int i = 0; i < pDisplayManager->GetRootCount(); i++)
1206         {
1207                 Tizen::Ui::Animations::_VisualElementImpl* pVisualElementImpl = Tizen::Ui::Animations::_VisualElementImpl::GetInstance(*pDisplayManager->GetRoot(i));
1208                 if (pVisualElementImpl)
1209                 {
1210                         Tizen::Ui::Animations::_VeDebug::DumpAllVeImages(pVisualElementImpl, 0);
1211                 }
1212         }
1213 }
1214
1215 extern "C" _OSP_EXPORT_ void
1216 DumpAllEvas(void)
1217 {
1218         Tizen::Ui::Animations::_VeDebug::DumpAllEvas();
1219 }
1220
1221 extern "C" _OSP_EXPORT_ void
1222 DumpEvasTreeGraph(void)
1223 {
1224         Tizen::Ui::Animations::_DisplayManager* pDisplayManager = Tizen::Ui::Animations::_DisplayManager::GetInstance();
1225
1226         for (int i = 0; i < pDisplayManager->GetRootCount(); i++)
1227         {
1228                 char filePath[256];
1229                 snprintf(filePath, sizeof(filePath), "/tmp/graph_%d.dot", i);
1230                 Tizen::Ui::Animations::_VeDebug::DumpEvasTreeGraph(filePath, pDisplayManager->GetRoot(i));
1231         }
1232 }
1233
1234 #ifdef  __i386__
1235 extern "C" _OSP_EXPORT_ void
1236 DebugAnimBreak(void)
1237 {
1238         asm volatile ("int $3\n");
1239 }
1240 #endif
1241
1242
1243 #endif
1244