directfb: remove useless code manipulating window's private data
The window management code used to deal with gdk internals. It seems a lot of code has been pushed to the generic gdk code, so we remove useless code. Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
This commit is contained in:

committed by
Sven Neumann

parent
737f035959
commit
333d53b342
@ -552,26 +552,17 @@ _gdk_window_impl_new (GdkWindow *window,
|
|||||||
private = GDK_WINDOW_OBJECT (window);
|
private = GDK_WINDOW_OBJECT (window);
|
||||||
private->impl = (GdkDrawable *)impl;
|
private->impl = (GdkDrawable *)impl;
|
||||||
|
|
||||||
private->x = (attributes_mask & GDK_WA_X) ? attributes->x : 0;
|
|
||||||
private->y = (attributes_mask & GDK_WA_Y) ? attributes->y : 0;
|
|
||||||
|
|
||||||
parent_private = GDK_WINDOW_OBJECT (real_parent);
|
parent_private = GDK_WINDOW_OBJECT (real_parent);
|
||||||
parent_impl = GDK_WINDOW_IMPL_DIRECTFB (parent_private->impl);
|
parent_impl = GDK_WINDOW_IMPL_DIRECTFB (parent_private->impl);
|
||||||
|
|
||||||
private->parent = parent_private;
|
|
||||||
|
|
||||||
impl->drawable.width = MAX (1, attributes->width);
|
impl->drawable.width = MAX (1, attributes->width);
|
||||||
impl->drawable.height = MAX (1, attributes->height);
|
impl->drawable.height = MAX (1, attributes->height);
|
||||||
|
|
||||||
private->window_type = attributes->window_type;
|
|
||||||
|
|
||||||
desc.flags = 0;
|
desc.flags = 0;
|
||||||
|
|
||||||
switch (attributes->wclass)
|
switch (attributes->wclass)
|
||||||
{
|
{
|
||||||
case GDK_INPUT_OUTPUT:
|
case GDK_INPUT_OUTPUT:
|
||||||
private->input_only = FALSE;
|
|
||||||
|
|
||||||
desc.flags |= DWDESC_PIXELFORMAT;
|
desc.flags |= DWDESC_PIXELFORMAT;
|
||||||
desc.pixelformat = ((GdkVisualDirectFB *)visual)->format;
|
desc.pixelformat = ((GdkVisualDirectFB *)visual)->format;
|
||||||
|
|
||||||
@ -584,7 +575,6 @@ _gdk_window_impl_new (GdkWindow *window,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case GDK_INPUT_ONLY:
|
case GDK_INPUT_ONLY:
|
||||||
private->input_only = TRUE;
|
|
||||||
desc.flags |= DWDESC_CAPS;
|
desc.flags |= DWDESC_CAPS;
|
||||||
desc.caps = DWCAPS_INPUTONLY;
|
desc.caps = DWCAPS_INPUTONLY;
|
||||||
break;
|
break;
|
||||||
@ -653,8 +643,6 @@ _gdk_window_impl_new (GdkWindow *window,
|
|||||||
impl->drawable.surface->GetPixelFormat (impl->drawable.surface,
|
impl->drawable.surface->GetPixelFormat (impl->drawable.surface,
|
||||||
&impl->drawable.format);
|
&impl->drawable.format);
|
||||||
|
|
||||||
private->depth = DFB_BITS_PER_PIXEL (impl->drawable.format);
|
|
||||||
|
|
||||||
if ((attributes_mask & GDK_WA_COLORMAP) && attributes->colormap)
|
if ((attributes_mask & GDK_WA_COLORMAP) && attributes->colormap)
|
||||||
{
|
{
|
||||||
colormap = attributes->colormap;
|
colormap = attributes->colormap;
|
||||||
@ -672,17 +660,12 @@ _gdk_window_impl_new (GdkWindow *window,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
impl->drawable.format = ((GdkVisualDirectFB *)visual)->format;
|
impl->drawable.format = ((GdkVisualDirectFB *)visual)->format;
|
||||||
private->depth = visual->depth;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gdk_window_set_cursor (window,
|
gdk_window_set_cursor (window,
|
||||||
((attributes_mask & GDK_WA_CURSOR) ?
|
((attributes_mask & GDK_WA_CURSOR) ?
|
||||||
(attributes->cursor) : NULL));
|
(attributes->cursor) : NULL));
|
||||||
|
|
||||||
if (parent_private)
|
|
||||||
parent_private->children = g_list_prepend (parent_private->children,
|
|
||||||
window);
|
|
||||||
|
|
||||||
/* we hold a reference count on ourself */
|
/* we hold a reference count on ourself */
|
||||||
g_object_ref (window);
|
g_object_ref (window);
|
||||||
|
|
||||||
@ -1245,8 +1228,6 @@ show_window_internal (GdkWindow *window,
|
|||||||
|
|
||||||
if (!private->destroyed && !GDK_WINDOW_IS_MAPPED (private))
|
if (!private->destroyed && !GDK_WINDOW_IS_MAPPED (private))
|
||||||
{
|
{
|
||||||
private->state &= ~GDK_WINDOW_STATE_WITHDRAWN;
|
|
||||||
|
|
||||||
if (raise)
|
if (raise)
|
||||||
gdk_window_raise (window);
|
gdk_window_raise (window);
|
||||||
|
|
||||||
@ -1309,8 +1290,6 @@ gdk_directfb_window_hide (GdkWindow *window)
|
|||||||
{
|
{
|
||||||
GdkEvent *event;
|
GdkEvent *event;
|
||||||
|
|
||||||
private->state |= GDK_WINDOW_STATE_WITHDRAWN;
|
|
||||||
|
|
||||||
if (!private->input_only && private->parent)
|
if (!private->input_only && private->parent)
|
||||||
{
|
{
|
||||||
gdk_window_clear_area (GDK_WINDOW (private->parent),
|
gdk_window_clear_area (GDK_WINDOW (private->parent),
|
||||||
@ -1362,9 +1341,6 @@ _gdk_directfb_move_resize_child (GdkWindow *window,
|
|||||||
private = GDK_WINDOW_OBJECT (window);
|
private = GDK_WINDOW_OBJECT (window);
|
||||||
impl = GDK_WINDOW_IMPL_DIRECTFB (private->impl);
|
impl = GDK_WINDOW_IMPL_DIRECTFB (private->impl);
|
||||||
|
|
||||||
private->x = x;
|
|
||||||
private->y = y;
|
|
||||||
|
|
||||||
impl->drawable.width = width;
|
impl->drawable.width = width;
|
||||||
impl->drawable.height = height;
|
impl->drawable.height = height;
|
||||||
|
|
||||||
@ -1393,16 +1369,6 @@ _gdk_directfb_move_resize_child (GdkWindow *window,
|
|||||||
&impl->drawable.surface);
|
&impl->drawable.surface);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (list = private->children; list; list = list->next)
|
|
||||||
{
|
|
||||||
private = GDK_WINDOW_OBJECT (list->data);
|
|
||||||
impl = GDK_WINDOW_IMPL_DIRECTFB (private->impl);
|
|
||||||
|
|
||||||
_gdk_directfb_move_resize_child (list->data,
|
|
||||||
private->x, private->y,
|
|
||||||
impl->drawable.width, impl->drawable.height);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1420,8 +1386,6 @@ gdk_directfb_window_move (GdkWindow *window,
|
|||||||
|
|
||||||
if (impl->window)
|
if (impl->window)
|
||||||
{
|
{
|
||||||
private->x = x;
|
|
||||||
private->y = y;
|
|
||||||
impl->window->MoveTo (impl->window, x, y);
|
impl->window->MoveTo (impl->window, x, y);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1500,8 +1464,6 @@ gdk_directfb_window_move_resize (GdkWindow *window,
|
|||||||
else if (impl->window)
|
else if (impl->window)
|
||||||
{
|
{
|
||||||
if (with_move) {
|
if (with_move) {
|
||||||
private->x = x;
|
|
||||||
private->y = y;
|
|
||||||
impl->window->MoveTo (impl->window, x, y);
|
impl->window->MoveTo (impl->window, x, y);
|
||||||
}
|
}
|
||||||
impl->drawable.width = width;
|
impl->drawable.width = width;
|
||||||
@ -1572,14 +1534,6 @@ gdk_directfb_window_reparent (GdkWindow *window,
|
|||||||
|
|
||||||
window_private->parent = (GdkWindowObject *) new_parent;
|
window_private->parent = (GdkWindowObject *) new_parent;
|
||||||
|
|
||||||
if (old_parent_private)
|
|
||||||
{
|
|
||||||
old_parent_private->children =
|
|
||||||
g_list_remove (old_parent_private->children, window);
|
|
||||||
}
|
|
||||||
|
|
||||||
parent_private->children = g_list_prepend (parent_private->children, window);
|
|
||||||
|
|
||||||
impl = GDK_WINDOW_IMPL_DIRECTFB (window_private->impl);
|
impl = GDK_WINDOW_IMPL_DIRECTFB (window_private->impl);
|
||||||
|
|
||||||
if (impl->drawable.surface) {
|
if (impl->drawable.surface) {
|
||||||
@ -1810,61 +1764,20 @@ static void
|
|||||||
gdk_directfb_window_set_background (GdkWindow *window,
|
gdk_directfb_window_set_background (GdkWindow *window,
|
||||||
const GdkColor *color)
|
const GdkColor *color)
|
||||||
{
|
{
|
||||||
GdkWindowObject *private;
|
|
||||||
|
|
||||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||||
|
|
||||||
g_return_if_fail (color != NULL);
|
g_return_if_fail (color != NULL);
|
||||||
|
|
||||||
D_DEBUG_AT (GDKDFB_Window, "%s( %p, %d,%d,%d )\n", G_STRFUNC,
|
D_DEBUG_AT (GDKDFB_Window, "%s( %p, %d,%d,%d )\n", G_STRFUNC,
|
||||||
window, color->red, color->green, color->blue);
|
window, color->red, color->green, color->blue);
|
||||||
|
|
||||||
private = GDK_WINDOW_OBJECT (window);
|
|
||||||
private->bg_color = *color;
|
|
||||||
|
|
||||||
if (private->bg_pixmap &&
|
|
||||||
private->bg_pixmap != GDK_PARENT_RELATIVE_BG &&
|
|
||||||
private->bg_pixmap != GDK_NO_BG)
|
|
||||||
g_object_unref (private->bg_pixmap);
|
|
||||||
|
|
||||||
private->bg_pixmap = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gdk_directfb_window_set_back_pixmap (GdkWindow *window,
|
gdk_directfb_window_set_back_pixmap (GdkWindow *window,
|
||||||
GdkPixmap *pixmap)
|
GdkPixmap *pixmap)
|
||||||
{
|
{
|
||||||
GdkWindowObject *private;
|
|
||||||
|
|
||||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||||
|
|
||||||
D_DEBUG_AT (GDKDFB_Window, "%s( %p, %p )\n", G_STRFUNC, window, pixmap);
|
D_DEBUG_AT (GDKDFB_Window, "%s( %p, %p )\n", G_STRFUNC, window, pixmap);
|
||||||
|
|
||||||
private = GDK_WINDOW_OBJECT (window);
|
|
||||||
|
|
||||||
if (private->bg_pixmap &&
|
|
||||||
private->bg_pixmap != GDK_PARENT_RELATIVE_BG &&
|
|
||||||
private->bg_pixmap != GDK_NO_BG)
|
|
||||||
{
|
|
||||||
g_object_unref (private->bg_pixmap);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pixmap == GDK_PARENT_RELATIVE_BG)
|
|
||||||
{
|
|
||||||
private->bg_pixmap = GDK_PARENT_RELATIVE_BG;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (pixmap)
|
|
||||||
{
|
|
||||||
g_object_ref (pixmap);
|
|
||||||
private->bg_pixmap = pixmap;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
private->bg_pixmap = GDK_NO_BG;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Reference in New Issue
Block a user