GTK+ 2.14 and directFB
Sven Neumann
s.neumann at phase-zero.de
Sat Feb 21 11:54:07 UTC 2009
Hi,
I am somewhat surprised that there is still no GTK+ 2.14 package that
has the DirectFB fixes applied, not even in experimental. I spent the
last two evenings to fix all problems you pointed out. If there are
still issues with the graphical installer, then I would like you to tell
me about them.
I suggest that you patch gtk+-2.4.7 with the full set of changes that I
applied to the gtk-2-14 branch in svn.gnome.org. This will give you the
state of the DirectFB port that will be released as GTK+ 2.4.8. I have
attached a patch with these changes to this mail.
Looking forward to see gtk+ 2.14 and GNOME 2.24 finally appear in sid,
Sven
-------------- next part --------------
Index: gdk/directfb/gdkevents-directfb.c
===================================================================
--- gdk/directfb/gdkevents-directfb.c (revision 22357)
+++ gdk/directfb/gdkevents-directfb.c (working copy)
@@ -162,24 +162,22 @@ dfb_events_process_window_event (DFBWind
static gboolean
gdk_event_send_client_message_by_window (GdkEvent *event,
- GdkWindow *window)
+ GdkWindow *window)
{
- GdkEvent *new_event;
+ DFBUserEvent evt;
g_return_val_if_fail(event != NULL, FALSE);
g_return_val_if_fail(GDK_IS_WINDOW(window), FALSE);
- new_event = gdk_directfb_event_make (window, GDK_CLIENT_EVENT);
- new_event->client.message_type = event->client.message_type;
- new_event->client.data_format = event->client.data_format;
- memcpy(&new_event->client.data,
- &event->client.data,
- sizeof(event->client.data));
+ evt.clazz = DFEC_USER;
+ evt.type = GPOINTER_TO_UINT (GDK_ATOM_TO_POINTER (event->client.message_type));
+ evt.data = (void *) event->client.data.l[0];
+
+ _gdk_display->buffer->PostEvent(_gdk_display->buffer, DFB_EVENT (&evt));
return TRUE;
}
-
static void
dfb_events_dispatch (void)
{
@@ -230,6 +228,32 @@ dfb_events_io_func (GIOChannel *channe
else
dfb_events_process_window_event (&event->window);
break;
+
+ case DFEC_USER:
+ {
+ GList *list;
+
+ GDK_NOTE (EVENTS, g_print (" client_message"));
+
+ for (list = client_filters; list; list = list->next)
+ {
+ GdkClientFilter *filter = list->data;
+ DFBUserEvent *user_event = (DFBUserEvent *) event;
+ GdkAtom type;
+
+ type = GDK_POINTER_TO_ATOM (GUINT_TO_POINTER (user_event->type));
+
+ if (filter->type == type)
+ {
+ if (filter->function (user_event,
+ NULL,
+ filter->data) != GDK_FILTER_CONTINUE)
+ break;
+ }
+ }
+ }
+ break;
+
default:
break;
}
@@ -395,7 +419,6 @@ gdk_directfb_event_windows_add (GdkWindo
impl->window->CreateEventBuffer (impl->window, &EventBuffer);
}
-#if (DIRECTFB_MAJOR_VERSION >= 1)
void
gdk_directfb_event_windows_remove (GdkWindow *window)
{
@@ -412,7 +435,6 @@ gdk_directfb_event_windows_remove (GdkWi
impl->window->DetachEventBuffer (impl->window, EventBuffer);
/* FIXME: should we warn if (! EventBuffer) ? */
}
-#endif
GdkWindow *
gdk_directfb_child_at (GdkWindow *window,
Index: gdk/directfb/gdkdisplay-directfb.c
===================================================================
--- gdk/directfb/gdkdisplay-directfb.c (revision 22357)
+++ gdk/directfb/gdkdisplay-directfb.c (working copy)
@@ -21,7 +21,7 @@
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
@@ -32,28 +32,23 @@
#include "gdkprivate-directfb.h"
#include "gdkscreen.h"
#include "gdkdisplaymanager.h"
-#include "gdkintl.h"
#include "gdkalias.h"
-
-extern void _gdk_visual_init (void);
-extern void _gdk_events_init (void);
-extern void _gdk_input_init (void);
-extern void _gdk_dnd_init (void);
-extern void _gdk_windowing_window_init (void);
-extern void _gdk_windowing_image_init (void);
-extern void _gdk_directfb_keyboard_init (void);
+extern void _gdk_visual_init (void);
+extern void _gdk_events_init (void);
+extern void _gdk_input_init (void);
+extern void _gdk_dnd_init (void);
+extern void _gdk_windowing_window_init (void);
+extern void _gdk_windowing_image_init (void);
+extern void _gdk_directfb_keyboard_init (void);
static gboolean gdk_directfb_argb_font = FALSE;
static gint gdk_directfb_glyph_surface_cache = 8;
-static gchar *directfb_args;
const GOptionEntry _gdk_windowing_args[] =
{
- { "dfb",0,0,G_OPTION_ARG_STRING,&directfb_args,N_("directfb arg"),N_("sdl|system")},
- { "dfb-help",0,0,G_OPTION_ARG_NONE, NULL,NULL},
{ "disable-aa-fonts",0,0,G_OPTION_ARG_INT,&gdk_directfb_monochrome_fonts,NULL,NULL },
{ "argb-font",0,0, G_OPTION_ARG_INT, &gdk_directfb_argb_font,NULL,NULL},
{ "transparent-unfocused",0,0, G_OPTION_ARG_INT, &gdk_directfb_apply_focus_opacity,NULL,NULL },
@@ -67,43 +62,35 @@ const GOptionEntry _gdk_windowing_args[]
**/
GdkDisplay * gdk_display_open (const gchar *display_name)
{
-
- if (_gdk_display) {
- return GDK_DISPLAY_OBJECT(_gdk_display); /* single display only */
- }
- DFBResult ret;
IDirectFB *directfb;
IDirectFBDisplayLayer *layer;
IDirectFBInputDevice *keyboard;
+ DFBResult ret;
- int argc=0;
- char **argv=NULL;
+ int argc = 0;
+ char **argv = NULL;
-#if 0 /* arg hack arg support broken*/
- if(directfb_args ) {
- argc=2;
- argv = (char **)g_malloc(sizeof(char *)*argc);
- argv[0] = "simple";
- argv[1] = "--dfb:system=SDL";
- }
-#endif
+ if (_gdk_display)
+ {
+ return GDK_DISPLAY_OBJECT(_gdk_display); /* single display only */
+ }
ret = DirectFBInit (&argc,&argv);
if (ret != DFB_OK)
-{
+ {
DirectFBError ("gdk_display_open: DirectFBInit", ret);
return NULL;
}
- ret = DirectFBCreate (&directfb);
-
+ ret = DirectFBCreate (&directfb);
if (ret != DFB_OK)
{
DirectFBError ("gdk_display_open: DirectFBCreate", ret);
return NULL;
}
- _gdk_display = g_object_new(GDK_TYPE_DISPLAY_DFB,NULL);
- _gdk_display->directfb=directfb;
+
+ _gdk_display = g_object_new (GDK_TYPE_DISPLAY_DFB, NULL);
+ _gdk_display->directfb = directfb;
ret = directfb->GetDisplayLayer (directfb, DLID_PRIMARY, &layer);
if (ret != DFB_OK)
@@ -130,11 +117,10 @@ GdkDisplay * gdk_display_open (const gch
_gdk_screen = g_object_new (GDK_TYPE_SCREEN, NULL);
_gdk_visual_init ();
+ _gdk_windowing_window_init ();
gdk_screen_set_default_colormap (_gdk_screen,
- gdk_screen_get_system_colormap (_gdk_screen));
- _gdk_windowing_window_init ();
- _gdk_windowing_image_init ();
+ gdk_screen_get_system_colormap (_gdk_screen)); _gdk_windowing_image_init ();
_gdk_input_init ();
_gdk_dnd_init ();
Index: gdk/directfb/gdkkeys-directfb.c
===================================================================
--- gdk/directfb/gdkkeys-directfb.c (revision 22357)
+++ gdk/directfb/gdkkeys-directfb.c (working copy)
@@ -1629,28 +1629,7 @@ gdk_directfb_translate_key (DFBInputDevi
break;
case DIKT_DEAD:
- switch (key_symbol)
- {
- case DIKS_DEAD_ABOVEDOT: keyval = GDK_dead_abovedot; break;
- case DIKS_DEAD_ABOVERING: keyval = GDK_dead_abovering; break;
- case DIKS_DEAD_ACUTE: keyval = GDK_dead_acute; break;
- case DIKS_DEAD_BREVE: keyval = GDK_dead_breve; break;
- case DIKS_DEAD_CARON: keyval = GDK_dead_caron; break;
- case DIKS_DEAD_CEDILLA: keyval = GDK_dead_cedilla; break;
- case DIKS_DEAD_CIRCUMFLEX: keyval = GDK_dead_circumflex; break;
- case DIKS_DEAD_DIAERESIS: keyval = GDK_dead_diaeresis; break;
- case DIKS_DEAD_DOUBLEACUTE: keyval = GDK_dead_doubleacute; break;
- case DIKS_DEAD_GRAVE: keyval = GDK_dead_grave; break;
- case DIKS_DEAD_IOTA: keyval = GDK_dead_iota; break;
- case DIKS_DEAD_MACRON: keyval = GDK_dead_macron; break;
- case DIKS_DEAD_OGONEK: keyval = GDK_dead_ogonek; break;
- case DIKS_DEAD_SEMIVOICED_SOUND:
- keyval = GDK_dead_semivoiced_sound; break;
- case DIKS_DEAD_TILDE: keyval = GDK_dead_tilde; break;
- case DIKS_DEAD_VOICED_SOUND: keyval = GDK_dead_voiced_sound; break;
- default:
- break;
- }
+ /* dead keys are handled directly by directfb */
break;
case DIKT_CUSTOM:
Index: gdk/directfb/gdkgeometry-directfb.c
===================================================================
--- gdk/directfb/gdkgeometry-directfb.c (revision 22357)
+++ gdk/directfb/gdkgeometry-directfb.c (working copy)
@@ -41,9 +41,9 @@
void
-_gdk_windowing_window_get_offsets (GdkWindow *window,
- gint *x_offset,
- gint *y_offset)
+_gdk_directfb_window_get_offsets (GdkWindow *window,
+ gint *x_offset,
+ gint *y_offset)
{
if (x_offset)
*x_offset = 0;
@@ -69,9 +69,9 @@ _gdk_windowing_window_queue_antiexpose (
* brings in from offscreen areas are invalidated.
**/
void
-gdk_window_scroll (GdkWindow *window,
- gint dx,
- gint dy)
+_gdk_directfb_window_scroll (GdkWindow *window,
+ gint dx,
+ gint dy)
{
GdkWindowObject *private;
GdkDrawableImplDirectFB *impl;
@@ -161,10 +161,10 @@ gdk_window_scroll (GdkWindow *window,
* Since: 2.8
**/
void
-gdk_window_move_region (GdkWindow *window,
- const GdkRegion *region,
- gint dx,
- gint dy)
+_gdk_directfb_window_move_region (GdkWindow *window,
+ const GdkRegion *region,
+ gint dx,
+ gint dy)
{
GdkWindowObject *private;
GdkDrawableImplDirectFB *impl;
Index: gdk/directfb/gdkdirectfb.h
===================================================================
--- gdk/directfb/gdkdirectfb.h (revision 22357)
+++ gdk/directfb/gdkdirectfb.h (working copy)
@@ -80,10 +80,8 @@ GdkVisual * gdk_directfb_visual_by_forma
IDirectFBWindow *gdk_directfb_window_lookup(GdkWindow *window);
IDirectFBSurface *gdk_directfb_surface_lookup(GdkWindow *window);
-#if (DIRECTFB_MAJOR_VERSION >= 1)
GdkWindow *gdk_directfb_create_child_window(GdkWindow *parent,
- IDirectFBSurface *subsurface);
-#endif
+ IDirectFBSurface *subsurface);
G_END_DECLS
Index: gdk/directfb/gdkwindow-directfb.c
===================================================================
--- gdk/directfb/gdkwindow-directfb.c (revision 22357)
+++ gdk/directfb/gdkwindow-directfb.c (working copy)
@@ -33,6 +33,7 @@
#include "config.h"
#include "gdk.h"
+#include "gdkwindowimpl.h"
#include "gdkwindow.h"
#include "gdkdirectfb.h"
@@ -67,6 +68,9 @@ static void gdk_window_impl_directfb_ini
static void gdk_window_impl_directfb_class_init (GdkWindowImplDirectFBClass *klass);
static void gdk_window_impl_directfb_finalize (GObject *object);
+static void gdk_window_impl_iface_init (GdkWindowImplIface *iface);
+
+
typedef struct
{
GdkWindowChildChanged changed;
@@ -98,9 +102,8 @@ gdk_window_directfb_process_all_updates
tmp_list = old_update_windows;
while (tmp_list)
{
- GdkWindowObject *private = GDK_WINDOW_OBJECT( tmp_list->data );
- GdkWindowImplDirectFB *wimpl = GDK_WINDOW_IMPL_DIRECTFB( private->impl );
-
+ GdkWindowObject *private = GDK_WINDOW_OBJECT( tmp_list->data );
+
if (private->update_freeze_count)
{
D_DEBUG_AT( GDKDFB_Updates, " -> %p frozen [%4d,%4d-%4dx%4d] (%d boxes)\n",
@@ -115,7 +118,7 @@ gdk_window_directfb_process_all_updates
wimpl->flips.num_regions );
gdk_window_process_updates(tmp_list->data,TRUE);
}
-
+
g_object_unref (tmp_list->data);
tmp_list = tmp_list->next;
}
@@ -186,11 +189,8 @@ static GdkWindow *gdk_directfb_window_co
static GdkWindow *gdk_directfb_focused_window = NULL;
static gpointer parent_class = NULL;
GdkWindow * _gdk_parent_root = NULL;
-static void
-gdk_window_impl_directfb_paintable_init (GdkPaintableIface *iface);
-
-
+static void gdk_window_impl_directfb_paintable_init (GdkPaintableIface *iface);
GType
@@ -213,20 +213,30 @@ gdk_window_impl_directfb_get_type (void)
(GInstanceInitFunc) gdk_window_impl_directfb_init,
};
- static const GInterfaceInfo paintable_info =
- {
- (GInterfaceInitFunc) gdk_window_impl_directfb_paintable_init,
- NULL,
- NULL
- };
+ static const GInterfaceInfo paintable_info =
+ {
+ (GInterfaceInitFunc) gdk_window_impl_directfb_paintable_init,
+ NULL,
+ NULL
+ };
+
+ static const GInterfaceInfo window_impl_info =
+ {
+ (GInterfaceInitFunc) gdk_window_impl_iface_init,
+ NULL,
+ NULL
+ };
object_type = g_type_register_static (GDK_TYPE_DRAWABLE_IMPL_DIRECTFB,
"GdkWindowImplDirectFB",
&object_info, 0);
- g_type_add_interface_static (object_type,
- GDK_TYPE_PAINTABLE,
- &paintable_info);
-
+ g_type_add_interface_static (object_type,
+ GDK_TYPE_PAINTABLE,
+ &paintable_info);
+
+ g_type_add_interface_static (object_type,
+ GDK_TYPE_WINDOW_IMPL,
+ &window_impl_info);
}
return object_type;
@@ -401,11 +411,11 @@ _gdk_windowing_window_init (void)
g_assert (_gdk_parent_root == NULL);
- _gdk_display->layer->GetConfiguration(
- _gdk_display->layer, &dlc );
+ _gdk_display->layer->GetConfiguration (_gdk_display->layer, &dlc);
_gdk_parent_root = g_object_new (GDK_TYPE_WINDOW, NULL);
private = GDK_WINDOW_OBJECT (_gdk_parent_root);
+ private->impl = g_object_new (_gdk_window_impl_get_type (), NULL);
impl = GDK_WINDOW_IMPL_DIRECTFB (private->impl);
private->window_type = GDK_WINDOW_ROOT;
@@ -475,6 +485,7 @@ gdk_directfb_window_new (GdkWindow
window = g_object_new (GDK_TYPE_WINDOW, NULL);
private = GDK_WINDOW_OBJECT (window);
+ private->impl = g_object_new (_gdk_window_impl_get_type (), NULL);
parent_private = GDK_WINDOW_OBJECT (parent);
parent_impl = GDK_WINDOW_IMPL_DIRECTFB (parent_private->impl);
@@ -647,8 +658,8 @@ gdk_directfb_window_new (GdkWindow
GdkWindow *
_gdk_window_new (GdkWindow *parent,
- GdkWindowAttr *attributes,
- gint attributes_mask)
+ GdkWindowAttr *attributes,
+ gint attributes_mask)
{
g_return_val_if_fail (attributes != NULL, NULL);
@@ -685,9 +696,8 @@ _gdk_windowing_window_destroy (GdkWindow
impl = GDK_WINDOW_IMPL_DIRECTFB (private->impl);
_gdk_selection_window_destroyed (window);
-#if (DIRECTFB_MAJOR_VERSION >= 1)
gdk_directfb_event_windows_remove (window);
-#endif
+
if (window == _gdk_directfb_pointer_grab_window)
gdk_pointer_ungrab (GDK_CURRENT_TIME);
if (window == _gdk_directfb_keyboard_grab_window)
@@ -1230,28 +1240,19 @@ show_window_internal (GdkWindow *window,
}
}
-void
-gdk_window_show_unraised (GdkWindow *window)
-{
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", __FUNCTION__, window );
-
- show_window_internal (window, FALSE);
-}
-
-void
-gdk_window_show (GdkWindow *window)
+static void
+gdk_directfb_window_show (GdkWindow *window,
+ gboolean raise)
{
g_return_if_fail (GDK_IS_WINDOW (window));
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", __FUNCTION__, window );
- show_window_internal (window, TRUE);
+ show_window_internal (window, raise);
}
-void
-gdk_window_hide (GdkWindow *window)
+static void
+gdk_directfb_window_hide (GdkWindow *window)
{
GdkWindowObject *private;
GdkWindowImplDirectFB *impl;
@@ -1276,11 +1277,11 @@ gdk_window_hide (GdkWindow *window)
if (!private->input_only && private->parent)
{
- _gdk_windowing_window_clear_area (GDK_WINDOW (private->parent),
- private->x,
- private->y,
- impl->drawable.width,
- impl->drawable.height);
+ gdk_window_clear_area (GDK_WINDOW (private->parent),
+ private->x,
+ private->y,
+ impl->drawable.width,
+ impl->drawable.height);
}
event_win = gdk_directfb_other_event_window (window, GDK_UNMAP);
@@ -1299,8 +1300,8 @@ gdk_window_hide (GdkWindow *window)
}
}
-void
-gdk_window_withdraw (GdkWindow *window)
+static void
+gdk_directfb_window_withdraw (GdkWindow *window)
{
g_return_if_fail (GDK_IS_WINDOW (window));
@@ -1309,80 +1310,6 @@ gdk_window_withdraw (GdkWindow *window)
}
void
-gdk_window_move (GdkWindow *window,
- gint x,
- gint y)
-{
- GdkWindowObject *private;
- GdkWindowImplDirectFB *impl;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- private = GDK_WINDOW_OBJECT (window);
- impl = GDK_WINDOW_IMPL_DIRECTFB (private->impl);
-
- if (impl->window)
- {
- private->x = x;
- private->y = y;
- impl->window->MoveTo (impl->window, x, y);
- }
- else
- {
- gint width=impl->drawable.width;
- gint height=impl->drawable.height;
- GdkRectangle old =
- { private->x, private->y,width,height };
-
- _gdk_directfb_move_resize_child (window, x, y, width, height);
- _gdk_directfb_calc_abs (window);
-
- if (GDK_WINDOW_IS_MAPPED (private))
- {
- GdkWindow *mousewin;
- GdkRectangle new = { x, y, width, height };
-
- gdk_rectangle_union (&new, &old, &new);
- gdk_window_invalidate_rect (GDK_WINDOW (private->parent), &new,TRUE);
-
- /* The window the pointer is in might have changed */
- mousewin = gdk_window_at_pointer (NULL, NULL);
- gdk_directfb_window_send_crossing_events (NULL, mousewin,
- GDK_CROSSING_NORMAL);
- }
- }
-}
-
-void
-gdk_window_resize (GdkWindow *window,
- gint width,
- gint height)
-{
- GdkWindowObject *private;
- gint x, y;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- private = GDK_WINDOW_OBJECT (window);
-
- x = private->x;
- y = private->y;
-
- if (private->parent && (private->parent->window_type != GDK_WINDOW_CHILD))
- {
- GdkWindowChildHandlerData *data;
-
- data = g_object_get_data (G_OBJECT (private->parent),
- "gdk-window-child-handler");
-
- if (data)
- (*data->get_pos) (window, &x, &y, data->user_data);
- }
-
- gdk_window_move_resize (window, x, y, width, height);
-}
-
-void
_gdk_directfb_move_resize_child (GdkWindow *window,
gint x,
gint y,
@@ -1407,15 +1334,17 @@ _gdk_directfb_move_resize_child (GdkWind
if (!private->input_only)
{
- if (impl->drawable.surface) {
- GdkDrawableImplDirectFB *dimpl = GDK_DRAWABLE_IMPL_DIRECTFB (private->impl);
- if(dimpl->cairo_surface) {
- cairo_surface_destroy(dimpl->cairo_surface);
- dimpl->cairo_surface= NULL;
- }
- impl->drawable.surface->Release (impl->drawable.surface);
- impl->drawable.surface = NULL;
- }
+ if (impl->drawable.surface)
+ {
+ if (impl->drawable.cairo_surface)
+ {
+ cairo_surface_destroy (impl->drawable.cairo_surface);
+ impl->drawable.cairo_surface = NULL;
+ }
+
+ impl->drawable.surface->Release (impl->drawable.surface);
+ impl->drawable.surface = NULL;
+ }
parent_impl = GDK_WINDOW_IMPL_DIRECTFB (GDK_WINDOW_OBJECT (private->parent)->impl);
@@ -1432,19 +1361,66 @@ _gdk_directfb_move_resize_child (GdkWind
for (list = private->children; list; list = list->next)
{
private = GDK_WINDOW_OBJECT (list->data);
- impl = GDK_WINDOW_IMPL_DIRECTFB (private->impl);
+ impl = GDK_WINDOW_IMPL_DIRECTFB (private->impl);
+
_gdk_directfb_move_resize_child (list->data,
private->x, private->y,
impl->drawable.width, impl->drawable.height);
}
}
-void
-gdk_window_move_resize (GdkWindow *window,
- gint x,
- gint y,
- gint width,
- gint height)
+static void
+gdk_directfb_window_move (GdkWindow *window,
+ gint x,
+ gint y)
+{
+ GdkWindowObject *private;
+ GdkWindowImplDirectFB *impl;
+
+ g_return_if_fail (GDK_IS_WINDOW (window));
+
+ private = GDK_WINDOW_OBJECT (window);
+ impl = GDK_WINDOW_IMPL_DIRECTFB (private->impl);
+
+ if (impl->window)
+ {
+ private->x = x;
+ private->y = y;
+ impl->window->MoveTo (impl->window, x, y);
+ }
+ else
+ {
+ gint width=impl->drawable.width;
+ gint height=impl->drawable.height;
+ GdkRectangle old =
+ { private->x, private->y,width,height };
+
+ _gdk_directfb_move_resize_child (window, x, y, width, height);
+ _gdk_directfb_calc_abs (window);
+
+ if (GDK_WINDOW_IS_MAPPED (private))
+ {
+ GdkWindow *mousewin;
+ GdkRectangle new = { x, y, width, height };
+
+ gdk_rectangle_union (&new, &old, &new);
+ gdk_window_invalidate_rect (GDK_WINDOW (private->parent), &new,TRUE);
+
+ /* The window the pointer is in might have changed */
+ mousewin = gdk_window_at_pointer (NULL, NULL);
+ gdk_directfb_window_send_crossing_events (NULL, mousewin,
+ GDK_CROSSING_NORMAL);
+ }
+ }
+}
+
+static void
+gdk_directfb_window_move_resize (GdkWindow *window,
+ gboolean with_move,
+ gint x,
+ gint y,
+ gint width,
+ gint height)
{
GdkWindowObject *private;
GdkWindowImplDirectFB *impl;
@@ -1454,8 +1430,14 @@ gdk_window_move_resize (GdkWindow *windo
private = GDK_WINDOW_OBJECT (window);
impl = GDK_WINDOW_IMPL_DIRECTFB (private->impl);
+ if (with_move && (width < 0 && height < 0))
+ {
+ gdk_directfb_window_move (window, x, y);
+ return;
+ }
+
if (width < 1)
- width = 1;
+ width = 1;
if (height < 1)
height = 1;
@@ -1478,26 +1460,39 @@ gdk_window_move_resize (GdkWindow *windo
if (impl->drawable.width == width && impl->drawable.height == height)
{
- gdk_window_move (window, x, y);
+ if (with_move)
+ gdk_directfb_window_move (window, x, y);
}
else if (impl->window)
{
- private->x = x;
- private->y = y;
- impl->window->MoveTo (impl->window, x, y);
+ private->x = x;
+ private->y = y;
+ impl->drawable.width = width;
+ impl->drawable.height = height;
+
+ if (with_move)
+ impl->window->MoveTo (impl->window, x, y);
impl->window->Resize (impl->window, width, height);
}
else
{
- GdkRectangle old =
- { private->x, private->y, impl->drawable.width, impl->drawable.height };
- _gdk_directfb_move_resize_child (window, x, y, width, height);
+ GdkRectangle old = { private->x, private->y,
+ impl->drawable.width, impl->drawable.height };
+ GdkRectangle new = { x, y, width, height };
+
+ if (! with_move)
+ {
+ new.x = private->x;
+ new.y = private->y;
+ }
+
+ _gdk_directfb_move_resize_child (window,
+ new.x, new.y, new.width, new.height);
_gdk_directfb_calc_abs (window);
if (GDK_WINDOW_IS_MAPPED (private))
{
- GdkWindow *mousewin;
- GdkRectangle new = { x, y, width, height };
+ GdkWindow *mousewin;
gdk_rectangle_union (&new, &old, &new);
gdk_window_invalidate_rect (GDK_WINDOW (private->parent), &new,TRUE);
@@ -1510,11 +1505,11 @@ gdk_window_move_resize (GdkWindow *windo
}
}
-void
-_gdk_window_reparent (GdkWindow *window,
- GdkWindow *new_parent,
- gint x,
- gint y)
+static gboolean
+gdk_directfb_window_reparent (GdkWindow *window,
+ GdkWindow *new_parent,
+ gint x,
+ gint y)
{
GdkWindowObject *window_private;
GdkWindowObject *parent_private;
@@ -1523,10 +1518,10 @@ _gdk_window_reparent (GdkWindow *window,
GdkWindowImplDirectFB *parent_impl;
GdkVisual *visual;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
if (GDK_WINDOW_DESTROYED (window))
- return;
+ return FALSE;
if (!new_parent)
new_parent = _gdk_parent_root;
@@ -1539,7 +1534,7 @@ _gdk_window_reparent (GdkWindow *window,
/* already parented */
if( window_private->parent == (GdkWindowObject *)new_parent )
- return;
+ return FALSE;
window_private->parent = (GdkWindowObject *) new_parent;
@@ -1593,7 +1588,7 @@ _gdk_window_reparent (GdkWindow *window,
{
g_assert(0);
_gdk_window_destroy (window, FALSE);
- return;
+ return FALSE;
}
/* we hold a reference count on ourselves */
g_object_ref (window);
@@ -1609,14 +1604,17 @@ _gdk_window_reparent (GdkWindow *window,
&rect,
&impl->drawable.surface);
}
+
+ return TRUE;
}
-void
-_gdk_windowing_window_clear_area (GdkWindow *window,
- gint x,
- gint y,
- gint width,
- gint height)
+static void
+gdk_directfb_window_clear_area (GdkWindow *window,
+ gint x,
+ gint y,
+ gint width,
+ gint height,
+ gboolean send_expose)
{
GdkWindowObject *private;
GdkDrawableImplDirectFB *impl;
@@ -1700,51 +1698,8 @@ _gdk_windowing_window_clear_area (GdkWin
g_object_unref (gc);
}
-void
-_gdk_windowing_window_clear_area_e (GdkWindow *window,
- gint x,
- gint y,
- gint width,
- gint height)
-{
- GdkRectangle rect;
- GdkWindowObject *private;
- GdkWindowImplDirectFB *impl;
-
- D_DEBUG_AT( GDKDFB_Window, "%s( %p, %4d,%4d-%4dx%4d )\n", __FUNCTION__, window, x, y, width, height );
-
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- private = GDK_WINDOW_OBJECT (window);
- impl = GDK_WINDOW_IMPL_DIRECTFB (private->impl);
-
- /**
- Follow XClearArea definition for zero height width
- **/
- if( width == 0 )
- width = impl->drawable.width-x;
- if( height == 0 )
- height = impl->drawable.height-y;
-
- rect.x = x;
- rect.y = y;
- rect.width = width;
- rect.height = height;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (GDK_WINDOW_DESTROYED (window)) {
- D_DEBUG_AT( GDKDFB_Window, " -> DESTROYED!\n" );
- return;
- }
-
- _gdk_windowing_window_clear_area (window, x, y, width, height);
-
- gdk_window_invalidate_rect (window, &rect, TRUE);
-}
-
-void
-gdk_window_raise (GdkWindow *window)
+static void
+gdk_window_directfb_raise (GdkWindow *window)
{
GdkWindowImplDirectFB *impl;
@@ -1774,8 +1729,8 @@ gdk_window_raise (GdkWindow *window)
}
}
-void
-gdk_window_lower (GdkWindow *window)
+static void
+gdk_window_directfb_lower (GdkWindow *window)
{
GdkWindowImplDirectFB *impl;
@@ -1875,9 +1830,9 @@ gdk_window_set_role (GdkWindow *window
* Since: 2.12
*
**/
-void
+void
gdk_window_set_startup_id (GdkWindow *window,
- const gchar *startup_id)
+ const gchar *startup_id)
{
}
@@ -1907,9 +1862,9 @@ gdk_window_set_transient_for (GdkWindow
root->children = g_list_insert (root->children, window, i);
}
-void
-gdk_window_set_background (GdkWindow *window,
- const GdkColor *color)
+static void
+gdk_directfb_window_set_background (GdkWindow *window,
+ const GdkColor *color)
{
GdkWindowObject *private;
@@ -1930,10 +1885,10 @@ gdk_window_set_background (GdkWindow *wi
private->bg_pixmap = NULL;
}
-void
-gdk_window_set_back_pixmap (GdkWindow *window,
- GdkPixmap *pixmap,
- gint parent_relative)
+static void
+gdk_directfb_window_set_back_pixmap (GdkWindow *window,
+ GdkPixmap *pixmap,
+ gboolean parent_relative)
{
GdkWindowObject *private;
GdkPixmap *old_pixmap;
@@ -1972,9 +1927,9 @@ gdk_window_set_back_pixmap (GdkWindow *w
}
}
-void
-gdk_window_set_cursor (GdkWindow *window,
- GdkCursor *cursor)
+static void
+gdk_directfb_window_set_cursor (GdkWindow *window,
+ GdkCursor *cursor)
{
GdkWindowImplDirectFB *impl;
GdkCursor *old_cursor;
@@ -2011,13 +1966,13 @@ gdk_window_set_cursor (GdkWindow *window
gdk_cursor_unref (old_cursor);
}
-void
-gdk_window_get_geometry (GdkWindow *window,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- gint *depth)
+static void
+gdk_directfb_window_get_geometry (GdkWindow *window,
+ gint *x,
+ gint *y,
+ gint *width,
+ gint *height,
+ gint *depth)
{
GdkWindowObject *private;
GdkDrawableImplDirectFB *impl;
@@ -2078,10 +2033,10 @@ _gdk_directfb_calc_abs (GdkWindow *windo
}
}
-gboolean
-gdk_window_get_origin (GdkWindow *window,
- gint *x,
- gint *y)
+static gboolean
+gdk_directfb_window_get_origin (GdkWindow *window,
+ gint *x,
+ gint *y)
{
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
@@ -2215,8 +2170,8 @@ _gdk_windowing_window_get_pointer (displ
}
-GdkEventMask
-gdk_window_get_events (GdkWindow *window)
+static GdkEventMask
+gdk_directfb_window_get_events (GdkWindow *window)
{
g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
@@ -2226,9 +2181,9 @@ gdk_window_get_events (GdkWindow *window
return GDK_WINDOW_OBJECT (window)->event_mask;
}
-void
-gdk_window_set_events (GdkWindow *window,
- GdkEventMask event_mask)
+static void
+gdk_directfb_window_set_events (GdkWindow *window,
+ GdkEventMask event_mask)
{
g_return_if_fail (GDK_IS_WINDOW (window));
@@ -2240,27 +2195,27 @@ gdk_window_set_events (GdkWindow *win
GDK_WINDOW_OBJECT (window)->event_mask = event_mask;
}
-void
-gdk_window_shape_combine_mask (GdkWindow *window,
- GdkBitmap *mask,
- gint x,
- gint y)
+static void
+gdk_directfb_window_shape_combine_mask (GdkWindow *window,
+ GdkBitmap *mask,
+ gint x,
+ gint y)
{
}
void
gdk_window_input_shape_combine_mask (GdkWindow *window,
- GdkBitmap *mask,
- gint x,
- gint y)
+ GdkBitmap *mask,
+ gint x,
+ gint y)
{
}
-void
-gdk_window_shape_combine_region (GdkWindow *window,
- const GdkRegion *shape_region,
- gint offset_x,
- gint offset_y)
+static void
+gdk_directfb_window_shape_combine_region (GdkWindow *window,
+ const GdkRegion *shape_region,
+ gint offset_x,
+ gint offset_y)
{
}
@@ -2584,13 +2539,13 @@ gdk_window_set_functions (GdkWindow
g_message("unimplemented %s", __FUNCTION__);
}
-void
-gdk_window_set_child_shapes (GdkWindow *window)
+static void
+gdk_directfb_window_set_child_shapes (GdkWindow *window)
{
}
-void
-gdk_window_merge_child_shapes (GdkWindow *window)
+static void
+gdk_directfb_window_merge_child_shapes (GdkWindow *window)
{
}
@@ -2604,9 +2559,9 @@ gdk_window_merge_child_input_shapes (Gdk
{
}
-gboolean
-gdk_window_set_static_gravities (GdkWindow *window,
- gboolean use_static)
+static gboolean
+gdk_directfb_window_set_static_gravities (GdkWindow *window,
+ gboolean use_static)
{
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
@@ -2693,9 +2648,8 @@ gdk_window_get_frame_extents (GdkWindow
* Given a directfb window and a subsurface of that window
* create a gdkwindow child wrapper
*/
-#if (DIRECTFB_MAJOR_VERSION >= 1)
GdkWindow *gdk_directfb_create_child_window(GdkWindow *parent,
- IDirectFBSurface *subsurface)
+ IDirectFBSurface *subsurface)
{
GdkWindow *window;
GdkWindowObject *private;
@@ -2708,6 +2662,7 @@ GdkWindow *gdk_directfb_create_child_win
window = g_object_new (GDK_TYPE_WINDOW, NULL);
private = GDK_WINDOW_OBJECT (window);
+ private->impl = g_object_new (_gdk_window_impl_get_type (), NULL);
parent_private = GDK_WINDOW_OBJECT (parent);
parent_impl = GDK_WINDOW_IMPL_DIRECTFB (parent_private->impl);
private->parent = parent_private;
@@ -2739,7 +2694,6 @@ GdkWindow *gdk_directfb_create_child_win
return window;
}
-#endif
/*
* The wrapping is not perfect since directfb does not give full access
@@ -2787,6 +2741,7 @@ gdk_window_foreign_new_for_display (GdkD
/* we hold a reference count on ourselves */
g_object_ref (window);
private = GDK_WINDOW_OBJECT (window);
+ private->impl = g_object_new (_gdk_window_impl_get_type (), NULL);
private->parent = parent_private;
private->window_type = GDK_WINDOW_TOPLEVEL;
impl = GDK_WINDOW_IMPL_DIRECTFB (private->impl);
@@ -3153,11 +3108,11 @@ gdk_window_impl_directfb_begin_paint_reg
D_DEBUG_AT( GDKDFB_Window, " -> [%2d] %4d,%4d-%4dx%4d\n", i, GDKDFB_RECTANGLE_VALS_FROM_BOX( box ) );
- _gdk_windowing_window_clear_area (GDK_WINDOW(wimpl->gdkWindow),
- box->x1,
- box->y1,
- box->x2 - box->x1,
- box->y2 - box->y1);
+ gdk_window_clear_area (GDK_WINDOW(wimpl->gdkWindow),
+ box->x1,
+ box->y1,
+ box->x2 - box->x1,
+ box->y2 - box->y1);
}
}
@@ -3259,7 +3214,7 @@ gdk_window_set_opacity (GdkWindow *windo
{
GdkDisplay *display;
guint8 cardinal;
-
+
g_return_if_fail (GDK_IS_WINDOW (window));
if (GDK_WINDOW_DESTROYED (window))
@@ -3281,6 +3236,33 @@ _gdk_windowing_window_set_composited (Gd
{
}
+static void
+gdk_window_impl_iface_init (GdkWindowImplIface *iface)
+{
+ iface->show = gdk_directfb_window_show;
+ iface->hide = gdk_directfb_window_hide;
+ iface->withdraw = gdk_directfb_window_withdraw;
+ iface->raise = gdk_window_directfb_raise;
+ iface->lower = gdk_window_directfb_lower;
+ iface->move_resize = gdk_directfb_window_move_resize;
+ iface->move_region = _gdk_directfb_window_move_region;
+ iface->scroll = _gdk_directfb_window_scroll;
+ iface->clear_area = gdk_directfb_window_clear_area;
+ iface->set_background = gdk_directfb_window_set_background;
+ iface->set_back_pixmap = gdk_directfb_window_set_back_pixmap;
+ iface->get_events = gdk_directfb_window_get_events;
+ iface->set_events = gdk_directfb_window_set_events;
+ iface->reparent = gdk_directfb_window_reparent;
+ iface->set_cursor = gdk_directfb_window_set_cursor;
+ iface->get_geometry = gdk_directfb_window_get_geometry;
+ iface->get_origin = gdk_directfb_window_get_origin;
+ iface->get_offsets = _gdk_directfb_window_get_offsets;
+ iface->shape_combine_mask = gdk_directfb_window_shape_combine_mask;
+ iface->shape_combine_region = gdk_directfb_window_shape_combine_region;
+ iface->set_child_shapes = gdk_directfb_window_set_child_shapes;
+ iface->merge_child_shapes = gdk_directfb_window_merge_child_shapes;
+ iface->set_static_gravities = gdk_directfb_window_set_static_gravities;
+}
#define __GDK_WINDOW_X11_C__
#include "gdkaliasdef.c"
Index: gdk/directfb/gdkcursor-directfb.c
===================================================================
--- gdk/directfb/gdkcursor-directfb.c (revision 22357)
+++ gdk/directfb/gdkcursor-directfb.c (working copy)
@@ -41,10 +41,6 @@
#include <directfb_version.h>
-#if DIRECTFB_MAJOR_VERSION < 1
-#define u32 __u32
-#define u8 __u8
-#endif
static struct {
const guchar *bits;
Index: gdk/directfb/gdkprivate-directfb.h
===================================================================
--- gdk/directfb/gdkprivate-directfb.h (revision 22357)
+++ gdk/directfb/gdkprivate-directfb.h (working copy)
@@ -172,6 +172,17 @@ void gdk_directfb_window_id_table
void gdk_directfb_window_id_table_remove (DFBWindowID dfb_id);
GdkWindow * gdk_directfb_window_id_table_lookup (DFBWindowID dfb_id);
+void _gdk_directfb_window_get_offsets (GdkWindow *window,
+ gint *x_offset,
+ gint *y_offset);
+void _gdk_directfb_window_scroll (GdkWindow *window,
+ gint dx,
+ gint dy);
+void _gdk_directfb_window_move_region (GdkWindow *window,
+ const GdkRegion *region,
+ gint dx,
+ gint dy);
+
typedef struct
{
@@ -228,10 +239,8 @@ GdkImage* _gdk_directfb_copy_to_image (G
gint width,
gint height);
-void gdk_directfb_event_windows_add (GdkWindow *window);
-#if (DIRECTFB_MAJOR_VERSION >= 1)
+void gdk_directfb_event_windows_add (GdkWindow *window);
void gdk_directfb_event_windows_remove (GdkWindow *window);
-#endif
GdkGrabStatus gdk_directfb_keyboard_grab (GdkDisplay *display,
GdkWindow *window,
Index: configure.in
===================================================================
--- configure.in (revision 22357)
+++ configure.in (working copy)
@@ -1619,7 +1619,7 @@ AC_SUBST(GDK_PIXBUF_XLIB_DEP_LIBS)
AC_SUBST(GDK_PIXBUF_XLIB_DEP_CFLAGS)
if test "x$gdktarget" = "xdirectfb"; then
- DIRECTFB_REQUIRED_VERSION=0.9.24
+ DIRECTFB_REQUIRED_VERSION=1.0.0
AC_MSG_CHECKING(for DirectFB)
if $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb && $PKG_CONFIG --exists cairo-directfb ; then
More information about the pkg-gnome-maintainers
mailing list