Commit be1215a2 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

added -DGDK_PIXBUF_DISABLE_DEPRECATED to CPPFLAGS.

2001-12-18  Michael Natterer  <mitch@gimp.org>

	* configure.in: added -DGDK_PIXBUF_DISABLE_DEPRECATED to CPPFLAGS.

	* app/core/gimpbuffer.[ch]: gimp_buffer_get_[width|height]:
	added "const" to the GimpBuffer parameter.

	* app/core/gimpchannel.c: indentation and comment changes.

	* app/core/gimpdrawable-desaturate.c: don't include
	"paint-funcs/paint-funcs.h".

	* app/display/gimpdisplayshell.c: don't include "base/temp-buf.h".

	* app/gui/gui.c: removed the image container's "name_changed"
	handler.

	* app/gui/palette-import-dialog.[ch]: use GimpPreview and
	GimpContainerMenu instead of doing the same manually. Removed lots
	of code. Not perfect yet.

	* app/tools/gimpfuzzyselecttool.c: no need to include tile stuff.

	* app/widgets/gimpcontainerview-utils.c: better g_warning() message.

	* tools/pdbgen/pdb/paint_tools.pdb: don't include
	"base/tile-manager.h".

	* app/pdb/paint_tools_cmds.c: regenerated.

	* data/images/Makefile.am
	* data/images/gimp_logo.ppm: removed...
	* data/images/gimp_logo.png: ...and added as PNG.

	* app/gui/about-dialog.c: use gdk_pixbuf_new_from_file() to load
	the PNG logo instead of manually parsing the PPM.
