gtk+ r19447 - in trunk: . gdk/directfb



Author: neo
Date: Thu Jan 31 17:25:19 2008
New Revision: 19447
URL: http://svn.gnome.org/viewvc/gtk+?rev=19447&view=rev

Log:
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.



Modified:
   trunk/ChangeLog
   trunk/gdk/directfb/gdkdisplay-directfb.c
   trunk/gdk/directfb/gdkdrawable-directfb.c
   trunk/gdk/directfb/gdkprivate-directfb.h
   trunk/gdk/directfb/gdkwindow-directfb.c

Modified: trunk/gdk/directfb/gdkdisplay-directfb.c
==============================================================================
--- trunk/gdk/directfb/gdkdisplay-directfb.c	(original)
+++ trunk/gdk/directfb/gdkdisplay-directfb.c	Thu Jan 31 17:25:19 2008
@@ -410,9 +410,10 @@
  */
 
 GdkGrabStatus
-gdk_directfb_keyboard_grab (GdkDisplay *display,GdkWindow *window,
-                            gint       owner_events,
-                            guint32    time)
+gdk_directfb_keyboard_grab (GdkDisplay *display,
+                            GdkWindow  *window,
+                            gint        owner_events,
+                            guint32     time)
 {
   GdkWindow             *toplevel;
   GdkWindowImplDirectFB *impl;
@@ -437,7 +438,8 @@
 }
 
 void
-gdk_directfb_keyboard_ungrab (GdkDisplay *display,guint32 time)
+gdk_directfb_keyboard_ungrab (GdkDisplay *display,
+                              guint32     time)
 {
   GdkWindow             *toplevel;
   GdkWindowImplDirectFB *impl;
@@ -445,8 +447,7 @@
   if (!_gdk_directfb_keyboard_grab_window)
     return;
 
-  toplevel =
-    gdk_directfb_window_find_toplevel (_gdk_directfb_keyboard_grab_window);
+  toplevel = gdk_directfb_window_find_toplevel (_gdk_directfb_keyboard_grab_window);
   impl = GDK_WINDOW_IMPL_DIRECTFB (GDK_WINDOW_OBJECT (toplevel)->impl);
 
   if (impl->window)
@@ -477,50 +478,19 @@
  */
 
 GdkGrabStatus
-gdk_display_keyboard_grab (GdkDisplay *display,GdkWindow *window,
-                   gint       owner_events,
-                   guint32    time)
+gdk_display_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;
+  return gdk_directfb_keyboard_grab (display, window, owner_events, time);
 }
 
 void
-gdk_display_keyboard_ungrab (GdkDisplay *display,guint32 time)
+gdk_display_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;
+  return gdk_directfb_keyboard_ungrab (display, time);
 }
 
 

Modified: trunk/gdk/directfb/gdkdrawable-directfb.c
==============================================================================
--- trunk/gdk/directfb/gdkdrawable-directfb.c	(original)
+++ trunk/gdk/directfb/gdkdrawable-directfb.c	Thu Jan 31 17:25:19 2008
@@ -255,7 +255,7 @@
 
   if (private->buffered) {
        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 );
 
     gdk_region_intersect (ret_clip, &private->paint_region);
@@ -269,7 +269,7 @@
       if (region->numRects)
         {
           D_DEBUG_AT( GDKDFB_DrawClip, "  -> clipping region   > %4d,%4d - %4dx%4d <  (%ld boxes)\n",
-                      GDKDFB_RECTANGLE_VALS_FROM_SEGMENT( &region->extents ), region->numRects );
+                      GDKDFB_RECTANGLE_VALS_FROM_BOX( &region->extents ), region->numRects );
 
           if (gc->clip_x_origin || gc->clip_y_origin)
             {
@@ -290,7 +290,7 @@
 
   if (private->buffered) {
        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;
   }
 
@@ -324,15 +324,15 @@
           temp.extents.x2 = cur_private->x + cur_impl->width;
           temp.extents.y2 = cur_private->y + cur_impl->height;
 
-          D_DEBUG_AT( GDKDFB_DrawClip, "  -> clipping child    [ %4d,%4d - %4dx%4d ]\n",
-                      GDKDFB_RECTANGLE_VALS_FROM_SEGMENT( &temp.extents ), temp.numRects );
+          D_DEBUG_AT( GDKDFB_DrawClip, "  -> clipping child    [ %4d,%4d - %4dx%4d ]  (%ld boxes)\n",
+                      GDKDFB_RECTANGLE_VALS_FROM_BOX( &temp.extents ), temp.numRects );
 
           gdk_region_subtract (ret_clip, &temp);
         }
     }
 
   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
