app: add gimp_context_get_foreground,background_pixel()

which takes a Babl format to convert from/to.
Include <gegl.h> in a million places.
This commit is contained in:
Michael Natterer 2012-03-29 19:19:01 +02:00
parent 37c895ba68
commit 867da8f293
155 changed files with 240 additions and 37 deletions

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -19,6 +19,7 @@
#include <string.h>
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -19,6 +19,7 @@
#include <string.h>
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpthumb/gimpthumb.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "actions-types.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -19,6 +19,7 @@
#include <string.h>
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -19,6 +19,7 @@
#include <string.h>
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -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"

View File

@ -20,7 +20,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "core-types.h"

View File

@ -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)
{

View File

@ -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 */

View File

@ -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"

View File

@ -20,7 +20,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpconfig/gimpconfig.h"

View File

@ -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"

View File

@ -17,7 +17,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "core-types.h"

View File

@ -22,7 +22,7 @@
#include <string.h>
#include <glib-object.h>
#include <gegl.h>
#include "core-types.h"

View File

@ -22,7 +22,7 @@
#include <string.h>
#include <glib-object.h>
#include <gegl.h>
#include "core-types.h"

View File

@ -21,7 +21,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpconfig/gimpconfig.h"

View File

@ -19,7 +19,7 @@
#include <string.h>
#include <glib-object.h>
#include <gegl.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpconfig/gimpconfig.h"

View File

@ -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

View File

@ -17,7 +17,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -19,6 +19,7 @@
#include <string.h>
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -20,6 +20,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"

View File

@ -20,6 +20,7 @@
#include <string.h>
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -19,6 +19,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "display-types.h"

View File

@ -20,6 +20,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "gui-types.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -17,7 +17,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -19,7 +19,7 @@
#include <string.h>
#include <glib-object.h>
#include <gegl.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -17,7 +17,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -17,7 +17,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -17,7 +17,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -17,7 +17,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -17,7 +17,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -17,7 +17,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -17,7 +17,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -19,7 +19,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "plug-in-types.h"

View File

@ -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)

View File

@ -19,7 +19,7 @@
#include "config.h"
#include <glib-object.h>
#include <gegl.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpbase/gimpprotocol.h"

View File

@ -21,7 +21,7 @@
#include <string.h>
#include <glib-object.h>
#include <gegl.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpconfig/gimpconfig.h"

View File

@ -21,7 +21,7 @@
#include <string.h>
#include <glib-object.h>
#include <gegl.h>
#include "plug-in-types.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpcolor/gimpcolor.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -20,6 +20,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -19,6 +19,7 @@
#include <string.h>
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -20,6 +20,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpconfig/gimpconfig.h"

View File

@ -22,6 +22,7 @@
#include <string.h>
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"

View File

@ -22,6 +22,7 @@
#include <string.h>
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpmath/gimpmath.h"

View File

@ -20,6 +20,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -20,6 +20,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -19,6 +19,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpcolor/gimpcolor.h"

View File

@ -22,6 +22,7 @@
#include <string.h>
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpcolor/gimpcolor.h"

View File

@ -17,6 +17,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpcolor/gimpcolor.h"

View File

@ -20,6 +20,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpcolor/gimpcolor.h"

View File

@ -22,6 +22,7 @@
#include <string.h>
#include <gegl.h>
#include <gtk/gtk.h>
#include "widgets-types.h"

View File

@ -22,6 +22,7 @@
#include <string.h>
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -22,6 +22,7 @@
#include <string.h>
#include <gegl.h>
#include <gtk/gtk.h>
#include "widgets-types.h"

View File

@ -20,6 +20,7 @@
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -22,6 +22,7 @@
#include <string.h>
#include <gegl.h>
#include <gtk/gtk.h>
#include "widgets-types.h"

Some files were not shown because too many files have changed in this diff Show More