Rename config-parser.h to libweston/config-parser.h
authorPekka Paalanen <pekka.paalanen@collabora.com>
Thu, 4 Apr 2019 11:27:31 +0000 (14:27 +0300)
committerPekka Paalanen <pekka.paalanen@collabora.com>
Thu, 18 Apr 2019 09:31:46 +0000 (12:31 +0300)
It is a public installed header used by libweston.h.

See "Rename compositor.h to libweston/libweston.h" for rationale.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
19 files changed:
clients/desktop-shell.c
clients/editor.c
clients/ivi-shell-user-interface.c
clients/terminal.c
clients/window.h
desktop-shell/shell.c
include/libweston/config-parser.h [new file with mode: 0644]
include/libweston/libweston.h
include/libweston/meson.build
libweston/compositor-x11.c
libweston/meson.build
shared/cairo-util.c
shared/config-parser.c
shared/config-parser.h [deleted file]
shared/meson.build
shared/option-parser.c
tests/config-parser-test.c
tests/weston-test-desktop-shell.c
tools/zunitc/src/zunitc_impl.c

index 0dc0f0ba3137e3e47c869bbbf6b5e9478b072db1..8e4fae948226bbdb7ae663453ce73d880c0da259 100644 (file)
@@ -43,7 +43,7 @@
 #include <wayland-client.h>
 #include "window.h"
 #include "shared/cairo-util.h"
-#include "shared/config-parser.h"
+#include <libweston/config-parser.h>
 #include "shared/helpers.h"
 #include "shared/xalloc.h"
 #include "shared/zalloc.h"
index 8f9eb6322567c0150a4edf3c6fb901c2d0279ca8..03e6b4913371316f75537c32104e68e3c5958813 100644 (file)
@@ -38,7 +38,7 @@
 
 #include <pango/pangocairo.h>
 
-#include "shared/config-parser.h"
+#include <libweston/config-parser.h>
 #include "shared/helpers.h"
 #include "shared/xalloc.h"
 #include "window.h"
index a38d6af8660e9abcda3a44c60e9780e2b6233723..44baa5420dec313c173958d48143d6bb05a7ef32 100644 (file)
@@ -38,7 +38,7 @@
 #include <wayland-cursor.h>
 #include <wayland-client-protocol.h>
 #include "shared/cairo-util.h"
-#include "shared/config-parser.h"
+#include <libweston/config-parser.h>
 #include "shared/helpers.h"
 #include "shared/os-compatibility.h"
 #include "shared/xalloc.h"
index ebc5bbe2933b662943d5f76e5fba4a3ad144707c..f7546ede8c9353acab672760a165f3862b9161c3 100644 (file)
@@ -44,7 +44,7 @@
 
 #include <wayland-client.h>
 
-#include "shared/config-parser.h"
+#include <libweston/config-parser.h>
 #include "shared/helpers.h"
 #include "shared/xalloc.h"
 #include "window.h"
index fde5c2f05910c5b5bac43d5352fd1b0979f2015c..03a1fe671754ce2e10ad3bd7e6d3e763c0e22f4b 100644 (file)
@@ -31,7 +31,7 @@
 #include <xkbcommon/xkbcommon.h>
 #include <wayland-client.h>
 #include <cairo.h>
-#include "shared/config-parser.h"
+#include <libweston/config-parser.h>
 #include "shared/zalloc.h"
 #include "shared/platform.h"
 
index 93b1c70b5a3b6e37fd24b522e5521d7c71514997..270c954353c07149c750ef2215b93b98e4200854 100644 (file)
@@ -39,7 +39,7 @@
 #include "shell.h"
 #include "compositor/weston.h"
 #include "weston-desktop-shell-server-protocol.h"
-#include "shared/config-parser.h"
+#include <libweston/config-parser.h>
 #include "shared/helpers.h"
 #include "shared/timespec-util.h"
 #include "libweston-desktop/libweston-desktop.h"
