diff --git a/app/base/Makefile.am b/app/base/Makefile.am index 5071432982..7c9140cce9 100644 --- a/app/base/Makefile.am +++ b/app/base/Makefile.am @@ -8,6 +8,7 @@ INCLUDES = \ -I$(top_srcdir) \ -I$(top_builddir)/app \ -I$(top_srcdir)/app \ + $(CAIRO_CFLAGS) \ $(GLIB_CFLAGS) \ -I$(includedir) diff --git a/app/base/color-balance.c b/app/base/color-balance.c index 2c55801103..fa77683e2b 100644 --- a/app/base/color-balance.c +++ b/app/base/color-balance.c @@ -17,6 +17,7 @@ #include "config.h" +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/base/colorize.c b/app/base/colorize.c index a966415292..1fd14a3933 100644 --- a/app/base/colorize.c +++ b/app/base/colorize.c @@ -17,6 +17,7 @@ #include "config.h" +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/base/desaturate.c b/app/base/desaturate.c index d12beda894..944c6e91aa 100644 --- a/app/base/desaturate.c +++ b/app/base/desaturate.c @@ -17,6 +17,7 @@ #include "config.h" +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/base/hue-saturation.c b/app/base/hue-saturation.c index 1060a065a9..61e69261fc 100644 --- a/app/base/hue-saturation.c +++ b/app/base/hue-saturation.c @@ -17,6 +17,7 @@ #include "config.h" +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/base/levels.c b/app/base/levels.c index e8e489f6aa..43499788f8 100644 --- a/app/base/levels.c +++ b/app/base/levels.c @@ -17,6 +17,7 @@ #include "config.h" +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/base/temp-buf.c b/app/base/temp-buf.c index 61fc650155..125ab7f957 100644 --- a/app/base/temp-buf.c +++ b/app/base/temp-buf.c @@ -23,6 +23,7 @@ #include #include +#include #include #include diff --git a/app/composite/Makefile.am b/app/composite/Makefile.am index ed92ff5b17..c81cbbb98e 100644 --- a/app/composite/Makefile.am +++ b/app/composite/Makefile.am @@ -11,6 +11,7 @@ INCLUDES = \ -I$(top_srcdir) \ -I$(top_builddir)/app \ -I$(top_srcdir)/app \ + $(CAIRO_CFLAGS) \ $(GLIB_CFLAGS) \ -I$(includedir) diff --git a/app/composite/gimp-composite-generic.c b/app/composite/gimp-composite-generic.c index a2bb373eef..18726f01ea 100644 --- a/app/composite/gimp-composite-generic.c +++ b/app/composite/gimp-composite-generic.c @@ -26,6 +26,7 @@ #include #include +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/config/Makefile.am b/app/config/Makefile.am index a93482b28e..1f756b17e2 100644 --- a/app/config/Makefile.am +++ b/app/config/Makefile.am @@ -16,6 +16,7 @@ INCLUDES = \ -I$(top_srcdir) \ -I$(top_builddir)/app \ -I$(top_srcdir)/app \ + $(CAIRO_CFLAGS) \ $(GDK_PIXBUF_CFLAGS) \ -I$(includedir) diff --git a/app/config/gimpconfig-dump.c b/app/config/gimpconfig-dump.c index 06235ea0e6..5cf410afbf 100644 --- a/app/config/gimpconfig-dump.c +++ b/app/config/gimpconfig-dump.c @@ -27,6 +27,7 @@ #include #endif +#include #include #include "libgimpbase/gimpbase.h" diff --git a/app/config/gimpdisplayconfig.c b/app/config/gimpdisplayconfig.c index 0e513086ed..91c8c3dc5b 100644 --- a/app/config/gimpdisplayconfig.c +++ b/app/config/gimpdisplayconfig.c @@ -20,6 +20,7 @@ #include "config.h" +#include #include #include "libgimpbase/gimpbase.h" diff --git a/app/config/gimpdisplayoptions.c b/app/config/gimpdisplayoptions.c index 82eb38805c..2e038dc6d5 100644 --- a/app/config/gimpdisplayoptions.c +++ b/app/config/gimpdisplayoptions.c @@ -20,6 +20,7 @@ #include "config.h" +#include #include #include "libgimpbase/gimpbase.h" diff --git a/app/config/gimprc-deserialize.c b/app/config/gimprc-deserialize.c index a356aa77a3..f8217b515c 100644 --- a/app/config/gimprc-deserialize.c +++ b/app/config/gimprc-deserialize.c @@ -20,6 +20,7 @@ #include "config.h" +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/core/gimp-utils.c b/app/core/gimp-utils.c index a6ebd0b776..91a5c292b9 100644 --- a/app/core/gimp-utils.c +++ b/app/core/gimp-utils.c @@ -26,6 +26,7 @@ #include #endif +#include #include #include diff --git a/app/core/gimpchannel-project.c b/app/core/gimpchannel-project.c index 8c838fb268..260fe14fad 100644 --- a/app/core/gimpchannel-project.c +++ b/app/core/gimpchannel-project.c @@ -19,6 +19,7 @@ #include "config.h" +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/core/gimpchannel.c b/app/core/gimpchannel.c index fa3cacaa65..2d97f761ce 100644 --- a/app/core/gimpchannel.c +++ b/app/core/gimpchannel.c @@ -19,6 +19,7 @@ #include +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/core/gimpcontext.c b/app/core/gimpcontext.c index 570e9b796b..250b9f8657 100644 --- a/app/core/gimpcontext.c +++ b/app/core/gimpcontext.c @@ -20,6 +20,7 @@ #include "config.h" +#include #include #include "libgimpbase/gimpbase.h" diff --git a/app/core/gimpdrawable-blend.c b/app/core/gimpdrawable-blend.c index 0e1e1a2297..ee3fd163b8 100644 --- a/app/core/gimpdrawable-blend.c +++ b/app/core/gimpdrawable-blend.c @@ -20,6 +20,7 @@ #include #include +#include #include #include "libgimpbase/gimpbase.h" diff --git a/app/core/gimpdrawable-bucket-fill.c b/app/core/gimpdrawable-bucket-fill.c index eb9c039f3c..30f2ebf0d2 100644 --- a/app/core/gimpdrawable-bucket-fill.c +++ b/app/core/gimpdrawable-bucket-fill.c @@ -19,6 +19,7 @@ #include +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/core/gimpdrawable-convert.c b/app/core/gimpdrawable-convert.c index dd09bfb435..bebc9855e1 100644 --- a/app/core/gimpdrawable-convert.c +++ b/app/core/gimpdrawable-convert.c @@ -18,6 +18,7 @@ #include "config.h" +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/core/gimpdrawable-offset.c b/app/core/gimpdrawable-offset.c index f531af904c..fcd5c51334 100644 --- a/app/core/gimpdrawable-offset.c +++ b/app/core/gimpdrawable-offset.c @@ -19,6 +19,7 @@ #include +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c index a65d697fdf..6207b0cb5d 100644 --- a/app/core/gimpdrawable.c +++ b/app/core/gimpdrawable.c @@ -17,6 +17,7 @@ #include "config.h" +#include #include #include diff --git a/app/core/gimpgradient-load.c b/app/core/gimpgradient-load.c index 8e5df24607..6f18bad5f5 100644 --- a/app/core/gimpgradient-load.c +++ b/app/core/gimpgradient-load.c @@ -21,6 +21,7 @@ #include #include +#include #include #include diff --git a/app/core/gimpgradient.c b/app/core/gimpgradient.c index d3a4e8ba39..8cece7f2a3 100644 --- a/app/core/gimpgradient.c +++ b/app/core/gimpgradient.c @@ -19,6 +19,7 @@ #include +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/core/gimpgrid.c b/app/core/gimpgrid.c index 650ab06815..0ae08f1825 100644 --- a/app/core/gimpgrid.c +++ b/app/core/gimpgrid.c @@ -20,8 +20,9 @@ #include "config.h" -#include /* strcmp */ +#include +#include #include #include "libgimpbase/gimpbase.h" diff --git a/app/core/gimpimage-colormap.c b/app/core/gimpimage-colormap.c index d8fec8598a..0a0e7e55a6 100644 --- a/app/core/gimpimage-colormap.c +++ b/app/core/gimpimage-colormap.c @@ -19,6 +19,7 @@ #include +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/core/gimpimage-contiguous-region.c b/app/core/gimpimage-contiguous-region.c index 7ff166dcfd..539376ffce 100644 --- a/app/core/gimpimage-contiguous-region.c +++ b/app/core/gimpimage-contiguous-region.c @@ -19,6 +19,7 @@ #include +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/core/gimpimage-convert.c b/app/core/gimpimage-convert.c index 81d8c80806..74faf849dd 100644 --- a/app/core/gimpimage-convert.c +++ b/app/core/gimpimage-convert.c @@ -132,6 +132,7 @@ #include #include +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/core/gimpimage-merge.c b/app/core/gimpimage-merge.c index edb5d17692..46cfa46293 100644 --- a/app/core/gimpimage-merge.c +++ b/app/core/gimpimage-merge.c @@ -17,6 +17,7 @@ #include "config.h" +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/core/gimpimage-quick-mask.c b/app/core/gimpimage-quick-mask.c index 0a6630c379..7072809384 100644 --- a/app/core/gimpimage-quick-mask.c +++ b/app/core/gimpimage-quick-mask.c @@ -17,6 +17,7 @@ #include "config.h" +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c index 6a165b07e5..01d02cdeaa 100644 --- a/app/core/gimpimage.c +++ b/app/core/gimpimage.c @@ -20,6 +20,7 @@ #include #include +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/core/gimpimageundo.c b/app/core/gimpimageundo.c index 74b69b7657..f67a59f5b0 100644 --- a/app/core/gimpimageundo.c +++ b/app/core/gimpimageundo.c @@ -19,6 +19,7 @@ #include +#include #include #include "libgimpbase/gimpbase.h" diff --git a/app/core/gimppalette-import.c b/app/core/gimppalette-import.c index 10dbb0f009..becab79464 100644 --- a/app/core/gimppalette-import.c +++ b/app/core/gimppalette-import.c @@ -19,6 +19,7 @@ #include +#include #include #include "libgimpbase/gimpbase.h" diff --git a/app/core/gimppalette-load.c b/app/core/gimppalette-load.c index a0cd4d7ecd..475ce42bd3 100644 --- a/app/core/gimppalette-load.c +++ b/app/core/gimppalette-load.c @@ -31,6 +31,7 @@ #define _O_BINARY 0 #endif +#include #include #include diff --git a/app/core/gimppalette-save.c b/app/core/gimppalette-save.c index 7bed0b7ab1..e0e0d444f9 100644 --- a/app/core/gimppalette-save.c +++ b/app/core/gimppalette-save.c @@ -25,6 +25,7 @@ #include #endif +#include #include #include diff --git a/app/core/gimppalette.c b/app/core/gimppalette.c index ba826e76f6..8aca12558e 100644 --- a/app/core/gimppalette.c +++ b/app/core/gimppalette.c @@ -19,6 +19,7 @@ #include +#include #include #include "libgimpbase/gimpbase.h" diff --git a/app/core/gimpparamspecs-duplicate.c b/app/core/gimpparamspecs-duplicate.c index 21e23257af..c0b7426001 100644 --- a/app/core/gimpparamspecs-duplicate.c +++ b/app/core/gimpparamspecs-duplicate.c @@ -20,6 +20,7 @@ #include "config.h" +#include #include #include diff --git a/app/core/gimppickable.c b/app/core/gimppickable.c index 4fb2e93cec..9f4e320321 100644 --- a/app/core/gimppickable.c +++ b/app/core/gimppickable.c @@ -26,6 +26,7 @@ #include "config.h" +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/display/gimpcanvastransformpreview.c b/app/display/gimpcanvastransformpreview.c index 0ddd0d4ccc..cb97aa57b5 100644 --- a/app/display/gimpcanvastransformpreview.c +++ b/app/display/gimpcanvastransformpreview.c @@ -25,6 +25,7 @@ #include "libgimpbase/gimpbase.h" #include "libgimpmath/gimpmath.h" +#include "libgimpcolor/gimpcolor.h" #include "libgimpwidgets/gimpwidgets.h" #include "display/display-types.h" diff --git a/app/display/gimpdisplayshell-render.c b/app/display/gimpdisplayshell-render.c index cf7cfe55c9..6d2e98774c 100644 --- a/app/display/gimpdisplayshell-render.c +++ b/app/display/gimpdisplayshell-render.c @@ -20,6 +20,7 @@ #include #include +#include "libgimpcolor/gimpcolor.h" #include "libgimpwidgets/gimpwidgets.h" #include "display-types.h" diff --git a/app/gegl/Makefile.am b/app/gegl/Makefile.am index 33a76772e8..addc33f6d0 100644 --- a/app/gegl/Makefile.am +++ b/app/gegl/Makefile.am @@ -8,6 +8,7 @@ INCLUDES = \ -I$(top_srcdir) \ -I$(top_builddir)/app \ -I$(top_srcdir)/app \ + $(CAIRO_CFLAGS) \ $(GEGL_CFLAGS) \ $(GDK_PIXBUF_CFLAGS) \ -I$(includedir) diff --git a/app/gegl/gimpcolorbalanceconfig.c b/app/gegl/gimpcolorbalanceconfig.c index 6646ad7691..05f9749725 100644 --- a/app/gegl/gimpcolorbalanceconfig.c +++ b/app/gegl/gimpcolorbalanceconfig.c @@ -20,6 +20,7 @@ #include "config.h" +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/gegl/gimpcurvesconfig.c b/app/gegl/gimpcurvesconfig.c index c5f7a85d57..745e3870cb 100644 --- a/app/gegl/gimpcurvesconfig.c +++ b/app/gegl/gimpcurvesconfig.c @@ -22,6 +22,7 @@ #include +#include #include #include diff --git a/app/gegl/gimphuesaturationconfig.c b/app/gegl/gimphuesaturationconfig.c index c85364f1d3..a2486d7c01 100644 --- a/app/gegl/gimphuesaturationconfig.c +++ b/app/gegl/gimphuesaturationconfig.c @@ -20,6 +20,7 @@ #include "config.h" +#include #include #include "libgimpconfig/gimpconfig.h" diff --git a/app/gegl/gimplevelsconfig.c b/app/gegl/gimplevelsconfig.c index 36a9f6a961..3b638d1c90 100644 --- a/app/gegl/gimplevelsconfig.c +++ b/app/gegl/gimplevelsconfig.c @@ -23,6 +23,7 @@ #include #include +#include #include #include diff --git a/app/gegl/gimpoperationcagetransform.c b/app/gegl/gimpoperationcagetransform.c index 4affa9a409..42d264a1d6 100644 --- a/app/gegl/gimpoperationcagetransform.c +++ b/app/gegl/gimpoperationcagetransform.c @@ -19,6 +19,7 @@ #include "config.h" +#include #include #include diff --git a/app/gegl/gimpoperationcolorbalance.c b/app/gegl/gimpoperationcolorbalance.c index 4c187f47ec..3762f61683 100644 --- a/app/gegl/gimpoperationcolorbalance.c +++ b/app/gegl/gimpoperationcolorbalance.c @@ -20,6 +20,7 @@ #include "config.h" +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/gegl/gimpoperationcolorize.c b/app/gegl/gimpoperationcolorize.c index 469750d924..2753a3bb28 100644 --- a/app/gegl/gimpoperationcolorize.c +++ b/app/gegl/gimpoperationcolorize.c @@ -20,6 +20,7 @@ #include "config.h" +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/gegl/gimpoperationcurves.c b/app/gegl/gimpoperationcurves.c index d43a84f6a7..ed9ae13f1e 100644 --- a/app/gegl/gimpoperationcurves.c +++ b/app/gegl/gimpoperationcurves.c @@ -20,6 +20,7 @@ #include "config.h" +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/gegl/gimpoperationdesaturate.c b/app/gegl/gimpoperationdesaturate.c index 6e8688eb50..456021201c 100644 --- a/app/gegl/gimpoperationdesaturate.c +++ b/app/gegl/gimpoperationdesaturate.c @@ -20,6 +20,7 @@ #include "config.h" +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/gegl/gimpoperationhuesaturation.c b/app/gegl/gimpoperationhuesaturation.c index 06c0aaa35b..3f530a862c 100644 --- a/app/gegl/gimpoperationhuesaturation.c +++ b/app/gegl/gimpoperationhuesaturation.c @@ -20,6 +20,7 @@ #include "config.h" +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/gegl/gimpoperationlevels.c b/app/gegl/gimpoperationlevels.c index d7a706a255..6c5e62f909 100644 --- a/app/gegl/gimpoperationlevels.c +++ b/app/gegl/gimpoperationlevels.c @@ -20,6 +20,7 @@ #include "config.h" +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/gegl/gimpoperationpointlayermode.c b/app/gegl/gimpoperationpointlayermode.c index 1b591550ef..7571b1a251 100644 --- a/app/gegl/gimpoperationpointlayermode.c +++ b/app/gegl/gimpoperationpointlayermode.c @@ -21,6 +21,7 @@ #include "config.h" +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/gegl/gimpoperationposterize.c b/app/gegl/gimpoperationposterize.c index 47d4a05f6b..aea0a317f8 100644 --- a/app/gegl/gimpoperationposterize.c +++ b/app/gegl/gimpoperationposterize.c @@ -20,6 +20,7 @@ #include "config.h" +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/gegl/gimpoperationthreshold.c b/app/gegl/gimpoperationthreshold.c index 2b21a283c3..8809b500c5 100644 --- a/app/gegl/gimpoperationthreshold.c +++ b/app/gegl/gimpoperationthreshold.c @@ -20,6 +20,7 @@ #include "config.h" +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/paint-funcs/Makefile.am b/app/paint-funcs/Makefile.am index e897a4b459..1e412cc99b 100644 --- a/app/paint-funcs/Makefile.am +++ b/app/paint-funcs/Makefile.am @@ -13,6 +13,7 @@ INCLUDES = \ -I$(top_srcdir) \ -I$(top_builddir)/app \ -I$(top_srcdir)/app \ + $(CAIRO_CFLAGS) \ $(GLIB_CFLAGS) \ -I$(includedir) diff --git a/app/paint-funcs/paint-funcs.c b/app/paint-funcs/paint-funcs.c index 0853c2ac89..c8322cc567 100644 --- a/app/paint-funcs/paint-funcs.c +++ b/app/paint-funcs/paint-funcs.c @@ -19,6 +19,7 @@ #include +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/paint/Makefile.am b/app/paint/Makefile.am index 18108b3712..e72b5a6f34 100644 --- a/app/paint/Makefile.am +++ b/app/paint/Makefile.am @@ -8,6 +8,7 @@ INCLUDES = \ -I$(top_srcdir) \ -I$(top_builddir)/app \ -I$(top_srcdir)/app \ + $(CAIRO_CFLAGS) \ $(GEGL_CFLAGS) \ $(GDK_PIXBUF_CFLAGS) \ -I$(includedir) diff --git a/app/paint/gimpairbrush.c b/app/paint/gimpairbrush.c index 5d7e512061..0af635946e 100644 --- a/app/paint/gimpairbrush.c +++ b/app/paint/gimpairbrush.c @@ -17,6 +17,7 @@ #include "config.h" +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/paint/gimperaser.c b/app/paint/gimperaser.c index 6cf296e594..6a8ca68409 100644 --- a/app/paint/gimperaser.c +++ b/app/paint/gimperaser.c @@ -19,8 +19,6 @@ #include -#include "libgimpcolor/gimpcolor.h" - #include "paint-types.h" #include "base/temp-buf.h" diff --git a/app/paint/gimppaintbrush.c b/app/paint/gimppaintbrush.c index dfdea9aa82..ab5d52c53a 100644 --- a/app/paint/gimppaintbrush.c +++ b/app/paint/gimppaintbrush.c @@ -17,6 +17,7 @@ #include "config.h" +#include #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/pdb/Makefile.am b/app/pdb/Makefile.am index dbbf1adbcd..d7c41af0d9 100644 --- a/app/pdb/Makefile.am +++ b/app/pdb/Makefile.am @@ -8,6 +8,7 @@ INCLUDES = \ -I$(top_srcdir) \ -I$(top_builddir)/app \ -I$(top_srcdir)/app \ + $(CAIRO_CFLAGS) \ $(GEGL_CFLAGS) \ $(GDK_PIXBUF_CFLAGS) \ -I$(includedir) diff --git a/app/pdb/channel-cmds.c b/app/pdb/channel-cmds.c index 3dddf32496..59b2102c84 100644 --- a/app/pdb/channel-cmds.c +++ b/app/pdb/channel-cmds.c @@ -19,6 +19,8 @@ #include "config.h" +#include + #include #include "libgimpbase/gimpbase.h" diff --git a/app/pdb/context-cmds.c b/app/pdb/context-cmds.c index 013cfa61e9..cff909fa33 100644 --- a/app/pdb/context-cmds.c +++ b/app/pdb/context-cmds.c @@ -19,6 +19,8 @@ #include "config.h" +#include + #include #include "libgimpcolor/gimpcolor.h" diff --git a/app/pdb/gimp-pdb-compat.c b/app/pdb/gimp-pdb-compat.c index 8a99b89304..cd6bda2fb5 100644 --- a/app/pdb/gimp-pdb-compat.c +++ b/app/pdb/gimp-pdb-compat.c @@ -17,6 +17,7 @@ #include "config.h" +#include #include #include "libgimpbase/gimpbase.h" diff --git a/app/pdb/gimppdb.c b/app/pdb/gimppdb.c index 397ea0cac7..22b28e79af 100644 --- a/app/pdb/gimppdb.c +++ b/app/pdb/gimppdb.c @@ -25,7 +25,6 @@ #include #include "libgimpbase/gimpbase.h" -#include "libgimpcolor/gimpcolor.h" #include "pdb-types.h" diff --git a/app/pdb/gimpprocedure.c b/app/pdb/gimpprocedure.c index 370d32fdaa..59f1b366f8 100644 --- a/app/pdb/gimpprocedure.c +++ b/app/pdb/gimpprocedure.c @@ -23,7 +23,6 @@ #include #include "libgimpbase/gimpbase.h" -#include "libgimpcolor/gimpcolor.h" #include "pdb-types.h" diff --git a/app/pdb/gradient-cmds.c b/app/pdb/gradient-cmds.c index 180046d8ec..c0907c28fb 100644 --- a/app/pdb/gradient-cmds.c +++ b/app/pdb/gradient-cmds.c @@ -19,6 +19,7 @@ #include "config.h" +#include #include #include diff --git a/app/pdb/grid-cmds.c b/app/pdb/grid-cmds.c index a4ae6c073a..bc54afe850 100644 --- a/app/pdb/grid-cmds.c +++ b/app/pdb/grid-cmds.c @@ -19,6 +19,8 @@ #include "config.h" +#include + #include #include "libgimpbase/gimpbaseenums.h" diff --git a/app/pdb/image-cmds.c b/app/pdb/image-cmds.c index 7c5b3aca5c..c9f9f29328 100644 --- a/app/pdb/image-cmds.c +++ b/app/pdb/image-cmds.c @@ -19,6 +19,8 @@ #include "config.h" +#include + #include #include "libgimpbase/gimpbase.h" diff --git a/app/pdb/image-select-cmds.c b/app/pdb/image-select-cmds.c index dcc4269cd1..c139e6fc05 100644 --- a/app/pdb/image-select-cmds.c +++ b/app/pdb/image-select-cmds.c @@ -19,6 +19,8 @@ #include "config.h" +#include + #include #include "libgimpbase/gimpbase.h" diff --git a/app/pdb/palette-cmds.c b/app/pdb/palette-cmds.c index 6d25e5570e..bd3a9eedcd 100644 --- a/app/pdb/palette-cmds.c +++ b/app/pdb/palette-cmds.c @@ -19,6 +19,7 @@ #include "config.h" +#include #include #include diff --git a/app/pdb/palettes-cmds.c b/app/pdb/palettes-cmds.c index 37f801482b..ad85e27503 100644 --- a/app/pdb/palettes-cmds.c +++ b/app/pdb/palettes-cmds.c @@ -19,6 +19,7 @@ #include "config.h" +#include #include #include diff --git a/app/pdb/selection-tools-cmds.c b/app/pdb/selection-tools-cmds.c index f0a3cce112..a4c624477c 100644 --- a/app/pdb/selection-tools-cmds.c +++ b/app/pdb/selection-tools-cmds.c @@ -19,6 +19,8 @@ #include "config.h" +#include + #include #include "libgimpbase/gimpbase.h" diff --git a/app/pdb/text-layer-cmds.c b/app/pdb/text-layer-cmds.c index f8cf681699..bfea61040f 100644 --- a/app/pdb/text-layer-cmds.c +++ b/app/pdb/text-layer-cmds.c @@ -19,6 +19,8 @@ #include "config.h" +#include + #include #include "libgimpbase/gimpbase.h" diff --git a/app/plug-in/Makefile.am b/app/plug-in/Makefile.am index e3b285f7cc..8b14512dab 100644 --- a/app/plug-in/Makefile.am +++ b/app/plug-in/Makefile.am @@ -8,6 +8,7 @@ INCLUDES = \ -I$(top_srcdir) \ -I$(top_builddir)/app \ -I$(top_srcdir)/app \ + $(CAIRO_CFLAGS) \ $(GEGL_CFLAGS) \ $(GDK_PIXBUF_CFLAGS) \ -I$(includedir) diff --git a/app/plug-in/plug-in-params.c b/app/plug-in/plug-in-params.c index c5a5f9e0e4..0b1727678a 100644 --- a/app/plug-in/plug-in-params.c +++ b/app/plug-in/plug-in-params.c @@ -17,6 +17,7 @@ #include "config.h" +#include #include #include "libgimpbase/gimpbase.h" diff --git a/app/text/gimptext-parasite.c b/app/text/gimptext-parasite.c index 6e3c519eb8..aa8026ed66 100644 --- a/app/text/gimptext-parasite.c +++ b/app/text/gimptext-parasite.c @@ -23,6 +23,7 @@ #include #include +#include #include #include "libgimpbase/gimpbase.h" diff --git a/app/text/gimptext.c b/app/text/gimptext.c index 80d2c80b68..00c640fd59 100644 --- a/app/text/gimptext.c +++ b/app/text/gimptext.c @@ -22,7 +22,7 @@ #include -#include +#include #include #include "libgimpbase/gimpbase.h" diff --git a/app/text/gimptextlayer.c b/app/text/gimptextlayer.c index 8c57e852ce..8984c76e95 100644 --- a/app/text/gimptextlayer.c +++ b/app/text/gimptextlayer.c @@ -22,17 +22,15 @@ #include +#include #include #include #include #include "libgimpbase/gimpbase.h" +#include "libgimpcolor/gimpcolor.h" #include "libgimpconfig/gimpconfig.h" -#define GIMP_WIDGETS_COMPILATION -#include "libgimpwidgets/gimpcairo-utils.h" /* eek */ -#undef GIMP_WIDGETS_COMPILATION - #include "text-types.h" #include "base/pixel-region.h" diff --git a/app/widgets/gimpcurveview.c b/app/widgets/gimpcurveview.c index e2c6e851f9..304a068073 100644 --- a/app/widgets/gimpcurveview.c +++ b/app/widgets/gimpcurveview.c @@ -22,8 +22,9 @@ #include #include -#include "libgimpconfig/gimpconfig.h" #include "libgimpmath/gimpmath.h" +#include "libgimpcolor/gimpcolor.h" +#include "libgimpconfig/gimpconfig.h" #include "libgimpwidgets/gimpwidgets.h" #include "widgets-types.h" diff --git a/app/xcf/Makefile.am b/app/xcf/Makefile.am index e38e2ee7e1..1efa6bf5b2 100644 --- a/app/xcf/Makefile.am +++ b/app/xcf/Makefile.am @@ -8,6 +8,7 @@ INCLUDES = \ -I$(top_srcdir) \ -I$(top_builddir)/app \ -I$(top_srcdir)/app \ + $(CAIRO_CFLAGS) \ $(GEGL_CFLAGS) \ $(GDK_PIXBUF_CFLAGS) \ -I$(includedir) diff --git a/app/xcf/xcf-load.c b/app/xcf/xcf-load.c index c6470997ff..63040c0d7b 100644 --- a/app/xcf/xcf-load.c +++ b/app/xcf/xcf-load.c @@ -20,6 +20,7 @@ #include #include +#include #include #include "libgimpbase/gimpbase.h" diff --git a/app/xcf/xcf-save.c b/app/xcf/xcf-save.c index e8f5e2e4e8..6d3e21468e 100644 --- a/app/xcf/xcf-save.c +++ b/app/xcf/xcf-save.c @@ -20,6 +20,7 @@ #include #include +#include #include #include "libgimpbase/gimpbase.h" diff --git a/devel-docs/libgimpcolor/libgimpcolor-docs.sgml b/devel-docs/libgimpcolor/libgimpcolor-docs.sgml index 2d582e5a53..bc9037db5e 100644 --- a/devel-docs/libgimpcolor/libgimpcolor-docs.sgml +++ b/devel-docs/libgimpcolor/libgimpcolor-docs.sgml @@ -20,6 +20,7 @@ + diff --git a/devel-docs/libgimpcolor/libgimpcolor-sections.txt b/devel-docs/libgimpcolor/libgimpcolor-sections.txt index 53ce8fcbf3..094de90211 100644 --- a/devel-docs/libgimpcolor/libgimpcolor-sections.txt +++ b/devel-docs/libgimpcolor/libgimpcolor-sections.txt @@ -141,3 +141,15 @@ gimp_bilinear_rgb gimp_bilinear_rgba gimp_bilinear_pixels_8 + +
+gimpcairocolor +GimpCairoColor +gimp_cairo_set_source_rgb +gimp_cairo_set_source_rgba +gimp_cairo_checkerboard_create +GIMP_CAIRO_RGB24_SET_PIXEL +GIMP_CAIRO_RGB24_GET_PIXEL +GIMP_CAIRO_ARGB32_SET_PIXEL +GIMP_CAIRO_ARGB32_GET_PIXEL +
diff --git a/devel-docs/libgimpwidgets/libgimpwidgets-sections.txt b/devel-docs/libgimpwidgets/libgimpwidgets-sections.txt index 860ffdba37..d2effe1a38 100644 --- a/devel-docs/libgimpwidgets/libgimpwidgets-sections.txt +++ b/devel-docs/libgimpwidgets/libgimpwidgets-sections.txt @@ -37,15 +37,8 @@ GIMP_BUTTON_GET_CLASS
gimpcairo-utils GimpCairoUtils -gimp_cairo_set_source_rgb -gimp_cairo_set_source_rgba gimp_cairo_set_focus_line_pattern -gimp_cairo_checkerboard_create gimp_cairo_surface_create_from_pixbuf -GIMP_CAIRO_RGB24_SET_PIXEL -GIMP_CAIRO_RGB24_GET_PIXEL -GIMP_CAIRO_ARGB32_SET_PIXEL -GIMP_CAIRO_ARGB32_GET_PIXEL
diff --git a/libgimp/gimplayer.c b/libgimp/gimplayer.c index 7a83a419cc..af210a46c1 100644 --- a/libgimp/gimplayer.c +++ b/libgimp/gimplayer.c @@ -27,10 +27,6 @@ #undef __GIMP_LAYER_H__ #include "gimplayer.h" -#define GIMP_WIDGETS_COMPILATION -#include "libgimpwidgets/gimpcairo-utils.h" /* eek */ -#undef GIMP_WIDGETS_COMPILATION - /** * gimp_layer_new: diff --git a/libgimpcolor/Makefile.am b/libgimpcolor/Makefile.am index eed43a6eaf..3bb5eb67a2 100644 --- a/libgimpcolor/Makefile.am +++ b/libgimpcolor/Makefile.am @@ -52,6 +52,7 @@ AM_CPPFLAGS = \ INCLUDES = \ -I$(top_srcdir) \ + $(CAIRO_CFLAGS) \ $(GLIB_CFLAGS) \ -I$(includedir) @@ -68,6 +69,8 @@ libgimpcolor_2_0_la_SOURCES = \ gimpadaptivesupersample.h \ gimpbilinear.c \ gimpbilinear.h \ + gimpcairocolor.c \ + gimpcairocolor.h \ gimpcmyk.c \ gimpcmyk.h \ gimpcolormanaged.c \ @@ -87,6 +90,7 @@ libgimpcolorinclude_HEADERS = \ gimpcolortypes.h \ gimpadaptivesupersample.h \ gimpbilinear.h \ + gimpcairocolor.h \ gimpcmyk.h \ gimpcolormanaged.h \ gimpcolorspace.h \ @@ -99,9 +103,14 @@ libgimpcolor_2_0_la_LDFLAGS = \ $(no_undefined) \ $(libgimpcolor_export_symbols) -libgimpcolor_2_0_la_DEPENDENCIES = $(gimpcolor_def) $(libgimpbase) +libgimpcolor_2_0_la_DEPENDENCIES = \ + $(gimpcolor_def) \ + $(libgimpbase) -libgimpcolor_2_0_la_LIBADD = $(GLIB_LIBS) $(libm) +libgimpcolor_2_0_la_LIBADD = \ + $(CAIRO_LIBS) \ + $(GLIB_LIBS) \ + $(libm) # @@ -116,6 +125,7 @@ test_color_parser_DEPENDENCIES = \ $(top_builddir)/libgimpcolor/libgimpcolor-$(GIMP_API_VERSION).la test_color_parser_LDADD = \ + $(CAIRO_LIBS) \ $(GLIB_LIBS) \ $(test_color_parser_DEPENDENCIES) diff --git a/libgimpcolor/gimpcairocolor.c b/libgimpcolor/gimpcairocolor.c new file mode 100644 index 0000000000..5e4b657a7a --- /dev/null +++ b/libgimpcolor/gimpcairocolor.c @@ -0,0 +1,142 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball + * + * gimpcairocolor.c + * Copyright (C) 2007 Sven Neumann + * 2010 Michael Natterer + * + * This library is free software: you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * . + */ + +#include "config.h" + +#include +#include + +#include "libgimpbase/gimpbase.h" + +#include "gimpcolortypes.h" + +#include "gimpcairocolor.h" + + +/** + * SECTION: gimpcairocolor + * @title: GimpCairoColor + * @short_description: Color utility functions for cairo + * + * Utility functions that make cairo easier to use with GIMP color + * data types. + **/ + + +/** + * gimp_cairo_set_source_rgb: + * @cr: Cairo context + * @color: GimpRGB color + * + * Sets the source pattern within @cr to the solid opaque color + * described by @color. + * + * This function calls cairo_set_source_rgb() for you. + * + * Since: GIMP 2.6 + **/ +void +gimp_cairo_set_source_rgb (cairo_t *cr, + const GimpRGB *color) +{ + cairo_set_source_rgb (cr, color->r, color->g, color->b); +} + +/** + * gimp_cairo_set_source_rgba: + * @cr: Cairo context + * @color: GimpRGB color + * + * Sets the source pattern within @cr to the solid translucent color + * described by @color. + * + * This function calls cairo_set_source_rgba() for you. + * + * Since: GIMP 2.6 + **/ +void +gimp_cairo_set_source_rgba (cairo_t *cr, + const GimpRGB *color) +{ + cairo_set_source_rgba (cr, color->r, color->g, color->b, color->a); +} + +/** + * gimp_cairo_checkerboard_create: + * @cr: Cairo context + * @size: check size + * @light: light check color or %NULL to use the default light gray + * @dark: dark check color or %NULL to use the default dark gray + * + * Create a repeating checkerboard pattern. + * + * Return value: a new Cairo pattern that can be used as a source on @cr. + * + * Since: GIMP 2.6 + **/ +cairo_pattern_t * +gimp_cairo_checkerboard_create (cairo_t *cr, + gint size, + const GimpRGB *light, + const GimpRGB *dark) +{ + cairo_t *context; + cairo_surface_t *surface; + cairo_pattern_t *pattern; + + g_return_val_if_fail (cr != NULL, NULL); + g_return_val_if_fail (size > 0, NULL); + + surface = cairo_surface_create_similar (cairo_get_target (cr), + CAIRO_CONTENT_COLOR, + 2 * size, 2 * size); + context = cairo_create (surface); + + if (light) + gimp_cairo_set_source_rgb (context, light); + else + cairo_set_source_rgb (context, + GIMP_CHECK_LIGHT, GIMP_CHECK_LIGHT, GIMP_CHECK_LIGHT); + + cairo_rectangle (context, 0, 0, size, size); + cairo_rectangle (context, size, size, size, size); + cairo_fill (context); + + if (dark) + gimp_cairo_set_source_rgb (context, dark); + else + cairo_set_source_rgb (context, + GIMP_CHECK_DARK, GIMP_CHECK_DARK, GIMP_CHECK_DARK); + + cairo_rectangle (context, 0, size, size, size); + cairo_rectangle (context, size, 0, size, size); + cairo_fill (context); + + cairo_destroy (context); + + pattern = cairo_pattern_create_for_surface (surface); + cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT); + + cairo_surface_destroy (surface); + + return pattern; +} diff --git a/libgimpcolor/gimpcairocolor.h b/libgimpcolor/gimpcairocolor.h new file mode 100644 index 0000000000..8ead589614 --- /dev/null +++ b/libgimpcolor/gimpcairocolor.h @@ -0,0 +1,156 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball + * + * gimpcairocolor.h + * Copyright (C) 2007 Sven Neumann + * 2010 Michael Natterer + * + * This library is free software: you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * . + */ + +#ifndef __GIMP_CAIRO_COLOR_H__ +#define __GIMP_CAIRO_COLOR_H__ + + +void gimp_cairo_set_source_rgb (cairo_t *cr, + const GimpRGB *color); +void gimp_cairo_set_source_rgba (cairo_t *cr, + const GimpRGB *color); + +cairo_pattern_t * gimp_cairo_checkerboard_create (cairo_t *cr, + gint size, + const GimpRGB *light, + const GimpRGB *dark); + + +/* some useful macros for writing directly to a Cairo surface */ + +/** + * GIMP_CAIRO_RGB24_SET_PIXEL: + * @d: pointer to the destination buffer + * @r: red component + * @g: green component + * @b: blue component + * + * Sets a single pixel in an Cairo image surface in %CAIRO_FORMAT_RGB24. + * + * Since: GIMP 2.6 + **/ +#if G_BYTE_ORDER == G_LITTLE_ENDIAN +#define GIMP_CAIRO_RGB24_SET_PIXEL(d, r, g, b) \ + G_STMT_START { d[0] = (b); d[1] = (g); d[2] = (r); } G_STMT_END +#else +#define GIMP_CAIRO_RGB24_SET_PIXEL(d, r, g, b) \ + G_STMT_START { d[1] = (r); d[2] = (g); d[3] = (b); } G_STMT_END +#endif + + +/** + * GIMP_CAIRO_RGB24_GET_PIXEL: + * @s: pointer to the source buffer + * @r: red component + * @g: green component + * @b: blue component + * + * Gets a single pixel from a Cairo image surface in %CAIRO_FORMAT_RGB24. + * + * Since: GIMP 2.8 + **/ +#if G_BYTE_ORDER == G_LITTLE_ENDIAN +#define GIMP_CAIRO_RGB24_GET_PIXEL(s, r, g, b) \ + G_STMT_START { (b) = s[0]; (g) = s[1]; (r) = s[2]; } G_STMT_END +#else +#define GIMP_CAIRO_RGB24_GET_PIXEL(s, r, g, b) \ + G_STMT_START { (r) = s[1]; (g) = s[2]; (b) = s[3]; } G_STMT_END +#endif + + +/** + * GIMP_CAIRO_ARGB32_SET_PIXEL: + * @d: pointer to the destination buffer + * @r: red component, not pre-multiplied + * @g: green component, not pre-multiplied + * @b: blue component, not pre-multiplied + * @a: alpha component + * + * Sets a single pixel in an Cairo image surface in %CAIRO_FORMAT_ARGB32. + * + * Since: GIMP 2.6 + **/ +#if G_BYTE_ORDER == G_LITTLE_ENDIAN +#define GIMP_CAIRO_ARGB32_SET_PIXEL(d, r, g, b, a) \ + G_STMT_START { \ + const guint tr = (a) * (r) + 0x80; \ + const guint tg = (a) * (g) + 0x80; \ + const guint tb = (a) * (b) + 0x80; \ + (d)[0] = (((tb) >> 8) + (tb)) >> 8; \ + (d)[1] = (((tg) >> 8) + (tg)) >> 8; \ + (d)[2] = (((tr) >> 8) + (tr)) >> 8; \ + (d)[3] = (a); \ + } G_STMT_END +#else +#define GIMP_CAIRO_ARGB32_SET_PIXEL(d, r, g, b, a) \ + G_STMT_START { \ + const guint tr = (a) * (r) + 0x80; \ + const guint tg = (a) * (g) + 0x80; \ + const guint tb = (a) * (b) + 0x80; \ + (d)[0] = (a); \ + (d)[1] = (((tr) >> 8) + (tr)) >> 8; \ + (d)[2] = (((tg) >> 8) + (tg)) >> 8; \ + (d)[3] = (((tb) >> 8) + (tb)) >> 8; \ + } G_STMT_END +#endif + + +/** + * GIMP_CAIRO_ARGB32_GET_PIXEL: + * @s: pointer to the source buffer + * @r: red component, not pre-multiplied + * @g: green component, not pre-multiplied + * @b: blue component, not pre-multiplied + * @a: alpha component + * + * Gets a single pixel from a Cairo image surface in %CAIRO_FORMAT_ARGB32. + * + * Since: GIMP 2.8 + **/ +#if G_BYTE_ORDER == G_LITTLE_ENDIAN +#define GIMP_CAIRO_ARGB32_GET_PIXEL(s, r, g, b, a) \ + G_STMT_START { \ + const guint tb = (s)[0]; \ + const guint tg = (s)[1]; \ + const guint tr = (s)[2]; \ + const guint ta = (s)[3]; \ + (r) = (tr << 8) / (ta + 1); \ + (g) = (tg << 8) / (ta + 1); \ + (b) = (tb << 8) / (ta + 1); \ + (a) = ta; \ + } G_STMT_END +#else +#define GIMP_CAIRO_ARGB32_GET_PIXEL(s, r, g, b, a) \ + G_STMT_START { \ + const guint ta = (s)[0]; \ + const guint tr = (s)[1]; \ + const guint tg = (s)[2]; \ + const guint tb = (s)[3]; \ + (r) = (tr << 8) / (ta + 1); \ + (g) = (tg << 8) / (ta + 1); \ + (b) = (tb << 8) / (ta + 1); \ + (a) = ta; \ + } G_STMT_END +#endif + + +#endif /* __GIMP_CAIRO_COLOR_H__ */ diff --git a/libgimpcolor/gimpcolor.h b/libgimpcolor/gimpcolor.h index a5f339faab..dc0327b5b3 100644 --- a/libgimpcolor/gimpcolor.h +++ b/libgimpcolor/gimpcolor.h @@ -25,6 +25,7 @@ #include #include +#include #include #include #include diff --git a/libgimpconfig/Makefile.am b/libgimpconfig/Makefile.am index f517c041d5..599e0d9d84 100644 --- a/libgimpconfig/Makefile.am +++ b/libgimpconfig/Makefile.am @@ -49,6 +49,7 @@ AM_CPPFLAGS = \ INCLUDES = \ -I$(top_srcdir) \ + $(CAIRO_CFLAGS) \ $(GLIB_CFLAGS) \ -I$(includedir) @@ -116,6 +117,7 @@ libgimpconfig_2_0_la_LIBADD = \ $(libgimpbase) \ $(libgimpcolor) \ $(libgimpmath) \ + $(CAIRO_LIBS) \ $(GLIB_LIBS) diff --git a/libgimpconfig/gimpcolorconfig.c b/libgimpconfig/gimpcolorconfig.c index eb50a3f372..6bfe77a57b 100644 --- a/libgimpconfig/gimpcolorconfig.c +++ b/libgimpconfig/gimpcolorconfig.c @@ -21,6 +21,7 @@ #include "config.h" +#include #include #include "libgimpbase/gimpbase.h" diff --git a/libgimpconfig/gimpconfig-deserialize.c b/libgimpconfig/gimpconfig-deserialize.c index 9148f0da01..c9a0927ccf 100644 --- a/libgimpconfig/gimpconfig-deserialize.c +++ b/libgimpconfig/gimpconfig-deserialize.c @@ -21,6 +21,7 @@ #include "config.h" +#include #include #include "libgimpbase/gimpbase.h" diff --git a/libgimpconfig/gimpconfig-serialize.c b/libgimpconfig/gimpconfig-serialize.c index aa3cb04b17..2b44c3b82e 100644 --- a/libgimpconfig/gimpconfig-serialize.c +++ b/libgimpconfig/gimpconfig-serialize.c @@ -21,6 +21,7 @@ #include "config.h" +#include #include #include "libgimpbase/gimpbase.h" diff --git a/libgimpconfig/gimpscanner.c b/libgimpconfig/gimpscanner.c index 920166225b..2583ed95b1 100644 --- a/libgimpconfig/gimpscanner.c +++ b/libgimpconfig/gimpscanner.c @@ -25,6 +25,7 @@ #include #include +#include #include #include "libgimpbase/gimpbase.h" diff --git a/libgimpwidgets/gimpcairo-utils.c b/libgimpwidgets/gimpcairo-utils.c index 02868f564b..3b1dd88f36 100644 --- a/libgimpwidgets/gimpcairo-utils.c +++ b/libgimpwidgets/gimpcairo-utils.c @@ -41,44 +41,6 @@ **/ -/** - * gimp_cairo_set_source_rgb: - * @cr: Cairo context - * @color: GimpRGB color - * - * Sets the source pattern within @cr to the solid opaque color - * described by @color. - * - * This function calls cairo_set_source_rgb() for you. - * - * Since: GIMP 2.6 - **/ -void -gimp_cairo_set_source_rgb (cairo_t *cr, - const GimpRGB *color) -{ - cairo_set_source_rgb (cr, color->r, color->g, color->b); -} - -/** - * gimp_cairo_set_source_rgba: - * @cr: Cairo context - * @color: GimpRGB color - * - * Sets the source pattern within @cr to the solid translucent color - * described by @color. - * - * This function calls cairo_set_source_rgba() for you. - * - * Since: GIMP 2.6 - **/ -void -gimp_cairo_set_source_rgba (cairo_t *cr, - const GimpRGB *color) -{ - cairo_set_source_rgba (cr, color->r, color->g, color->b, color->a); -} - /** * gimp_cairo_set_focus_line_pattern: * @cr: Cairo context @@ -133,67 +95,6 @@ gimp_cairo_set_focus_line_pattern (cairo_t *cr, return retval; } -/** - * gimp_cairo_checkerboard_create: - * @cr: Cairo context - * @size: check size - * @light: light check color or %NULL to use the default light gray - * @dark: dark check color or %NULL to use the default dark gray - * - * Create a repeating checkerboard pattern. - * - * Return value: a new Cairo pattern that can be used as a source on @cr. - * - * Since: GIMP 2.6 - **/ -cairo_pattern_t * -gimp_cairo_checkerboard_create (cairo_t *cr, - gint size, - const GimpRGB *light, - const GimpRGB *dark) -{ - cairo_t *context; - cairo_surface_t *surface; - cairo_pattern_t *pattern; - - g_return_val_if_fail (cr != NULL, NULL); - g_return_val_if_fail (size > 0, NULL); - - surface = cairo_surface_create_similar (cairo_get_target (cr), - CAIRO_CONTENT_COLOR, - 2 * size, 2 * size); - context = cairo_create (surface); - - if (light) - gimp_cairo_set_source_rgb (context, light); - else - cairo_set_source_rgb (context, - GIMP_CHECK_LIGHT, GIMP_CHECK_LIGHT, GIMP_CHECK_LIGHT); - - cairo_rectangle (context, 0, 0, size, size); - cairo_rectangle (context, size, size, size, size); - cairo_fill (context); - - if (dark) - gimp_cairo_set_source_rgb (context, dark); - else - cairo_set_source_rgb (context, - GIMP_CHECK_DARK, GIMP_CHECK_DARK, GIMP_CHECK_DARK); - - cairo_rectangle (context, 0, size, size, size); - cairo_rectangle (context, size, 0, size, size); - cairo_fill (context); - - cairo_destroy (context); - - pattern = cairo_pattern_create_for_surface (surface); - cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT); - - cairo_surface_destroy (surface); - - return pattern; -} - /** * gimp_cairo_surface_create_from_pixbuf: * @pixbuf: a #GdkPixbuf diff --git a/libgimpwidgets/gimpcairo-utils.h b/libgimpwidgets/gimpcairo-utils.h index 1b896a474c..87b4e14633 100644 --- a/libgimpwidgets/gimpcairo-utils.h +++ b/libgimpwidgets/gimpcairo-utils.h @@ -27,143 +27,10 @@ #define __GIMP_CAIRO_UTILS_H__ -void gimp_cairo_set_source_rgb (cairo_t *cr, - const GimpRGB *color); -void gimp_cairo_set_source_rgba (cairo_t *cr, - const GimpRGB *color); - -/* This is a bad hack that allows to include this file from the app's - * non-gui files. I haven't decided yet how to split this header and - * where to move the non-GTK+ part. --Mitch - */ -#ifdef __GTK_H__ gboolean gimp_cairo_set_focus_line_pattern (cairo_t *cr, GtkWidget *widget); -#endif - -cairo_pattern_t * gimp_cairo_checkerboard_create (cairo_t *cr, - gint size, - const GimpRGB *light, - const GimpRGB *dark); cairo_surface_t * gimp_cairo_surface_create_from_pixbuf (GdkPixbuf *pixbuf); -/* some useful macros for writing directly to a Cairo surface */ - -/** - * GIMP_CAIRO_RGB24_SET_PIXEL: - * @d: pointer to the destination buffer - * @r: red component - * @g: green component - * @b: blue component - * - * Sets a single pixel in an Cairo image surface in %CAIRO_FORMAT_RGB24. - * - * Since: GIMP 2.6 - **/ -#if G_BYTE_ORDER == G_LITTLE_ENDIAN -#define GIMP_CAIRO_RGB24_SET_PIXEL(d, r, g, b) \ - G_STMT_START { d[0] = (b); d[1] = (g); d[2] = (r); } G_STMT_END -#else -#define GIMP_CAIRO_RGB24_SET_PIXEL(d, r, g, b) \ - G_STMT_START { d[1] = (r); d[2] = (g); d[3] = (b); } G_STMT_END -#endif - - -/** - * GIMP_CAIRO_RGB24_GET_PIXEL: - * @s: pointer to the source buffer - * @r: red component - * @g: green component - * @b: blue component - * - * Gets a single pixel from a Cairo image surface in %CAIRO_FORMAT_RGB24. - * - * Since: GIMP 2.8 - **/ -#if G_BYTE_ORDER == G_LITTLE_ENDIAN -#define GIMP_CAIRO_RGB24_GET_PIXEL(s, r, g, b) \ - G_STMT_START { (b) = s[0]; (g) = s[1]; (r) = s[2]; } G_STMT_END -#else -#define GIMP_CAIRO_RGB24_GET_PIXEL(s, r, g, b) \ - G_STMT_START { (r) = s[1]; (g) = s[2]; (b) = s[3]; } G_STMT_END -#endif - - -/** - * GIMP_CAIRO_ARGB32_SET_PIXEL: - * @d: pointer to the destination buffer - * @r: red component, not pre-multiplied - * @g: green component, not pre-multiplied - * @b: blue component, not pre-multiplied - * @a: alpha component - * - * Sets a single pixel in an Cairo image surface in %CAIRO_FORMAT_ARGB32. - * - * Since: GIMP 2.6 - **/ -#if G_BYTE_ORDER == G_LITTLE_ENDIAN -#define GIMP_CAIRO_ARGB32_SET_PIXEL(d, r, g, b, a) \ - G_STMT_START { \ - const guint tr = (a) * (r) + 0x80; \ - const guint tg = (a) * (g) + 0x80; \ - const guint tb = (a) * (b) + 0x80; \ - (d)[0] = (((tb) >> 8) + (tb)) >> 8; \ - (d)[1] = (((tg) >> 8) + (tg)) >> 8; \ - (d)[2] = (((tr) >> 8) + (tr)) >> 8; \ - (d)[3] = (a); \ - } G_STMT_END -#else -#define GIMP_CAIRO_ARGB32_SET_PIXEL(d, r, g, b, a) \ - G_STMT_START { \ - const guint tr = (a) * (r) + 0x80; \ - const guint tg = (a) * (g) + 0x80; \ - const guint tb = (a) * (b) + 0x80; \ - (d)[0] = (a); \ - (d)[1] = (((tr) >> 8) + (tr)) >> 8; \ - (d)[2] = (((tg) >> 8) + (tg)) >> 8; \ - (d)[3] = (((tb) >> 8) + (tb)) >> 8; \ - } G_STMT_END -#endif - -/** - * GIMP_CAIRO_ARGB32_GET_PIXEL: - * @s: pointer to the source buffer - * @r: red component, not pre-multiplied - * @g: green component, not pre-multiplied - * @b: blue component, not pre-multiplied - * @a: alpha component - * - * Gets a single pixel from a Cairo image surface in %CAIRO_FORMAT_ARGB32. - * - * Since: GIMP 2.8 - **/ -#if G_BYTE_ORDER == G_LITTLE_ENDIAN -#define GIMP_CAIRO_ARGB32_GET_PIXEL(s, r, g, b, a) \ - G_STMT_START { \ - const guint tb = (s)[0]; \ - const guint tg = (s)[1]; \ - const guint tr = (s)[2]; \ - const guint ta = (s)[3]; \ - (r) = (tr << 8) / (ta + 1); \ - (g) = (tg << 8) / (ta + 1); \ - (b) = (tb << 8) / (ta + 1); \ - (a) = ta; \ - } G_STMT_END -#else -#define GIMP_CAIRO_ARGB32_GET_PIXEL(s, r, g, b, a) \ - G_STMT_START { \ - const guint ta = (s)[0]; \ - const guint tr = (s)[1]; \ - const guint tg = (s)[2]; \ - const guint tb = (s)[3]; \ - (r) = (tr << 8) / (ta + 1); \ - (g) = (tg << 8) / (ta + 1); \ - (b) = (tb << 8) / (ta + 1); \ - (a) = ta; \ - } G_STMT_END -#endif - - #endif /* __GIMP_CAIRO_UTILS_H__ */ diff --git a/modules/display-filter-color-blind.c b/modules/display-filter-color-blind.c index dcad8cb835..3b06f5c6ab 100644 --- a/modules/display-filter-color-blind.c +++ b/modules/display-filter-color-blind.c @@ -31,6 +31,7 @@ #include +#include "libgimpcolor/gimpcolor.h" #include "libgimpconfig/gimpconfig.h" #include "libgimpmath/gimpmath.h" #include "libgimpmodule/gimpmodule.h" diff --git a/modules/display-filter-gamma.c b/modules/display-filter-gamma.c index 797bd16914..07cfbadd36 100644 --- a/modules/display-filter-gamma.c +++ b/modules/display-filter-gamma.c @@ -19,6 +19,7 @@ #include +#include "libgimpcolor/gimpcolor.h" #include "libgimpconfig/gimpconfig.h" #include "libgimpmath/gimpmath.h" #include "libgimpmodule/gimpmodule.h" diff --git a/modules/display-filter-high-contrast.c b/modules/display-filter-high-contrast.c index 550aceea0b..f1739d336c 100644 --- a/modules/display-filter-high-contrast.c +++ b/modules/display-filter-high-contrast.c @@ -19,6 +19,7 @@ #include +#include "libgimpcolor/gimpcolor.h" #include "libgimpconfig/gimpconfig.h" #include "libgimpmath/gimpmath.h" #include "libgimpmodule/gimpmodule.h" diff --git a/modules/display-filter-proof.c b/modules/display-filter-proof.c index a9e722b252..41967f519a 100644 --- a/modules/display-filter-proof.c +++ b/modules/display-filter-proof.c @@ -24,6 +24,7 @@ #include #include "libgimpbase/gimpbase.h" +#include "libgimpcolor/gimpcolor.h" #include "libgimpconfig/gimpconfig.h" #include "libgimpmath/gimpmath.h" #include "libgimpmodule/gimpmodule.h" diff --git a/plug-ins/pygimp/pygimpcolor.h b/plug-ins/pygimp/pygimpcolor.h index f89fb71015..53a6bdbd19 100644 --- a/plug-ins/pygimp/pygimpcolor.h +++ b/plug-ins/pygimp/pygimpcolor.h @@ -21,6 +21,7 @@ #include +#include #include #include diff --git a/tools/pdbgen/pdb.pl b/tools/pdbgen/pdb.pl index e54049d7c3..5162dda7ac 100644 --- a/tools/pdbgen/pdb.pl +++ b/tools/pdbgen/pdb.pl @@ -107,7 +107,7 @@ package Gimp::CodeGen::pdb; init_value => '{ 0.0, 0.0, 0.0, 1.0 }', get_value_func => 'gimp_value_get_rgb ($value, &$var)', set_value_func => 'gimp_value_set_rgb ($value, &$var)', - headers => [ qw("libgimpcolor/gimpcolor.h") ] }, + headers => [ qw( "libgimpcolor/gimpcolor.h") ] }, display => { name => 'DISPLAY', type => 'GimpObject *',