parent d15b07b4
2001-12-18 Michael Natterer <mitch@gimp.org>
* configure.in: added -DGDK_PIXBUF_DISABLE_DEPRECATED to CPPFLAGS.
* app/core/gimpbuffer.[ch]: gimp_buffer_get_[width|height]:
added "const" to the GimpBuffer parameter.
* app/core/gimpchannel.c: indentation and comment changes.
* app/core/gimpdrawable-desaturate.c: don't include
"paint-funcs/paint-funcs.h".
* app/display/gimpdisplayshell.c: don't include "base/temp-buf.h".
* app/gui/gui.c: removed the image container's "name_changed"
handler.
* app/gui/palette-import-dialog.[ch]: use GimpPreview and
GimpContainerMenu instead of doing the same manually. Removed lots
of code. Not perfect yet.
* app/tools/gimpfuzzyselecttool.c: no need to include tile stuff.
* app/widgets/gimpcontainerview-utils.c: better g_warning() message.
* tools/pdbgen/pdb/paint_tools.pdb: don't include
"base/tile-manager.h".
* app/pdb/paint_tools_cmds.c: regenerated.
* data/images/Makefile.am
* data/images/gimp_logo.ppm: removed...
* data/images/gimp_logo.png: ...and added as PNG.
* app/gui/about-dialog.c: use gdk_pixbuf_new_from_file() to load
the PNG logo instead of manually parsing the PPM.
2001-12-17 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpdrawablelistview.[ch]: changed
......
......@@ -196,7 +196,7 @@ gimp_buffer_new (TileManager *tiles,
}
gint
gimp_buffer_get_width (GimpBuffer *buffer)
gimp_buffer_get_width (const GimpBuffer *buffer)
{
g_return_val_if_fail (GIMP_IS_BUFFER (buffer), 0);
......@@ -204,7 +204,7 @@ gimp_buffer_get_width (GimpBuffer *buffer)
}
gint
gimp_buffer_get_height (GimpBuffer *buffer)
gimp_buffer_get_height (const GimpBuffer *buffer)
{
g_return_val_if_fail (GIMP_IS_BUFFER (buffer), 0);
......
......@@ -52,8 +52,8 @@ GimpBuffer * gimp_buffer_new (TileManager *tiles,
const gchar *name,
gboolean copy_pixels);
gint gimp_buffer_get_width (GimpBuffer *buffer);
gint gimp_buffer_get_height (GimpBuffer *buffer);
gint gimp_buffer_get_width (const GimpBuffer *buffer);
gint gimp_buffer_get_height (const GimpBuffer *buffer);
#endif /* __GIMP_BUFFER_H__ */
......@@ -276,17 +276,22 @@ gimp_channel_scale (GimpChannel *channel,
GIMP_DRAWABLE (channel)->width,
GIMP_DRAWABLE (channel)->height);
/* Allocate the new channel */
new_tiles = tile_manager_new (new_width, new_height, 1);
/* Configure the pixel regions */
pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles,
0, 0,
GIMP_DRAWABLE (channel)->width,
GIMP_DRAWABLE (channel)->height, FALSE);
GIMP_DRAWABLE (channel)->height,
FALSE);
/* Allocate the new channel, configure dest region */
new_tiles = tile_manager_new (new_width, new_height, 1);
pixel_region_init (&destPR, new_tiles, 0, 0, new_width, new_height, TRUE);
pixel_region_init (&destPR, new_tiles,
0, 0,
new_width, new_height,
TRUE);
/* Add an alpha channel */
/* Sclae the channel */
scale_region (&srcPR, &destPR);
/* Push the channel on the undo stack */
......@@ -323,7 +328,7 @@ gimp_channel_resize (GimpChannel *channel,
g_return_if_fail (GIMP_IS_CHANNEL (channel));
if (!new_width || !new_height)
if (new_width == 0 || new_height == 0)
return;
x1 = CLAMP (offx, 0, new_width);
......@@ -379,7 +384,11 @@ gimp_channel_resize (GimpChannel *channel,
/* Set to black (empty--for selections) */
if (clear)
{
pixel_region_init (&destPR, new_tiles, 0, 0, new_width, new_height, TRUE);
pixel_region_init (&destPR, new_tiles,
0, 0,
new_width, new_height,
TRUE);
color_region (&destPR, &bg);
}
......
......@@ -276,17 +276,22 @@ gimp_channel_scale (GimpChannel *channel,
GIMP_DRAWABLE (channel)->width,
GIMP_DRAWABLE (channel)->height);
/* Allocate the new channel */
new_tiles = tile_manager_new (new_width, new_height, 1);
/* Configure the pixel regions */
pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles,
0, 0,
GIMP_DRAWABLE (channel)->width,
GIMP_DRAWABLE (channel)->height, FALSE);
GIMP_DRAWABLE (channel)->height,
FALSE);
/* Allocate the new channel, configure dest region */
new_tiles = tile_manager_new (new_width, new_height, 1);
pixel_region_init (&destPR, new_tiles, 0, 0, new_width, new_height, TRUE);
pixel_region_init (&destPR, new_tiles,
0, 0,
new_width, new_height,
TRUE);
/* Add an alpha channel */
/* Sclae the channel */
scale_region (&srcPR, &destPR);
/* Push the channel on the undo stack */
......@@ -323,7 +328,7 @@ gimp_channel_resize (GimpChannel *channel,
g_return_if_fail (GIMP_IS_CHANNEL (channel));
if (!new_width || !new_height)
if (new_width == 0 || new_height == 0)
return;
x1 = CLAMP (offx, 0, new_width);
......@@ -379,7 +384,11 @@ gimp_channel_resize (GimpChannel *channel,
/* Set to black (empty--for selections) */
if (clear)
{
pixel_region_init (&destPR, new_tiles, 0, 0, new_width, new_height, TRUE);
pixel_region_init (&destPR, new_tiles,
0, 0,
new_width, new_height,
TRUE);
color_region (&destPR, &bg);
}
......
......@@ -24,8 +24,6 @@
#include "base/pixel-region.h"
#include "paint-funcs/paint-funcs.h"
#include "gimpdrawable.h"
#include "gimpdrawable-desaturate.h"
#include "gimpimage.h"
......
......@@ -47,11 +47,11 @@
#define ANIMATION_STEPS 16
#define ANIMATION_SIZE 2
static gboolean about_dialog_load_logo (GtkWidget *window);
static void about_dialog_destroy (GtkObject *object,
gpointer data);
static void about_dialog_unmap (GtkWidget *widget,
GdkEvent *event,
gpointer data);
static gint about_dialog_logo_expose (GtkWidget *widget,
GdkEventExpose *event,
......@@ -139,7 +139,7 @@ about_dialog_create (void)
g_signal_connect (G_OBJECT (about_dialog), "destroy",
G_CALLBACK (about_dialog_destroy),
NULL);
g_signal_connect (G_OBJECT (about_dialog), "unmap_event",
g_signal_connect (G_OBJECT (about_dialog), "unmap",
G_CALLBACK (about_dialog_unmap),
NULL);
g_signal_connect (G_OBJECT (about_dialog), "button_press_event",
......@@ -304,81 +304,55 @@ about_dialog_create (void)
static gboolean
about_dialog_load_logo (GtkWidget *window)
{
GtkWidget *preview;
GdkGC *gc;
gchar buf[1024];
gchar *filename;
guchar *pixelrow;
FILE *fp;
gint count;
GdkPixbuf *pixbuf;
GdkGC *gc;
gint i, j, k;
if (logo_pixmap)
return TRUE;
filename = g_build_filename (gimp_data_directory (), "images",
"gimp_logo.ppm", NULL);
fp = fopen (filename, "rb");
g_free (filename);
"gimp_logo.png", NULL);
if (!fp)
return FALSE;
pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
fgets (buf, 1024, fp);
g_free (filename);
if (strncmp (buf, "P6", 2) != 0)
{
fclose (fp);
if (! pixbuf)
return FALSE;
}
fgets (buf, 1024, fp);
fgets (buf, 1024, fp);
sscanf (buf, "%d %d", &logo_width, &logo_height);
fgets (buf, 1024, fp);
if (strncmp (buf, "255", 3) != 0)
{
fclose (fp);
return FALSE;
}
logo_width = gdk_pixbuf_get_width (pixbuf);
logo_height = gdk_pixbuf_get_height (pixbuf);
preview = gtk_preview_new (GTK_PREVIEW_COLOR);
gtk_preview_size (GTK_PREVIEW (preview), logo_width, logo_height);
pixelrow = g_new (guchar, logo_width * 3);
gtk_widget_realize (window);
for (i = 0; i < logo_height; i++)
{
count = fread (pixelrow, sizeof (guchar), logo_width * 3, fp);
if (count != (logo_width * 3))
{
gtk_object_sink (GTK_OBJECT (preview));
g_free (pixelrow);
fclose (fp);
return FALSE;
}
logo_pixmap = gdk_pixmap_new (window->window,
logo_width, logo_height,
gtk_widget_get_visual (window)->depth);
gtk_preview_draw_row (GTK_PREVIEW (preview), pixelrow, 0, i, logo_width);
}
gtk_widget_realize (window);
logo_pixmap = gdk_pixmap_new (window->window, logo_width, logo_height,
gtk_preview_get_visual ()->depth);
gc = gdk_gc_new (logo_pixmap);
gtk_preview_put (GTK_PREVIEW (preview),
logo_pixmap, gc,
0, 0, 0, 0, logo_width, logo_height);
g_object_unref (gc);
gtk_object_sink (GTK_OBJECT (preview));
g_free (pixelrow);
gdk_pixbuf_render_to_drawable (pixbuf,
GDK_DRAWABLE (logo_pixmap),
gc,
0, 0,
0, 0,
logo_width,
logo_height,
GDK_RGB_DITHER_MAX,
0, 0);
fclose (fp);
g_object_unref (G_OBJECT (gc));
g_object_unref (G_OBJECT (pixbuf));
dissolve_width =
(logo_width / ANIMATION_SIZE) + (logo_width % ANIMATION_SIZE == 0 ? 0 : 1);
(logo_width / ANIMATION_SIZE) +
(logo_width % ANIMATION_SIZE == 0 ? 0 : 1);
dissolve_height =
(logo_height / ANIMATION_SIZE) + (logo_height % ANIMATION_SIZE == 0 ? 0 : 1);
(logo_height / ANIMATION_SIZE) +
(logo_height % ANIMATION_SIZE == 0 ? 0 : 1);
dissolve_map = g_new (guchar, dissolve_width * dissolve_height);
......@@ -396,12 +370,11 @@ about_dialog_destroy (GtkObject *object,
gpointer data)
{
about_dialog = NULL;
about_dialog_unmap (NULL, NULL, NULL);
about_dialog_unmap (NULL, NULL);
}
static void
about_dialog_unmap (GtkWidget *widget,
GdkEvent *event,
gpointer data)
{
if (timer)
......
This diff is collapsed.
......@@ -24,8 +24,4 @@ void palette_import_dialog_show (Gimp *gimp);
void palette_import_dialog_destroy (void);
/* FIXME */
void palette_import_image_renamed (GimpImage *gimage);
#endif /* __PALETTE_IMPORT_H__ */
......@@ -26,8 +26,6 @@
#include "display-types.h"
#include "base/temp-buf.h"
#include "core/gimp.h"
#include "core/gimpbuffer.h"
#include "core/gimpcontext.h"
......
......@@ -26,8 +26,6 @@
#include "display-types.h"
#include "base/temp-buf.h"
#include "core/gimp.h"
#include "core/gimpbuffer.h"
#include "core/gimpcontext.h"
......
......@@ -47,11 +47,11 @@
#define ANIMATION_STEPS 16
#define ANIMATION_SIZE 2
static gboolean about_dialog_load_logo (GtkWidget *window);
static void about_dialog_destroy (GtkObject *object,
gpointer data);
static void about_dialog_unmap (GtkWidget *widget,
GdkEvent *event,
gpointer data);
static gint about_dialog_logo_expose (GtkWidget *widget,
GdkEventExpose *event,
......@@ -139,7 +139,7 @@ about_dialog_create (void)
g_signal_connect (G_OBJECT (about_dialog), "destroy",
G_CALLBACK (about_dialog_destroy),
NULL);
g_signal_connect (G_OBJECT (about_dialog), "unmap_event",
g_signal_connect (G_OBJECT (about_dialog), "unmap",
G_CALLBACK (about_dialog_unmap),
NULL);
g_signal_connect (G_OBJECT (about_dialog), "button_press_event",
......@@ -304,81 +304,55 @@ about_dialog_create (void)
static gboolean
about_dialog_load_logo (GtkWidget *window)
{
GtkWidget *preview;
GdkGC *gc;
gchar buf[1024];
gchar *filename;
guchar *pixelrow;
FILE *fp;
gint count;
GdkPixbuf *pixbuf;
GdkGC *gc;
gint i, j, k;
if (logo_pixmap)
return TRUE;
filename = g_build_filename (gimp_data_directory (), "images",
"gimp_logo.ppm", NULL);
fp = fopen (filename, "rb");
g_free (filename);
"gimp_logo.png", NULL);
if (!fp)
return FALSE;
pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
fgets (buf, 1024, fp);
g_free (filename);
if (strncmp (buf, "P6", 2) != 0)
{
fclose (fp);
if (! pixbuf)
return FALSE;
}
fgets (buf, 1024, fp);
fgets (buf, 1024, fp);
sscanf (buf, "%d %d", &logo_width, &logo_height);
fgets (buf, 1024, fp);
if (strncmp (buf, "255", 3) != 0)
{
fclose (fp);
return FALSE;
}
logo_width = gdk_pixbuf_get_width (pixbuf);
logo_height = gdk_pixbuf_get_height (pixbuf);
preview = gtk_preview_new (GTK_PREVIEW_COLOR);
gtk_preview_size (GTK_PREVIEW (preview), logo_width, logo_height);
pixelrow = g_new (guchar, logo_width * 3);
gtk_widget_realize (window);
for (i = 0; i < logo_height; i++)
{
count = fread (pixelrow, sizeof (guchar), logo_width * 3, fp);
if (count != (logo_width * 3))
{
gtk_object_sink (GTK_OBJECT (preview));
g_free (pixelrow);
fclose (fp);
return FALSE;
}
logo_pixmap = gdk_pixmap_new (window->window,
logo_width, logo_height,
gtk_widget_get_visual (window)->depth);
gtk_preview_draw_row (GTK_PREVIEW (preview), pixelrow, 0, i, logo_width);
}
gtk_widget_realize (window);
logo_pixmap = gdk_pixmap_new (window->window, logo_width, logo_height,
gtk_preview_get_visual ()->depth);
gc = gdk_gc_new (logo_pixmap);
gtk_preview_put (GTK_PREVIEW (preview),
logo_pixmap, gc,
0, 0, 0, 0, logo_width, logo_height);
g_object_unref (gc);
gtk_object_sink (GTK_OBJECT (preview));
g_free (pixelrow);
gdk_pixbuf_render_to_drawable (pixbuf,
GDK_DRAWABLE (logo_pixmap),
gc,
0, 0,
0, 0,
logo_width,
logo_height,
GDK_RGB_DITHER_MAX,
0, 0);
fclose (fp);
g_object_unref (G_OBJECT (gc));
g_object_unref (G_OBJECT (pixbuf));
dissolve_width =
(logo_width / ANIMATION_SIZE) + (logo_width % ANIMATION_SIZE == 0 ? 0 : 1);
(logo_width / ANIMATION_SIZE) +
(logo_width % ANIMATION_SIZE == 0 ? 0 : 1);
dissolve_height =
(logo_height / ANIMATION_SIZE) + (logo_height % ANIMATION_SIZE == 0 ? 0 : 1);
(logo_height / ANIMATION_SIZE) +
(logo_height % ANIMATION_SIZE == 0 ? 0 : 1);
dissolve_map = g_new (guchar, dissolve_width * dissolve_height);
......@@ -396,12 +370,11 @@ about_dialog_destroy (GtkObject *object,
gpointer data)
{
about_dialog = NULL;
about_dialog_unmap (NULL, NULL, NULL);
about_dialog_unmap (NULL, NULL);
}
static void
about_dialog_unmap (GtkWidget *widget,
GdkEvent *event,
gpointer data)
{
if (timer)
......
......@@ -55,7 +55,6 @@
#include "gui.h"
#include "menus.h"
#include "palette-select.h"
#include "palette-import-dialog.h"
#include "pattern-select.h"
#include "session.h"
#include "tool-options-dialog.h"
......@@ -91,14 +90,11 @@ static void gui_display_changed (GimpContext *context,
gpointer data);
static void gui_image_disconnect (GimpImage *gimage,
gpointer data);
static void gui_image_name_changed (GimpImage *gimage,
gpointer data);
/* private variables */
static GQuark image_disconnect_handler_id = 0;
static GQuark image_name_changed_handler_id = 0;
static GHashTable *themes_hash = NULL;
......@@ -231,11 +227,6 @@ gui_init (Gimp *gimp)
G_CALLBACK (gui_image_disconnect),
gimp);
image_name_changed_handler_id =
gimp_container_add_handler (gimp->images, "name_changed",
G_CALLBACK (gui_image_name_changed),
gimp);
g_signal_connect (G_OBJECT (gimp_get_user_context (gimp)), "display_changed",
G_CALLBACK (gui_display_changed),
gimp);
......@@ -336,10 +327,8 @@ gui_exit (Gimp *gimp)
gimp_help_free ();
gimp_container_remove_handler (gimp->images, image_disconnect_handler_id);
gimp_container_remove_handler (gimp->images, image_name_changed_handler_id);
image_disconnect_handler_id = 0;
image_name_changed_handler_id = 0;
if (themes_hash)
{
......@@ -581,14 +570,3 @@ gui_image_disconnect (GimpImage *gimage,
"gimp:toolbox", -1);
}
}
static void
gui_image_name_changed (GimpImage *gimage,
gpointer data)
{
Gimp *gimp;
gimp = (Gimp *) data;
palette_import_image_renamed (gimage);
}
This diff is collapsed.
......@@ -24,8 +24,4 @@ void palette_import_dialog_show (Gimp *gimp);
void palette_import_dialog_destroy (void);
/* FIXME */
void palette_import_image_renamed (GimpImage *gimage);
#endif /* __PALETTE_IMPORT_H__ */
......@@ -29,7 +29,6 @@
#include "tools/tools-types.h"
#include "procedural_db.h"
#include "base/tile-manager.h"
#include "core/core-enums.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage-mask-select.h"
......
......@@ -30,8 +30,6 @@
#include "base/boundary.h"
#include "base/pixel-region.h"
#include "base/tile-manager.h"
#include "base/tile.h"
#include "core/gimpchannel.h"
#include "core/gimpdrawable.h"
......
......@@ -30,8 +30,6 @@
#include "base/boundary.h"
#include "base/pixel-region.h"
#include "base/tile-manager.h"
#include "base/tile.h"
#include "core/gimpchannel.h"
#include "core/gimpdrawable.h"
......
......@@ -162,8 +162,8 @@ gimp_container_view_get_name_func_preview (GtkWidget *widget)
return GIMP_PREVIEW (GIMP_MENU_ITEM (widget)->preview);
}
g_warning ("gimp_container_view_get_name_func_preview(): "
"widget type does not match");
g_warning ("%s: widget type %s does not contain a GimpPreview",
G_STRLOC, g_type_name (G_TYPE_FROM_INSTANCE (widget)));
return NULL;
}
......
......@@ -734,7 +734,7 @@ fi
AM_CONDITIONAL(STATICLIBS, test x$enable_static = xyes)
CPPFLAGS="${CPPFLAGS} -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED"
CPPFLAGS="${CPPFLAGS} -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED"