[gimp] Generate icon resources where they are needed, and don't include .c files



commit 5674e31850417d4619fa7aed0a8ee045dfaa1926
Author: Michael Natterer <mitch gimp org>
Date:   Wed Jun 13 20:02:05 2018 +0200

    Generate icon resources where they are needed, and don't include .c files
    
    Treat the gimp-core-pixbufs and gimp-icon-pixbufs resources like we
    changed the cursor resources before, and clean out a lot of cruft from
    icons/ (there is no need to generate stuff in all icon themes when we
    include only one fallback icon from one theme).

 app/Makefile.am            |  9 ++++----
 app/core/.gitignore        |  2 ++
 app/core/Makefile.am       | 24 ++++++++++++++++++---
 app/core/gimpviewable.c    |  2 --
 icons/.gitignore           |  2 --
 icons/Color/Makefile.am    | 18 ++--------------
 icons/Legacy/Makefile.am   | 52 ----------------------------------------------
 icons/Symbolic/Makefile.am | 51 ---------------------------------------------
 libgimpwidgets/.gitignore  |  6 ++++--
 libgimpwidgets/Makefile.am | 15 +++++++++++++
 libgimpwidgets/gimpicons.c |  2 --
 11 files changed, 49 insertions(+), 134 deletions(-)
---
diff --git a/app/Makefile.am b/app/Makefile.am
index 5f91e55f86..970cbe73f2 100644
--- a/app/Makefile.am
+++ b/app/Makefile.am
@@ -173,10 +173,11 @@ gimpconsoleldadd = \
        $(libm)
 
 gimp_@GIMP_APP_VERSION@_LDFLAGS = \
-       $(AM_LDFLAGS)                           \
-       $(win32_ldflags)                        \
-       $(framework_cocoa)                      \
-       -Wl,-u,$(SYMPREFIX)gimp_lebl_dialog     \
+       $(AM_LDFLAGS)                                           \
+       $(win32_ldflags)                                        \
+       $(framework_cocoa)                                      \
+       -Wl,-u,$(SYMPREFIX)gimp_lebl_dialog                     \
+       -Wl,-u,$(SYMPREFIX)gimp_core_pixbufs_get_resource       \
        -Wl,-u,$(SYMPREFIX)gimp_tool_cursors_get_resource
 
 
diff --git a/app/core/.gitignore b/app/core/.gitignore
index 70066a4ee4..d69ed15fe6 100644
--- a/app/core/.gitignore
+++ b/app/core/.gitignore
@@ -3,6 +3,8 @@
 /.libs
 /Makefile
 /Makefile.in
+/gimp-core-pixbufs.c
+/gimp-core-pixbufs.h
 /gimpmarshal.c
 /gimpmarshal.h
 /libappcore.a
diff --git a/app/core/Makefile.am b/app/core/Makefile.am
index 31392be3a2..bad1af34d9 100644
--- a/app/core/Makefile.am
+++ b/app/core/Makefile.am
@@ -461,8 +461,10 @@ libappcore_a_sources = \
        gimpwaitable.h
 
 libappcore_a_built_sources = \
-       core-enums.c    \
-       gimpmarshal.c   \
+       gimp-core-pixbufs.c     \
+       gimp-core-pixbufs.h     \
+       core-enums.c            \
+       gimpmarshal.c           \
        gimpmarshal.h
 
 libappcore_a_extra_sources = \
@@ -477,7 +479,13 @@ EXTRA_DIST = \
 # rules to generate built sources
 #
 # setup autogeneration dependencies
-gen_sources = xgen-gmh xgen-gmc xgen-cec
+gen_sources = \
+       gimp-core-pixbufs.c     \
+       gimp-core-pixbufs.h     \
+       xgen-gmh                \
+       xgen-gmc                \
+       xgen-cec
+
 CLEANFILES = $(gen_sources)
 
 gimpmarshal.h: $(srcdir)/gimpmarshal.list
@@ -513,3 +521,13 @@ $(srcdir)/core-enums.c: xgen-cec
                touch $@ 2> /dev/null \
                || true; \
        fi
