SET( cachePath /home/owner )
ENDIF()
+IF( enable_appfw AND (enable_tizen_major_version GREATER_EQUAL 8) )
+ ADD_DEFINITIONS( -DUI_THREAD_AVAILABLE )
+ENDIF()
+
IF( enable_appfw )
ADD_DEFINITIONS( -DUSE_APPFW -DCOMPONENT_APPLICATION_SUPPORT)
ENDIF()
{
if(!gPreInitializedApplication)
{
- char* retEnv = std::getenv("TIZEN_UI_THREAD");
- bool isUseUIThread = false;
+ bool isUseUIThread = false;
+
+#ifdef UI_THREAD_AVAILABLE
+ char* retEnv = std::getenv("TIZEN_UI_THREAD");
if(retEnv)
{
std::string uiThreadEnv = retEnv;
isUseUIThread = true;
}
}
+#endif
Dali::TextAbstraction::FontClientPreInitialize();
WindowData windowData;
gPreInitializedApplication = new Application(argc, argv, "", Framework::NORMAL, isUseUIThread, windowData);
gPreInitializedApplication->mLaunchpadState = Launchpad::PRE_INITIALIZED;
+
+#ifdef UI_THREAD_AVAILABLE
if(isUseUIThread)
{
DALI_LOG_RELEASE_INFO("PRE_INITIALIZED with UI Threading");
gPreInitializedApplication->mUIThreadLoader->Run([&]() { gPreInitializedApplication->CreateWindow(); });
}
else
+#endif
{
DALI_LOG_RELEASE_INFO("Only PRE_INITIALIZED");
gPreInitializedApplication->CreateWindow(); // Only create window
#include <widget_base.h>
#include <app_core_ui_base.hh>
#include <app_event_internal.hh>
+
+#ifdef UI_THREAD_AVAILABLE
#include <app_core_ui_thread_base.hh>
+#endif
// CONDITIONAL INCLUDES
#ifdef APPCORE_WATCH_AVAILABLE
AppCoreUiBase::HINT_HW_ACC_CONTROL |
AppCoreUiBase::HINT_WINDOW_AUTO_CONTROL;
+#ifdef UI_THREAD_AVAILABLE
// For testing UIThread model, This code turns on the UI Thread feature forcibly.
// ex) app_launcher -e [APPID] __K_UI_THREAD enable
// This code doesn't change mUseUiThread in Internal::Application
{
hint |= AppCoreUiBase::HINT_DUAL_THREAD;
}
+#endif
mUiAppContext = std::make_unique<UiAppContext>(hint, mFramework);
}
struct UIThreadLoader::Impl
{
// Constructor
- Impl(void *data)
+ Impl(void* data)
{
- mUIThreadLoader = static_cast<UIThreadLoader*>(data);
+#ifdef UI_THREAD_AVAILABLE
+ mUIThreadLoader = static_cast<UIThreadLoader*>(data);
mAppCoreUiThreadBase = new AppCoreUiThreadBase();
print_log(DLOG_INFO, "DALI", "%s: %s(%d) > Create mAppCoreUiThreadBase(%p)", __MODULE__, __func__, __LINE__, mAppCoreUiThreadBase);
+#endif
}
// Destructor
~Impl()
{
+#ifdef UI_THREAD_AVAILABLE
if(mAppCoreUiThreadBase)
{
mAppCoreUiThreadBase->Exit();
delete mAppCoreUiThreadBase;
}
+#endif
}
/**
*/
void Run(Runner runner)
{
+#ifdef UI_THREAD_AVAILABLE
mAppCoreUiThreadBase->Post(runner);
mAppCoreUiThreadBase->Run(*(mUIThreadLoader->mArgc), *(mUIThreadLoader->mArgv));
+#endif
}
private:
Impl(const Impl& impl);
Impl& operator=(const Impl& impl);
+#ifdef UI_THREAD_AVAILABLE
// Data
AppCoreUiThreadBase* mAppCoreUiThreadBase;
UIThreadLoader* mUIThreadLoader;
+#endif
};
/**
// INTERNAL INCLUDES
#include <dali/internal/adaptor/tizen-wayland/dali-ecore-wl2.h>
-#include <dali/internal/window-system/common/window-system.h>
#include <dali/internal/window-system/common/window-impl.h>
+#include <dali/internal/window-system/common/window-system.h>
///////////////////////////////////////////////////////////////////////////////////////////////////
// DragAndDrop
mSourceCallback(type);
if(type != Dali::DragAndDrop::SourceEventType::START)
{
- mDragWindow.Reset();
+ mDragWindow.Reset();
}
}
}
}
mTargetIndex = -1;
- Ecore_Wl2_Display* display = ecore_wl2_connected_display_get(NULL);
- Ecore_Wl2_Input* input = ecore_wl2_input_default_input_get(display);
+#ifdef OVER_TIZEN_VERSION_8
+ Ecore_Wl2_Display* display = ecore_wl2_connected_display_get(NULL);
+ Ecore_Wl2_Input* input = ecore_wl2_input_default_input_get(display);
+#endif
if(mWindowTargetIndex != -1)
{
mDropWindowTargets[mWindowTargetIndex].callback(dragEvent);
mDropWindowTargets[mWindowTargetIndex].inside = false;
}
+#ifdef OVER_TIZEN_VERSION_8
else if(ev->offer != ecore_wl2_dnd_selection_get(input))
{
- for (std::size_t i = 0; i< mDropWindowTargets.size(); i++)
+ for(std::size_t i = 0; i < mDropWindowTargets.size(); i++)
{
- if (ev->win == mDropWindowTargets[i].windowId)
+ if(ev->win == mDropWindowTargets[i].windowId)
{
Dali::DragAndDrop::DragEvent dragEvent(Dali::DragAndDrop::DragType::DROP, mWindowPosition, ev->mimetype, ev->data);
mDropWindowTargets[i].callback(dragEvent);
}
}
}
+#endif
mWindowTargetIndex = -1;
}
Internal::Adaptor::WindowSystem::GetScreenSize(screenWidth, screenHeight);
int angle = DevelWindow::GetPhysicalOrientation(window);
- int newX, newY;
+ int newX, newY;
Dali::Vector2 newPosition;
if(angle == 90)
continue;
}
- Vector2 position = mDropTargets[i].target.GetProperty<Vector2>(Dali::Actor::Property::SCREEN_POSITION);
- Vector2 size = mDropTargets[i].target.GetProperty<Vector2>(Dali::Actor::Property::SIZE);
+ Vector2 position = mDropTargets[i].target.GetProperty<Vector2>(Dali::Actor::Property::SCREEN_POSITION);
+ Vector2 size = mDropTargets[i].target.GetProperty<Vector2>(Dali::Actor::Property::SIZE);
// Recalculate Cursor by Orientation
- Dali::Window window = Dali::DevelWindow::Get(mDropTargets[i].target);
+ Dali::Window window = Dali::DevelWindow::Get(mDropTargets[i].target);
Dali::Vector2 cursor = RecalculatePositionByOrientation(ev->x, ev->y, window);
bool currentInside = IsIntersection(cursor.x, cursor.y, position.x, position.y, size.width, size.height);
}
// Recalculate Cursor by Orientation
- Dali::Window window = mDropWindowTargets[i].target;
+ Dali::Window window = mDropWindowTargets[i].target;
Dali::Window::WindowPosition position = window.GetPosition();
- Dali::Window::WindowSize size = window.GetSize();
+ Dali::Window::WindowSize size = window.GetSize();
bool currentInside = IsIntersection(ev->x + position.GetX(), ev->y + position.GetY(), position.GetX(), position.GetY(), size.GetWidth(), size.GetHeight());
Ecore_Wl2_Event_Dnd_Drop* ev = reinterpret_cast<Ecore_Wl2_Event_Dnd_Drop*>(event);
// Check the target object region
- mTargetIndex = -1;
+ mTargetIndex = -1;
mWindowTargetIndex = -1;
for(std::size_t i = 0; i < mDropTargets.size(); i++)
Vector2 size = mDropTargets[i].target.GetProperty<Vector2>(Dali::Actor::Property::SIZE);
// Recalculate Cursor by Orientation
- Dali::Window window = Dali::DevelWindow::Get(mDropTargets[i].target);
+ Dali::Window window = Dali::DevelWindow::Get(mDropTargets[i].target);
Dali::Vector2 cursor = RecalculatePositionByOrientation(ev->x, ev->y, window);
// If the drop position is in the target object region, request drop data to the source object
}
// Recalculate Cursor by Orientation
- Dali::Window window = mDropWindowTargets[i].target;
+ Dali::Window window = mDropWindowTargets[i].target;
Dali::Window::WindowPosition position = window.GetPosition();
- Dali::Window::WindowSize size = window.GetSize();
+ Dali::Window::WindowSize size = window.GetSize();
// If the drop position is in the target object region, request drop data to the source object
if(IsIntersection(ev->x + position.GetX(), ev->y + position.GetY(), position.GetX(), position.GetY(), size.GetWidth(), size.GetHeight()))
{
mWindowTargetIndex = i;
- mWindowPosition = Dali::Vector2(position.GetX(), position.GetY());
+ mWindowPosition = Dali::Vector2(position.GetX(), position.GetY());
char* mimetype = (char*)eina_array_data_get(ecore_wl2_offer_mimes_get(ev->offer), 0);
if(mimetype)
return ECORE_CALLBACK_PASS_ON;
}
+#ifdef OVER_TIZEN_VERSION_8
/**
* Called when a touch motion is received.
*/
}
return ECORE_CALLBACK_PASS_ON;
}
+#endif
/**
* Called when a touch is canceled.
return ECORE_CALLBACK_PASS_ON;
}
+#ifdef OVER_TIZEN_VERSION_8
/**
* Called when pointer constraints event is recevied.
*/
}
return ECORE_CALLBACK_PASS_ON;
}
+#endif
/**
* Called when a mouse wheel is received.
mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP, EcoreEventMouseButtonUp, this));
mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE, EcoreEventMouseButtonMove, this));
mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_CANCEL, EcoreEventMouseButtonCancel, this));
+#ifdef OVER_TIZEN_VERSION_8
mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_RELATIVE_MOVE, EcoreEventMouseButtonRelativeMove, this));
// Register pointer lock/unlock event
mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_POINTER_CONSTRAINTS, EcoreEventPointerConstraints, this));
+#endif
// Register Mouse wheel events
mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_WHEEL, EcoreEventMouseWheel, this));
}
}
+#ifdef OVER_TIZEN_VERSION_8
void WindowBaseEcoreWl2::OnMouseButtonRelativeMove(void* data, int type, void* event)
{
Ecore_Event_Mouse_Relative_Move* relativeMoveEvent = static_cast<Ecore_Event_Mouse_Relative_Move*>(event);
mMouseRelativeEventSignal.Emit(mouseRelativeEvent);
}
}
+#endif
void WindowBaseEcoreWl2::OnMouseButtonCancel(void* data, int type, void* event)
{
}
}
+#ifdef OVER_TIZEN_VERSION_8
void WindowBaseEcoreWl2::OnPointerConstraints(void* data, int type, void* event)
{
Ecore_Wl2_Event_Pointer_Constraints* constraintsEvent = static_cast<Ecore_Wl2_Event_Pointer_Constraints*>(event);
mPointerConstraintsSignal.Emit(position, constraintsEvent->locked, constraintsEvent->confined);
}
}
+#endif
void WindowBaseEcoreWl2::OnMouseWheel(void* data, int type, void* event)
{
GetDeviceSubclass(ecore_device_subclass_get(keyEvent->dev), deviceSubclass);
bool isRepeat = false;
-#if defined(ECORE_VERSION_MAJOR) && (ECORE_VERSION_MAJOR >= 1) && defined(ECORE_VERSION_MINOR) && (ECORE_VERSION_MINOR >= 25)
+#ifdef OVER_TIZEN_VERSION_8
if(keyEvent->event_flags & ECORE_EVENT_FLAG_REPEAT)
{
isRepeat = true;
}
-#endif // Since ecore 1.25 version
+#endif
Integration::KeyEvent keyEvent(keyName, logicalKey, keyString, keyCode, modifier, time, Integration::KeyEvent::DOWN, compose, deviceName, deviceClass, deviceSubclass);
keyEvent.isRepeat = isRepeat;
void WindowBaseEcoreWl2::SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan)
{
+#ifdef OVER_TIZEN_VERSION_8
DALI_LOG_RELEASE_INFO("ecore_wl2_window_layout_set, numCols[%d], numRows[%d], column[%d], row[%d], colSpan[%d], rowSpan[%d]\n", numCols, numRows, column, row, colSpan, rowSpan);
START_DURATION_CHECK();
ecore_wl2_window_layout_set(mEcoreWindow, numCols, numRows, column, row, colSpan, rowSpan);
FINISH_DURATION_CHECK("ecore_wl2_window_layout_set");
+#endif
}
void WindowBaseEcoreWl2::SetClass(const std::string& name, const std::string& className)
bool WindowBaseEcoreWl2::PointerConstraintsLock()
{
+#ifdef OVER_TIZEN_VERSION_8
return ecore_wl2_window_pointer_constraints_lock_pointer(mEcoreWindow);
+#else
+ return false;
+#endif
}
bool WindowBaseEcoreWl2::PointerConstraintsUnlock()
{
+#ifdef OVER_TIZEN_VERSION_8
return ecore_wl2_window_pointer_constraints_unlock_pointer(mEcoreWindow);
+#else
+ return false;
+#endif
}
void WindowBaseEcoreWl2::LockedPointerRegionSet(int32_t x, int32_t y, int32_t width, int32_t height)
{
+#ifdef OVER_TIZEN_VERSION_8
ecore_wl2_window_locked_pointer_region_set(mEcoreWindow, x, y, width, height);
ecore_wl2_window_commit(mEcoreWindow, EINA_TRUE);
+#endif
}
void WindowBaseEcoreWl2::LockedPointerCursorPositionHintSet(int32_t x, int32_t y)
{
+#ifdef OVER_TIZEN_VERSION_8
ecore_wl2_window_locked_pointer_cursor_position_hint_set(mEcoreWindow, x, y);
ecore_wl2_window_commit(mEcoreWindow, EINA_TRUE);
+#endif
}
bool WindowBaseEcoreWl2::PointerWarp(int32_t x, int32_t y)
void WindowBaseEcoreWl2::CursorVisibleSet(bool visible)
{
+#ifdef OVER_TIZEN_VERSION_8
ecore_wl2_window_cursor_visible_set(mEcoreWindow, visible);
+#endif
}
// Request grab key events according to the requested device subtype
//(For now, subtype could be '0'/'11'/'12' which equals to ECORE_DEVICE_SUBCLASS_NONE/REMOCON/VIRTUAL_KEYBOARD)
bool WindowBaseEcoreWl2::KeyboardGrab(Device::Subclass::Type deviceSubclass)
{
+#ifdef OVER_TIZEN_VERSION_8
Ecore_Device_Subclass ecoreDeviceSubclass;
switch(deviceSubclass)
{
}
}
return ecore_wl2_window_keyboard_grab(mEcoreWindow, ecoreDeviceSubclass);
+#else
+ return false;
+#endif
}
// Request ungrab key events
bool WindowBaseEcoreWl2::KeyboardUnGrab()
{
+#ifdef OVER_TIZEN_VERSION_8
return ecore_wl2_window_keyboard_ungrab(mEcoreWindow);
+#else
+ return false;
+#endif
}
void WindowBaseEcoreWl2::SetFullScreen(bool fullscreen)
void Initialize()
{
auto frameworkFactory = Dali::Internal::Adaptor::GetFrameworkFactory();
- if(frameworkFactory == nullptr || (frameworkFactory && frameworkFactory->GetFrameworkBackend() == FrameworkBackend::DEFAULT))
+ if(frameworkFactory == nullptr || (frameworkFactory && frameworkFactory->GetFrameworkBackend() == FrameworkBackend::DEFAULT))
{
ecore_wl2_init();
}
return false;
}
-
bool SetKeyboardHorizontalRepeatInfo(float rate, float delay)
{
+#ifdef OVER_TIZEN_VERSION_8
auto frameworkFactory = Dali::Internal::Adaptor::GetFrameworkFactory();
if(frameworkFactory == nullptr || (frameworkFactory && frameworkFactory->GetFrameworkBackend() == FrameworkBackend::DEFAULT))
{
return ecore_wl2_input_keyboard_horizontal_way_repeat_set(input, static_cast<double>(rate), static_cast<double>(delay));
}
return false;
+#else
+ return SetKeyboardRepeatInfo(rate, delay);
+#endif
}
bool GetKeyboardHorizontalRepeatInfo(float& rate, float& delay)
{
+#ifdef OVER_TIZEN_VERSION_8
auto frameworkFactory = Dali::Internal::Adaptor::GetFrameworkFactory();
if(frameworkFactory == nullptr || (frameworkFactory && frameworkFactory->GetFrameworkBackend() == FrameworkBackend::DEFAULT))
{
return ret;
}
return false;
+#else
+ return GetKeyboardRepeatInfo(rate, delay);
+#endif
}
bool SetKeyboardVerticalRepeatInfo(float rate, float delay)
{
+#ifdef OVER_TIZEN_VERSION_8
auto frameworkFactory = Dali::Internal::Adaptor::GetFrameworkFactory();
if(frameworkFactory == nullptr || (frameworkFactory && frameworkFactory->GetFrameworkBackend() == FrameworkBackend::DEFAULT))
{
return ecore_wl2_input_keyboard_vertical_way_repeat_set(input, static_cast<double>(rate), static_cast<double>(delay));
}
return false;
+#else
+ return SetKeyboardRepeatInfo(rate, delay);
+#endif
}
bool GetKeyboardVerticalRepeatInfo(float& rate, float& delay)
{
+#ifdef OVER_TIZEN_VERSION_8
auto frameworkFactory = Dali::Internal::Adaptor::GetFrameworkFactory();
if(frameworkFactory == nullptr || (frameworkFactory && frameworkFactory->GetFrameworkBackend() == FrameworkBackend::DEFAULT))
{
return ret;
}
return false;
+#else
+ return GetKeyboardRepeatInfo(rate, delay);
+#endif
}
} // namespace WindowSystem
CXXFLAGS+=" -DOVER_TIZEN_VERSION_7"
%endif
+# Use this conditional when Tizen version is 8.x or greater
+%if 0%{?tizen_version_major} >= 8
+CXXFLAGS+=" -DOVER_TIZEN_VERSION_8"
+%endif
+
%if 0%{?enable_debug}
cmake_flags+=" -DCMAKE_BUILD_TYPE=Debug"
%endif