[mutter/wip/cb2eb3: 34/55] ui: Remove meta_ui_theme_get_frame_borders



commit 8f789a8fad7a89e9999265e739313a4d09d91f20
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Sun Apr 29 15:15:50 2012 -0400

    ui: Remove meta_ui_theme_get_frame_borders
    
    The function is easily replaced, and also becomes more correct
    as different window types may have different extents.

 src/core/display.c |    7 +++----
 src/ui/ui.c        |   37 -------------------------------------
 src/ui/ui.h        |    4 ----
 3 files changed, 3 insertions(+), 45 deletions(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index 6ef744e..b73da9f 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -4385,10 +4385,9 @@ process_request_frame_extents (MetaDisplay    *display,
         }
 
       /* Return estimated frame extents for a normal window. */
-      meta_ui_theme_get_frame_borders (screen->ui,
-                                       META_FRAME_TYPE_NORMAL,
-                                       0,
-                                       &borders);
+      meta_ui_get_frame_borders (screen->ui,
+                                 xwindow,
+                                 &borders);
       data[0] = borders.visible.left;
       data[1] = borders.visible.right;
       data[2] = borders.visible.top;
diff --git a/src/ui/ui.c b/src/ui/ui.c
index 9fb7d1f..6eb459d 100644
--- a/src/ui/ui.c
+++ b/src/ui/ui.c
@@ -707,43 +707,6 @@ meta_text_property_to_utf8 (Display             *xdisplay,
 }
 
 void
-meta_ui_theme_get_frame_borders (MetaUI *ui,
-                                 MetaFrameType      type,
-                                 MetaFrameFlags     flags,
-                                 MetaFrameBorders  *borders)
-{
-  int text_height;
-  GtkStyleContext *style = NULL;
-  PangoContext *context;
-  const PangoFontDescription *font_desc;
-
-  if (meta_ui_have_a_theme ())
-    {
-      context = gtk_widget_get_pango_context (GTK_WIDGET (ui->frames));
-      font_desc = meta_prefs_get_titlebar_font ();
-
-      if (!font_desc)
-        {
-          style = gtk_style_context_new ();
-          font_desc = gtk_style_context_get_font (style, 0);
-        }
-
-      text_height = meta_pango_font_desc_get_text_height (font_desc, context);
-
-      meta_theme_get_frame_borders (meta_theme_get_current (),
-                                    type, text_height, flags,
-                                    borders);
-    }
-  else
-    {
-      meta_frame_borders_clear (borders);
-    }
-
-  if (style != NULL)
-    g_object_unref (style);
-}
-
-void
 meta_ui_set_current_theme (const char *name,
                            gboolean    force_reload)
 {
diff --git a/src/ui/ui.h b/src/ui/ui.h
index 8651329..fdba2e3 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -57,10 +57,6 @@ MetaUI* meta_ui_new (Display *xdisplay,
                      Screen  *screen);
 void    meta_ui_free (MetaUI *ui);
 
-void meta_ui_theme_get_frame_borders (MetaUI *ui,
-                                      MetaFrameType      type,
-                                      MetaFrameFlags     flags,
-                                      MetaFrameBorders *borders);
 void meta_ui_get_frame_borders (MetaUI *ui,
                                 Window frame_xwindow,
                                 MetaFrameBorders *borders);


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