+
+gimp-core-pixbufs.h: $(top_builddir)/icons/Color/gimp-core-pixbufs.gresource.xml
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) \
+         --sourcedir=$(top_srcdir)/icons/Color --generate-header \
+         --target=$@ $(top_builddir)/icons/Color/gimp-core-pixbufs.gresource.xml
+
+gimp-core-pixbufs.c: gimp-core-pixbufs.h
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) \
+         --sourcedir=$(top_srcdir)/icons/Color --generate-source \
+         --target=$@ $(top_builddir)/icons/Color/gimp-core-pixbufs.gresource.xml
diff --git a/app/core/gimpviewable.c b/app/core/gimpviewable.c
index 800c93eedb..f3bee53f76 100644
--- a/app/core/gimpviewable.c
+++ b/app/core/gimpviewable.c
@@ -39,8 +39,6 @@
 #include "gimptempbuf.h"
 #include "gimpviewable.h"
 
-#include "icons/Color/gimp-core-pixbufs.c"
-
 
 enum
 {
diff --git a/icons/.gitignore b/icons/.gitignore
index c00eaee5a9..58196eb229 100644
--- a/icons/.gitignore
+++ b/icons/.gitignore
@@ -1,6 +1,4 @@
 Makefile
 Makefile.in
-gimp-core-pixbufs.c
 gimp-core-pixbufs.gresource.xml
-gimp-icon-pixbufs.c
 gimp-icon-pixbufs.gresource.xml
diff --git a/icons/Color/Makefile.am b/icons/Color/Makefile.am
index 3421597d51..13a7c0c012 100644
--- a/icons/Color/Makefile.am
+++ b/icons/Color/Makefile.am
@@ -52,14 +52,11 @@ EXTRA_DIST = \
        color-scalable.svg
 
 noinst_DATA = \
-       gimp-core-pixbufs.c     \
-       gimp-icon-pixbufs.c
-
-CLEANFILES = \
-       $(noinst_DATA)                  \
        gimp-core-pixbufs.gresource.xml \
        gimp-icon-pixbufs.gresource.xml
 
+CLEANFILES = $(noinst_DATA)
+
 
 gimp-core-pixbufs.gresource.xml: $(CORE_IMAGES) Makefile.am
        $(AM_V_GEN) ( rm -f $@; \
@@ -72,12 +69,6 @@ gimp-core-pixbufs.gresource.xml: $(CORE_IMAGES) Makefile.am
          echo '  </gresource>' >> $@; \
          echo '</gresources>' >> $@ )
 
-gimp-core-pixbufs.c: gimp-core-pixbufs.gresource.xml
-       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) \
-         --sourcedir=$(srcdir) --generate-source \
-         --target=$@ gimp-core-pixbufs.gresource.xml
-
-
 gimp-icon-pixbufs.gresource.xml: $(ICON_IMAGES) Makefile.am
        $(AM_V_GEN) ( rm -f $@; \
          echo '<?xml version="1.0" encoding="UTF-8"?>' > $@; \
@@ -88,8 +79,3 @@ gimp-icon-pixbufs.gresource.xml: $(ICON_IMAGES) Makefile.am
          done; \
          echo '  </gresource>' >> $@; \
          echo '</gresources>' >> $@ )
-
-gimp-icon-pixbufs.c: gimp-icon-pixbufs.gresource.xml
-       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) \
-         --sourcedir=$(srcdir) --generate-source \
-         --target=$@ gimp-icon-pixbufs.gresource.xml
diff --git a/icons/Legacy/Makefile.am b/icons/Legacy/Makefile.am
index eec32304ec..a033819fe2 100644
--- a/icons/Legacy/Makefile.am
+++ b/icons/Legacy/Makefile.am
@@ -496,15 +496,6 @@ icons256_DATA = \
        256/gimp-wilber.png             \
        256/gimp-wilber-outline.png
 
-
-## Compiled-in icons for both the core and libgimpwidgets
-
-CORE_IMAGES = \
-       64/gimp-question.png
-
-ICON_IMAGES = \
-       64/gimp-wilber-eek.png
-
 EXTRA_DIST = \
        $(icons_DATA)           \
        $(icons12_DATA)         \
@@ -521,46 +512,3 @@ EXTRA_DIST = \
        $(icons192_DATA)        \
        $(icons256_DATA)        \
        $(tools22_DATA)
