[metacity/wip/gtk-theme: 41/51] MetaFrames: factor out MetaUIFrame accessors for borders, corner radiuses



commit 8ec4552e9752393b4054022b6e6930566efc0630
Author: Simon McVittie <simon mcvittie collabora co uk>
Date:   Thu Apr 11 16:55:41 2013 +0100

    MetaFrames: factor out MetaUIFrame accessors for borders, corner
     radiuses
    
    This makes it a bit simpler for other functions on a MetaUIFrame to
    get this information.
    
    Bug: https://bugzilla.gnome.org/show_bug.cgi?id=697758
    Reviewed-by: Jasper St. Pierre <jstpierre mecheye net>
    Signed-off-by: Simon McVittie <simon mcvittie collabora co uk>

 src/ui/frames.c |   56 ++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 39 insertions(+), 17 deletions(-)
---
diff --git a/src/ui/frames.c b/src/ui/frames.c
index 232c040..8c63cba 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -768,20 +768,14 @@ meta_frames_lookup_window (MetaFrames *frames,
   return frame;
 }
 
-void
-meta_frames_get_borders (MetaFrames *frames,
-                         Window xwindow,
-                         MetaFrameBorders *borders)
+static void
+meta_ui_frame_get_borders (MetaFrames       *frames,
+                           MetaUIFrame      *frame,
+                           MetaFrameBorders *borders)
 {
   MetaFrameFlags flags;
-  MetaUIFrame *frame;
   MetaFrameType type;
 
-  frame = meta_frames_lookup_window (frames, xwindow);
-
-  if (frame == NULL)
-    meta_bug ("No such frame 0x%lx\n", xwindow);
-
   meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow,
                  META_CORE_GET_FRAME_FLAGS, &flags,
                  META_CORE_GET_FRAME_TYPE, &type,
@@ -805,18 +799,30 @@ meta_frames_get_borders (MetaFrames *frames,
 }
 
 void
-meta_frames_get_corner_radiuses (MetaFrames *frames,
-                                 Window      xwindow,
-                                 float      *top_left,
-                                 float      *top_right,
-                                 float      *bottom_left,
-                                 float      *bottom_right)
+meta_frames_get_borders (MetaFrames       *frames,
+                         Window            xwindow,
+                         MetaFrameBorders *borders)
 {
   MetaUIFrame *frame;
-  MetaFrameGeometry fgeom;
 
   frame = meta_frames_lookup_window (frames, xwindow);
 
+  if (frame == NULL)
+    meta_bug ("No such frame 0x%lx\n", xwindow);
+
+  meta_ui_frame_get_borders (frames, frame, borders);
+}
+
+static void
+meta_ui_frame_get_corner_radiuses (MetaFrames  *frames,
+                                   MetaUIFrame *frame,
+                                   float       *top_left,
+                                   float       *top_right,
+                                   float       *bottom_left,
+                                   float       *bottom_right)
+{
+  MetaFrameGeometry fgeom;
+
   meta_frames_calc_geometry (frames, frame, &fgeom);
 
   /* For compatibility with the code in get_visible_rect(), there's
@@ -839,6 +845,22 @@ meta_frames_get_corner_radiuses (MetaFrames *frames,
 }
 
 void
+meta_frames_get_corner_radiuses (MetaFrames *frames,
+                                 Window      xwindow,
+                                 float      *top_left,
+                                 float      *top_right,
+                                 float      *bottom_left,
+                                 float      *bottom_right)
+{
+  MetaUIFrame *frame;
+
+  frame = meta_frames_lookup_window (frames, xwindow);
+
+  meta_ui_frame_get_corner_radiuses (frames, frame, top_left, top_right,
+                                     bottom_left, bottom_right);
+}
+
+void
 meta_frames_reset_bg (MetaFrames *frames,
                       Window  xwindow)
 {


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