Commit 18dd0728 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/gimpprogress.[ch] s/GDisplay/GimpDisplay/

2001-10-16  Michael Natterer  <mitch@gimp.org>

	* app/gimpprogress.[ch]
	* app/undo.c: s/GDisplay/GimpDisplay/

	* app/plug_in.[ch]: removed unused boolean "destroy" field of
	the PlugIn struct.

	* app/core/gimpedit.c: don't include "app_procs.h"

	* app/display/gimpdisplay-callbacks.c: moved the "grab_abd_scroll"
	stuff from gimpdisplay-scroll.* here (less complicated and easier
	to cleanup...)

	* app/display/gimpdisplay-scroll.[ch]: removed here.

	* app/display/gimpdisplay-render.[ch]
	* app/display/gimpdisplay-selection.[ch]
	* app/display/gimpdisplayshell.c: s/GDisplay/GimpDisplay/g

	* app/display/gimpdisplay.[ch]: ditto, removed gdisplay_active()
	which was just a wrapper around
	"gimp_context_get_display (gimp_get_user_context (the_gimp))"
	(which is more to type but makes the use of the global
	"the_gimp" variable more obvious).

	* app/gui/color-area.h
	* app/gui/edit-commands.c
	* app/gui/file-commands.c
	* app/gui/file-dialog-utils.c
	* app/gui/image-commands.c
	* app/gui/info-window.h
	* app/gui/paths-dialog.h
	* app/gui/select-commands.c
	* app/gui/tool-options-dialog.c
	* app/gui/tools-commands.c
	* app/gui/view-commands.c: s/GDisplay/GimpDisplay/, gdisplay_active()
	removal, include "app_procs.h" for "the_gimp".

	* app/tools/gimpbezierselecttool.h
	* app/tools/gimpbrightnesscontrasttool.[ch]
	* app/tools/gimpbycolorselecttool.c
	* app/tools/gimpcolorbalancetool.[ch]
	* app/tools/gimpcurvestool.[ch]
	* app/tools/gimpeditselectiontool.h
	* app/tools/gimphistogramtool.[ch]
	* app/tools/gimphuesaturationtool.[ch]
	* app/tools/gimplevelstool.[ch]
	* app/tools/gimpmovetool.h
	* app/tools/gimpperspectivetool.h
	* app/tools/gimpposterizetool.[ch]
	* app/tools/gimprotatetool.h
	* app/tools/gimpscaletool.h
	* app/tools/gimpsheartool.h
	* app/tools/gimptexttool.h
	* app/tools/gimpthresholdtool.[ch]
	* app/tools/gimptool.[ch]
	* app/tools/gimptransformtool.h
	* app/tools/tool_manager.[ch]: lots of s/GDisplay/GimpDisplay/, made
	all *_dialog_hide() functions private, cleanup.

	* app/widgets/*: removed GtkType and gtk_type_* stuff entirely and
	use GObject functions, removed lots of empty "destroy" methods and
	use more type checking class cast macros instead of casting
	directly.

	* app/widgets/gimpcontainermenu.c: fixed item insert order.

	* app/widgets/gimphistogramview.[ch]: cleaned up and renamed all
	functions.

	* app/widgets/gimpwidgets-utils.[ch]: removed gimp_dialog_hide() as
	Gtk+ does the right thing (TM) now.

	* tools/pdbgen/pdb/color.pdb: implemented "histogram" without
	digging into tools/ and widgets/ (needs to be done for all
	color PDB functions).

	* tools/pdbgen/pdb/gimprc.pdb: no need to use "the_gimp" in a PDB
	function as a "Gimp" pointer is passed to them all.

	* tools/pdbgen/pdb/image.pdb: don't include "app_procs.h"

	* app/pdb/color_cmds.c
	* app/pdb/gimprc_cmds.c
	* app/pdb/image_cmds.c: regenerated.

	* app/pdb/procedural_db.c: don't include "app_procs.h"
parent c0ff451a
2001-10-16 Michael Natterer <mitch@gimp.org>
* app/gimpprogress.[ch]
* app/undo.c: s/GDisplay/GimpDisplay/
* app/plug_in.[ch]: removed unused boolean "destroy" field of
the PlugIn struct.
* app/core/gimpedit.c: don't include "app_procs.h"
* app/display/gimpdisplay-callbacks.c: moved the "grab_abd_scroll"
stuff from gimpdisplay-scroll.* here (less complicated and easier
to cleanup...)
* app/display/gimpdisplay-scroll.[ch]: removed here.
* app/display/gimpdisplay-render.[ch]
* app/display/gimpdisplay-selection.[ch]
* app/display/gimpdisplayshell.c: s/GDisplay/GimpDisplay/g
* app/display/gimpdisplay.[ch]: ditto, removed gdisplay_active()
which was just a wrapper around
"gimp_context_get_display (gimp_get_user_context (the_gimp))"
(which is more to type but makes the use of the global
"the_gimp" variable more obvious).
* app/gui/color-area.h
* app/gui/edit-commands.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/image-commands.c
* app/gui/info-window.h
* app/gui/paths-dialog.h
* app/gui/select-commands.c
* app/gui/tool-options-dialog.c
* app/gui/tools-commands.c
* app/gui/view-commands.c: s/GDisplay/GimpDisplay/, gdisplay_active()
removal, include "app_procs.h" for "the_gimp".
* app/tools/gimpbezierselecttool.h
* app/tools/gimpbrightnesscontrasttool.[ch]
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpcolorbalancetool.[ch]
* app/tools/gimpcurvestool.[ch]
* app/tools/gimpeditselectiontool.h
* app/tools/gimphistogramtool.[ch]
* app/tools/gimphuesaturationtool.[ch]
* app/tools/gimplevelstool.[ch]
* app/tools/gimpmovetool.h
* app/tools/gimpperspectivetool.h
* app/tools/gimpposterizetool.[ch]
* app/tools/gimprotatetool.h
* app/tools/gimpscaletool.h
* app/tools/gimpsheartool.h
* app/tools/gimptexttool.h
* app/tools/gimpthresholdtool.[ch]
* app/tools/gimptool.[ch]
* app/tools/gimptransformtool.h
* app/tools/tool_manager.[ch]: lots of s/GDisplay/GimpDisplay/, made
all *_dialog_hide() functions private, cleanup.
* app/widgets/*: removed GtkType and gtk_type_* stuff entirely and
use GObject functions, removed lots of empty "destroy" methods and
use more type checking class cast macros instead of casting
directly.
* app/widgets/gimpcontainermenu.c: fixed item insert order.
* app/widgets/gimphistogramview.[ch]: cleaned up and renamed all
functions.
* app/widgets/gimpwidgets-utils.[ch]: removed gimp_dialog_hide() as
Gtk+ does the right thing (TM) now.
* tools/pdbgen/pdb/color.pdb: implemented "histogram" without
digging into tools/ and widgets/ (needs to be done for all
color PDB functions).
* tools/pdbgen/pdb/gimprc.pdb: no need to use "the_gimp" in a PDB
function as a "Gimp" pointer is passed to them all.
* tools/pdbgen/pdb/image.pdb: don't include "app_procs.h"
* app/pdb/color_cmds.c
* app/pdb/gimprc_cmds.c
* app/pdb/image_cmds.c: regenerated.
* app/pdb/procedural_db.c: don't include "app_procs.h"
2001-10-16 Sven Neumann <sven@gimp.org> 2001-10-16 Sven Neumann <sven@gimp.org>
* plug-ins/common/sel_gauss.c: merged fix for bug #62433 from stable * plug-ins/common/sel_gauss.c: merged fix for bug #62433 from stable
......
...@@ -43,13 +43,14 @@ ...@@ -43,13 +43,14 @@
#include "dialogs.h" #include "dialogs.h"
#include "edit-commands.h" #include "edit-commands.h"
#include "app_procs.h"
#include "undo.h" #include "undo.h"
#include "libgimp/gimpintl.h" #include "libgimp/gimpintl.h"
#define return_if_no_display(gdisp) \ #define return_if_no_display(gdisp) \
gdisp = gdisplay_active (); \ gdisp = gimp_context_get_display (gimp_get_user_context (the_gimp)); \
if (!gdisp) return if (!gdisp) return
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#include "gui-types.h" #include "gui-types.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h" #include "core/gimpimage.h"
#include "core/gimpobject.h" #include "core/gimpobject.h"
...@@ -49,7 +51,7 @@ ...@@ -49,7 +51,7 @@
#define REVERT_DATA_KEY "revert-confirm-dialog" #define REVERT_DATA_KEY "revert-confirm-dialog"
#define return_if_no_display(gdisp) \ #define return_if_no_display(gdisp) \
gdisp = gdisplay_active (); \ gdisp = gimp_context_get_display (gimp_get_user_context (the_gimp)); \
if (!gdisp) return if (!gdisp) return
...@@ -67,15 +69,15 @@ file_new_cmd_callback (GtkWidget *widget, ...@@ -67,15 +69,15 @@ file_new_cmd_callback (GtkWidget *widget,
gpointer data, gpointer data,
guint action) guint action)
{ {
GDisplay *gdisp; GimpDisplay *gdisp;
GimpImage *gimage = NULL; GimpImage *gimage = NULL;
/* Before we try to determine the responsible gdisplay, /* Before we try to determine the responsible gdisplay,
* make sure this wasn't called from the toolbox * make sure this wasn't called from the toolbox
*/ */
if (action) if (action)
{ {
gdisp = gdisplay_active (); gdisp = gimp_context_get_display (gimp_get_user_context (the_gimp));
if (gdisp) if (gdisp)
gimage = gdisp->gimage; gimage = gdisp->gimage;
...@@ -135,7 +137,7 @@ void ...@@ -135,7 +137,7 @@ void
file_save_cmd_callback (GtkWidget *widget, file_save_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GDisplay *gdisp; GimpDisplay *gdisp;
return_if_no_display (gdisp); return_if_no_display (gdisp);
if (! gimp_image_active_drawable (gdisp->gimage)) if (! gimp_image_active_drawable (gdisp->gimage))
...@@ -182,7 +184,7 @@ void ...@@ -182,7 +184,7 @@ void
file_save_as_cmd_callback (GtkWidget *widget, file_save_as_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GDisplay *gdisp; GimpDisplay *gdisp;
return_if_no_display (gdisp); return_if_no_display (gdisp);
file_save_dialog_show (gdisp->gimage); file_save_dialog_show (gdisp->gimage);
...@@ -192,7 +194,7 @@ void ...@@ -192,7 +194,7 @@ void
file_save_a_copy_as_cmd_callback (GtkWidget *widget, file_save_a_copy_as_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GDisplay *gdisp; GimpDisplay *gdisp;
return_if_no_display (gdisp); return_if_no_display (gdisp);
file_save_a_copy_dialog_show (gdisp->gimage); file_save_a_copy_dialog_show (gdisp->gimage);
...@@ -202,7 +204,7 @@ void ...@@ -202,7 +204,7 @@ void
file_revert_cmd_callback (GtkWidget *widget, file_revert_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GDisplay *gdisp; GimpDisplay *gdisp;
GtkWidget *query_box; GtkWidget *query_box;
const gchar *filename; const gchar *filename;
...@@ -260,7 +262,7 @@ void ...@@ -260,7 +262,7 @@ void
file_close_cmd_callback (GtkWidget *widget, file_close_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GDisplay *gdisp; GimpDisplay *gdisp;
return_if_no_display (gdisp); return_if_no_display (gdisp);
gdisplay_close_window (gdisp, FALSE); gdisplay_close_window (gdisp, FALSE);
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "gui-types.h" #include "gui-types.h"
#include "core/gimp.h" #include "core/gimp.h"
#include "core/gimpcontext.h"
#include "core/gimpdrawable.h" #include "core/gimpdrawable.h"
#include "core/gimpdrawable-desaturate.h" #include "core/gimpdrawable-desaturate.h"
#include "core/gimpdrawable-equalize.h" #include "core/gimpdrawable-equalize.h"
...@@ -36,6 +37,7 @@ ...@@ -36,6 +37,7 @@
#include "display/gimpdisplay.h" #include "display/gimpdisplay.h"
#include "display/gimpdisplay-foreach.h" #include "display/gimpdisplay-foreach.h"
#include "app_procs.h"
#include "convert-dialog.h" #include "convert-dialog.h"
#include "offset-dialog.h" #include "offset-dialog.h"
#include "resize-dialog.h" #include "resize-dialog.h"
...@@ -46,7 +48,7 @@ ...@@ -46,7 +48,7 @@
#define return_if_no_display(gdisp) \ #define return_if_no_display(gdisp) \
gdisp = gdisplay_active (); \ gdisp = gimp_context_get_display (gimp_get_user_context (the_gimp)); \
if (!gdisp) return if (!gdisp) return
...@@ -68,7 +70,7 @@ void ...@@ -68,7 +70,7 @@ void
image_convert_rgb_cmd_callback (GtkWidget *widget, image_convert_rgb_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GDisplay *gdisp; GimpDisplay *gdisp;
return_if_no_display (gdisp); return_if_no_display (gdisp);
convert_to_rgb (gdisp->gimage); convert_to_rgb (gdisp->gimage);
...@@ -78,7 +80,7 @@ void ...@@ -78,7 +80,7 @@ void
image_convert_grayscale_cmd_callback (GtkWidget *widget, image_convert_grayscale_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GDisplay *gdisp; GimpDisplay *gdisp;
return_if_no_display (gdisp); return_if_no_display (gdisp);
convert_to_grayscale (gdisp->gimage); convert_to_grayscale (gdisp->gimage);
...@@ -88,7 +90,7 @@ void ...@@ -88,7 +90,7 @@ void
image_convert_indexed_cmd_callback (GtkWidget *widget, image_convert_indexed_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GDisplay *gdisp; GimpDisplay *gdisp;
return_if_no_display (gdisp); return_if_no_display (gdisp);
convert_to_indexed (gdisp->gimage); convert_to_indexed (gdisp->gimage);
...@@ -98,7 +100,7 @@ void ...@@ -98,7 +100,7 @@ void
image_desaturate_cmd_callback (GtkWidget *widget, image_desaturate_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GDisplay *gdisp; GimpDisplay *gdisp;
GimpDrawable *drawable; GimpDrawable *drawable;
return_if_no_display (gdisp); return_if_no_display (gdisp);
...@@ -120,7 +122,7 @@ void ...@@ -120,7 +122,7 @@ void
image_invert_cmd_callback (GtkWidget *widget, image_invert_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GDisplay *gdisp; GimpDisplay *gdisp;
GimpDrawable *drawable; GimpDrawable *drawable;
Argument *return_vals; Argument *return_vals;
gint nreturn_vals; gint nreturn_vals;
...@@ -154,7 +156,7 @@ void ...@@ -154,7 +156,7 @@ void
image_equalize_cmd_callback (GtkWidget *widget, image_equalize_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GDisplay *gdisp; GimpDisplay *gdisp;
GimpDrawable *drawable; GimpDrawable *drawable;
return_if_no_display (gdisp); return_if_no_display (gdisp);
...@@ -176,7 +178,7 @@ void ...@@ -176,7 +178,7 @@ void
image_offset_cmd_callback (GtkWidget *widget, image_offset_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GDisplay *gdisp; GimpDisplay *gdisp;
return_if_no_display (gdisp); return_if_no_display (gdisp);
offset_dialog_create (gdisp->gimage); offset_dialog_create (gdisp->gimage);
...@@ -186,7 +188,7 @@ void ...@@ -186,7 +188,7 @@ void
image_resize_cmd_callback (GtkWidget *widget, image_resize_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GDisplay *gdisp; GimpDisplay *gdisp;
GimpImage *gimage; GimpImage *gimage;
ImageResize *image_resize; ImageResize *image_resize;
...@@ -222,7 +224,7 @@ void ...@@ -222,7 +224,7 @@ void
image_scale_cmd_callback (GtkWidget *widget, image_scale_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GDisplay *gdisp; GimpDisplay *gdisp;
GimpImage *gimage; GimpImage *gimage;
ImageResize *image_scale; ImageResize *image_scale;
...@@ -258,8 +260,8 @@ void ...@@ -258,8 +260,8 @@ void
image_duplicate_cmd_callback (GtkWidget *widget, image_duplicate_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GDisplay *gdisp; GimpDisplay *gdisp;
GimpImage *gimage; GimpImage *gimage;
return_if_no_display (gdisp); return_if_no_display (gdisp);
......
...@@ -90,6 +90,7 @@ ...@@ -90,6 +90,7 @@
#include "base/tile-manager.h" #include "base/tile-manager.h"
#include "core/gimp.h" #include "core/gimp.h"
#include "core/gimpcontext.h"
#include "core/gimpcoreconfig.h" #include "core/gimpcoreconfig.h"
#include "core/gimpdatafiles.h" #include "core/gimpdatafiles.h"
#include "core/gimpdrawable.h" #include "core/gimpdrawable.h"
...@@ -881,7 +882,6 @@ plug_in_new (gchar *name) ...@@ -881,7 +882,6 @@ plug_in_new (gchar *name)
plug_in = g_new (PlugIn, 1); plug_in = g_new (PlugIn, 1);
plug_in->open = FALSE; plug_in->open = FALSE;
plug_in->destroy = FALSE;
plug_in->query = FALSE; plug_in->query = FALSE;
plug_in->synchronous = FALSE; plug_in->synchronous = FALSE;
plug_in->recurse = FALSE; plug_in->recurse = FALSE;
...@@ -935,8 +935,7 @@ plug_in_destroy (PlugIn *plug_in) ...@@ -935,8 +935,7 @@ plug_in_destroy (PlugIn *plug_in)
if (plug_in == current_plug_in) if (plug_in == current_plug_in)
plug_in_pop (); plug_in_pop ();
if (!plug_in->destroy) g_free (plug_in);
g_free (plug_in);
} }
} }
...@@ -1377,13 +1376,13 @@ plug_in_run (ProcRecord *proc_rec, ...@@ -1377,13 +1376,13 @@ plug_in_run (ProcRecord *proc_rec,
void void
plug_in_repeat (gboolean with_interface) plug_in_repeat (gboolean with_interface)
{ {
GDisplay *gdisplay; GimpDisplay *gdisplay;
Argument *args; Argument *args;
gint i; gint i;
if (last_plug_in) if (last_plug_in)
{ {
gdisplay = gdisplay_active (); gdisplay = gimp_context_get_display (gimp_get_user_context (the_gimp));
if (!gdisplay) return; if (!gdisplay) return;
/* construct the procedures arguments */ /* construct the procedures arguments */
...@@ -2710,15 +2709,15 @@ static void ...@@ -2710,15 +2709,15 @@ static void
plug_in_callback (GtkWidget *widget, plug_in_callback (GtkWidget *widget,
gpointer client_data) gpointer client_data)
{ {
GDisplay *gdisplay; GimpDisplay *gdisplay;
ProcRecord *proc_rec; ProcRecord *proc_rec;
Argument *args; Argument *args;
gint i; gint i;
gint gdisp_ID = -1; gint gdisp_ID = -1;
gint argc = 0; /* calm down a gcc warning. */ gint argc = 0; /* calm down a gcc warning. */
/* get the active gdisplay */ /* get the active gdisplay */
gdisplay = gdisplay_active (); gdisplay = gimp_context_get_display (gimp_get_user_context (the_gimp));
proc_rec = (ProcRecord *) client_data; proc_rec = (ProcRecord *) client_data;
...@@ -3604,7 +3603,7 @@ plug_in_progress_init (PlugIn *plug_in, ...@@ -3604,7 +3603,7 @@ plug_in_progress_init (PlugIn *plug_in,
gchar *message, gchar *message,
gint gdisp_ID) gint gdisp_ID)
{ {
GDisplay *gdisp = NULL; GimpDisplay *gdisp = NULL;
if (!message) if (!message)
message = plug_in->args[0]; message = plug_in->args[0];
......
...@@ -25,17 +25,21 @@ ...@@ -25,17 +25,21 @@
#include "gui-types.h" #include "gui-types.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h" #include "core/gimpimage.h"
#include "core/gimpimage-mask.h" #include "core/gimpimage-mask.h"
#include "display/gimpdisplay.h" #include "display/gimpdisplay.h"
#include "display/gimpdisplay-foreach.h" #include "display/gimpdisplay-foreach.h"
#include "app_procs.h"
#include "libgimp/gimpintl.h" #include "libgimp/gimpintl.h"
#define return_if_no_display(gdisp) \ #define return_if_no_display(gdisp) \
gdisp = gdisplay_active (); \ gdisp = gimp_context_get_display (gimp_get_user_context (the_gimp)); \