gimp/libgimp/gimppalette.c
Michael Natterer b346ba965d app/Makefile.am new files containing stuff needed for linking libgimp
2001-01-23  Michael Natterer  <mitch@gimp.org>

	* app/Makefile.am
	* app/libgimp_glue.[ch]: new files containing stuff needed for
	linking libgimp stuff against the app. This file is not needed
	at all for the app itself and should never be included.

	* app/gimpcontext.[ch]: removed from here.

	* libgimp/Makefile.am
	* libgimp/gimp.h
	* libgimp/gimppalette.[ch]: new files for the PDB wrapping
	gimp_palette_*_rgb() stuff.

	* libgimp/gimpcolor.[ch]: removed the PDB dependency from here.
2001-01-23 16:05:10 +00:00

84 lines
1.9 KiB
C

/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* 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 2 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
* Library 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, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <glib.h>
#include "gimpcolor.h"
#include "gimppalette_pdb.h"
/* These functions will become the default one day */
gboolean
gimp_palette_set_foreground_rgb (const GimpRGB *rgb)
{
guchar r, g, b;
g_return_val_if_fail (rgb != NULL, FALSE);
gimp_rgb_get_uchar (rgb, &r, &g, &b);
return gimp_palette_set_foreground (r, g, b);
}
gboolean
gimp_palette_get_foreground_rgb (GimpRGB *rgb)
{
guchar r, g, b;
g_return_val_if_fail (rgb != NULL, FALSE);
if (gimp_palette_get_foreground (&r, &g, &b))
{
gimp_rgb_set_uchar (rgb, r, g, b);
return TRUE;
}
return FALSE;
}
gboolean
gimp_palette_set_background_rgb (const GimpRGB *rgb)
{
guchar r, g, b;
g_return_val_if_fail (rgb != NULL, FALSE);
gimp_rgb_get_uchar (rgb, &r, &g, &b);
return gimp_palette_set_background (r, g, b);
}
gboolean
gimp_palette_get_background_rgb (GimpRGB *rgb)
{
guchar r, g, b;
g_return_val_if_fail (rgb != NULL, FALSE);
if (gimp_palette_get_background (&r, &g, &b))
{
gimp_rgb_set_uchar (rgb, r, g, b);
return TRUE;
}
return FALSE;
}