put all tool_manager variables into a struct which is attached to a
2001-07-07 Michael Natterer <mitch@gimp.org> * app/tools/tool_manager.[ch]: put all tool_manager variables into a struct which is attached to a "Gimp". Pass a Gimp* to all tool_manager functions. * app/disp_callbacks.c * app/gdisplay.c * app/gimage.c * app/scale.c * app/scroll.c * app/undo.c * app/gui/convert-dialog.c * app/gui/edit-commands.c * app/gui/tool-options-dialog.c * app/gui/tools-commands.c: changed accordingly. * app/tools/gimpbezierselecttool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcroptool.c * app/tools/gimpcurvestool.c * app/tools/gimpeditselectiontool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimplevelstool.c * app/tools/gimpposterizetool.c * app/tools/gimptexttool.c * app/tools/gimpthresholdtool.c * app/tools/gimptool.c * app/tools/gimptransformtool.c: mostly bad hacks for tool dialogs which exist without a real context. Needs some more review.
This commit is contained in:
committed by
Michael Natterer
parent
5693956664
commit
b70ee4b76d
@ -40,6 +40,7 @@
|
||||
#include "tool_manager.h"
|
||||
#include "tool_options.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "image_map.h"
|
||||
@ -482,12 +483,16 @@ threshold_update (ThresholdDialog *td,
|
||||
static void
|
||||
threshold_preview (ThresholdDialog *td)
|
||||
{
|
||||
GimpTool *active_tool;
|
||||
|
||||
if (!td->image_map)
|
||||
{
|
||||
g_warning ("threshold_preview(): No image map");
|
||||
return;
|
||||
}
|
||||
|
||||
active_tool = tool_manager_get_active (the_gimp);
|
||||
|
||||
active_tool->preserve = TRUE;
|
||||
image_map_apply (td->image_map, threshold, td);
|
||||
active_tool->preserve = FALSE;
|
||||
@ -515,11 +520,14 @@ threshold_ok_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
ThresholdDialog *td;
|
||||
GimpTool *active_tool;
|
||||
|
||||
td = (ThresholdDialog *) data;
|
||||
|
||||
gimp_dialog_hide (td->shell);
|
||||
|
||||
|
||||
active_tool = tool_manager_get_active (the_gimp);
|
||||
|
||||
active_tool->preserve = TRUE;
|
||||
|
||||
if (!td->preview)
|
||||
@ -541,11 +549,14 @@ threshold_cancel_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
ThresholdDialog *td;
|
||||
GimpTool *active_tool;
|
||||
|
||||
td = (ThresholdDialog *) data;
|
||||
|
||||
gimp_dialog_hide (td->shell);
|
||||
|
||||
active_tool = tool_manager_get_active (the_gimp);
|
||||
|
||||
if (td->image_map)
|
||||
{
|
||||
active_tool->preserve = TRUE;
|
||||
@ -565,6 +576,7 @@ threshold_preview_update (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
ThresholdDialog *td;
|
||||
GimpTool *active_tool;
|
||||
|
||||
td = (ThresholdDialog *) data;
|
||||
|
||||
@ -578,6 +590,8 @@ threshold_preview_update (GtkWidget *widget,
|
||||
td->preview = FALSE;
|
||||
if (td->image_map)
|
||||
{
|
||||
active_tool = tool_manager_get_active (the_gimp);
|
||||
|
||||
active_tool->preserve = TRUE;
|
||||
image_map_clear (td->image_map);
|
||||
active_tool->preserve = FALSE;
|
||||
|
||||
Reference in New Issue
Block a user