Commit 1ccb029e authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

added -DGDK_DISABLE_DEPRECATED.

2001-09-02  Michael Natterer  <mitch@gimp.org>

	* configure.in: added -DGDK_DISABLE_DEPRECATED.

	* app/gui/about-dialog.c
	* plug-ins/common/wmf.c
	* plug-ins/ifscompose/ifscompose_utils.c: #undef it here (too lazy...)

	* app/colormaps.[ch]
	* app/gdisplay.c
	* app/module_db.c
	* app/plug_in.c
	* app/gui/brush-editor.c
	* app/gui/color-notebook.c
	* app/gui/gradient-select.c
	* app/gui/palette-select.c
	* app/gui/paths-dialog.c
	* app/gui/select-commands.c
	* app/widgets/gimpdialogfactory.c
	* app/widgets/gimpdock.c
	* app/widgets/gimpdockbook.c: replaced deprecated stuff,
	g_list_free() the return value of gtk_container_get_children().

	* plug-ins/Makefile.am: build gflare again.

	* plug-ins/gflare/asupsample.[ch]: removed because the same function
	is already in libgimpcolor.

	* plug-ins/gflare/gtkmultioptionmenu.[ch]: removed because Gtk+
	handles menu_height > screen_height by scrolling now.

	* plug-ins/gflare/Makefile.am
	* plug-ins/gflare/gflare.c: changed accordingly, cleanups.
