diff options
author | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2016-02-03 22:23:54 +0200 |
---|---|---|
committer | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2016-02-03 23:05:29 +0200 |
commit | 2aec0aceb5302efd8aec7814c732f362569acd8a (patch) | |
tree | f4e17bbc7430009148ea5833faf6defd5ef96d20 /libmetacity/meta-theme.c | |
parent | 1e87976ef41b277ee7fa39f088df92354d52250b (diff) | |
download | metacity-2aec0aceb5302efd8aec7814c732f362569acd8a.tar.gz |
theme: move meta_frame_type_from_string to libmetacity
Diffstat (limited to 'libmetacity/meta-theme.c')
-rw-r--r-- | libmetacity/meta-theme.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libmetacity/meta-theme.c b/libmetacity/meta-theme.c index e875ab96..193fcbdb 100644 --- a/libmetacity/meta-theme.c +++ b/libmetacity/meta-theme.c @@ -17,6 +17,8 @@ #include "config.h" +#include <string.h> + #include "meta-enum-types.h" #include "meta-theme.h" #include "meta-theme-gtk-private.h" @@ -432,6 +434,27 @@ meta_pango_font_desc_get_text_height (const PangoFontDescription *font_desc, return retval; } +MetaFrameType +meta_frame_type_from_string (const gchar *str) +{ + if (strcmp ("normal", str) == 0) + return META_FRAME_TYPE_NORMAL; + else if (strcmp ("dialog", str) == 0) + return META_FRAME_TYPE_DIALOG; + else if (strcmp ("modal_dialog", str) == 0) + return META_FRAME_TYPE_MODAL_DIALOG; + else if (strcmp ("utility", str) == 0) + return META_FRAME_TYPE_UTILITY; + else if (strcmp ("menu", str) == 0) + return META_FRAME_TYPE_MENU; + else if (strcmp ("border", str) == 0) + return META_FRAME_TYPE_BORDER; + else if (strcmp ("attached", str) == 0) + return META_FRAME_TYPE_ATTACHED; + else + return META_FRAME_TYPE_LAST; +} + gboolean meta_theme_allows_shade_stick_above_buttons (MetaTheme *theme) { |