#include <dali/internal/window-system/common/event-handler.h>
#include <dali/internal/window-system/common/window-impl.h>
#include <dali/internal/window-system/common/window-render-surface.h>
+#include <dali/internal/window-system/common/window-system.h>
#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
#include <dali/internal/system/common/logging.h>
dpiHor = dpiVer = 0;
defaultWindow->GetSurface()->GetDpi(dpiHor, dpiVer);
-
- // set the DPI value for font rendering
- FontClient fontClient = FontClient::Get();
- fontClient.SetDpi(dpiHor, dpiVer);
+ Dali::Internal::Adaptor::WindowSystem::SetDpi(dpiHor, dpiVer);
// Initialize the thread controller
mThreadController->Initialize();
// INTERNAL INCLUDES
#include <dali/devel-api/common/singleton-service.h>
#include <dali/internal/text/text-abstraction/plugin/font-client-plugin-impl.h>
+#include <dali/internal/window-system/common/window-system.h>
#include <dali/devel-api/text-abstraction/glyph-info.h>
fontClientHandle = Dali::TextAbstraction::FontClient(new FontClient);
}
+ uint32_t horizontalDpi, verticalDpi;
+ fontClientHandle.GetDpi(horizontalDpi, verticalDpi);
+ if(horizontalDpi == 0u || verticalDpi == 0u)
+ {
+ horizontalDpi = verticalDpi = 0u;
+ Dali::Internal::Adaptor::WindowSystem::GetDpi(horizontalDpi, verticalDpi);
+ fontClientHandle.SetDpi(horizontalDpi, verticalDpi);
+ }
+
service.Register(typeid(fontClientHandle), fontClientHandle);
}
}
--- /dev/null
+/*
+ * Copyright (c) 2023 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL HEADERS
+#include <dali/internal/window-system/common/window-system.h>
+
+// EXTERNAL_HEADERS
+#include <cstdio>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+namespace WindowSystem
+{
+namespace
+{
+static uint32_t gDpiHorizontal = 0u;
+static uint32_t gDpiVertical = 0u;
+} // unnamed namespaces
+
+void SetDpi(uint32_t dpiHorizontal, uint32_t dpiVertical)
+{
+ gDpiHorizontal = dpiHorizontal;
+ gDpiVertical = dpiVertical;
+}
+
+void GetDpi(uint32_t& dpiHorizontal, uint32_t& dpiVertical)
+{
+ dpiHorizontal = gDpiHorizontal;
+ dpiVertical = gDpiVertical;
+}
+
+} // namespace WindowSystem
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
+
+#pragma GCC diagnostic pop
void Shutdown();
/**
+ * @brief Set the DPI of the target screen.
+ *
+ * @note Multiple screens are not currently supported.
+ * @param[in] horizontalDpi The horizontal resolution in DPI.
+ * @param[in] verticalDpi The vertical resolution in DPI.
+ */
+void SetDpi(uint32_t dpiHorizontal, uint32_t dpiVertical);
+
+/**
+ * @brief Retrieves the DPI previously set to the target screen.
+ *
+ * @note Multiple screens are not currently supported.
+ * @param[out] horizontalDpi The horizontal resolution in DPI.
+ * @param[out] verticalDpi The vertical resolution in DPI.
+ */
+void GetDpi(uint32_t& dpiHorizontal, uint32_t& dpiVertical);
+
+/**
* @brief Get the screen size
*/
void GetScreenSize(int32_t& width, int32_t& height);
SET( adaptor_window_system_common_src_files
${adaptor_window_system_dir}/common/display-connection.cpp
${adaptor_window_system_dir}/common/event-handler.cpp
+ ${adaptor_window_system_dir}/common/gl-window-impl.cpp
+ ${adaptor_window_system_dir}/common/gl-window-render-thread.cpp
${adaptor_window_system_dir}/common/native-render-surface-factory.cpp
${adaptor_window_system_dir}/common/orientation-impl.cpp
${adaptor_window_system_dir}/common/window-base.cpp
${adaptor_window_system_dir}/common/window-impl.cpp
${adaptor_window_system_dir}/common/window-render-surface.cpp
- ${adaptor_window_system_dir}/common/gl-window-impl.cpp
- ${adaptor_window_system_dir}/common/gl-window-render-thread.cpp
+ ${adaptor_window_system_dir}/common/window-system.cpp
)
# module: window-system, backend: tizen-wayland