mBrightness( 0 ),
mBrightnessChangeState( 0 ),
mBrightnessChangeDone( true ),
+ mVisible( true ),
+ mWindowPositionSize( positionSize ),
mOwnSurface( false ),
mMoveResizeSerial( 0 ),
- mLastSubmittedMoveResizeSerial( 0 )
+ mLastSubmittedMoveResizeSerial( 0 ),
+ mWindowRotationAngle( 0 ),
+ mScreenRotationAngle( 0 ),
+ mSupportedPreProtation( 0 )
#ifdef DALI_ELDBUS_AVAILABLE
, mSystemConnection( NULL )
#endif
CreateWindow( positionSize );
}
+ for( int i = 0; i < 4; ++i )
+ {
+ mAvaiableWindowOrientations[i] = 0;
+ }
+
mWlSurface = ecore_wl2_window_surface_get( mEcoreWindow );
SetTransparency( isTransparent );
rotationEvent.height = ev->w;
}
+ mWindowPositionSize.width = rotationEvent.width;
+ mWindowPositionSize.height = rotationEvent.height;
+
mRotationSignal.Emit( rotationEvent );
}
}
mTouchEventSignal.Emit( point, touchEvent->timestamp );
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnMouseButtonCancel\n" );
+ DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnMouseButtonCancel\n" );
}
}
if( mouseWheelEvent->window == static_cast< unsigned int >( ecore_wl2_window_id_get( mEcoreWindow ) ) )
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnMouseWheel: direction: %d, modifiers: %d, x: %d, y: %d, z: %d\n", mouseWheelEvent->direction, mouseWheelEvent->modifiers, mouseWheelEvent->x, mouseWheelEvent->y, mouseWheelEvent->z );
+ DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnMouseWheel: direction: %d, modifiers: %d, x: %d, y: %d, z: %d\n", mouseWheelEvent->direction, mouseWheelEvent->modifiers, mouseWheelEvent->x, mouseWheelEvent->y, mouseWheelEvent->z );
WheelEvent wheelEvent( WheelEvent::MOUSE_WHEEL, mouseWheelEvent->direction, mouseWheelEvent->modifiers, Vector2( mouseWheelEvent->x, mouseWheelEvent->y ), mouseWheelEvent->z, mouseWheelEvent->timestamp );
{
Ecore_Event_Detent_Rotate* detentEvent = static_cast< Ecore_Event_Detent_Rotate* >( event );
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl::OnDetentRotation\n" );
+ DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl2::OnDetentRotation\n" );
int direction = ( detentEvent->direction == ECORE_DETENT_DIRECTION_CLOCKWISE ) ? 1 : -1;
int timeStamp = detentEvent->timestamp;
- WheelEvent wheelEvent( WheelEvent::CUSTOM_WHEEL, 0, 0, Vector2( 0.0f, 0.0f ), direction, timeStamp );
+ WheelEvent wheelEvent( WheelEvent::CUSTOM_WHEEL, direction, 0, Vector2( 0.0f, 0.0f ), 0, timeStamp );
mWheelEventSignal.Emit( wheelEvent );
}
if( keyEvent->window == static_cast< unsigned int >( ecore_wl2_window_id_get( mEcoreWindow ) ) )
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnKeyDown\n" );
+ DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnKeyDown\n" );
std::string keyName( keyEvent->keyname );
std::string logicalKey( "" );
if( keyEvent->window == static_cast< unsigned int >( ecore_wl2_window_id_get( mEcoreWindow ) ) )
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnKeyUp\n" );
+ DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnKeyUp\n" );
std::string keyName( keyEvent->keyname );
std::string logicalKey( "" );
EGLNativeWindowType WindowBaseEcoreWl2::CreateEglWindow( int width, int height )
{
- mEglWindow = wl_egl_window_create( mWlSurface, width, height );
+ int totalAngle = (mWindowRotationAngle + mScreenRotationAngle) % 360;
+ if( totalAngle == 90 || totalAngle == 270 )
+ {
+ mEglWindow = wl_egl_window_create( mWlSurface, height, width );
+ }
+ else
+ {
+ mEglWindow = wl_egl_window_create( mWlSurface, width, height );
+ }
return static_cast< EGLNativeWindowType >( mEglWindow );
}
wl_egl_window_tizen_capability capability = static_cast< wl_egl_window_tizen_capability >( wl_egl_window_tizen_get_capabilities( mEglWindow ) );
if( capability == WL_EGL_WINDOW_TIZEN_CAPABILITY_ROTATION_SUPPORTED )
{
+ mSupportedPreProtation = true;
return true;
}
-
+ mSupportedPreProtation = false;
return false;
}
void WindowBaseEcoreWl2::Move( PositionSize positionSize )
{
+ mWindowPositionSize = positionSize;
ecore_wl2_window_position_set( mEcoreWindow, positionSize.x, positionSize.y );
}
void WindowBaseEcoreWl2::Resize( PositionSize positionSize )
{
+ mWindowPositionSize = positionSize;
ecore_wl2_window_geometry_set( mEcoreWindow, positionSize.x, positionSize.y, positionSize.width, positionSize.height );
}
void WindowBaseEcoreWl2::MoveResize( PositionSize positionSize )
{
+ mWindowPositionSize = positionSize;
ecore_wl2_window_sync_geometry_set( mEcoreWindow, ++mMoveResizeSerial, positionSize.x, positionSize.y, positionSize.width, positionSize.height );
}
void WindowBaseEcoreWl2::SetAvailableAnlges( const std::vector< int >& angles )
{
- int rotations[4] = { 0 };
DALI_LOG_RELEASE_INFO( "WindowBaseEcoreWl2::SetAvailableAnlges, angle's count: %d, angles\n", angles.size() );
- for( std::size_t i = 0; i < angles.size(); ++i )
+ std::size_t size = angles.size();
+ for( std::size_t i = 0; i < size; ++i )
{
- rotations[i] = static_cast< int >( angles[i] );
- DALI_LOG_RELEASE_INFO( "%d ", rotations[i] );
+ mAvaiableWindowOrientations[i] = static_cast< int >( angles[i] );
+ DALI_LOG_RELEASE_INFO( "%d ", mAvaiableWindowOrientations[i] );
}
- ecore_wl2_window_available_rotations_set( mEcoreWindow, rotations, angles.size() );
+ ecore_wl2_window_available_rotations_set( mEcoreWindow, mAvaiableWindowOrientations, size );
}
void WindowBaseEcoreWl2::SetPreferredAngle( int angle )
{
+ DALI_LOG_RELEASE_INFO( "WindowBaseEcoreWl2::SetPreferredAngle, angle: %d\n", angle );
ecore_wl2_window_preferred_rotation_set( mEcoreWindow, angle );
}
void WindowBaseEcoreWl2::Show()
{
+ if( !mVisible )
+ {
+ ecore_wl2_window_geometry_set( mEcoreWindow, mWindowPositionSize.x, mWindowPositionSize.y, mWindowPositionSize.width, mWindowPositionSize.height );
+ }
+ mVisible = true;
+
ecore_wl2_window_show( mEcoreWindow );
}
void WindowBaseEcoreWl2::Hide()
{
+ mVisible = false;
ecore_wl2_window_hide( mEcoreWindow );
}
dpiVertical = int( yres + 0.5f );
}
+int WindowBaseEcoreWl2::GetOrientation() const
+{
+ int orientation = (mScreenRotationAngle + mWindowRotationAngle) % 360;
+ if( mSupportedPreProtation )
+ {
+ orientation = 0;
+ }
+ return orientation;
+}
+
int WindowBaseEcoreWl2::GetScreenRotationAngle()
{
int transform = 0;
{
transform = ecore_wl2_output_transform_get( ecore_wl2_window_output_find( mEcoreWindow ) );
}
-
- return transform * 90;
+ mScreenRotationAngle = transform * 90;
+ return mScreenRotationAngle;
}
void WindowBaseEcoreWl2::SetWindowRotationAngle( int degree )
{
+ mWindowRotationAngle = degree;
ecore_wl2_window_rotation_set( mEcoreWindow, degree );
}
+int WindowBaseEcoreWl2::GetWindowRotationAngle()
+{
+ return mWindowRotationAngle;
+}
+
void WindowBaseEcoreWl2::WindowRotationCompleted( int degree, int width, int height )
{
ecore_wl2_window_rotation_change_done_send( mEcoreWindow, degree, width, height );
DALI_ASSERT_ALWAYS( 0 && "Failed to get display" );
}
+ ecore_wl2_display_sync( display );
+
mEcoreWindow = ecore_wl2_window_new( display, NULL, positionSize.x, positionSize.y, positionSize.width, positionSize.height );
if ( mEcoreWindow == 0 )
ecore_wl2_window_parent_set( mEcoreWindow, ecoreParent );
}
+int WindowBaseEcoreWl2::CreateFrameRenderedSyncFence()
+{
+ return wl_egl_window_tizen_create_commit_sync_fd( mEglWindow );
+}
+
+int WindowBaseEcoreWl2::CreateFramePresentedSyncFence()
+{
+ return wl_egl_window_tizen_create_presentation_sync_fd( mEglWindow );
+}
+
} // namespace Adaptor
} // namespace Internal