/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// Enable debug log for test coverage
#define DEBUG_ENABLED 1
-#include "dali-scene3d/public-api/loader/string-callback.h"
#include <dali-test-suite-utils.h>
#include <string_view>
+#include "dali-scene3d/public-api/loader/string-callback.h"
using namespace Dali;
using namespace Dali::Scene3D::Loader;
namespace
{
-
char sBuffer[64];
void TestLogFunction(Integration::Log::DebugPriority level, std::string& str)
snprintf(sBuffer, sizeof(sBuffer), "%d: %s", level, str.c_str());
}
-}
+} // namespace
int UtcDaliUtilsDefaultStringCallback(void)
{
InstallLogFunction(TestLogFunction);
DefaultErrorCallback("Hello world!");
- DALI_TEST_EQUAL(std::string(sBuffer), "2: string-callback.cpp: DefaultErrorCallback(28) > Hello world!");
+ DALI_TEST_EQUAL(std::string(sBuffer), "3: string-callback.cpp: DefaultErrorCallback(28) > Hello world!");
END_TEST;
}
{
switch(level)
{
- case Dali::Integration::Log::DebugInfo:
+ case Dali::Integration::Log::DEBUG:
+ fprintf(stderr, "DEBUG: %s", message.c_str());
+ break;
+ case Dali::Integration::Log::INFO:
fprintf(stderr, "INFO: %s", message.c_str());
break;
- case Dali::Integration::Log::DebugWarning:
+ case Dali::Integration::Log::WARNING:
fprintf(stderr, "WARN: %s", message.c_str());
break;
- case Dali::Integration::Log::DebugError:
+ case Dali::Integration::Log::ERROR:
fprintf(stderr, "ERROR: %s", message.c_str());
break;
default:
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// currently not called from code so compiler will optimize these away, kept here for future debugging
#define FLEX_CONTAINER_TAG "DALI Toolkit::FlexContainer "
-#define FC_LOG(fmt, args, ...) Debug::LogMessageWithFunctionLine(Debug::DebugInfo, FLEX_CONTAINER_TAG fmt, ##args)
+#define FC_LOG(fmt, args, ...) Debug::LogMessageWithFunctionLine(Debug::INFO, FLEX_CONTAINER_TAG fmt, ##args)
// #define FLEX_CONTAINER_DEBUG 1
#if defined(FLEX_CONTAINER_DEBUG)
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
//#define ENABLED_SCROLL_STATE_LOGGING
#ifdef ENABLED_SCROLL_STATE_LOGGING
-#define DALI_LOG_SCROLL_STATE(format, ...) Dali::Integration::Log::LogMessageWithFunctionLine(Dali::Integration::Log::DebugInfo, "%s:%d " format "\n", __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
+#define DALI_LOG_SCROLL_STATE(format, ...) Dali::Integration::Log::LogMessageWithFunctionLine(Dali::Integration::Log::INFO, "%s:%d " format "\n", __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
#define DALI_LOG_SCROLL_STATE(format, ...)
#endif
Dali::Vector2 GetPosition(Dali::Actor actor)
{
- Vector2 screenPosition = actor.GetProperty<Vector2>(Actor::Property::SCREEN_POSITION);
- Vector3 size = actor.GetCurrentProperty<Vector3>(Actor::Property::SIZE) * actor.GetCurrentProperty<Vector3>(Actor::Property::WORLD_SCALE);
- bool positionUsesAnchorPoint = actor.GetProperty<bool>(Actor::Property::POSITION_USES_ANCHOR_POINT);
- Vector3 anchorPointOffSet = size * (positionUsesAnchorPoint ? actor.GetCurrentProperty<Vector3>(Actor::Property::ANCHOR_POINT) : AnchorPoint::TOP_LEFT);
- Vector2 position = Vector2(screenPosition.x - anchorPointOffSet.x, screenPosition.y - anchorPointOffSet.y);
+ Vector2 screenPosition = actor.GetProperty<Vector2>(Actor::Property::SCREEN_POSITION);
+ Vector3 size = actor.GetCurrentProperty<Vector3>(Actor::Property::SIZE) * actor.GetCurrentProperty<Vector3>(Actor::Property::WORLD_SCALE);
+ bool positionUsesAnchorPoint = actor.GetProperty<bool>(Actor::Property::POSITION_USES_ANCHOR_POINT);
+ Vector3 anchorPointOffSet = size * (positionUsesAnchorPoint ? actor.GetCurrentProperty<Vector3>(Actor::Property::ANCHOR_POINT) : AnchorPoint::TOP_LEFT);
+ Vector2 position = Vector2(screenPosition.x - anchorPointOffSet.x, screenPosition.y - anchorPointOffSet.y);
return position;
}
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// currently not called from code so compiler will optimize these away, kept here for future debugging
#define TABLEVIEW_TAG "DALI Toolkit::TableView "
-#define TV_LOG(fmt, args, ...) Debug::LogMessageWithFunctionLine(Debug::DebugInfo, TABLEVIEW_TAG fmt, ##args)
+#define TV_LOG(fmt, args, ...) Debug::LogMessageWithFunctionLine(Debug::INFO, TABLEVIEW_TAG fmt, ##args)
//#define TABLEVIEW_DEBUG 1
#if defined(TABLEVIEW_DEBUG)
#define DALI_TOOLKIT_IMAGE_VISUAL_PROPERTIES_H
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* @brief The policy to determine when an image should no longer be cached.
* @details Name "releasePolicy", Type ReleasePolicy::Type (Property::INTEGER) or Property::STRING
* @SINCE_1_3_5
- * @note Default ReleasePolicy::DESTROYED
+ * @note Default ReleasePolicy::DETACHED
* @see ReleasePolicy::Type
*/
RELEASE_POLICY,