Adding multi-window support to DumpVeLayout()
authorBongjoo Seo <bongjoo.seo@samsung.com>
Sat, 23 Mar 2013 07:39:16 +0000 (16:39 +0900)
committerBongjoo Seo <bongjoo.seo@samsung.com>
Sat, 23 Mar 2013 07:39:16 +0000 (16:39 +0900)
Change-Id: I36e9aa5251eba86860d57a64b851102be2f47f12
Signed-off-by: Bongjoo Seo <bongjoo.seo@samsung.com>
src/ui/animations/FUiAnim_Debug.cpp
src/ui/animations/FUiAnim_EflLayer.cpp

index 8e32cc5..8d138a9 100644 (file)
@@ -57,6 +57,7 @@
 #endif
 
 #include "FUiAnim_EflNode.h"
+#include "FUiAnim_EflLayer.h"
 #include "FUiAnim_AnimationManager.h"
 #include "FUiAnim_DisplayManager.h"
 
@@ -266,11 +267,20 @@ _VeDebug::DumpVisualElementLayout(_VisualElementImpl* pElement, FILE* pFile)
                                evas_object_geometry_get(pEvasObject, &absolute.x, &absolute.y, &absolute.width, &absolute.height);
 
                                FloatRectangle realBounds = pElement->__bounds;
+                               _RootVisualElement* pRoot = dynamic_cast<_RootVisualElement*>(pElement->__pPublicInstance);
+                               if (pRoot)
+                               {
+                                       _NativeLayer* pLayer = pRoot->GetNativeLayer();
+                                       FloatRectangle rect = pLayer->GetBounds();
+                                       realBounds.x += rect.x;
+                                       realBounds.y += rect.y;
+                               }
                                _VisualElementCoordinateSystem::ConvertDimensionToPhysical(realBounds.width, realBounds.height);
                                _VisualElementCoordinateSystem::MakeIntegralPoint(realBounds.width, realBounds.height, relative.width, relative.height);
                                _VisualElementCoordinateSystem::ConvertPointToPhysical(realBounds.x, realBounds.y);
                                _VisualElementCoordinateSystem::MakeIntegralPoint(realBounds.x, realBounds.y, relative.x, relative.y);
 
+
                                bool showState = pElement->GetShowState();
                                bool visible = pElement->IsVisible();
                                bool evasVisible = evas_object_visible_get(pEvasObject);
@@ -298,7 +308,7 @@ _VeDebug::DumpVisualElementLayout(_VisualElementImpl* pElement, FILE* pFile)
                                        }
 
                                        // save the image file
-                                       strncpy(savePath, "/tmp/", 5);
+                                       strncpy(savePath, "/tmp/layout/", 12);
                                        strncat(savePath, filename, strlen(filename));
                                        evas_object_image_save(pEvasObjectImage, savePath, NULL, "quality=100 compress=9");
 
@@ -1467,7 +1477,9 @@ DumpVeLayout(void)
 {
        Tizen::Ui::Animations::_DisplayManager* pDisplayManager = Tizen::Ui::Animations::_DisplayManager::GetInstance();
 
-       FILE* pFile = fopen("/tmp/layout.html", "w");
+       system("rm -rf /tmp/layout");
+       system("mkdir /tmp/layout");
+       FILE* pFile = fopen("/tmp/layout/layout.html", "w");
        fprintf(pFile, "<body>\n");
        fprintf(pFile, "<div style='position:absolute; left:0px; top:0px;'>Model</div>\n");
        fprintf(pFile, "<div style='position:absolute; left:0px; top:30px;'>\n");
index 5ab7676..819a6a5 100644 (file)
@@ -458,7 +458,9 @@ _EflLayer::GetBounds(void) const
                int y = 0;
                int w = 0;
                int h = 0;
-               evas_object_geometry_get(_pWindow, &x, &y, &w, &h);
+
+               evas_object_geometry_get(_pWindow, null, null, &w, &h);
+               elm_win_screen_position_get(_pWindow, &x, &y);
 
                return FloatRectangle(x, y, w, h);
        }