GTK+ Patch
- From: Denis Oliver Kropp <dok directfb org>
- To: gtk-devel-list gnome org, directfb-dev <directfb-dev directfb org>
- Subject: GTK+ Patch
- Date: Wed, 30 Jan 2008 00:31:15 +0100
Hi,
this is the first of more patches coming up these days.
It fixes various warnings, some errors, has some cleanups and a change that's worth to mention:
@@ -2818,10 +2818,10 @@
}
static void
-gdk_window_impl_directfb_invalidate_maybe_recurse (GdkPaintable *paintable,
- GdkRegion *region,
- gboolean (*child_func) (GdkWindow *, gpointer),
- gpointer user_data)
+gdk_window_impl_directfb_invalidate_maybe_recurse (GdkPaintable *paintable,
+ const GdkRegion *region,
+ gboolean (*child_func) (GdkWindow *, gpointer),
+ gpointer user_data)
{
GdkWindow *window;
GdkWindowObject *private;
@@ -2866,14 +2866,11 @@
if (child_func && (*child_func) ((GdkWindow *)child, user_data))
{
- gdk_region_offset (region, - child->x, - child->y);
- gdk_region_offset (&child_region, - child->x, - child->y);
gdk_region_intersect (&child_region, region);
+ gdk_region_offset (&child_region, - child->x, - child->y);
gdk_window_invalidate_maybe_recurse ((GdkWindow *)child,
&child_region, child_func, user_data);
-
- gdk_region_offset (region, child->x, child->y);
}
temp_region_deinit( &child_region );
In case I'm not missing something here, this change does not only fix the conflict with
the new const, but also reduces 4 calls to one (gdk_region_offset).
Mike was asking for someone to take over the project recently, wasn't he?
After seven years of more and more abandoning it, I'd be happy to have it back and make
it something great(er) :)
Too bad noone could tell me about the simpler Quartz implementation so far. It seems a
lot of the recursion with invalidation, clipping, lots of paint events etc. could be
avoided. There are also other differences like, e.g. crossing event generation does not
happen on show/hide of windows.
--
Best regards,
Denis Oliver Kropp
.------------------------------------------.
| DirectFB - Hardware accelerated graphics |
| http://www.directfb.org/ |
"------------------------------------------"
Index: gdk/directfb/gdktestutils-directfb.c
===================================================================
--- gdk/directfb/gdktestutils-directfb.c (revision 19427)
+++ gdk/directfb/gdktestutils-directfb.c (working copy)
@@ -83,7 +83,7 @@
case GDK_Cancel:
return DIKS_CANCEL;
/* TODO: handle them all */
- defualt:
+ default:
break;
}
Index: gdk/directfb/gdkim-directfb.c
===================================================================
--- gdk/directfb/gdkim-directfb.c (revision 19427)
+++ gdk/directfb/gdkim-directfb.c (working copy)
@@ -151,7 +151,7 @@
*bp = 0;
- return mbstr;
+ return (gchar*)mbstr;
}
Index: gdk/directfb/gdkdisplay-directfb.c
===================================================================
--- gdk/directfb/gdkdisplay-directfb.c (revision 19427)
+++ gdk/directfb/gdkdisplay-directfb.c (working copy)
@@ -195,6 +195,9 @@
}
+/*************************************************************************************************
+ * Displays and Screens
+ */
void
_gdk_windowing_set_default_display (GdkDisplay *display)
@@ -228,6 +231,30 @@
}
gboolean
+gdk_display_supports_shapes (GdkDisplay *display)
+{
+ return FALSE;
+}
+
+gboolean
+gdk_display_supports_input_shapes (GdkDisplay *display)
+{
+ return FALSE;
+}
+
+
+GdkWindow *gdk_display_get_default_group (GdkDisplay *display)
+{
+ g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
+ return _gdk_parent_root;
+}
+
+
+/*************************************************************************************************
+ * Selection and Clipboard
+ */
+
+gboolean
gdk_display_supports_selection_notification (GdkDisplay *display)
{
return FALSE;
@@ -262,29 +289,10 @@
}
-gboolean
-gdk_display_supports_shapes (GdkDisplay *display)
-{
- return FALSE;
-}
+/*************************************************************************************************
+ * Pointer
+ */
-
-gboolean
-gdk_display_supports_input_shapes (GdkDisplay *display)
-{
- return FALSE;
-}
-
-
-GdkWindow *gdk_display_get_default_group (GdkDisplay *display)
-{
- g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
- return _gdk_parent_root;
-}
-
-
-
-
static gboolean _gdk_directfb_pointer_implicit_grab = FALSE;
GdkGrabStatus
@@ -338,9 +346,6 @@
return GDK_GRAB_SUCCESS;
}
-
-
-
void
gdk_directfb_pointer_ungrab (guint32 time,
gboolean implicit_grab)
@@ -387,9 +392,70 @@
g_object_unref (old_grab_window);
}
+gint
+gdk_display_pointer_is_grabbed (GdkDisplay *display)
+{
+ return _gdk_directfb_pointer_grab_window != NULL;
+}
+void
+gdk_display_pointer_ungrab (GdkDisplay *display,guint32 time)
+{
+ gdk_directfb_pointer_ungrab (time, _gdk_directfb_pointer_implicit_grab);
+}
+/*************************************************************************************************
+ * Keyboard
+ */
+
+GdkGrabStatus
+gdk_directfb_keyboard_grab (GdkDisplay *display,GdkWindow *window,
+ gint owner_events,
+ guint32 time)
+{
+ GdkWindow *toplevel;
+ GdkWindowImplDirectFB *impl;
+
+ g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
+
+ if (_gdk_directfb_keyboard_grab_window)
+ gdk_keyboard_ungrab (time);
+
+ toplevel = gdk_directfb_window_find_toplevel (window);
+ impl = GDK_WINDOW_IMPL_DIRECTFB (GDK_WINDOW_OBJECT (toplevel)->impl);
+
+ if (impl->window)
+ {
+ if (impl->window->GrabKeyboard (impl->window) == DFB_LOCKED)
+ return GDK_GRAB_ALREADY_GRABBED;
+ }
+
+ _gdk_directfb_keyboard_grab_window = g_object_ref (window);
+ _gdk_directfb_keyboard_grab_owner_events = owner_events;
+ return GDK_GRAB_SUCCESS;
+}
+
+void
+gdk_directfb_keyboard_ungrab (GdkDisplay *display,guint32 time)
+{
+ GdkWindow *toplevel;
+ GdkWindowImplDirectFB *impl;
+
+ if (!_gdk_directfb_keyboard_grab_window)
+ return;
+
+ toplevel =
+ gdk_directfb_window_find_toplevel (_gdk_directfb_keyboard_grab_window);
+ impl = GDK_WINDOW_IMPL_DIRECTFB (GDK_WINDOW_OBJECT (toplevel)->impl);
+
+ if (impl->window)
+ impl->window->UngrabKeyboard (impl->window);
+
+ g_object_unref (_gdk_directfb_keyboard_grab_window);
+ _gdk_directfb_keyboard_grab_window = NULL;
+}
+
/*
*--------------------------------------------------------------
* gdk_keyboard_grab
@@ -457,17 +523,10 @@
_gdk_directfb_keyboard_grab_window = NULL;
}
-gint
-gdk_display_pointer_is_grabbed (GdkDisplay *display)
-{
- return _gdk_directfb_pointer_grab_window != NULL;
-}
-void
-gdk_display_pointer_ungrab (GdkDisplay *display,guint32 time)
-{
- gdk_directfb_pointer_ungrab (time, _gdk_directfb_pointer_implicit_grab);
-}
+/*************************************************************************************************
+ * Misc Stuff
+ */
void
gdk_display_beep (GdkDisplay *display)
@@ -486,6 +545,10 @@
+/*************************************************************************************************
+ * Notifications
+ */
+
void
gdk_notify_startup_complete (void)
{
@@ -512,12 +575,17 @@
}
+/*************************************************************************************************
+ * Compositing
+ */
+
gboolean
gdk_display_supports_composite (GdkDisplay *display)
{
return FALSE;
}
+
#define __GDK_DISPLAY_X11_C__
#include "gdkaliasdef.c"
Index: gdk/directfb/gdkdrawable-directfb.c
===================================================================
--- gdk/directfb/gdkdrawable-directfb.c (revision 19427)
+++ gdk/directfb/gdkdrawable-directfb.c (working copy)
@@ -49,17 +49,7 @@
#include "cairo-directfb.h"
-#define WARN_UNIMPLEMENTED(func)\
-{\
- static gboolean first_call = TRUE;\
- if (first_call)\
- {\
- g_message ("unimplemented " func);\
- first_call = FALSE;\
- }\
-}
-
/* From DirectFB's <gfx/generix/duffs_device.h> */
#define DUFF_1() \
case 1:\
@@ -556,7 +546,7 @@
gint angle1,
gint angle2)
{
- WARN_UNIMPLEMENTED (G_GNUC_FUNCTION);
+ D_UNIMPLEMENTED();
}
static void
@@ -640,7 +630,7 @@
const gchar *text,
gint text_length)
{
- WARN_UNIMPLEMENTED (G_GNUC_FUNCTION);
+ D_UNIMPLEMENTED();
}
static void
@@ -652,7 +642,7 @@
const GdkWChar *text,
gint text_length)
{
- WARN_UNIMPLEMENTED (G_GNUC_FUNCTION);
+ D_UNIMPLEMENTED();
}
static void
Index: gdk/directfb/gdkmain-directfb.c
===================================================================
--- gdk/directfb/gdkmain-directfb.c (revision 19427)
+++ gdk/directfb/gdkmain-directfb.c (working copy)
@@ -435,7 +435,7 @@
gint owner_events,
guint32 time)
{
- return gdk_display_keyboard_grab(gdk_display_get_default(),
+ return gdk_directfb_keyboard_grab(gdk_display_get_default(),
window,
owner_events,
time);
Index: gdk/directfb/gdkpixmap-directfb.c
===================================================================
--- gdk/directfb/gdkpixmap-directfb.c (revision 19427)
+++ gdk/directfb/gdkpixmap-directfb.c (working copy)
@@ -109,8 +109,6 @@
static void
gdk_pixmap_impl_directfb_finalize (GObject *object)
{
- GdkDrawableImplDirectFB *impl = GDK_DRAWABLE_IMPL_DIRECTFB (object);
-
if (G_OBJECT_CLASS (parent_class)->finalize)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -172,7 +170,7 @@
format = DSPF_RGB32;
break;
default:
- g_message ("unimplemented %s for depth %d", G_GNUC_FUNCTION, depth);
+ g_message ("unimplemented %s for depth %d", __FUNCTION__, depth);
return NULL;
}
}
Index: gdk/directfb/gdkinput-directfb.c
===================================================================
--- gdk/directfb/gdkinput-directfb.c (revision 19427)
+++ gdk/directfb/gdkinput-directfb.c (working copy)
@@ -228,7 +228,7 @@
gdk_device_set_mode (GdkDevice *device,
GdkInputMode mode)
{
- g_message ("unimplemented %s", G_GNUC_FUNCTION);
+ g_message ("unimplemented %s", __FUNCTION__);
return FALSE;
}
@@ -303,7 +303,7 @@
gint mask,
GdkExtensionMode mode)
{
- g_message ("unimplemented %s", G_GNUC_FUNCTION);
+ g_message ("unimplemented %s", __FUNCTION__);
}
GList *
Index: gdk/directfb/gdkvisual-directfb.c
===================================================================
--- gdk/directfb/gdkvisual-directfb.c (revision 19427)
+++ gdk/directfb/gdkvisual-directfb.c (working copy)
@@ -112,7 +112,6 @@
void
_gdk_visual_init ()
{
- DFBResult ret;
DFBDisplayLayerConfig dlc;
DFBSurfaceDescription desc;
IDirectFBSurface *dest;
Index: gdk/directfb/gdkdirectfb.h
===================================================================
--- gdk/directfb/gdkdirectfb.h (revision 19427)
+++ gdk/directfb/gdkdirectfb.h (working copy)
@@ -41,17 +41,7 @@
#include <directfb.h>
#include "gdk/gdkprivate.h"
-/* macro for a safe call to DirectFB functions */
-#define DFBCHECK(x...) \
- { \
- int err = x; \
- if (err != DFB_OK) { \
- fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \
- DirectFBErrorFatal( #x, err ); \
- } \
- }
-
extern GdkWindow * _gdk_parent_root;
G_BEGIN_DECLS
Index: gdk/directfb/gdkwindow-directfb.c
===================================================================
--- gdk/directfb/gdkwindow-directfb.c (revision 19427)
+++ gdk/directfb/gdkwindow-directfb.c (working copy)
@@ -2453,7 +2453,7 @@
return;
/* N/A */
- g_message("unimplemented %s", G_GNUC_FUNCTION);
+ g_message("unimplemented %s", __FUNCTION__);
}
void
@@ -2486,7 +2486,7 @@
return FALSE;
/* N/A */
- g_message("unimplemented %s", G_GNUC_FUNCTION);
+ g_message("unimplemented %s", __FUNCTION__);
return FALSE;
}
@@ -2504,7 +2504,7 @@
if (GDK_WINDOW_DESTROYED (window))
return;
- g_message("unimplemented %s", G_GNUC_FUNCTION);
+ g_message("unimplemented %s", __FUNCTION__);
}
void
@@ -2519,7 +2519,7 @@
if (GDK_WINDOW_DESTROYED (window))
return;
- g_message("unimplemented %s", G_GNUC_FUNCTION);
+ g_message("unimplemented %s", __FUNCTION__);
}
/**
@@ -2818,10 +2818,10 @@
}
static void
-gdk_window_impl_directfb_invalidate_maybe_recurse (GdkPaintable *paintable,
- GdkRegion *region,
- gboolean (*child_func) (GdkWindow *, gpointer),
- gpointer user_data)
+gdk_window_impl_directfb_invalidate_maybe_recurse (GdkPaintable *paintable,
+ const GdkRegion *region,
+ gboolean (*child_func) (GdkWindow *, gpointer),
+ gpointer user_data)
{
GdkWindow *window;
GdkWindowObject *private;
@@ -2866,14 +2866,11 @@
if (child_func && (*child_func) ((GdkWindow *)child, user_data))
{
- gdk_region_offset (region, - child->x, - child->y);
- gdk_region_offset (&child_region, - child->x, - child->y);
gdk_region_intersect (&child_region, region);
+ gdk_region_offset (&child_region, - child->x, - child->y);
gdk_window_invalidate_maybe_recurse ((GdkWindow *)child,
&child_region, child_func, user_data);
-
- gdk_region_offset (region, child->x, child->y);
}
temp_region_deinit( &child_region );
@@ -2967,8 +2964,8 @@
static void
-gdk_window_impl_directfb_begin_paint_region (GdkPaintable *paintable,
- GdkRegion *region)
+gdk_window_impl_directfb_begin_paint_region (GdkPaintable *paintable,
+ const GdkRegion *region)
{
GdkDrawableImplDirectFB *impl;
GdkWindowImplDirectFB *wimpl;
Index: gdk/directfb/gdkimage-directfb.c
===================================================================
--- gdk/directfb/gdkimage-directfb.c (revision 19427)
+++ gdk/directfb/gdkimage-directfb.c (working copy)
@@ -151,7 +151,7 @@
GDK_NOTE (MISC, g_print ("gdk_image_new_bitmap: %dx%d\n", w, h));
- g_message ("not fully implemented %s", G_GNUC_FUNCTION);
+ g_message ("not fully implemented %s", __FUNCTION__);
image->bpl = (w + 7) / 8;
image->mem = g_malloc (image->bpl * h);
@@ -209,7 +209,7 @@
format = DSPF_ARGB;
break;
default:
- g_message ("unimplemented %s for depth %d", G_GNUC_FUNCTION, depth);
+ g_message ("unimplemented %s for depth %d", __FUNCTION__, depth);
return NULL;
}
@@ -225,7 +225,13 @@
private->surface = surface;
- surface->Lock( surface, DSLF_WRITE, &image->mem, &pitch );
+ ret = surface->Lock( surface, DSLF_WRITE, &image->mem, &pitch );
+ if (ret)
+ {
+ DirectFBError( "IDirectFBSurface::Lock() for writing failed!\n", ret );
+ gdk_image_unref( image );
+ return NULL;
+ }
image->type = type;
image->visual = visual;
@@ -403,8 +409,8 @@
if (!private)
return;
- GDK_NOTE (MISC, g_print ("gdk_directfb_image_destroy: %#x\n",
- (guint) private->surface));
+ GDK_NOTE (MISC, g_print ("gdk_directfb_image_destroy: %#lx\n",
+ (gulong) private->surface));
private->surface->Unlock( private->surface );
private->surface->Release( private->surface );
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]