Commit 867da8f2 authored by Michael Natterer's avatar Michael Natterer

app: add gimp_context_get_foreground,background_pixel()

which takes a Babl format to convert from/to.
Include <gegl.h> in a million places.
parent 37c895ba
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -19,6 +19,7 @@
#include <string.h>
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -19,6 +19,7 @@
#include <string.h>
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpthumb/gimpthumb.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "actions-types.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpconfig/gimpconfig.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -19,6 +19,7 @@
#include <string.h>
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpconfig/gimpconfig.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -19,6 +19,7 @@
#include <string.h>
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -25,8 +25,8 @@
#include <unistd.h>
#endif
#include <gegl.h>
#include <glib/gstdio.h>
#include <glib-object.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpconfig/gimpconfig.h"
......
......@@ -20,7 +20,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "core-types.h"
......
......@@ -2214,6 +2214,20 @@ gimp_context_get_foreground (GimpContext *context,
*color = context->foreground;
}
void
gimp_context_get_foreground_pixel (GimpContext *context,
const Babl *pixel_format,
gpointer pixel)
{
g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (pixel_format != NULL);
g_return_if_fail (pixel != NULL);
babl_process (babl_fish (babl_format ("R'G'B'A double"),
pixel_format),
&context->foreground, pixel, 1);
}
void
gimp_context_set_foreground (GimpContext *context,
const GimpRGB *color)
......@@ -2225,6 +2239,24 @@ gimp_context_set_foreground (GimpContext *context,
gimp_context_real_set_foreground (context, color);
}
void
gimp_context_set_foreground_pixel (GimpContext *context,
const Babl *pixel_format,
gconstpointer pixel)
{
GimpRGB color;
g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (pixel_format != NULL);
g_return_if_fail (pixel != NULL);
babl_process (babl_fish (pixel_format,
babl_format ("R'G'B'A double")),
pixel, &color, 1);
gimp_context_set_foreground (context, &color);
}
void
gimp_context_foreground_changed (GimpContext *context)
{
......@@ -2264,6 +2296,20 @@ gimp_context_get_background (GimpContext *context,
*color = context->background;
}
void
gimp_context_get_background_pixel (GimpContext *context,
const Babl *pixel_format,
gpointer pixel)
{
g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (pixel_format != NULL);
g_return_if_fail (pixel != NULL);
babl_process (babl_fish (babl_format ("R'G'B'A double"),
pixel_format),
&context->background, pixel, 1);
}
void
gimp_context_set_background (GimpContext *context,
const GimpRGB *color)
......@@ -2275,6 +2321,24 @@ gimp_context_set_background (GimpContext *context,
gimp_context_real_set_background (context, color);
}
void
gimp_context_set_background_pixel (GimpContext *context,
const Babl *pixel_format,
gconstpointer pixel)
{
GimpRGB color;
g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (pixel_format != NULL);
g_return_if_fail (pixel != NULL);
babl_process (babl_fish (pixel_format,
babl_format ("R'G'B'A double")),
pixel, &color, 1);
gimp_context_set_background (context, &color);
}
void
gimp_context_background_changed (GimpContext *context)
{
......
......@@ -235,19 +235,31 @@ void gimp_context_paint_info_changed (GimpContext *context);
/* foreground color */
void gimp_context_get_foreground (GimpContext *context,
GimpRGB *color);
void gimp_context_set_foreground (GimpContext *context,
const GimpRGB *color);
void gimp_context_foreground_changed (GimpContext *context);
void gimp_context_get_foreground (GimpContext *context,
GimpRGB *color);
void gimp_context_get_foreground_pixel (GimpContext *context,
const Babl *pixel_format,
gpointer pixel);
void gimp_context_set_foreground (GimpContext *context,
const GimpRGB *color);
void gimp_context_set_foreground_pixel (GimpContext *context,
const Babl *pixel_format,
gconstpointer pixel);
void gimp_context_foreground_changed (GimpContext *context);
/* background color */
void gimp_context_get_background (GimpContext *context,
GimpRGB *color);
void gimp_context_set_background (GimpContext *context,
const GimpRGB *color);
void gimp_context_background_changed (GimpContext *context);
void gimp_context_get_background (GimpContext *context,
GimpRGB *color);
void gimp_context_get_background_pixel (GimpContext *context,
const Babl *pixel_format,
gpointer pixel);
void gimp_context_set_background (GimpContext *context,
const GimpRGB *color);
void gimp_context_set_background_pixel (GimpContext *context,
const Babl *pixel_format,
gconstpointer pixel);
void gimp_context_background_changed (GimpContext *context);
/* color utility functions */
......
......@@ -23,7 +23,7 @@
#include <stdlib.h>
#include <string.h>
#include <glib-object.h>
#include <gegl.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpmath/gimpmath.h"
......
......@@ -20,7 +20,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpconfig/gimpconfig.h"
......
......@@ -20,7 +20,7 @@
#include <string.h>
#include <cairo.h>
#include <glib-object.h>
#include <gegl.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
......
......@@ -17,7 +17,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "core-types.h"
......
......@@ -22,7 +22,7 @@
#include <string.h>
#include <glib-object.h>
#include <gegl.h>
#include "core-types.h"
......
......@@ -22,7 +22,7 @@
#include <string.h>
#include <glib-object.h>
#include <gegl.h>
#include "core-types.h"
......
......@@ -21,7 +21,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpconfig/gimpconfig.h"
......
......@@ -19,7 +19,7 @@
#include <string.h>
#include <glib-object.h>
#include <gegl.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpconfig/gimpconfig.h"
......
......@@ -23,8 +23,8 @@
#include <unistd.h>
#endif
#include <gegl.h>
#include <glib/gstdio.h>
#include <glib-object.h>
#include "libgimpbase/gimpbase.h"
#ifdef G_OS_WIN32
......
......@@ -17,7 +17,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "libgimpconfig/gimpconfig.h"
......
......@@ -19,6 +19,7 @@
#include <string.h>
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -20,6 +20,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"
......
......@@ -20,6 +20,7 @@
#include <string.h>
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -19,6 +19,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpconfig/gimpconfig.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "display-types.h"
......
......@@ -20,6 +20,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "gui-types.h"
......
......@@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......
......@@ -17,7 +17,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "libgimpconfig/gimpconfig.h"
......
......@@ -19,7 +19,7 @@
#include <string.h>
#include <glib-object.h>
#include <gegl.h>
#include "libgimpconfig/gimpconfig.h"
......
......@@ -17,7 +17,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "libgimpconfig/gimpconfig.h"
......
......@@ -17,7 +17,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "libgimpconfig/gimpconfig.h"
......
......@@ -17,7 +17,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "libgimpconfig/gimpconfig.h"
......
......@@ -17,7 +17,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "libgimpconfig/gimpconfig.h"
......
......@@ -17,7 +17,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "libgimpconfig/gimpconfig.h"
......
......@@ -17,7 +17,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "libgimpconfig/gimpconfig.h"
......
......@@ -17,7 +17,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "libgimpconfig/gimpconfig.h"
......
......@@ -19,7 +19,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "plug-in-types.h"
......
......@@ -45,7 +45,7 @@
#include <sys/param.h>
#endif
#include <glib-object.h>
#include <gegl.h>
#if defined(G_OS_WIN32) || defined(G_WITH_CYGWIN)
......
......@@ -19,7 +19,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpbase/gimpprotocol.h"
......
......@@ -21,7 +21,7 @@
#include <string.h>