From 77cb0db9c2702f077284178cf28dddc39add1410 Mon Sep 17 00:00:00 2001 From: Thomas James Alexander Thurman Date: Sun, 11 Jan 2009 04:48:54 +0000 Subject: [PATCH] add meta_theme_draw_frame_by_name, which is needed for the theme editor. * src/ui/theme.[ch]: add meta_theme_draw_frame_by_name, which is needed for the theme editor. svn path=/trunk/; revision=4074 --- ChangeLog | 5 +++++ src/ui/theme.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/ui/theme.h | 17 +++++++++++++++ 3 files changed, 80 insertions(+) diff --git a/ChangeLog b/ChangeLog index a035d54ef..8851741c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-01-10 Thomas Thurman + + * src/ui/theme.[ch]: add meta_theme_draw_frame_by_name, which + is needed for the theme editor. + 2008-12-26 Thomas Thurman * configure.in: Post-release bump to 2.25.144. diff --git a/src/ui/theme.c b/src/ui/theme.c index 6343fd414..1d822c82d 100644 --- a/src/ui/theme.c +++ b/src/ui/theme.c @@ -5084,6 +5084,64 @@ meta_theme_draw_frame (MetaTheme *theme, mini_icon, icon); } +void +meta_theme_draw_frame_by_name (MetaTheme *theme, + GtkWidget *widget, + GdkDrawable *drawable, + const GdkRectangle *clip, + int x_offset, + int y_offset, + const gchar *style_name, + MetaFrameFlags flags, + int client_width, + int client_height, + PangoLayout *title_layout, + int text_height, + const MetaButtonLayout *button_layout, + MetaButtonState button_states[META_BUTTON_TYPE_LAST], + GdkPixbuf *mini_icon, + GdkPixbuf *icon) +{ + MetaFrameGeometry fgeom; + MetaFrameStyle *style; + + style = meta_theme_lookup_style (theme, style_name); + + /* Parser is not supposed to allow this currently */ + if (style == NULL) + return; + + meta_frame_layout_calc_geometry (style->layout, + text_height, + flags, + client_width, client_height, + button_layout, + &fgeom, + theme); + + meta_frame_style_draw (style, + widget, + drawable, + x_offset, y_offset, + clip, + &fgeom, + client_width, client_height, + title_layout, + text_height, + button_states, + mini_icon, icon); +} + + + + + + + + + + + void meta_theme_get_frame_borders (MetaTheme *theme, MetaFrameType type, diff --git a/src/ui/theme.h b/src/ui/theme.h index 2fc1283fa..737f30a88 100644 --- a/src/ui/theme.h +++ b/src/ui/theme.h @@ -1000,6 +1000,23 @@ void meta_theme_draw_frame (MetaTheme *theme, GdkPixbuf *mini_icon, GdkPixbuf *icon); +void meta_theme_draw_frame_by_name (MetaTheme *theme, + GtkWidget *widget, + GdkDrawable *drawable, + const GdkRectangle *clip, + int x_offset, + int y_offset, + const gchar *style_name, + MetaFrameFlags flags, + int client_width, + int client_height, + PangoLayout *title_layout, + int text_height, + const MetaButtonLayout *button_layout, + MetaButtonState button_states[META_BUTTON_TYPE_LAST], + GdkPixbuf *mini_icon, + GdkPixbuf *icon); + void meta_theme_get_frame_borders (MetaTheme *theme, MetaFrameType type, int text_height,