summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Thurman <tthurman@gnome.org>2009-10-19 11:26:17 -0400
committerThomas Thurman <tthurman@gnome.org>2009-10-19 11:26:17 -0400
commit0a4a637f099f76339ab13e2439dfd273a71631b0 (patch)
tree03f6dbd36f24260895b1a05ca708bb9ee033c2ce
parentde02c05845be34f8514ddbd4aafb75ed3ed20f6d (diff)
downloadmetacity-0a4a637f099f76339ab13e2439dfd273a71631b0.tar.gz
cowbell_get_current_style minimally working
-rw-r--r--src/ui/theme.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 981d0c03..383f8dea 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;