/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * 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.
{
namespace
{
-const std::string DEFAULT_DEVICE_NAME = "";
+const char* DEFAULT_DEVICE_NAME = "";
const Device::Class::Type DEFAULT_DEVICE_CLASS = Device::Class::NONE;
const Device::Subclass::Type DEFAULT_DEVICE_SUBCLASS = Device::Subclass::NONE;
// Window Callbacks
/////////////////////////////////////////////////////////////////////////////////////////////////
+static bool EventWindowConfigureNotify(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
+{
+ WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
+ if(windowBase)
+ {
+ windowBase->OnConfigure(event);
+ }
+
+ return false;
+}
+
static bool EventWindowPropertyChanged(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
{
WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
if(mOwnSurface)
{
XDestroyWindow(WindowSystem::GetImplementation().GetXDisplay(), mWindow);
-
- /**** @todo Should not be destroyed here! ****/
- WindowSystem::Shutdown();
}
}
// if the surface is empty, create a new one.
if(surfaceId == 0)
{
- /**** @todo Should be created from somewhere else! ****/
- WindowSystem::Initialize();
-
// we own the surface about to created
mOwnSurface = true;
CreateWindow(positionSize, isTransparent);
void WindowBaseX::SetupEvents()
{
auto& windowSystem = WindowSystem::GetImplementation();
+ windowSystem.AddEventHandler(WindowSystemBase::Event::CONFIGURE_NOTIFY, EventWindowConfigureNotify, this);
windowSystem.AddEventHandler(WindowSystemBase::Event::PROPERTY_NOTIFY, EventWindowPropertyChanged, this);
windowSystem.AddEventHandler(WindowSystemBase::Event::DELETE_REQUEST, EventWindowDeleteRequest, this);
windowSystem.AddEventHandler(WindowSystemBase::Event::FOCUS_IN, EventWindowFocusIn, this);
return handled;
}
+void WindowBaseX::OnConfigure(WindowSystemBase::EventBase* event)
+{
+ auto configureEvent = static_cast<WindowSystemX::X11ConfigureNotifyEvent*>(event);
+ if(configureEvent->window == mWindow)
+ {
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Window::OnConfigureNotify\n");
+ Dali::PositionSize positionSize;
+ positionSize.x = configureEvent->x;
+ positionSize.y = configureEvent->y;
+ positionSize.width = configureEvent->width;
+ positionSize.height = configureEvent->height;
+ /// @note Can also get the window below this one if raise/lower was called.
+ mUpdatePositionSizeSignal.Emit(positionSize);
+ }
+}
+
void WindowBaseX::OnDeleteRequest()
{
mDeleteRequestSignal.Emit();
WindowSystem::GetImplementation().GetDPI(dpiHorizontal, dpiVertical);
}
-int WindowBaseX::GetOrientation() const
+int WindowBaseX::GetWindowRotationAngle() const
{
return 0;
}