@@ -418,14 +418,14 @@
   return TRUE;
 }
 
-void
-_gdk_directfb_draw_rectangle (GdkDrawable *drawable,
-                              GdkGC       *gc,
-                              gint         filled,
-                              gint         x,
-                              gint         y,
-                              gint         width,
-                              gint         height)
+static void
+gdk_directfb_draw_rectangle (GdkDrawable *drawable,
+                             GdkGC       *gc,
+                             gint         filled,
+                             gint         x,
+                             gint         y,
+                             gint         width,
+                             gint         height)
 {
   GdkDrawableImplDirectFB *impl;
   GdkRegion                clip;
@@ -1519,7 +1519,7 @@
   object_class->finalize = gdk_drawable_impl_directfb_finalize;
 
   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_polygon   = gdk_directfb_draw_polygon;
   drawable_class->draw_text      = gdk_directfb_draw_text;

Modified: trunk/gdk/directfb/gdkprivate-directfb.h
==============================================================================
--- trunk/gdk/directfb/gdkprivate-directfb.h	(original)
+++ trunk/gdk/directfb/gdkprivate-directfb.h	Thu Jan 31 17:25:19 2008
@@ -96,17 +96,6 @@
 
 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,
                                          GdkEventType             type);
 
@@ -244,6 +233,14 @@
 void       gdk_directfb_event_windows_remove (GdkWindow *window);
 #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,
                                            gint                 owner_events,
                                            GdkEventMask         event_mask,
@@ -410,7 +407,7 @@
 }
 
 
-#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__ */

Modified: trunk/gdk/directfb/gdkwindow-directfb.c
==============================================================================
--- trunk/gdk/directfb/gdkwindow-directfb.c	(original)
+++ trunk/gdk/directfb/gdkwindow-directfb.c	Thu Jan 31 17:25:19 2008
@@ -3055,7 +3055,7 @@
   private->update_area = NULL;
       
   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))
     {
@@ -3105,8 +3105,8 @@
   if (!region)
     return;
 
-  D_DEBUG_AT( GDKDFB_Window, "%s( %p ) <- %4d,%4d-%4d,%4d (%d boxes)\n", __FUNCTION__,
-              paintable, GDKDFB_RECTANGLE_VALS_FROM_SEGMENT(&region->extents), region->numRects );
+  D_DEBUG_AT( GDKDFB_Window, "%s( %p ) <- %4d,%4d-%4d,%4d (%ld boxes)\n", __FUNCTION__,
+              paintable, GDKDFB_RECTANGLE_VALS_FROM_BOX(&region->extents), region->numRects );
 
   /* When it's buffered... */
   if (impl->buffered)
@@ -3114,7 +3114,7 @@
       /* ...we're already painting on it! */
       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 );
 
       /* Add the new region to the paint region... */
@@ -3134,13 +3134,13 @@
       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 );
 
   /* ...but clip the initial/compound result against the 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 );
 
   impl->paint_depth++;
@@ -3151,7 +3151,7 @@
     {
       GdkRegionBox *box = &region->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),
                                         box->x1,
@@ -3188,7 +3188,7 @@
                             impl->paint_region.extents.x2-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( &reg ), impl->paint_region.numRects );
 
           impl->surface->Flip( impl->surface, &reg, 0 );
@@ -3221,7 +3221,7 @@
                   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;
   
-                  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( &reg ), impl->paint_region.numRects );
   
                   dfb_updates_add( &wimpl->flips, &reg );



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]