-
-noinst_DATA = \
-       gimp-core-pixbufs.c     \
-       gimp-icon-pixbufs.c
-
-CLEANFILES = \
-       $(noinst_DATA)                  \
-       gimp-core-pixbufs.gresource.xml \
-       gimp-icon-pixbufs.gresource.xml
-
-
-gimp-core-pixbufs.gresource.xml: $(CORE_IMAGES) Makefile.am
-       $(AM_V_GEN) ( rm -f $@; \
-         echo '<?xml version="1.0" encoding="UTF-8"?>' > $@; \
-         echo '<gresources>' >> $@; \
-         echo '  <gresource prefix="/org/gimp/icons">' >> $@; \
-         for image in $(CORE_IMAGES); do \
-           echo "    <file preprocess=\"to-pixdata\">$$image</file>" >> $@; \
-         done; \
-         echo '  </gresource>' >> $@; \
-         echo '</gresources>' >> $@ )
-
-gimp-core-pixbufs.c: gimp-core-pixbufs.gresource.xml
-       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) \
-         --sourcedir=$(srcdir) --generate-source \
-         --target=$@ gimp-core-pixbufs.gresource.xml
-
-
-gimp-icon-pixbufs.gresource.xml: $(ICON_IMAGES) Makefile.am
-       $(AM_V_GEN) ( rm -f $@; \
-         echo '<?xml version="1.0" encoding="UTF-8"?>' > $@; \
-         echo '<gresources>' >> $@; \
-         echo '  <gresource prefix="/org/gimp/icons">' >> $@; \
-         for image in $(ICON_IMAGES); do \
-           echo "    <file preprocess=\"to-pixdata\">$$image</file>" >> $@; \
-         done; \
-         echo '  </gresource>' >> $@; \
-         echo '</gresources>' >> $@ )
-
-gimp-icon-pixbufs.c: gimp-icon-pixbufs.gresource.xml
-       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) \
-         --sourcedir=$(srcdir) --generate-source \
-         --target=$@ gimp-icon-pixbufs.gresource.xml
diff --git a/icons/Symbolic/Makefile.am b/icons/Symbolic/Makefile.am
index 3f00cf5413..03debf91f5 100644
--- a/icons/Symbolic/Makefile.am
+++ b/icons/Symbolic/Makefile.am
@@ -25,14 +25,6 @@ endif
 #      SVG=`$(top_srcdir)/tools/extract-vector-icon.sh $< $*` && \
 #      echo $${SVG} > $@
 
-## Compiled-in icons for both the core and libgimpwidgets
-
-CORE_IMAGES = \
-       64/gimp-question.png
-
-ICON_IMAGES = \
-       64/gimp-wilber-eek.png
-
 EXTRA_DIST = \
        $(icons_DATA)                   \
        $(icons12_images)               \
@@ -52,46 +44,3 @@ EXTRA_DIST = \
        $(symbolic_scalable_images)     \
        $(symbolic_vector24_images)     \
        symbolic-scalable.svg
-
-noinst_DATA = \
-       gimp-core-pixbufs.c     \
-       gimp-icon-pixbufs.c
-
-CLEANFILES = \
-       $(noinst_DATA)                  \
-       gimp-core-pixbufs.gresource.xml \
-       gimp-icon-pixbufs.gresource.xml
-
-
-gimp-core-pixbufs.gresource.xml: $(CORE_IMAGES) Makefile.am
-       $(AM_V_GEN) ( rm -f $@; \
-         echo '<?xml version="1.0" encoding="UTF-8"?>' > $@; \
-         echo '<gresources>' >> $@; \
-         echo '  <gresource prefix="/org/gimp/icons">' >> $@; \
-         for image in $(CORE_IMAGES); do \
-           echo "    <file preprocess=\"to-pixdata\">$$image</file>" >> $@; \
-         done; \
-         echo '  </gresource>' >> $@; \
-         echo '</gresources>' >> $@ )
-
-gimp-core-pixbufs.c: gimp-core-pixbufs.gresource.xml
-       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) \
-         --sourcedir=$(srcdir) --generate-source \
-         --target=$@ gimp-core-pixbufs.gresource.xml
-
-
-gimp-icon-pixbufs.gresource.xml: $(ICON_IMAGES) Makefile.am
-       $(AM_V_GEN) ( rm -f $@; \
-         echo '<?xml version="1.0" encoding="UTF-8"?>' > $@; \
-         echo '<gresources>' >> $@; \
-         echo '  <gresource prefix="/org/gimp/icons">' >> $@; \
-         for image in $(ICON_IMAGES); do \
-           echo "    <file preprocess=\"to-pixdata\">$$image</file>" >> $@; \
-         done; \
-         echo '  </gresource>' >> $@; \
-         echo '</gresources>' >> $@ )
-
-gimp-icon-pixbufs.c: gimp-icon-pixbufs.gresource.xml
-       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) \
-         --sourcedir=$(srcdir) --generate-source \
-         --target=$@ gimp-icon-pixbufs.gresource.xml
diff --git a/libgimpwidgets/.gitignore b/libgimpwidgets/.gitignore
index ec95e47016..09ebacfe80 100644
--- a/libgimpwidgets/.gitignore
+++ b/libgimpwidgets/.gitignore
@@ -5,6 +5,10 @@
 /Makefile
 /Makefile.in
 /_libs
