[metacity/cowbell] rm meta_theme_get_frame_style



commit 90c8821bc4bbf3a113a6a89e890517e45f161410
Author: Thomas Thurman <tthurman gnome org>
Date:   Tue Oct 27 17:28:24 2009 -0400

    rm meta_theme_get_frame_style

 src/ui/frames.c |   24 ++++++++++++++++--------
 src/ui/frames.h |    4 +++-
 src/ui/theme.c  |   14 --------------
 src/ui/theme.h  |   31 -------------------------------
 4 files changed, 19 insertions(+), 54 deletions(-)
---
diff --git a/src/ui/frames.c b/src/ui/frames.c
index 5021d81..d941d3a 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -458,7 +458,7 @@ meta_frames_ensure_layout (MetaFrames  *frames,
   GtkWidget *widget;
   MetaFrameFlags flags;
   MetaFrameType type;
-  MetaFrameStyle *style;
+  MetaTheme *current;
   
   g_return_if_fail (GTK_WIDGET_REALIZED (frames));
 
@@ -469,10 +469,11 @@ meta_frames_ensure_layout (MetaFrames  *frames,
                  META_CORE_GET_FRAME_TYPE, &type,
                  META_CORE_GET_END);
 
-  style = meta_theme_get_frame_style (meta_theme_get_current (),
-                                      type, flags);
+  current = meta_theme_get_current ();
 
-  if (style != frame->cache_style)
+  if (frame->cache_theme != current ||
+      frame->cache_frametype != type ||
+      frame->cache_frameflags != flags)
     {
       if (frame->layout)
         {
@@ -486,7 +487,9 @@ meta_frames_ensure_layout (MetaFrames  *frames,
         }
     }
 
-  frame->cache_style = style;
+  frame->cache_theme = current;
+  frame->cache_frametype = type;
+  frame->cache_frameflags = flags;
   
   if (frame->layout == NULL)
     {
@@ -618,7 +621,10 @@ meta_frames_manage_window (MetaFrames *frames,
   /* Don't set event mask here, it's in frame.c */
   
   frame->xwindow = xwindow;
-  frame->cache_style = NULL;
+  frame->cache_theme = NULL;
+  /* set these to zero; they will be ignored since cache_theme is NULL */
+  frame->cache_frameflags = 0;
+  frame->cache_frametype = 0;
   frame->layout = NULL;
   frame->text_height = -1;
   frame->title = NULL;
@@ -2534,7 +2540,9 @@ meta_frames_set_window_background (MetaFrames   *frames,
 {
   MetaFrameFlags flags;
   MetaFrameType type;
+#if 0
   MetaFrameStyle *style;
+#endif
   gboolean frame_exists;
 
   meta_core_get (gdk_display, frame->xwindow,
@@ -2543,6 +2551,7 @@ meta_frames_set_window_background (MetaFrames   *frames,
                  META_CORE_GET_FRAME_TYPE, &type,
                  META_CORE_GET_END);
 
+#if 0
   if (frame_exists)
     {
       style = meta_theme_get_frame_style (meta_theme_get_current (),
@@ -2551,7 +2560,6 @@ meta_frames_set_window_background (MetaFrames   *frames,
 
   if (frame_exists && style->window_background_color != NULL)
     {
-#if 0
       GdkColor color;
       GdkVisual *visual;
 
@@ -2577,9 +2585,9 @@ meta_frames_set_window_background (MetaFrames   *frames,
         }
 
       gdk_window_set_background (frame->window, &color);
-#endif
     }
   else
+#endif
     {
       gtk_style_set_background (frame->style,
                                 frame->window, GTK_STATE_NORMAL);
diff --git a/src/ui/frames.h b/src/ui/frames.h
index ad8d361..ad698f2 100644
--- a/src/ui/frames.h
+++ b/src/ui/frames.h
@@ -76,7 +76,9 @@ struct _MetaUIFrame
   Window xwindow;
   GdkWindow *window;
   GtkStyle *style;
-  MetaFrameStyle *cache_style;
+  MetaTheme *cache_theme;
+  MetaFrameFlags cache_frameflags;
+  MetaFrameType cache_frametype;
   PangoLayout *layout;
   int text_height;
   char *title; /* NULL once we have a layout */
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 2970f37..d46d599 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -323,20 +323,6 @@ meta_theme_set_current (const char *name,
   g_free (css_path);
 }
 
-MetaFrameStyle*
-meta_theme_get_frame_style (MetaTheme     *theme,
-                            MetaFrameType  type,
-                            MetaFrameFlags flags)
-{
-  /* stub FIXME */
-  /* FIXME of course this leaks like crazy, but it's a stub */
-  MetaFrameStyle *style;
-
-  style = g_new0 (MetaFrameStyle, 1);
-
-  return style;
-}
-
 double
 meta_theme_get_title_scale (MetaTheme     *theme,
                             MetaFrameType  type,
diff --git a/src/ui/theme.h b/src/ui/theme.h
index 8a98053..a881e52 100644
--- a/src/ui/theme.h
+++ b/src/ui/theme.h
@@ -141,21 +141,6 @@ typedef struct
 
 typedef struct _MetaTheme MetaTheme;
 
-typedef struct {
-  gboolean dummy;
-
-  /**
-   * Background colour of the window. Only present in theme formats
-   * 2 and above. Can be NULL to use the standard GTK theme engine.
-   *
-   * FIXME: This is the only place that code outside the theme
-   * subsystem accesses the internals of a struct within it;
-   * this should change.
-   */
-  MetaColorSpec *window_background_color;
-
-} MetaFrameStyle;
-
 /**
  * Returns the current theme.
  *
@@ -175,22 +160,6 @@ void       meta_theme_set_current (const char *name,
                                    gboolean    force_reload);
 
 /**
- * Returns a style object representing the configuration of
- * window borders in a given theme in a given situation.
- *
- * \bug This is probably unnecessary.  The framestyle isn't
- *      passed in to the drawing function at all.  Look into
- *      removing this.
- *
- * \param theme  a theme
- * \param type   the type of window: normal, dialogue, etc.
- * \param flags  the situation: shaded, with focus, etc.
- */
-MetaFrameStyle* meta_theme_get_frame_style (MetaTheme     *theme,
-                                            MetaFrameType  type,
-                                            MetaFrameFlags flags);
-
-/**
  * Returns how much the title should be scaled.
  *
  * \bug This should probably be an operation on a MetaFrameStyle.



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