diff --git a/include/libweston/config-parser.h b/include/libweston/config-parser.h
new file mode 100644 (file)
index 0000000..5cb0bca
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * Copyright © 2008 Kristian Høgsberg
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef CONFIGPARSER_H
+#define CONFIGPARSER_H
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+
+#define WESTON_CONFIG_FILE_ENV_VAR "WESTON_CONFIG_FILE"
+
+enum config_key_type {
+       CONFIG_KEY_INTEGER,             /* typeof data = int */
+       CONFIG_KEY_UNSIGNED_INTEGER,    /* typeof data = unsigned int */
+       CONFIG_KEY_STRING,              /* typeof data = char* */
+       CONFIG_KEY_BOOLEAN              /* typeof data = int */
+};
+
+struct config_key {
+       const char *name;
+       enum config_key_type type;
+       void *data;
+};
+
+struct config_section {
+       const char *name;
+       const struct config_key *keys;
+       int num_keys;
+       void (*done)(void *data);
+};
+
+enum weston_option_type {
+       WESTON_OPTION_INTEGER,
+       WESTON_OPTION_UNSIGNED_INTEGER,
+       WESTON_OPTION_STRING,
+       WESTON_OPTION_BOOLEAN
+};
+
+struct weston_option {
+       enum weston_option_type type;
+       const char *name;
+       char short_name;
+       void *data;
+};
+
+int
+parse_options(const struct weston_option *options,
+             int count, int *argc, char *argv[]);
+
+struct weston_config_section;
+struct weston_config;
+
+struct weston_config_section *
+weston_config_get_section(struct weston_config *config, const char *section,
+                         const char *key, const char *value);
+int
+weston_config_section_get_int(struct weston_config_section *section,
+                             const char *key,
+                             int32_t *value, int32_t default_value);
+int
+weston_config_section_get_uint(struct weston_config_section *section,
+                              const char *key,
+                              uint32_t *value, uint32_t default_value);
+int
+weston_config_section_get_color(struct weston_config_section *section,
+                               const char *key,
+                               uint32_t *color, uint32_t default_color);
+int
+weston_config_section_get_double(struct weston_config_section *section,
+                                const char *key,
+                                double *value, double default_value);
+int
+weston_config_section_get_string(struct weston_config_section *section,
+                                const char *key,
+                                char **value,
+                                const char *default_value);
+int
+weston_config_section_get_bool(struct weston_config_section *section,
+                              const char *key,
+                              int *value, int default_value);
+
+const char *
+weston_config_get_name_from_env(void);
+
+struct weston_config *
+weston_config_parse(const char *name);
+
+const char *
+weston_config_get_full_path(struct weston_config *config);
+
+void
+weston_config_destroy(struct weston_config *config);
+
+int weston_config_next_section(struct weston_config *config,
+                              struct weston_config_section **section,
+                              const char **name);
+
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif /* CONFIGPARSER_H */
+
index e4ebc71d04dc62503b8033e6971fa7eb1b3fafe6..7632382ccd90a88d42a58185531ca108a7d56439 100644 (file)
@@ -42,7 +42,7 @@ extern "C" {
 #include <wayland-server.h>
 
 #include <libweston/matrix.h>
-#include "config-parser.h"
+#include <libweston/config-parser.h>
 #include "zalloc.h"
 #include <libweston/timeline-object.h>
 
index e631e1d13141a162c908e0ad654a90a28926de99..659e135b20900f5a85b9bbf10828103443f1a3fe 100644 (file)
@@ -1,4 +1,5 @@
 install_headers(
+       'config-parser.h',
        'libweston.h',
        'matrix.h',
        'plugin-registry.h',
index a62fe80ca89aa37d71269b15a46c396cbf420cd3..3fdeb1142d2b3574e47bfa21cb69f62e2b664efe 100644 (file)
@@ -52,7 +52,6 @@
 
 #include <libweston/libweston.h>
 #include <libweston/backend-x11.h>
-#include "shared/config-parser.h"
 #include "shared/helpers.h"
 #include "shared/image-loader.h"
 #include "shared/timespec-util.h"
index de6c9397575befc3de73c33483a1b2fb1cc2e5bf..b165ddb6602263b00125b838d743af011be5a579 100644 (file)
@@ -57,7 +57,6 @@ srcs_libweston = [
 ]
 
 install_headers(
-       '../shared/config-parser.h',
        '../shared/zalloc.h',
        subdir: dir_include_libweston
 )
index 15cbf82cafd5f10a1b1830d0b1f3f6d2213a0789..f558e1d0ca0216e0193d7d6b2a304ecc51abd031 100644 (file)
@@ -37,7 +37,7 @@
 
 #include "shared/helpers.h"
 #include "image-loader.h"
-#include "config-parser.h"
+#include <libweston/config-parser.h>
 
 #ifdef HAVE_PANGO
 #include <pango/pangocairo.h>
@@ -543,7 +543,7 @@ theme_render_frame(struct theme *t,
                text_height = logical.height;
                if (text_width < logical.width)
                  pango_layout_set_width (title_layout, text_width * PANGO_SCALE);
-               
+
 #else
                cairo_text_extents_t extents;
                cairo_font_extents_t font_extents;
index 35f09f006da5acdc8d2299757b10049b733e01d1..297b0f70a1de13cb7d1d9251f72c9139a75431c8 100644 (file)
@@ -39,7 +39,7 @@
 #include <errno.h>
 
 #include <wayland-util.h>
-#include "config-parser.h"
+#include <libweston/config-parser.h>
 #include "helpers.h"
 #include "string-helpers.h"
 
diff --git a/shared/config-parser.h b/shared/config-parser.h
deleted file mode 100644 (file)
index 5cb0bca..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright © 2008 Kristian Høgsberg
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial
- * portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#ifndef CONFIGPARSER_H
-#define CONFIGPARSER_H
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-#include <stdint.h>
-
-#define WESTON_CONFIG_FILE_ENV_VAR "WESTON_CONFIG_FILE"
-
-enum config_key_type {
-       CONFIG_KEY_INTEGER,             /* typeof data = int */
-       CONFIG_KEY_UNSIGNED_INTEGER,    /* typeof data = unsigned int */
-       CONFIG_KEY_STRING,              /* typeof data = char* */
-       CONFIG_KEY_BOOLEAN              /* typeof data = int */
-};
-
-struct config_key {
-       const char *name;
-       enum config_key_type type;
-       void *data;
-};
-
-struct config_section {
-       const char *name;
-       const struct config_key *keys;
-       int num_keys;
-       void (*done)(void *data);
-};
-
-enum weston_option_type {
-       WESTON_OPTION_INTEGER,
-       WESTON_OPTION_UNSIGNED_INTEGER,
-       WESTON_OPTION_STRING,
-       WESTON_OPTION_BOOLEAN
-};
-
-struct weston_option {
-       enum weston_option_type type;
-       const char *name;
-       char short_name;
-       void *data;
-};
-
-int
-parse_options(const struct weston_option *options,
-             int count, int *argc, char *argv[]);
-
-struct weston_config_section;
-struct weston_config;
-
-struct weston_config_section *
-weston_config_get_section(struct weston_config *config, const char *section,
-                         const char *key, const char *value);
-int
-weston_config_section_get_int(struct weston_config_section *section,
-                             const char *key,
-                             int32_t *value, int32_t default_value);
-int
-weston_config_section_get_uint(struct weston_config_section *section,
-                              const char *key,
-                              uint32_t *value, uint32_t default_value);
-int
-weston_config_section_get_color(struct weston_config_section *section,
-                               const char *key,
-                               uint32_t *color, uint32_t default_color);
-int
-weston_config_section_get_double(struct weston_config_section *section,
-                                const char *key,
-                                double *value, double default_value);
-int
-weston_config_section_get_string(struct weston_config_section *section,
-                                const char *key,
-                                char **value,
-                                const char *default_value);
-int
-weston_config_section_get_bool(struct weston_config_section *section,
-                              const char *key,
-                              int *value, int default_value);
-
-const char *
-weston_config_get_name_from_env(void);
-
-struct weston_config *
-weston_config_parse(const char *name);
-
-const char *
-weston_config_get_full_path(struct weston_config *config);
-
-void
-weston_config_destroy(struct weston_config *config);
-
-int weston_config_next_section(struct weston_config *config,
-                              struct weston_config_section **section,
-                              const char **name);
-
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif /* CONFIGPARSER_H */
-
index c3fd932aeeef173cc76a7bdd67f574d7c7c26ebf..eb897c1009859b9407e4ff4ec554c43a49780b1d 100644 (file)
@@ -10,7 +10,7 @@ deps_libshared = dep_wayland_client
 lib_libshared = static_library(
        'shared',
        srcs_libshared,
-       include_directories: include_directories('..'),
+       include_directories: [ include_directories('..'), public_inc ],
        dependencies: deps_libshared,
        pic: true,
        install: false
index 0f93464c654db25575f91eda503a2347869d0d8b..795195f5c119417049e783db36a944f75721a343 100644 (file)
@@ -33,7 +33,7 @@
 #include <assert.h>
 #include <errno.h>
 
-#include "config-parser.h"
+#include <libweston/config-parser.h>
 #include "string-helpers.h"
 
 static bool
index 1cdffffc7982f43e88cda961893e1bbe42ee081a..44ee73593d172dff9be5454942f7f027ee8f07a7 100644 (file)
@@ -33,7 +33,7 @@
 #include <errno.h>
 #include <unistd.h>
 
-#include "config-parser.h"
+#include <libweston/config-parser.h>
 
 #include "shared/helpers.h"
 #include "zunitc/zunitc.h"
index c780316d91afbdc2eaf7f47b6dbf87e3eacd79de..b580ffd6f6c9b45be355aeba162a7f094a4b15b5 100644 (file)
@@ -37,7 +37,7 @@
 #include <sys/types.h>
 
 #include "compositor/weston.h"
-#include "shared/config-parser.h"
+#include <libweston/config-parser.h>
 #include "shared/helpers.h"
 #include "libweston-desktop/libweston-desktop.h"
 
index 58a5b174416602472441b35cd6adb3a9f0b960d1..72f08df6742b789d22610b8b7be116deeba5a383 100644 (file)
@@ -46,7 +46,7 @@
 #include "zuc_event_listener.h"
 #include "zuc_junit_reporter.h"
 
-#include "shared/config-parser.h"
+#include <libweston/config-parser.h>
 #include "shared/helpers.h"
 #include "shared/zalloc.h"