static DFBResult IDirectFBWindow_Resize( IDirectFBWindow *thiz, int width, int height ) { DFBResult ret; DFBInsets insets; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow) D_DEBUG_AT( IDirectFB_Window, "%s()\n", __FUNCTION__ ); if (data->destroyed) return DFB_DESTROYED; if (width < 1 || width > 4096 || height < 1 || height > 4096) return DFB_INVARG; dfb_windowstack_lock( data->window->stack ); dfb_wm_get_insets( data->window->stack, data->window, &insets ); width += insets.l+insets.r; height += insets.t+insets.b; ret = dfb_window_resize( data->window, width, height ); dfb_windowstack_unlock( data->window->stack ); return ret; }
static DFBResult IDirectFBWindow_GetSize( IDirectFBWindow *thiz, int *width, int *height ) { DFBInsets insets; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow) D_DEBUG_AT( IDirectFB_Window, "%s()\n", __FUNCTION__ ); if (data->destroyed) return DFB_DESTROYED; if (!width && !height) return DFB_INVARG; dfb_windowstack_lock( data->window->stack ); dfb_wm_get_insets( data->window->stack, data->window, &insets ); dfb_windowstack_unlock( data->window->stack ); if (width) *width = data->window->config.bounds.w-insets.l-insets.r; if (height) *height = data->window->config.bounds.h-insets.t-insets.b; return DFB_OK; }
static DFBResult IDirectFBWindow_GetPosition( IDirectFBWindow *thiz, int *x, int *y ) { DFBInsets insets; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow) D_DEBUG_AT( IDirectFB_Window, "%s()\n", __FUNCTION__ ); if (data->destroyed) return DFB_DESTROYED; if (!x && !y) return DFB_INVARG; dfb_windowstack_lock( data->window->stack ); dfb_wm_get_insets( data->window->stack, data->window, &insets ); dfb_windowstack_unlock( data->window->stack ); if (x) *x = data->window->config.bounds.x-insets.l; if (y) *y = data->window->config.bounds.y-insets.t; return DFB_OK; }
DFBResult IWindow_Real::GetInsets( DFBInsets *ret_insets ) { DFBResult ret; D_DEBUG_AT( Core_Window, "IWindow_Real::%s()\n", __FUNCTION__ ); ret = (DFBResult) dfb_layer_context_lock( obj->stack->context ); if (ret) return ret; ret = dfb_wm_get_insets( obj->stack, obj, ret_insets ); dfb_layer_context_unlock( obj->stack->context ); return ret; }
DFBResult IWindowStack_Real::GetInsets( CoreWindow *window, DFBInsets *ret_insets ) { DFBResult ret; D_DEBUG_AT( DirectFB_CoreWindowStack, "IWindowStack_Real::%s()\n", __FUNCTION__ ); ret = (DFBResult) dfb_layer_context_lock( obj->context ); if (ret) return ret; ret = dfb_wm_get_insets( obj, window, ret_insets ); dfb_layer_context_unlock( obj->context ); return ret; }
DFBResult IWindow_Real::Resize( int width, int height ) { DFBResult ret; DFBInsets insets; D_DEBUG_AT( Core_Window, "IWindow_Real::%s( %p )\n", __FUNCTION__, obj ); D_MAGIC_ASSERT( obj, CoreWindow ); dfb_windowstack_lock( obj->stack ); dfb_wm_get_insets( obj->stack, obj, &insets ); ret = dfb_window_resize( obj, width + insets.l+insets.r, height + insets.t+insets.b ); dfb_windowstack_unlock( obj->stack ); return ret; }
DFBResult IWindow_Real::MoveTo( int x, int y ) { DFBResult ret; DFBInsets insets; D_DEBUG_AT( Core_Window, "IWindow_Real::%s( %p )\n", __FUNCTION__, obj ); D_MAGIC_ASSERT( obj, CoreWindow ); dfb_windowstack_lock( obj->stack ); dfb_wm_get_insets( obj->stack, obj, &insets ); ret = dfb_window_move( obj, x + insets.l, y + insets.t, false ); dfb_windowstack_unlock( obj->stack ); return ret; }
static DFBResult IDirectFBWindow_MoveTo( IDirectFBWindow *thiz, int x, int y ) { DFBResult ret; DFBInsets insets; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow) D_DEBUG_AT( IDirectFB_Window, "%s()\n", __FUNCTION__ ); if (data->destroyed) return DFB_DESTROYED; dfb_windowstack_lock( data->window->stack ); dfb_wm_get_insets( data->window->stack, data->window, &insets ); x += insets.l; y += insets.t; ret = dfb_window_move( data->window, x, y, false ); dfb_windowstack_unlock( data->window->stack ); return ret; }