+/gimp-color-picker-cursors.c
+/gimp-color-picker-cursors.h
+/gimp-icon-pixbufs.c
+/gimp-icon-pixbufs.h
 /gimpwidgetsmarshal.c
 /gimpwidgetsmarshal.h
 /makefile.mingw
@@ -13,5 +17,3 @@
 /*.trs
 /*.log
 /xgen-wec
-/gimp-color-picker-cursors.c
-/gimp-color-picker-cursors.h
diff --git a/libgimpwidgets/Makefile.am b/libgimpwidgets/Makefile.am
index c11e041dd9..12969c175d 100644
--- a/libgimpwidgets/Makefile.am
+++ b/libgimpwidgets/Makefile.am
@@ -198,6 +198,8 @@ libgimpwidgets_sources = \
 libgimpwidgets_built_sources = \
        gimp-color-picker-cursors.c     \
        gimp-color-picker-cursors.h     \
+       gimp-icon-pixbufs.c             \
+       gimp-icon-pixbufs.h             \
        gimpwidgetsenums.c              \
        gimpwidgetsmarshal.c            \
        gimpwidgetsmarshal.h
@@ -316,9 +318,12 @@ endif
 gen_sources = \
        gimp-color-picker-cursors.c     \
        gimp-color-picker-cursors.h     \
+       gimp-icon-pixbufs.c             \
+       gimp-icon-pixbufs.h             \
        xgen-wec                        \
        xgen-wmh                        \
        xgen-wmc
+
 CLEANFILES = $(gen_sources)
 
 xgen-wec: $(srcdir)/gimpwidgetsenums.h $(GIMP_MKENUMS) Makefile.am
@@ -365,6 +370,16 @@ gimp-color-picker-cursors.c: gimp-color-picker-cursors.h
          --sourcedir=$(top_srcdir)/cursors --generate-source \
          --target=$@ $(top_builddir)/cursors/gimp-color-picker-cursors.gresource.xml
 
+gimp-icon-pixbufs.h: $(top_builddir)/icons/Color/gimp-icon-pixbufs.gresource.xml
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) \
+         --sourcedir=$(top_srcdir)/icons/Color --generate-header \
+         --target=$@ $(top_builddir)/icons/Color/gimp-icon-pixbufs.gresource.xml
+
+gimp-icon-pixbufs.c: gimp-icon-pixbufs.h
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) \
+         --sourcedir=$(top_srcdir)/icons/Color --generate-source \
+         --target=$@ $(top_builddir)/icons/Color/gimp-icon-pixbufs.gresource.xml
+
 
 #
 # test programs, not installed
diff --git a/libgimpwidgets/gimpicons.c b/libgimpwidgets/gimpicons.c
index 19e3f79d64..30903a4ec5 100644
--- a/libgimpwidgets/gimpicons.c
+++ b/libgimpwidgets/gimpicons.c
@@ -27,8 +27,6 @@
 
 #include "gimpicons.h"
 
-#include "icons/Color/gimp-icon-pixbufs.c"
-
 #include "libgimp/libgimp-intl.h"
 
 


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