[metacity/cowbell] cowbell_get_current_style minimally working



commit 0a4a637f099f76339ab13e2439dfd273a71631b0
Author: Thomas Thurman <tthurman gnome org>
Date:   Mon Oct 19 11:26:17 2009 -0400

    cowbell_get_current_style minimally working

 src/ui/theme.c |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)
---
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 981d0c0..383f8de 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -586,13 +586,21 @@ cowbell_get_edge_sizes (ccss_style_t *style,
   *right = SILLY_BORDER_SIZE;
 }
 
+/**
+ * Returns the style to use with the given type and flags.
+ * When you're done with it, call ccss_style_destroy (style).
+ * (FIXME: Currently always returns the plain style.)
+ */
 static ccss_style_t *
 cowbell_get_current_style (MetaTheme *theme,
                            MetaFrameType type,
-                           MetaFrameFlags flags)
+                           MetaFrameFlags flags,
+                           CopperClasses style_id)
 {
-  /* stub */
-  return NULL;
+  ccss_stylesheet_t *stylesheet = theme->stylesheet;
+
+  return ccss_stylesheet_query (stylesheet,
+                                (ccss_node_t*) &cowbell_nodes[style_id]);
 }
 
 void
@@ -608,13 +616,15 @@ meta_theme_get_frame_borders (MetaTheme         *theme,
   /* stub */
   ccss_style_t *style;
 
-  style = cowbell_get_current_style (theme, type, flags);
+  style = cowbell_get_current_style (theme, type, flags, CC_FRAME);
 
   cowbell_get_edge_sizes (NULL, TRUE,
                           top_height,
                           bottom_height,
                           left_width,
                           right_width);
+
+  ccss_style_destroy (style);
 }
 
 #define MAX_MIDDLE_BACKGROUNDS (MAX_BUTTONS_PER_CORNER - 2)
@@ -650,7 +660,7 @@ meta_theme_calc_geometry (MetaTheme              *theme,
   int i;
   ccss_style_t *style;
 
-  style = cowbell_get_current_style (theme, type, flags);
+  style = cowbell_get_current_style (theme, type, flags, CC_FRAME);
 
   cowbell_get_edge_sizes (style,
                           TRUE,
@@ -659,6 +669,8 @@ meta_theme_calc_geometry (MetaTheme              *theme,
                           &(fgeom->left_width),
                           &(fgeom->right_width));
 
+  ccss_style_destroy (style);
+
   fgeom->width = 40+client_width;
   fgeom->height = 40+client_height;
 



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