[gnome-builder/wip/plugins] icons: build embedded icons into libicons.la



commit ea52a37d91c61f353a408bc467e976cb0f61e145
Author: Christian Hergert <christian hergert me>
Date:   Wed Jun 10 19:46:59 2015 -0700

    icons: build embedded icons into libicons.la
    
    This keeps the icon resource logic all contained in data/icons which is
    a lot nicer than the crazy path logic we had in src/.
    
    Now we just statically link libicons.la and register the resources so the
    module isn't dropped in linking.

 configure.ac                                       |    2 +
 data/icons/Makefile.am                             |   28 +-----------------
 .../256x256/{vcs => actions}/builder-vcs-git.png   |  Bin 20169 -> 20169 bytes
 .../32x32/{vcs => actions}/builder-vcs-git.png     |  Bin 2061 -> 2061 bytes
 .../48x48/{vcs => actions}/builder-vcs-git.png     |  Bin 2946 -> 2946 bytes
 data/icons/hicolor/Makefile.am                     |   21 ++++++++++++++
 data/icons/hicolor/icons.gresource.xml             |   30 ++++++++++++++++++++
 .../{vcs => actions}/builder-vcs-git-symbolic.svg  |    0
 .../lang-class-symbolic.svg                        |    0
 .../lang-define-symbolic.svg                       |    0
 .../lang-enum-symbolic.svg                         |    0
 .../lang-enum-value-symbolic.svg                   |    0
 .../lang-function-symbolic.svg                     |    0
 .../lang-include-symbolic.svg                      |    0
 .../lang-method-symbolic.svg                       |    0
 .../lang-struct-symbolic.svg                       |    0
 .../lang-typedef-symbolic.svg                      |    0
 .../lang-union-symbolic.svg                        |    0
 .../lang-variable-symbolic.svg                     |    0
 .../struct-field-symbolic.svg                      |    0
 libide/resources/libide.gresource.xml              |    8 -----
 src/Makefile.am                                    |    2 +
 src/main.c                                         |    2 +
 src/resources/gnome-builder.gresource.xml          |   28 ------------------
 24 files changed, 59 insertions(+), 62 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index baaa33c..07648c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -158,6 +158,7 @@ PKG_CHECK_MODULES(BUILDER,  [gtk+-3.0 >= gtk_required_version
 PKG_CHECK_MODULES(EGG,      [glib-2.0 >= glib_required_version
                              gtk+-3.0 >= gtk_required_version])
 PKG_CHECK_MODULES(GD,       [gtk+-3.0 >= gtk_required_version])
+PKG_CHECK_MODULES(ICONS,    [gio-2.0 >= glib_required_version])
 PKG_CHECK_MODULES(LIBIDE,   [gio-2.0 >= glib_required_version
                              gio-unix-2.0 >= glib_required_version
                              gtksourceview-3.0 >= gtksourceview_required_version
@@ -391,6 +392,7 @@ AC_CONFIG_FILES([
        data/Makefile
        data/gsettings/Makefile
        data/icons/Makefile
+       data/icons/hicolor/Makefile
        data/libide-1.0.pc
        data/style-schemes/Makefile
 
diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am
index 85b40a2..f078028 100644
--- a/data/icons/Makefile.am
+++ b/data/icons/Makefile.am
@@ -1,3 +1,4 @@
+SUBDIRS = hicolor
 
 icondir = $(datadir)/icons
 
@@ -11,32 +12,7 @@ nobase_icon_DATA = \
        hicolor/scalable/apps/builder-symbolic.svg \
        $(NULL)
 
-bundled_icon_sources = \
-       hicolor/scalable/vcs/builder-vcs-git-symbolic.svg \
-       hicolor/256x256/vcs/builder-vcs-git.png \
-       hicolor/48x48/vcs/builder-vcs-git.png \
-       hicolor/32x32/vcs/builder-vcs-git.png \
-       hicolor/scalable/actions/builder-split-tab-symbolic.svg \
-       hicolor/scalable/apps/builder-documentation-symbolic.svg \
-       hicolor/scalable/apps/builder-editor-symbolic.svg \
-       hicolor/scalable/autocomplete/lang-enum-value-symbolic.svg \
-       hicolor/scalable/autocomplete/struct-field-symbolic.svg \
-       hicolor/scalable/autocomplete/lang-class-symbolic.svg \
-       hicolor/scalable/autocomplete/lang-define-symbolic.svg \
-       hicolor/scalable/autocomplete/lang-enum-symbolic.svg \
-       hicolor/scalable/autocomplete/lang-include-symbolic.svg \
-       hicolor/scalable/autocomplete/lang-method-symbolic.svg \
-       hicolor/scalable/autocomplete/lang-function-symbolic.svg \
-       hicolor/scalable/autocomplete/lang-typedef-symbolic.svg \
-       hicolor/scalable/autocomplete/lang-struct-symbolic.svg \
-       hicolor/scalable/autocomplete/lang-variable-symbolic.svg \
-       hicolor/scalable/autocomplete/lang-union-symbolic.svg \
-       $(NULL)
-
-EXTRA_DIST = \
-       $(bundled_icon_sources) \
-       $(nobase_icon_DATA) \
-       hicolor/source.svg
+EXTRA_DIST = $(nobase_icon_DATA)
 
 gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
 
diff --git a/data/icons/hicolor/Makefile.am b/data/icons/hicolor/Makefile.am
new file mode 100644
index 0000000..57f3591
--- /dev/null
+++ b/data/icons/hicolor/Makefile.am
@@ -0,0 +1,21 @@
+DISTCLEANFILES =
+CLEANFILES = 
+BUILT_SOURCES =
+EXTRA_DIST =
+
+noinst_LTLIBRARIES = libicons.la
+
+nodist_libicons_la_SOURCES = \
+       gb-icons-resources.c \
+       gb-icons-resources.h
+
+libicons_la_CFLAGS = $(ICONS_CFLAGS)
+libicons_la_LIBADD = $(ICONS_LIBS)
+
+glib_resources_c = gb-icons-resources.c
+glib_resources_h = gb-icons-resources.h
+glib_resources_xml = icons.gresource.xml
+glib_resources_namespace = gb_icons
+include $(top_srcdir)/build/autotools/Makefile.am.gresources
+
+-include $(top_srcdir)/git.mk
diff --git a/data/icons/hicolor/icons.gresource.xml b/data/icons/hicolor/icons.gresource.xml
new file mode 100644
index 0000000..355a7ad
--- /dev/null
+++ b/data/icons/hicolor/icons.gresource.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+  <gresource prefix="/org/gnome/builder/icons">
+    <file>scalable/actions/builder-move-left-symbolic.svg</file>
+    <file>scalable/actions/builder-move-right-symbolic.svg</file>
+    <file>scalable/actions/builder-split-tab-left-symbolic.svg</file>
+    <file>scalable/actions/builder-split-tab-right-symbolic.svg</file>
+    <file>scalable/actions/builder-split-tab-symbolic.svg</file>
+    <file>scalable/actions/builder-vcs-git-symbolic.svg</file>
+    <file>scalable/actions/builder-view-bottom-pane-symbolic.svg</file>
+    <file>scalable/actions/builder-view-left-pane-symbolic.svg</file>
+    <file>scalable/actions/builder-view-right-pane-symbolic.svg</file>
+    <file>scalable/actions/lang-class-symbolic.svg</file>
+    <file>scalable/actions/lang-define-symbolic.svg</file>
+    <file>scalable/actions/lang-enum-symbolic.svg</file>
+    <file>scalable/actions/lang-enum-value-symbolic.svg</file>
+    <file>scalable/actions/lang-function-symbolic.svg</file>
+    <file>scalable/actions/lang-include-symbolic.svg</file>
+    <file>scalable/actions/lang-method-symbolic.svg</file>
+    <file>scalable/actions/lang-struct-symbolic.svg</file>
+    <file>scalable/actions/lang-typedef-symbolic.svg</file>
+    <file>scalable/actions/lang-union-symbolic.svg</file>
+    <file>scalable/actions/lang-variable-symbolic.svg</file>
+    <file>scalable/actions/struct-field-symbolic.svg</file>
+
+    <file>256x256/actions/builder-vcs-git.png</file>
+    <file>48x48/actions/builder-vcs-git.png</file>
+    <file>32x32/actions/builder-vcs-git.png</file>
+  </gresource>
+</gresources>
diff --git a/data/icons/hicolor/scalable/vcs/builder-vcs-git-symbolic.svg 
b/data/icons/hicolor/scalable/actions/builder-vcs-git-symbolic.svg
similarity index 100%
rename from data/icons/hicolor/scalable/vcs/builder-vcs-git-symbolic.svg
rename to data/icons/hicolor/scalable/actions/builder-vcs-git-symbolic.svg
diff --git a/data/icons/hicolor/scalable/autocomplete/lang-class-symbolic.svg 
b/data/icons/hicolor/scalable/actions/lang-class-symbolic.svg
similarity index 100%
rename from data/icons/hicolor/scalable/autocomplete/lang-class-symbolic.svg
rename to data/icons/hicolor/scalable/actions/lang-class-symbolic.svg
diff --git a/data/icons/hicolor/scalable/autocomplete/lang-define-symbolic.svg 
b/data/icons/hicolor/scalable/actions/lang-define-symbolic.svg
similarity index 100%
rename from data/icons/hicolor/scalable/autocomplete/lang-define-symbolic.svg
rename to data/icons/hicolor/scalable/actions/lang-define-symbolic.svg
diff --git a/data/icons/hicolor/scalable/autocomplete/lang-enum-symbolic.svg 
b/data/icons/hicolor/scalable/actions/lang-enum-symbolic.svg
similarity index 100%
rename from data/icons/hicolor/scalable/autocomplete/lang-enum-symbolic.svg
rename to data/icons/hicolor/scalable/actions/lang-enum-symbolic.svg
diff --git a/data/icons/hicolor/scalable/autocomplete/lang-enum-value-symbolic.svg 
b/data/icons/hicolor/scalable/actions/lang-enum-value-symbolic.svg
similarity index 100%
rename from data/icons/hicolor/scalable/autocomplete/lang-enum-value-symbolic.svg
rename to data/icons/hicolor/scalable/actions/lang-enum-value-symbolic.svg
diff --git a/data/icons/hicolor/scalable/autocomplete/lang-function-symbolic.svg 
b/data/icons/hicolor/scalable/actions/lang-function-symbolic.svg
similarity index 100%
rename from data/icons/hicolor/scalable/autocomplete/lang-function-symbolic.svg
rename to data/icons/hicolor/scalable/actions/lang-function-symbolic.svg
diff --git a/data/icons/hicolor/scalable/autocomplete/lang-include-symbolic.svg 
b/data/icons/hicolor/scalable/actions/lang-include-symbolic.svg
similarity index 100%
rename from data/icons/hicolor/scalable/autocomplete/lang-include-symbolic.svg
rename to data/icons/hicolor/scalable/actions/lang-include-symbolic.svg
diff --git a/data/icons/hicolor/scalable/autocomplete/lang-method-symbolic.svg 
b/data/icons/hicolor/scalable/actions/lang-method-symbolic.svg
similarity index 100%
rename from data/icons/hicolor/scalable/autocomplete/lang-method-symbolic.svg
rename to data/icons/hicolor/scalable/actions/lang-method-symbolic.svg
diff --git a/data/icons/hicolor/scalable/autocomplete/lang-struct-symbolic.svg 
b/data/icons/hicolor/scalable/actions/lang-struct-symbolic.svg
similarity index 100%
rename from data/icons/hicolor/scalable/autocomplete/lang-struct-symbolic.svg
rename to data/icons/hicolor/scalable/actions/lang-struct-symbolic.svg
diff --git a/data/icons/hicolor/scalable/autocomplete/lang-typedef-symbolic.svg 
b/data/icons/hicolor/scalable/actions/lang-typedef-symbolic.svg
similarity index 100%
rename from data/icons/hicolor/scalable/autocomplete/lang-typedef-symbolic.svg
rename to data/icons/hicolor/scalable/actions/lang-typedef-symbolic.svg
diff --git a/data/icons/hicolor/scalable/autocomplete/lang-union-symbolic.svg 
b/data/icons/hicolor/scalable/actions/lang-union-symbolic.svg
similarity index 100%
rename from data/icons/hicolor/scalable/autocomplete/lang-union-symbolic.svg
rename to data/icons/hicolor/scalable/actions/lang-union-symbolic.svg
diff --git a/data/icons/hicolor/scalable/autocomplete/lang-variable-symbolic.svg 
b/data/icons/hicolor/scalable/actions/lang-variable-symbolic.svg
similarity index 100%
rename from data/icons/hicolor/scalable/autocomplete/lang-variable-symbolic.svg
rename to data/icons/hicolor/scalable/actions/lang-variable-symbolic.svg
diff --git a/data/icons/hicolor/scalable/autocomplete/struct-field-symbolic.svg 
b/data/icons/hicolor/scalable/actions/struct-field-symbolic.svg
similarity index 100%
rename from data/icons/hicolor/scalable/autocomplete/struct-field-symbolic.svg
rename to data/icons/hicolor/scalable/actions/struct-field-symbolic.svg
diff --git a/libide/resources/libide.gresource.xml b/libide/resources/libide.gresource.xml
index 7ab2b50..647b0ae 100644
--- a/libide/resources/libide.gresource.xml
+++ b/libide/resources/libide.gresource.xml
@@ -18,13 +18,5 @@
 
     <file alias="keybindings/emacs.css">../../data/keybindings/emacs.css</file>
     <file alias="keybindings/vim.css">../../data/keybindings/vim.css</file>
-
-    <file 
alias="icons/autocomplete/lang-class-symbolic.svg">../../data/icons/hicolor/scalable/autocomplete/lang-class-symbolic.svg</file>
-    <file 
alias="icons/autocomplete/lang-enum-symbolic.svg">../../data/icons/hicolor/scalable/autocomplete/lang-enum-symbolic.svg</file>
-    <file 
alias="icons/autocomplete/lang-enum-value-symbolic.svg">../../data/icons/hicolor/scalable/autocomplete/lang-enum-value-symbolic.svg</file>
-    <file 
alias="icons/autocomplete/lang-function-symbolic.svg">../../data/icons/hicolor/scalable/autocomplete/lang-function-symbolic.svg</file>
-    <file 
alias="icons/autocomplete/lang-method-symbolic.svg">../../data/icons/hicolor/scalable/autocomplete/lang-method-symbolic.svg</file>
-    <file 
alias="icons/autocomplete/lang-struct-symbolic.svg">../../data/icons/hicolor/scalable/autocomplete/lang-struct-symbolic.svg</file>
-    <file 
alias="icons/autocomplete/struct-field-symbolic.svg">../../data/icons/hicolor/scalable/autocomplete/struct-field-symbolic.svg</file>
   </gresource>
 </gresources>
diff --git a/src/Makefile.am b/src/Makefile.am
index 5579f31..717d123 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -160,6 +160,7 @@ nodist_libgnome_builder_la_SOURCES = \
 libgnome_builder_la_LIBADD = \
        $(BUILDER_LIBS) \
        $(OPTIMIZE_LDFLAGS) \
+       $(top_builddir)/data/icons/hicolor/libicons.la \
        $(top_builddir)/libide/libide-1.0.la \
        $(top_builddir)/contrib/egg/libegg.la \
        $(top_builddir)/contrib/gd/libgd.la \
@@ -195,6 +196,7 @@ libgnome_builder_la_CFLAGS = \
        -I$(srcdir)/views \
        -I$(srcdir)/workbench \
        -I$(srcdir)/workspace \
+       -I$(top_builddir)/data/icons/hicolor \
        -I$(top_builddir)/libide \
        -I$(top_srcdir)/libide \
        -I$(top_srcdir)/contrib/egg \
diff --git a/src/main.c b/src/main.c
index 2be702d..bbf6155 100644
--- a/src/main.c
+++ b/src/main.c
@@ -29,6 +29,7 @@
 #include <locale.h>
 
 #include "gb-application.h"
+#include "gb-icons-resources.h"
 #include "gb-plugins.h"
 
 int
@@ -56,6 +57,7 @@ main (int   argc,
              gtk_get_minor_version (),
              gtk_get_micro_version ());
 
+  g_resources_register (gb_icons_get_resource ());
   gb_plugins_load ();
 
   app = g_object_new (GB_TYPE_APPLICATION,
diff --git a/src/resources/gnome-builder.gresource.xml b/src/resources/gnome-builder.gresource.xml
index d3c25b9..c2805df 100644
--- a/src/resources/gnome-builder.gresource.xml
+++ b/src/resources/gnome-builder.gresource.xml
@@ -3,34 +3,6 @@
   <gresource prefix="/org/gnome/builder">
     <file alias="gtk/menus.ui">../../data/gtk/menus.ui</file>
 
-    <!-- Scalable icons all go into actions/ since gtk+ will ignore our directory scheme -->
-    <file 
alias="icons/scalable/actions/builder-move-left-symbolic.svg">../../data/icons/hicolor/scalable/actions/builder-move-left-symbolic.svg</file>
-    <file 
alias="icons/scalable/actions/builder-move-right-symbolic.svg">../../data/icons/hicolor/scalable/actions/builder-move-right-symbolic.svg</file>
-    <file 
alias="icons/scalable/actions/builder-split-tab-left-symbolic.svg">../../data/icons/hicolor/scalable/actions/builder-split-tab-left-symbolic.svg</file>
-    <file 
alias="icons/scalable/actions/builder-split-tab-right-symbolic.svg">../../data/icons/hicolor/scalable/actions/builder-split-tab-right-symbolic.svg</file>
-    <file 
alias="icons/scalable/actions/builder-split-tab-symbolic.svg">../../data/icons/hicolor/scalable/actions/builder-split-tab-symbolic.svg</file>
-    <file 
alias="icons/scalable/actions/builder-view-bottom-pane-symbolic.svg">../../data/icons/hicolor/scalable/actions/builder-view-bottom-pane-symbolic.svg</file>
-    <file 
alias="icons/scalable/actions/builder-view-left-pane-symbolic.svg">../../data/icons/hicolor/scalable/actions/builder-view-left-pane-symbolic.svg</file>
-    <file 
alias="icons/scalable/actions/builder-view-right-pane-symbolic.svg">../../data/icons/hicolor/scalable/actions/builder-view-right-pane-symbolic.svg</file>
-    <file 
alias="icons/scalable/actions/builder-vcs-git-symbolic.svg">../../data/icons/hicolor/scalable/vcs/builder-vcs-git-symbolic.svg</file>
-
-    <!-- Scalable autocompletion icons -->
-    <file 
alias="icons/scalable/actions/lang-class-symbolic.svg">../../data/icons/hicolor/scalable/autocomplete/lang-class-symbolic.svg</file>
-    <file 
alias="icons/scalable/actions/lang-define-symbolic.svg">../../data/icons/hicolor/scalable/autocomplete/lang-define-symbolic.svg</file>
-    <file 
alias="icons/scalable/actions/lang-enum-symbolic.svg">../../data/icons/hicolor/scalable/autocomplete/lang-enum-symbolic.svg</file>
-    <file 
alias="icons/scalable/actions/lang-function-symbolic.svg">../../data/icons/hicolor/scalable/autocomplete/lang-function-symbolic.svg</file>
-    <file 
alias="icons/scalable/actions/lang-include-symbolic.svg">../../data/icons/hicolor/scalable/autocomplete/lang-include-symbolic.svg</file>
-    <file 
alias="icons/scalable/actions/lang-struct-field-symbolic.svg">../../data/icons/hicolor/scalable/autocomplete/struct-field-symbolic.svg</file>
-    <file 
alias="icons/scalable/actions/lang-struct-symbolic.svg">../../data/icons/hicolor/scalable/autocomplete/lang-struct-symbolic.svg</file>
-    <file 
alias="icons/scalable/actions/lang-typedef-symbolic.svg">../../data/icons/hicolor/scalable/autocomplete/lang-typedef-symbolic.svg</file>
-    <file 
alias="icons/scalable/actions/lang-union-symbolic.svg">../../data/icons/hicolor/scalable/autocomplete/lang-union-symbolic.svg</file>
-    <file 
alias="icons/scalable/actions/lang-variable-symbolic.svg">../../data/icons/hicolor/scalable/autocomplete/lang-variable-symbolic.svg</file>
-
-    <!-- Non-scalable vcs icons -->
-    <file 
alias="icons/256x256/actions/builder-vcs-git.png">../../data/icons/hicolor/256x256/vcs/builder-vcs-git.png</file>
-    <file 
alias="icons/48x48/actions/builder-vcs-git.png">../../data/icons/hicolor/48x48/vcs/builder-vcs-git.png</file>
-    <file 
alias="icons/32x32/actions/builder-vcs-git.png">../../data/icons/hicolor/32x32/vcs/builder-vcs-git.png</file>
-
     <file alias="markdown/markdown.css">../../data/markdown/markdown.css</file>
     <file alias="markdown/marked.js">../../data/markdown/marked.js</file>
     <file alias="markdown/markdown-view.js">../../data/markdown/markdown-view.js</file>


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