snprintf(logMessage, LOG_LEN_MAX, "%s%*s<div id=\"%#x\" style=\"%s\" title=\"%s\">\n", endTag, depth*4, " ", (unsigned int)pElement, style, title);
fputs(logMessage,pFile);
}
+
+ Eina_List *pEvasObjects = evas_object_smart_members_get(pNativeNode->__pNativeSmartObject);
+ void* pObject;
+ EINA_LIST_FREE(pEvasObjects, pObject)
+ {
+ pEvasObject = (Evas_Object*)pObject;
+ if (pEvasObject)
+ {
+ Dimension imageSize;
+ Rectangle absolute;
+ Rectangle relative;
+ Rectangle filled;
+ int red = 0;
+ int green = 0;
+ int blue = 0;
+ int alpha = 0;
+ unsigned int rgb = 0;
+ const char* eoType = evas_object_type_get(pEvasObject);
+ char style1[LOG_LEN_MAX] = {0, };
+ char title1[LOG_LEN_MAX] = {0, };
+ char style[LOG_LEN_MAX] = {0, };
+ char title[LOG_LEN_MAX] = {0, };
+
+ if (!pElement->GetName().IsEmpty())
+ {
+ ByteBuffer* pByteBuffer(Tizen::Base::Utility::StringUtil::StringToUtf8N(pElement->GetName()));
+ evas_object_name_set(pEvasObject, (const char*)pByteBuffer->GetPointer());
+ delete pByteBuffer;
+ }
+
+ 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);
+
+ if (!strcmp(eoType, "image"))
+ {
+ char filename[LOG_LEN_MAX/4] = {0, };
+ char savePath[LOG_LEN_MAX/2] = {0, };
+ Evas_Object* pEvasObjectImage = pEvasObject;
+ Evas_Object* pSource = evas_object_image_source_get(pEvasObject);
+ if (pSource)
+ {
+ pEvasObjectImage = pSource;
+ }
+ evas_object_image_size_get(pEvasObjectImage, &imageSize.width, &imageSize.height);
+ evas_object_image_fill_get(pEvasObject, &filled.x, &filled.y, &filled.width, &filled.height);
+
+ if (name.GetLength() > 0)
+ {
+ sprintf(filename, "VE_%d_%ls_%08x.png", count, pElement->GetName().GetPointer(), (unsigned int)pElement->GetPresentation());
+ }
+ else
+ {
+ sprintf(filename, "VE_%d_%08x.png", count, (unsigned int)pElement->GetPresentation());
+ }
+
+ // save the image file
+ strncpy(savePath, "/tmp/layout/", 12);
+ strncat(savePath, filename, strlen(filename));
+ evas_object_image_save(pEvasObjectImage, savePath, NULL, "quality=100 compress=9");
+
+ snprintf(style1, LOG_LEN_MAX, "background-image:url(%s); ", filename);
+ snprintf(title1, LOG_LEN_MAX, "%s\nImage: w=%d h=%d\nEvas Absolute Bounds: x=%d y=%d w=%d h=%d\nVE Relative Bounds: x=%d y=%d w=%d h=%d\nFilled Bounds: x=%d y=%d w=%d h=%d\n",
+ filename, relative.width, relative.height, absolute.x, absolute.y, absolute.width, absolute.height, relative.x, relative.y, relative.width, relative.height, filled.x, filled.y, filled.width, filled.height);
+ }
+ else
+ {
+ evas_object_color_get(pEvasObject, &red, &green, &blue, &alpha);
+ rgb = (((red << 16) & 0x00ff0000) | ((green << 8) & 0x0000ff00) | (blue & 0x000000ff));
+ if (alpha)
+ {
+ snprintf(style1, LOG_LEN_MAX, "background-color:#%06x; ", rgb);
+ }
+ else
+ {
+ //snprintf(style1, LOG_LEN_MAX, "pointer-events: none; ");
+ }
+ snprintf(title1, LOG_LEN_MAX, "No Surface\nColor: #%06x Alpha: %02x\nEvas Absolute Bounds: x=%d y=%d w=%d h=%d\nVE Relative Bounds: x=%d y=%d w=%d h=%d\n", rgb, alpha, absolute.x, absolute.y, absolute.width, absolute.height, relative.x, relative.y, relative.width, relative.height);
+ }
+
+ snprintf(title, LOG_LEN_MAX, "%s\nname=%ls\nshow=%s visible=%s evas=%s\nmodel=%#x\npresentation=%#x\nparent=%#x\nevas_object=%#x\nclip-source=%#x",
+ title1, name.GetPointer(), showState ? "true" : "false", visible ? "true" : "false", evasVisible ? "show" : "hide", (unsigned int)pModel, (unsigned int)pPresentation, (unsigned int)pElement->GetParent(), (unsigned int)pEvasObject, (unsigned int)pElement->GetClipSource());
+ snprintf(style, LOG_LEN_MAX, "%sopacity:%.2f; position:absolute; left:%dpx; top:%dpx; width:%dpx; height:%dpx; border:1px dotted #aaaaaa; z-index:%d; display:%s;%s",
+ style1, (pElement->__opacity), relative.x, relative.y, relative.width, relative.height, depth, (showState ? "block" : "none"), (pElement->__isClipChildren ? " overflow:hidden;" : ""));
+
+ snprintf(logMessage, LOG_LEN_MAX, "%s%*s<div id=\"%#x\" style=\"%s\" title=\"%s\">\n", endTag, depth*4, " ", (unsigned int)pElement, style, title);
+ fputs(logMessage,pFile);
+ }
+ }
}
}
}
void
-_VeDebug::DumpAllEvas(void)
+_VeDebug::DumpAllEvas(Evas* pEvas)
{
Eina_List* pEvasObjects = null;
void* pObject = null;
Evas_Object* pEvasObject = null;
// int w, h;
- if (GetEcoreEvasMgr() && GetEcoreEvasMgr()->GetEcoreEvas() && GetEcoreEvasMgr()->GetEcoreEvas()->GetEvas())
+ if (pEvas)
{
-// evas_output_size_get(GetEcoreEvasMgr()->GetEcoreEvas()->GetEvas(), &w, &h);
-
- pEvasObjects = evas_objects_in_rectangle_get(
- GetEcoreEvasMgr()->GetEcoreEvas()->GetEvas(),
-// 0, 0, w, h,
+ pEvasObjects = evas_objects_in_rectangle_get(pEvas,
-99999, -99999, 99999 * 2, 99999 * 2,
1, 1
);
}
void
+_VeDebug::DumpAllEvasImages(Evas *pEvas)
+{
+ Eina_List* pEvasObjects = null;
+ void* pObject = null;
+ Evas_Object* pEvasObject = null;
+ static int count = 0;
+ char filename[2048] = {0, };
+ const char* pathPrefix = "/tmp/";
+
+ if (pEvas)
+ {
+ pEvasObjects = evas_objects_in_rectangle_get(pEvas,
+ -99999, -99999, 99999 * 2, 99999 * 2,
+ 1, 1
+ );
+ }
+
+ if (!pEvasObjects)
+ {
+ return;
+ }
+
+ VeLog(NID_UI_ANIM, "--------------------------[EVAS ALL DUMP IMAGE START]-----------------------------");
+
+ pEvasObject = null;
+ EINA_LIST_FREE(pEvasObjects, pObject)
+ {
+ if (likely(pObject))
+ {
+ pEvasObject = (Evas_Object*)pObject;
+
+ Tizen::Base::String type(evas_object_type_get(pEvasObject));
+
+ if (type == "image")
+ {
+ Evas_Object* pSource = evas_object_image_source_get(pEvasObject);
+ pEvasObject = pSource ? pSource : pEvasObject;
+
+ if (pEvasObject)
+ {
+ sprintf(filename, "%sEVAS_%d_%08x.png", pathPrefix, count++, (unsigned int)pEvasObject);
+
+ VeLog(NID_UI_ANIM, "--------------------------[VE DUMP IMAGE START %#08x]---------------------------", (unsigned int)pEvasObject);
+ if (evas_object_image_save(pEvasObject, filename, NULL, "quality=100 compress=9"))
+ {
+ evas_object_image_save(pEvasObject, "/tmp/lastimage.png", NULL, "quality=100 compress=9");
+ VeLog(NID_UI_ANIM, "--------------------------[VE DUMP IMAGE END]-----------------------------");
+ }
+ else
+ {
+ VeLog(NID_UI_ANIM, "--------------------------[VE DUMP IMAGE ERROR!!!]-----------------------------");
+ }
+ }
+ }
+ }
+ }
+
+ VeLog(NID_UI_ANIM, "--------------------------[EVAS ALL DUMP IMAGE END]-----------------------------");
+}
+
+void
_VeDebug::PrintVeTree(_VisualElementImpl* pElement, int depth, unsigned int remainingChild)
{
static Tizen::Base::String output = "";
extern "C" _OSP_EXPORT_ void
DumpAllEvas(void)
{
- Tizen::Ui::Animations::_VeDebug::DumpAllEvas();
+ Tizen::Ui::Animations::_DisplayManager* pDisplayManager = Tizen::Ui::Animations::_DisplayManager::GetInstance();
+
+ for (int i = 0; i < pDisplayManager->GetRootCount(); i++)
+ {
+ Tizen::Ui::Animations::_RootVisualElement* pRoot = pDisplayManager->GetRoot(i);
+ if (!pRoot)
+ {
+ continue;
+ }
+ Tizen::Ui::Animations::_EflLayer* pLayer = dynamic_cast<Tizen::Ui::Animations::_EflLayer*>(pRoot->GetNativeLayer());
+ if (!pLayer)
+ {
+ continue;
+ }
+ Evas* pEvas = pLayer->GetEvas();
+ if (!pEvas)
+ {
+ continue;
+ }
+ Tizen::Ui::Animations::_VeDebug::DumpAllEvas(pEvas);
+ }
+}
+
+extern "C" _OSP_EXPORT_ void
+DumpAllEvasImages(void)
+{
+ Tizen::Ui::Animations::_DisplayManager* pDisplayManager = Tizen::Ui::Animations::_DisplayManager::GetInstance();
+
+ for (int i = 0; i < pDisplayManager->GetRootCount(); i++)
+ {
+ Tizen::Ui::Animations::_RootVisualElement* pRoot = pDisplayManager->GetRoot(i);
+ if (!pRoot)
+ {
+ continue;
+ }
+ Tizen::Ui::Animations::_EflLayer* pLayer = dynamic_cast<Tizen::Ui::Animations::_EflLayer*>(pRoot->GetNativeLayer());
+ if (!pLayer)
+ {
+ continue;
+ }
+ Evas* pEvas = pLayer->GetEvas();
+ if (!pEvas)
+ {
+ continue;
+ }
+ Tizen::Ui::Animations::_VeDebug::DumpAllEvasImages(pEvas);
+ }
}
extern "C" _OSP_EXPORT_ void