[metacity] theme: make meta_button_type_from_string static
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] theme: make meta_button_type_from_string static
- Date: Thu, 28 Jan 2016 09:18:22 +0000 (UTC)
commit db6def21ea97bcd508e8fe25e1cec14f43d02cb9
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sun Jan 24 01:25:01 2016 +0200
theme: make meta_button_type_from_string static
src/ui/theme-parser.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++
src/ui/theme-private.h | 2 -
src/ui/theme.c | 49 ------------------------------------------------
3 files changed, 49 insertions(+), 51 deletions(-)
---
diff --git a/src/ui/theme-parser.c b/src/ui/theme-parser.c
index 0625b91..1246d89 100644
--- a/src/ui/theme-parser.c
+++ b/src/ui/theme-parser.c
@@ -2637,6 +2637,55 @@ meta_button_state_from_string (const char *str)
return META_BUTTON_STATE_LAST;
}
+static MetaButtonType
+meta_button_type_from_string (const char *str, MetaTheme *theme)
+{
+ if (META_THEME_ALLOWS(theme, META_THEME_SHADE_STICK_ABOVE_BUTTONS))
+ {
+ if (strcmp ("shade", str) == 0)
+ return META_BUTTON_TYPE_SHADE;
+ else if (strcmp ("above", str) == 0)
+ return META_BUTTON_TYPE_ABOVE;
+ else if (strcmp ("stick", str) == 0)
+ return META_BUTTON_TYPE_STICK;
+ else if (strcmp ("unshade", str) == 0)
+ return META_BUTTON_TYPE_UNSHADE;
+ else if (strcmp ("unabove", str) == 0)
+ return META_BUTTON_TYPE_UNABOVE;
+ else if (strcmp ("unstick", str) == 0)
+ return META_BUTTON_TYPE_UNSTICK;
+ }
+
+ if (strcmp ("close", str) == 0)
+ return META_BUTTON_TYPE_CLOSE;
+ else if (strcmp ("maximize", str) == 0)
+ return META_BUTTON_TYPE_MAXIMIZE;
+ else if (strcmp ("minimize", str) == 0)
+ return META_BUTTON_TYPE_MINIMIZE;
+ else if (strcmp ("menu", str) == 0)
+ return META_BUTTON_TYPE_MENU;
+ else if (strcmp ("appmenu", str) == 0)
+ return META_BUTTON_TYPE_APPMENU;
+ else if (strcmp ("left_left_background", str) == 0)
+ return META_BUTTON_TYPE_LEFT_LEFT_BACKGROUND;
+ else if (strcmp ("left_middle_background", str) == 0)
+ return META_BUTTON_TYPE_LEFT_MIDDLE_BACKGROUND;
+ else if (strcmp ("left_right_background", str) == 0)
+ return META_BUTTON_TYPE_LEFT_RIGHT_BACKGROUND;
+ else if (strcmp ("left_single_background", str) == 0)
+ return META_BUTTON_TYPE_LEFT_SINGLE_BACKGROUND;
+ else if (strcmp ("right_left_background", str) == 0)
+ return META_BUTTON_TYPE_RIGHT_LEFT_BACKGROUND;
+ else if (strcmp ("right_middle_background", str) == 0)
+ return META_BUTTON_TYPE_RIGHT_MIDDLE_BACKGROUND;
+ else if (strcmp ("right_right_background", str) == 0)
+ return META_BUTTON_TYPE_RIGHT_RIGHT_BACKGROUND;
+ else if (strcmp ("right_single_background", str) == 0)
+ return META_BUTTON_TYPE_RIGHT_SINGLE_BACKGROUND;
+ else
+ return META_BUTTON_TYPE_LAST;
+}
+
static void
parse_style_element (GMarkupParseContext *context,
const gchar *element_name,
diff --git a/src/ui/theme-private.h b/src/ui/theme-private.h
index 3a5e7ab..dc81c1e 100644
--- a/src/ui/theme-private.h
+++ b/src/ui/theme-private.h
@@ -874,8 +874,6 @@ gboolean meta_theme_lookup_color_constant (MetaTheme
const char *name,
char **value);
-MetaButtonType meta_button_type_from_string (const char *str,
- MetaTheme *theme);
const char *meta_button_type_to_string (MetaButtonType type);
MetaFramePiece meta_frame_piece_from_string (const char *str);
MetaFrameState meta_frame_state_from_string (const char *str);
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 39909dc..c6c8457 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -6567,55 +6567,6 @@ meta_pango_font_desc_get_text_height (const PangoFontDescription *font_desc,
return retval;
}
-MetaButtonType
-meta_button_type_from_string (const char *str, MetaTheme *theme)
-{
- if (META_THEME_ALLOWS(theme, META_THEME_SHADE_STICK_ABOVE_BUTTONS))
- {
- if (strcmp ("shade", str) == 0)
- return META_BUTTON_TYPE_SHADE;
- else if (strcmp ("above", str) == 0)
- return META_BUTTON_TYPE_ABOVE;
- else if (strcmp ("stick", str) == 0)
- return META_BUTTON_TYPE_STICK;
- else if (strcmp ("unshade", str) == 0)
- return META_BUTTON_TYPE_UNSHADE;
- else if (strcmp ("unabove", str) == 0)
- return META_BUTTON_TYPE_UNABOVE;
- else if (strcmp ("unstick", str) == 0)
- return META_BUTTON_TYPE_UNSTICK;
- }
-
- if (strcmp ("close", str) == 0)
- return META_BUTTON_TYPE_CLOSE;
- else if (strcmp ("maximize", str) == 0)
- return META_BUTTON_TYPE_MAXIMIZE;
- else if (strcmp ("minimize", str) == 0)
- return META_BUTTON_TYPE_MINIMIZE;
- else if (strcmp ("menu", str) == 0)
- return META_BUTTON_TYPE_MENU;
- else if (strcmp ("appmenu", str) == 0)
- return META_BUTTON_TYPE_APPMENU;
- else if (strcmp ("left_left_background", str) == 0)
- return META_BUTTON_TYPE_LEFT_LEFT_BACKGROUND;
- else if (strcmp ("left_middle_background", str) == 0)
- return META_BUTTON_TYPE_LEFT_MIDDLE_BACKGROUND;
- else if (strcmp ("left_right_background", str) == 0)
- return META_BUTTON_TYPE_LEFT_RIGHT_BACKGROUND;
- else if (strcmp ("left_single_background", str) == 0)
- return META_BUTTON_TYPE_LEFT_SINGLE_BACKGROUND;
- else if (strcmp ("right_left_background", str) == 0)
- return META_BUTTON_TYPE_RIGHT_LEFT_BACKGROUND;
- else if (strcmp ("right_middle_background", str) == 0)
- return META_BUTTON_TYPE_RIGHT_MIDDLE_BACKGROUND;
- else if (strcmp ("right_right_background", str) == 0)
- return META_BUTTON_TYPE_RIGHT_RIGHT_BACKGROUND;
- else if (strcmp ("right_single_background", str) == 0)
- return META_BUTTON_TYPE_RIGHT_SINGLE_BACKGROUND;
- else
- return META_BUTTON_TYPE_LAST;
-}
-
const char*
meta_button_type_to_string (MetaButtonType type)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]