gimp/app/widgets/gimpdataselect.c
Michael Natterer 8d9e362249 app/gui/Makefile.am app/gui/brush-select.[ch] app/gui/font-select.[ch]
2004-07-09  Michael Natterer  <mitch@gimp.org>

	* app/gui/Makefile.am
	* app/gui/brush-select.[ch]
	* app/gui/font-select.[ch]
	* app/gui/gradient-select.[ch]
	* app/gui/palette-select.[ch]
	* app/gui/pattern-select.[ch]: removed...

	* app/widgets/Makefile.am
	* app/widgets/widgets-types.h
	* app/widgets/gimppdbdialog.[ch]
	* app/widgets/gimpdataselect.[ch]
	* app/widgets/gimpbrushselect.[ch]
	* app/widgets/gimpgradientselect.[ch]
	* app/widgets/gimppaletteselect.[ch]
	* app/widgets/gimppatternselect.[ch]
	* app/widgets/gimpfontselect.[ch]: ...and added here as a
	hierarchy of widgets.

	* app/widgets/gimpdatafactoryview.h: removed typdef
	GimpDataEditFunc, it's in widgets-types.h now.

	* app/gui/convert-dialog.c: changed accordingly.

	* app/core/gimp.[ch]: added vtable entries for creating, closing
	and setting PDB dialogs.

	* app/gui/gui-vtable.c: implement the vtable entries using the new
	widgets.

	* tools/pdbgen/pdb/brush_select.pdb
	* tools/pdbgen/pdb/font_select.pdb
	* tools/pdbgen/pdb/gradient_select.pdb
	* tools/pdbgen/pdb/palette_select.pdb
	* tools/pdbgen/pdb/pattern_select.pdb: use the new functions of
	the Gimp object to create / manage the selection dialogs. The
	generated files don't depend on GUI stuff any longer.

	* app/pdb/brush_select_cmds.c
	* app/pdb/font_select_cmds.c
	* app/pdb/gradient_select_cmds.c
	* app/pdb/palette_select_cmds.c
	* app/pdb/pattern_select_cmds.c: regenerated.
2004-07-09 19:14:59 +00:00

114 lines
3.4 KiB
C

/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpdataselect.c
* Copyright (C) 2004 Michael Natterer <mitch@gimp.org>
*
* 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.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "widgets-types.h"
#include "gimpdataselect.h"
enum
{
PROP_0,
PROP_EDIT_FUNC
};
static void gimp_data_select_class_init (GimpDataSelectClass *klass);
static void gimp_data_select_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static GimpPdbDialogClass *parent_class = NULL;
GType
gimp_data_select_get_type (void)
{
static GType dialog_type = 0;
if (! dialog_type)
{
static const GTypeInfo dialog_info =
{
sizeof (GimpDataSelectClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_data_select_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpDataSelect),
0, /* n_preallocs */
NULL, /* instance_init */
};
dialog_type = g_type_register_static (GIMP_TYPE_PDB_DIALOG,
"GimpDataSelect",
&dialog_info,
G_TYPE_FLAG_ABSTRACT);
}
return dialog_type;
}
static void
gimp_data_select_class_init (GimpDataSelectClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->set_property = gimp_data_select_set_property;
g_object_class_install_property (object_class, PROP_EDIT_FUNC,
g_param_spec_pointer ("edit-func",
NULL, NULL,
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY));
}
static void
gimp_data_select_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
GimpDataSelect *select = GIMP_DATA_SELECT (object);
switch (property_id)
{
case PROP_EDIT_FUNC:
select->edit_func = g_value_get_pointer (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}