Commit 2353c5d3 authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

fix compiler warning.

2001-08-10  Michael Natterer  <mitch@convergence.de>

	* app/nav_window.c: fix compiler warning.

	* app/core/gimp.[ch]: added gimp->documents which will be an MRU
	list of GimpImagefile objects.

	* app/core/gimpcontainer.c: added some g_return_if_fail().

	* app/gui/palette-editor.c: use GtkImage instead of GtkPixmap,
	s/gtk_signal_*/g_signal_*/.

	* app/widgets/gimppreview.c: render the checkerboard only for
	channel == -1. In particular, don't render it for channel
	previews.

	* app/module_db.c
	* app/core/*.c
	* app/gui/colormap-dialog.c
	* app/tools/gimpairbrushtool.c
	* app/tools/gimpdodgeburntool.c
	* app/tools/gimpeditselectiontool.c
	* app/tools/gimperasertool.c
	* app/tools/gimppaintbrushtool.c
	* app/tools/gimppenciltool.c
	* app/tools/gimpsmudgetool.c
	* app/tools/tool_manager.c
	* app/widgets/*.c
	* libgimpwidgets/*.c: s/gtk_type_new/g_object_new/
parent 45785431
2001-08-10 Michael Natterer <mitch@convergence.de>
* app/nav_window.c: fix compiler warning.
* app/core/gimp.[ch]: added gimp->documents which will be an MRU
list of GimpImagefile objects.
* app/core/gimpcontainer.c: added some g_return_if_fail().
* app/gui/palette-editor.c: use GtkImage instead of GtkPixmap,
s/gtk_signal_*/g_signal_*/.
* app/widgets/gimppreview.c: render the checkerboard only for
channel == -1. In particular, don't render it for channel
previews.
* app/module_db.c
* app/core/*.c
* app/gui/colormap-dialog.c
* app/tools/gimpairbrushtool.c
* app/tools/gimpdodgeburntool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimperasertool.c
* app/tools/gimppaintbrushtool.c
* app/tools/gimppenciltool.c
* app/tools/gimpsmudgetool.c
* app/tools/tool_manager.c
* app/widgets/*.c
* libgimpwidgets/*.c: s/gtk_type_new/g_object_new/
2001-08-09 Michael Natterer <mitch@gimp.org>
* app/appenums.h: removed GIMP_ZOOM_TYPE,
......
......@@ -41,6 +41,7 @@
#include "gimpgradient.h"
#include "gimpimage.h"
#include "gimpimage-new.h"
#include "gimpimagefile.h"
#include "gimplist.h"
#include "gimppalette.h"
#include "gimppattern.h"
......@@ -148,6 +149,11 @@ gimp_init (Gimp *gimp)
gtk_object_ref (GTK_OBJECT (gimp->tool_info_list));
gtk_object_sink (GTK_OBJECT (gimp->tool_info_list));
gimp->documents = gimp_list_new (GIMP_TYPE_IMAGEFILE,
GIMP_CONTAINER_POLICY_STRONG);
gtk_object_ref (GTK_OBJECT (gimp->documents));
gtk_object_sink (GTK_OBJECT (gimp->documents));
gimp->image_base_type_names = NULL;
gimp->fill_type_names = NULL;
gimp->have_current_cut_buffer = FALSE;
......@@ -179,6 +185,12 @@ gimp_destroy (GtkObject *object)
gimp_image_new_exit (gimp);
if (gimp->documents)
{
g_object_unref (G_OBJECT (gimp->documents));
gimp->documents = NULL;
}
if (gimp->tool_info_list)
{
g_object_unref (G_OBJECT (gimp->tool_info_list));
......@@ -263,7 +275,7 @@ gimp_new (void)
g_type_class_ref (GIMP_TYPE_CONTAINER);
g_type_class_ref (GIMP_TYPE_IMAGE);
gimp = gtk_type_new (GIMP_TYPE_GIMP);
gimp = g_object_new (GIMP_TYPE_GIMP, NULL);
return gimp;
}
......
......@@ -76,6 +76,9 @@ struct _Gimp
GimpContainer *tool_info_list;
/* the opened and saved images in MRU order */
GimpContainer *documents;
/* image_new values */
GList *image_base_type_names;
GList *fill_type_names;
......
......@@ -475,7 +475,7 @@ gimp_brush_load_brush (gint fd,
switch (header.bytes)
{
case 1:
brush = GIMP_BRUSH (gtk_type_new (GIMP_TYPE_BRUSH));
brush = GIMP_BRUSH (g_object_new (GIMP_TYPE_BRUSH, NULL));
brush->mask = temp_buf_new (header.width, header.height, 1,
0, 0, NULL);
if (read (fd,
......@@ -491,7 +491,7 @@ gimp_brush_load_brush (gint fd,
break;
case 4:
brush = GIMP_BRUSH (gtk_type_new (GIMP_TYPE_BRUSH));
brush = GIMP_BRUSH (g_object_new (GIMP_TYPE_BRUSH, NULL));
brush->mask = temp_buf_new (header.width, header.height, 1, 0, 0, NULL);
brush->pixmap = temp_buf_new (header.width, header.height, 3, 0, 0, NULL);
......
......@@ -475,7 +475,7 @@ gimp_brush_load_brush (gint fd,
switch (header.bytes)
{
case 1:
brush = GIMP_BRUSH (gtk_type_new (GIMP_TYPE_BRUSH));
brush = GIMP_BRUSH (g_object_new (GIMP_TYPE_BRUSH, NULL));
brush->mask = temp_buf_new (header.width, header.height, 1,
0, 0, NULL);
if (read (fd,
......@@ -491,7 +491,7 @@ gimp_brush_load_brush (gint fd,
break;
case 4:
brush = GIMP_BRUSH (gtk_type_new (GIMP_TYPE_BRUSH));
brush = GIMP_BRUSH (g_object_new (GIMP_TYPE_BRUSH, NULL));
brush->mask = temp_buf_new (header.width, header.height, 1, 0, 0, NULL);
brush->pixmap = temp_buf_new (header.width, header.height, 3, 0, 0, NULL);
......
......@@ -339,7 +339,7 @@ gimp_brush_generated_new (gfloat radius,
GimpBrushGenerated *brush;
/* set up normal brush data */
brush = GIMP_BRUSH_GENERATED (gtk_type_new (GIMP_TYPE_BRUSH_GENERATED));
brush = GIMP_BRUSH_GENERATED (g_object_new (GIMP_TYPE_BRUSH_GENERATED, NULL));
gimp_object_set_name (GIMP_OBJECT (brush), "Untitled");
......@@ -381,7 +381,7 @@ gimp_brush_generated_load (const gchar *filename)
g_return_val_if_fail (version < 2.0, NULL);
/* create new brush */
brush = GIMP_BRUSH_GENERATED (gtk_type_new (GIMP_TYPE_BRUSH_GENERATED));
brush = GIMP_BRUSH_GENERATED (g_object_new (GIMP_TYPE_BRUSH_GENERATED, NULL));
gimp_data_set_filename (GIMP_DATA (brush), filename);
......
......@@ -339,7 +339,7 @@ gimp_brush_generated_new (gfloat radius,
GimpBrushGenerated *brush;
/* set up normal brush data */
brush = GIMP_BRUSH_GENERATED (gtk_type_new (GIMP_TYPE_BRUSH_GENERATED));
brush = GIMP_BRUSH_GENERATED (g_object_new (GIMP_TYPE_BRUSH_GENERATED, NULL));
gimp_object_set_name (GIMP_OBJECT (brush), "Untitled");
......@@ -381,7 +381,7 @@ gimp_brush_generated_load (const gchar *filename)
g_return_val_if_fail (version < 2.0, NULL);
/* create new brush */
brush = GIMP_BRUSH_GENERATED (gtk_type_new (GIMP_TYPE_BRUSH_GENERATED));
brush = GIMP_BRUSH_GENERATED (g_object_new (GIMP_TYPE_BRUSH_GENERATED, NULL));
gimp_data_set_filename (GIMP_DATA (brush), filename);
......
......@@ -339,7 +339,7 @@ gimp_brush_generated_new (gfloat radius,
GimpBrushGenerated *brush;
/* set up normal brush data */
brush = GIMP_BRUSH_GENERATED (gtk_type_new (GIMP_TYPE_BRUSH_GENERATED));
brush = GIMP_BRUSH_GENERATED (g_object_new (GIMP_TYPE_BRUSH_GENERATED, NULL));
gimp_object_set_name (GIMP_OBJECT (brush), "Untitled");
......@@ -381,7 +381,7 @@ gimp_brush_generated_load (const gchar *filename)
g_return_val_if_fail (version < 2.0, NULL);
/* create new brush */
brush = GIMP_BRUSH_GENERATED (gtk_type_new (GIMP_TYPE_BRUSH_GENERATED));
brush = GIMP_BRUSH_GENERATED (g_object_new (GIMP_TYPE_BRUSH_GENERATED, NULL));
gimp_data_set_filename (GIMP_DATA (brush), filename);
......
......@@ -266,7 +266,7 @@ gimp_brush_pipe_load (const gchar *filename)
if (buffer->len > 0 && buffer->len < 1024)
{
pipe = GIMP_BRUSH_PIPE (gtk_type_new (GIMP_TYPE_BRUSH_PIPE));
pipe = GIMP_BRUSH_PIPE (g_object_new (GIMP_TYPE_BRUSH_PIPE, NULL));
gimp_object_set_name (GIMP_OBJECT (pipe), buffer->str);
}
g_string_free (buffer, TRUE);
......
......@@ -266,7 +266,7 @@ gimp_brush_pipe_load (const gchar *filename)
if (buffer->len > 0 && buffer->len < 1024)
{
pipe = GIMP_BRUSH_PIPE (gtk_type_new (GIMP_TYPE_BRUSH_PIPE));
pipe = GIMP_BRUSH_PIPE (g_object_new (GIMP_TYPE_BRUSH_PIPE, NULL));
gimp_object_set_name (GIMP_OBJECT (pipe), buffer->str);
}
g_string_free (buffer, TRUE);
......
......@@ -170,7 +170,7 @@ gimp_buffer_new (TileManager *tiles,
width = tile_manager_width (tiles);
height = tile_manager_height (tiles);
buffer = GIMP_BUFFER (gtk_type_new (GIMP_TYPE_BUFFER));
buffer = GIMP_BUFFER (g_object_new (GIMP_TYPE_BUFFER, NULL));
gimp_object_set_name (GIMP_OBJECT (buffer), name);
......
......@@ -157,7 +157,7 @@ gimp_channel_new (GimpImage *gimage,
g_return_val_if_fail (color != NULL, NULL);
channel = gtk_type_new (GIMP_TYPE_CHANNEL);
channel = g_object_new (GIMP_TYPE_CHANNEL, NULL);
gimp_drawable_configure (GIMP_DRAWABLE (channel),
gimage, width, height, GRAY_GIMAGE, name);
......
......@@ -157,7 +157,7 @@ gimp_channel_new (GimpImage *gimage,
g_return_val_if_fail (color != NULL, NULL);
channel = gtk_type_new (GIMP_TYPE_CHANNEL);
channel = g_object_new (GIMP_TYPE_CHANNEL, NULL);
gimp_drawable_configure (GIMP_DRAWABLE (channel),
gimage, width, height, GRAY_GIMAGE, name);
......
......@@ -260,18 +260,24 @@ gimp_container_child_destroy_callback (GtkObject *object,
GType
gimp_container_children_type (const GimpContainer *container)
{
g_return_val_if_fail (GIMP_IS_CONTAINER (container), G_TYPE_NONE);
return container->children_type;
}
GimpContainerPolicy
gimp_container_policy (const GimpContainer *container)
{
g_return_val_if_fail (GIMP_IS_CONTAINER (container), 0);
return container->policy;
}
gint
gimp_container_num_children (const GimpContainer *container)
{
g_return_val_if_fail (GIMP_IS_CONTAINER (container), 0);
return container->num_children;
}
......
......@@ -762,12 +762,11 @@ gimp_context_new (Gimp *gimp,
{
GimpContext *context;
g_return_val_if_fail (gimp != NULL, NULL);
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (name != NULL, NULL);
g_return_val_if_fail (!template || GIMP_IS_CONTEXT (template), NULL);
g_return_val_if_fail (! template || GIMP_IS_CONTEXT (template), NULL);
context = gtk_type_new (GIMP_TYPE_CONTEXT);
context = g_object_new (GIMP_TYPE_CONTEXT, NULL);
context->gimp = gimp;
......
......@@ -126,7 +126,7 @@ gimp_data_factory_new (GtkType data_type,
g_return_val_if_fail (loader_entries != NULL, NULL);
g_return_val_if_fail (n_loader_entries > 0, NULL);
factory = gtk_type_new (GIMP_TYPE_DATA_FACTORY);
factory = g_object_new (GIMP_TYPE_DATA_FACTORY, NULL);
factory->container = gimp_data_list_new (data_type);
......
......@@ -138,7 +138,7 @@ gimp_data_list_new (GType children_type)
g_return_val_if_fail (g_type_is_a (children_type, GIMP_TYPE_DATA), NULL);
list = GIMP_DATA_LIST (gtk_type_new (GIMP_TYPE_DATA_LIST));
list = GIMP_DATA_LIST (g_object_new (GIMP_TYPE_DATA_LIST, NULL));
GIMP_CONTAINER (list)->children_type = children_type;
GIMP_CONTAINER (list)->policy = GIMP_CONTAINER_POLICY_STRONG;
......
......@@ -219,7 +219,7 @@ gimp_gradient_duplicate (GimpData *data)
GimpGradient *gradient;
GimpGradientSegment *head, *prev, *cur, *orig;
gradient = GIMP_GRADIENT (gtk_type_new (GIMP_TYPE_GRADIENT));
gradient = GIMP_GRADIENT (g_object_new (GIMP_TYPE_GRADIENT, NULL));
gimp_data_dirty (GIMP_DATA (gradient));
......@@ -257,7 +257,7 @@ gimp_gradient_new (const gchar *name)
g_return_val_if_fail (name != NULL, NULL);
gradient = GIMP_GRADIENT (gtk_type_new (GIMP_TYPE_GRADIENT));
gradient = GIMP_GRADIENT (g_object_new (GIMP_TYPE_GRADIENT, NULL));
gimp_object_set_name (GIMP_OBJECT (gradient), name);
......@@ -307,7 +307,7 @@ gimp_gradient_load (const gchar *filename)
return NULL;
}
gradient = GIMP_GRADIENT (gtk_type_new (GIMP_TYPE_GRADIENT));
gradient = GIMP_GRADIENT (g_object_new (GIMP_TYPE_GRADIENT, NULL));
gimp_data_set_filename (GIMP_DATA (gradient), filename);
......
......@@ -608,7 +608,7 @@ gimp_image_new (Gimp *gimp,
g_return_val_if_fail (gimp != NULL, NULL);
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
gimage = GIMP_IMAGE (gtk_type_new (GIMP_TYPE_IMAGE));
gimage = GIMP_IMAGE (g_object_new (GIMP_TYPE_IMAGE, NULL));
gimage->gimp = gimp;
gimage->ID = gimp->next_image_ID++;
......
......@@ -608,7 +608,7 @@ gimp_image_new (Gimp *gimp,
g_return_val_if_fail (gimp != NULL, NULL);
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
gimage = GIMP_IMAGE (gtk_type_new (GIMP_TYPE_IMAGE));
gimage = GIMP_IMAGE (g_object_new (GIMP_TYPE_IMAGE, NULL));
gimage->gimp = gimp;
gimage->ID = gimp->next_image_ID++;
......
......@@ -608,7 +608,7 @@ gimp_image_new (Gimp *gimp,
g_return_val_if_fail (gimp != NULL, NULL);
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
gimage = GIMP_IMAGE (gtk_type_new (GIMP_TYPE_IMAGE));
gimage = GIMP_IMAGE (g_object_new (GIMP_TYPE_IMAGE, NULL));
gimage->gimp = gimp;
gimage->ID = gimp->next_image_ID++;
......
......@@ -608,7 +608,7 @@ gimp_image_new (Gimp *gimp,
g_return_val_if_fail (gimp != NULL, NULL);
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
gimage = GIMP_IMAGE (gtk_type_new (GIMP_TYPE_IMAGE));
gimage = GIMP_IMAGE (g_object_new (GIMP_TYPE_IMAGE, NULL));
gimage->gimp = gimp;
gimage->ID = gimp->next_image_ID++;
......
......@@ -608,7 +608,7 @@ gimp_image_new (Gimp *gimp,
g_return_val_if_fail (gimp != NULL, NULL);
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
gimage = GIMP_IMAGE (gtk_type_new (GIMP_TYPE_IMAGE));
gimage = GIMP_IMAGE (g_object_new (GIMP_TYPE_IMAGE, NULL));
gimage->gimp = gimp;
gimage->ID = gimp->next_image_ID++;
......
......@@ -608,7 +608,7 @@ gimp_image_new (Gimp *gimp,
g_return_val_if_fail (gimp != NULL, NULL);
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
gimage = GIMP_IMAGE (gtk_type_new (GIMP_TYPE_IMAGE));
gimage = GIMP_IMAGE (g_object_new (GIMP_TYPE_IMAGE, NULL));
gimage->gimp = gimp;
gimage->ID = gimp->next_image_ID++;
......
......@@ -260,7 +260,7 @@ gimp_layer_new (GimpImage *gimage,
return NULL;
}
layer = gtk_type_new (GIMP_TYPE_LAYER);
layer = g_object_new (GIMP_TYPE_LAYER, NULL);
gimp_drawable_configure (GIMP_DRAWABLE (layer),
gimage, width, height, type, name);
......
......@@ -153,7 +153,7 @@ gimp_layer_mask_new (GimpImage *gimage,
{
GimpLayerMask *layer_mask;
layer_mask = gtk_type_new (GIMP_TYPE_LAYER_MASK);
layer_mask = g_object_new (GIMP_TYPE_LAYER_MASK, NULL);
gimp_drawable_configure (GIMP_DRAWABLE (layer_mask),
gimage, width, height, GRAY_GIMAGE, name);
......
......@@ -190,7 +190,7 @@ gimp_list_foreach (GimpContainer *container,
}
GimpContainer *
gimp_list_new (GtkType children_type,
gimp_list_new (GType children_type,
GimpContainerPolicy policy)
{
GimpList *list;
......@@ -199,7 +199,7 @@ gimp_list_new (GtkType children_type,
g_return_val_if_fail (policy == GIMP_CONTAINER_POLICY_STRONG ||
policy == GIMP_CONTAINER_POLICY_WEAK, NULL);
list = gtk_type_new (GIMP_TYPE_LIST);
list = g_object_new (GIMP_TYPE_LIST, NULL);
GIMP_CONTAINER (list)->children_type = children_type;
GIMP_CONTAINER (list)->policy = policy;
......
......@@ -31,6 +31,7 @@
#define GIMP_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LIST, GimpListClass))
#define GIMP_IS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_LIST))
#define GIMP_IS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_LIST))
#define GIMP_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_LIST, GimpListClass))
typedef struct _GimpListClass GimpListClass;
......@@ -48,8 +49,9 @@ struct _GimpListClass
};
GtkType gimp_list_get_type (void);
GimpContainer * gimp_list_new (GtkType children_type,
GType gimp_list_get_type (void);
GimpContainer * gimp_list_new (GType children_type,
GimpContainerPolicy policy);
......
......@@ -227,7 +227,7 @@ gimp_palette_get_standard (void)
if (! standard_palette)
{
standard_palette = GIMP_PALETTE (gtk_type_new (GIMP_TYPE_PALETTE));
standard_palette = GIMP_PALETTE (g_object_new (GIMP_TYPE_PALETTE, NULL));
gimp_object_set_name (GIMP_OBJECT (standard_palette), "Standard");
}
......@@ -280,7 +280,7 @@ gimp_palette_load (const gchar *filename)
return NULL;
}
palette = gtk_type_new (GIMP_TYPE_PALETTE);
palette = g_object_new (GIMP_TYPE_PALETTE, NULL);
gimp_data_set_filename (GIMP_DATA (palette), filename);
......
......@@ -227,7 +227,7 @@ gimp_palette_get_standard (void)
if (! standard_palette)
{
standard_palette = GIMP_PALETTE (gtk_type_new (GIMP_TYPE_PALETTE));
standard_palette = GIMP_PALETTE (g_object_new (GIMP_TYPE_PALETTE, NULL));
gimp_object_set_name (GIMP_OBJECT (standard_palette), "Standard");
}
......@@ -280,7 +280,7 @@ gimp_palette_load (const gchar *filename)
return NULL;
}
palette = gtk_type_new (GIMP_TYPE_PALETTE);
palette = g_object_new (GIMP_TYPE_PALETTE, NULL);
gimp_data_set_filename (GIMP_DATA (palette), filename);
......
......@@ -227,7 +227,7 @@ gimp_palette_get_standard (void)
if (! standard_palette)
{
standard_palette = GIMP_PALETTE (gtk_type_new (GIMP_TYPE_PALETTE));
standard_palette = GIMP_PALETTE (g_object_new (GIMP_TYPE_PALETTE, NULL));
gimp_object_set_name (GIMP_OBJECT (standard_palette), "Standard");
}
......@@ -280,7 +280,7 @@ gimp_palette_load (const gchar *filename)
return NULL;
}
palette = gtk_type_new (GIMP_TYPE_PALETTE);
palette = g_object_new (GIMP_TYPE_PALETTE, NULL);
gimp_data_set_filename (GIMP_DATA (palette), filename);
......
......@@ -117,7 +117,7 @@ gimp_parasite_list_new (void)
{
GimpParasiteList *list;
list = gtk_type_new (GIMP_TYPE_PARASITE_LIST);
list = g_object_new (GIMP_TYPE_PARASITE_LIST, NULL);
return list;
}
......
......@@ -178,7 +178,7 @@ gimp_pattern_duplicate (GimpData *data)
{
GimpPattern *pattern;
pattern = GIMP_PATTERN (gtk_type_new (GIMP_TYPE_PATTERN));
pattern = GIMP_PATTERN (g_object_new (GIMP_TYPE_PATTERN, NULL));
pattern->mask = temp_buf_copy (GIMP_PATTERN (data)->mask, NULL);
......@@ -198,7 +198,7 @@ gimp_pattern_new (const gchar *name)
g_return_val_if_fail (name != NULL, NULL);
pattern = GIMP_PATTERN (gtk_type_new (GIMP_TYPE_PATTERN));
pattern = GIMP_PATTERN (g_object_new (GIMP_TYPE_PATTERN, NULL));
gimp_object_set_name (GIMP_OBJECT (pattern), name);
......@@ -230,7 +230,7 @@ gimp_pattern_get_standard (void)
guchar *data;
gint row, col;
standard_pattern = GIMP_PATTERN (gtk_type_new (GIMP_TYPE_PATTERN));
standard_pattern = GIMP_PATTERN (g_object_new (GIMP_TYPE_PATTERN, NULL));
gimp_object_set_name (GIMP_OBJECT (standard_pattern), "Standard");
......@@ -316,7 +316,8 @@ gimp_pattern_load (const gchar *filename)
name = g_strdup (_("Unnamed"));
}
pattern = GIMP_PATTERN (gtk_type_new (GIMP_TYPE_PATTERN));
pattern = GIMP_PATTERN (g_object_new (GIMP_TYPE_PATTERN, NULL));
pattern->mask = temp_buf_new (header.width, header.height, header.bytes,
0, 0, NULL);
if (read (fd, temp_buf_data (pattern->mask),
......
......@@ -178,7 +178,7 @@ gimp_pattern_duplicate (GimpData *data)
{
GimpPattern *pattern;
pattern = GIMP_PATTERN (gtk_type_new (GIMP_TYPE_PATTERN));
pattern = GIMP_PATTERN (g_object_new (GIMP_TYPE_PATTERN, NULL));
pattern->mask = temp_buf_copy (GIMP_PATTERN (data)->mask, NULL);
......@@ -198,7 +198,7 @@ gimp_pattern_new (const gchar *name)
g_return_val_if_fail (name != NULL, NULL);
pattern = GIMP_PATTERN (gtk_type_new (GIMP_TYPE_PATTERN));
pattern = GIMP_PATTERN (g_object_new (GIMP_TYPE_PATTERN, NULL));
gimp_object_set_name (GIMP_OBJECT (pattern), name);
......@@ -230,7 +230,7 @@ gimp_pattern_get_standard (void)
guchar *data;
gint row, col;
standard_pattern = GIMP_PATTERN (gtk_type_new (GIMP_TYPE_PATTERN));
standard_pattern = GIMP_PATTERN (g_object_new (GIMP_TYPE_PATTERN, NULL));
gimp_object_set_name (GIMP_OBJECT (standard_pattern), "Standard");
......@@ -316,7 +316,8 @@ gimp_pattern_load (const gchar *filename)
name = g_strdup (_("Unnamed"));
}
pattern = GIMP_PATTERN (gtk_type_new (GIMP_TYPE_PATTERN));
pattern = GIMP_PATTERN (g_object_new (GIMP_TYPE_PATTERN, NULL));
pattern->mask = temp_buf_new (header.width, header.height, header.bytes,
0, 0, NULL);
if (read (fd, temp_buf_data (pattern->mask),
......
......@@ -608,7 +608,7 @@ gimp_image_new (Gimp *gimp,
g_return_val_if_fail (gimp != NULL, NULL);
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
gimage = GIMP_IMAGE (gtk_type_new (GIMP_TYPE_IMAGE));
gimage = GIMP_IMAGE (g_object_new (GIMP_TYPE_IMAGE, NULL));
gimage->gimp = gimp;
gimage->ID = gimp->next_image_ID++;
......
......@@ -234,7 +234,7 @@ gimp_tool_info_new (GimpContext *context,
g_return_val_if_fail (stock_id != NULL, NULL);
g_return_val_if_fail (GDK_IS_PIXBUF (stock_pixbuf), NULL);
tool_info = gtk_type_new (GIMP_TYPE_TOOL_INFO);
tool_info = g_object_new (GIMP_TYPE_TOOL_INFO, NULL);
gimp_object_set_name (GIMP_OBJECT (tool_info), identifier);
......
......@@ -503,7 +503,7 @@ module_info_modified (ModuleInfo *mod)
static ModuleInfo *
module_info_new (void)
{
return MODULE_INFO (gtk_type_new (module_info_get_type ()));
return MODULE_INFO (g_object_new (module_info_get_type (), NULL));
}
static void
......
......@@ -191,7 +191,7 @@ nav_dialog_scroll (GimpNavigationPreview *nav_preview,
GdkScrollDirection direction,
NavigationDialog *nav_dialog)
{
GtkAdjustment *adj;
GtkAdjustment *adj = NULL;
gdouble value;
g_print ("nav_dialog_scroll(%d)\n", direction);
......@@ -209,6 +209,8 @@ nav_dialog_scroll (GimpNavigationPreview *nav_preview,
break;
}
g_assert (adj != NULL);
value = adj->value;
switch (direction)
......
......@@ -191,7 +191,7 @@ nav_dialog_scroll (GimpNavigationPreview *nav_preview,
GdkScrollDirection direction,
NavigationDialog *nav_dialog)
{
GtkAdjustment *adj;
GtkAdjustment *adj = NULL;
gdouble value;
g_print ("nav_dialog_scroll(%d)\n", direction);
......@@ -209,6 +209,8 @@ nav_dialog_scroll (GimpNavigationPreview *nav_preview,
break;
}
g_assert (adj != NULL);
value = adj->value;
switch (direction)
......
......@@ -206,7 +206,7 @@ gimp_colormap_dialog_new (GimpImage *gimage)
g_return_val_if_fail (! gimage || GIMP_IS_IMAGE (gimage), NULL);
ipal = gtk_type_new (GIMP_TYPE_COLORMAP_DIALOG);
ipal = g_object_new (GIMP_TYPE_COLORMAP_DIALOG, NULL);
gtk_box_set_spacing (GTK_BOX (ipal), 2);
......
......@@ -503,7 +503,7 @@ module_info_modified (ModuleInfo *mod)
static ModuleInfo *
module_info_new (void)
{
return MODULE_INFO (gtk_type_new (module_info_get_type ()));
return MODULE_INFO (g_object_new (module_info_get_type (), NULL));
}
static void
......
......@@ -47,9 +47,6 @@
#include "libgimp/gimpintl.h"
#include "pixmaps/zoom_in.xpm"
#include "pixmaps/zoom_out.xpm"
#define ENTRY_WIDTH 12
#define ENTRY_HEIGHT 10
......@@ -246,6 +243,7 @@ palette_editor_new (Gimp *gimp)
GtkWidget *eventbox;
GtkWidget *alignment;
GtkWidget *button;
GtkWidget *image;
palette_editor = g_new0 (PaletteEditor, 1);
......@@ -283,12 +281,12 @@ palette_editor_new (Gimp *gimp)
FALSE, FALSE, 0);
gtk_widget_show (palette_editor->name);
gtk_signal_connect (GTK_OBJECT (palette_editor->name), "activate",
GTK_SIGNAL_FUNC (palette_editor_name_activate),
palette_editor);
gtk_signal_connect (GTK_OBJECT (palette_editor->name), "focus_out_event",
GTK_SIGNAL_FUNC (palette_editor_name_focus_out),
palette_editor);
g_signal_connect (G_OBJECT (palette_editor->name), "activate",
G_CALLBACK (palette_editor_name_activate),
palette_editor);
g_signal_connect (G_OBJECT (palette_editor->name), "focus_out_event",
G_CALLBACK (palette_editor_name_focus_out),
palette_editor);
palette_editor->scrolled_window = scrolledwindow =
gtk_scrolled_window_new (NULL, NULL);
......@@ -304,9 +302,9 @@ palette_editor_new (Gimp *gimp)
eventbox);