Commit e2daae31 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

an evil temp_hack which lets GimpContext managing the active display

2001-08-14  Michael Natterer  <mitch@gimp.org>

	* app/gdisplay.h: an evil temp_hack which lets GimpContext managing
	the active display withoug including "gdisplay.h". Will go away as
	soon ad context properties are registered dynamically.

	* app/module_db.c: cleaned up the object code in preparation of
	moving it to core/.

	* app/path.c: connect to GimpImage's

	* app/core/gimpobject.[ch]: derive it from GObject, not from
	GtkObject any more (yeah :-)

	* app/core/*.c: #include <glib-object.h> instead of <gtk/gtk.h>,
	removed some remaining GtkObject-isms.

	(left in a few #include <gtk/gtk.h> where bigger changes are needed
	to get rid of the UI dependency).

	* app/core/core-types.h: #include <gdk-pixbuf/gdk-pixbuf.h> here
	temporarily.

	* app/core/gimp.c (gimp_create_display): unref the image after
	creating it's first display.

	* app/core/gimpbrush.[ch]: disabled the parts of the code which
	depend on GimpPaintTool.

	* app/core/gimpbrushgenerated.c
	* app/core/gimpbrushpipe.c: changed accordingly.

	* app/core/gimpcontext.[ch]: evil hack (see above) to manage the
	active display without including "gdisplay.h"

	* app/core/gimpimage-mask.[ch]: pass a context to
	gimage_mask_stroke() and get the current tool's PDB string from
	there.

	* app/core/gimpedit.c: changed accordingly.

	* app/core/gimpimage.c: use gimp_image_update() instead of
	gdisplays_update_full().

	* app/gui/color-area.c
	* app/gui/colormap-dialog.c
	* app/gui/dialogs-constructors.c
	* app/gui/edit-commands.c
	* app/gui/image-commands.c
	* app/gui/toolbox.c: changed accordingly (don't use Gtk methods on
	GObjects).

	* app/gui/menus.c: fix some const warnings by explicit casting.

	* app/tools/*.[ch]: ported all tools to GObject, some minor
	cleanup while i was on it.

	* app/widgets/gimpdialogfactory.[ch]: ported to GObject.

	* app/widgets/gimplayerlistview.h: added FOO_GET_CLASS() macro.

	* tools/pdbgen/app.pl: added a "widgets_eek" hack like "tools_eek"
	which inserts #include "widgets/widgets-types.h" before ordinary
	includes.

	* tools/pdbgen/pdb/brush_select.pdb
	* tools/pdbgen/pdb/edit.pdb
	* app/pdb/brush_select_cmds.c
	* app/pdb/edit_cmds.c: changed according to the stuff above.
parent 84043719
2001-08-14 Michael Natterer <mitch@gimp.org>
* app/gdisplay.h: an evil temp_hack which lets GimpContext managing
the active display withoug including "gdisplay.h". Will go away as
soon ad context properties are registered dynamically.
* app/module_db.c: cleaned up the object code in preparation of
moving it to core/.
* app/path.c: connect to GimpImage's
* app/core/gimpobject.[ch]: derive it from GObject, not from
GtkObject any more (yeah :-)
* app/core/*.c: #include <glib-object.h> instead of <gtk/gtk.h>,
removed some remaining GtkObject-isms.
(left in a few #include <gtk/gtk.h> where bigger changes are needed
to get rid of the UI dependency).
* app/core/core-types.h: #include <gdk-pixbuf/gdk-pixbuf.h> here
temporarily.
* app/core/gimp.c (gimp_create_display): unref the image after
creating it's first display.
* app/core/gimpbrush.[ch]: disabled the parts of the code which
depend on GimpPaintTool.
* app/core/gimpbrushgenerated.c
* app/core/gimpbrushpipe.c: changed accordingly.
* app/core/gimpcontext.[ch]: evil hack (see above) to manage the
active display without including "gdisplay.h"
* app/core/gimpimage-mask.[ch]: pass a context to
gimage_mask_stroke() and get the current tool's PDB string from
there.
* app/core/gimpedit.c: changed accordingly.
* app/core/gimpimage.c: use gimp_image_update() instead of
gdisplays_update_full().
* app/gui/color-area.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-constructors.c
* app/gui/edit-commands.c
* app/gui/image-commands.c
* app/gui/toolbox.c: changed accordingly (don't use Gtk methods on
GObjects).
* app/gui/menus.c: fix some const warnings by explicit casting.
* app/tools/*.[ch]: ported all tools to GObject, some minor
cleanup while i was on it.
* app/widgets/gimpdialogfactory.[ch]: ported to GObject.
* app/widgets/gimplayerlistview.h: added FOO_GET_CLASS() macro.
* tools/pdbgen/app.pl: added a "widgets_eek" hack like "tools_eek"
which inserts #include "widgets/widgets-types.h" before ordinary
includes.
* tools/pdbgen/pdb/brush_select.pdb
* tools/pdbgen/pdb/edit.pdb
* app/pdb/brush_select_cmds.c
* app/pdb/edit_cmds.c: changed according to the stuff above.
2001-08-14 Sven Neumann <sven@gimp.org>
* app/tools/gimptexttool.c: take image resolution and choosen unit
......
......@@ -265,7 +265,8 @@ edit_stroke_cmd_callback (GtkWidget *widget,
return_if_no_display (gdisp);
gimage_mask_stroke (gdisp->gimage,
gimp_image_active_drawable (gdisp->gimage));
gimp_image_active_drawable (gdisp->gimage),
gimp_get_current_context (gdisp->gimage->gimp));
gdisplays_flush ();
}
......
......@@ -24,6 +24,7 @@
#include "core/core-types.h"
#include "core/gimp.h"
#include "core/gimpdrawable.h"
#include "core/gimpdrawable-desaturate.h"
#include "core/gimpdrawable-equalize.h"
......@@ -257,10 +258,14 @@ void
image_duplicate_cmd_callback (GtkWidget *widget,
gpointer data)
{
GDisplay *gdisp;
GDisplay *gdisp;
GimpImage *gimage;
return_if_no_display (gdisp);
gdisplay_new (gimp_image_duplicate (gdisp->gimage), 0x0101);
gimage = gimp_image_duplicate (gdisp->gimage);
gimp_create_display (gimage->gimp, gimage);
}
......
......@@ -56,8 +56,6 @@
static void gimp_color_balance_tool_class_init (GimpColorBalanceToolClass *klass);
static void gimp_color_balance_tool_init (GimpColorBalanceTool *bc_tool);
static void gimp_color_balance_tool_destroy (GtkObject *object);
static void gimp_color_balance_tool_initialize (GimpTool *tool,
GDisplay *gdisp);
static void gimp_color_balance_tool_control (GimpTool *tool,
......@@ -114,26 +112,29 @@ gimp_color_balance_tool_register (Gimp *gimp)
GIMP_STOCK_TOOL_COLOR_BALANCE);
}
GtkType
GType
gimp_color_balance_tool_get_type (void)
{
static GtkType tool_type = 0;
static GType tool_type = 0;
if (! tool_type)
{
GtkTypeInfo tool_info =
static const GTypeInfo tool_info =
{
"GimpColorBalanceTool",
sizeof (GimpColorBalanceTool),
sizeof (GimpColorBalanceToolClass),
(GtkClassInitFunc) gimp_color_balance_tool_class_init,
(GtkObjectInitFunc) gimp_color_balance_tool_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_color_balance_tool_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpColorBalanceTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_color_balance_tool_init,
};
tool_type = gtk_type_unique (GIMP_TYPE_IMAGE_MAP_TOOL, &tool_info);
tool_type = g_type_register_static (GIMP_TYPE_IMAGE_MAP_TOOL,
"GimpColorBalanceTool",
&tool_info, 0);
}
return tool_type;
......@@ -142,15 +143,11 @@ gimp_color_balance_tool_get_type (void)
static void
gimp_color_balance_tool_class_init (GimpColorBalanceToolClass *klass)
{
GtkObjectClass *object_class;
GimpToolClass *tool_class;
object_class = (GtkObjectClass *) klass;
tool_class = (GimpToolClass *) klass;
GimpToolClass *tool_class;
parent_class = gtk_type_class (GIMP_TYPE_IMAGE_MAP_TOOL);
tool_class = GIMP_TOOL_CLASS (klass);
object_class->destroy = gimp_color_balance_tool_destroy;
parent_class = g_type_class_peek_parent (klass);
tool_class->initialize = gimp_color_balance_tool_initialize;
tool_class->control = gimp_color_balance_tool_control;
......@@ -174,15 +171,6 @@ gimp_color_balance_tool_init (GimpColorBalanceTool *bc_tool)
}
}
static void
gimp_color_balance_tool_destroy (GtkObject *object)
{
color_balance_dialog_hide ();
if (GTK_OBJECT_CLASS (parent_class)->destroy)
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
static void
gimp_color_balance_tool_initialize (GimpTool *tool,
GDisplay *gdisp)
......
......@@ -25,9 +25,11 @@
#define GIMP_TYPE_COLOR_BALANCE_TOOL (gimp_color_balance_tool_get_type ())
#define GIMP_COLOR_BALANCE_TOOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_COLOR_BALANCE_TOOL, GimpColorBalanceTool))
#define GIMP_COLOR_BALANCE_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_COLOR_BALANCE_TOOL, GimpColorBalanceToolClass))
#define GIMP_IS_COLOR_BALANCE_TOOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_COLOR_BALANCE_TOOL))
#define GIMP_COLOR_BALANCE_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_COLOR_BALANCE_TOOL, GimpColorBalanceToolClass))
#define GIMP_IS_COLOR_BALANCE_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_COLOR_BALANCE_TOOL))
#define GIMP_COLOR_BALANCE_TOOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_COLOR_BALANCE_TOOL, GimpColorBalanceToolClass))
typedef struct _GimpColorBalanceTool GimpColorBalanceTool;
......@@ -71,9 +73,9 @@ struct _ColorBalanceDialog
};
void gimp_color_balance_tool_register (Gimp *gimp);
void gimp_color_balance_tool_register (Gimp *gimp);
GtkType gimp_color_balance_tool_get_type (void);
GType gimp_color_balance_tool_get_type (void);
void color_balance_dialog_hide (void);
......
......@@ -89,8 +89,6 @@ typedef gdouble CRMatrix[4][4];
static void gimp_curves_tool_class_init (GimpCurvesToolClass *klass);
static void gimp_curves_tool_init (GimpCurvesTool *bc_tool);
static void gimp_curves_tool_destroy (GtkObject *object);
static void gimp_curves_tool_initialize (GimpTool *tool,
GDisplay *gdisp);
static void gimp_curves_tool_control (GimpTool *tool,
......@@ -210,26 +208,29 @@ gimp_curves_tool_register (Gimp *gimp)
GIMP_STOCK_TOOL_CURVES);
}
GtkType
GType
gimp_curves_tool_get_type (void)
{
static GtkType tool_type = 0;
static GType tool_type = 0;
if (! tool_type)
{
GtkTypeInfo tool_info =
static const GTypeInfo tool_info =
{
"GimpCurvesTool",
sizeof (GimpCurvesTool),
sizeof (GimpCurvesToolClass),
(GtkClassInitFunc) gimp_curves_tool_class_init,
(GtkObjectInitFunc) gimp_curves_tool_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_curves_tool_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpCurvesTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_curves_tool_init,
};
tool_type = gtk_type_unique (GIMP_TYPE_IMAGE_MAP_TOOL, &tool_info);
tool_type = g_type_register_static (GIMP_TYPE_IMAGE_MAP_TOOL,
"GimpCurvesTool",
&tool_info, 0);
}
return tool_type;
......@@ -238,15 +239,11 @@ gimp_curves_tool_get_type (void)
static void
gimp_curves_tool_class_init (GimpCurvesToolClass *klass)
{
GtkObjectClass *object_class;
GimpToolClass *tool_class;
object_class = (GtkObjectClass *) klass;
tool_class = (GimpToolClass *) klass;
GimpToolClass *tool_class;
parent_class = gtk_type_class (GIMP_TYPE_IMAGE_MAP_TOOL);
tool_class = GIMP_TOOL_CLASS (klass);
object_class->destroy = gimp_curves_tool_destroy;
parent_class = g_type_class_peek_parent (klass);
tool_class->initialize = gimp_curves_tool_initialize;
tool_class->control = gimp_curves_tool_control;
......@@ -271,15 +268,6 @@ gimp_curves_tool_init (GimpCurvesTool *bc_tool)
}
}
static void
gimp_curves_tool_destroy (GtkObject *object)
{
curves_dialog_hide ();
if (GTK_OBJECT_CLASS (parent_class)->destroy)
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
static void
gimp_curves_tool_initialize (GimpTool *tool,
GDisplay *gdisp)
......
......@@ -85,9 +85,9 @@ struct _CurvesDialog
};
void gimp_curves_tool_register (Gimp *gimp);
void gimp_curves_tool_register (Gimp *gimp);
GtkType gimp_curves_tool_get_type (void);
GType gimp_curves_tool_get_type (void);
void curves_dialog_hide (void);
......
......@@ -64,8 +64,6 @@
static void gimp_hue_saturation_tool_class_init (GimpHueSaturationToolClass *klass);
static void gimp_hue_saturation_tool_init (GimpHueSaturationTool *bc_tool);
static void gimp_hue_saturation_tool_destroy (GtkObject *object);
static void gimp_hue_saturation_tool_initialize (GimpTool *tool,
GDisplay *gdisp);
static void gimp_hue_saturation_tool_control (GimpTool *tool,
......@@ -138,26 +136,29 @@ gimp_hue_saturation_tool_register (Gimp *gimp)
GIMP_STOCK_TOOL_HUE_SATURATION);
}
GtkType
GType
gimp_hue_saturation_tool_get_type (void)
{
static GtkType tool_type = 0;
static GType tool_type = 0;
if (! tool_type)
{
GtkTypeInfo tool_info =
static const GTypeInfo tool_info =
{
"GimpHueSaturationTool",
sizeof (GimpHueSaturationTool),
sizeof (GimpHueSaturationToolClass),
(GtkClassInitFunc) gimp_hue_saturation_tool_class_init,
(GtkObjectInitFunc) gimp_hue_saturation_tool_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_hue_saturation_tool_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpHueSaturationTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_hue_saturation_tool_init,
};
tool_type = gtk_type_unique (GIMP_TYPE_IMAGE_MAP_TOOL, &tool_info);
tool_type = g_type_register_static (GIMP_TYPE_IMAGE_MAP_TOOL,
"GimpHueSaturationTool",
&tool_info, 0);
}
return tool_type;
......@@ -166,15 +167,11 @@ gimp_hue_saturation_tool_get_type (void)
static void
gimp_hue_saturation_tool_class_init (GimpHueSaturationToolClass *klass)
{
GtkObjectClass *object_class;
GimpToolClass *tool_class;
object_class = (GtkObjectClass *) klass;
tool_class = (GimpToolClass *) klass;
GimpToolClass *tool_class;
parent_class = gtk_type_class (GIMP_TYPE_IMAGE_MAP_TOOL);
tool_class = GIMP_TOOL_CLASS (klass);
object_class->destroy = gimp_hue_saturation_tool_destroy;
parent_class = g_type_class_peek_parent (klass);
tool_class->initialize = gimp_hue_saturation_tool_initialize;
tool_class->control = gimp_hue_saturation_tool_control;
......@@ -196,15 +193,6 @@ gimp_hue_saturation_tool_init (GimpHueSaturationTool *bc_tool)
}
}
static void
gimp_hue_saturation_tool_destroy (GtkObject *object)
{
hue_saturation_dialog_hide ();
if (GTK_OBJECT_CLASS (parent_class)->destroy)
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
static void
gimp_hue_saturation_tool_initialize (GimpTool *tool,
GDisplay *gdisp)
......
......@@ -37,9 +37,10 @@ typedef enum
#define GIMP_TYPE_HUE_SATURATION_TOOL (gimp_hue_saturation_tool_get_type ())
#define GIMP_HUE_SATURATION_TOOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_HUE_SATURATION_TOOL, GimpHueSaturationTool))
#define GIMP_IS_HUE_SATURATION_TOOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_HUE_SATURATION_TOOL))
#define GIMP_HUE_SATURATION_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_HUE_SATURATION_TOOL, GimpHueSaturationToolClass))
#define GIMP_IS_HUE_SATURATION_TOOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_HUE_SATURATION_TOOL))
#define GIMP_IS_HUE_SATURATION_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_HUE_SATURATION_TOOL))
#define GIMP_HUE_SATURATION_TOOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_HUE_SATURATION_TOOL, GimpHueSaturationToolClass))
typedef struct _GimpHueSaturationTool GimpHueSaturationTool;
......@@ -80,9 +81,9 @@ struct _HueSaturationDialog
};
void gimp_hue_saturation_tool_register (Gimp *gimp);
void gimp_hue_saturation_tool_register (Gimp *gimp);
GtkType gimp_hue_saturation_tool_get_type (void);
GType gimp_hue_saturation_tool_get_type (void);
void hue_saturation_free (void);
void hue_saturation_dialog_hide (void);
......
......@@ -61,8 +61,6 @@
static void gimp_threshold_tool_class_init (GimpThresholdToolClass *klass);
static void gimp_threshold_tool_init (GimpThresholdTool *threshold_tool);
static void gimp_threshold_tool_destroy (GtkObject *object);
static void gimp_threshold_tool_initialize (GimpTool *tool,
GDisplay *gdisp);
static void gimp_threshold_tool_control (GimpTool *tool,
......@@ -121,26 +119,29 @@ gimp_threshold_tool_register (Gimp *gimp)
GIMP_STOCK_TOOL_THRESHOLD);
}
GtkType
GType
gimp_threshold_tool_get_type (void)
{
static GtkType tool_type = 0;
static GType tool_type = 0;
if (! tool_type)
{
GtkTypeInfo tool_info =
static const GTypeInfo tool_info =
{
"GimpThresholdTool",
sizeof (GimpThresholdTool),
sizeof (GimpThresholdToolClass),
(GtkClassInitFunc) gimp_threshold_tool_class_init,
(GtkObjectInitFunc) gimp_threshold_tool_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_threshold_tool_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpThresholdTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_threshold_tool_init,
};
tool_type = gtk_type_unique (GIMP_TYPE_IMAGE_MAP_TOOL, &tool_info);
tool_type = g_type_register_static (GIMP_TYPE_IMAGE_MAP_TOOL,
"GimpThresholdTool",
&tool_info, 0);
}
return tool_type;
......@@ -149,15 +150,11 @@ gimp_threshold_tool_get_type (void)
static void
gimp_threshold_tool_class_init (GimpThresholdToolClass *klass)
{
GtkObjectClass *object_class;
GimpToolClass *tool_class;
object_class = (GtkObjectClass *) klass;
tool_class = (GimpToolClass *) klass;
GimpToolClass *tool_class;
parent_class = gtk_type_class (GIMP_TYPE_IMAGE_MAP_TOOL);
tool_class = GIMP_TOOL_CLASS (klass);
object_class->destroy = gimp_threshold_tool_destroy;
parent_class = g_type_class_peek_parent (klass);
tool_class->initialize = gimp_threshold_tool_initialize;
tool_class->control = gimp_threshold_tool_control;
......@@ -179,15 +176,6 @@ gimp_threshold_tool_init (GimpThresholdTool *bc_tool)
}
}
static void
gimp_threshold_tool_destroy (GtkObject *object)
{
threshold_dialog_hide ();
if (GTK_OBJECT_CLASS (parent_class)->destroy)
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
static void
gimp_threshold_tool_initialize (GimpTool *tool,
GDisplay *gdisp)
......
......@@ -25,9 +25,10 @@
#define GIMP_TYPE_THRESHOLD_TOOL (gimp_threshold_tool_get_type ())
#define GIMP_THRESHOLD_TOOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_THRESHOLD_TOOL, GimpThresholdTool))
#define GIMP_IS_THRESHOLD_TOOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_THRESHOLD_TOOL))
#define GIMP_THRESHOLD_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_THRESHOLD_TOOL, GimpThresholdToolClass))
#define GIMP_IS_THRESHOLD_TOOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_THRESHOLD_TOOL))
#define GIMP_IS_THRESHOLD_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_THRESHOLD_TOOL))
#define GIMP_THRESHOLD_TOOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_THRESHOLD_TOOL, GimpThresholdToolClass))
typedef struct _GimpThresholdTool GimpThresholdTool;
......@@ -67,9 +68,9 @@ struct _ThresholdDialog
};
void gimp_threshold_tool_register (Gimp *gimp);
void gimp_threshold_tool_register (Gimp *gimp);
GtkType gimp_threshold_tool_get_type (void);
GType gimp_threshold_tool_get_type (void);
void threshold_dialog_hide (void);
......
......@@ -20,6 +20,9 @@
#define __CORE_TYPES_H__
/* EEK */
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "apptypes.h"
......
......@@ -18,7 +18,7 @@
#include "config.h"
#include <gtk/gtk.h>
#include <glib-object.h>
#include <stdio.h>
#ifdef HAVE_UNISTD_H
......
......@@ -20,9 +20,7 @@
#include <stdlib.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include <glib-object.h>
#include "core-types.h"
......@@ -58,9 +56,7 @@ gimp_edit_cut (GimpImage *gimage,
TileManager *cropped_cut;
gboolean empty;
g_return_val_if_fail (gimage != NULL, NULL);
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
/* Start a group undo */
......@@ -115,9 +111,7 @@ gimp_edit_copy (GimpImage *gimage,
TileManager *cropped_copy;
gboolean empty;
g_return_val_if_fail (gimage != NULL, NULL);
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
/* See if the gimage mask is empty */
......@@ -168,7 +162,6 @@ gimp_edit_paste (GimpImage *gimage,
gint x1, y1, x2, y2;
gint cx, cy;
g_return_val_if_fail (gimage != NULL, NULL);
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
g_return_val_if_fail (! drawable || GIMP_IS_DRAWABLE (drawable), NULL);
......@@ -290,9 +283,7 @@ gimp_edit_clear (GimpImage *gimage,
gint x1, y1, x2, y2;
guchar col[MAX_CHANNELS];
g_return_val_if_fail (gimage != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
g_return_val_if_fail (drawable != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
gimp_image_get_background (gimage, drawable, col);
......@@ -334,9 +325,7 @@ gimp_edit_fill (GimpImage *gimage,
gint x1, y1, x2, y2;
guchar col[MAX_CHANNELS];
g_return_val_if_fail (gimage != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
g_return_val_if_fail (drawable != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
if (gimp_drawable_has_alpha (drawable))
......
......@@ -17,7 +17,7 @@
#include "config.h"
#include <gtk/gtk.h>
#include <glib-object.h>
#include <stdio.h>
#ifdef HAVE_UNISTD_H
......
......@@ -107,7 +107,7 @@ static void gimp_transform_tool_grid_recalc (GimpTransformTool *gimp_tra
static void gimp_transform_tool_init (GimpTransformTool *tool);
static void gimp_transform_tool_class_init (GimpTransformToolClass *tool);
static void gimp_transform_tool_destroy (GtkObject *object);
static void gimp_transform_tool_finalize (GObject *object);
static void gimp_transform_tool_button_press (GimpTool *tool,
GdkEventButton *bevent,
......@@ -149,19 +149,22 @@ gimp_transform_tool_get_type (void)
if (! tool_type)
{
GtkTypeInfo tool_info =
static const GTypeInfo tool_info =
{
"GimpTransformTool",
sizeof (GimpTransformTool),
sizeof (GimpTransformToolClass),
(GtkClassInitFunc) gimp_transform_tool_class_init,
(GtkObjectInitFunc) gimp_transform_tool_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
NULL /* (GtkClassInitFunc) gimp_tool_class_init, */
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_transform_tool_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpTransformTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_transform_tool_init,