Commit 49049eb8 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

gdk/directfb/gdkdirectfb.h gdk/directfb/gdkdisplay-directfb.c

2008-01-30  Sven Neumann  <sven@gimp.org>

	* gdk/directfb/gdkdirectfb.h
	* gdk/directfb/gdkdisplay-directfb.c
	* gdk/directfb/gdkdrawable-directfb.c
	* gdk/directfb/gdkim-directfb.c
	* gdk/directfb/gdkimage-directfb.c
	* gdk/directfb/gdkinput-directfb.c
	* gdk/directfb/gdkmain-directfb.c
	* gdk/directfb/gdkpixmap-directfb.c
	* gdk/directfb/gdktestutils-directfb.c
	* gdk/directfb/gdkvisual-directfb.c
	* gdk/directfb/gdkwindow-directfb.c: applied patch from Denis
	Oliver Kropp <dok@directfb.org>. Fixes various warnings, some
	errors and has some cleanups.


svn path=/trunk/; revision=19432
parent 63af2cd0
2008-01-30 Sven Neumann <sven@gimp.org>
* gdk/directfb/gdkdirectfb.h
* gdk/directfb/gdkdisplay-directfb.c
* gdk/directfb/gdkdrawable-directfb.c
* gdk/directfb/gdkim-directfb.c
* gdk/directfb/gdkimage-directfb.c
* gdk/directfb/gdkinput-directfb.c
* gdk/directfb/gdkmain-directfb.c
* gdk/directfb/gdkpixmap-directfb.c
* gdk/directfb/gdktestutils-directfb.c
* gdk/directfb/gdkvisual-directfb.c
* gdk/directfb/gdkwindow-directfb.c: applied patch from Denis
Oliver Kropp <dok@directfb.org>. Fixes various warnings, some
errors and has some cleanups.
2008-01-30 Michael Natterer <mitch@imendio.com>
* gtk/gtkbuilderparser.c (parse_custom): use the right type for
......
......@@ -41,16 +41,6 @@
#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;
......
......@@ -195,6 +195,9 @@ IDirectFBSurface * gdk_display_dfb_create_surface (GdkDisplayDFB *display,int fo
}
/*************************************************************************************************
* Displays and Screens
*/
void
_gdk_windowing_set_default_display (GdkDisplay *display)
......@@ -227,6 +230,30 @@ gdk_display_get_default_screen (GdkDisplay *display)
return _gdk_screen;
}
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)
{
......@@ -262,28 +289,9 @@ gdk_display_store_clipboard (GdkDisplay *display,
}
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;
}
/*************************************************************************************************
* Pointer
*/
static gboolean _gdk_directfb_pointer_implicit_grab = FALSE;
......@@ -338,9 +346,6 @@ gdk_directfb_pointer_grab (GdkWindow *window,
return GDK_GRAB_SUCCESS;
}
void
gdk_directfb_pointer_ungrab (guint32 time,
gboolean implicit_grab)
......@@ -387,8 +392,69 @@ gdk_directfb_pointer_ungrab (guint32 time,
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;
}
/*
*--------------------------------------------------------------
......@@ -457,17 +523,10 @@ gdk_display_keyboard_ungrab (GdkDisplay *display,guint32 time)
_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 @@ gdk_display_flush (GdkDisplay *display)
/*************************************************************************************************
* Notifications
*/
void
gdk_notify_startup_complete (void)
{
......@@ -512,12 +575,17 @@ gdk_notify_startup_complete_with_id (const gchar* startup_id)
}
/*************************************************************************************************
* Compositing
*/
gboolean
gdk_display_supports_composite (GdkDisplay *display)
{
return FALSE;
}
#define __GDK_DISPLAY_X11_C__
#include "gdkaliasdef.c"
......@@ -49,16 +49,6 @@
#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() \
......@@ -556,7 +546,7 @@ gdk_directfb_draw_arc (GdkDrawable *drawable,
gint angle1,
gint angle2)
{
WARN_UNIMPLEMENTED (G_GNUC_FUNCTION);
D_UNIMPLEMENTED();
}
static void
......@@ -640,7 +630,7 @@ gdk_directfb_draw_text (GdkDrawable *drawable,
const gchar *text,
gint text_length)
{
WARN_UNIMPLEMENTED (G_GNUC_FUNCTION);
D_UNIMPLEMENTED();
}
static void
......@@ -652,7 +642,7 @@ gdk_directfb_draw_text_wc (GdkDrawable *drawable,
const GdkWChar *text,
gint text_length)
{
WARN_UNIMPLEMENTED (G_GNUC_FUNCTION);
D_UNIMPLEMENTED();
}
static void
......
......@@ -151,7 +151,7 @@ gdk_wcstombs (const GdkWChar *src)
*bp = 0;
return mbstr;
return (gchar*)mbstr;
}
......
......@@ -151,7 +151,7 @@ gdk_image_new_bitmap (GdkVisual *visual,
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 @@ _gdk_image_new_for_depth (GdkScreen *screen,
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 @@ _gdk_image_new_for_depth (GdkScreen *screen,
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 @@ gdk_directfb_image_destroy (GdkImage *image)
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 );
......
......@@ -228,7 +228,7 @@ gboolean
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 @@ gdk_input_set_extension_events (GdkWindow *window,
gint mask,
GdkExtensionMode mode)
{
g_message ("unimplemented %s", G_GNUC_FUNCTION);
g_message ("unimplemented %s", __FUNCTION__);
}
GList *
......
......@@ -435,7 +435,7 @@ gdk_keyboard_grab (GdkWindow *window,
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);
......
......@@ -109,8 +109,6 @@ gdk_pixmap_impl_directfb_class_init (GdkPixmapImplDirectFBClass *klass)
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 @@ gdk_pixmap_new (GdkDrawable *drawable,
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;
}
}
......
......@@ -83,7 +83,7 @@ _gdk_keyval_to_directfb (guint keyval)
case GDK_Cancel:
return DIKS_CANCEL;
/* TODO: handle them all */
defualt:
default:
break;
}
......
......@@ -112,7 +112,6 @@ gdk_visual_get_type (void)
void
_gdk_visual_init ()
{
DFBResult ret;
DFBDisplayLayerConfig dlc;
DFBSurfaceDescription desc;
IDirectFBSurface *dest;
......
......@@ -2453,7 +2453,7 @@ gdk_window_set_functions (GdkWindow *window,
return;
/* N/A */
g_message("unimplemented %s", G_GNUC_FUNCTION);
g_message("unimplemented %s", __FUNCTION__);
}
void
......@@ -2486,7 +2486,7 @@ gdk_window_set_static_gravities (GdkWindow *window,
return FALSE;
/* N/A */
g_message("unimplemented %s", G_GNUC_FUNCTION);
g_message("unimplemented %s", __FUNCTION__);
return FALSE;
}
......@@ -2504,7 +2504,7 @@ gdk_window_begin_resize_drag (GdkWindow *window,
if (GDK_WINDOW_DESTROYED (window))
return;
g_message("unimplemented %s", G_GNUC_FUNCTION);
g_message("unimplemented %s", __FUNCTION__);
}
void
......@@ -2519,7 +2519,7 @@ gdk_window_begin_move_drag (GdkWindow *window,
if (GDK_WINDOW_DESTROYED (window))
return;
g_message("unimplemented %s", G_GNUC_FUNCTION);
g_message("unimplemented %s", __FUNCTION__);
}
/**
......@@ -2818,10 +2818,10 @@ gdk_window_set_urgency_hint (GdkWindow *window,
}
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 @@ gdk_window_impl_directfb_invalidate_maybe_recurse (GdkPaintable *paintable,
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 @@ gdk_window_impl_directfb_process_updates (GdkPaintable *paintable,
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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment