#include <functional>
#include <memory>
+#include <unordered_map>
namespace Dali
{
DALI_TYPE_REGISTRATION_END()
// clang-format on
+std::unordered_map<Dali::WebEnginePlugin*, Dali::WeakHandle<Toolkit::WebView>>& GetPluginWebViewTable()
+{
+ static std::unordered_map<Dali::WebEnginePlugin*, Dali::WeakHandle<Toolkit::WebView>> pluginWebViewMap;
+ return pluginWebViewMap;
+}
} // namespace
-std::unordered_map<Dali::WebEnginePlugin*, Dali::WeakHandle<Toolkit::WebView>> WebView::mPluginWebViewMap;
-
WebView::WebView(const std::string& locale, const std::string& timezoneId)
: Control(ControlBehaviour(ACTOR_BEHAVIOUR_DEFAULT | DISABLE_STYLE_CHANGE_SIGNALS)),
mVisual(),
{
if(mWebEngine)
{
- auto iter = mPluginWebViewMap.find(mWebEngine.GetPlugin());
- if (iter != mPluginWebViewMap.end())
+ auto iter = GetPluginWebViewTable().find(mWebEngine.GetPlugin());
+ if (iter != GetPluginWebViewTable().end())
{
- mPluginWebViewMap.erase(iter);
+ GetPluginWebViewTable().erase(iter);
}
mWebEngine.Destroy();
}
Toolkit::WebView handle = Toolkit::WebView(*impl);
if (impl->GetPlugin())
{
- mPluginWebViewMap[impl->GetPlugin()] = handle;
+ GetPluginWebViewTable()[impl->GetPlugin()] = handle;
}
impl->Initialize();
return handle;
Toolkit::WebView handle = Toolkit::WebView(*impl);
if (impl->GetPlugin())
{
- mPluginWebViewMap[impl->GetPlugin()] = handle;
+ GetPluginWebViewTable()[impl->GetPlugin()] = handle;
}
impl->Initialize();
return handle;
Toolkit::WebView handle = Toolkit::WebView(*impl);
if (impl->GetPlugin())
{
- mPluginWebViewMap[impl->GetPlugin()] = handle;
+ GetPluginWebViewTable()[impl->GetPlugin()] = handle;
}
impl->Initialize();
return handle;
Toolkit::WebView WebView::FindWebView(Dali::WebEnginePlugin* plugin)
{
- auto iter = mPluginWebViewMap.find(plugin);
- if (iter != mPluginWebViewMap.end())
+ auto iter = GetPluginWebViewTable().find(plugin);
+ if (iter != GetPluginWebViewTable().end())
{
return iter->second.GetHandle();
}
#include <dali/public-api/images/image-operations.h>
#include <dali/public-api/object/property-notification.h>
#include <memory>
-#include <unordered_map>
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/controls/control-accessible.h>
Dali::Toolkit::WebView::WebViewScreenshotCapturedCallback mScreenshotCapturedCallback;
Dali::WebEnginePlugin::WebEngineFrameRenderedCallback mFrameRenderedCallback;
-
- static std::unordered_map<Dali::WebEnginePlugin*, Dali::WeakHandle<Toolkit::WebView>> mPluginWebViewMap;
};
} // namespace Internal
SignalFeedbackInfoContainer mSignalFeedbackInfoList;
};
-static const FeedbackStyleInfo DEFAULT_FEEDBACK_STYLE_INFO;
-
FeedbackStyle::FeedbackStyle()
{
mFeedback = Dali::FeedbackPlayer::Get();
}
else
{
+ static const FeedbackStyleInfo DEFAULT_FEEDBACK_STYLE_INFO;
return DEFAULT_FEEDBACK_STYLE_INFO;
}
}
{
namespace Text
{
-namespace
-{
-static const Vector<CharacterSpacingGlyphRun> EMPTY_CHARACTER_SPACING_GLYPH_RUNS;
-}
float GetGlyphCharacterSpacing(const GlyphIndex& index,
const Vector<CharacterSpacingGlyphRun>& characterSpacingGlyphRuns,
const float modelCharacterSpacing)
return characterSpacing;
}
-
-const Vector<CharacterSpacingGlyphRun>& GetEmptyCharacterSpacingGlyphRuns()
-{
- // This is needed to return a common empty vector for CharacterSpacingGlyphRun
- return EMPTY_CHARACTER_SPACING_GLYPH_RUNS;
-}
} // namespace Text
} // namespace Toolkit
-} // namespace Dali
\ No newline at end of file
+} // namespace Dali
float GetGlyphCharacterSpacing(const GlyphIndex& index,
const Vector<CharacterSpacingGlyphRun>& characterSpacingGlyphRuns,
const float modelCharacterSpacing);
-
-/**
- * @brief Create static empty vector and retrun it.
- *
- * @return The reference for the empty character-spacing glyph runs.
- */
-const Vector<CharacterSpacingGlyphRun>& GetEmptyCharacterSpacingGlyphRuns();
-
} // namespace Text
} // namespace Toolkit
} // namespace Dali
-#endif // DALI_TOOLKIT_TEXT_RENDERING_STYLES_CHARACTER_SPACING_HELPER_FUNCTIONS_H
\ No newline at end of file
+#endif // DALI_TOOLKIT_TEXT_RENDERING_STYLES_CHARACTER_SPACING_HELPER_FUNCTIONS_H
virtual const Vector<BoundedParagraphRun>& GetBoundedParagraphRuns() const = 0;
/**
- * @brief Retrieves the number of character-spacing glyph runs.
- *
- * @return The number of character-spacing glyph runs.
- */
- virtual Length GetNumberOfCharacterSpacingGlyphRuns() const = 0;
-
- /**
- * @brief Retrieves the reference for character-spacing glyph runs.
- *
- * @return The reference for character-spacing glyph runs.
- */
- virtual const Vector<CharacterSpacingGlyphRun>& GetCharacterSpacingGlyphRuns() const = 0;
-
- /**
* @brief Retrieves the strikethrough runs.
*
* @param[out] strikethroughRuns Pointer to a buffer where the strikethrough runs are copied.
return mImpl->mLogicalModel->GetBoundedParagraphRuns();
}
-Length View::GetNumberOfCharacterSpacingGlyphRuns() const
-{
- return (mImpl->mVisualModel) ? mImpl->mVisualModel->GetNumberOfCharacterSpacingGlyphRuns() : 0u;
-}
-
-const Vector<CharacterSpacingGlyphRun>& View::GetCharacterSpacingGlyphRuns() const
-{
- return (mImpl->mVisualModel) ? mImpl->mVisualModel->GetCharacterSpacingGlyphRuns() : GetEmptyCharacterSpacingGlyphRuns();
-}
-
float View::GetCharacterSpacing() const
{
- return (mImpl->mVisualModel) ? mImpl->mVisualModel->GetCharacterSpacing() : 0.f;
+ return mImpl->mVisualModel->GetCharacterSpacing();
}
const Character* View::GetTextBuffer() const
{
- return (mImpl->mVisualModel) ? mImpl->mLogicalModel->mText.Begin() : nullptr;
+ return mImpl->mLogicalModel->mText.Begin();
}
const Vector<CharacterIndex>& View::GetGlyphsToCharacters() const
virtual const Vector<BoundedParagraphRun>& GetBoundedParagraphRuns() const;
/**
- * @copydoc Dali::Toolkit::Text::ViewInterface::GetNumberOfCharacterSpacingGlyphRuns()
- */
- Length GetNumberOfCharacterSpacingGlyphRuns() const override;
-
- /**
- * @copydoc Dali::Toolkit::Text::ViewInterface::GetCharacterSpacingGlyphRuns()
- */
- const Vector<CharacterSpacingGlyphRun>& GetCharacterSpacingGlyphRuns() const override;
-
- /**
* @copydoc Dali::Toolkit::Text::ViewInterface::GetCharacterSpacing()
*/
float GetCharacterSpacing() const override;
{
namespace
{
-static constexpr float OPACITY_TRANSPARENT = 0.0f;
-
-const Dali::AlphaFunction DEFAULT_ALPHA_FUNCTION(Dali::AlphaFunction::DEFAULT);
-
-const Property::Map PROPERTY_MAP_INDEPENDENT_CONTROL{
- {Dali::Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER},
- {Dali::Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER},
- {Dali::Actor::Property::POSITION_USES_ANCHOR_POINT, true},
- {Dali::Actor::Property::INHERIT_POSITION, false},
- {Dali::Actor::Property::INHERIT_ORIENTATION, false},
- {Dali::Actor::Property::INHERIT_SCALE, false},
- {Dali::Actor::Property::COLOR_MODE, Dali::ColorMode::USE_OWN_COLOR},
-};
-
Property::Map GetOriginalProperties(Dali::Toolkit::Control control)
{
Property::Map propertyMap;
return propertyMap;
}
-
} // anonymous namespace
TransitionBasePtr TransitionBase::New()
}
TransitionBase::TransitionBase()
-: mAlphaFunction(DEFAULT_ALPHA_FUNCTION),
+: mAlphaFunction(Dali::AlphaFunction::DEFAULT),
mTimePeriod(TimePeriod(0.0f)),
mTransitionWithChild(false),
mMoveTargetChildren(false),
targetWorldTransform.GetTransformComponents(targetPosition, targetOrientation, targetScale);
Vector4 targetColor = DevelActor::GetWorldColor(mTarget);
- mTarget.SetProperties(PROPERTY_MAP_INDEPENDENT_CONTROL);
+ mTarget[Dali::Actor::Property::ANCHOR_POINT] = AnchorPoint::CENTER;
+ mTarget[Dali::Actor::Property::PARENT_ORIGIN] = ParentOrigin::CENTER;
+ mTarget[Dali::Actor::Property::POSITION_USES_ANCHOR_POINT] = true;
+ mTarget[Dali::Actor::Property::INHERIT_POSITION] = false;
+ mTarget[Dali::Actor::Property::INHERIT_ORIENTATION] = false;
+ mTarget[Dali::Actor::Property::INHERIT_SCALE] = false;
+ mTarget[Dali::Actor::Property::COLOR_MODE] = Dali::ColorMode::USE_OWN_COLOR;
+
mTarget[Dali::Actor::Property::POSITION] = targetPosition;
mTarget[Dali::Actor::Property::SCALE] = targetScale;
mTarget[Dali::Actor::Property::ORIENTATION] = targetOrientation;
{
namespace Internal
{
-namespace
-{
-const Dali::AlphaFunction DEFAULT_ALPHA_FUNCTION(Dali::AlphaFunction::DEFAULT);
-} // anonymous namespace
-
TransitionPtr Transition::New(Dali::Toolkit::Control source, Dali::Toolkit::Control destination, bool useDestinationTarget, TimePeriod timePeriod)
{
float delaySeconds = timePeriod.delaySeconds;
#else
#define LOG_CACHE
#endif
-
-static constexpr bool ENABLE_ORIENTATION_CORRECTION(true);
-
} // namespace
namespace Dali
{
const Vector4 FULL_TEXTURE_RECT(0.f, 0.f, 1.f, 1.f);
-// global string variable to caching complate vertex shader
-static std::string gVertexShader;
-
-// global string variable to caching complate fragment shader (no atlas)
-static std::string gFragmentShaderNoAtlas;
-
const int NATIVE_SHADER_TYPE_OFFSET = VisualFactoryCache::ShaderType::NATIVE_IMAGE_SHADER - VisualFactoryCache::ShaderType::IMAGE_SHADER;
// enum of required list when we select shader
std::string_view ImageVisualShaderFactory::GetVertexShaderSource()
{
+ // static string variable to cache complete vertex shader
+ static std::string gVertexShader;
if(gVertexShader.empty())
{
gVertexShader = Dali::Shader::GetVertexShaderPrefix() + SHADER_IMAGE_VISUAL_SHADER_VERT.data();
std::string_view ImageVisualShaderFactory::GetFragmentShaderSource()
{
+ // static string variable to cache complete fragment shader (no atlas)
+ static std::string gFragmentShaderNoAtlas;
if(gFragmentShaderNoAtlas.empty())
{
gFragmentShaderNoAtlas = Dali::Shader::GetFragmentShaderPrefix() + SHADER_IMAGE_VISUAL_SHADER_FRAG.data();
{
namespace
{
-// global string variable to caching complate vertex shader
-static std::string gVertexShader;
-
-// global string variable to caching complate fragment shader (no atlas)
-static std::string gFragmentShaderNoAtlas;
-
// enum of required list when we select shader
enum class TextVisualRequireFlag : uint32_t
{