[gnome-builder: 52/139] libide-themes: add libide-themes static library



commit 267ef5496199ca25ff3f53ce0f3acfa3d8d3d8ae
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jan 9 16:42:28 2019 -0800

    libide-themes: add libide-themes static library
    
    This adds a new static library that contains the theme data and a bit
    of code to register it during startup.

 src/libide/themes/libide-themes.c             | 32 ++++++++++++++++
 src/libide/themes/libide-themes.gresource.xml | 30 +++++++++++++++
 src/libide/themes/libide-themes.h             | 29 +++++++++++++++
 src/libide/themes/meson.build                 | 53 +++++++++++++++++++++++++++
 4 files changed, 144 insertions(+)
---
diff --git a/src/libide/themes/libide-themes.c b/src/libide/themes/libide-themes.c
new file mode 100644
index 000000000..62512df92
--- /dev/null
+++ b/src/libide/themes/libide-themes.c
@@ -0,0 +1,32 @@
+/* libide-themes.c
+ *
+ * Copyright 2018-2019 Christian Hergert <chergert redhat com>
+ *
+ * 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 3 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/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#define G_LOG_DOMAIN "ide-themes-global"
+
+#include "config.h"
+
+#include "libide-themes.h"
+#include "ide-themes-resources.h"
+
+void
+ide_themes_init (void)
+{
+  g_resources_register (ide_themes_get_resource ());
+}
diff --git a/src/libide/themes/libide-themes.gresource.xml b/src/libide/themes/libide-themes.gresource.xml
new file mode 100644
index 000000000..2d22cd6b7
--- /dev/null
+++ b/src/libide/themes/libide-themes.gresource.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+  <gresource prefix="/org/gnome/builder">
+    <file compressed="true">themes/Adwaita.css</file>
+    <file compressed="true">themes/Adwaita-dark.css</file>
+    <file compressed="true">themes/Adwaita-shared.css</file>
+
+    <file compressed="true" alias="themes/Arc.css">themes/Arc.css</file>
+    <file compressed="true" alias="themes/Arc-Dark.css">themes/Arc-Dark.css</file>
+    <file compressed="true" alias="themes/Arc-Darker.css">themes/Arc-Darker.css</file>
+    <file compressed="true" alias="themes/Arc-dark.css">themes/Arc-Dark.css</file>
+    <file compressed="true" alias="themes/Arc-Dark-dark.css">themes/Arc-Dark.css</file>
+    <file compressed="true" alias="themes/Arc-Darker-dark.css">themes/Arc-Dark.css</file>
+    <file compressed="true" alias="themes/Arc-shared.css">themes/Arc-shared.css</file>
+
+    <file compressed="true">themes/elementary.css</file>
+
+    <file compressed="true">themes/shared.css</file>
+    <file compressed="true">themes/shared/shared-buildui.css</file>
+    <file compressed="true">themes/shared/shared-completion.css</file>
+    <file compressed="true">themes/shared/shared-debugger.css</file>
+    <file compressed="true">themes/shared/shared-editor.css</file>
+    <file compressed="true">themes/shared/shared-greeter.css</file>
+    <file compressed="true">themes/shared/shared-hoverer.css</file>
+    <file compressed="true">themes/shared/shared-layout.css</file>
+    <file compressed="true">themes/shared/shared-omnibar.css</file>
+    <file compressed="true">themes/shared/shared-search.css</file>
+    <file compressed="true">themes/shared/shared-treeview.css</file>
+  </gresource>
+</gresources>
diff --git a/src/libide/themes/libide-themes.h b/src/libide/themes/libide-themes.h
new file mode 100644
index 000000000..a16cdbd88
--- /dev/null
+++ b/src/libide/themes/libide-themes.h
@@ -0,0 +1,29 @@
+/* libide-themes.h
+ *
+ * Copyright 2018-2019 Christian Hergert <chergert redhat com>
+ *
+ * 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 3 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/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#pragma once
+
+#include <libide-core.h>
+
+G_BEGIN_DECLS
+
+void ide_themes_init (void);
+
+G_END_DECLS
diff --git a/src/libide/themes/meson.build b/src/libide/themes/meson.build
new file mode 100644
index 000000000..9d6c8e247
--- /dev/null
+++ b/src/libide/themes/meson.build
@@ -0,0 +1,53 @@
+libide_themes_header_subdir = join_paths(libide_header_subdir, 'themes')
+
+#
+# Sources
+#
+
+libide_themes_sources = ['libide-themes.c']
+libide_themes_headers = ['libide-themes.h']
+
+#
+# Generated Resources
+#
+
+libide_themes_resources = gnome.compile_resources(
+  'ide-themes-resources',
+  'libide-themes.gresource.xml',
+  c_name: 'ide_themes',
+)
+
+#
+# Install Headers
+#
+
+install_headers(libide_themes_headers, subdir: libide_themes_header_subdir)
+
+#
+# Dependencies
+#
+
+libide_themes_deps = [
+  libgio_dep,
+
+  libide_core_dep,
+]
+
+#
+# Library Definitions
+#
+
+libide_themes = static_library('ide-themes-' + libide_api_version,
+   libide_themes_sources + libide_themes_resources,
+   dependencies: libide_themes_deps,
+         c_args: libide_args + release_args + ['-DIDE_THEMES_COMPILATION'],
+)
+
+libide_themes_dep = declare_dependency(
+              sources: libide_themes_resources[1],
+         dependencies: libide_themes_deps,
+           link_whole: libide_themes,
+  include_directories: include_directories('.'),
+)
+
+gnome_builder_include_subdirs += libide_themes_header_subdir


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