parent 083c7c91
2001-09-02 Michael Natterer <mitch@gimp.org>
* configure.in: added -DGDK_DISABLE_DEPRECATED.
* app/gui/about-dialog.c
* plug-ins/common/wmf.c
* plug-ins/ifscompose/ifscompose_utils.c: #undef it here (too lazy...)
* app/colormaps.[ch]
* app/gdisplay.c
* app/module_db.c
* app/plug_in.c
* app/gui/brush-editor.c
* app/gui/color-notebook.c
* app/gui/gradient-select.c
* app/gui/palette-select.c
* app/gui/paths-dialog.c
* app/gui/select-commands.c
* app/widgets/gimpdialogfactory.c
* app/widgets/gimpdock.c
* app/widgets/gimpdockbook.c: replaced deprecated stuff,
g_list_free() the return value of gtk_container_get_children().
* plug-ins/Makefile.am: build gflare again.
* plug-ins/gflare/asupsample.[ch]: removed because the same function
is already in libgimpcolor.
* plug-ins/gflare/gtkmultioptionmenu.[ch]: removed because Gtk+
handles menu_height > screen_height by scrolling now.
* plug-ins/gflare/Makefile.am
* plug-ins/gflare/gflare.c: changed accordingly, cleanups.
2001-09-03 Sven Neumann <sven@gimp.org>
* app/plug_in.c
......
......@@ -910,7 +910,8 @@ plug_in_destroy (PlugIn *plug_in)
{
if (plug_in)
{
plug_in_close (plug_in, TRUE);
if (plug_in->open)
plug_in_close (plug_in, TRUE);
if (plug_in->args[0])
g_free (plug_in->args[0]);
......@@ -1126,132 +1127,129 @@ plug_in_close (PlugIn *plug_in,
struct timeval tv;
#endif
if (plug_in && plug_in->open)
{
plug_in->open = FALSE;
g_return_if_fail (plug_in != NULL);
g_return_if_fail (plug_in->open == TRUE);
/* Ask the filter to exit gracefully
*/
if (kill_it && plug_in->pid)
{
plug_in_push (plug_in);
gp_quit_write (current_writechannel);
plug_in_pop ();
if (! plug_in->open)
return;
plug_in->open = FALSE;
/* give the plug-in some time (10 ms) */
/* Ask the filter to exit gracefully */
if (kill_it && plug_in->pid)
{
plug_in_push (plug_in);
gp_quit_write (current_writechannel);
plug_in_pop ();
/* give the plug-in some time (10 ms) */
#ifndef G_OS_WIN32
tv.tv_sec = 0;
tv.tv_usec = 100; /* But this is 0.1 ms? */
select (0, NULL, NULL, NULL, &tv);
tv.tv_sec = 0;
tv.tv_usec = 100; /* But this is 0.1 ms? */
select (0, NULL, NULL, NULL, &tv);
#else
Sleep (10);
Sleep (10);
#endif
}
}
/* If necessary, kill the filter. */
/* If necessary, kill the filter. */
#ifndef G_OS_WIN32
if (kill_it && plug_in->pid)
status = kill (plug_in->pid, SIGKILL);
if (kill_it && plug_in->pid)
status = kill (plug_in->pid, SIGKILL);
/* Wait for the process to exit. This will happen
* immediately if it was just killed.
*/
if (plug_in->pid)
waitpid (plug_in->pid, &status, 0);
/* Wait for the process to exit. This will happen
* immediately if it was just killed.
*/
if (plug_in->pid)
waitpid (plug_in->pid, &status, 0);
#else
if (kill_it && plug_in->pid)
{
/* Trying to avoid TerminateProcess (does mostly work).
* Otherwise some of our needed DLLs may get into an unstable state
* (see Win32 API docs).
*/
DWORD dwExitCode = STILL_ACTIVE;
DWORD dwTries = 10;
while ((STILL_ACTIVE == dwExitCode)
&& GetExitCodeProcess((HANDLE) plug_in->pid, &dwExitCode)
&& (dwTries > 0))
{
Sleep(10);
dwTries--;
}
if (STILL_ACTIVE == dwExitCode)
{
g_warning("Terminating %s ...", plug_in->args[0]);
TerminateProcess ((HANDLE) plug_in->pid, 0);
}
}
#endif
/* Remove the input handler. */
if (plug_in->input_id)
gdk_input_remove (plug_in->input_id);
/* Close the pipes. */
if (plug_in->my_read != NULL)
{
g_io_channel_unref (plug_in->my_read);
plug_in->my_read = NULL;
}
if (plug_in->my_write != NULL)
{
g_io_channel_unref (plug_in->my_write);
plug_in->my_write = NULL;
}
if (plug_in->his_read != NULL)
if (kill_it && plug_in->pid)
{
/* Trying to avoid TerminateProcess (does mostly work).
* Otherwise some of our needed DLLs may get into an unstable state
* (see Win32 API docs).
*/
DWORD dwExitCode = STILL_ACTIVE;
DWORD dwTries = 10;
while ((STILL_ACTIVE == dwExitCode)
&& GetExitCodeProcess((HANDLE) plug_in->pid, &dwExitCode)
&& (dwTries > 0))
{
g_io_channel_unref (plug_in->his_read);
plug_in->his_read = NULL;
Sleep(10);
dwTries--;
}
if (plug_in->his_write != NULL)
if (STILL_ACTIVE == dwExitCode)
{
g_io_channel_unref (plug_in->his_write);
plug_in->his_write = NULL;
g_warning("Terminating %s ...", plug_in->args[0]);
TerminateProcess ((HANDLE) plug_in->pid, 0);
}
}
#endif
wire_clear_error ();
plug_in->pid = 0;
/* Destroy the progress dialog if it exists. */
if (plug_in->progress)
progress_end (plug_in->progress);
plug_in->progress = NULL;
/* Set the fields to null values. */
plug_in->pid = 0;
/* Remove the input handler. */
if (plug_in->input_id)
{
g_source_remove (plug_in->input_id);
plug_in->input_id = 0;
}
/* Close the pipes. */
if (plug_in->my_read != NULL)
{
g_io_channel_unref (plug_in->my_read);
plug_in->my_read = NULL;
}
if (plug_in->my_write != NULL)
{
g_io_channel_unref (plug_in->my_write);
plug_in->my_write = NULL;
}
if (plug_in->his_read != NULL)
{
g_io_channel_unref (plug_in->his_read);
plug_in->his_read = NULL;
}
if (plug_in->his_write != NULL)
{
g_io_channel_unref (plug_in->his_write);
plug_in->his_write = NULL;
}
if (plug_in->recurse)
gtk_main_quit ();
wire_clear_error ();
plug_in->synchronous = FALSE;
plug_in->recurse = FALSE;
/* Destroy the progress dialog if it exists. */
if (plug_in->progress)
{
progress_end (plug_in->progress);
plug_in->progress = NULL;
}
/* Unregister any temporary procedures. */
if (plug_in->temp_proc_defs)
{
GSList *list;
PlugInProcDef *proc_def;
if (plug_in->recurse)
{
gtk_main_quit ();
plug_in->recurse = FALSE;
}
for (list = plug_in->temp_proc_defs; list; list = g_slist_next (list))
{
proc_def = (PlugInProcDef *) list->data;
plug_in_proc_def_remove (proc_def);
}
plug_in->synchronous = FALSE;
g_slist_free (plug_in->temp_proc_defs);
plug_in->temp_proc_defs = NULL;
}
/* Unregister any temporary procedures. */
if (plug_in->temp_proc_defs)
{
g_slist_foreach (plug_in->temp_proc_defs,
(GFunc) plug_in_proc_def_remove,
NULL);
g_slist_free (plug_in->temp_proc_defs);
plug_in->temp_proc_defs = NULL;
}
/* Close any dialogs that this plugin might have opened */
brush_select_dialogs_check ();
pattern_select_dialogs_check ();
gradient_select_dialogs_check ();
/* Close any dialogs that this plugin might have opened */
brush_select_dialogs_check ();
pattern_select_dialogs_check ();
gradient_select_dialogs_check ();
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
}
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
}
static Argument *
......
......@@ -154,6 +154,7 @@ select_shrink_cmd_callback (GtkWidget *widget,
GtkWidget *edge_lock;
GtkWidget *shrink_dialog;
GDisplay *gdisp;
GList *children;
return_if_no_display (gdisp);
......@@ -171,11 +172,15 @@ select_shrink_cmd_callback (GtkWidget *widget,
gimage_mask_shrink_callback, gdisp->gimage);
edge_lock = gtk_check_button_new_with_label (_("Shrink from image border"));
/* eeek */
gtk_box_pack_start (GTK_BOX (g_list_nth_data (gtk_container_children (GTK_CONTAINER (GTK_DIALOG (shrink_dialog)->vbox)), 0)), edge_lock,
FALSE, FALSE, 0);
g_object_set_data (G_OBJECT (shrink_dialog), "edge_lock_toggle",
edge_lock);
children = gtk_container_get_children (GTK_CONTAINER (GTK_DIALOG (shrink_dialog)->vbox));
gtk_box_pack_start (GTK_BOX (children->data), edge_lock, FALSE, FALSE, 0);
g_list_free (children);
g_object_set_data (G_OBJECT (shrink_dialog), "edge_lock_toggle", edge_lock);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (edge_lock),
! selection_shrink_edge_lock);
gtk_widget_show (edge_lock);
......
......@@ -22,6 +22,12 @@
#include <stdlib.h>
#include <string.h>
#ifdef __GNUC__
#warning FIXME: GDK_DISABLE_DEPRECATED
#endif
#undef GDK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#include "libgimpmath/gimpmath.h"
......@@ -58,7 +64,7 @@
#define ALL 0xFF
/* NB: take care when changing these values: make sure the curve[] array in
* curves.h is large enough.
* gimpcurvestool.h is large enough.
*/
#define GRAPH_WIDTH 256
#define GRAPH_HEIGHT 256
......
......@@ -18,6 +18,12 @@
#include "config.h"
#ifdef __GNUC__
#warning FIXME: GDK_DISABLE_DEPRECATED
#endif
#undef GDK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#include "core/core-types.h"
......@@ -38,6 +44,7 @@ gulong g_active_guide_pixel;
gulong marching_ants_pixels[8];
static void
set_app_colors (void)
{
......@@ -53,9 +60,9 @@ set_app_colors (void)
}
gulong
get_color (int red,
int green,
int blue)
get_color (gint red,
gint green,
gint blue)
{
return gdk_rgb_xpixel_from_rgb ((red << 16) | (green << 8) | blue);
}
......@@ -63,10 +70,7 @@ get_color (int red,
void
get_standard_colormaps (void)
{
if (gtk_check_version (1, 2, 8))
gimprc.min_colors = CLAMP (gimprc.min_colors, 27, 216);
else
gimprc.min_colors = CLAMP (gimprc.min_colors, 27, 256);
gimprc.min_colors = CLAMP (gimprc.min_colors, 27, 256);
gdk_rgb_set_min_colors (gimprc.min_colors);
gdk_rgb_set_install (gimprc.install_cmap);
......
......@@ -36,10 +36,11 @@ extern gulong g_active_guide_pixel;
/* Colormap entries reserved for color cycled marching ants--optional */
extern gulong marching_ants_pixels[8];
gulong get_color (gint red,
gint green,
gint blue);
void get_standard_colormaps (void);
gulong get_color (gint red,
gint green,
gint blue);
void get_standard_colormaps (void);
#endif /* __COLORMAPS_H__ */
......@@ -21,6 +21,12 @@
#include <stdlib.h>
#include <string.h>
#ifdef __GNUC__
#warning FIXME: GDK_DISABLE_DEPRECATED
#endif
#undef GDK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#include "libgimpmath/gimpmath.h"
......@@ -857,7 +863,8 @@ gdisplay_update_icon (GDisplay *gdisp)
GtkStyle *style;
GdkGC *icongc, *iconmaskgc;
GdkColormap *colormap;
GdkColor black, white;
GdkColor black, white;
gboolean success;
TempBuf *icondata;
guchar *data;
......@@ -866,7 +873,6 @@ gdisplay_update_icon (GDisplay *gdisp)
if (!gdisp->icon)
{
gdk_rgb_init ();
gdisp->icon = gdk_pixmap_new (gdisp->shell->window,
gdisp->iconsize,
gdisp->iconsize,
......@@ -877,12 +883,19 @@ gdisplay_update_icon (GDisplay *gdisp)
1);
}
icongc = gdk_gc_new (gdisp->icon);
icongc = gdk_gc_new (gdisp->icon);
iconmaskgc = gdk_gc_new (gdisp->iconmask);
colormap = gdk_colormap_get_system (); /* or gdk_rgb_get_colormap () */
colormap = gdk_colormap_get_system (); /* or gdk_rgb_get_colormap () */
gdk_color_white (colormap, &white);
gdk_color_black (colormap, &black);
white.red = 255;
white.green = 255;
white.blue = 255;
gdk_colormap_alloc_colors (colormap, &white, 1, FALSE, TRUE, &success);
black.red = 0;
black.green = 0;
black.blue = 0;
gdk_colormap_alloc_colors (colormap, &black, 1, FALSE, TRUE, &success);
if (! gdisp->icon_needs_update)
return;
......@@ -1490,7 +1503,9 @@ gdisplay_resize_cursor_label (GDisplay *gdisp)
gdisp->cursor_label->allocation.width;
gtk_widget_set_usize (gdisp->cursor_label, cursor_label_width, -1);
if (label_frame_size_difference) /* don't resize if this is a new display */
/* don't resize if this is a new display */
if (label_frame_size_difference)
gtk_widget_set_usize (gdisp->cursor_label->parent,
cursor_label_width + label_frame_size_difference, -1);
......
......@@ -23,6 +23,12 @@
#include <string.h>
#include <time.h>
#ifdef __GNUC__
#warning FIXME: GDK_DISABLE_DEPRECATED
#endif
#undef GDK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
......
......@@ -264,8 +264,7 @@ color_notebook_new (const gchar *title,
NULL);
gtk_widget_hide (GTK_WIDGET (g_list_nth_data (gtk_container_children (GTK_CONTAINER (GTK_BIN (cnp->shell)->child)), 0)));
gtk_dialog_set_has_separator (GTK_DIALOG (cnp->shell), FALSE);
gtk_widget_hide (GTK_DIALOG (cnp->shell)->action_area);
}
else
......
......@@ -1046,37 +1046,37 @@ browser_info_add (GimpContainer *container,
static void
browser_info_remove (GimpContainer *container,
GimpModuleInfoObj *mod,
BrowserState *st)
browser_info_remove (GimpContainer *container,
GimpModuleInfoObj *mod,
BrowserState *st)
{
GList *dlist;
GList *free_list;
GtkWidget *list_item;
GList *dlist;
GList *free_list;
GtkWidget *list_item;
GimpModuleInfoObj *info;
dlist = gtk_container_children (GTK_CONTAINER (st->list));
dlist = gtk_container_get_children (GTK_CONTAINER (st->list));
free_list = dlist;
while (dlist)
{
list_item = dlist->data;
{
list_item = dlist->data;
info = g_object_get_data (G_OBJECT (list_item), "module_info");
g_return_if_fail (info != NULL);
info = g_object_get_data (G_OBJECT (list_item), "module_info");
g_return_if_fail (info != NULL);
if (info == mod)
{
gtk_container_remove (GTK_CONTAINER (st->list), list_item);
g_list_free (free_list);
return;
}
if (info == mod)
{
gtk_container_remove (GTK_CONTAINER (st->list), list_item);
g_list_free (free_list);
return;
}
dlist = dlist->next;
}
dlist = dlist->next;
}
g_warning ("tried to remove module that wasn't in brower's list");
g_list_free(free_list);
g_list_free (free_list);
}
......
......@@ -21,6 +21,12 @@
#include <stdlib.h>
#include <string.h>
#ifdef __GNUC__
#warning FIXME: GDK_DISABLE_DEPRECATED
#endif
#undef GDK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#include "libgimpmath/gimpmath.h"
......@@ -857,7 +863,8 @@ gdisplay_update_icon (GDisplay *gdisp)
GtkStyle *style;
GdkGC *icongc, *iconmaskgc;
GdkColormap *colormap;
GdkColor black, white;
GdkColor black, white;
gboolean success;
TempBuf *icondata;
guchar *data;
......@@ -866,7 +873,6 @@ gdisplay_update_icon (GDisplay *gdisp)
if (!gdisp->icon)
{
gdk_rgb_init ();
gdisp->icon = gdk_pixmap_new (gdisp->shell->window,
gdisp->iconsize,
gdisp->iconsize,
......@@ -877,12 +883,19 @@ gdisplay_update_icon (GDisplay *gdisp)
1);
}
icongc = gdk_gc_new (gdisp->icon);
icongc = gdk_gc_new (gdisp->icon);
iconmaskgc = gdk_gc_new (gdisp->iconmask);
colormap = gdk_colormap_get_system (); /* or gdk_rgb_get_colormap () */
colormap = gdk_colormap_get_system (); /* or gdk_rgb_get_colormap () */
gdk_color_white (colormap, &white);
gdk_color_black (colormap, &black);
white.red = 255;
white.green = 255;
white.blue = 255;
gdk_colormap_alloc_colors (colormap, &white, 1, FALSE, TRUE, &success);
black.red = 0;
black.green = 0;
black.blue = 0;
gdk_colormap_alloc_colors (colormap, &black, 1, FALSE, TRUE, &success);
if (! gdisp->icon_needs_update)
return;
......@@ -1490,7 +1503,9 @@ gdisplay_resize_cursor_label (GDisplay *gdisp)
gdisp->cursor_label->allocation.width;
gtk_widget_set_usize (gdisp->cursor_label, cursor_label_width, -1);
if (label_frame_size_difference) /* don't resize if this is a new display */
/* don't resize if this is a new display */
if (label_frame_size_difference)
gtk_widget_set_usize (gdisp->cursor_label->parent,
cursor_label_width + label_frame_size_difference, -1);
......
......@@ -21,6 +21,12 @@
#include <stdlib.h>
#include <string.h>
#ifdef __GNUC__
#warning FIXME: GDK_DISABLE_DEPRECATED
#endif
#undef GDK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#include "libgimpmath/gimpmath.h"
......@@ -857,7 +863,8 @@ gdisplay_update_icon (GDisplay *gdisp)
GtkStyle *style;
GdkGC *icongc, *iconmaskgc;
GdkColormap *colormap;
GdkColor black, white;
GdkColor black, white;
gboolean success;
TempBuf *icondata;
guchar *data;
......@@ -866,7 +873,6 @@ gdisplay_update_icon (GDisplay *gdisp)
if (!gdisp->icon)
{
gdk_rgb_init ();
gdisp->icon = gdk_pixmap_new (gdisp->shell->window,
gdisp->iconsize,
gdisp->iconsize,
......@@ -877,12 +883,19 @@ gdisplay_update_icon (GDisplay *gdisp)
1);
}
icongc = gdk_gc_new (gdisp->icon);
icongc = gdk_gc_new (gdisp->icon);
iconmaskgc = gdk_gc_new (gdisp->iconmask);
colormap = gdk_colormap_get_system (); /* or gdk_rgb_get_colormap () */
colormap = gdk_colormap_get_system (); /* or gdk_rgb_get_colormap () */
gdk_color_white (colormap, &white);
gdk_color_black (colormap, &black);
white.red = 255;
white.green = 255;
white.blue = 255;
gdk_colormap_alloc_colors (colormap, &white, 1, FALSE, TRUE, &success);
black.red = 0;
black.green = 0;
black.blue = 0;
gdk_colormap_alloc_colors (colormap, &black, 1, FALSE, TRUE, &success);
if (! gdisp->icon_needs_update)
return;
......@@ -1490,7 +1503,9 @@ gdisplay_resize_cursor_label (GDisplay *gdisp)
gdisp->cursor_label->allocation.width;
gtk_widget_set_usize (gdisp->cursor_label, cursor_label_width, -1);
if (label_frame_size_difference) /* don't resize if this is a new display */
/* don't resize if this is a new display */
if (label_frame_size_difference)
gtk_widget_set_usize (gdisp->cursor_label->parent,
cursor_label_width + label_frame_size_difference, -1);
......
......@@ -23,6 +23,12 @@
#include <string.h>
#include <time.h>
#ifdef __GNUC__
#warning FIXME: GDK_DISABLE_DEPRECATED
#endif