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 )
\r
247 EventCallback callback = GetCallback( uMsg );
\r
248 EventHandler *handler = (EventHandler*)GetEventHandler( uMsg );
\r
250 if( NULL != callback )
\r
252 //EventHandler *handler = new EventHandler();
\r
253 TWinEventInfo eventInfo( hWnd, uMsg, wParam, lParam );
\r
254 callback( handler, uMsg, &eventInfo );
\r
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 );
\r
383 EventHandler* handler( (EventHandler*)data );
\r
385 if( windowDamagedEvent->window == mWin32Window )
\r
393 //handler->SendEvent( area );
\r
394 mWindowDamagedSignal.Emit( area );
\r
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 );
\r
402 touchEvent.y = HIWORD( event->lParam );
\r
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 );
\r
433 touchEvent.y = HIWORD( event->lParam );
\r
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 );
\r
465 touchEvent.y = HIWORD( event->lParam );
\r
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 keyString( "" );
515 std::string compose( "" );
518 unsigned long time( 0 );
520 // Ensure key event string is not NULL as keys like SHIFT have a null string.
521 keyString.push_back( event->wParam );
523 Integration::KeyEvent keyEvent( keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Down, compose, DEFAULT_DEVICE_NAME, DEFAULT_DEVICE_CLASS, DEFAULT_DEVICE_SUBCLASS );
525 mKeyEventSignal.Emit( keyEvent );
529 void WindowBaseWin::OnKeyUp( void* data, int type, TWinEventInfo *event )
531 if( event->mWindow == mWin32Window )
533 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseWin::OnKeyDown\n" );
535 int keyCode = event->wParam;
536 std::string keyName( WindowsPlatformImplement::GetKeyName( keyCode ) );
537 std::string keyString( "" );
538 std::string compose( "" );
541 unsigned long time( 0 );
543 // Ensure key event string is not NULL as keys like SHIFT have a null string.
544 keyString.push_back( event->wParam );
546 Integration::KeyEvent keyEvent( keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Up, compose, DEFAULT_DEVICE_NAME, DEFAULT_DEVICE_CLASS, DEFAULT_DEVICE_SUBCLASS );
548 mKeyEventSignal.Emit( keyEvent );
552 void WindowBaseWin::OnSelectionClear( void* data, int type, TWinEventInfo *event )
554 //Ecore_X_Event_Selection_Clear* selectionClearEvent = static_cast< Ecore_X_Event_Selection_Clear* >( event );
556 //if( selectionClearEvent->win == mWin32Window )
558 // DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, " WindowBaseWin::OnSelectionClear\n" );
560 // if( selectionClearEvent->selection == ECORE_X_SELECTION_SECONDARY )
562 // // Request to get the content from Ecore.
563 // ecore_x_selection_secondary_request( selectionClearEvent->win, ECORE_X_SELECTION_TARGET_TEXT );
568 void WindowBaseWin::OnSelectionNotify( void* data, int type, TWinEventInfo *event )
570 //Ecore_X_Event_Selection_Notify* selectionNotifyEvent = static_cast< Ecore_X_Event_Selection_Notify* >( event );
572 //if( selectionNotifyEvent->win == mWin32Window )
574 // DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, " WindowBaseWin::OnSelectionNotify\n" );
576 // Ecore_X_Selection_Data* selectionData = static_cast< Ecore_X_Selection_Data* >( selectionNotifyEvent->data );
577 // if( selectionData->data )
579 // if( selectionNotifyEvent->selection == ECORE_X_SELECTION_SECONDARY )
581 // mSelectionDataReceivedSignal.Emit( event );
587 Any WindowBaseWin::GetNativeWindow()
592 int WindowBaseWin::GetNativeWindowId()
597 EGLNativeWindowType WindowBaseWin::CreateEglWindow( int width, int height )
599 return reinterpret_cast< EGLNativeWindowType >( mWin32Window );
602 void WindowBaseWin::DestroyEglWindow()
606 void WindowBaseWin::SetEglWindowRotation( int angle )
610 void WindowBaseWin::SetEglWindowBufferTransform( int angle )
614 void WindowBaseWin::SetEglWindowTransform( int angle )
618 void WindowBaseWin::ResizeEglWindow( PositionSize positionSize )
622 bool WindowBaseWin::IsEglWindowRotationSupported()
627 void WindowBaseWin::Move( PositionSize positionSize )
629 //ecore_x_window_move( mWin32Window, positionSize.x, positionSize.y );
632 void WindowBaseWin::Resize( PositionSize positionSize )
634 //ecore_x_window_resize( mWin32Window, positionSize.width, positionSize.height );
637 void WindowBaseWin::MoveResize( PositionSize positionSize )
639 //ecore_x_window_move_resize( mWin32Window, positionSize.x, positionSize.y, positionSize.width, positionSize.height );
642 void WindowBaseWin::ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode, Dali::Window::IndicatorBgOpacity opacityMode )
644 // DALI_LOG_TRACE_METHOD_FMT( gWindowBaseLogFilter, "visible : %d\n", visibleMode );
646 // if( visibleMode == Dali::Window::VISIBLE )
648 // // when the indicator is visible, set proper mode for indicator server according to bg mode
649 // if( opacityMode == Dali::Window::OPAQUE )
651 // ecore_x_e_illume_indicator_opacity_set( mWin32Window, ECORE_X_ILLUME_INDICATOR_OPAQUE );
653 // else if( opacityMode == Dali::Window::TRANSLUCENT )
655 // ecore_x_e_illume_indicator_opacity_set( mWin32Window, ECORE_X_ILLUME_INDICATOR_TRANSLUCENT );
657 //#if defined (DALI_PROFILE_MOBILE)
658 // else if( opacityMode == Dali::Window::TRANSPARENT )
660 // ecore_x_e_illume_indicator_opacity_set( mWin32Window, ECORE_X_ILLUME_INDICATOR_OPAQUE );
666 // // when the indicator is not visible, set TRANSPARENT mode for indicator server
667 // ecore_x_e_illume_indicator_opacity_set( mWin32Window, ECORE_X_ILLUME_INDICATOR_TRANSPARENT ); // it means hidden indicator
671 void WindowBaseWin::SetIndicatorProperties( bool isShow, Dali::Window::WindowOrientation lastOrientation )
673 /*int show_state = static_cast< int >( isShow );
674 ecore_x_window_prop_property_set( mWin32Window, ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE,
675 ECORE_X_ATOM_CARDINAL, 32, &show_state, 1 );
679 ecore_x_e_illume_indicator_state_set( mWin32Window, ECORE_X_ILLUME_INDICATOR_STATE_ON );
683 ecore_x_e_illume_indicator_state_set( mWin32Window, ECORE_X_ILLUME_INDICATOR_STATE_OFF );
687 void WindowBaseWin::IndicatorTypeChanged( IndicatorInterface::Type type )
691 void WindowBaseWin::SetClass( const std::string& name, const std::string& className )
693 //ecore_x_icccm_name_class_set( mWin32Window, name.c_str(), className.c_str() );
696 void WindowBaseWin::Raise()
698 //ecore_x_window_raise( mWin32Window );
701 void WindowBaseWin::Lower()
703 //ecore_x_window_lower( mWin32Window );
706 void WindowBaseWin::Activate()
708 //ecore_x_netwm_client_active_request( ecore_x_window_root_get( mWin32Window ), mWin32Window, 1 /* request type, 1:application, 2:pager */, 0 );
711 void WindowBaseWin::SetAvailableOrientations( const std::vector< Dali::Window::WindowOrientation >& orientations )
715 void WindowBaseWin::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
719 void WindowBaseWin::SetAcceptFocus( bool accept )
723 void WindowBaseWin::Show()
725 //ecore_x_window_show( mWin32Window );
728 void WindowBaseWin::Hide()
730 //ecore_x_window_hide( mWin32Window );
733 unsigned int WindowBaseWin::GetSupportedAuxiliaryHintCount() const
738 std::string WindowBaseWin::GetSupportedAuxiliaryHint( unsigned int index ) const
740 return std::string();
743 unsigned int WindowBaseWin::AddAuxiliaryHint( const std::string& hint, const std::string& value )
748 bool WindowBaseWin::RemoveAuxiliaryHint( unsigned int id )
753 bool WindowBaseWin::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
758 std::string WindowBaseWin::GetAuxiliaryHintValue( unsigned int id ) const
760 return std::string();
763 unsigned int WindowBaseWin::GetAuxiliaryHintId( const std::string& hint ) const
768 void WindowBaseWin::SetInputRegion( const Rect< int >& inputRegion )
772 void WindowBaseWin::SetType( Dali::Window::Type type )
776 bool WindowBaseWin::SetNotificationLevel( Dali::Window::NotificationLevel::Type level )
781 Dali::Window::NotificationLevel::Type WindowBaseWin::GetNotificationLevel() const
783 return Dali::Window::NotificationLevel::NONE;
786 void WindowBaseWin::SetOpaqueState( bool opaque )
790 bool WindowBaseWin::SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode)
795 Dali::Window::ScreenOffMode::Type WindowBaseWin::GetScreenOffMode() const
797 return Dali::Window::ScreenOffMode::TIMEOUT;
800 bool WindowBaseWin::SetBrightness( int brightness )
805 int WindowBaseWin::GetBrightness() const
810 bool WindowBaseWin::GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode )
815 bool WindowBaseWin::UngrabKey( Dali::KEY key )
820 bool WindowBaseWin::GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result )
825 bool WindowBaseWin::UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result )
830 void WindowBaseWin::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical )
835 //// 1 inch = 25.4 millimeters
836 WindowsPlatformImplement::GetDPI( xres, yres );
841 dpiHorizontal = int( xres + 0.5f ); // rounding
842 dpiVertical = int( yres + 0.5f );
845 void WindowBaseWin::SetViewMode( ViewMode viewMode )
849 int WindowBaseWin::GetScreenRotationAngle()
854 void WindowBaseWin::SetWindowRotationAngle( int degree )
858 void WindowBaseWin::WindowRotationCompleted( int degree, int width, int height )
862 void WindowBaseWin::SetTransparency( bool transparent )
866 unsigned int WindowBaseWin::GetSurfaceId( Any surface ) const
868 unsigned int surfaceId = 0;
870 if ( surface.Empty() == false )
872 // check we have a valid type
873 DALI_ASSERT_ALWAYS( ( (surface.GetType() == typeid ( winWindow ) ) || (surface.GetType() == typeid ( Win_Window_Handle ) ) )
874 && "Surface type is invalid" );
876 if ( surface.GetType() == typeid ( Win_Window_Handle ) )
878 surfaceId = AnyCast< Win_Window_Handle >( surface );
882 surfaceId = AnyCast< winWindow >( surface );
888 void WindowBaseWin::CreateWinWindow( PositionSize positionSize, bool isTransparent )
890 long hWnd = WindowsPlatformImplement::CreateHwnd( "Demo", "Demo", positionSize.x, positionSize.y, positionSize.width, positionSize.height, NULL );
\r
892 WindowsPlatformImplement::ShowWindow( hWnd );
\r
894 mWin32Window = (Win_Window_Handle)hWnd;
\r
895 DALI_ASSERT_ALWAYS( mWin32Window != 0 && "There is no EcoreWin window" );
898 } // namespace Adaptor
900 } // namespace Internal
904 #pragma GCC diagnostic pop