2 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/internal/window-system/windows/window-base-win.h>
22 #include <dali/internal/window-system/common/window-impl.h>
23 #include <dali/internal/window-system/common/window-render-surface.h>
26 #include <dali/public-api/object/any.h>
27 #include <dali/integration-api/debug.h>
41 const std::string DEFAULT_DEVICE_NAME = "";
42 const Device::Class::Type DEFAULT_DEVICE_CLASS = Device::Class::NONE;
43 const Device::Subclass::Type DEFAULT_DEVICE_SUBCLASS = Device::Subclass::NONE;
45 const unsigned int PRIMARY_TOUCH_BUTTON_ID( 1 );
47 #if defined(DEBUG_ENABLED)
48 Debug::Filter* gWindowBaseLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_WINDOW_BASE" );
51 static bool EcoreEventWindowPropertyChanged( void* data, int type, TWinEventInfo *event )
53 WindowBaseWin* windowBase = static_cast< WindowBaseWin* >( data );
56 return windowBase->OnWindowPropertyChanged( data, type, event );
63 * Called when the window gains focus.
65 static bool EcoreEventWindowFocusIn( void* data, int type, TWinEventInfo *event )
67 WindowBaseWin* windowBase = static_cast< WindowBaseWin* >( data );
70 windowBase->OnFocusIn( data, type, event );
76 * Called when the window loses focus.
78 static bool EcoreEventWindowFocusOut( void* data, int type, TWinEventInfo *event )
80 WindowBaseWin* windowBase = static_cast< WindowBaseWin* >( data );
83 windowBase->OnFocusOut( data, type, event );
89 * Called when the window is damaged.
91 static bool EcoreEventWindowDamaged( void* data, int type, TWinEventInfo *event )
93 WindowBaseWin* windowBase = static_cast< WindowBaseWin* >( data );
96 windowBase->OnWindowDamaged( data, type, event );
102 /////////////////////////////////////////////////////////////////////////////////////////////////
103 // Selection Callbacks
104 /////////////////////////////////////////////////////////////////////////////////////////////////
107 * Called when the source window notifies us the content in clipboard is selected.
109 static bool EcoreEventSelectionClear( void* data, int type, TWinEventInfo *event )
111 WindowBaseWin* windowBase = static_cast< WindowBaseWin* >( data );
114 windowBase->OnSelectionClear( data, type, event );
120 * Called when the source window sends us about the selected content.
121 * For example, when dragged items are dragged INTO our window or when items are selected in the clipboard.
123 static bool EcoreEventSelectionNotify( void* data, int type, TWinEventInfo *event )
125 WindowBaseWin* windowBase = static_cast< WindowBaseWin* >( data );
128 windowBase->OnSelectionNotify( data, type, event );
133 /////////////////////////////////////////////////////////////////////////////////////////////////
135 /////////////////////////////////////////////////////////////////////////////////////////////////
138 * Called when a touch down is received.
140 static bool EcoreEventMouseButtonDown( void* data, int type, TWinEventInfo *event )
142 WindowBaseWin* windowBase = static_cast< WindowBaseWin* >( data );
145 windowBase->OnMouseButtonDown( data, type, event );
151 * Called when a touch up is received.
153 static bool EcoreEventMouseButtonUp( void* data, int type, TWinEventInfo *event )
155 WindowBaseWin* windowBase = static_cast< WindowBaseWin* >( data );
158 windowBase->OnMouseButtonUp( data, type, event );
164 * Called when a touch motion is received.
166 static bool EcoreEventMouseButtonMove( void* data, int type, TWinEventInfo *event )
168 WindowBaseWin* windowBase = static_cast< WindowBaseWin* >( data );
171 windowBase->OnMouseButtonMove( data, type, event );
176 /////////////////////////////////////////////////////////////////////////////////////////////////
178 /////////////////////////////////////////////////////////////////////////////////////////////////
181 * Called when a mouse wheel is received.
183 static bool EcoreEventMouseWheel( void* data, int type, TWinEventInfo *event )
185 WindowBaseWin* windowBase = static_cast< WindowBaseWin* >( data );
188 windowBase->OnMouseWheel( data, type, event );
193 /////////////////////////////////////////////////////////////////////////////////////////////////
195 /////////////////////////////////////////////////////////////////////////////////////////////////
198 * Called when a key down is received.
200 static bool EcoreEventKeyDown( void* data, int type, TWinEventInfo *event )
202 WindowBaseWin* windowBase = static_cast< WindowBaseWin* >( data );
205 windowBase->OnKeyDown( data, type, event );
211 * Called when a key up is received.
213 static bool EcoreEventKeyUp( void* data, int type, TWinEventInfo *event )
215 WindowBaseWin* windowBase = static_cast< WindowBaseWin* >( data );
218 windowBase->OnKeyUp( data, type, event );
222 } // unnamed namespace
224 WindowBaseWin::WindowBaseWin( Dali::PositionSize positionSize, Any surface, bool isTransparent )
227 mOwnSurface( false ),
228 mIsTransparent( false ), // Should only be set to true once we actually create a transparent window regardless of what isTransparent is.
229 mRotationAppSet( false )
231 Initialize( positionSize, surface, isTransparent );
234 WindowBaseWin::~WindowBaseWin()
236 for( Dali::Vector< Event_Handler >::Iterator iter = mEventHandler.Begin(), endIter = mEventHandler.End(); iter != endIter; ++iter )
238 event_handler_del( *iter );
240 mEventHandler.Clear();
242 WindowsPlatformImplement::PostWinMessage( WM_CLOSE, 0, 0, mWin32Window );
245 static void EventEntry( long hWnd, unsigned int uMsg, long wParam, long lParam )
247 EventCallback callback = GetCallback( uMsg );
248 EventHandler *handler = (EventHandler*)GetEventHandler( uMsg );
250 if( NULL != callback )
252 //EventHandler *handler = new EventHandler();
253 TWinEventInfo eventInfo( hWnd, uMsg, wParam, lParam );
254 callback( handler, uMsg, &eventInfo );
258 void WindowBaseWin::Initialize( PositionSize positionSize, Any surface, bool isTransparent )
260 // see if there is a surface in Any surface
261 unsigned int surfaceId = GetSurfaceId( surface );
263 // if the surface is empty, create a new one.
266 // we own the surface about to created
268 CreateWinWindow( positionSize, isTransparent );
272 // XLib should already be initialized so no point in calling XInitThreads
273 mWin32Window = static_cast< Win_Window_Handle >( surfaceId );
276 // Register window focus events
277 mEventHandler.PushBack( event_handler_add( WIN_EVENT_WINDOW_FOCUS_IN, EcoreEventWindowFocusIn, this ) );
278 mEventHandler.PushBack( event_handler_add( WIN_EVENT_WINDOW_FOCUS_OUT, EcoreEventWindowFocusOut, this ) );
280 // Register Window damage events
281 mEventHandler.PushBack( event_handler_add( WIN_EVENT_WINDOW_DAMAGE, EcoreEventWindowDamaged, this ) );
283 // Register Touch events
284 mEventHandler.PushBack( event_handler_add( EVENT_MOUSE_BUTTON_DOWN, EcoreEventMouseButtonDown, this ) );
285 mEventHandler.PushBack( event_handler_add( EVENT_MOUSE_BUTTON_UP, EcoreEventMouseButtonUp, this ) );
286 mEventHandler.PushBack( event_handler_add( EVENT_MOUSE_MOVE, EcoreEventMouseButtonMove, this ) );
287 mEventHandler.PushBack( event_handler_add( EVENT_MOUSE_OUT, EcoreEventMouseButtonUp, this ) ); // process mouse out event like up event
289 // Register Mouse wheel events
290 mEventHandler.PushBack( event_handler_add( EVENT_MOUSE_WHEEL, EcoreEventMouseWheel, this ) );
292 // Register Key events
293 mEventHandler.PushBack( event_handler_add( EVENT_KEY_DOWN, EcoreEventKeyDown, this ) );
294 mEventHandler.PushBack( event_handler_add( EVENT_KEY_UP, EcoreEventKeyUp, this ) );
296 // Register Selection event
297 mEventHandler.PushBack( event_handler_add( WIN_EVENT_SELECTION_CLEAR, EcoreEventSelectionClear, this ) );
298 mEventHandler.PushBack( event_handler_add( WIN_EVENT_SELECTION_NOTIFY, EcoreEventSelectionNotify, this ) );
300 WindowsPlatformImplement::AddListener( EventEntry );
303 bool WindowBaseWin::OnWindowPropertyChanged( void* data, int type, TWinEventInfo *event )
305 //Ecore_X_Event_Window_Property* propertyChangedEvent = static_cast< Ecore_X_Event_Window_Property* >( event );
306 //bool handled( true );
308 //if( propertyChangedEvent->win == mWin32Window )
310 // Ecore_X_Window_State_Hint state( ecore_x_icccm_state_get( propertyChangedEvent->win ) );
314 // case ECORE_X_WINDOW_STATE_HINT_WITHDRAWN:
316 // // Window was hidden.
317 // mWindow->OnIconifyChanged( true );
318 // DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "Window (%d) Withdrawn\n", mWindow );
319 // handled = ECORE_CALLBACK_DONE;
322 // case ECORE_X_WINDOW_STATE_HINT_ICONIC:
324 // // Window was iconified (minimised).
325 // mWindow->OnIconifyChanged( true );
326 // DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "Window (%d) Iconfied\n", mWindow );
327 // handled = ECORE_CALLBACK_DONE;
330 // case ECORE_X_WINDOW_STATE_HINT_NORMAL:
332 // // Window was shown.
333 // mWindow->OnIconifyChanged( false );
334 // DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "Window (%d) Shown\n", mWindow );
335 // handled = ECORE_CALLBACK_DONE;
350 void WindowBaseWin::OnDeleteRequest()
352 mDeleteRequestSignal.Emit();
355 void WindowBaseWin::OnFocusIn( void* data, int type, TWinEventInfo *event )
357 //Ecore_X_Event_Window_Focus_In* focusInEvent = static_cast< Ecore_X_Event_Window_Focus_In* >( event );
359 //if( focusInEvent->win == mWin32Window )
361 // DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "Window EcoreEventWindowFocusIn\n" );
363 // mFocusChangedSignal.Emit( true );
367 void WindowBaseWin::OnFocusOut( void* data, int type, TWinEventInfo *event )
369 //Ecore_X_Event_Window_Focus_Out* focusOutEvent = static_cast< Ecore_X_Event_Window_Focus_Out* >( event );
371 //// If the window loses focus then hide the keyboard.
372 //if( focusOutEvent->win == mWin32Window )
374 // DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "Window EcoreEventWindowFocusOut\n" );
376 // mFocusChangedSignal.Emit( false );
380 void WindowBaseWin::OnWindowDamaged( void* data, int type, TWinEventInfo *event )
382 Event_Mouse_Button* windowDamagedEvent( (Event_Mouse_Button*)event );
383 EventHandler* handler( (EventHandler*)data );
385 if( windowDamagedEvent->window == mWin32Window )
393 //handler->SendEvent( area );
394 mWindowDamagedSignal.Emit( area );
398 void WindowBaseWin::OnMouseButtonDown( void* data, int type, TWinEventInfo *event )
400 Event_Mouse_Button touchEvent = *((Event_Mouse_Button*)event);
401 touchEvent.x = LOWORD( event->lParam );
402 touchEvent.y = HIWORD( event->lParam );
403 touchEvent.multi.device = DEVICE_MOUSE;
405 if( touchEvent.window == mWin32Window )
407 PointState::Type state ( PointState::DOWN );
409 // Check if the buttons field is set and ensure it's the primary touch button.
410 // If this event was triggered by buttons other than the primary button (used for touch), then
411 // just send an interrupted event to Core.
412 if( touchEvent.buttons && ( touchEvent.buttons != PRIMARY_TOUCH_BUTTON_ID ) )
414 state = PointState::INTERRUPTED;
417 Integration::Point point;
418 point.SetDeviceId( touchEvent.multi.device );
419 point.SetState( state );
420 point.SetScreenPosition( Vector2( touchEvent.x, touchEvent.y + WindowsPlatformImplement::GetEdgeHeight() ) );
421 point.SetRadius( touchEvent.multi.radius, Vector2( touchEvent.multi.radius_x, touchEvent.multi.radius_y ) );
422 point.SetPressure( touchEvent.multi.pressure );
423 point.SetAngle( Degree( touchEvent.multi.angle ) );
425 mTouchEventSignal.Emit( point, touchEvent.timestamp );
429 void WindowBaseWin::OnMouseButtonUp( void* data, int type, TWinEventInfo *event )
431 Event_Mouse_Button touchEvent = *( (Event_Mouse_Button*)event );
432 touchEvent.x = LOWORD( event->lParam );
433 touchEvent.y = HIWORD( event->lParam );
434 touchEvent.multi.device = DEVICE_MOUSE;
436 if( touchEvent.window == mWin32Window )
438 PointState::Type state( PointState::UP );
440 // Check if the buttons field is set and ensure it's the primary touch button.
441 // If this event was triggered by buttons other than the primary button (used for touch), then
442 // just send an interrupted event to Core.
443 if( touchEvent.buttons && ( touchEvent.buttons != PRIMARY_TOUCH_BUTTON_ID ) )
445 state = PointState::INTERRUPTED;
448 Integration::Point point;
449 point.SetDeviceId( touchEvent.multi.device );
450 point.SetState( state );
451 point.SetScreenPosition( Vector2( touchEvent.x, touchEvent.y + WindowsPlatformImplement::GetEdgeHeight() ) );
452 point.SetRadius( touchEvent.multi.radius, Vector2( touchEvent.multi.radius_x, touchEvent.multi.radius_y ) );
453 point.SetPressure( touchEvent.multi.pressure );
454 point.SetAngle( Degree( touchEvent.multi.angle ) );
456 mTouchEventSignal.Emit( point, touchEvent.timestamp );
460 void WindowBaseWin::OnMouseButtonMove( void* data, int type, TWinEventInfo *event )
462 Event_Mouse_Button touchEvent = *((Event_Mouse_Button*)event);
463 touchEvent.timestamp = GetTickCount();
464 touchEvent.x = LOWORD( event->lParam );
465 touchEvent.y = HIWORD( event->lParam );
466 touchEvent.multi.device = DEVICE_MOUSE;
468 if( touchEvent.window == mWin32Window )
470 PointState::Type state( PointState::MOTION );
472 // Check if the buttons field is set and ensure it's the primary touch button.
473 // If this event was triggered by buttons other than the primary button (used for touch), then
474 // just send an interrupted event to Core.
475 if( touchEvent.buttons && ( touchEvent.buttons != PRIMARY_TOUCH_BUTTON_ID ) )
477 state = PointState::INTERRUPTED;
480 Integration::Point point;
481 point.SetDeviceId( touchEvent.multi.device );
482 point.SetState( state );
483 point.SetScreenPosition( Vector2( touchEvent.x, touchEvent.y + WindowsPlatformImplement::GetEdgeHeight() ) );
484 point.SetRadius( touchEvent.multi.radius, Vector2( touchEvent.multi.radius_x, touchEvent.multi.radius_y ) );
485 point.SetPressure( touchEvent.multi.pressure );
486 point.SetAngle( Degree( touchEvent.multi.angle ) );
488 mTouchEventSignal.Emit( point, touchEvent.timestamp );
492 void WindowBaseWin::OnMouseWheel( void* data, int type, TWinEventInfo *event )
494 Event_Mouse_Wheel mouseWheelEvent = *((Event_Mouse_Wheel*)( event ));
496 if( mouseWheelEvent.window == mWin32Window )
498 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseWin::OnMouseWheel: direction: %d, modifiers: %d, x: %d, y: %d, z: %d\n", mouseWheelEvent.direction, mouseWheelEvent.modifiers, mouseWheelEvent.x, mouseWheelEvent.y, mouseWheelEvent.z );
500 WheelEvent wheelEvent( WheelEvent::MOUSE_WHEEL, mouseWheelEvent.direction, mouseWheelEvent.modifiers, Vector2( mouseWheelEvent.x, mouseWheelEvent.y ), mouseWheelEvent.z, mouseWheelEvent.timestamp );
502 mWheelEventSignal.Emit( wheelEvent );
506 void WindowBaseWin::OnKeyDown( void* data, int type, TWinEventInfo *event )
508 if( event->mWindow == mWin32Window )
510 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseWin::OnKeyDown\n" );
512 int keyCode = event->wParam;
513 std::string keyName( WindowsPlatformImplement::GetKeyName( keyCode ) );
514 std::string key( "" );
515 std::string keyString( "" );
516 std::string compose( "" );
519 unsigned long time( 0 );
521 // Ensure key event string is not NULL as keys like SHIFT have a null string.
522 keyString.push_back( event->wParam );
524 Integration::KeyEvent keyEvent( keyName, key, keyString, keyCode, modifier, time, Integration::KeyEvent::Down, compose, DEFAULT_DEVICE_NAME, DEFAULT_DEVICE_CLASS, DEFAULT_DEVICE_SUBCLASS );
526 mKeyEventSignal.Emit( keyEvent );
530 void WindowBaseWin::OnKeyUp( void* data, int type, TWinEventInfo *event )
532 if( event->mWindow == mWin32Window )
534 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseWin::OnKeyDown\n" );
536 int keyCode = event->wParam;
537 std::string keyName( WindowsPlatformImplement::GetKeyName( keyCode ) );
538 std::string key( "" );
539 std::string keyString( "" );
540 std::string compose( "" );
543 unsigned long time( 0 );
545 // Ensure key event string is not NULL as keys like SHIFT have a null string.
546 keyString.push_back( event->wParam );
548 Integration::KeyEvent keyEvent( keyName, key, keyString, keyCode, modifier, time, Integration::KeyEvent::Up, compose, DEFAULT_DEVICE_NAME, DEFAULT_DEVICE_CLASS, DEFAULT_DEVICE_SUBCLASS );
550 mKeyEventSignal.Emit( keyEvent );
554 void WindowBaseWin::OnSelectionClear( void* data, int type, TWinEventInfo *event )
556 //Ecore_X_Event_Selection_Clear* selectionClearEvent = static_cast< Ecore_X_Event_Selection_Clear* >( event );
558 //if( selectionClearEvent->win == mWin32Window )
560 // DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, " WindowBaseWin::OnSelectionClear\n" );
562 // if( selectionClearEvent->selection == ECORE_X_SELECTION_SECONDARY )
564 // // Request to get the content from Ecore.
565 // ecore_x_selection_secondary_request( selectionClearEvent->win, ECORE_X_SELECTION_TARGET_TEXT );
570 void WindowBaseWin::OnSelectionNotify( void* data, int type, TWinEventInfo *event )
572 //Ecore_X_Event_Selection_Notify* selectionNotifyEvent = static_cast< Ecore_X_Event_Selection_Notify* >( event );
574 //if( selectionNotifyEvent->win == mWin32Window )
576 // DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, " WindowBaseWin::OnSelectionNotify\n" );
578 // Ecore_X_Selection_Data* selectionData = static_cast< Ecore_X_Selection_Data* >( selectionNotifyEvent->data );
579 // if( selectionData->data )
581 // if( selectionNotifyEvent->selection == ECORE_X_SELECTION_SECONDARY )
583 // mSelectionDataReceivedSignal.Emit( event );
589 Any WindowBaseWin::GetNativeWindow()
594 int WindowBaseWin::GetNativeWindowId()
599 EGLNativeWindowType WindowBaseWin::CreateEglWindow( int width, int height )
601 return reinterpret_cast< EGLNativeWindowType >( mWin32Window );
604 void WindowBaseWin::DestroyEglWindow()
608 void WindowBaseWin::SetEglWindowRotation( int angle )
612 void WindowBaseWin::SetEglWindowBufferTransform( int angle )
616 void WindowBaseWin::SetEglWindowTransform( int angle )
620 void WindowBaseWin::ResizeEglWindow( PositionSize positionSize )
624 bool WindowBaseWin::IsEglWindowRotationSupported()
629 void WindowBaseWin::Move( PositionSize positionSize )
631 //ecore_x_window_move( mWin32Window, positionSize.x, positionSize.y );
634 void WindowBaseWin::Resize( PositionSize positionSize )
636 //ecore_x_window_resize( mWin32Window, positionSize.width, positionSize.height );
639 void WindowBaseWin::MoveResize( PositionSize positionSize )
641 //ecore_x_window_move_resize( mWin32Window, positionSize.x, positionSize.y, positionSize.width, positionSize.height );
644 void WindowBaseWin::ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode, Dali::Window::IndicatorBgOpacity opacityMode )
646 // DALI_LOG_TRACE_METHOD_FMT( gWindowBaseLogFilter, "visible : %d\n", visibleMode );
648 // if( visibleMode == Dali::Window::VISIBLE )
650 // // when the indicator is visible, set proper mode for indicator server according to bg mode
651 // if( opacityMode == Dali::Window::OPAQUE )
653 // ecore_x_e_illume_indicator_opacity_set( mWin32Window, ECORE_X_ILLUME_INDICATOR_OPAQUE );
655 // else if( opacityMode == Dali::Window::TRANSLUCENT )
657 // ecore_x_e_illume_indicator_opacity_set( mWin32Window, ECORE_X_ILLUME_INDICATOR_TRANSLUCENT );
659 //#if defined (DALI_PROFILE_MOBILE)
660 // else if( opacityMode == Dali::Window::TRANSPARENT )
662 // ecore_x_e_illume_indicator_opacity_set( mWin32Window, ECORE_X_ILLUME_INDICATOR_OPAQUE );
668 // // when the indicator is not visible, set TRANSPARENT mode for indicator server
669 // ecore_x_e_illume_indicator_opacity_set( mWin32Window, ECORE_X_ILLUME_INDICATOR_TRANSPARENT ); // it means hidden indicator
673 void WindowBaseWin::SetIndicatorProperties( bool isShow, Dali::Window::WindowOrientation lastOrientation )
675 /*int show_state = static_cast< int >( isShow );
676 ecore_x_window_prop_property_set( mWin32Window, ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE,
677 ECORE_X_ATOM_CARDINAL, 32, &show_state, 1 );
681 ecore_x_e_illume_indicator_state_set( mWin32Window, ECORE_X_ILLUME_INDICATOR_STATE_ON );
685 ecore_x_e_illume_indicator_state_set( mWin32Window, ECORE_X_ILLUME_INDICATOR_STATE_OFF );
689 void WindowBaseWin::IndicatorTypeChanged( IndicatorInterface::Type type )
693 void WindowBaseWin::SetClass( const std::string& name, const std::string& className )
695 //ecore_x_icccm_name_class_set( mWin32Window, name.c_str(), className.c_str() );
698 void WindowBaseWin::Raise()
700 //ecore_x_window_raise( mWin32Window );
703 void WindowBaseWin::Lower()
705 //ecore_x_window_lower( mWin32Window );
708 void WindowBaseWin::Activate()
710 //ecore_x_netwm_client_active_request( ecore_x_window_root_get( mWin32Window ), mWin32Window, 1 /* request type, 1:application, 2:pager */, 0 );
713 void WindowBaseWin::SetAvailableOrientations( const std::vector< Dali::Window::WindowOrientation >& orientations )
717 void WindowBaseWin::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
721 void WindowBaseWin::SetAcceptFocus( bool accept )
725 void WindowBaseWin::Show()
727 //ecore_x_window_show( mWin32Window );
730 void WindowBaseWin::Hide()
732 //ecore_x_window_hide( mWin32Window );
735 unsigned int WindowBaseWin::GetSupportedAuxiliaryHintCount() const
740 std::string WindowBaseWin::GetSupportedAuxiliaryHint( unsigned int index ) const
742 return std::string();
745 unsigned int WindowBaseWin::AddAuxiliaryHint( const std::string& hint, const std::string& value )
750 bool WindowBaseWin::RemoveAuxiliaryHint( unsigned int id )
755 bool WindowBaseWin::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
760 std::string WindowBaseWin::GetAuxiliaryHintValue( unsigned int id ) const
762 return std::string();
765 unsigned int WindowBaseWin::GetAuxiliaryHintId( const std::string& hint ) const
770 void WindowBaseWin::SetInputRegion( const Rect< int >& inputRegion )
774 void WindowBaseWin::SetType( Dali::Window::Type type )
778 bool WindowBaseWin::SetNotificationLevel( Dali::Window::NotificationLevel::Type level )
783 Dali::Window::NotificationLevel::Type WindowBaseWin::GetNotificationLevel() const
785 return Dali::Window::NotificationLevel::NONE;
788 void WindowBaseWin::SetOpaqueState( bool opaque )
792 bool WindowBaseWin::SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode)
797 Dali::Window::ScreenOffMode::Type WindowBaseWin::GetScreenOffMode() const
799 return Dali::Window::ScreenOffMode::TIMEOUT;
802 bool WindowBaseWin::SetBrightness( int brightness )
807 int WindowBaseWin::GetBrightness() const
812 bool WindowBaseWin::GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode )
817 bool WindowBaseWin::UngrabKey( Dali::KEY key )
822 bool WindowBaseWin::GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result )
827 bool WindowBaseWin::UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result )
832 void WindowBaseWin::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical )
837 //// 1 inch = 25.4 millimeters
838 WindowsPlatformImplement::GetDPI( xres, yres );
843 dpiHorizontal = int( xres + 0.5f ); // rounding
844 dpiVertical = int( yres + 0.5f );
847 void WindowBaseWin::SetViewMode( ViewMode viewMode )
851 int WindowBaseWin::GetScreenRotationAngle()
856 void WindowBaseWin::SetWindowRotationAngle( int degree )
860 void WindowBaseWin::WindowRotationCompleted( int degree, int width, int height )
864 void WindowBaseWin::SetTransparency( bool transparent )
868 unsigned int WindowBaseWin::GetSurfaceId( Any surface ) const
870 unsigned int surfaceId = 0;
872 if ( surface.Empty() == false )
874 // check we have a valid type
875 DALI_ASSERT_ALWAYS( ( (surface.GetType() == typeid ( winWindow ) ) || (surface.GetType() == typeid ( Win_Window_Handle ) ) )
876 && "Surface type is invalid" );
878 if ( surface.GetType() == typeid ( Win_Window_Handle ) )
880 surfaceId = AnyCast< Win_Window_Handle >( surface );
884 surfaceId = AnyCast< winWindow >( surface );
890 void WindowBaseWin::CreateWinWindow( PositionSize positionSize, bool isTransparent )
892 long hWnd = WindowsPlatformImplement::CreateHwnd( "Demo", "Demo", positionSize.x, positionSize.y, positionSize.width, positionSize.height, NULL );
894 WindowsPlatformImplement::ShowWindow( hWnd );
896 mWin32Window = (Win_Window_Handle)hWnd;
897 DALI_ASSERT_ALWAYS( mWin32Window != 0 && "There is no EcoreWin window" );
900 } // namespace Adaptor
902 } // namespace Internal
906 #pragma GCC diagnostic pop