gimp/app/pdb/pdb_glue.h
Michael Natterer 451d392aac Some PDB cleanup:
2002-09-10  Michael Natterer  <mitch@gimp.org>

	Some PDB cleanup:

	* tools/pdbgen/pdb/procedural_db.pdb: removed the get_data() and
	set_data() implementations and the global "data_list" variable.
	Cleaned up the dump() stuff (pass the FILE pointer around instead
	of having a global variable for it). Fixed output_string() so it
	does not crash on NULL strings.

	* app/core/gimp.[ch]: added gimp->procedural_db_data_list.

	* app/pdb/procedural_db.[ch]: added procedural_db_[set|get]_data().
	Don't leak data identifiers when overwriting an already existing
	entry. Added g_return_if_fail() stuff to all public functions.

	* tools/pdbgen/pdb/channel.pdb
	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/layer.pdb
	* tools/pdbgen/pdb/parasite.pdb: tweaked some helper functions to
	take parameters which make them aware of the real type of the
	objects they handle (e.g. the PDB function gimp_layer_set_name()
	matches the core function gimp_object_get_name()).

	* app/pdb/pdb_glue.h: removed ugly CPP-level workarounds for the
	issue mentioned above.

	* app/pdb/channel_cmds.c
	* app/pdb/drawable_cmds.c
	* app/pdb/layer_cmds.c
	* app/pdb/parasite_cmds.c
	* app/pdb/procedural_db_cmds.c: regenerated.
2002-09-10 20:23:00 +00:00

33 lines
1.5 KiB
C

/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* 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.
*/
#ifndef __PDB_GLUE_H__
#define __PDB_GLUE_H__
#define gimp_layer_get_apply_mask(l) (l)->mask ? gimp_layer_mask_get_apply((l)->mask) : FALSE;
#define gimp_layer_get_show_mask(l) (l)->mask ? gimp_layer_mask_get_show((l)->mask) : FALSE;
#define gimp_layer_get_edit_mask(l) (l)->mask ? gimp_layer_mask_get_edit((l)->mask) : FALSE;
#define gimp_layer_set_apply_mask(l,a) { if((l)->mask) gimp_layer_mask_set_apply((l)->mask,(a)); else success = FALSE; }
#define gimp_layer_set_show_mask(l,s) { if((l)->mask) gimp_layer_mask_set_show((l)->mask,(s)); else success = FALSE; }
#define gimp_layer_set_edit_mask(l,e) { if((l)->mask) gimp_layer_mask_set_edit((l)->mask,(e)); else success = FALSE; }
#endif /* __PDB_GLUE_H__ */