};
-Window* Window::New(const PositionSize& posSize, const std::string& name, const std::string& className, bool isTransparent)
+Window* Window::New( const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent )
{
Window* window = new Window();
window->mIsTransparent = isTransparent;
- window->Initialize(posSize, name, className);
+ window->Initialize( positionSize, name, className );
return window;
}
mIsFocusAcceptable( true ),
mVisible( true ),
mOpaqueState( false ),
+ mResizeEnabled( true ),
mIndicator( NULL ),
mIndicatorOrientation( Dali::Window::PORTRAIT ),
mNextIndicatorOrientation( Dali::Window::PORTRAIT ),
mIndicatorOpacityMode( Dali::Window::OPAQUE ),
mOverlay( NULL ),
mAdaptor( NULL ),
- mType( Dali::DevelWindow::NORMAL ),
+ mType( Dali::Window::NORMAL ),
mEventHandler( NULL ),
mPreferredOrientation( Dali::Window::PORTRAIT ),
mSupportedAuxiliaryHints(),
- mAuxiliaryHints()
+ mAuxiliaryHints(),
+ mIndicatorVisibilityChangedSignal(),
+ mFocusChangedSignal(),
+ mResizedSignal(),
+ mDeleteRequestSignal()
{
-
- // Detect if we're not running in a ecore main loop (e.g. libuv).
- // Typically ecore_x_init is called by app_efl_main->elm_init
- // but if we're not using app_efl_main then we have to call it ourselves
- // This is a hack until we create a pure X Window class
- if( ecore_x_display_get() == NULL )
- {
- mEcoreEventHander = false;
- ecore_x_init (NULL); // internally calls _ecore_x_input_init
- }
-
}
Window::~Window()
delete mSurface;
}
-void Window::Initialize(const PositionSize& windowPosition, const std::string& name, const std::string& className)
+void Window::Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className)
{
// create an X11 window by default
Any surface;
- ECore::WindowRenderSurface* windowSurface = new ECore::WindowRenderSurface( windowPosition, surface, name, className, mIsTransparent );
+ ECore::WindowRenderSurface* windowSurface = new ECore::WindowRenderSurface( positionSize, surface, name, className, mIsTransparent );
windowSurface->Map();
mSurface = windowSurface;
mIsFocusAcceptable = accept;
}
-bool Window::IsFocusAcceptable()
+bool Window::IsFocusAcceptable() const
{
return mIsFocusAcceptable;
}
ecore_x_window_prop_property_set( ecoreWindow,
ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
ECORE_X_ATOM_CARDINAL, 32, &angles, 2 );
+
+ mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( width, height ) );
+
+ // Emit signal
+ mResizedSignal.Emit( Dali::Window::WindowSize( width, height ) );
+
+ mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( width, height ) );
#endif // DALI_PROFILE_UBUNTU
}
}
-unsigned int Window::GetSupportedAuxiliaryHintCount()
+void Window::SetIndicatorVisibleMode( Dali::Window::IndicatorVisibleMode mode )
+{
+ mIndicatorVisible = mode;
+}
+
+unsigned int Window::GetSupportedAuxiliaryHintCount() const
{
return 0;
}
-std::string Window::GetSupportedAuxiliaryHint( unsigned int index )
+std::string Window::GetSupportedAuxiliaryHint( unsigned int index ) const
{
return std::string();
}
{
}
-void Window::SetType( Dali::DevelWindow::Type type )
+void Window::SetType( Dali::Window::Type type )
{
mType = type;
}
-Dali::DevelWindow::Type Window::GetType() const
+Dali::Window::Type Window::GetType() const
{
return mType;
}
-bool Window::SetNotificationLevel( Dali::DevelWindow::NotificationLevel::Type level )
+bool Window::SetNotificationLevel( Dali::Window::NotificationLevel::Type level )
{
return false;
}
-Dali::DevelWindow::NotificationLevel::Type Window::GetNotificationLevel()
+Dali::Window::NotificationLevel::Type Window::GetNotificationLevel() const
{
- return Dali::DevelWindow::NotificationLevel::NONE;
+ return Dali::Window::NotificationLevel::NONE;
}
void Window::SetOpaqueState( bool opaque )
mOpaqueState = opaque;
}
-bool Window::IsOpaqueState()
+bool Window::IsOpaqueState() const
{
return mOpaqueState;
}
-bool Window::SetScreenMode( Dali::DevelWindow::ScreenMode::Type screenMode )
+bool Window::SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode)
{
return false;
}
-Dali::DevelWindow::ScreenMode::Type Window::GetScreenMode()
+Dali::Window::ScreenOffMode::Type Window::GetScreenOffMode() const
{
- return Dali::DevelWindow::ScreenMode::DEFAULT;
+ return Dali::Window::ScreenOffMode::TIMEOUT;
}
bool Window::SetBrightness( int brightness )
return false;
}
-int Window::GetBrightness()
+int Window::GetBrightness() const
{
return 0;
}
+void Window::SetSize( Dali::Window::WindowSize size )
+{
+ PositionSize positionSize = mSurface->GetPositionSize();
+
+ if( positionSize.width != size.GetWidth() || positionSize.height != size.GetHeight() )
+ {
+ positionSize.width = size.GetWidth();
+ positionSize.height = size.GetHeight();
+
+ mSurface->MoveResize( positionSize );
+
+ mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+
+ // Emit signal
+ mResizedSignal.Emit( Dali::Window::WindowSize( positionSize.width, positionSize.height ) );
+
+ mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ }
+}
+
+Dali::Window::WindowSize Window::GetSize() const
+{
+ PositionSize positionSize = mSurface->GetPositionSize();
+
+ return Dali::Window::WindowSize( positionSize.width, positionSize.height );
+}
+
+void Window::SetPosition( Dali::Window::WindowPosition position )
+{
+ PositionSize positionSize = mSurface->GetPositionSize();
+
+ if( positionSize.x != position.GetX() || positionSize.y != position.GetY() )
+ {
+ positionSize.x = position.GetX();
+ positionSize.y = position.GetY();
+
+ mSurface->MoveResize( positionSize );
+ }
+}
+
+Dali::Window::WindowPosition Window::GetPosition() const
+{
+ PositionSize positionSize = mSurface->GetPositionSize();
+
+ return Dali::Window::WindowPosition( positionSize.x, positionSize.y );
+}
+
+void Window::SetTransparency( bool transparent )
+{
+}
+
} // Adaptor
} // Internal