summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberts Muktupāvels <alberts.muktupavels@gmail.com>2016-02-03 22:23:54 +0200
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2016-02-03 23:05:29 +0200
commit2aec0aceb5302efd8aec7814c732f362569acd8a (patch)
treef4e17bbc7430009148ea5833faf6defd5ef96d20
parent1e87976ef41b277ee7fa39f088df92354d52250b (diff)
downloadmetacity-2aec0aceb5302efd8aec7814c732f362569acd8a.tar.gz
theme: move meta_frame_type_from_string to libmetacity
-rw-r--r--libmetacity/meta-theme-metacity.c21
-rw-r--r--libmetacity/meta-theme.c23
-rw-r--r--libmetacity/meta-theme.h2
-rw-r--r--src/ui/theme.c21
-rw-r--r--src/ui/theme.h2
5 files changed, 25 insertions, 44 deletions
diff --git a/libmetacity/meta-theme-metacity.c b/libmetacity/meta-theme-metacity.c
index 914b585c..d98803ae 100644
--- a/libmetacity/meta-theme-metacity.c
+++ b/libmetacity/meta-theme-metacity.c
@@ -556,27 +556,6 @@ check_no_attributes (GMarkupParseContext *context,
return TRUE;
}
-static MetaFrameType
-meta_frame_type_from_string (const char *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;
-}
-
static gboolean
parse_double (const char *str,
double *val,
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)
{
diff --git a/libmetacity/meta-theme.h b/libmetacity/meta-theme.h
index 51794276..0681b160 100644
--- a/libmetacity/meta-theme.h
+++ b/libmetacity/meta-theme.h
@@ -187,6 +187,8 @@ PangoFontDescription *meta_style_info_create_font_desc (MetaTheme
gint meta_pango_font_desc_get_text_height (const PangoFontDescription *font_desc,
PangoContext *context);
+MetaFrameType meta_frame_type_from_string (const gchar *str);
+
gboolean meta_theme_allows_shade_stick_above_buttons (MetaTheme *theme);
G_END_DECLS
diff --git a/src/ui/theme.c b/src/ui/theme.c
index b1eec051..2d9b7428 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -1713,24 +1713,3 @@ meta_theme_calc_geometry (MetaTheme *theme,
fgeom,
theme);
}
-
-MetaFrameType
-meta_frame_type_from_string (const char *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;
-}
diff --git a/src/ui/theme.h b/src/ui/theme.h
index 0e844d5c..4aad669c 100644
--- a/src/ui/theme.h
+++ b/src/ui/theme.h
@@ -65,6 +65,4 @@ void meta_theme_calc_geometry (MetaTheme *theme,
const MetaButtonLayout *button_layout,
MetaFrameGeometry *fgeom);
-MetaFrameType meta_frame_type_from_string (const char *str);
-
#endif