[metacity] theme: move MetaThemeError to libmetacity



commit 4bba06c8a0fe176375c8bf73f49f975ff9816418
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Wed Jan 27 21:10:00 2016 +0200

    theme: move MetaThemeError to libmetacity

 libmetacity/Makefile.am  |    2 +
 libmetacity/meta-theme.c |   33 ++++++++++++++++++++++++
 libmetacity/meta-theme.h |   62 ++++++++++++++++++++++++++++++++++++++++++++++
 src/ui/theme.h           |   15 +----------
 4 files changed, 98 insertions(+), 14 deletions(-)
---
diff --git a/libmetacity/Makefile.am b/libmetacity/Makefile.am
index d556b96..117c410 100644
--- a/libmetacity/Makefile.am
+++ b/libmetacity/Makefile.am
@@ -5,6 +5,8 @@ noinst_LTLIBRARIES = libmetacity.la
 libmetacity_la_SOURCES = \
        meta-hsla.c \
        meta-hsla.h \
+       meta-theme.c \
+       meta-theme.h \
        $(NULL)
 
 libmetacity_la_CPPFLAGS = \
diff --git a/libmetacity/meta-theme.c b/libmetacity/meta-theme.c
new file mode 100644
index 0000000..39f500f
--- /dev/null
+++ b/libmetacity/meta-theme.c
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2016 Alberts Muktupāvels
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include "meta-theme.h"
+
+/**
+ * meta_theme_error_quark:
+ *
+ * Domain for #MetaThemeError errors.
+ *
+ * Returns: the #GQuark identifying the #MetaThemeError domain.
+ */
+GQuark
+meta_theme_error_quark (void)
+{
+  return g_quark_from_static_string ("meta-theme-error-quark");
+}
diff --git a/libmetacity/meta-theme.h b/libmetacity/meta-theme.h
new file mode 100644
index 0000000..303fe2a
--- /dev/null
+++ b/libmetacity/meta-theme.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2001 Havoc Pennington
+ * Copyright (C) 2016 Alberts Muktupāvels
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef META_THEME_H
+#define META_THEME_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+/**
+ * META_THEME_ERROR:
+ *
+ * Domain for #MetaThemeError errors.
+ */
+#define META_THEME_ERROR (meta_theme_error_quark ())
+
+/**
+ * MetaThemeError:
+ * @META_THEME_ERROR_TOO_OLD:
+ * @META_THEME_ERROR_FRAME_GEOMETRY:
+ * @META_THEME_ERROR_BAD_CHARACTER:
+ * @META_THEME_ERROR_BAD_PARENS:
+ * @META_THEME_ERROR_UNKNOWN_VARIABLE:
+ * @META_THEME_ERROR_DIVIDE_BY_ZERO:
+ * @META_THEME_ERROR_MOD_ON_FLOAT:
+ * @META_THEME_ERROR_FAILED:
+ *
+ * Error codes for %META_THEME_ERROR.
+ */
+typedef enum
+{
+  META_THEME_ERROR_TOO_OLD,
+  META_THEME_ERROR_FRAME_GEOMETRY,
+  META_THEME_ERROR_BAD_CHARACTER,
+  META_THEME_ERROR_BAD_PARENS,
+  META_THEME_ERROR_UNKNOWN_VARIABLE,
+  META_THEME_ERROR_DIVIDE_BY_ZERO,
+  META_THEME_ERROR_MOD_ON_FLOAT,
+  META_THEME_ERROR_FAILED
+} MetaThemeError;
+
+GQuark meta_theme_error_quark (void);
+
+G_END_DECLS
+
+#endif
diff --git a/src/ui/theme.h b/src/ui/theme.h
index 358b014..e985538 100644
--- a/src/ui/theme.h
+++ b/src/ui/theme.h
@@ -24,6 +24,7 @@
 
 #include "common.h"
 #include <gtk/gtk.h>
+#include <libmetacity/meta-theme.h>
 
 /**
  * MetaStyleInfo: (skip)
@@ -34,20 +35,6 @@ typedef struct _MetaButtonSpace MetaButtonSpace;
 typedef struct _MetaFrameGeometry MetaFrameGeometry;
 typedef struct _MetaTheme MetaTheme;
 
-#define META_THEME_ERROR (g_quark_from_static_string ("meta-theme-error"))
-
-typedef enum
-{
-  META_THEME_ERROR_TOO_OLD,
-  META_THEME_ERROR_FRAME_GEOMETRY,
-  META_THEME_ERROR_BAD_CHARACTER,
-  META_THEME_ERROR_BAD_PARENS,
-  META_THEME_ERROR_UNKNOWN_VARIABLE,
-  META_THEME_ERROR_DIVIDE_BY_ZERO,
-  META_THEME_ERROR_MOD_ON_FLOAT,
-  META_THEME_ERROR_FAILED
-} MetaThemeError;
-
 /**
  * The computed size of a button (really just a way of tying its
  * visible and clickable areas together).


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]