[metacity] theme: move meta_frame_type_from_string to libmetacity
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] theme: move meta_frame_type_from_string to libmetacity
- Date: Wed, 3 Feb 2016 23:06:00 +0000 (UTC)
commit 2aec0aceb5302efd8aec7814c732f362569acd8a
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Wed Feb 3 22:23:54 2016 +0200
theme: move meta_frame_type_from_string to libmetacity
libmetacity/meta-theme-metacity.c | 21 ---------------------
libmetacity/meta-theme.c | 23 +++++++++++++++++++++++
libmetacity/meta-theme.h | 2 ++
src/ui/theme.c | 21 ---------------------
src/ui/theme.h | 2 --
5 files changed, 25 insertions(+), 44 deletions(-)
---
diff --git a/libmetacity/meta-theme-metacity.c b/libmetacity/meta-theme-metacity.c
index 914b585..d98803a 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 e875ab9..193fcbd 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 5179427..0681b16 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 b1eec05..2d9b742 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 0e844d5..4aad669 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]