mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-24 12:41:16 +00:00
gdk/directfb/gdkdisplay-directfb.c gdk/directfb/gdkdrawable-directfb.c
2008-01-31 Sven Neumann <sven@gimp.org> * gdk/directfb/gdkdisplay-directfb.c * gdk/directfb/gdkdrawable-directfb.c * gdk/directfb/gdkprivate-directfb.h * gdk/directfb/gdkwindow-directfb.c: applied patch from Denis Oliver Kropp <dok@directfb.org>. Fixes remaining warnings. svn path=/trunk/; revision=19447
This commit is contained in:
parent
0ca4891ee0
commit
9e528c18ad
@ -1,3 +1,11 @@
|
|||||||
|
2008-01-31 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* gdk/directfb/gdkdisplay-directfb.c
|
||||||
|
* gdk/directfb/gdkdrawable-directfb.c
|
||||||
|
* gdk/directfb/gdkprivate-directfb.h
|
||||||
|
* gdk/directfb/gdkwindow-directfb.c: applied patch from Denis
|
||||||
|
Oliver Kropp <dok@directfb.org>. Fixes remaining warnings.
|
||||||
|
|
||||||
2008-01-31 Richard Hult <richard@imendio.com>
|
2008-01-31 Richard Hult <richard@imendio.com>
|
||||||
|
|
||||||
* gdk/quartz/GdkQuartzView.c: Another attempt at fixing focus
|
* gdk/quartz/GdkQuartzView.c: Another attempt at fixing focus
|
||||||
|
@ -410,9 +410,10 @@ gdk_display_pointer_ungrab (GdkDisplay *display,guint32 time)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
GdkGrabStatus
|
GdkGrabStatus
|
||||||
gdk_directfb_keyboard_grab (GdkDisplay *display,GdkWindow *window,
|
gdk_directfb_keyboard_grab (GdkDisplay *display,
|
||||||
gint owner_events,
|
GdkWindow *window,
|
||||||
guint32 time)
|
gint owner_events,
|
||||||
|
guint32 time)
|
||||||
{
|
{
|
||||||
GdkWindow *toplevel;
|
GdkWindow *toplevel;
|
||||||
GdkWindowImplDirectFB *impl;
|
GdkWindowImplDirectFB *impl;
|
||||||
@ -437,7 +438,8 @@ gdk_directfb_keyboard_grab (GdkDisplay *display,GdkWindow *window,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gdk_directfb_keyboard_ungrab (GdkDisplay *display,guint32 time)
|
gdk_directfb_keyboard_ungrab (GdkDisplay *display,
|
||||||
|
guint32 time)
|
||||||
{
|
{
|
||||||
GdkWindow *toplevel;
|
GdkWindow *toplevel;
|
||||||
GdkWindowImplDirectFB *impl;
|
GdkWindowImplDirectFB *impl;
|
||||||
@ -445,8 +447,7 @@ gdk_directfb_keyboard_ungrab (GdkDisplay *display,guint32 time)
|
|||||||
if (!_gdk_directfb_keyboard_grab_window)
|
if (!_gdk_directfb_keyboard_grab_window)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
toplevel =
|
toplevel = gdk_directfb_window_find_toplevel (_gdk_directfb_keyboard_grab_window);
|
||||||
gdk_directfb_window_find_toplevel (_gdk_directfb_keyboard_grab_window);
|
|
||||||
impl = GDK_WINDOW_IMPL_DIRECTFB (GDK_WINDOW_OBJECT (toplevel)->impl);
|
impl = GDK_WINDOW_IMPL_DIRECTFB (GDK_WINDOW_OBJECT (toplevel)->impl);
|
||||||
|
|
||||||
if (impl->window)
|
if (impl->window)
|
||||||
@ -477,50 +478,19 @@ gdk_directfb_keyboard_ungrab (GdkDisplay *display,guint32 time)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
GdkGrabStatus
|
GdkGrabStatus
|
||||||
gdk_display_keyboard_grab (GdkDisplay *display,GdkWindow *window,
|
gdk_display_keyboard_grab (GdkDisplay *display,
|
||||||
gint owner_events,
|
GdkWindow *window,
|
||||||
guint32 time)
|
gint owner_events,
|
||||||
|
guint32 time)
|
||||||
{
|
{
|
||||||
GdkWindow *toplevel;
|
return gdk_directfb_keyboard_grab (display, window, owner_events, time);
|
||||||
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
|
void
|
||||||
gdk_display_keyboard_ungrab (GdkDisplay *display,guint32 time)
|
gdk_display_keyboard_ungrab (GdkDisplay *display,
|
||||||
|
guint32 time)
|
||||||
{
|
{
|
||||||
GdkWindow *toplevel;
|
return gdk_directfb_keyboard_ungrab (display, time);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -255,7 +255,7 @@ gdk_directfb_clip_region (GdkDrawable *drawable,
|
|||||||
|
|
||||||
if (private->buffered) {
|
if (private->buffered) {
|
||||||
D_DEBUG_AT( GDKDFB_DrawClip, " -> buffered region > %4d,%4d - %4dx%4d < (%ld boxes)\n",
|
D_DEBUG_AT( GDKDFB_DrawClip, " -> buffered region > %4d,%4d - %4dx%4d < (%ld boxes)\n",
|
||||||
GDKDFB_RECTANGLE_VALS_FROM_SEGMENT( &private->paint_region.extents ),
|
GDKDFB_RECTANGLE_VALS_FROM_BOX( &private->paint_region.extents ),
|
||||||
private->paint_region.numRects );
|
private->paint_region.numRects );
|
||||||
|
|
||||||
gdk_region_intersect (ret_clip, &private->paint_region);
|
gdk_region_intersect (ret_clip, &private->paint_region);
|
||||||
@ -269,7 +269,7 @@ gdk_directfb_clip_region (GdkDrawable *drawable,
|
|||||||
if (region->numRects)
|
if (region->numRects)
|
||||||
{
|
{
|
||||||
D_DEBUG_AT( GDKDFB_DrawClip, " -> clipping region > %4d,%4d - %4dx%4d < (%ld boxes)\n",
|
D_DEBUG_AT( GDKDFB_DrawClip, " -> clipping region > %4d,%4d - %4dx%4d < (%ld boxes)\n",
|
||||||
GDKDFB_RECTANGLE_VALS_FROM_SEGMENT( ®ion->extents ), region->numRects );
|
GDKDFB_RECTANGLE_VALS_FROM_BOX( ®ion->extents ), region->numRects );
|
||||||
|
|
||||||
if (gc->clip_x_origin || gc->clip_y_origin)
|
if (gc->clip_x_origin || gc->clip_y_origin)
|
||||||
{
|
{
|
||||||
@ -290,7 +290,7 @@ gdk_directfb_clip_region (GdkDrawable *drawable,
|
|||||||
|
|
||||||
if (private->buffered) {
|
if (private->buffered) {
|
||||||
D_DEBUG_AT( GDKDFB_DrawClip, " => returning clip >> %4d,%4d - %4dx%4d << (%ld boxes)\n",
|
D_DEBUG_AT( GDKDFB_DrawClip, " => returning clip >> %4d,%4d - %4dx%4d << (%ld boxes)\n",
|
||||||
GDKDFB_RECTANGLE_VALS_FROM_SEGMENT( &ret_clip->extents ), ret_clip->numRects );
|
GDKDFB_RECTANGLE_VALS_FROM_BOX( &ret_clip->extents ), ret_clip->numRects );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,15 +324,15 @@ gdk_directfb_clip_region (GdkDrawable *drawable,
|
|||||||
temp.extents.x2 = cur_private->x + cur_impl->width;
|
temp.extents.x2 = cur_private->x + cur_impl->width;
|
||||||
temp.extents.y2 = cur_private->y + cur_impl->height;
|
temp.extents.y2 = cur_private->y + cur_impl->height;
|
||||||
|
|
||||||
D_DEBUG_AT( GDKDFB_DrawClip, " -> clipping child [ %4d,%4d - %4dx%4d ]\n",
|
D_DEBUG_AT( GDKDFB_DrawClip, " -> clipping child [ %4d,%4d - %4dx%4d ] (%ld boxes)\n",
|
||||||
GDKDFB_RECTANGLE_VALS_FROM_SEGMENT( &temp.extents ), temp.numRects );
|
GDKDFB_RECTANGLE_VALS_FROM_BOX( &temp.extents ), temp.numRects );
|
||||||
|
|
||||||
gdk_region_subtract (ret_clip, &temp);
|
gdk_region_subtract (ret_clip, &temp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
D_DEBUG_AT( GDKDFB_DrawClip, " => returning clip >> %4d,%4d - %4dx%4d << (%ld boxes)\n",
|
D_DEBUG_AT( GDKDFB_DrawClip, " => returning clip >> %4d,%4d - %4dx%4d << (%ld boxes)\n",
|
||||||
GDKDFB_RECTANGLE_VALS_FROM_SEGMENT( &ret_clip->extents ), ret_clip->numRects );
|
GDKDFB_RECTANGLE_VALS_FROM_BOX( &ret_clip->extents ), ret_clip->numRects );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Drawing
|
/* Drawing
|
||||||
@ -418,14 +418,14 @@ gdk_directfb_setup_for_drawing (GdkDrawableImplDirectFB *impl,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
_gdk_directfb_draw_rectangle (GdkDrawable *drawable,
|
gdk_directfb_draw_rectangle (GdkDrawable *drawable,
|
||||||
GdkGC *gc,
|
GdkGC *gc,
|
||||||
gint filled,
|
gint filled,
|
||||||
gint x,
|
gint x,
|
||||||
gint y,
|
gint y,
|
||||||
gint width,
|
gint width,
|
||||||
gint height)
|
gint height)
|
||||||
{
|
{
|
||||||
GdkDrawableImplDirectFB *impl;
|
GdkDrawableImplDirectFB *impl;
|
||||||
GdkRegion clip;
|
GdkRegion clip;
|
||||||
@ -1519,7 +1519,7 @@ gdk_drawable_impl_directfb_class_init (GdkDrawableImplDirectFBClass *klass)
|
|||||||
object_class->finalize = gdk_drawable_impl_directfb_finalize;
|
object_class->finalize = gdk_drawable_impl_directfb_finalize;
|
||||||
|
|
||||||
drawable_class->create_gc = _gdk_directfb_gc_new;
|
drawable_class->create_gc = _gdk_directfb_gc_new;
|
||||||
drawable_class->draw_rectangle = _gdk_directfb_draw_rectangle;
|
drawable_class->draw_rectangle = gdk_directfb_draw_rectangle;
|
||||||
drawable_class->draw_arc = gdk_directfb_draw_arc;
|
drawable_class->draw_arc = gdk_directfb_draw_arc;
|
||||||
drawable_class->draw_polygon = gdk_directfb_draw_polygon;
|
drawable_class->draw_polygon = gdk_directfb_draw_polygon;
|
||||||
drawable_class->draw_text = gdk_directfb_draw_text;
|
drawable_class->draw_text = gdk_directfb_draw_text;
|
||||||
|
@ -96,17 +96,6 @@ typedef struct
|
|||||||
|
|
||||||
GType gdk_drawable_impl_directfb_get_type (void);
|
GType gdk_drawable_impl_directfb_get_type (void);
|
||||||
|
|
||||||
void _gdk_directfb_draw_rectangle (GdkDrawable *drawable,
|
|
||||||
GdkGC *gc,
|
|
||||||
gint filled,
|
|
||||||
gint x,
|
|
||||||
gint y,
|
|
||||||
gint width,
|
|
||||||
gint height);
|
|
||||||
|
|
||||||
void _gdk_directfb_update (GdkDrawableImplDirectFB *impl,
|
|
||||||
DFBRegion *region);
|
|
||||||
|
|
||||||
GdkEvent * gdk_directfb_event_make (GdkWindow *window,
|
GdkEvent * gdk_directfb_event_make (GdkWindow *window,
|
||||||
GdkEventType type);
|
GdkEventType type);
|
||||||
|
|
||||||
@ -244,6 +233,14 @@ void gdk_directfb_event_windows_add (GdkWindow *window);
|
|||||||
void gdk_directfb_event_windows_remove (GdkWindow *window);
|
void gdk_directfb_event_windows_remove (GdkWindow *window);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
GdkGrabStatus gdk_directfb_keyboard_grab (GdkDisplay *display,
|
||||||
|
GdkWindow *window,
|
||||||
|
gint owner_events,
|
||||||
|
guint32 time);
|
||||||
|
|
||||||
|
void gdk_directfb_keyboard_ungrab(GdkDisplay *display,
|
||||||
|
guint32 time);
|
||||||
|
|
||||||
GdkGrabStatus gdk_directfb_pointer_grab (GdkWindow *window,
|
GdkGrabStatus gdk_directfb_pointer_grab (GdkWindow *window,
|
||||||
gint owner_events,
|
gint owner_events,
|
||||||
GdkEventMask event_mask,
|
GdkEventMask event_mask,
|
||||||
@ -410,7 +407,7 @@ temp_region_deinit( GdkRegion *region )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define GDKDFB_RECTANGLE_VALS_FROM_SEGMENT(s) (s)->x1, (s)->y1, (s)->x2-(s)->x1, (s)->y2-(s)->y1
|
#define GDKDFB_RECTANGLE_VALS_FROM_BOX(s) (s)->x1, (s)->y1, (s)->x2-(s)->x1, (s)->y2-(s)->y1
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GDK_PRIVATE_DIRECTFB_H__ */
|
#endif /* __GDK_PRIVATE_DIRECTFB_H__ */
|
||||||
|
@ -3055,7 +3055,7 @@ gdk_window_impl_directfb_process_updates (GdkPaintable *paintable,
|
|||||||
private->update_area = NULL;
|
private->update_area = NULL;
|
||||||
|
|
||||||
D_DEBUG_AT( GDKDFB_Paintable, " -> update area %4d,%4d-%4dx%4d\n",
|
D_DEBUG_AT( GDKDFB_Paintable, " -> update area %4d,%4d-%4dx%4d\n",
|
||||||
GDKDFB_RECTANGLE_VALS_FROM_SEGMENT( &update_area->extents ) );
|
GDKDFB_RECTANGLE_VALS_FROM_BOX( &update_area->extents ) );
|
||||||
|
|
||||||
if (_gdk_event_func && gdk_window_is_viewable (window))
|
if (_gdk_event_func && gdk_window_is_viewable (window))
|
||||||
{
|
{
|
||||||
@ -3105,8 +3105,8 @@ gdk_window_impl_directfb_begin_paint_region (GdkPaintable *paintable,
|
|||||||
if (!region)
|
if (!region)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
D_DEBUG_AT( GDKDFB_Window, "%s( %p ) <- %4d,%4d-%4d,%4d (%d boxes)\n", __FUNCTION__,
|
D_DEBUG_AT( GDKDFB_Window, "%s( %p ) <- %4d,%4d-%4d,%4d (%ld boxes)\n", __FUNCTION__,
|
||||||
paintable, GDKDFB_RECTANGLE_VALS_FROM_SEGMENT(®ion->extents), region->numRects );
|
paintable, GDKDFB_RECTANGLE_VALS_FROM_BOX(®ion->extents), region->numRects );
|
||||||
|
|
||||||
/* When it's buffered... */
|
/* When it's buffered... */
|
||||||
if (impl->buffered)
|
if (impl->buffered)
|
||||||
@ -3114,7 +3114,7 @@ gdk_window_impl_directfb_begin_paint_region (GdkPaintable *paintable,
|
|||||||
/* ...we're already painting on it! */
|
/* ...we're already painting on it! */
|
||||||
g_assert( impl->paint_depth > 0 );
|
g_assert( impl->paint_depth > 0 );
|
||||||
|
|
||||||
D_DEBUG_AT( GDKDFB_Window, " -> painted %4d,%4d-%4dx%4d (%d boxes)\n",
|
D_DEBUG_AT( GDKDFB_Window, " -> painted %4d,%4d-%4dx%4d (%ld boxes)\n",
|
||||||
DFB_RECTANGLE_VALS_FROM_REGION( &impl->paint_region.extents ), impl->paint_region.numRects );
|
DFB_RECTANGLE_VALS_FROM_REGION( &impl->paint_region.extents ), impl->paint_region.numRects );
|
||||||
|
|
||||||
/* Add the new region to the paint region... */
|
/* Add the new region to the paint region... */
|
||||||
@ -3134,13 +3134,13 @@ gdk_window_impl_directfb_begin_paint_region (GdkPaintable *paintable,
|
|||||||
impl->buffered = TRUE;
|
impl->buffered = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
D_DEBUG_AT( GDKDFB_Window, " -> painting %4d,%4d-%4dx%4d (%d boxes)\n",
|
D_DEBUG_AT( GDKDFB_Window, " -> painting %4d,%4d-%4dx%4d (%ld boxes)\n",
|
||||||
DFB_RECTANGLE_VALS_FROM_REGION( &impl->paint_region.extents ), impl->paint_region.numRects );
|
DFB_RECTANGLE_VALS_FROM_REGION( &impl->paint_region.extents ), impl->paint_region.numRects );
|
||||||
|
|
||||||
/* ...but clip the initial/compound result against the clip region. */
|
/* ...but clip the initial/compound result against the clip region. */
|
||||||
gdk_region_intersect (&impl->paint_region, &impl->clip_region);
|
gdk_region_intersect (&impl->paint_region, &impl->clip_region);
|
||||||
|
|
||||||
D_DEBUG_AT( GDKDFB_Window, " -> clipped %4d,%4d-%4dx%4d (%d boxes)\n",
|
D_DEBUG_AT( GDKDFB_Window, " -> clipped %4d,%4d-%4dx%4d (%ld boxes)\n",
|
||||||
DFB_RECTANGLE_VALS_FROM_REGION( &impl->paint_region.extents ), impl->paint_region.numRects );
|
DFB_RECTANGLE_VALS_FROM_REGION( &impl->paint_region.extents ), impl->paint_region.numRects );
|
||||||
|
|
||||||
impl->paint_depth++;
|
impl->paint_depth++;
|
||||||
@ -3151,7 +3151,7 @@ gdk_window_impl_directfb_begin_paint_region (GdkPaintable *paintable,
|
|||||||
{
|
{
|
||||||
GdkRegionBox *box = ®ion->rects[i];
|
GdkRegionBox *box = ®ion->rects[i];
|
||||||
|
|
||||||
D_DEBUG_AT( GDKDFB_Window, " -> [%2d] %4d,%4d-%4dx%4d\n", i, GDKDFB_RECTANGLE_VALS_FROM_SEGMENT( box ) );
|
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),
|
_gdk_windowing_window_clear_area (GDK_WINDOW(wimpl->gdkWindow),
|
||||||
box->x1,
|
box->x1,
|
||||||
@ -3188,7 +3188,7 @@ gdk_window_impl_directfb_end_paint (GdkPaintable *paintable)
|
|||||||
impl->paint_region.extents.x2-1,
|
impl->paint_region.extents.x2-1,
|
||||||
impl->paint_region.extents.y2-1 };
|
impl->paint_region.extents.y2-1 };
|
||||||
|
|
||||||
D_DEBUG_AT( GDKDFB_Window, " -> flip %4d,%4d-%4dx%4d (%d boxes)\n",
|
D_DEBUG_AT( GDKDFB_Window, " -> flip %4d,%4d-%4dx%4d (%ld boxes)\n",
|
||||||
DFB_RECTANGLE_VALS_FROM_REGION( ® ), impl->paint_region.numRects );
|
DFB_RECTANGLE_VALS_FROM_REGION( ® ), impl->paint_region.numRects );
|
||||||
|
|
||||||
impl->surface->Flip( impl->surface, ®, 0 );
|
impl->surface->Flip( impl->surface, ®, 0 );
|
||||||
@ -3221,7 +3221,7 @@ gdk_window_impl_directfb_end_paint (GdkPaintable *paintable)
|
|||||||
reg.x2 = impl->abs_x - top->x + impl->paint_region.extents.x2 - 1;
|
reg.x2 = impl->abs_x - top->x + impl->paint_region.extents.x2 - 1;
|
||||||
reg.y2 = impl->abs_y - top->y + impl->paint_region.extents.y2 - 1;
|
reg.y2 = impl->abs_y - top->y + impl->paint_region.extents.y2 - 1;
|
||||||
|
|
||||||
D_DEBUG_AT( GDKDFB_Window, " -> queue flip %4d,%4d-%4dx%4d (%d boxes)\n",
|
D_DEBUG_AT( GDKDFB_Window, " -> queue flip %4d,%4d-%4dx%4d (%ld boxes)\n",
|
||||||
DFB_RECTANGLE_VALS_FROM_REGION( ® ), impl->paint_region.numRects );
|
DFB_RECTANGLE_VALS_FROM_REGION( ® ), impl->paint_region.numRects );
|
||||||
|
|
||||||
dfb_updates_add( &wimpl->flips, ® );
|
dfb_updates_add( &wimpl->flips, ® );
|
||||||
|
Loading…
Reference in New Issue
Block a user