1999-04-04 07:12:22 +00:00
/* The GIMP -- an image manipulation program
2000-02-17 11:44:27 +00:00
* Copyright ( C ) 1995 - 2000 Spencer Kimball and Peter Mattis
1999-04-04 07:12:22 +00:00
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 2 of the License , or
* ( at your option ) any later version .
*
* This program 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 General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software
* Foundation , Inc . , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
*/
/* NOTE: This file is autogenerated by pdbgen.pl. */
2000-12-29 15:22:01 +00:00
# include "config.h"
2001-10-28 18:45:45 +00:00
# include <string.h>
2000-12-29 15:22:01 +00:00
2001-08-17 14:27:31 +00:00
# include <glib-object.h>
2000-12-29 15:22:01 +00:00
2001-05-21 13:58:46 +00:00
# include "libgimpbase/gimpbasetypes.h"
2001-08-17 14:27:31 +00:00
# include "pdb-types.h"
1999-04-04 07:12:22 +00:00
# include "procedural_db.h"
2001-07-04 19:31:35 +00:00
# include "core/gimp.h"
2001-05-09 02:32:03 +00:00
# include "core/gimpcontext.h"
# include "core/gimpdatafactory.h"
2001-10-28 00:53:42 +00:00
# include "core/gimplist.h"
# include "core/gimppalette.h"
1999-04-04 07:12:22 +00:00
2001-01-24 22:36:18 +00:00
# include "libgimpcolor/gimpcolor.h"
1999-04-04 07:12:22 +00:00
static ProcRecord palette_get_foreground_proc ;
static ProcRecord palette_get_background_proc ;
static ProcRecord palette_set_foreground_proc ;
static ProcRecord palette_set_background_proc ;
static ProcRecord palette_set_default_colors_proc ;
static ProcRecord palette_swap_colors_proc ;
void
2001-07-04 19:31:35 +00:00
register_palette_procs ( Gimp * gimp )
1999-04-04 07:12:22 +00:00
{
2001-07-04 19:31:35 +00:00
procedural_db_register ( gimp , & palette_get_foreground_proc ) ;
procedural_db_register ( gimp , & palette_get_background_proc ) ;
procedural_db_register ( gimp , & palette_set_foreground_proc ) ;
procedural_db_register ( gimp , & palette_set_background_proc ) ;
procedural_db_register ( gimp , & palette_set_default_colors_proc ) ;
procedural_db_register ( gimp , & palette_swap_colors_proc ) ;
1999-04-04 07:12:22 +00:00
}
static Argument *
2001-07-04 19:31:35 +00:00
palette_get_foreground_invoker ( Gimp * gimp ,
Argument * args )
1999-04-04 07:12:22 +00:00
{
Argument * return_args ;
2001-01-25 14:38:10 +00:00
GimpRGB color ;
2001-01-15 01:48:53 +00:00
2001-07-07 12:17:23 +00:00
gimp_context_get_foreground ( gimp_get_current_context ( gimp ) , & color ) ;
1999-04-04 07:12:22 +00:00
return_args = procedural_db_return_args ( & palette_get_foreground_proc , TRUE ) ;
2001-01-25 14:38:10 +00:00
return_args [ 1 ] . value . pdb_color = color ;
1999-04-04 07:12:22 +00:00
return return_args ;
}
static ProcArg palette_get_foreground_outargs [ ] =
{
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_COLOR ,
1999-04-04 07:12:22 +00:00
" foreground " ,
" The foreground color "
}
} ;
static ProcRecord palette_get_foreground_proc =
{
" gimp_palette_get_foreground " ,
" Get the current GIMP foreground color. " ,
" This procedure retrieves the current GIMP foreground color. The foreground color is used in a variety of tools such as paint tools, blending, and bucket fill. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
1999-04-04 07:12:22 +00:00
0 ,
NULL ,
1 ,
palette_get_foreground_outargs ,
{ { palette_get_foreground_invoker } }
} ;
static Argument *
2001-07-04 19:31:35 +00:00
palette_get_background_invoker ( Gimp * gimp ,
Argument * args )
1999-04-04 07:12:22 +00:00
{
Argument * return_args ;
2001-01-25 14:38:10 +00:00
GimpRGB color ;
1999-04-04 07:12:22 +00:00
2001-07-07 12:17:23 +00:00
gimp_context_get_background ( gimp_get_current_context ( gimp ) , & color ) ;
1999-04-04 07:12:22 +00:00
return_args = procedural_db_return_args ( & palette_get_background_proc , TRUE ) ;
2001-01-25 14:38:10 +00:00
return_args [ 1 ] . value . pdb_color = color ;
1999-04-04 07:12:22 +00:00
return return_args ;
}
static ProcArg palette_get_background_outargs [ ] =
{
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_COLOR ,
1999-04-04 07:12:22 +00:00
" background " ,
" The background color "
}
} ;
static ProcRecord palette_get_background_proc =
{
" gimp_palette_get_background " ,
" Get the current GIMP background color. " ,
" This procedure retrieves the current GIMP background color. The background color is used in a variety of tools such as blending, erasing (with non-alpha images), and image filling. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
1999-04-04 07:12:22 +00:00
0 ,
NULL ,
1 ,
palette_get_background_outargs ,
{ { palette_get_background_invoker } }
} ;
static Argument *
2001-07-04 19:31:35 +00:00
palette_set_foreground_invoker ( Gimp * gimp ,
Argument * args )
1999-04-04 07:12:22 +00:00
{
2001-01-25 14:38:10 +00:00
GimpRGB color ;
1999-04-04 07:12:22 +00:00
2001-01-25 14:38:10 +00:00
color = args [ 0 ] . value . pdb_color ;
2001-01-15 01:48:53 +00:00
2001-01-25 14:38:10 +00:00
gimp_rgb_set_alpha ( & color , 1.0 ) ;
2001-07-07 12:17:23 +00:00
gimp_context_set_foreground ( gimp_get_current_context ( gimp ) , & color ) ;
1999-04-04 07:12:22 +00:00
return procedural_db_return_args ( & palette_set_foreground_proc , TRUE ) ;
}
static ProcArg palette_set_foreground_inargs [ ] =
{
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_COLOR ,
1999-04-04 07:12:22 +00:00
" foreground " ,
" The foreground color "
}
} ;
static ProcRecord palette_set_foreground_proc =
{
" gimp_palette_set_foreground " ,
" Set the current GIMP foreground color. " ,
" This procedure sets the current GIMP foreground color. After this is set, operations which use foreground such as paint tools, blending, and bucket fill will use the new value. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
1999-04-04 07:12:22 +00:00
1 ,
palette_set_foreground_inargs ,
0 ,
NULL ,
{ { palette_set_foreground_invoker } }
} ;
static Argument *
2001-07-04 19:31:35 +00:00
palette_set_background_invoker ( Gimp * gimp ,
Argument * args )
1999-04-04 07:12:22 +00:00
{
2001-01-25 14:38:10 +00:00
GimpRGB color ;
1999-04-04 07:12:22 +00:00
2001-01-25 14:38:10 +00:00
color = args [ 0 ] . value . pdb_color ;
2001-01-15 01:48:53 +00:00
2001-01-25 14:38:10 +00:00
gimp_rgb_set_alpha ( & color , 1.0 ) ;
2001-07-07 12:17:23 +00:00
gimp_context_set_background ( gimp_get_current_context ( gimp ) , & color ) ;
1999-04-04 07:12:22 +00:00
return procedural_db_return_args ( & palette_set_background_proc , TRUE ) ;
}
static ProcArg palette_set_background_inargs [ ] =
{
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_COLOR ,
1999-04-04 07:12:22 +00:00
" background " ,
" The background color "
}
} ;
static ProcRecord palette_set_background_proc =
{
" gimp_palette_set_background " ,
" Set the current GIMP background color. " ,
" This procedure sets the current GIMP background color. After this is set, operations which use background such as blending, filling images, clearing, and erasing (in non-alpha images) will use the new value. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
1999-04-04 07:12:22 +00:00
1 ,
palette_set_background_inargs ,
0 ,
NULL ,
{ { palette_set_background_invoker } }
} ;
static Argument *
2001-07-04 19:31:35 +00:00
palette_set_default_colors_invoker ( Gimp * gimp ,
Argument * args )
1999-04-04 07:12:22 +00:00
{
2001-07-07 12:17:23 +00:00
gimp_context_set_default_colors ( gimp_get_current_context ( gimp ) ) ;
1999-04-04 07:12:22 +00:00
return procedural_db_return_args ( & palette_set_default_colors_proc , TRUE ) ;
}
static ProcRecord palette_set_default_colors_proc =
{
" gimp_palette_set_default_colors " ,
" Set the current GIMP foreground and background colors to black and white. " ,
" This procedure sets the current GIMP foreground and background colors to their initial default values, black and white. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
1999-04-04 07:12:22 +00:00
0 ,
NULL ,
0 ,
NULL ,
{ { palette_set_default_colors_invoker } }
} ;
static Argument *
2001-07-04 19:31:35 +00:00
palette_swap_colors_invoker ( Gimp * gimp ,
Argument * args )
1999-04-04 07:12:22 +00:00
{
2001-07-07 12:17:23 +00:00
gimp_context_swap_colors ( gimp_get_current_context ( gimp ) ) ;
1999-04-04 07:12:22 +00:00
return procedural_db_return_args ( & palette_swap_colors_proc , TRUE ) ;
}
static ProcRecord palette_swap_colors_proc =
{
" gimp_palette_swap_colors " ,
" Swap the current GIMP foreground and background colors. " ,
" This procedure swaps the current GIMP foreground and background colors, so that the new foreground color becomes the old background color and vice versa. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
1999-04-04 07:12:22 +00:00
0 ,
NULL ,
0 ,
NULL ,
{ { palette_swap_colors_invoker } }
} ;