colormap_dialog.c 3.04 KB
Newer Older
Manish Singh's avatar
Manish Singh committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
#include <colormap_dialog.p.h>

GtkType _gimp_colormap_dialog_type;
static void gimp_colormap_dialog_class_init (GimpColormapDialogClass* klass);
static void gimp_colormap_dialog_init (GimpColormapDialog* colormap_dialog);
static guint _gimp_colormap_dialog_signal_selected;
static void _gimp_colormap_dialog_demarshall_0 (GtkObject*, GtkSignalFunc, gpointer, GtkArg*);
typedef void (*_GimpColormapDialogHandler_0)(GtkObject*, gpointer);
static void _gimp_colormap_dialog_demarshall_0 (
	GtkObject* object,
	GtkSignalFunc func,
	gpointer user_data,
	GtkArg* args){
	(void)args;
	((_GimpColormapDialogHandler_0)func)(object,
	user_data);
}
#ifdef GCG_IMPL
#	include GCG_IMPL
#else
#	include "colormap_dialog.i.c"
#endif

void _gimp_colormap_dialog_init_type (void){
	static GtkTypeInfo info = {
		"GimpColormapDialog",
		sizeof (GimpColormapDialog),
		sizeof (GimpColormapDialogClass),
		(GtkClassInitFunc) gimp_colormap_dialog_class_init,
		(GtkObjectInitFunc) gimp_colormap_dialog_init,
		NULL,
		NULL,
		NULL,
	};
	if (!_gimp_colormap_dialog_type)
		_gimp_colormap_dialog_type = gtk_type_unique (GTK_TYPE_DIALOG, &info);
}

static void gimp_colormap_dialog_class_init (GimpColormapDialogClass* klass){
	GtkObjectClass* obklass = (GtkObjectClass*) klass;
	(void) obklass;
	_gimp_colormap_dialog_signal_selected =
	gtk_signal_new("selected",
		GTK_RUN_FIRST,
		obklass->type,
		GTK_SIGNAL_OFFSET (GimpColormapDialogClass, selected),
		_gimp_colormap_dialog_demarshall_0,
		GTK_TYPE_NONE,
		0);
	gtk_object_class_add_signals(obklass,
		&_gimp_colormap_dialog_signal_selected,
		1);
#ifdef COLORMAP_DIALOG_CLASS_INIT
	COLORMAP_DIALOG_CLASS_INIT (klass);
#endif
}

static void gimp_colormap_dialog_init (GimpColormapDialog* colormap_dialog){
	(void) colormap_dialog;
#ifdef COLORMAP_DIALOG_INIT
	COLORMAP_DIALOG_INIT (colormap_dialog);
#endif
}

GimpColormapDialog* gimp_colormap_dialog_create (
	GimpSet* context){
	g_assert (!context || GIMP_IS_SET(context));
#ifdef COLORMAP_DIALOG_CREATE
	return COLORMAP_DIALOG_CREATE (context);
#else
	g_error("Not implemented: Gimp.ColormapDialog.create");
#endif
}

GimpImage* gimp_colormap_dialog_image (
	const GimpColormapDialog* colormap_dialog){
	g_assert (colormap_dialog);
	g_assert (GIMP_IS_COLORMAP_DIALOG(colormap_dialog));
	return colormap_dialog->image;
}

gint gimp_colormap_dialog_col_index (
	const GimpColormapDialog* colormap_dialog){
	g_assert (colormap_dialog);
	g_assert (GIMP_IS_COLORMAP_DIALOG(colormap_dialog));
	return colormap_dialog->col_index;
}

void gimp_colormap_dialog_connect_selected (
	GimpColormapDialogHandler_selected handler,
	gpointer user_data,
	GimpColormapDialog* colormap_dialog){
	g_assert (colormap_dialog);
	g_assert (GIMP_IS_COLORMAP_DIALOG(colormap_dialog));
	gtk_signal_connect((GtkObject*)colormap_dialog,
		"selected",
		(GtkSignalFunc)handler,
		user_data);
}

void gimp_colormap_dialog_selected (
	GimpColormapDialog* colormap_dialog){
	g_assert (colormap_dialog);
	g_assert (GIMP_IS_COLORMAP_DIALOG(colormap_dialog));
	{
	gtk_signal_emitv((GtkObject*)colormap_dialog, _gimp_colormap_dialog_signal_selected, NULL);
	}
}