mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-19 22:34:37 +00:00
app/Makefile.am removed.
2001-07-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/drawable.[ch]: removed. * app/core/gimpdrawable.[ch]: added the functions here. Made an end to the myth that FG/BG and the undo system (!!!) are not really part of the core. * app/disp_callbacks.c * app/floating_sel.c * app/image_map.c * app/qmask.c * app/undo.c * app/core/gimpchannel.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-offset.c * app/core/gimpedit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimpimage-new.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/core/gimplayermask.c * app/gui/channels-commands.c * app/gui/gui.c * app/gui/layers-commands.c * app/tools/gimpairbrushtool.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcurvestool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimpscaletool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/tool_manager.c * app/widgets/gimpchannellistitem.c * app/widgets/gimpchannellistview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * app/pdb/channel_cmds.c * app/pdb/color_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * app/pdb/floating_sel_cmds.c * app/pdb/image_cmds.c * app/pdb/layer_cmds.c * app/pdb/parasite_cmds.c * app/pdb/selection_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/tools_cmds.c * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb: changed accordingly. Misc small fixes and cleanups.
This commit is contained in:
parent
3196563c14
commit
37ce6b9ac8
70
ChangeLog
70
ChangeLog
|
@ -1,3 +1,73 @@
|
|||
2001-07-08 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/Makefile.am
|
||||
* app/drawable.[ch]: removed.
|
||||
|
||||
* app/core/gimpdrawable.[ch]: added the functions here. Made an
|
||||
end to the myth that FG/BG and the undo system (!!!) are not
|
||||
really part of the core.
|
||||
|
||||
* app/disp_callbacks.c
|
||||
* app/floating_sel.c
|
||||
* app/image_map.c
|
||||
* app/qmask.c
|
||||
* app/undo.c
|
||||
* app/core/gimpchannel.c
|
||||
* app/core/gimpdrawable-desaturate.c
|
||||
* app/core/gimpdrawable-equalize.c
|
||||
* app/core/gimpdrawable-invert.c
|
||||
* app/core/gimpdrawable-offset.c
|
||||
* app/core/gimpedit.c
|
||||
* app/core/gimpimage-duplicate.c
|
||||
* app/core/gimpimage-mask.c
|
||||
* app/core/gimpimage-new.c
|
||||
* app/core/gimpimage.[ch]
|
||||
* app/core/gimplayer.c
|
||||
* app/core/gimplayermask.c
|
||||
* app/gui/channels-commands.c
|
||||
* app/gui/gui.c
|
||||
* app/gui/layers-commands.c
|
||||
* app/tools/gimpairbrushtool.c
|
||||
* app/tools/gimpbezierselecttool.c
|
||||
* app/tools/gimpblendtool.c
|
||||
* app/tools/gimpbrightnesscontrasttool.c
|
||||
* app/tools/gimpbucketfilltool.c
|
||||
* app/tools/gimpclonetool.c
|
||||
* app/tools/gimpcolorbalancetool.c
|
||||
* app/tools/gimpconvolvetool.c
|
||||
* app/tools/gimpcurvestool.c
|
||||
* app/tools/gimphistogramtool.c
|
||||
* app/tools/gimphuesaturationtool.c
|
||||
* app/tools/gimpinktool.c
|
||||
* app/tools/gimpiscissorstool.c
|
||||
* app/tools/gimplevelstool.c
|
||||
* app/tools/gimppainttool.c
|
||||
* app/tools/gimpposterizetool.c
|
||||
* app/tools/gimpscaletool.c
|
||||
* app/tools/gimpthresholdtool.c
|
||||
* app/tools/gimptransformtool.c
|
||||
* app/tools/tool_manager.c
|
||||
* app/widgets/gimpchannellistitem.c
|
||||
* app/widgets/gimpchannellistview.c
|
||||
* app/widgets/gimpdrawablelistitem.c
|
||||
* app/widgets/gimplayerlistitem.c
|
||||
* app/widgets/gimplayerlistview.c
|
||||
* app/pdb/channel_cmds.c
|
||||
* app/pdb/color_cmds.c
|
||||
* app/pdb/drawable_cmds.c
|
||||
* app/pdb/edit_cmds.c
|
||||
* app/pdb/floating_sel_cmds.c
|
||||
* app/pdb/image_cmds.c
|
||||
* app/pdb/layer_cmds.c
|
||||
* app/pdb/parasite_cmds.c
|
||||
* app/pdb/selection_cmds.c
|
||||
* app/pdb/text_tool_cmds.c
|
||||
* app/pdb/tools_cmds.c
|
||||
* tools/pdbgen/pdb.pl
|
||||
* tools/pdbgen/pdb/color.pdb
|
||||
* tools/pdbgen/pdb/drawable.pdb: changed accordingly. Misc small
|
||||
fixes and cleanups.
|
||||
|
||||
2001-07-07 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/Makefile.am
|
||||
|
|
|
@ -81,8 +81,6 @@ gimp_SOURCES = @STRIP_BEGIN@ \
|
|||
##
|
||||
datafiles.c \
|
||||
datafiles.h \
|
||||
drawable.c \
|
||||
drawable.h \
|
||||
floating_sel.c \
|
||||
floating_sel.h \
|
||||
gimpparasite.c \
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include "menus.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
@ -316,9 +315,9 @@ new_channel_query_ok_callback (GtkWidget *widget,
|
|||
channel_name,
|
||||
&channel_color);
|
||||
|
||||
drawable_fill (GIMP_DRAWABLE (new_channel),
|
||||
gimp_get_user_context (the_gimp),
|
||||
TRANSPARENT_FILL);
|
||||
gimp_drawable_fill_by_type (GIMP_DRAWABLE (new_channel),
|
||||
gimp_get_user_context (the_gimp),
|
||||
TRANSPARENT_FILL);
|
||||
|
||||
gimp_image_add_channel (gimage, new_channel, -1);
|
||||
gdisplays_flush ();
|
||||
|
@ -465,12 +464,7 @@ edit_channel_query_ok_callback (GtkWidget *widget,
|
|||
|
||||
if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
|
||||
{
|
||||
channel->color = color;
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
gimp_channel_set_color (channel, &color);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
#include "resize-dialog.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "floating_sel.h"
|
||||
#include "undo.h"
|
||||
|
@ -246,7 +245,7 @@ layers_delete_cmd_callback (GtkWidget *widget,
|
|||
else
|
||||
gimp_image_remove_layer (gimage, layer);
|
||||
|
||||
gdisplays_flush_now ();
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -544,9 +543,9 @@ new_layer_query_ok_callback (GtkWidget *widget,
|
|||
layer_name, OPAQUE_OPACITY, NORMAL_MODE);
|
||||
if (layer)
|
||||
{
|
||||
drawable_fill (GIMP_DRAWABLE (layer),
|
||||
gimp_get_user_context (the_gimp),
|
||||
fill_type);
|
||||
gimp_drawable_fill_by_type (GIMP_DRAWABLE (layer),
|
||||
gimp_get_user_context (gimage->gimp),
|
||||
fill_type);
|
||||
gimp_image_add_layer (gimage, layer, -1);
|
||||
|
||||
/* End the group undo */
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include "widgets/gimpcolorpanel.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplay.h"
|
||||
#include "qmask.h"
|
||||
|
@ -51,11 +50,11 @@ typedef struct _EditQmaskOptions EditQmaskOptions;
|
|||
|
||||
struct _EditQmaskOptions
|
||||
{
|
||||
GtkWidget *query_box;
|
||||
GtkWidget *name_entry;
|
||||
GtkWidget *color_panel;
|
||||
GtkWidget *query_box;
|
||||
GtkWidget *name_entry;
|
||||
GtkWidget *color_panel;
|
||||
|
||||
GimpImage *gimage;
|
||||
GimpImage *gimage;
|
||||
};
|
||||
|
||||
|
||||
|
@ -104,7 +103,7 @@ qmask_removed_callback (GtkObject *qmask,
|
|||
|
||||
if (!gdisp->gimage)
|
||||
return;
|
||||
|
||||
|
||||
gdisp->gimage->qmask_state = FALSE;
|
||||
|
||||
qmask_buttons_update (gdisp);
|
||||
|
@ -120,34 +119,34 @@ qmask_buttons_update (GDisplay *gdisp)
|
|||
if (gdisp->gimage->qmask_state != GTK_TOGGLE_BUTTON (gdisp->qmaskon)->active)
|
||||
{
|
||||
/* Disable toggle from doing anything */
|
||||
gtk_signal_handler_block_by_func(GTK_OBJECT(gdisp->qmaskoff),
|
||||
(GtkSignalFunc) qmask_deactivate,
|
||||
gdisp);
|
||||
gtk_signal_handler_block_by_func(GTK_OBJECT(gdisp->qmaskon),
|
||||
(GtkSignalFunc) qmask_activate,
|
||||
gdisp);
|
||||
gtk_signal_handler_block_by_func (GTK_OBJECT (gdisp->qmaskoff),
|
||||
GTK_SIGNAL_FUNC (qmask_deactivate),
|
||||
gdisp);
|
||||
gtk_signal_handler_block_by_func (GTK_OBJECT (gdisp->qmaskon),
|
||||
GTK_SIGNAL_FUNC (qmask_activate),
|
||||
gdisp);
|
||||
|
||||
/* Change the state of the buttons */
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gdisp->qmaskon),
|
||||
gdisp->gimage->qmask_state);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gdisp->qmaskon),
|
||||
gdisp->gimage->qmask_state);
|
||||
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gdisp->qmaskoff),
|
||||
!gdisp->gimage->qmask_state);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gdisp->qmaskoff),
|
||||
! gdisp->gimage->qmask_state);
|
||||
|
||||
/* Enable toggle again */
|
||||
gtk_signal_handler_unblock_by_func(GTK_OBJECT(gdisp->qmaskoff),
|
||||
(GtkSignalFunc) qmask_deactivate,
|
||||
gdisp);
|
||||
gtk_signal_handler_unblock_by_func(GTK_OBJECT(gdisp->qmaskon),
|
||||
(GtkSignalFunc) qmask_activate,
|
||||
gdisp);
|
||||
gtk_signal_handler_unblock_by_func (GTK_OBJECT (gdisp->qmaskoff),
|
||||
GTK_SIGNAL_FUNC (qmask_deactivate),
|
||||
gdisp);
|
||||
gtk_signal_handler_unblock_by_func (GTK_OBJECT (gdisp->qmaskon),
|
||||
GTK_SIGNAL_FUNC (qmask_activate),
|
||||
gdisp);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
qmask_click_handler (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
void
|
||||
qmask_click_handler (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
|
||||
|
@ -164,28 +163,29 @@ void
|
|||
qmask_deactivate (GtkWidget *widget,
|
||||
GDisplay *gdisp)
|
||||
{
|
||||
GimpImage *gimg;
|
||||
GimpImage *gimage;
|
||||
GimpChannel *gmask;
|
||||
|
||||
if (gdisp)
|
||||
{
|
||||
gimg = gdisp->gimage;
|
||||
if (!gimg)
|
||||
gimage = gdisp->gimage;
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
|
||||
if (!gdisp->gimage->qmask_state)
|
||||
return; /* if already set do nothing */
|
||||
|
||||
if ( (gmask = gimp_image_get_channel_by_name (gimg, "Qmask")) )
|
||||
if ( (gmask = gimp_image_get_channel_by_name (gimage, "Qmask")) )
|
||||
{
|
||||
undo_push_group_start (gimg, QMASK_UNDO);
|
||||
undo_push_group_start (gimage, QMASK_UNDO);
|
||||
/* push the undo here since removing the mask will
|
||||
call the qmask_removed_callback() which will set
|
||||
the qmask_state to FALSE */
|
||||
undo_push_qmask (gimg);
|
||||
gimage_mask_load (gimg, gmask);
|
||||
gimp_image_remove_channel (gimg, gmask);
|
||||
undo_push_group_end (gimg);
|
||||
undo_push_qmask (gimage);
|
||||
gimage_mask_load (gimage, gmask);
|
||||
gimp_image_remove_channel (gimage, gmask);
|
||||
undo_push_group_end (gimage);
|
||||
}
|
||||
|
||||
gdisp->gimage->qmask_state = FALSE;
|
||||
|
@ -199,65 +199,64 @@ void
|
|||
qmask_activate (GtkWidget *widget,
|
||||
GDisplay *gdisp)
|
||||
{
|
||||
GimpImage *gimg;
|
||||
GimpImage *gimage;
|
||||
GimpChannel *gmask;
|
||||
GimpLayer *layer;
|
||||
GimpRGB color;
|
||||
|
||||
if (gdisp)
|
||||
{
|
||||
gimg = gdisp->gimage;
|
||||
if (!gimg)
|
||||
gimage = gdisp->gimage;
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
|
||||
if (gdisp->gimage->qmask_state)
|
||||
return; /* If already set, do nothing */
|
||||
|
||||
/* Set the defaults */
|
||||
color = gimg->qmask_color;
|
||||
color = gimage->qmask_color;
|
||||
|
||||
if ((gmask = gimp_image_get_channel_by_name (gimg, "Qmask")))
|
||||
if ((gmask = gimp_image_get_channel_by_name (gimage, "Qmask")))
|
||||
{
|
||||
gimg->qmask_state = TRUE;
|
||||
gimage->qmask_state = TRUE;
|
||||
/* if the user was clever and created his own */
|
||||
return;
|
||||
}
|
||||
|
||||
undo_push_group_start (gimg, QMASK_UNDO);
|
||||
undo_push_group_start (gimage, QMASK_UNDO);
|
||||
|
||||
if (gimage_mask_is_empty (gimg))
|
||||
if (gimage_mask_is_empty (gimage))
|
||||
{
|
||||
/* if no selection */
|
||||
|
||||
if ((layer = gimp_image_floating_sel (gimg)))
|
||||
if ((layer = gimp_image_floating_sel (gimage)))
|
||||
{
|
||||
floating_sel_to_layer (layer);
|
||||
}
|
||||
|
||||
gmask = gimp_channel_new (gimg,
|
||||
gimg->width,
|
||||
gimg->height,
|
||||
gmask = gimp_channel_new (gimage,
|
||||
gimage->width,
|
||||
gimage->height,
|
||||
"Qmask",
|
||||
&color);
|
||||
gimp_image_add_channel (gimg, gmask, 0);
|
||||
gimp_image_add_channel (gimage, gmask, 0);
|
||||
|
||||
drawable_fill (GIMP_DRAWABLE (gmask),
|
||||
gimp_get_user_context (gimg->gimp),
|
||||
TRANSPARENT_FILL);
|
||||
gimp_drawable_fill_by_type (GIMP_DRAWABLE (gmask),
|
||||
gimp_get_user_context (gimage->gimp),
|
||||
TRANSPARENT_FILL);
|
||||
}
|
||||
else
|
||||
else /* if selection */
|
||||
{
|
||||
/* if selection */
|
||||
|
||||
gmask = gimp_channel_copy (gimp_image_get_mask (gimg), TRUE);
|
||||
gimp_image_add_channel (gimg, gmask, 0);
|
||||
gmask = gimp_channel_copy (gimp_image_get_mask (gimage), TRUE);
|
||||
gimp_image_add_channel (gimage, gmask, 0);
|
||||
gimp_channel_set_color (gmask, &color);
|
||||
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
|
||||
gimage_mask_none (gimg); /* Clear the selection */
|
||||
gimage_mask_none (gimage); /* Clear the selection */
|
||||
}
|
||||
|
||||
undo_push_qmask (gimg);
|
||||
undo_push_group_end (gimg);
|
||||
undo_push_qmask (gimage);
|
||||
undo_push_group_end (gimage);
|
||||
gdisp->gimage->qmask_state = TRUE;
|
||||
gdisplays_flush ();
|
||||
|
||||
|
@ -368,12 +367,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
|
|||
|
||||
if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
|
||||
{
|
||||
channel->color = color;
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
gimp_channel_set_color (channel, &color);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include "widgets/gimpcolorpanel.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplay.h"
|
||||
#include "qmask.h"
|
||||
|
@ -51,11 +50,11 @@ typedef struct _EditQmaskOptions EditQmaskOptions;
|
|||
|
||||
struct _EditQmaskOptions
|
||||
{
|
||||
GtkWidget *query_box;
|
||||
GtkWidget *name_entry;
|
||||
GtkWidget *color_panel;
|
||||
GtkWidget *query_box;
|
||||
GtkWidget *name_entry;
|
||||
GtkWidget *color_panel;
|
||||
|
||||
GimpImage *gimage;
|
||||
GimpImage *gimage;
|
||||
};
|
||||
|
||||
|
||||
|
@ -104,7 +103,7 @@ qmask_removed_callback (GtkObject *qmask,
|
|||
|
||||
if (!gdisp->gimage)
|
||||
return;
|
||||
|
||||
|
||||
gdisp->gimage->qmask_state = FALSE;
|
||||
|
||||
qmask_buttons_update (gdisp);
|
||||
|
@ -120,34 +119,34 @@ qmask_buttons_update (GDisplay *gdisp)
|
|||
if (gdisp->gimage->qmask_state != GTK_TOGGLE_BUTTON (gdisp->qmaskon)->active)
|
||||
{
|
||||
/* Disable toggle from doing anything */
|
||||
gtk_signal_handler_block_by_func(GTK_OBJECT(gdisp->qmaskoff),
|
||||
(GtkSignalFunc) qmask_deactivate,
|
||||
gdisp);
|
||||
gtk_signal_handler_block_by_func(GTK_OBJECT(gdisp->qmaskon),
|
||||
(GtkSignalFunc) qmask_activate,
|
||||
gdisp);
|
||||
gtk_signal_handler_block_by_func (GTK_OBJECT (gdisp->qmaskoff),
|
||||
GTK_SIGNAL_FUNC (qmask_deactivate),
|
||||
gdisp);
|
||||
gtk_signal_handler_block_by_func (GTK_OBJECT (gdisp->qmaskon),
|
||||
GTK_SIGNAL_FUNC (qmask_activate),
|
||||
gdisp);
|
||||
|
||||
/* Change the state of the buttons */
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gdisp->qmaskon),
|
||||
gdisp->gimage->qmask_state);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gdisp->qmaskon),
|
||||
gdisp->gimage->qmask_state);
|
||||
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gdisp->qmaskoff),
|
||||
!gdisp->gimage->qmask_state);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gdisp->qmaskoff),
|
||||
! gdisp->gimage->qmask_state);
|
||||
|
||||
/* Enable toggle again */
|
||||
gtk_signal_handler_unblock_by_func(GTK_OBJECT(gdisp->qmaskoff),
|
||||
(GtkSignalFunc) qmask_deactivate,
|
||||
gdisp);
|
||||
gtk_signal_handler_unblock_by_func(GTK_OBJECT(gdisp->qmaskon),
|
||||
(GtkSignalFunc) qmask_activate,
|
||||
gdisp);
|
||||
gtk_signal_handler_unblock_by_func (GTK_OBJECT (gdisp->qmaskoff),
|
||||
GTK_SIGNAL_FUNC (qmask_deactivate),
|
||||
gdisp);
|
||||
gtk_signal_handler_unblock_by_func (GTK_OBJECT (gdisp->qmaskon),
|
||||
GTK_SIGNAL_FUNC (qmask_activate),
|
||||
gdisp);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
qmask_click_handler (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
void
|
||||
qmask_click_handler (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
|
||||
|
@ -164,28 +163,29 @@ void
|
|||
qmask_deactivate (GtkWidget *widget,
|
||||
GDisplay *gdisp)
|
||||
{
|
||||
GimpImage *gimg;
|
||||
GimpImage *gimage;
|
||||
GimpChannel *gmask;
|
||||
|
||||
if (gdisp)
|
||||
{
|
||||
gimg = gdisp->gimage;
|
||||
if (!gimg)
|
||||
gimage = gdisp->gimage;
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
|
||||
if (!gdisp->gimage->qmask_state)
|
||||
return; /* if already set do nothing */
|
||||
|
||||
if ( (gmask = gimp_image_get_channel_by_name (gimg, "Qmask")) )
|
||||
if ( (gmask = gimp_image_get_channel_by_name (gimage, "Qmask")) )
|
||||
{
|
||||
undo_push_group_start (gimg, QMASK_UNDO);
|
||||
undo_push_group_start (gimage, QMASK_UNDO);
|
||||
/* push the undo here since removing the mask will
|
||||
call the qmask_removed_callback() which will set
|
||||
the qmask_state to FALSE */
|
||||
undo_push_qmask (gimg);
|
||||
gimage_mask_load (gimg, gmask);
|
||||
gimp_image_remove_channel (gimg, gmask);
|
||||
undo_push_group_end (gimg);
|
||||
undo_push_qmask (gimage);
|
||||
gimage_mask_load (gimage, gmask);
|
||||
gimp_image_remove_channel (gimage, gmask);
|
||||
undo_push_group_end (gimage);
|
||||
}
|
||||
|
||||
gdisp->gimage->qmask_state = FALSE;
|
||||
|
@ -199,65 +199,64 @@ void
|
|||
qmask_activate (GtkWidget *widget,
|
||||
GDisplay *gdisp)
|
||||
{
|
||||
GimpImage *gimg;
|
||||
GimpImage *gimage;
|
||||
GimpChannel *gmask;
|
||||
GimpLayer *layer;
|
||||
GimpRGB color;
|
||||
|
||||
if (gdisp)
|
||||
{
|
||||
gimg = gdisp->gimage;
|
||||
if (!gimg)
|
||||
gimage = gdisp->gimage;
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
|
||||
if (gdisp->gimage->qmask_state)
|
||||
return; /* If already set, do nothing */
|
||||
|
||||
/* Set the defaults */
|
||||
color = gimg->qmask_color;
|
||||
color = gimage->qmask_color;
|
||||
|
||||
if ((gmask = gimp_image_get_channel_by_name (gimg, "Qmask")))
|
||||
if ((gmask = gimp_image_get_channel_by_name (gimage, "Qmask")))
|
||||
{
|
||||
gimg->qmask_state = TRUE;
|
||||
gimage->qmask_state = TRUE;
|
||||
/* if the user was clever and created his own */
|
||||
return;
|
||||
}
|
||||
|
||||
undo_push_group_start (gimg, QMASK_UNDO);
|
||||
undo_push_group_start (gimage, QMASK_UNDO);
|
||||
|
||||
if (gimage_mask_is_empty (gimg))
|
||||
if (gimage_mask_is_empty (gimage))
|
||||
{
|
||||
/* if no selection */
|
||||
|
||||
if ((layer = gimp_image_floating_sel (gimg)))
|
||||
if ((layer = gimp_image_floating_sel (gimage)))
|
||||
{
|
||||
floating_sel_to_layer (layer);
|
||||
}
|
||||
|
||||
gmask = gimp_channel_new (gimg,
|
||||
gimg->width,
|
||||
gimg->height,
|
||||
gmask = gimp_channel_new (gimage,
|
||||
gimage->width,
|
||||
gimage->height,
|
||||
"Qmask",
|
||||
&color);
|
||||
gimp_image_add_channel (gimg, gmask, 0);
|
||||
gimp_image_add_channel (gimage, gmask, 0);
|
||||
|
||||
drawable_fill (GIMP_DRAWABLE (gmask),
|
||||
gimp_get_user_context (gimg->gimp),
|
||||
TRANSPARENT_FILL);
|
||||
gimp_drawable_fill_by_type (GIMP_DRAWABLE (gmask),
|
||||
gimp_get_user_context (gimage->gimp),
|
||||
TRANSPARENT_FILL);
|
||||
}
|
||||
else
|
||||
else /* if selection */
|
||||
{
|
||||
/* if selection */
|
||||
|
||||
gmask = gimp_channel_copy (gimp_image_get_mask (gimg), TRUE);
|
||||
gimp_image_add_channel (gimg, gmask, 0);
|
||||
gmask = gimp_channel_copy (gimp_image_get_mask (gimage), TRUE);
|
||||
gimp_image_add_channel (gimage, gmask, 0);
|
||||
gimp_channel_set_color (gmask, &color);
|
||||
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
|
||||
gimage_mask_none (gimg); /* Clear the selection */
|
||||
gimage_mask_none (gimage); /* Clear the selection */
|
||||
}
|
||||
|
||||
undo_push_qmask (gimg);
|
||||
undo_push_group_end (gimg);
|
||||
undo_push_qmask (gimage);
|
||||
undo_push_group_end (gimage);
|
||||
gdisp->gimage->qmask_state = TRUE;
|
||||
gdisplays_flush ();
|
||||
|
||||
|
@ -368,12 +367,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
|
|||
|
||||
if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
|
||||
{
|
||||
channel->color = color;
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
gimp_channel_set_color (channel, &color);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include "tool_options.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "image_map.h"
|
||||
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
#include "tool_options.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "image_map.h"
|
||||
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include "tool_options.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "image_map.h"
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include "tool_options.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "image_map.h"
|
||||
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
#include "gimplist.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "undo.h"
|
||||
|
||||
|
@ -315,9 +314,9 @@ gimp_edit_clear (GimpImage *gimage,
|
|||
ERASE_MODE, NULL, x1, y1);
|
||||
|
||||
/* update the image */
|
||||
drawable_update (drawable,
|
||||
x1, y1,
|
||||
(x2 - x1), (y2 - y1));
|
||||
gimp_drawable_update (drawable,
|
||||
x1, y1,
|
||||
(x2 - x1), (y2 - y1));
|
||||
|
||||
/* free the temporary tiles */
|
||||
tile_manager_destroy (buf_tiles);
|
||||
|
@ -391,9 +390,9 @@ gimp_edit_fill (GimpImage *gimage,
|
|||
NORMAL_MODE, NULL, x1, y1);
|
||||
|
||||
/* update the image */
|
||||
drawable_update (drawable,
|
||||
x1, y1,
|
||||
(x2 - x1), (y2 - y1));
|
||||
gimp_drawable_update (drawable,
|
||||
x1, y1,
|
||||
(x2 - x1), (y2 - y1));
|
||||
|
||||
/* free the temporary tiles */
|
||||
tile_manager_destroy (buf_tiles);
|
||||
|
|
|
@ -59,7 +59,6 @@
|
|||
#include "gimpfliptool.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "undo.h"
|
||||
#include "path_transform.h"
|
||||
|
@ -1665,10 +1664,10 @@ gimp_transform_tool_paste (GimpImage *gimage,
|
|||
if (floating_layer)
|
||||
floating_sel_rigor (floating_layer, TRUE);
|
||||
|
||||
drawable_update (drawable,
|
||||
0, 0,
|
||||
gimp_drawable_width (drawable),
|
||||
gimp_drawable_height (drawable));
|
||||
gimp_drawable_update (drawable,
|
||||
0, 0,
|
||||
gimp_drawable_width (drawable),
|
||||
gimp_drawable_height (drawable));
|
||||
|
||||
/* if we were operating on the floating selection, then it's boundary
|
||||
* and previews need invalidating
|
||||
|
|
|
@ -39,11 +39,11 @@
|
|||
|
||||
#include "paint-funcs/paint-funcs.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpimage-mask.h"
|
||||
#include "gimpchannel.h"
|
||||
#include "gimplayer.h"
|
||||
|
||||
#include "parasitelist.h"
|
||||
#include "undo.h"
|
||||
|
||||
|
@ -244,7 +244,15 @@ gimp_channel_set_color (GimpChannel *channel,
|
|||
g_return_if_fail (GIMP_IS_CHANNEL (channel));
|
||||
g_return_if_fail (color != NULL);
|
||||
|
||||
channel->color = *color;
|
||||
if (gimp_rgba_distance (&channel->color, color) > 0.0001)
|
||||
{
|
||||
channel->color = *color;
|
||||
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
}
|
||||
}
|
||||
|
||||
const GimpRGB *
|
||||
|
@ -289,10 +297,10 @@ gimp_channel_scale (GimpChannel *channel,
|
|||
return;
|
||||
|
||||
/* Update the old channel position */
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
|
||||
/* Configure the pixel regions */
|
||||
pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles,
|
||||
|
@ -319,10 +327,10 @@ gimp_channel_scale (GimpChannel *channel,
|
|||
channel->bounds_known = FALSE;
|
||||
|
||||
/* Update the new channel position */
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -372,10 +380,10 @@ gimp_channel_resize (GimpChannel *channel,
|
|||
}
|
||||
|
||||
/* Update the old channel position */
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
|
||||
/* Configure the pixel regions */
|
||||
pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles,
|
||||
|
@ -416,10 +424,10 @@ gimp_channel_resize (GimpChannel *channel,
|
|||
channel->bounds_known = FALSE;
|
||||
|
||||
/* update the new channel area */
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -39,11 +39,11 @@
|
|||
|
||||
#include "paint-funcs/paint-funcs.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpimage-mask.h"
|
||||
#include "gimpchannel.h"
|
||||
#include "gimplayer.h"
|
||||
|
||||
#include "parasitelist.h"
|
||||
#include "undo.h"
|
||||
|
||||
|
@ -244,7 +244,15 @@ gimp_channel_set_color (GimpChannel *channel,
|
|||
g_return_if_fail (GIMP_IS_CHANNEL (channel));
|
||||
g_return_if_fail (color != NULL);
|
||||
|
||||
channel->color = *color;
|
||||
if (gimp_rgba_distance (&channel->color, color) > 0.0001)
|
||||
{
|
||||
channel->color = *color;
|
||||
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
}
|
||||
}
|
||||
|
||||
const GimpRGB *
|
||||
|
@ -289,10 +297,10 @@ gimp_channel_scale (GimpChannel *channel,
|
|||
return;
|
||||
|
||||
/* Update the old channel position */
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
|
||||
/* Configure the pixel regions */
|
||||
pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles,
|
||||
|
@ -319,10 +327,10 @@ gimp_channel_scale (GimpChannel *channel,
|
|||
channel->bounds_known = FALSE;
|
||||
|
||||
/* Update the new channel position */
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -372,10 +380,10 @@ gimp_channel_resize (GimpChannel *channel,
|
|||
}
|
||||
|
||||
/* Update the old channel position */
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
|
||||
/* Configure the pixel regions */
|
||||
pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles,
|
||||
|
@ -416,10 +424,10 @@ gimp_channel_resize (GimpChannel *channel,
|
|||
channel->bounds_known = FALSE;
|
||||
|
||||
/* update the new channel area */
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
|
||||
#include "appenv.h"
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "errors.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpprogress.h"
|
||||
|
@ -954,7 +953,7 @@ blend (GimpImage *gimage,
|
|||
(opacity * 255) / 100, paint_mode, NULL, x1, y1);
|
||||
|
||||
/* update the image */
|
||||
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
gimp_drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
|
||||
/* free the temporary buffer */
|
||||
tile_manager_destroy (buf_tiles);
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
|
||||
#include "paint-funcs/paint-funcs.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimpdrawable-desaturate.h"
|
||||
#include "gimpimage.h"
|
||||
|
@ -95,5 +94,5 @@ gimp_drawable_desaturate (GimpDrawable *drawable)
|
|||
|
||||
gimp_drawable_merge_shadow (drawable, TRUE);
|
||||
|
||||
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
gimp_drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
}
|
||||
|
|
|
@ -33,8 +33,6 @@
|
|||
#include "gimpdrawable-histogram.h"
|
||||
#include "gimpimage.h"
|
||||
|
||||
#include "drawable.h"
|
||||
|
||||
|
||||
void
|
||||
gimp_drawable_equalize (GimpDrawable *drawable,
|
||||
|
@ -79,7 +77,7 @@ gimp_drawable_equalize (GimpDrawable *drawable,
|
|||
|
||||
gimp_drawable_merge_shadow (drawable, TRUE);
|
||||
|
||||
drawable_update (drawable,
|
||||
x1, y1,
|
||||
(x2 - x1), (y2 - y1));
|
||||
gimp_drawable_update (drawable,
|
||||
x1, y1,
|
||||
(x2 - x1), (y2 - y1));
|
||||
}
|
||||
|
|
|
@ -30,8 +30,6 @@
|
|||
#include "gimpdrawable.h"
|
||||
#include "gimpdrawable-invert.h"
|
||||
|
||||
#include "drawable.h"
|
||||
|
||||
|
||||
void
|
||||
gimp_drawable_invert (GimpDrawable *drawable)
|
||||
|
@ -55,7 +53,7 @@ gimp_drawable_invert (GimpDrawable *drawable)
|
|||
|
||||
gimp_drawable_merge_shadow (drawable, TRUE);
|
||||
|
||||
drawable_update (drawable,
|
||||
x1, y1,
|
||||
(x2 - x1), (y2 - y1));
|
||||
gimp_drawable_update (drawable,
|
||||
x1, y1,
|
||||
(x2 - x1), (y2 - y1));
|
||||
}
|
||||
|
|
|
@ -38,8 +38,6 @@
|
|||
#include "gimpdrawable-offset.h"
|
||||
#include "gimpimage.h"
|
||||
|
||||
#include "drawable.h"
|
||||
|
||||
|
||||
void
|
||||
gimp_drawable_offset (GimpDrawable *drawable,
|
||||
|
@ -309,20 +307,20 @@ gimp_drawable_offset (GimpDrawable *drawable,
|
|||
}
|
||||
|
||||
/* push an undo */
|
||||
drawable_apply_image (drawable,
|
||||
0, 0,
|
||||
gimp_drawable_width (drawable),
|
||||
gimp_drawable_height (drawable),
|
||||
gimp_drawable_data (drawable),
|
||||
FALSE);
|
||||
gimp_drawable_apply_image (drawable,
|
||||
0, 0,
|
||||
gimp_drawable_width (drawable),
|
||||
gimp_drawable_height (drawable),
|
||||
gimp_drawable_data (drawable),
|
||||
FALSE);
|
||||
|
||||
/* swap the tiles */
|
||||
drawable->tiles = new_tiles;
|
||||
|
||||
|
||||
/* update the drawable */
|
||||
drawable_update (drawable,
|
||||
0, 0,
|
||||
gimp_drawable_width (drawable),
|
||||
gimp_drawable_height (drawable));
|
||||
gimp_drawable_update (drawable,
|
||||
0, 0,
|
||||
gimp_drawable_width (drawable),
|
||||
gimp_drawable_height (drawable));
|
||||
}
|
||||
|
|
|
@ -59,7 +59,6 @@
|
|||
#include "gimpfliptool.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "undo.h"
|
||||
#include "path_transform.h"
|
||||
|
@ -1665,10 +1664,10 @@ gimp_transform_tool_paste (GimpImage *gimage,
|
|||
if (floating_layer)
|
||||
floating_sel_rigor (floating_layer, TRUE);
|
||||
|
||||
drawable_update (drawable,
|
||||
0, 0,
|
||||
gimp_drawable_width (drawable),
|
||||
gimp_drawable_height (drawable));
|
||||
gimp_drawable_update (drawable,
|
||||
0, 0,
|
||||
gimp_drawable_width (drawable),
|
||||
gimp_drawable_height (drawable));
|
||||
|
||||
/* if we were operating on the floating selection, then it's boundary
|
||||
* and previews need invalidating
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "paint-funcs/paint-funcs.h"
|
||||
|
||||
#include "gimpchannel.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimpdrawable-preview.h"
|
||||
#include "gimpimage.h"
|
||||
|
@ -136,14 +137,15 @@ gimp_drawable_class_init (GimpDrawableClass *klass)
|
|||
gtk_object_class_add_signals (object_class, gimp_drawable_signals,
|
||||
LAST_SIGNAL);
|
||||
|
||||
object_class->destroy = gimp_drawable_destroy;
|
||||
object_class->destroy = gimp_drawable_destroy;
|
||||
|
||||
gimp_object_class->name_changed = gimp_drawable_name_changed;
|
||||
gimp_object_class->name_changed = gimp_drawable_name_changed;
|
||||
|
||||
viewable_class->invalidate_preview = gimp_drawable_invalidate_preview;
|
||||
viewable_class->get_preview = gimp_drawable_get_preview;
|
||||
|
||||
klass->removed = NULL;
|
||||
klass->visibility_changed = NULL;
|
||||
klass->removed = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -407,6 +409,7 @@ gimp_drawable_set_gimage (GimpDrawable *drawable,
|
|||
GimpImage *gimage)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
|
||||
g_return_if_fail (! gimage || GIMP_IS_IMAGE (gimage));;
|
||||
|
||||
if (gimage == NULL)
|
||||
drawable->tattoo = 0;
|
||||
|
@ -416,9 +419,56 @@ gimp_drawable_set_gimage (GimpDrawable *drawable,
|
|||
drawable->gimage = gimage;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_drawable_update (GimpDrawable *drawable,
|
||||
gint x,
|
||||
gint y,
|
||||
gint w,
|
||||
gint h)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
gint offset_x;
|
||||
gint offset_y;
|
||||
|
||||
g_return_if_fail (drawable != NULL);
|
||||
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
|
||||
|
||||
gimage = gimp_drawable_gimage (drawable);
|
||||
|
||||
g_return_if_fail (gimage != NULL);
|
||||
|
||||
gimp_drawable_offsets (drawable, &offset_x, &offset_y);
|
||||
x += offset_x;
|
||||
y += offset_y;
|
||||
|
||||
gimp_image_update (gimage, x, y, w, h);
|
||||
|
||||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (drawable));
|
||||
}
|
||||
|
||||
void
|
||||
gimp_drawable_apply_image (GimpDrawable *drawable,
|
||||
gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2,
|
||||
TileManager *tiles,
|
||||
gint sparse)
|
||||
{
|
||||
g_return_if_fail (drawable != NULL);
|
||||
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
|
||||
|
||||
if (! tiles)
|
||||
undo_push_image (drawable->gimage, drawable,
|
||||
x1, y1, x2, y2);
|
||||
else
|
||||
undo_push_image_mod (drawable->gimage, drawable,
|
||||
x1, y1, x2, y2, tiles, sparse);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_drawable_merge_shadow (GimpDrawable *drawable,
|
||||
gint undo)
|
||||
gboolean undo)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
PixelRegion shadowPR;
|
||||
|
@ -508,6 +558,52 @@ gimp_drawable_fill (GimpDrawable *drawable,
|
|||
gimp_drawable_height (drawable),
|
||||
TRUE);
|
||||
color_region (&destPR, c);
|
||||
|
||||
gimp_drawable_update (drawable,
|
||||
0, 0,
|
||||
gimp_drawable_width (drawable),
|
||||
gimp_drawable_height (drawable));
|
||||
}
|
||||
|
||||
void
|
||||
gimp_drawable_fill_by_type (GimpDrawable *drawable,
|
||||
GimpContext *context,
|
||||
GimpFillType fill_type)
|
||||
{
|
||||
GimpRGB color;
|
||||
|
||||
g_return_if_fail (drawable != NULL);
|
||||
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
|
||||
|
||||
color.a = 1.0;
|
||||
|
||||
switch (fill_type)
|
||||
{
|
||||
case FOREGROUND_FILL:
|
||||
gimp_context_get_foreground (context, &color);
|
||||
break;
|
||||
|
||||
case BACKGROUND_FILL:
|
||||
gimp_context_get_background (context, &color);
|
||||
break;
|
||||
|
||||
case WHITE_FILL:
|
||||
gimp_rgb_set (&color, 1.0, 1.0, 1.0);
|
||||
break;
|
||||
|
||||
case TRANSPARENT_FILL:
|
||||
gimp_rgba_set (&color, 0.0, 0.0, 0.0, 0.0);
|
||||
break;
|
||||
|
||||
case NO_FILL:
|
||||
return;
|
||||
|
||||
default:
|
||||
g_warning ("gimp_drawable_fill_by_type(): unknown fill type");
|
||||
return;
|
||||
}
|
||||
|
||||
gimp_drawable_fill (drawable, &color);
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
@ -579,14 +675,12 @@ GimpImageType
|
|||
gimp_drawable_type_with_alpha (const GimpDrawable *drawable)
|
||||
{
|
||||
GimpImageType type;
|
||||
gboolean has_alpha;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
|
||||
|
||||
type = gimp_drawable_type (drawable);
|
||||
has_alpha = gimp_drawable_has_alpha (drawable);
|
||||
|
||||
if (has_alpha)
|
||||
if (gimp_drawable_has_alpha (drawable))
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
@ -595,11 +689,14 @@ gimp_drawable_type_with_alpha (const GimpDrawable *drawable)
|
|||
switch (type)
|
||||
{
|
||||
case RGB_GIMAGE:
|
||||
return RGBA_GIMAGE; break;
|
||||
return RGBA_GIMAGE;
|
||||
break;
|
||||
case GRAY_GIMAGE:
|
||||
return GRAYA_GIMAGE; break;
|
||||
return GRAYA_GIMAGE;
|
||||
break;
|
||||
case INDEXED_GIMAGE:
|
||||
return INDEXEDA_GIMAGE; break;
|
||||
return INDEXEDA_GIMAGE;
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
break;
|
||||
|
@ -633,6 +730,11 @@ gimp_drawable_set_visible (GimpDrawable *drawable,
|
|||
|
||||
gtk_signal_emit (GTK_OBJECT (drawable),
|
||||
gimp_drawable_signals[VISIBILITY_CHANGED]);
|
||||
|
||||
gimp_drawable_update (drawable,
|
||||
0, 0,
|
||||
drawable->width,
|
||||
drawable->height);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -82,10 +82,28 @@ GimpImage * gimp_drawable_gimage (const GimpDrawable *drawable);
|
|||
void gimp_drawable_set_gimage (GimpDrawable *drawable,
|
||||
GimpImage *gimage);
|
||||
|
||||
void gimp_drawable_update (GimpDrawable *drawable,
|
||||
gint x,
|
||||
gint y,
|
||||
gint w,
|
||||
gint h);
|
||||
|
||||
void gimp_drawable_apply_image (GimpDrawable *drawable,
|
||||
gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2,
|
||||
TileManager *tiles,
|
||||
gint sparse);
|
||||
|
||||
void gimp_drawable_merge_shadow (GimpDrawable *drawable,
|
||||
gint undo);
|
||||
gboolean undo);
|
||||
|
||||
void gimp_drawable_fill (GimpDrawable *drawable,
|
||||
const GimpRGB *color);
|
||||
void gimp_drawable_fill_by_type (GimpDrawable *drawable,
|
||||
GimpContext *context,
|
||||
GimpFillType fill_type);
|
||||
|
||||
gboolean gimp_drawable_mask_bounds (GimpDrawable *drawable,
|
||||
gint *x1,
|
||||
|
@ -106,9 +124,11 @@ TileManager * gimp_drawable_shadow (GimpDrawable *drawable);
|
|||
gint gimp_drawable_bytes (const GimpDrawable *drawable);
|
||||
gint gimp_drawable_width (const GimpDrawable *drawable);
|
||||
gint gimp_drawable_height (const GimpDrawable *drawable);
|
||||
|
||||
gboolean gimp_drawable_get_visible (const GimpDrawable *drawable);
|
||||
void gimp_drawable_set_visible (GimpDrawable *drawable,
|
||||
gboolean visible);
|
||||
|
||||
void gimp_drawable_offsets (const GimpDrawable *drawable,
|
||||
gint *offset_x,
|
||||
gint *offset_y);
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
#include "gimplist.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "undo.h"
|
||||
|
||||
|
@ -315,9 +314,9 @@ gimp_edit_clear (GimpImage *gimage,
|
|||
ERASE_MODE, NULL, x1, y1);
|
||||
|
||||
/* update the image */
|
||||
drawable_update (drawable,
|
||||
x1, y1,
|
||||
(x2 - x1), (y2 - y1));
|
||||
gimp_drawable_update (drawable,
|
||||
x1, y1,
|
||||
(x2 - x1), (y2 - y1));
|
||||
|
||||
/* free the temporary tiles */
|
||||
tile_manager_destroy (buf_tiles);
|
||||
|
@ -391,9 +390,9 @@ gimp_edit_fill (GimpImage *gimage,
|
|||
NORMAL_MODE, NULL, x1, y1);
|
||||
|
||||
/* update the image */
|
||||
drawable_update (drawable,
|
||||
x1, y1,
|
||||
(x2 - x1), (y2 - y1));
|
||||
gimp_drawable_update (drawable,
|
||||
x1, y1,
|
||||
(x2 - x1), (y2 - y1));
|
||||
|
||||
/* free the temporary tiles */
|
||||
tile_manager_destroy (buf_tiles);
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
#include "gimplist.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplay.h"
|
||||
#include "parasitelist.h"
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
#include "gimpundostack.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplay.h"
|
||||
#include "parasitelist.h"
|
||||
|
@ -172,7 +171,7 @@ enum
|
|||
|
||||
CLEAN,
|
||||
DIRTY,
|
||||
REPAINT,
|
||||
UPDATE,
|
||||
COLORMAP_CHANGED,
|
||||
UNDO_EVENT,
|
||||
LAST_SIGNAL
|
||||
|
@ -318,12 +317,12 @@ gimp_image_class_init (GimpImageClass *klass)
|
|||
gtk_signal_default_marshaller,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
gimp_image_signals[REPAINT] =
|
||||
gtk_signal_new ("repaint",
|
||||
gimp_image_signals[UPDATE] =
|
||||
gtk_signal_new ("update",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (GimpImageClass,
|
||||
repaint),
|
||||
update),
|
||||
gimp_marshal_NONE__INT_INT_INT_INT,
|
||||
GTK_TYPE_NONE, 4,
|
||||
GTK_TYPE_INT,
|
||||
|
@ -373,7 +372,7 @@ gimp_image_class_init (GimpImageClass *klass)
|
|||
|
||||
klass->clean = NULL;
|
||||
klass->dirty = NULL;
|
||||
klass->repaint = NULL;
|
||||
klass->update = NULL;
|
||||
klass->colormap_changed = gimp_image_real_colormap_changed;
|
||||
klass->undo_event = NULL;
|
||||
klass->undo = gimp_image_undo;
|
||||
|
@ -1216,7 +1215,7 @@ gimp_image_replace_image (GimpImage *gimage,
|
|||
|
||||
/* If the calling procedure specified an undo step... */
|
||||
if (undo)
|
||||
drawable_apply_image (drawable, x1, y1, x2, y2, NULL, FALSE);
|
||||
gimp_drawable_apply_image (drawable, x1, y1, x2, y2, NULL, FALSE);
|
||||
|
||||
/* configure the pixel regions
|
||||
* If an alternative to using the drawable's data as src1 was provided...
|
||||
|
@ -1746,6 +1745,20 @@ gimp_image_floating_selection_changed (GimpImage *gimage)
|
|||
gimp_image_signals[FLOATING_SELECTION_CHANGED]);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_image_update (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_IMAGE (gimage));
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[UPDATE],
|
||||
x, y, width, height);
|
||||
}
|
||||
|
||||
|
||||
/************************************************************/
|
||||
/* Projection functions */
|
||||
/************************************************************/
|
||||
|
@ -2918,7 +2931,6 @@ gimp_image_position_layer (GimpImage *gimage,
|
|||
gint new_index,
|
||||
gboolean push_undo)
|
||||
{
|
||||
gint x_min, y_min, x_max, y_max;
|
||||
gint off_x, off_y;
|
||||
gint index;
|
||||
gint num_layers;
|
||||
|
@ -2967,13 +2979,11 @@ gimp_image_position_layer (GimpImage *gimage,
|
|||
gimp_container_reorder (gimage->layers, GIMP_OBJECT (layer), new_index);
|
||||
|
||||
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
|
||||
x_min = off_x;
|
||||
y_min = off_y;
|
||||
x_max = off_x + gimp_drawable_width (GIMP_DRAWABLE (layer));
|
||||
y_max = off_y + gimp_drawable_height (GIMP_DRAWABLE (layer));
|
||||
gtk_signal_emit (GTK_OBJECT (gimage),
|
||||
gimp_image_signals[REPAINT],
|
||||
x_min, y_min, x_max, y_max);
|
||||
|
||||
gimp_image_update (gimage,
|
||||
off_x, off_y,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (layer)));
|
||||
|
||||
/* invalidate the composite preview */
|
||||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimage));
|
||||
|
@ -3420,10 +3430,10 @@ gimp_image_merge_layers (GimpImage *gimage,
|
|||
|
||||
gimp_drawable_set_visible (GIMP_DRAWABLE (merge_layer), TRUE);
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (merge_layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (merge_layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (merge_layer)));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (merge_layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (merge_layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (merge_layer)));
|
||||
|
||||
/*reinit_layer_idlerender (gimage, merge_layer);*/
|
||||
|
||||
|
@ -3510,13 +3520,10 @@ gimp_image_add_layer (GimpImage *gimage,
|
|||
gimp_image_set_active_layer (gimage, layer);
|
||||
|
||||
/* update the new layer's area */
|
||||
drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (layer)));
|
||||
|
||||
/* invalidate the composite preview */
|
||||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimage));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (layer)));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -3659,10 +3666,10 @@ gimp_image_position_channel (GimpImage *gimage,
|
|||
gimp_container_reorder (gimage->channels,
|
||||
GIMP_OBJECT (channel), new_index);
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -3710,10 +3717,10 @@ gimp_image_add_channel (GimpImage *gimage,
|
|||
|
||||
/* if channel is visible, update the image */
|
||||
if (gimp_drawable_get_visible (GIMP_DRAWABLE (channel)))
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -150,11 +150,11 @@ struct _GimpImageClass
|
|||
|
||||
void (* clean) (GimpImage *gimage);
|
||||
void (* dirty) (GimpImage *gimage);
|
||||
void (* repaint) (GimpImage *gimage,
|
||||
gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2);
|
||||
void (* update) (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void (* colormap_changed) (GimpImage *gimage,
|
||||
gint color_index);
|
||||
void (* undo_event) (GimpImage *gimage,
|
||||
|
@ -282,8 +282,13 @@ void gimp_image_colormap_changed (GimpImage *gimage,
|
|||
|
||||
void gimp_image_mode_changed (GimpImage *gimage);
|
||||
void gimp_image_alpha_changed (GimpImage *gimage);
|
||||
void gimp_image_floating_selection_changed (GimpImage *gimage);
|
||||
void gimp_image_mask_changed (GimpImage *gimage);
|
||||
void gimp_image_floating_selection_changed (GimpImage *gimage);
|
||||
void gimp_image_mask_changed (GimpImage *gimage);
|
||||
void gimp_image_update (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
|
||||
/* layer/channel functions */
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include "gimplayer.h"
|
||||
#include "gimplayermask.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplay.h"
|
||||
#include "undo.h"
|
||||
|
@ -154,13 +153,13 @@ gimage_mask_invalidate (GimpImage *gimage)
|
|||
layer = gimp_image_get_active_layer (gimage);
|
||||
|
||||
if (layer && gimp_layer_is_floating_sel (layer))
|
||||
drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
|
||||
/* Issue the MASK_CHANGED signal here */
|
||||
gimp_image_mask_changed(gimage);
|
||||
gimp_image_mask_changed (gimage);
|
||||
}
|
||||
|
||||
|
||||
|
@ -271,7 +270,7 @@ gimage_mask_extract (GimpImage *gimage,
|
|||
* push an undo
|
||||
*/
|
||||
if (cut_gimage && non_empty)
|
||||
drawable_apply_image (drawable, x1, y1, x2, y2, NULL, FALSE);
|
||||
gimp_drawable_apply_image (drawable, x1, y1, x2, y2, NULL, FALSE);
|
||||
|
||||
gimp_drawable_offsets (drawable, &off_x, &off_y);
|
||||
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
#include "gimpundostack.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplay.h"
|
||||
#include "parasitelist.h"
|
||||
|
@ -172,7 +171,7 @@ enum
|
|||
|
||||
CLEAN,
|
||||
DIRTY,
|
||||
REPAINT,
|
||||
UPDATE,
|
||||
COLORMAP_CHANGED,
|
||||
UNDO_EVENT,
|
||||
LAST_SIGNAL
|
||||
|
@ -318,12 +317,12 @@ gimp_image_class_init (GimpImageClass *klass)
|
|||
gtk_signal_default_marshaller,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
gimp_image_signals[REPAINT] =
|
||||
gtk_signal_new ("repaint",
|
||||
gimp_image_signals[UPDATE] =
|
||||
gtk_signal_new ("update",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (GimpImageClass,
|
||||
repaint),
|
||||
update),
|
||||
gimp_marshal_NONE__INT_INT_INT_INT,
|
||||
GTK_TYPE_NONE, 4,
|
||||
GTK_TYPE_INT,
|
||||
|
@ -373,7 +372,7 @@ gimp_image_class_init (GimpImageClass *klass)
|
|||
|
||||
klass->clean = NULL;
|
||||
klass->dirty = NULL;
|
||||
klass->repaint = NULL;
|
||||
klass->update = NULL;
|
||||
klass->colormap_changed = gimp_image_real_colormap_changed;
|
||||
klass->undo_event = NULL;
|
||||
klass->undo = gimp_image_undo;
|
||||
|
@ -1216,7 +1215,7 @@ gimp_image_replace_image (GimpImage *gimage,
|
|||
|
||||
/* If the calling procedure specified an undo step... */
|
||||
if (undo)
|
||||
drawable_apply_image (drawable, x1, y1, x2, y2, NULL, FALSE);
|
||||
gimp_drawable_apply_image (drawable, x1, y1, x2, y2, NULL, FALSE);
|
||||
|
||||
/* configure the pixel regions
|
||||
* If an alternative to using the drawable's data as src1 was provided...
|
||||
|
@ -1746,6 +1745,20 @@ gimp_image_floating_selection_changed (GimpImage *gimage)
|
|||
gimp_image_signals[FLOATING_SELECTION_CHANGED]);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_image_update (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_IMAGE (gimage));
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[UPDATE],
|
||||
x, y, width, height);
|
||||
}
|
||||
|
||||
|
||||
/************************************************************/
|
||||
/* Projection functions */
|
||||
/************************************************************/
|
||||
|
@ -2918,7 +2931,6 @@ gimp_image_position_layer (GimpImage *gimage,
|
|||
gint new_index,
|
||||
gboolean push_undo)
|
||||
{
|
||||
gint x_min, y_min, x_max, y_max;
|
||||
gint off_x, off_y;
|
||||
gint index;
|
||||
gint num_layers;
|
||||
|
@ -2967,13 +2979,11 @@ gimp_image_position_layer (GimpImage *gimage,
|
|||
gimp_container_reorder (gimage->layers, GIMP_OBJECT (layer), new_index);
|
||||
|
||||
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
|
||||
x_min = off_x;
|
||||
y_min = off_y;
|
||||
x_max = off_x + gimp_drawable_width (GIMP_DRAWABLE (layer));
|
||||
y_max = off_y + gimp_drawable_height (GIMP_DRAWABLE (layer));
|
||||
gtk_signal_emit (GTK_OBJECT (gimage),
|
||||
gimp_image_signals[REPAINT],
|
||||
x_min, y_min, x_max, y_max);
|
||||
|
||||
gimp_image_update (gimage,
|
||||
off_x, off_y,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (layer)));
|
||||
|
||||
/* invalidate the composite preview */
|
||||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimage));
|
||||
|
@ -3420,10 +3430,10 @@ gimp_image_merge_layers (GimpImage *gimage,
|
|||
|
||||
gimp_drawable_set_visible (GIMP_DRAWABLE (merge_layer), TRUE);
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (merge_layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (merge_layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (merge_layer)));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (merge_layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (merge_layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (merge_layer)));
|
||||
|
||||
/*reinit_layer_idlerender (gimage, merge_layer);*/
|
||||
|
||||
|
@ -3510,13 +3520,10 @@ gimp_image_add_layer (GimpImage *gimage,
|
|||
gimp_image_set_active_layer (gimage, layer);
|
||||
|
||||
/* update the new layer's area */
|
||||
drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (layer)));
|
||||
|
||||
/* invalidate the composite preview */
|
||||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimage));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (layer)));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -3659,10 +3666,10 @@ gimp_image_position_channel (GimpImage *gimage,
|
|||
gimp_container_reorder (gimage->channels,
|
||||
GIMP_OBJECT (channel), new_index);
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -3710,10 +3717,10 @@ gimp_image_add_channel (GimpImage *gimage,
|
|||
|
||||
/* if channel is visible, update the image */
|
||||
if (gimp_drawable_get_visible (GIMP_DRAWABLE (channel)))
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -150,11 +150,11 @@ struct _GimpImageClass
|
|||
|
||||
void (* clean) (GimpImage *gimage);
|
||||
void (* dirty) (GimpImage *gimage);
|
||||
void (* repaint) (GimpImage *gimage,
|
||||
gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2);
|
||||
void (* update) (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void (* colormap_changed) (GimpImage *gimage,
|
||||
gint color_index);
|
||||
void (* undo_event) (GimpImage *gimage,
|
||||
|
@ -282,8 +282,13 @@ void gimp_image_colormap_changed (GimpImage *gimage,
|
|||
|
||||
void gimp_image_mode_changed (GimpImage *gimage);
|
||||
void gimp_image_alpha_changed (GimpImage *gimage);
|
||||
void gimp_image_floating_selection_changed (GimpImage *gimage);
|
||||
void gimp_image_mask_changed (GimpImage *gimage);
|
||||
void gimp_image_floating_selection_changed (GimpImage *gimage);
|
||||
void gimp_image_mask_changed (GimpImage *gimage);
|
||||
void gimp_image_update (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
|
||||
/* layer/channel functions */
|
||||
|
|
|
@ -35,8 +35,6 @@
|
|||
#include "gimpimage-new.h"
|
||||
#include "gimplayer.h"
|
||||
|
||||
#include "drawable.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
|
@ -271,9 +269,9 @@ gimp_image_new_create_image (Gimp *gimp,
|
|||
gimp_image_add_layer (gimage, layer, 0);
|
||||
gimp_image_undo_enable (gimage);
|
||||
|
||||
drawable_fill (GIMP_DRAWABLE (layer),
|
||||
gimp_get_current_context (gimp),
|
||||
values->fill_type);
|
||||
gimp_drawable_fill_by_type (GIMP_DRAWABLE (layer),
|
||||
gimp_get_current_context (gimp),
|
||||
values->fill_type);
|
||||
|
||||
gimp_image_clean_all (gimage);
|
||||
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
#include "gimpundostack.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplay.h"
|
||||
#include "parasitelist.h"
|
||||
|
@ -172,7 +171,7 @@ enum
|
|||
|
||||
CLEAN,
|
||||
DIRTY,
|
||||
REPAINT,
|
||||
UPDATE,
|
||||
COLORMAP_CHANGED,
|
||||
UNDO_EVENT,
|
||||
LAST_SIGNAL
|
||||
|
@ -318,12 +317,12 @@ gimp_image_class_init (GimpImageClass *klass)
|
|||
gtk_signal_default_marshaller,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
gimp_image_signals[REPAINT] =
|
||||
gtk_signal_new ("repaint",
|
||||
gimp_image_signals[UPDATE] =
|
||||
gtk_signal_new ("update",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (GimpImageClass,
|
||||
repaint),
|
||||
update),
|
||||
gimp_marshal_NONE__INT_INT_INT_INT,
|
||||
GTK_TYPE_NONE, 4,
|
||||
GTK_TYPE_INT,
|
||||
|
@ -373,7 +372,7 @@ gimp_image_class_init (GimpImageClass *klass)
|
|||
|
||||
klass->clean = NULL;
|
||||
klass->dirty = NULL;
|
||||
klass->repaint = NULL;
|
||||
klass->update = NULL;
|
||||
klass->colormap_changed = gimp_image_real_colormap_changed;
|
||||
klass->undo_event = NULL;
|
||||
klass->undo = gimp_image_undo;
|
||||
|
@ -1216,7 +1215,7 @@ gimp_image_replace_image (GimpImage *gimage,
|
|||
|
||||
/* If the calling procedure specified an undo step... */
|
||||
if (undo)
|
||||
drawable_apply_image (drawable, x1, y1, x2, y2, NULL, FALSE);
|
||||
gimp_drawable_apply_image (drawable, x1, y1, x2, y2, NULL, FALSE);
|
||||
|
||||
/* configure the pixel regions
|
||||
* If an alternative to using the drawable's data as src1 was provided...
|
||||
|
@ -1746,6 +1745,20 @@ gimp_image_floating_selection_changed (GimpImage *gimage)
|
|||
gimp_image_signals[FLOATING_SELECTION_CHANGED]);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_image_update (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_IMAGE (gimage));
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[UPDATE],
|
||||
x, y, width, height);
|
||||
}
|
||||
|
||||
|
||||
/************************************************************/
|
||||
/* Projection functions */
|
||||
/************************************************************/
|
||||
|
@ -2918,7 +2931,6 @@ gimp_image_position_layer (GimpImage *gimage,
|
|||
gint new_index,
|
||||
gboolean push_undo)
|
||||
{
|
||||
gint x_min, y_min, x_max, y_max;
|
||||
gint off_x, off_y;
|
||||
gint index;
|
||||
gint num_layers;
|
||||
|
@ -2967,13 +2979,11 @@ gimp_image_position_layer (GimpImage *gimage,
|
|||
gimp_container_reorder (gimage->layers, GIMP_OBJECT (layer), new_index);
|
||||
|
||||
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
|
||||
x_min = off_x;
|
||||
y_min = off_y;
|
||||
x_max = off_x + gimp_drawable_width (GIMP_DRAWABLE (layer));
|
||||
y_max = off_y + gimp_drawable_height (GIMP_DRAWABLE (layer));
|
||||
gtk_signal_emit (GTK_OBJECT (gimage),
|
||||
gimp_image_signals[REPAINT],
|
||||
x_min, y_min, x_max, y_max);
|
||||
|
||||
gimp_image_update (gimage,
|
||||
off_x, off_y,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (layer)));
|
||||
|
||||
/* invalidate the composite preview */
|
||||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimage));
|
||||
|
@ -3420,10 +3430,10 @@ gimp_image_merge_layers (GimpImage *gimage,
|
|||
|
||||
gimp_drawable_set_visible (GIMP_DRAWABLE (merge_layer), TRUE);
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (merge_layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (merge_layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (merge_layer)));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (merge_layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (merge_layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (merge_layer)));
|
||||
|
||||
/*reinit_layer_idlerender (gimage, merge_layer);*/
|
||||
|
||||
|
@ -3510,13 +3520,10 @@ gimp_image_add_layer (GimpImage *gimage,
|
|||
gimp_image_set_active_layer (gimage, layer);
|
||||
|
||||
/* update the new layer's area */
|
||||
drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (layer)));
|
||||
|
||||
/* invalidate the composite preview */
|
||||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimage));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (layer)));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -3659,10 +3666,10 @@ gimp_image_position_channel (GimpImage *gimage,
|
|||
gimp_container_reorder (gimage->channels,
|
||||
GIMP_OBJECT (channel), new_index);
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -3710,10 +3717,10 @@ gimp_image_add_channel (GimpImage *gimage,
|
|||
|
||||
/* if channel is visible, update the image */
|
||||
if (gimp_drawable_get_visible (GIMP_DRAWABLE (channel)))
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -150,11 +150,11 @@ struct _GimpImageClass
|
|||
|
||||
void (* clean) (GimpImage *gimage);
|
||||
void (* dirty) (GimpImage *gimage);
|
||||
void (* repaint) (GimpImage *gimage,
|
||||
gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2);
|
||||
void (* update) (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void (* colormap_changed) (GimpImage *gimage,
|
||||
gint color_index);
|
||||
void (* undo_event) (GimpImage *gimage,
|
||||
|
@ -282,8 +282,13 @@ void gimp_image_colormap_changed (GimpImage *gimage,
|
|||
|
||||
void gimp_image_mode_changed (GimpImage *gimage);
|
||||
void gimp_image_alpha_changed (GimpImage *gimage);
|
||||
void gimp_image_floating_selection_changed (GimpImage *gimage);
|
||||
void gimp_image_mask_changed (GimpImage *gimage);
|
||||
void gimp_image_floating_selection_changed (GimpImage *gimage);
|
||||
void gimp_image_mask_changed (GimpImage *gimage);
|
||||
void gimp_image_update (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
|
||||
/* layer/channel functions */
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include "widgets/gimpcolorpanel.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplay.h"
|
||||
#include "qmask.h"
|
||||
|
@ -51,11 +50,11 @@ typedef struct _EditQmaskOptions EditQmaskOptions;
|
|||
|
||||
struct _EditQmaskOptions
|
||||
{
|
||||
GtkWidget *query_box;
|
||||
GtkWidget *name_entry;
|
||||
GtkWidget *color_panel;
|
||||
GtkWidget *query_box;
|
||||
GtkWidget *name_entry;
|
||||
GtkWidget *color_panel;
|
||||
|
||||
GimpImage *gimage;
|
||||
GimpImage *gimage;
|
||||
};
|
||||
|
||||
|
||||
|
@ -104,7 +103,7 @@ qmask_removed_callback (GtkObject *qmask,
|
|||
|
||||
if (!gdisp->gimage)
|
||||
return;
|
||||
|
||||
|
||||
gdisp->gimage->qmask_state = FALSE;
|
||||
|
||||
qmask_buttons_update (gdisp);
|
||||
|
@ -120,34 +119,34 @@ qmask_buttons_update (GDisplay *gdisp)
|
|||
if (gdisp->gimage->qmask_state != GTK_TOGGLE_BUTTON (gdisp->qmaskon)->active)
|
||||
{
|
||||
/* Disable toggle from doing anything */
|
||||
gtk_signal_handler_block_by_func(GTK_OBJECT(gdisp->qmaskoff),
|
||||
(GtkSignalFunc) qmask_deactivate,
|
||||
gdisp);
|
||||
gtk_signal_handler_block_by_func(GTK_OBJECT(gdisp->qmaskon),
|
||||
(GtkSignalFunc) qmask_activate,
|
||||
gdisp);
|
||||
gtk_signal_handler_block_by_func (GTK_OBJECT (gdisp->qmaskoff),
|
||||
GTK_SIGNAL_FUNC (qmask_deactivate),
|
||||
gdisp);
|
||||
gtk_signal_handler_block_by_func (GTK_OBJECT (gdisp->qmaskon),
|
||||
GTK_SIGNAL_FUNC (qmask_activate),
|
||||
gdisp);
|
||||
|
||||
/* Change the state of the buttons */
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gdisp->qmaskon),
|
||||
gdisp->gimage->qmask_state);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gdisp->qmaskon),
|
||||
gdisp->gimage->qmask_state);
|
||||
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gdisp->qmaskoff),
|
||||
!gdisp->gimage->qmask_state);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gdisp->qmaskoff),
|
||||
! gdisp->gimage->qmask_state);
|
||||
|
||||
/* Enable toggle again */
|
||||
gtk_signal_handler_unblock_by_func(GTK_OBJECT(gdisp->qmaskoff),
|
||||
(GtkSignalFunc) qmask_deactivate,
|
||||
gdisp);
|
||||
gtk_signal_handler_unblock_by_func(GTK_OBJECT(gdisp->qmaskon),
|
||||
(GtkSignalFunc) qmask_activate,
|
||||
gdisp);
|
||||
gtk_signal_handler_unblock_by_func (GTK_OBJECT (gdisp->qmaskoff),
|
||||
GTK_SIGNAL_FUNC (qmask_deactivate),
|
||||
gdisp);
|
||||
gtk_signal_handler_unblock_by_func (GTK_OBJECT (gdisp->qmaskon),
|
||||
GTK_SIGNAL_FUNC (qmask_activate),
|
||||
gdisp);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
qmask_click_handler (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
void
|
||||
qmask_click_handler (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
|
||||
|
@ -164,28 +163,29 @@ void
|
|||
qmask_deactivate (GtkWidget *widget,
|
||||
GDisplay *gdisp)
|
||||
{
|
||||
GimpImage *gimg;
|
||||
GimpImage *gimage;
|
||||
GimpChannel *gmask;
|
||||
|
||||
if (gdisp)
|
||||
{
|
||||
gimg = gdisp->gimage;
|
||||
if (!gimg)
|
||||
gimage = gdisp->gimage;
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
|
||||
if (!gdisp->gimage->qmask_state)
|
||||
return; /* if already set do nothing */
|
||||
|
||||
if ( (gmask = gimp_image_get_channel_by_name (gimg, "Qmask")) )
|
||||
if ( (gmask = gimp_image_get_channel_by_name (gimage, "Qmask")) )
|
||||
{
|
||||
undo_push_group_start (gimg, QMASK_UNDO);
|
||||
undo_push_group_start (gimage, QMASK_UNDO);
|
||||
/* push the undo here since removing the mask will
|
||||
call the qmask_removed_callback() which will set
|
||||
the qmask_state to FALSE */
|
||||
undo_push_qmask (gimg);
|
||||
gimage_mask_load (gimg, gmask);
|
||||
gimp_image_remove_channel (gimg, gmask);
|
||||
undo_push_group_end (gimg);
|
||||
undo_push_qmask (gimage);
|
||||
gimage_mask_load (gimage, gmask);
|
||||
gimp_image_remove_channel (gimage, gmask);
|
||||
undo_push_group_end (gimage);
|
||||
}
|
||||
|
||||
gdisp->gimage->qmask_state = FALSE;
|
||||
|
@ -199,65 +199,64 @@ void
|
|||
qmask_activate (GtkWidget *widget,
|
||||
GDisplay *gdisp)
|
||||
{
|
||||
GimpImage *gimg;
|
||||
GimpImage *gimage;
|
||||
GimpChannel *gmask;
|
||||
GimpLayer *layer;
|
||||
GimpRGB color;
|
||||
|
||||
if (gdisp)
|
||||
{
|
||||
gimg = gdisp->gimage;
|
||||
if (!gimg)
|
||||
gimage = gdisp->gimage;
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
|
||||
if (gdisp->gimage->qmask_state)
|
||||
return; /* If already set, do nothing */
|
||||
|
||||
/* Set the defaults */
|
||||
color = gimg->qmask_color;
|
||||
color = gimage->qmask_color;
|
||||
|
||||
if ((gmask = gimp_image_get_channel_by_name (gimg, "Qmask")))
|
||||
if ((gmask = gimp_image_get_channel_by_name (gimage, "Qmask")))
|
||||
{
|
||||
gimg->qmask_state = TRUE;
|
||||
gimage->qmask_state = TRUE;
|
||||
/* if the user was clever and created his own */
|
||||
return;
|
||||
}
|
||||
|
||||
undo_push_group_start (gimg, QMASK_UNDO);
|
||||
undo_push_group_start (gimage, QMASK_UNDO);
|
||||
|
||||
if (gimage_mask_is_empty (gimg))
|
||||
if (gimage_mask_is_empty (gimage))
|
||||
{
|
||||
/* if no selection */
|
||||
|
||||
if ((layer = gimp_image_floating_sel (gimg)))
|
||||
if ((layer = gimp_image_floating_sel (gimage)))
|
||||
{
|
||||
floating_sel_to_layer (layer);
|
||||
}
|
||||
|
||||
gmask = gimp_channel_new (gimg,
|
||||
gimg->width,
|
||||
gimg->height,
|
||||
gmask = gimp_channel_new (gimage,
|
||||
gimage->width,
|
||||
gimage->height,
|
||||
"Qmask",
|
||||
&color);
|
||||
gimp_image_add_channel (gimg, gmask, 0);
|
||||
gimp_image_add_channel (gimage, gmask, 0);
|
||||
|
||||
drawable_fill (GIMP_DRAWABLE (gmask),
|
||||
gimp_get_user_context (gimg->gimp),
|
||||
TRANSPARENT_FILL);
|
||||
gimp_drawable_fill_by_type (GIMP_DRAWABLE (gmask),
|
||||
gimp_get_user_context (gimage->gimp),
|
||||
TRANSPARENT_FILL);
|
||||
}
|
||||
else
|
||||
else /* if selection */
|
||||
{
|
||||
/* if selection */
|
||||
|
||||
gmask = gimp_channel_copy (gimp_image_get_mask (gimg), TRUE);
|
||||
gimp_image_add_channel (gimg, gmask, 0);
|
||||
gmask = gimp_channel_copy (gimp_image_get_mask (gimage), TRUE);
|
||||
gimp_image_add_channel (gimage, gmask, 0);
|
||||
gimp_channel_set_color (gmask, &color);
|
||||
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
|
||||
gimage_mask_none (gimg); /* Clear the selection */
|
||||
gimage_mask_none (gimage); /* Clear the selection */
|
||||
}
|
||||
|
||||
undo_push_qmask (gimg);
|
||||
undo_push_group_end (gimg);
|
||||
undo_push_qmask (gimage);
|
||||
undo_push_group_end (gimage);
|
||||
gdisp->gimage->qmask_state = TRUE;
|
||||
gdisplays_flush ();
|
||||
|
||||
|
@ -368,12 +367,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
|
|||
|
||||
if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
|
||||
{
|
||||
channel->color = color;
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
gimp_channel_set_color (channel, &color);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include "widgets/gimpcolorpanel.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplay.h"
|
||||
#include "qmask.h"
|
||||
|
@ -51,11 +50,11 @@ typedef struct _EditQmaskOptions EditQmaskOptions;
|
|||
|
||||
struct _EditQmaskOptions
|
||||
{
|
||||
GtkWidget *query_box;
|
||||
GtkWidget *name_entry;
|
||||
GtkWidget *color_panel;
|
||||
GtkWidget *query_box;
|
||||
GtkWidget *name_entry;
|
||||
GtkWidget *color_panel;
|
||||
|
||||
GimpImage *gimage;
|
||||
GimpImage *gimage;
|
||||
};
|
||||
|
||||
|
||||
|
@ -104,7 +103,7 @@ qmask_removed_callback (GtkObject *qmask,
|
|||
|
||||
if (!gdisp->gimage)
|
||||
return;
|
||||
|
||||
|
||||
gdisp->gimage->qmask_state = FALSE;
|
||||
|
||||
qmask_buttons_update (gdisp);
|
||||
|
@ -120,34 +119,34 @@ qmask_buttons_update (GDisplay *gdisp)
|
|||
if (gdisp->gimage->qmask_state != GTK_TOGGLE_BUTTON (gdisp->qmaskon)->active)
|
||||
{
|
||||
/* Disable toggle from doing anything */
|
||||
gtk_signal_handler_block_by_func(GTK_OBJECT(gdisp->qmaskoff),
|
||||
(GtkSignalFunc) qmask_deactivate,
|
||||
gdisp);
|
||||
gtk_signal_handler_block_by_func(GTK_OBJECT(gdisp->qmaskon),
|
||||
(GtkSignalFunc) qmask_activate,
|
||||
gdisp);
|
||||
gtk_signal_handler_block_by_func (GTK_OBJECT (gdisp->qmaskoff),
|
||||
GTK_SIGNAL_FUNC (qmask_deactivate),
|
||||
gdisp);
|
||||
gtk_signal_handler_block_by_func (GTK_OBJECT (gdisp->qmaskon),
|
||||
GTK_SIGNAL_FUNC (qmask_activate),
|
||||
gdisp);
|
||||
|
||||
/* Change the state of the buttons */
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gdisp->qmaskon),
|
||||
gdisp->gimage->qmask_state);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gdisp->qmaskon),
|
||||
gdisp->gimage->qmask_state);
|
||||
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gdisp->qmaskoff),
|
||||
!gdisp->gimage->qmask_state);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gdisp->qmaskoff),
|
||||
! gdisp->gimage->qmask_state);
|
||||
|
||||
/* Enable toggle again */
|
||||
gtk_signal_handler_unblock_by_func(GTK_OBJECT(gdisp->qmaskoff),
|
||||
(GtkSignalFunc) qmask_deactivate,
|
||||
gdisp);
|
||||
gtk_signal_handler_unblock_by_func(GTK_OBJECT(gdisp->qmaskon),
|
||||
(GtkSignalFunc) qmask_activate,
|
||||
gdisp);
|
||||
gtk_signal_handler_unblock_by_func (GTK_OBJECT (gdisp->qmaskoff),
|
||||
GTK_SIGNAL_FUNC (qmask_deactivate),
|
||||
gdisp);
|
||||
gtk_signal_handler_unblock_by_func (GTK_OBJECT (gdisp->qmaskon),
|
||||
GTK_SIGNAL_FUNC (qmask_activate),
|
||||
gdisp);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
qmask_click_handler (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
void
|
||||
qmask_click_handler (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
|
||||
|
@ -164,28 +163,29 @@ void
|
|||
qmask_deactivate (GtkWidget *widget,
|
||||
GDisplay *gdisp)
|
||||
{
|
||||
GimpImage *gimg;
|
||||
GimpImage *gimage;
|
||||
GimpChannel *gmask;
|
||||
|
||||
if (gdisp)
|
||||
{
|
||||
gimg = gdisp->gimage;
|
||||
if (!gimg)
|
||||
gimage = gdisp->gimage;
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
|
||||
if (!gdisp->gimage->qmask_state)
|
||||
return; /* if already set do nothing */
|
||||
|
||||
if ( (gmask = gimp_image_get_channel_by_name (gimg, "Qmask")) )
|
||||
if ( (gmask = gimp_image_get_channel_by_name (gimage, "Qmask")) )
|
||||
{
|
||||
undo_push_group_start (gimg, QMASK_UNDO);
|
||||
undo_push_group_start (gimage, QMASK_UNDO);
|
||||
/* push the undo here since removing the mask will
|
||||
call the qmask_removed_callback() which will set
|
||||
the qmask_state to FALSE */
|
||||
undo_push_qmask (gimg);
|
||||
gimage_mask_load (gimg, gmask);
|
||||
gimp_image_remove_channel (gimg, gmask);
|
||||
undo_push_group_end (gimg);
|
||||
undo_push_qmask (gimage);
|
||||
gimage_mask_load (gimage, gmask);
|
||||
gimp_image_remove_channel (gimage, gmask);
|
||||
undo_push_group_end (gimage);
|
||||
}
|
||||
|
||||
gdisp->gimage->qmask_state = FALSE;
|
||||
|
@ -199,65 +199,64 @@ void
|
|||
qmask_activate (GtkWidget *widget,
|
||||
GDisplay *gdisp)
|
||||
{
|
||||
GimpImage *gimg;
|
||||
GimpImage *gimage;
|
||||
GimpChannel *gmask;
|
||||
GimpLayer *layer;
|
||||
GimpRGB color;
|
||||
|
||||
if (gdisp)
|
||||
{
|
||||
gimg = gdisp->gimage;
|
||||
if (!gimg)
|
||||
gimage = gdisp->gimage;
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
|
||||
if (gdisp->gimage->qmask_state)
|
||||
return; /* If already set, do nothing */
|
||||
|
||||
/* Set the defaults */
|
||||
color = gimg->qmask_color;
|
||||
color = gimage->qmask_color;
|
||||
|
||||
if ((gmask = gimp_image_get_channel_by_name (gimg, "Qmask")))
|
||||
if ((gmask = gimp_image_get_channel_by_name (gimage, "Qmask")))
|
||||
{
|
||||
gimg->qmask_state = TRUE;
|
||||
gimage->qmask_state = TRUE;
|
||||
/* if the user was clever and created his own */
|
||||
return;
|
||||
}
|
||||
|
||||
undo_push_group_start (gimg, QMASK_UNDO);
|
||||
undo_push_group_start (gimage, QMASK_UNDO);
|
||||
|
||||
if (gimage_mask_is_empty (gimg))
|
||||
if (gimage_mask_is_empty (gimage))
|
||||
{
|
||||
/* if no selection */
|
||||
|
||||
if ((layer = gimp_image_floating_sel (gimg)))
|
||||
if ((layer = gimp_image_floating_sel (gimage)))
|
||||
{
|
||||
floating_sel_to_layer (layer);
|
||||
}
|
||||
|
||||
gmask = gimp_channel_new (gimg,
|
||||
gimg->width,
|
||||
gimg->height,
|
||||
gmask = gimp_channel_new (gimage,
|
||||
gimage->width,
|
||||
gimage->height,
|
||||
"Qmask",
|
||||
&color);
|
||||
gimp_image_add_channel (gimg, gmask, 0);
|
||||
gimp_image_add_channel (gimage, gmask, 0);
|
||||
|
||||
drawable_fill (GIMP_DRAWABLE (gmask),
|
||||
gimp_get_user_context (gimg->gimp),
|
||||
TRANSPARENT_FILL);
|
||||
gimp_drawable_fill_by_type (GIMP_DRAWABLE (gmask),
|
||||
gimp_get_user_context (gimage->gimp),
|
||||
TRANSPARENT_FILL);
|
||||
}
|
||||
else
|
||||
else /* if selection */
|
||||
{
|
||||
/* if selection */
|
||||
|
||||
gmask = gimp_channel_copy (gimp_image_get_mask (gimg), TRUE);
|
||||
gimp_image_add_channel (gimg, gmask, 0);
|
||||
gmask = gimp_channel_copy (gimp_image_get_mask (gimage), TRUE);
|
||||
gimp_image_add_channel (gimage, gmask, 0);
|
||||
gimp_channel_set_color (gmask, &color);
|
||||
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
|
||||
gimage_mask_none (gimg); /* Clear the selection */
|
||||
gimage_mask_none (gimage); /* Clear the selection */
|
||||
}
|
||||
|
||||
undo_push_qmask (gimg);
|
||||
undo_push_group_end (gimg);
|
||||
undo_push_qmask (gimage);
|
||||
undo_push_group_end (gimage);
|
||||
gdisp->gimage->qmask_state = TRUE;
|
||||
gdisplays_flush ();
|
||||
|
||||
|
@ -368,12 +367,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
|
|||
|
||||
if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
|
||||
{
|
||||
channel->color = color;
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
gimp_channel_set_color (channel, &color);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
#include "gimpundostack.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplay.h"
|
||||
#include "parasitelist.h"
|
||||
|
@ -172,7 +171,7 @@ enum
|
|||
|
||||
CLEAN,
|
||||
DIRTY,
|
||||
REPAINT,
|
||||
UPDATE,
|
||||
COLORMAP_CHANGED,
|
||||
UNDO_EVENT,
|
||||
LAST_SIGNAL
|
||||
|
@ -318,12 +317,12 @@ gimp_image_class_init (GimpImageClass *klass)
|
|||
gtk_signal_default_marshaller,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
gimp_image_signals[REPAINT] =
|
||||
gtk_signal_new ("repaint",
|
||||
gimp_image_signals[UPDATE] =
|
||||
gtk_signal_new ("update",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (GimpImageClass,
|
||||
repaint),
|
||||
update),
|
||||
gimp_marshal_NONE__INT_INT_INT_INT,
|
||||
GTK_TYPE_NONE, 4,
|
||||
GTK_TYPE_INT,
|
||||
|
@ -373,7 +372,7 @@ gimp_image_class_init (GimpImageClass *klass)
|
|||
|
||||
klass->clean = NULL;
|
||||
klass->dirty = NULL;
|
||||
klass->repaint = NULL;
|
||||
klass->update = NULL;
|
||||
klass->colormap_changed = gimp_image_real_colormap_changed;
|
||||
klass->undo_event = NULL;
|
||||
klass->undo = gimp_image_undo;
|
||||
|
@ -1216,7 +1215,7 @@ gimp_image_replace_image (GimpImage *gimage,
|
|||
|
||||
/* If the calling procedure specified an undo step... */
|
||||
if (undo)
|
||||
drawable_apply_image (drawable, x1, y1, x2, y2, NULL, FALSE);
|
||||
gimp_drawable_apply_image (drawable, x1, y1, x2, y2, NULL, FALSE);
|
||||
|
||||
/* configure the pixel regions
|
||||
* If an alternative to using the drawable's data as src1 was provided...
|
||||
|
@ -1746,6 +1745,20 @@ gimp_image_floating_selection_changed (GimpImage *gimage)
|
|||
gimp_image_signals[FLOATING_SELECTION_CHANGED]);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_image_update (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_IMAGE (gimage));
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[UPDATE],
|
||||
x, y, width, height);
|
||||
}
|
||||
|
||||
|
||||
/************************************************************/
|
||||
/* Projection functions */
|
||||
/************************************************************/
|
||||
|
@ -2918,7 +2931,6 @@ gimp_image_position_layer (GimpImage *gimage,
|
|||
gint new_index,
|
||||
gboolean push_undo)
|
||||
{
|
||||
gint x_min, y_min, x_max, y_max;
|
||||
gint off_x, off_y;
|
||||
gint index;
|
||||
gint num_layers;
|
||||
|
@ -2967,13 +2979,11 @@ gimp_image_position_layer (GimpImage *gimage,
|
|||
gimp_container_reorder (gimage->layers, GIMP_OBJECT (layer), new_index);
|
||||
|
||||
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
|
||||
x_min = off_x;
|
||||
y_min = off_y;
|
||||
x_max = off_x + gimp_drawable_width (GIMP_DRAWABLE (layer));
|
||||
y_max = off_y + gimp_drawable_height (GIMP_DRAWABLE (layer));
|
||||
gtk_signal_emit (GTK_OBJECT (gimage),
|
||||
gimp_image_signals[REPAINT],
|
||||
x_min, y_min, x_max, y_max);
|
||||
|
||||
gimp_image_update (gimage,
|
||||
off_x, off_y,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (layer)));
|
||||
|
||||
/* invalidate the composite preview */
|
||||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimage));
|
||||
|
@ -3420,10 +3430,10 @@ gimp_image_merge_layers (GimpImage *gimage,
|
|||
|
||||
gimp_drawable_set_visible (GIMP_DRAWABLE (merge_layer), TRUE);
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (merge_layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (merge_layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (merge_layer)));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (merge_layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (merge_layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (merge_layer)));
|
||||
|
||||
/*reinit_layer_idlerender (gimage, merge_layer);*/
|
||||
|
||||
|
@ -3510,13 +3520,10 @@ gimp_image_add_layer (GimpImage *gimage,
|
|||
gimp_image_set_active_layer (gimage, layer);
|
||||
|
||||
/* update the new layer's area */
|
||||
drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (layer)));
|
||||
|
||||
/* invalidate the composite preview */
|
||||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimage));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (layer)));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -3659,10 +3666,10 @@ gimp_image_position_channel (GimpImage *gimage,
|
|||
gimp_container_reorder (gimage->channels,
|
||||
GIMP_OBJECT (channel), new_index);
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -3710,10 +3717,10 @@ gimp_image_add_channel (GimpImage *gimage,
|
|||
|
||||
/* if channel is visible, update the image */
|
||||
if (gimp_drawable_get_visible (GIMP_DRAWABLE (channel)))
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -150,11 +150,11 @@ struct _GimpImageClass
|
|||
|
||||
void (* clean) (GimpImage *gimage);
|
||||
void (* dirty) (GimpImage *gimage);
|
||||
void (* repaint) (GimpImage *gimage,
|
||||
gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2);
|
||||
void (* update) (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void (* colormap_changed) (GimpImage *gimage,
|
||||
gint color_index);
|
||||
void (* undo_event) (GimpImage *gimage,
|
||||
|
@ -282,8 +282,13 @@ void gimp_image_colormap_changed (GimpImage *gimage,
|
|||
|
||||
void gimp_image_mode_changed (GimpImage *gimage);
|
||||
void gimp_image_alpha_changed (GimpImage *gimage);
|
||||
void gimp_image_floating_selection_changed (GimpImage *gimage);
|
||||
void gimp_image_mask_changed (GimpImage *gimage);
|
||||
void gimp_image_floating_selection_changed (GimpImage *gimage);
|
||||
void gimp_image_mask_changed (GimpImage *gimage);
|
||||
void gimp_image_update (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
|
||||
/* layer/channel functions */
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
#include "gimpundostack.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplay.h"
|
||||
#include "parasitelist.h"
|
||||
|
@ -172,7 +171,7 @@ enum
|
|||
|
||||
CLEAN,
|
||||
DIRTY,
|
||||
REPAINT,
|
||||
UPDATE,
|
||||
COLORMAP_CHANGED,
|
||||
UNDO_EVENT,
|
||||
LAST_SIGNAL
|
||||
|
@ -318,12 +317,12 @@ gimp_image_class_init (GimpImageClass *klass)
|
|||
gtk_signal_default_marshaller,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
gimp_image_signals[REPAINT] =
|
||||
gtk_signal_new ("repaint",
|
||||
gimp_image_signals[UPDATE] =
|
||||
gtk_signal_new ("update",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (GimpImageClass,
|
||||
repaint),
|
||||
update),
|
||||
gimp_marshal_NONE__INT_INT_INT_INT,
|
||||
GTK_TYPE_NONE, 4,
|
||||
GTK_TYPE_INT,
|
||||
|
@ -373,7 +372,7 @@ gimp_image_class_init (GimpImageClass *klass)
|
|||
|
||||
klass->clean = NULL;
|
||||
klass->dirty = NULL;
|
||||
klass->repaint = NULL;
|
||||
klass->update = NULL;
|
||||
klass->colormap_changed = gimp_image_real_colormap_changed;
|
||||
klass->undo_event = NULL;
|
||||
klass->undo = gimp_image_undo;
|
||||
|
@ -1216,7 +1215,7 @@ gimp_image_replace_image (GimpImage *gimage,
|
|||
|
||||
/* If the calling procedure specified an undo step... */
|
||||
if (undo)
|
||||
drawable_apply_image (drawable, x1, y1, x2, y2, NULL, FALSE);
|
||||
gimp_drawable_apply_image (drawable, x1, y1, x2, y2, NULL, FALSE);
|
||||
|
||||
/* configure the pixel regions
|
||||
* If an alternative to using the drawable's data as src1 was provided...
|
||||
|
@ -1746,6 +1745,20 @@ gimp_image_floating_selection_changed (GimpImage *gimage)
|
|||
gimp_image_signals[FLOATING_SELECTION_CHANGED]);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_image_update (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_IMAGE (gimage));
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[UPDATE],
|
||||
x, y, width, height);
|
||||
}
|
||||
|
||||
|
||||
/************************************************************/
|
||||
/* Projection functions */
|
||||
/************************************************************/
|
||||
|
@ -2918,7 +2931,6 @@ gimp_image_position_layer (GimpImage *gimage,
|
|||
gint new_index,
|
||||
gboolean push_undo)
|
||||
{
|
||||
gint x_min, y_min, x_max, y_max;
|
||||
gint off_x, off_y;
|
||||
gint index;
|
||||
gint num_layers;
|
||||
|
@ -2967,13 +2979,11 @@ gimp_image_position_layer (GimpImage *gimage,
|
|||
gimp_container_reorder (gimage->layers, GIMP_OBJECT (layer), new_index);
|
||||
|
||||
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
|
||||
x_min = off_x;
|
||||
y_min = off_y;
|
||||
x_max = off_x + gimp_drawable_width (GIMP_DRAWABLE (layer));
|
||||
y_max = off_y + gimp_drawable_height (GIMP_DRAWABLE (layer));
|
||||
gtk_signal_emit (GTK_OBJECT (gimage),
|
||||
gimp_image_signals[REPAINT],
|
||||
x_min, y_min, x_max, y_max);
|
||||
|
||||
gimp_image_update (gimage,
|
||||
off_x, off_y,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (layer)));
|
||||
|
||||
/* invalidate the composite preview */
|
||||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimage));
|
||||
|
@ -3420,10 +3430,10 @@ gimp_image_merge_layers (GimpImage *gimage,
|
|||
|
||||
gimp_drawable_set_visible (GIMP_DRAWABLE (merge_layer), TRUE);
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (merge_layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (merge_layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (merge_layer)));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (merge_layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (merge_layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (merge_layer)));
|
||||
|
||||
/*reinit_layer_idlerender (gimage, merge_layer);*/
|
||||
|
||||
|
@ -3510,13 +3520,10 @@ gimp_image_add_layer (GimpImage *gimage,
|
|||
gimp_image_set_active_layer (gimage, layer);
|
||||
|
||||
/* update the new layer's area */
|
||||
drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (layer)));
|
||||
|
||||
/* invalidate the composite preview */
|
||||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimage));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (layer)));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -3659,10 +3666,10 @@ gimp_image_position_channel (GimpImage *gimage,
|
|||
gimp_container_reorder (gimage->channels,
|
||||
GIMP_OBJECT (channel), new_index);
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -3710,10 +3717,10 @@ gimp_image_add_channel (GimpImage *gimage,
|
|||
|
||||
/* if channel is visible, update the image */
|
||||
if (gimp_drawable_get_visible (GIMP_DRAWABLE (channel)))
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -150,11 +150,11 @@ struct _GimpImageClass
|
|||
|
||||
void (* clean) (GimpImage *gimage);
|
||||
void (* dirty) (GimpImage *gimage);
|
||||
void (* repaint) (GimpImage *gimage,
|
||||
gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2);
|
||||
void (* update) (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void (* colormap_changed) (GimpImage *gimage,
|
||||
gint color_index);
|
||||
void (* undo_event) (GimpImage *gimage,
|
||||
|
@ -282,8 +282,13 @@ void gimp_image_colormap_changed (GimpImage *gimage,
|
|||
|
||||
void gimp_image_mode_changed (GimpImage *gimage);
|
||||
void gimp_image_alpha_changed (GimpImage *gimage);
|
||||
void gimp_image_floating_selection_changed (GimpImage *gimage);
|
||||
void gimp_image_mask_changed (GimpImage *gimage);
|
||||
void gimp_image_floating_selection_changed (GimpImage *gimage);
|
||||
void gimp_image_mask_changed (GimpImage *gimage);
|
||||
void gimp_image_update (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
|
||||
/* layer/channel functions */
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
#include "tools/tool_manager.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gdisplay_ops.h"
|
||||
|
@ -976,7 +975,7 @@ undo_pop_image (GimpImage *gimage,
|
|||
}
|
||||
}
|
||||
|
||||
drawable_update (image_undo->drawable, x, y, w, h);
|
||||
gimp_drawable_update (image_undo->drawable, x, y, w, h);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1186,23 +1185,26 @@ undo_pop_layer_displace (GimpImage *gimage,
|
|||
{
|
||||
old_offsets[0] = GIMP_DRAWABLE (layer)->offset_x;
|
||||
old_offsets[1] = GIMP_DRAWABLE (layer)->offset_y;
|
||||
drawable_update (GIMP_DRAWABLE (layer), 0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
|
||||
GIMP_DRAWABLE (layer)->offset_x = ldu->info[1];
|
||||
GIMP_DRAWABLE (layer)->offset_y = ldu->info[2];
|
||||
drawable_update (GIMP_DRAWABLE (layer), 0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
|
||||
if (layer->mask)
|
||||
{
|
||||
GIMP_DRAWABLE (layer->mask)->offset_x = ldu->info[1];
|
||||
GIMP_DRAWABLE (layer->mask)->offset_y = ldu->info[2];
|
||||
drawable_update (GIMP_DRAWABLE (layer->mask), 0, 0,
|
||||
GIMP_DRAWABLE (layer->mask)->width,
|
||||
GIMP_DRAWABLE (layer->mask)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer->mask),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer->mask)->width,
|
||||
GIMP_DRAWABLE (layer->mask)->height);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1492,9 +1494,10 @@ undo_pop_layer (GimpImage *gimage,
|
|||
gimp_image_floating_selection_changed (gimage);
|
||||
}
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (lu->layer), 0, 0,
|
||||
GIMP_DRAWABLE (lu->layer)->width,
|
||||
GIMP_DRAWABLE (lu->layer)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (lu->layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (lu->layer)->width,
|
||||
GIMP_DRAWABLE (lu->layer)->height);
|
||||
}
|
||||
/* restore layer */
|
||||
else
|
||||
|
@ -1518,9 +1521,10 @@ undo_pop_layer (GimpImage *gimage,
|
|||
if (gimp_layer_is_floating_sel (lu->layer))
|
||||
gimp_image_floating_selection_changed (gimage);
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (lu->layer), 0, 0,
|
||||
GIMP_DRAWABLE (lu->layer)->width,
|
||||
GIMP_DRAWABLE (lu->layer)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (lu->layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (lu->layer)->width,
|
||||
GIMP_DRAWABLE (lu->layer)->height);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -1643,9 +1647,10 @@ undo_pop_layer_mod (GimpImage *gimage,
|
|||
data[1] = temp;
|
||||
|
||||
/* Issue the second update */
|
||||
drawable_update (GIMP_DRAWABLE (layer), 0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE(layer)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE(layer)->height);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1813,9 +1818,10 @@ undo_pop_channel (GimpImage *gimage,
|
|||
gimp_image_set_active_channel (gimage, cu->prev_channel);
|
||||
|
||||
/* update the area */
|
||||
drawable_update (GIMP_DRAWABLE (cu->channel), 0, 0,
|
||||
GIMP_DRAWABLE (cu->channel)->width,
|
||||
GIMP_DRAWABLE (cu->channel)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (cu->channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (cu->channel)->width,
|
||||
GIMP_DRAWABLE (cu->channel)->height);
|
||||
}
|
||||
/* restore channel */
|
||||
else
|
||||
|
@ -1831,9 +1837,10 @@ undo_pop_channel (GimpImage *gimage,
|
|||
gimp_image_set_active_channel (gimage, cu->channel);
|
||||
|
||||
/* update the area */
|
||||
drawable_update (GIMP_DRAWABLE (cu->channel), 0, 0,
|
||||
GIMP_DRAWABLE (cu->channel)->width,
|
||||
GIMP_DRAWABLE (cu->channel)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (cu->channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (cu->channel)->width,
|
||||
GIMP_DRAWABLE (cu->channel)->height);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -1912,9 +1919,10 @@ undo_pop_channel_mod (GimpImage *gimage,
|
|||
tiles = (TileManager *) data[1];
|
||||
|
||||
/* Issue the first update */
|
||||
drawable_update (GIMP_DRAWABLE (channel), 0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
|
||||
temp = GIMP_DRAWABLE (channel)->tiles;
|
||||
GIMP_DRAWABLE (channel)->tiles = tiles;
|
||||
|
@ -1928,9 +1936,10 @@ undo_pop_channel_mod (GimpImage *gimage,
|
|||
data[1] = temp;
|
||||
|
||||
/* Issue the second update */
|
||||
drawable_update (GIMP_DRAWABLE (channel), 0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
#include "gimpundostack.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplay.h"
|
||||
#include "parasitelist.h"
|
||||
|
@ -172,7 +171,7 @@ enum
|
|||
|
||||
CLEAN,
|
||||
DIRTY,
|
||||
REPAINT,
|
||||
UPDATE,
|
||||
COLORMAP_CHANGED,
|
||||
UNDO_EVENT,
|
||||
LAST_SIGNAL
|
||||
|
@ -318,12 +317,12 @@ gimp_image_class_init (GimpImageClass *klass)
|
|||
gtk_signal_default_marshaller,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
gimp_image_signals[REPAINT] =
|
||||
gtk_signal_new ("repaint",
|
||||
gimp_image_signals[UPDATE] =
|
||||
gtk_signal_new ("update",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (GimpImageClass,
|
||||
repaint),
|
||||
update),
|
||||
gimp_marshal_NONE__INT_INT_INT_INT,
|
||||
GTK_TYPE_NONE, 4,
|
||||
GTK_TYPE_INT,
|
||||
|
@ -373,7 +372,7 @@ gimp_image_class_init (GimpImageClass *klass)
|
|||
|
||||
klass->clean = NULL;
|
||||
klass->dirty = NULL;
|
||||
klass->repaint = NULL;
|
||||
klass->update = NULL;
|
||||
klass->colormap_changed = gimp_image_real_colormap_changed;
|
||||
klass->undo_event = NULL;
|
||||
klass->undo = gimp_image_undo;
|
||||
|
@ -1216,7 +1215,7 @@ gimp_image_replace_image (GimpImage *gimage,
|
|||
|
||||
/* If the calling procedure specified an undo step... */
|
||||
if (undo)
|
||||
drawable_apply_image (drawable, x1, y1, x2, y2, NULL, FALSE);
|
||||
gimp_drawable_apply_image (drawable, x1, y1, x2, y2, NULL, FALSE);
|
||||
|
||||
/* configure the pixel regions
|
||||
* If an alternative to using the drawable's data as src1 was provided...
|
||||
|
@ -1746,6 +1745,20 @@ gimp_image_floating_selection_changed (GimpImage *gimage)
|
|||
gimp_image_signals[FLOATING_SELECTION_CHANGED]);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_image_update (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_IMAGE (gimage));
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[UPDATE],
|
||||
x, y, width, height);
|
||||
}
|
||||
|
||||
|
||||
/************************************************************/
|
||||
/* Projection functions */
|
||||
/************************************************************/
|
||||
|
@ -2918,7 +2931,6 @@ gimp_image_position_layer (GimpImage *gimage,
|
|||
gint new_index,
|
||||
gboolean push_undo)
|
||||
{
|
||||
gint x_min, y_min, x_max, y_max;
|
||||
gint off_x, off_y;
|
||||
gint index;
|
||||
gint num_layers;
|
||||
|
@ -2967,13 +2979,11 @@ gimp_image_position_layer (GimpImage *gimage,
|
|||
gimp_container_reorder (gimage->layers, GIMP_OBJECT (layer), new_index);
|
||||
|
||||
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
|
||||
x_min = off_x;
|
||||
y_min = off_y;
|
||||
x_max = off_x + gimp_drawable_width (GIMP_DRAWABLE (layer));
|
||||
y_max = off_y + gimp_drawable_height (GIMP_DRAWABLE (layer));
|
||||
gtk_signal_emit (GTK_OBJECT (gimage),
|
||||
gimp_image_signals[REPAINT],
|
||||
x_min, y_min, x_max, y_max);
|
||||
|
||||
gimp_image_update (gimage,
|
||||
off_x, off_y,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (layer)));
|
||||
|
||||
/* invalidate the composite preview */
|
||||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimage));
|
||||
|
@ -3420,10 +3430,10 @@ gimp_image_merge_layers (GimpImage *gimage,
|
|||
|
||||
gimp_drawable_set_visible (GIMP_DRAWABLE (merge_layer), TRUE);
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (merge_layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (merge_layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (merge_layer)));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (merge_layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (merge_layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (merge_layer)));
|
||||
|
||||
/*reinit_layer_idlerender (gimage, merge_layer);*/
|
||||
|
||||
|
@ -3510,13 +3520,10 @@ gimp_image_add_layer (GimpImage *gimage,
|
|||
gimp_image_set_active_layer (gimage, layer);
|
||||
|
||||
/* update the new layer's area */
|
||||
drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (layer)));
|
||||
|
||||
/* invalidate the composite preview */
|
||||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimage));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (layer)));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -3659,10 +3666,10 @@ gimp_image_position_channel (GimpImage *gimage,
|
|||
gimp_container_reorder (gimage->channels,
|
||||
GIMP_OBJECT (channel), new_index);
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -3710,10 +3717,10 @@ gimp_image_add_channel (GimpImage *gimage,
|
|||
|
||||
/* if channel is visible, update the image */
|
||||
if (gimp_drawable_get_visible (GIMP_DRAWABLE (channel)))
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -150,11 +150,11 @@ struct _GimpImageClass
|
|||
|
||||
void (* clean) (GimpImage *gimage);
|
||||
void (* dirty) (GimpImage *gimage);
|
||||
void (* repaint) (GimpImage *gimage,
|
||||
gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2);
|
||||
void (* update) (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void (* colormap_changed) (GimpImage *gimage,
|
||||
gint color_index);
|
||||
void (* undo_event) (GimpImage *gimage,
|
||||
|
@ -282,8 +282,13 @@ void gimp_image_colormap_changed (GimpImage *gimage,
|
|||
|
||||
void gimp_image_mode_changed (GimpImage *gimage);
|
||||
void gimp_image_alpha_changed (GimpImage *gimage);
|
||||
void gimp_image_floating_selection_changed (GimpImage *gimage);
|
||||
void gimp_image_mask_changed (GimpImage *gimage);
|
||||
void gimp_image_floating_selection_changed (GimpImage *gimage);
|
||||
void gimp_image_mask_changed (GimpImage *gimage);
|
||||
void gimp_image_update (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
|
||||
/* layer/channel functions */
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "core/gimpdrawable.h"
|
||||
#include "core/gimpimage.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "image_map.h"
|
||||
|
||||
|
@ -93,7 +92,9 @@ image_map_do (gpointer data)
|
|||
/* display the results */
|
||||
if (image_map->gdisp)
|
||||
{
|
||||
drawable_update ( (image_map->drawable), x, y, w, h);
|
||||
gimp_drawable_update (image_map->drawable,
|
||||
x, y,
|
||||
w, h);
|
||||
gdisplay_flush_now (image_map->gdisp);
|
||||
}
|
||||
|
||||
|
@ -270,8 +271,9 @@ image_map_commit (ImageMap *image_map)
|
|||
tile_manager_get_offsets (image_map->undo_tiles, &x1, &y1);
|
||||
x2 = x1 + tile_manager_width (image_map->undo_tiles);
|
||||
y2 = y1 + tile_manager_height (image_map->undo_tiles);
|
||||
drawable_apply_image (image_map->drawable,
|
||||
x1, y1, x2, y2, image_map->undo_tiles, FALSE);
|
||||
|
||||
gimp_drawable_apply_image (image_map->drawable,
|
||||
x1, y1, x2, y2, image_map->undo_tiles, FALSE);
|
||||
}
|
||||
|
||||
gdisplay_set_menu_sensitivity (image_map->gdisp);
|
||||
|
@ -331,7 +333,9 @@ image_map_clear (ImageMap *image_map)
|
|||
copy_region (&srcPR, &destPR);
|
||||
|
||||
/* Update the area */
|
||||
drawable_update (image_map->drawable, offset_x, offset_y, width, height);
|
||||
gimp_drawable_update (image_map->drawable,
|
||||
offset_x, offset_y,
|
||||
width, height);
|
||||
|
||||
/* Free the undo_tiles tile manager */
|
||||
tile_manager_destroy (image_map->undo_tiles);
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "core/gimplayer.h"
|
||||
#include "core/gimplayermask.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "undo.h"
|
||||
|
||||
|
@ -237,10 +236,10 @@ floating_sel_to_layer (GimpLayer *layer)
|
|||
msw@gimp.org
|
||||
*/
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
|
||||
/* This may be undesirable when invoked non-interactively... we'll see. */
|
||||
/*reinit_layer_idlerender (gimage, layer);*/
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
|
||||
#include "paint-funcs/paint-funcs.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpdrawable-invert.h"
|
||||
|
@ -528,10 +527,10 @@ gimp_layer_add_mask (GimpLayer *layer,
|
|||
|
||||
gimp_layer_mask_set_layer (mask, layer);
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
|
||||
if (push_undo)
|
||||
{
|
||||
|
@ -707,11 +706,11 @@ gimp_layer_apply_mask (GimpLayer *layer,
|
|||
if (push_undo)
|
||||
{
|
||||
/* Put this apply mask operation on the undo stack */
|
||||
drawable_apply_image (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height,
|
||||
NULL, FALSE);
|
||||
gimp_drawable_apply_image (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height,
|
||||
NULL, FALSE);
|
||||
}
|
||||
|
||||
/* Combine the current layer's alpha channel and the mask */
|
||||
|
@ -751,10 +750,10 @@ gimp_layer_apply_mask (GimpLayer *layer,
|
|||
|
||||
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (layer)));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (layer)));
|
||||
}
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (layer), layer_signals[MASK_CHANGED]);
|
||||
|
@ -769,10 +768,10 @@ gimp_layer_translate (GimpLayer *layer,
|
|||
undo_push_layer_displace (GIMP_DRAWABLE (layer)->gimage, layer);
|
||||
|
||||
/* update the affected region */
|
||||
drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
|
||||
/* invalidate the selection boundary because of a layer modification */
|
||||
gimp_layer_invalidate_boundary (layer);
|
||||
|
@ -782,10 +781,10 @@ gimp_layer_translate (GimpLayer *layer,
|
|||
GIMP_DRAWABLE (layer)->offset_y += off_y;
|
||||
|
||||
/* update the affected region */
|
||||
drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
|
||||
if (layer->mask)
|
||||
{
|
||||
|
@ -868,10 +867,10 @@ gimp_layer_scale_lowlevel (GimpLayer *layer,
|
|||
TileManager *new_tiles;
|
||||
|
||||
/* Update the old layer position */
|
||||
drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
|
||||
/* Configure the pixel regions */
|
||||
pixel_region_init (&srcPR, GIMP_DRAWABLE(layer)->tiles,
|
||||
|
@ -922,11 +921,10 @@ gimp_layer_scale_lowlevel (GimpLayer *layer,
|
|||
gimp_layer_invalidate_boundary (layer);
|
||||
|
||||
/* Update the new layer position */
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1130,10 +1128,10 @@ gimp_layer_resize (GimpLayer *layer,
|
|||
}
|
||||
|
||||
/* Update the old layer position */
|
||||
drawable_update (GIMP_DRAWABLE( layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE( layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
|
||||
/* Configure the pixel regions */
|
||||
pixel_region_init (&srcPR, GIMP_DRAWABLE (layer)->tiles,
|
||||
|
@ -1198,10 +1196,10 @@ gimp_layer_resize (GimpLayer *layer,
|
|||
gimp_layer_invalidate_boundary (layer);
|
||||
|
||||
/* update the new layer area */
|
||||
drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1415,6 +1413,11 @@ gimp_layer_set_opacity (GimpLayer *layer,
|
|||
layer->opacity = layer_opacity;
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (layer), layer_signals[OPACITY_CHANGED]);
|
||||
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1439,6 +1442,11 @@ gimp_layer_set_mode (GimpLayer *layer,
|
|||
layer->mode = mode;
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (layer), layer_signals[MODE_CHANGED]);
|
||||
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
|
||||
#include "gimplayermask.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
@ -260,10 +259,10 @@ gimp_layer_mask_set_apply (GimpLayerMask *layer_mask,
|
|||
|
||||
drawable = GIMP_DRAWABLE (layer_mask->layer);
|
||||
|
||||
drawable_update (drawable,
|
||||
0, 0,
|
||||
gimp_drawable_width (drawable),
|
||||
gimp_drawable_height (drawable));
|
||||
gimp_drawable_update (drawable,
|
||||
0, 0,
|
||||
gimp_drawable_width (drawable),
|
||||
gimp_drawable_height (drawable));
|
||||
}
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (layer_mask),
|
||||
|
@ -322,10 +321,10 @@ gimp_layer_mask_set_show (GimpLayerMask *layer_mask,
|
|||
|
||||
drawable = GIMP_DRAWABLE (layer_mask->layer);
|
||||
|
||||
drawable_update (drawable,
|
||||
0, 0,
|
||||
gimp_drawable_width (drawable),
|
||||
gimp_drawable_height (drawable));
|
||||
gimp_drawable_update (drawable,
|
||||
0, 0,
|
||||
gimp_drawable_width (drawable),
|
||||
gimp_drawable_height (drawable));
|
||||
}
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (layer_mask),
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
#include "gimpundostack.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplay.h"
|
||||
#include "parasitelist.h"
|
||||
|
@ -172,7 +171,7 @@ enum
|
|||
|
||||
CLEAN,
|
||||
DIRTY,
|
||||
REPAINT,
|
||||
UPDATE,
|
||||
COLORMAP_CHANGED,
|
||||
UNDO_EVENT,
|
||||
LAST_SIGNAL
|
||||
|
@ -318,12 +317,12 @@ gimp_image_class_init (GimpImageClass *klass)
|
|||
gtk_signal_default_marshaller,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
gimp_image_signals[REPAINT] =
|
||||
gtk_signal_new ("repaint",
|
||||
gimp_image_signals[UPDATE] =
|
||||
gtk_signal_new ("update",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (GimpImageClass,
|
||||
repaint),
|
||||
update),
|
||||
gimp_marshal_NONE__INT_INT_INT_INT,
|
||||
GTK_TYPE_NONE, 4,
|
||||
GTK_TYPE_INT,
|
||||
|
@ -373,7 +372,7 @@ gimp_image_class_init (GimpImageClass *klass)
|
|||
|
||||
klass->clean = NULL;
|
||||
klass->dirty = NULL;
|
||||
klass->repaint = NULL;
|
||||
klass->update = NULL;
|
||||
klass->colormap_changed = gimp_image_real_colormap_changed;
|
||||
klass->undo_event = NULL;
|
||||
klass->undo = gimp_image_undo;
|
||||
|
@ -1216,7 +1215,7 @@ gimp_image_replace_image (GimpImage *gimage,
|
|||
|
||||
/* If the calling procedure specified an undo step... */
|
||||
if (undo)
|
||||
drawable_apply_image (drawable, x1, y1, x2, y2, NULL, FALSE);
|
||||
gimp_drawable_apply_image (drawable, x1, y1, x2, y2, NULL, FALSE);
|
||||
|
||||
/* configure the pixel regions
|
||||
* If an alternative to using the drawable's data as src1 was provided...
|
||||
|
@ -1746,6 +1745,20 @@ gimp_image_floating_selection_changed (GimpImage *gimage)
|
|||
gimp_image_signals[FLOATING_SELECTION_CHANGED]);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_image_update (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_IMAGE (gimage));
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[UPDATE],
|
||||
x, y, width, height);
|
||||
}
|
||||
|
||||
|
||||
/************************************************************/
|
||||
/* Projection functions */
|
||||
/************************************************************/
|
||||
|
@ -2918,7 +2931,6 @@ gimp_image_position_layer (GimpImage *gimage,
|
|||
gint new_index,
|
||||
gboolean push_undo)
|
||||
{
|
||||
gint x_min, y_min, x_max, y_max;
|
||||
gint off_x, off_y;
|
||||
gint index;
|
||||
gint num_layers;
|
||||
|
@ -2967,13 +2979,11 @@ gimp_image_position_layer (GimpImage *gimage,
|
|||
gimp_container_reorder (gimage->layers, GIMP_OBJECT (layer), new_index);
|
||||
|
||||
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
|
||||
x_min = off_x;
|
||||
y_min = off_y;
|
||||
x_max = off_x + gimp_drawable_width (GIMP_DRAWABLE (layer));
|
||||
y_max = off_y + gimp_drawable_height (GIMP_DRAWABLE (layer));
|
||||
gtk_signal_emit (GTK_OBJECT (gimage),
|
||||
gimp_image_signals[REPAINT],
|
||||
x_min, y_min, x_max, y_max);
|
||||
|
||||
gimp_image_update (gimage,
|
||||
off_x, off_y,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (layer)));
|
||||
|
||||
/* invalidate the composite preview */
|
||||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimage));
|
||||
|
@ -3420,10 +3430,10 @@ gimp_image_merge_layers (GimpImage *gimage,
|
|||
|
||||
gimp_drawable_set_visible (GIMP_DRAWABLE (merge_layer), TRUE);
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (merge_layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (merge_layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (merge_layer)));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (merge_layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (merge_layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (merge_layer)));
|
||||
|
||||
/*reinit_layer_idlerender (gimage, merge_layer);*/
|
||||
|
||||
|
@ -3510,13 +3520,10 @@ gimp_image_add_layer (GimpImage *gimage,
|
|||
gimp_image_set_active_layer (gimage, layer);
|
||||
|
||||
/* update the new layer's area */
|
||||
drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (layer)));
|
||||
|
||||
/* invalidate the composite preview */
|
||||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimage));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (layer)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (layer)));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -3659,10 +3666,10 @@ gimp_image_position_channel (GimpImage *gimage,
|
|||
gimp_container_reorder (gimage->channels,
|
||||
GIMP_OBJECT (channel), new_index);
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -3710,10 +3717,10 @@ gimp_image_add_channel (GimpImage *gimage,
|
|||
|
||||
/* if channel is visible, update the image */
|
||||
if (gimp_drawable_get_visible (GIMP_DRAWABLE (channel)))
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
gimp_drawable_width (GIMP_DRAWABLE (channel)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -150,11 +150,11 @@ struct _GimpImageClass
|
|||
|
||||
void (* clean) (GimpImage *gimage);
|
||||
void (* dirty) (GimpImage *gimage);
|
||||
void (* repaint) (GimpImage *gimage,
|
||||
gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2);
|
||||
void (* update) (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void (* colormap_changed) (GimpImage *gimage,
|
||||
gint color_index);
|
||||
void (* undo_event) (GimpImage *gimage,
|
||||
|
@ -282,8 +282,13 @@ void gimp_image_colormap_changed (GimpImage *gimage,
|
|||
|
||||
void gimp_image_mode_changed (GimpImage *gimage);
|
||||
void gimp_image_alpha_changed (GimpImage *gimage);
|
||||
void gimp_image_floating_selection_changed (GimpImage *gimage);
|
||||
void gimp_image_mask_changed (GimpImage *gimage);
|
||||
void gimp_image_floating_selection_changed (GimpImage *gimage);
|
||||
void gimp_image_mask_changed (GimpImage *gimage);
|
||||
void gimp_image_update (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
|
||||
/* layer/channel functions */
|
||||
|
|
|
@ -58,7 +58,6 @@
|
|||
#include "devices.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "disp_callbacks.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimprc.h"
|
||||
#include "scale.h"
|
||||
|
@ -1017,9 +1016,9 @@ gdisplay_bucket_fill (GtkWidget *widget,
|
|||
tile_manager_destroy (buf_tiles);
|
||||
|
||||
/* Update the displays */
|
||||
drawable_update (drawable,
|
||||
x1, y1,
|
||||
(x2 - x1), (y2 - y1));
|
||||
gimp_drawable_update (drawable,
|
||||
x1, y1,
|
||||
(x2 - x1), (y2 - y1));
|
||||
gdisplays_flush ();
|
||||
|
||||
if (new_buf)
|
||||
|
|
|
@ -58,7 +58,6 @@
|
|||
#include "devices.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "disp_callbacks.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimprc.h"
|
||||
#include "scale.h"
|
||||
|
@ -1017,9 +1016,9 @@ gdisplay_bucket_fill (GtkWidget *widget,
|
|||
tile_manager_destroy (buf_tiles);
|
||||
|
||||
/* Update the displays */
|
||||
drawable_update (drawable,
|
||||
x1, y1,
|
||||
(x2 - x1), (y2 - y1));
|
||||
gimp_drawable_update (drawable,
|
||||
x1, y1,
|
||||
(x2 - x1), (y2 - y1));
|
||||
gdisplays_flush ();
|
||||
|
||||
if (new_buf)
|
||||
|
|
|
@ -58,7 +58,6 @@
|
|||
#include "devices.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "disp_callbacks.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimprc.h"
|
||||
#include "scale.h"
|
||||
|
@ -1017,9 +1016,9 @@ gdisplay_bucket_fill (GtkWidget *widget,
|
|||
tile_manager_destroy (buf_tiles);
|
||||
|
||||
/* Update the displays */
|
||||
drawable_update (drawable,
|
||||
x1, y1,
|
||||
(x2 - x1), (y2 - y1));
|
||||
gimp_drawable_update (drawable,
|
||||
x1, y1,
|
||||
(x2 - x1), (y2 - y1));
|
||||
gdisplays_flush ();
|
||||
|
||||
if (new_buf)
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include "widgets/gimpcolorpanel.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplay.h"
|
||||
#include "qmask.h"
|
||||
|
@ -51,11 +50,11 @@ typedef struct _EditQmaskOptions EditQmaskOptions;
|
|||
|
||||
struct _EditQmaskOptions
|
||||
{
|
||||
GtkWidget *query_box;
|
||||
GtkWidget *name_entry;
|
||||
GtkWidget *color_panel;
|
||||
GtkWidget *query_box;
|
||||
GtkWidget *name_entry;
|
||||
GtkWidget *color_panel;
|
||||
|
||||
GimpImage *gimage;
|
||||
GimpImage *gimage;
|
||||
};
|
||||
|
||||
|
||||
|
@ -104,7 +103,7 @@ qmask_removed_callback (GtkObject *qmask,
|
|||
|
||||
if (!gdisp->gimage)
|
||||
return;
|
||||
|
||||
|
||||
gdisp->gimage->qmask_state = FALSE;
|
||||
|
||||
qmask_buttons_update (gdisp);
|
||||
|
@ -120,34 +119,34 @@ qmask_buttons_update (GDisplay *gdisp)
|
|||
if (gdisp->gimage->qmask_state != GTK_TOGGLE_BUTTON (gdisp->qmaskon)->active)
|
||||
{
|
||||
/* Disable toggle from doing anything */
|
||||
gtk_signal_handler_block_by_func(GTK_OBJECT(gdisp->qmaskoff),
|
||||
(GtkSignalFunc) qmask_deactivate,
|
||||
gdisp);
|
||||
gtk_signal_handler_block_by_func(GTK_OBJECT(gdisp->qmaskon),
|
||||
(GtkSignalFunc) qmask_activate,
|
||||
gdisp);
|
||||
gtk_signal_handler_block_by_func (GTK_OBJECT (gdisp->qmaskoff),
|
||||
GTK_SIGNAL_FUNC (qmask_deactivate),
|
||||
gdisp);
|
||||
gtk_signal_handler_block_by_func (GTK_OBJECT (gdisp->qmaskon),
|
||||
GTK_SIGNAL_FUNC (qmask_activate),
|
||||
gdisp);
|
||||
|
||||
/* Change the state of the buttons */
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gdisp->qmaskon),
|
||||
gdisp->gimage->qmask_state);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gdisp->qmaskon),
|
||||
gdisp->gimage->qmask_state);
|
||||
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gdisp->qmaskoff),
|
||||
!gdisp->gimage->qmask_state);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gdisp->qmaskoff),
|
||||
! gdisp->gimage->qmask_state);
|
||||
|
||||
/* Enable toggle again */
|
||||
gtk_signal_handler_unblock_by_func(GTK_OBJECT(gdisp->qmaskoff),
|
||||
(GtkSignalFunc) qmask_deactivate,
|
||||
gdisp);
|
||||
gtk_signal_handler_unblock_by_func(GTK_OBJECT(gdisp->qmaskon),
|
||||
(GtkSignalFunc) qmask_activate,
|
||||
gdisp);
|
||||
gtk_signal_handler_unblock_by_func (GTK_OBJECT (gdisp->qmaskoff),
|
||||
GTK_SIGNAL_FUNC (qmask_deactivate),
|
||||
gdisp);
|
||||
gtk_signal_handler_unblock_by_func (GTK_OBJECT (gdisp->qmaskon),
|
||||
GTK_SIGNAL_FUNC (qmask_activate),
|
||||
gdisp);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
qmask_click_handler (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
void
|
||||
qmask_click_handler (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
|
||||
|
@ -164,28 +163,29 @@ void
|
|||
qmask_deactivate (GtkWidget *widget,
|
||||
GDisplay *gdisp)
|
||||
{
|
||||
GimpImage *gimg;
|
||||
GimpImage *gimage;
|
||||
GimpChannel *gmask;
|
||||
|
||||
if (gdisp)
|
||||
{
|
||||
gimg = gdisp->gimage;
|
||||
if (!gimg)
|
||||
gimage = gdisp->gimage;
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
|
||||
if (!gdisp->gimage->qmask_state)
|
||||
return; /* if already set do nothing */
|
||||
|
||||
if ( (gmask = gimp_image_get_channel_by_name (gimg, "Qmask")) )
|
||||
if ( (gmask = gimp_image_get_channel_by_name (gimage, "Qmask")) )
|
||||
{
|
||||
undo_push_group_start (gimg, QMASK_UNDO);
|
||||
undo_push_group_start (gimage, QMASK_UNDO);
|
||||
/* push the undo here since removing the mask will
|
||||
call the qmask_removed_callback() which will set
|
||||
the qmask_state to FALSE */
|
||||
undo_push_qmask (gimg);
|
||||
gimage_mask_load (gimg, gmask);
|
||||
gimp_image_remove_channel (gimg, gmask);
|
||||
undo_push_group_end (gimg);
|
||||
undo_push_qmask (gimage);
|
||||
gimage_mask_load (gimage, gmask);
|
||||
gimp_image_remove_channel (gimage, gmask);
|
||||
undo_push_group_end (gimage);
|
||||
}
|
||||
|
||||
gdisp->gimage->qmask_state = FALSE;
|
||||
|
@ -199,65 +199,64 @@ void
|
|||
qmask_activate (GtkWidget *widget,
|
||||
GDisplay *gdisp)
|
||||
{
|
||||
GimpImage *gimg;
|
||||
GimpImage *gimage;
|
||||
GimpChannel *gmask;
|
||||
GimpLayer *layer;
|
||||
GimpRGB color;
|
||||
|
||||
if (gdisp)
|
||||
{
|
||||
gimg = gdisp->gimage;
|
||||
if (!gimg)
|
||||
gimage = gdisp->gimage;
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
|
||||
if (gdisp->gimage->qmask_state)
|
||||
return; /* If already set, do nothing */
|
||||
|
||||
/* Set the defaults */
|
||||
color = gimg->qmask_color;
|
||||
color = gimage->qmask_color;
|
||||
|
||||
if ((gmask = gimp_image_get_channel_by_name (gimg, "Qmask")))
|
||||
if ((gmask = gimp_image_get_channel_by_name (gimage, "Qmask")))
|
||||
{
|
||||
gimg->qmask_state = TRUE;
|
||||
gimage->qmask_state = TRUE;
|
||||
/* if the user was clever and created his own */
|
||||
return;
|
||||
}
|
||||
|
||||
undo_push_group_start (gimg, QMASK_UNDO);
|
||||
undo_push_group_start (gimage, QMASK_UNDO);
|
||||
|
||||
if (gimage_mask_is_empty (gimg))
|
||||
if (gimage_mask_is_empty (gimage))
|
||||
{
|
||||
/* if no selection */
|
||||
|
||||
if ((layer = gimp_image_floating_sel (gimg)))
|
||||
if ((layer = gimp_image_floating_sel (gimage)))
|
||||
{
|
||||
floating_sel_to_layer (layer);
|
||||
}
|
||||
|
||||
gmask = gimp_channel_new (gimg,
|
||||
gimg->width,
|
||||
gimg->height,
|
||||
gmask = gimp_channel_new (gimage,
|
||||
gimage->width,
|
||||
gimage->height,
|
||||
"Qmask",
|
||||
&color);
|
||||
gimp_image_add_channel (gimg, gmask, 0);
|
||||
gimp_image_add_channel (gimage, gmask, 0);
|
||||
|
||||
drawable_fill (GIMP_DRAWABLE (gmask),
|
||||
gimp_get_user_context (gimg->gimp),
|
||||
TRANSPARENT_FILL);
|
||||
gimp_drawable_fill_by_type (GIMP_DRAWABLE (gmask),
|
||||
gimp_get_user_context (gimage->gimp),
|
||||
TRANSPARENT_FILL);
|
||||
}
|
||||
else
|
||||
else /* if selection */
|
||||
{
|
||||
/* if selection */
|
||||
|
||||
gmask = gimp_channel_copy (gimp_image_get_mask (gimg), TRUE);
|
||||
gimp_image_add_channel (gimg, gmask, 0);
|
||||
gmask = gimp_channel_copy (gimp_image_get_mask (gimage), TRUE);
|
||||
gimp_image_add_channel (gimage, gmask, 0);
|
||||
gimp_channel_set_color (gmask, &color);
|
||||
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
|
||||
gimage_mask_none (gimg); /* Clear the selection */
|
||||
gimage_mask_none (gimage); /* Clear the selection */
|
||||
}
|
||||
|
||||
undo_push_qmask (gimg);
|
||||
undo_push_group_end (gimg);
|
||||
undo_push_qmask (gimage);
|
||||
undo_push_group_end (gimage);
|
||||
gdisp->gimage->qmask_state = TRUE;
|
||||
gdisplays_flush ();
|
||||
|
||||
|
@ -368,12 +367,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
|
|||
|
||||
if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
|
||||
{
|
||||
channel->color = color;
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
gimp_channel_set_color (channel, &color);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
|
122
app/drawable.c
122
app/drawable.c
|
@ -1,122 +0,0 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
|
||||
#include "core/core-types.h"
|
||||
|
||||
#include "core/gimpdrawable.h"
|
||||
#include "core/gimpcontext.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "undo.h"
|
||||
|
||||
|
||||
void
|
||||
drawable_fill (GimpDrawable *drawable,
|
||||
GimpContext *context,
|
||||
GimpFillType fill_type)
|
||||
{
|
||||
GimpRGB color;
|
||||
|
||||
g_return_if_fail (drawable != NULL);
|
||||
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
|
||||
|
||||
color.a = 1.0;
|
||||
|
||||
switch (fill_type)
|
||||
{
|
||||
case FOREGROUND_FILL:
|
||||
gimp_context_get_foreground (context, &color);
|
||||
break;
|
||||
|
||||
case BACKGROUND_FILL:
|
||||
gimp_context_get_background (context, &color);
|
||||
break;
|
||||
|
||||
case WHITE_FILL:
|
||||
gimp_rgb_set (&color, 1.0, 1.0, 1.0);
|
||||
break;
|
||||
|
||||
case TRANSPARENT_FILL:
|
||||
gimp_rgba_set (&color, 0.0, 0.0, 0.0, 0.0);
|
||||
break;
|
||||
|
||||
case NO_FILL:
|
||||
return;
|
||||
|
||||
default:
|
||||
g_warning ("drawable_fill(): unknown fill type");
|
||||
return;
|
||||
}
|
||||
|
||||
gimp_drawable_fill (drawable, &color);
|
||||
|
||||
drawable_update (drawable, 0, 0,
|
||||
gimp_drawable_width (drawable),
|
||||
gimp_drawable_height (drawable));
|
||||
}
|
||||
|
||||
void
|
||||
drawable_update (GimpDrawable *drawable,
|
||||
gint x,
|
||||
gint y,
|
||||
gint w,
|
||||
gint h)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
gint offset_x, offset_y;
|
||||
|
||||
g_return_if_fail (drawable != NULL);
|
||||
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
|
||||
|
||||
gimage = gimp_drawable_gimage (drawable);
|
||||
g_return_if_fail (gimage != NULL);
|
||||
|
||||
gimp_drawable_offsets (drawable, &offset_x, &offset_y);
|
||||
x += offset_x;
|
||||
y += offset_y;
|
||||
gdisplays_update_area (gimage, x, y, w, h);
|
||||
|
||||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (drawable));
|
||||
}
|
||||
|
||||
void
|
||||
drawable_apply_image (GimpDrawable *drawable,
|
||||
gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2,
|
||||
TileManager *tiles,
|
||||
gint sparse)
|
||||
{
|
||||
g_return_if_fail (drawable != NULL);
|
||||
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
|
||||
|
||||
if (! tiles)
|
||||
undo_push_image (drawable->gimage, drawable,
|
||||
x1, y1, x2, y2);
|
||||
else
|
||||
undo_push_image_mod (drawable->gimage, drawable,
|
||||
x1, y1, x2, y2, tiles, sparse);
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __DRAWABLE_H__
|
||||
#define __DRAWABLE_H__
|
||||
|
||||
|
||||
void drawable_fill (GimpDrawable *drawable,
|
||||
GimpContext *context,
|
||||
GimpFillType fill_type);
|
||||
|
||||
void drawable_update (GimpDrawable *drawable,
|
||||
gint x,
|
||||
gint y,
|
||||
gint w,
|
||||
gint h);
|
||||
void drawable_apply_image (GimpDrawable *drawable,
|
||||
gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2,
|
||||
TileManager *tiles,
|
||||
gint sparse);
|
||||
|
||||
|
||||
#endif /* __DRAWABLE_H__ */
|
|
@ -35,7 +35,6 @@
|
|||
#include "core/gimplayer.h"
|
||||
#include "core/gimplayermask.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "undo.h"
|
||||
|
||||
|
@ -237,10 +236,10 @@ floating_sel_to_layer (GimpLayer *layer)
|
|||
msw@gimp.org
|
||||
*/
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
|
||||
/* This may be undesirable when invoked non-interactively... we'll see. */
|
||||
/*reinit_layer_idlerender (gimage, layer);*/
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include "menus.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
@ -316,9 +315,9 @@ new_channel_query_ok_callback (GtkWidget *widget,
|
|||
channel_name,
|
||||
&channel_color);
|
||||
|
||||
drawable_fill (GIMP_DRAWABLE (new_channel),
|
||||
gimp_get_user_context (the_gimp),
|
||||
TRANSPARENT_FILL);
|
||||
gimp_drawable_fill_by_type (GIMP_DRAWABLE (new_channel),
|
||||
gimp_get_user_context (the_gimp),
|
||||
TRANSPARENT_FILL);
|
||||
|
||||
gimp_image_add_channel (gimage, new_channel, -1);
|
||||
gdisplays_flush ();
|
||||
|
@ -465,12 +464,7 @@ edit_channel_query_ok_callback (GtkWidget *widget,
|
|||
|
||||
if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
|
||||
{
|
||||
channel->color = color;
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
gimp_channel_set_color (channel, &color);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ static void gui_image_size_changed (GimpImage *gimage,
|
|||
gpointer data);
|
||||
static void gui_image_alpha_changed (GimpImage *gimage,
|
||||
gpointer data);
|
||||
static void gui_image_repaint (GimpImage *gimage,
|
||||
static void gui_image_update (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint w,
|
||||
|
@ -112,7 +112,7 @@ static GQuark image_colormap_changed_handler_id = 0;
|
|||
static GQuark image_name_changed_handler_id = 0;
|
||||
static GQuark image_size_changed_handler_id = 0;
|
||||
static GQuark image_alpha_changed_handler_id = 0;
|
||||
static GQuark image_repaint_handler_id = 0;
|
||||
static GQuark image_update_handler_id = 0;
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
@ -147,9 +147,9 @@ gui_init (Gimp *gimp)
|
|||
GTK_SIGNAL_FUNC (gui_image_alpha_changed),
|
||||
gimp);
|
||||
|
||||
image_repaint_handler_id =
|
||||
gimp_container_add_handler (gimp->images, "repaint",
|
||||
GTK_SIGNAL_FUNC (gui_image_repaint),
|
||||
image_update_handler_id =
|
||||
gimp_container_add_handler (gimp->images, "update",
|
||||
GTK_SIGNAL_FUNC (gui_image_update),
|
||||
gimp);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (gimp_get_user_context (gimp)),
|
||||
|
@ -267,14 +267,14 @@ gui_exit (Gimp *gimp)
|
|||
gimp_container_remove_handler (gimp->images, image_name_changed_handler_id);
|
||||
gimp_container_remove_handler (gimp->images, image_size_changed_handler_id);
|
||||
gimp_container_remove_handler (gimp->images, image_alpha_changed_handler_id);
|
||||
gimp_container_remove_handler (gimp->images, image_repaint_handler_id);
|
||||
gimp_container_remove_handler (gimp->images, image_update_handler_id);
|
||||
|
||||
image_destroy_handler_id = 0;
|
||||
image_colormap_changed_handler_id = 0;
|
||||
image_name_changed_handler_id = 0;
|
||||
image_size_changed_handler_id = 0;
|
||||
image_alpha_changed_handler_id = 0;
|
||||
image_repaint_handler_id = 0;
|
||||
image_update_handler_id = 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -498,12 +498,12 @@ gui_image_alpha_changed (GimpImage *gimage,
|
|||
}
|
||||
|
||||
static void
|
||||
gui_image_repaint (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint w,
|
||||
gint h,
|
||||
gpointer data)
|
||||
gui_image_update (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint w,
|
||||
gint h,
|
||||
gpointer data)
|
||||
{
|
||||
Gimp *gimp;
|
||||
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
#include "resize-dialog.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "floating_sel.h"
|
||||
#include "undo.h"
|
||||
|
@ -246,7 +245,7 @@ layers_delete_cmd_callback (GtkWidget *widget,
|
|||
else
|
||||
gimp_image_remove_layer (gimage, layer);
|
||||
|
||||
gdisplays_flush_now ();
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -544,9 +543,9 @@ new_layer_query_ok_callback (GtkWidget *widget,
|
|||
layer_name, OPAQUE_OPACITY, NORMAL_MODE);
|
||||
if (layer)
|
||||
{
|
||||
drawable_fill (GIMP_DRAWABLE (layer),
|
||||
gimp_get_user_context (the_gimp),
|
||||
fill_type);
|
||||
gimp_drawable_fill_by_type (GIMP_DRAWABLE (layer),
|
||||
gimp_get_user_context (gimage->gimp),
|
||||
fill_type);
|
||||
gimp_image_add_layer (gimage, layer, -1);
|
||||
|
||||
/* End the group undo */
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include "widgets/gimpcolorpanel.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplay.h"
|
||||
#include "qmask.h"
|
||||
|
@ -51,11 +50,11 @@ typedef struct _EditQmaskOptions EditQmaskOptions;
|
|||
|
||||
struct _EditQmaskOptions
|
||||
{
|
||||
GtkWidget *query_box;
|
||||
GtkWidget *name_entry;
|
||||
GtkWidget *color_panel;
|
||||
GtkWidget *query_box;
|
||||
GtkWidget *name_entry;
|
||||
GtkWidget *color_panel;
|
||||
|
||||
GimpImage *gimage;
|
||||
GimpImage *gimage;
|
||||
};
|
||||
|
||||
|
||||
|
@ -104,7 +103,7 @@ qmask_removed_callback (GtkObject *qmask,
|
|||
|
||||
if (!gdisp->gimage)
|
||||
return;
|
||||
|
||||
|
||||
gdisp->gimage->qmask_state = FALSE;
|
||||
|
||||
qmask_buttons_update (gdisp);
|
||||
|
@ -120,34 +119,34 @@ qmask_buttons_update (GDisplay *gdisp)
|
|||
if (gdisp->gimage->qmask_state != GTK_TOGGLE_BUTTON (gdisp->qmaskon)->active)
|
||||
{
|
||||
/* Disable toggle from doing anything */
|
||||
gtk_signal_handler_block_by_func(GTK_OBJECT(gdisp->qmaskoff),
|
||||
(GtkSignalFunc) qmask_deactivate,
|
||||
gdisp);
|
||||
gtk_signal_handler_block_by_func(GTK_OBJECT(gdisp->qmaskon),
|
||||
(GtkSignalFunc) qmask_activate,
|
||||
gdisp);
|
||||
gtk_signal_handler_block_by_func (GTK_OBJECT (gdisp->qmaskoff),
|
||||
GTK_SIGNAL_FUNC (qmask_deactivate),
|
||||
gdisp);
|
||||
gtk_signal_handler_block_by_func (GTK_OBJECT (gdisp->qmaskon),
|
||||
GTK_SIGNAL_FUNC (qmask_activate),
|
||||
gdisp);
|
||||
|
||||
/* Change the state of the buttons */
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gdisp->qmaskon),
|
||||
gdisp->gimage->qmask_state);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gdisp->qmaskon),
|
||||
gdisp->gimage->qmask_state);
|
||||
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gdisp->qmaskoff),
|
||||
!gdisp->gimage->qmask_state);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gdisp->qmaskoff),
|
||||
! gdisp->gimage->qmask_state);
|
||||
|
||||
/* Enable toggle again */
|
||||
gtk_signal_handler_unblock_by_func(GTK_OBJECT(gdisp->qmaskoff),
|
||||
(GtkSignalFunc) qmask_deactivate,
|
||||
gdisp);
|
||||
gtk_signal_handler_unblock_by_func(GTK_OBJECT(gdisp->qmaskon),
|
||||
(GtkSignalFunc) qmask_activate,
|
||||
gdisp);
|
||||
gtk_signal_handler_unblock_by_func (GTK_OBJECT (gdisp->qmaskoff),
|
||||
GTK_SIGNAL_FUNC (qmask_deactivate),
|
||||
gdisp);
|
||||
gtk_signal_handler_unblock_by_func (GTK_OBJECT (gdisp->qmaskon),
|
||||
GTK_SIGNAL_FUNC (qmask_activate),
|
||||
gdisp);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
qmask_click_handler (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
void
|
||||
qmask_click_handler (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
|
||||
|
@ -164,28 +163,29 @@ void
|
|||
qmask_deactivate (GtkWidget *widget,
|
||||
GDisplay *gdisp)
|
||||
{
|
||||
GimpImage *gimg;
|
||||
GimpImage *gimage;
|
||||
GimpChannel *gmask;
|
||||
|
||||
if (gdisp)
|
||||
{
|
||||
gimg = gdisp->gimage;
|
||||
if (!gimg)
|
||||
gimage = gdisp->gimage;
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
|
||||
if (!gdisp->gimage->qmask_state)
|
||||
return; /* if already set do nothing */
|
||||
|
||||
if ( (gmask = gimp_image_get_channel_by_name (gimg, "Qmask")) )
|
||||
if ( (gmask = gimp_image_get_channel_by_name (gimage, "Qmask")) )
|
||||
{
|
||||
undo_push_group_start (gimg, QMASK_UNDO);
|
||||
undo_push_group_start (gimage, QMASK_UNDO);
|
||||
/* push the undo here since removing the mask will
|
||||
call the qmask_removed_callback() which will set
|
||||
the qmask_state to FALSE */
|
||||
undo_push_qmask (gimg);
|
||||
gimage_mask_load (gimg, gmask);
|
||||
gimp_image_remove_channel (gimg, gmask);
|
||||
undo_push_group_end (gimg);
|
||||
undo_push_qmask (gimage);
|
||||
gimage_mask_load (gimage, gmask);
|
||||
gimp_image_remove_channel (gimage, gmask);
|
||||
undo_push_group_end (gimage);
|
||||
}
|
||||
|
||||
gdisp->gimage->qmask_state = FALSE;
|
||||
|
@ -199,65 +199,64 @@ void
|
|||
qmask_activate (GtkWidget *widget,
|
||||
GDisplay *gdisp)
|
||||
{
|
||||
GimpImage *gimg;
|
||||
GimpImage *gimage;
|
||||
GimpChannel *gmask;
|
||||
GimpLayer *layer;
|
||||
GimpRGB color;
|
||||
|
||||
if (gdisp)
|
||||
{
|
||||
gimg = gdisp->gimage;
|
||||
if (!gimg)
|
||||
gimage = gdisp->gimage;
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
|
||||
if (gdisp->gimage->qmask_state)
|
||||
return; /* If already set, do nothing */
|
||||
|
||||
/* Set the defaults */
|
||||
color = gimg->qmask_color;
|
||||
color = gimage->qmask_color;
|
||||
|
||||
if ((gmask = gimp_image_get_channel_by_name (gimg, "Qmask")))
|
||||
if ((gmask = gimp_image_get_channel_by_name (gimage, "Qmask")))
|
||||
{
|
||||
gimg->qmask_state = TRUE;
|
||||
gimage->qmask_state = TRUE;
|
||||
/* if the user was clever and created his own */
|
||||
return;
|
||||
}
|
||||
|
||||
undo_push_group_start (gimg, QMASK_UNDO);
|
||||
undo_push_group_start (gimage, QMASK_UNDO);
|
||||
|
||||
if (gimage_mask_is_empty (gimg))
|
||||
if (gimage_mask_is_empty (gimage))
|
||||
{
|
||||
/* if no selection */
|
||||
|
||||
if ((layer = gimp_image_floating_sel (gimg)))
|
||||
if ((layer = gimp_image_floating_sel (gimage)))
|
||||
{
|
||||
floating_sel_to_layer (layer);
|
||||
}
|
||||
|
||||
gmask = gimp_channel_new (gimg,
|
||||
gimg->width,
|
||||
gimg->height,
|
||||
gmask = gimp_channel_new (gimage,
|
||||
gimage->width,
|
||||
gimage->height,
|
||||
"Qmask",
|
||||
&color);
|
||||
gimp_image_add_channel (gimg, gmask, 0);
|
||||
gimp_image_add_channel (gimage, gmask, 0);
|
||||
|
||||
drawable_fill (GIMP_DRAWABLE (gmask),
|
||||
gimp_get_user_context (gimg->gimp),
|
||||
TRANSPARENT_FILL);
|
||||
gimp_drawable_fill_by_type (GIMP_DRAWABLE (gmask),
|
||||
gimp_get_user_context (gimage->gimp),
|
||||
TRANSPARENT_FILL);
|
||||
}
|
||||
else
|
||||
else /* if selection */
|
||||
{
|
||||
/* if selection */
|
||||
|
||||
gmask = gimp_channel_copy (gimp_image_get_mask (gimg), TRUE);
|
||||
gimp_image_add_channel (gimg, gmask, 0);
|
||||
gmask = gimp_channel_copy (gimp_image_get_mask (gimage), TRUE);
|
||||
gimp_image_add_channel (gimage, gmask, 0);
|
||||
gimp_channel_set_color (gmask, &color);
|
||||
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
|
||||
gimage_mask_none (gimg); /* Clear the selection */
|
||||
gimage_mask_none (gimage); /* Clear the selection */
|
||||
}
|
||||
|
||||
undo_push_qmask (gimg);
|
||||
undo_push_group_end (gimg);
|
||||
undo_push_qmask (gimage);
|
||||
undo_push_group_end (gimage);
|
||||
gdisp->gimage->qmask_state = TRUE;
|
||||
gdisplays_flush ();
|
||||
|
||||
|
@ -368,12 +367,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
|
|||
|
||||
if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
|
||||
{
|
||||
channel->color = color;
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
gimp_channel_set_color (channel, &color);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "core/gimpdrawable.h"
|
||||
#include "core/gimpimage.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "image_map.h"
|
||||
|
||||
|
@ -93,7 +92,9 @@ image_map_do (gpointer data)
|
|||
/* display the results */
|
||||
if (image_map->gdisp)
|
||||
{
|
||||
drawable_update ( (image_map->drawable), x, y, w, h);
|
||||
gimp_drawable_update (image_map->drawable,
|
||||
x, y,
|
||||
w, h);
|
||||
gdisplay_flush_now (image_map->gdisp);
|
||||
}
|
||||
|
||||
|
@ -270,8 +271,9 @@ image_map_commit (ImageMap *image_map)
|
|||
tile_manager_get_offsets (image_map->undo_tiles, &x1, &y1);
|
||||
x2 = x1 + tile_manager_width (image_map->undo_tiles);
|
||||
y2 = y1 + tile_manager_height (image_map->undo_tiles);
|
||||
drawable_apply_image (image_map->drawable,
|
||||
x1, y1, x2, y2, image_map->undo_tiles, FALSE);
|
||||
|
||||
gimp_drawable_apply_image (image_map->drawable,
|
||||
x1, y1, x2, y2, image_map->undo_tiles, FALSE);
|
||||
}
|
||||
|
||||
gdisplay_set_menu_sensitivity (image_map->gdisp);
|
||||
|
@ -331,7 +333,9 @@ image_map_clear (ImageMap *image_map)
|
|||
copy_region (&srcPR, &destPR);
|
||||
|
||||
/* Update the area */
|
||||
drawable_update (image_map->drawable, offset_x, offset_y, width, height);
|
||||
gimp_drawable_update (image_map->drawable,
|
||||
offset_x, offset_y,
|
||||
width, height);
|
||||
|
||||
/* Free the undo_tiles tile manager */
|
||||
tile_manager_destroy (image_map->undo_tiles);
|
||||
|
|
|
@ -36,14 +36,13 @@
|
|||
#include "core/gimpgradient.h"
|
||||
#include "core/gimpimage.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "gimpairbrushtool.h"
|
||||
#include "paint_options.h"
|
||||
#include "gimptool.h"
|
||||
#include "tool_manager.h"
|
||||
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#define WANT_AIRBRUSH_BITS
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
#include "tool_manager.h"
|
||||
#include "tool_options.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include "tool_manager.h"
|
||||
#include "tool_options.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
|
|
@ -41,17 +41,16 @@
|
|||
#include "core/gimpimage.h"
|
||||
#include "core/gimpimage-mask.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "gimprc.h"
|
||||
#include "undo.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "gimpinktool.h"
|
||||
#include "gimpinktool-blob.h"
|
||||
#include "gimptool.h"
|
||||
#include "paint_options.h"
|
||||
#include "tool_manager.h"
|
||||
|
||||
#include "gimprc.h"
|
||||
#include "undo.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#define WANT_INK_BITS
|
||||
|
@ -1233,8 +1232,8 @@ ink_finish (GimpInkTool *ink_tool,
|
|||
GimpDrawable *drawable)
|
||||
{
|
||||
/* push an undo */
|
||||
drawable_apply_image (drawable, ink_tool->x1, ink_tool->y1,
|
||||
ink_tool->x2, ink_tool->y2, undo_tiles, TRUE);
|
||||
gimp_drawable_apply_image (drawable, ink_tool->x1, ink_tool->y1,
|
||||
ink_tool->x2, ink_tool->y2, undo_tiles, TRUE);
|
||||
undo_tiles = NULL;
|
||||
|
||||
/* invalidate the drawable--have to do it here, because
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
|
||||
#include "app_procs.h"
|
||||
#include "devices.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimprc.h"
|
||||
#include "undo.h"
|
||||
|
@ -1068,8 +1067,8 @@ gimp_paint_tool_finish (GimpPaintTool *paint_tool,
|
|||
undo_push_paint (gimage, pu);
|
||||
|
||||
/* push an undo */
|
||||
drawable_apply_image (drawable, paint_tool->x1, paint_tool->y1,
|
||||
paint_tool->x2, paint_tool->y2, undo_tiles, TRUE);
|
||||
gimp_drawable_apply_image (drawable, paint_tool->x1, paint_tool->y1,
|
||||
paint_tool->x2, paint_tool->y2, undo_tiles, TRUE);
|
||||
undo_tiles = NULL;
|
||||
|
||||
/* push the group end */
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
#include "tool_manager.h"
|
||||
#include "tool_options.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "appenums.h"
|
||||
#include "core/gimpchannel.h"
|
||||
#include "core/gimpimage.h"
|
||||
#include "drawable.h"
|
||||
#include "pdb_glue.h"
|
||||
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#include "core/gimpdrawable-invert.h"
|
||||
#include "core/gimpdrawable.h"
|
||||
#include "core/gimpimage.h"
|
||||
#include "drawable.h"
|
||||
#include "tools/gimpcolorbalancetool.h"
|
||||
#include "tools/gimpcurvestool.h"
|
||||
#include "tools/gimphistogramtool.h"
|
||||
|
@ -128,7 +127,7 @@ brightness_contrast_invoker (Gimp *gimp,
|
|||
|
||||
gimp_lut_free (lut);
|
||||
gimp_drawable_merge_shadow (drawable, TRUE);
|
||||
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
gimp_drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -262,7 +261,7 @@ levels_invoker (Gimp *gimp,
|
|||
|
||||
gimp_lut_free(lut);
|
||||
gimp_drawable_merge_shadow (drawable, TRUE);
|
||||
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
gimp_drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -367,7 +366,7 @@ posterize_invoker (Gimp *gimp,
|
|||
|
||||
gimp_lut_free (lut);
|
||||
gimp_drawable_merge_shadow (drawable, TRUE);
|
||||
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
gimp_drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -628,7 +627,7 @@ curves_spline_invoker (Gimp *gimp,
|
|||
|
||||
gimp_lut_free (cd.lut);
|
||||
gimp_drawable_merge_shadow (drawable, TRUE);
|
||||
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
gimp_drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -737,7 +736,7 @@ curves_explicit_invoker (Gimp *gimp,
|
|||
|
||||
gimp_lut_free (cd.lut);
|
||||
gimp_drawable_merge_shadow (drawable, TRUE);
|
||||
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
gimp_drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -856,7 +855,7 @@ color_balance_invoker (Gimp *gimp,
|
|||
color_balance (&srcPR, &destPR, (void *) &cbd);
|
||||
|
||||
gimp_drawable_merge_shadow (drawable, TRUE);
|
||||
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
gimp_drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1148,7 +1147,7 @@ hue_saturation_invoker (Gimp *gimp,
|
|||
hue_saturation (&srcPR, &destPR, (void *) &hsd);
|
||||
|
||||
gimp_drawable_merge_shadow (drawable, TRUE);
|
||||
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
gimp_drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1246,7 +1245,7 @@ threshold_invoker (Gimp *gimp,
|
|||
&srcPR, &destPR);
|
||||
|
||||
gimp_drawable_merge_shadow (drawable, TRUE);
|
||||
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
gimp_drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#include "core/gimpimage.h"
|
||||
#include "core/gimplayer.h"
|
||||
#include "core/gimplayermask.h"
|
||||
#include "drawable.h"
|
||||
#include "pdb_glue.h"
|
||||
|
||||
static ProcRecord drawable_merge_shadow_proc;
|
||||
|
@ -162,7 +161,7 @@ drawable_fill_invoker (Gimp *gimp,
|
|||
success = FALSE;
|
||||
|
||||
if (success)
|
||||
drawable_fill (drawable, gimp_get_current_context (gimp), (GimpFillType) fill_type);
|
||||
gimp_drawable_fill_by_type (drawable, gimp_get_current_context (gimp), (GimpFillType) fill_type);
|
||||
|
||||
return procedural_db_return_args (&drawable_fill_proc, success);
|
||||
}
|
||||
|
@ -221,7 +220,7 @@ drawable_update_invoker (Gimp *gimp,
|
|||
height = args[4].value.pdb_int;
|
||||
|
||||
if (success)
|
||||
drawable_update (drawable, x, y, width, height);
|
||||
gimp_drawable_update (drawable, x, y, width, height);
|
||||
|
||||
return procedural_db_return_args (&drawable_update_proc, success);
|
||||
}
|
||||
|
|
|
@ -30,10 +30,10 @@
|
|||
|
||||
#include "core/core-types.h"
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimpdrawable.h"
|
||||
#include "core/gimpedit.h"
|
||||
#include "core/gimpimage-mask.h"
|
||||
#include "core/gimplayer.h"
|
||||
#include "drawable.h"
|
||||
|
||||
static ProcRecord edit_cut_proc;
|
||||
static ProcRecord edit_copy_proc;
|
||||
|
|
|
@ -28,8 +28,8 @@
|
|||
#include "core/core-types.h"
|
||||
#include "procedural_db.h"
|
||||
|
||||
#include "core/gimpdrawable.h"
|
||||
#include "core/gimplayer.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
|
||||
static ProcRecord floating_sel_remove_proc;
|
||||
|
|
|
@ -35,13 +35,13 @@
|
|||
#include "core/gimp.h"
|
||||
#include "core/gimpchannel.h"
|
||||
#include "core/gimpcontainer.h"
|
||||
#include "core/gimpdrawable.h"
|
||||
#include "core/gimpimage-crop.h"
|
||||
#include "core/gimpimage-duplicate.h"
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimplayer.h"
|
||||
#include "core/gimplayermask.h"
|
||||
#include "core/gimplist.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "core/gimplayer.h"
|
||||
#include "core/gimplayermask.h"
|
||||
#include "core/gimplist.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "pdb_glue.h"
|
||||
#include "undo.h"
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
|
||||
#include "core/gimpdrawable.h"
|
||||
#include "core/gimpimage.h"
|
||||
#include "drawable.h"
|
||||
#include "gimpparasite.h"
|
||||
|
||||
#include "libgimpbase/gimpparasite.h"
|
||||
|
|
|
@ -30,10 +30,10 @@
|
|||
|
||||
#include "appenums.h"
|
||||
#include "core/gimpchannel.h"
|
||||
#include "core/gimpdrawable.h"
|
||||
#include "core/gimpimage-mask.h"
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimplayer.h"
|
||||
#include "drawable.h"
|
||||
|
||||
static ProcRecord selection_bounds_proc;
|
||||
static ProcRecord selection_value_proc;
|
||||
|
|
|
@ -32,9 +32,9 @@
|
|||
#include "procedural_db.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "core/gimpdrawable.h"
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimplayer.h"
|
||||
#include "drawable.h"
|
||||
#include "tools/gimptexttool.h"
|
||||
|
||||
#include "libgimpbase/gimpbase.h"
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include "base/tile-manager.h"
|
||||
#include "core/gimpdrawable.h"
|
||||
#include "core/gimpimage.h"
|
||||
#include "drawable.h"
|
||||
#include "tools/gimpairbrushtool.h"
|
||||
#include "tools/gimpblendtool.h"
|
||||
#include "tools/gimpbucketfilltool.h"
|
||||
|
|
124
app/qmask.c
124
app/qmask.c
|
@ -38,7 +38,6 @@
|
|||
#include "widgets/gimpcolorpanel.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplay.h"
|
||||
#include "qmask.h"
|
||||
|
@ -51,11 +50,11 @@ typedef struct _EditQmaskOptions EditQmaskOptions;
|
|||
|
||||
struct _EditQmaskOptions
|
||||
{
|
||||
GtkWidget *query_box;
|
||||
GtkWidget *name_entry;
|
||||
GtkWidget *color_panel;
|
||||
GtkWidget *query_box;
|
||||
GtkWidget *name_entry;
|
||||
GtkWidget *color_panel;
|
||||
|
||||
GimpImage *gimage;
|
||||
GimpImage *gimage;
|
||||
};
|
||||
|
||||
|
||||
|
@ -104,7 +103,7 @@ qmask_removed_callback (GtkObject *qmask,
|
|||
|
||||
if (!gdisp->gimage)
|
||||
return;
|
||||
|
||||
|
||||
gdisp->gimage->qmask_state = FALSE;
|
||||
|
||||
qmask_buttons_update (gdisp);
|
||||
|
@ -120,34 +119,34 @@ qmask_buttons_update (GDisplay *gdisp)
|
|||
if (gdisp->gimage->qmask_state != GTK_TOGGLE_BUTTON (gdisp->qmaskon)->active)
|
||||
{
|
||||
/* Disable toggle from doing anything */
|
||||
gtk_signal_handler_block_by_func(GTK_OBJECT(gdisp->qmaskoff),
|
||||
(GtkSignalFunc) qmask_deactivate,
|
||||
gdisp);
|
||||
gtk_signal_handler_block_by_func(GTK_OBJECT(gdisp->qmaskon),
|
||||
(GtkSignalFunc) qmask_activate,
|
||||
gdisp);
|
||||
gtk_signal_handler_block_by_func (GTK_OBJECT (gdisp->qmaskoff),
|
||||
GTK_SIGNAL_FUNC (qmask_deactivate),
|
||||
gdisp);
|
||||
gtk_signal_handler_block_by_func (GTK_OBJECT (gdisp->qmaskon),
|
||||
GTK_SIGNAL_FUNC (qmask_activate),
|
||||
gdisp);
|
||||
|
||||
/* Change the state of the buttons */
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gdisp->qmaskon),
|
||||
gdisp->gimage->qmask_state);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gdisp->qmaskon),
|
||||
gdisp->gimage->qmask_state);
|
||||
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gdisp->qmaskoff),
|
||||
!gdisp->gimage->qmask_state);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gdisp->qmaskoff),
|
||||
! gdisp->gimage->qmask_state);
|
||||
|
||||
/* Enable toggle again */
|
||||
gtk_signal_handler_unblock_by_func(GTK_OBJECT(gdisp->qmaskoff),
|
||||
(GtkSignalFunc) qmask_deactivate,
|
||||
gdisp);
|
||||
gtk_signal_handler_unblock_by_func(GTK_OBJECT(gdisp->qmaskon),
|
||||
(GtkSignalFunc) qmask_activate,
|
||||
gdisp);
|
||||
gtk_signal_handler_unblock_by_func (GTK_OBJECT (gdisp->qmaskoff),
|
||||
GTK_SIGNAL_FUNC (qmask_deactivate),
|
||||
gdisp);
|
||||
gtk_signal_handler_unblock_by_func (GTK_OBJECT (gdisp->qmaskon),
|
||||
GTK_SIGNAL_FUNC (qmask_activate),
|
||||
gdisp);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
qmask_click_handler (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
void
|
||||
qmask_click_handler (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
|
||||
|
@ -164,28 +163,29 @@ void
|
|||
qmask_deactivate (GtkWidget *widget,
|
||||
GDisplay *gdisp)
|
||||
{
|
||||
GimpImage *gimg;
|
||||
GimpImage *gimage;
|
||||
GimpChannel *gmask;
|
||||
|
||||
if (gdisp)
|
||||
{
|
||||
gimg = gdisp->gimage;
|
||||
if (!gimg)
|
||||
gimage = gdisp->gimage;
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
|
||||
if (!gdisp->gimage->qmask_state)
|
||||
return; /* if already set do nothing */
|
||||
|
||||
if ( (gmask = gimp_image_get_channel_by_name (gimg, "Qmask")) )
|
||||
if ( (gmask = gimp_image_get_channel_by_name (gimage, "Qmask")) )
|
||||
{
|
||||
undo_push_group_start (gimg, QMASK_UNDO);
|
||||
undo_push_group_start (gimage, QMASK_UNDO);
|
||||
/* push the undo here since removing the mask will
|
||||
call the qmask_removed_callback() which will set
|
||||
the qmask_state to FALSE */
|
||||
undo_push_qmask (gimg);
|
||||
gimage_mask_load (gimg, gmask);
|
||||
gimp_image_remove_channel (gimg, gmask);
|
||||
undo_push_group_end (gimg);
|
||||
undo_push_qmask (gimage);
|
||||
gimage_mask_load (gimage, gmask);
|
||||
gimp_image_remove_channel (gimage, gmask);
|
||||
undo_push_group_end (gimage);
|
||||
}
|
||||
|
||||
gdisp->gimage->qmask_state = FALSE;
|
||||
|
@ -199,65 +199,64 @@ void
|
|||
qmask_activate (GtkWidget *widget,
|
||||
GDisplay *gdisp)
|
||||
{
|
||||
GimpImage *gimg;
|
||||
GimpImage *gimage;
|
||||
GimpChannel *gmask;
|
||||
GimpLayer *layer;
|
||||
GimpRGB color;
|
||||
|
||||
if (gdisp)
|
||||
{
|
||||
gimg = gdisp->gimage;
|
||||
if (!gimg)
|
||||
gimage = gdisp->gimage;
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
|
||||
if (gdisp->gimage->qmask_state)
|
||||
return; /* If already set, do nothing */
|
||||
|
||||
/* Set the defaults */
|
||||
color = gimg->qmask_color;
|
||||
color = gimage->qmask_color;
|
||||
|
||||
if ((gmask = gimp_image_get_channel_by_name (gimg, "Qmask")))
|
||||
if ((gmask = gimp_image_get_channel_by_name (gimage, "Qmask")))
|
||||
{
|
||||
gimg->qmask_state = TRUE;
|
||||
gimage->qmask_state = TRUE;
|
||||
/* if the user was clever and created his own */
|
||||
return;
|
||||
}
|
||||
|
||||
undo_push_group_start (gimg, QMASK_UNDO);
|
||||
undo_push_group_start (gimage, QMASK_UNDO);
|
||||
|
||||
if (gimage_mask_is_empty (gimg))
|
||||
if (gimage_mask_is_empty (gimage))
|
||||
{
|
||||
/* if no selection */
|
||||
|
||||
if ((layer = gimp_image_floating_sel (gimg)))
|
||||
if ((layer = gimp_image_floating_sel (gimage)))
|
||||
{
|
||||
floating_sel_to_layer (layer);
|
||||
}
|
||||
|
||||
gmask = gimp_channel_new (gimg,
|
||||
gimg->width,
|
||||
gimg->height,
|
||||
gmask = gimp_channel_new (gimage,
|
||||
gimage->width,
|
||||
gimage->height,
|
||||
"Qmask",
|
||||
&color);
|
||||
gimp_image_add_channel (gimg, gmask, 0);
|
||||
gimp_image_add_channel (gimage, gmask, 0);
|
||||
|
||||
drawable_fill (GIMP_DRAWABLE (gmask),
|
||||
gimp_get_user_context (gimg->gimp),
|
||||
TRANSPARENT_FILL);
|
||||
gimp_drawable_fill_by_type (GIMP_DRAWABLE (gmask),
|
||||
gimp_get_user_context (gimage->gimp),
|
||||
TRANSPARENT_FILL);
|
||||
}
|
||||
else
|
||||
else /* if selection */
|
||||
{
|
||||
/* if selection */
|
||||
|
||||
gmask = gimp_channel_copy (gimp_image_get_mask (gimg), TRUE);
|
||||
gimp_image_add_channel (gimg, gmask, 0);
|
||||
gmask = gimp_channel_copy (gimp_image_get_mask (gimage), TRUE);
|
||||
gimp_image_add_channel (gimage, gmask, 0);
|
||||
gimp_channel_set_color (gmask, &color);
|
||||
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
|
||||
gimage_mask_none (gimg); /* Clear the selection */
|
||||
gimage_mask_none (gimage); /* Clear the selection */
|
||||
}
|
||||
|
||||
undo_push_qmask (gimg);
|
||||
undo_push_group_end (gimg);
|
||||
undo_push_qmask (gimage);
|
||||
undo_push_group_end (gimage);
|
||||
gdisp->gimage->qmask_state = TRUE;
|
||||
gdisplays_flush ();
|
||||
|
||||
|
@ -368,12 +367,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
|
|||
|
||||
if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
|
||||
{
|
||||
channel->color = color;
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
gimp_channel_set_color (channel, &color);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
|
|
@ -36,14 +36,13 @@
|
|||
#include "core/gimpgradient.h"
|
||||
#include "core/gimpimage.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "gimpairbrushtool.h"
|
||||
#include "paint_options.h"
|
||||
#include "gimptool.h"
|
||||
#include "tool_manager.h"
|
||||
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#define WANT_AIRBRUSH_BITS
|
||||
|
|
|
@ -48,7 +48,6 @@
|
|||
#include "tool_manager.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "errors.h"
|
||||
#include "gdisplay.h"
|
||||
#include "undo.h"
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
|
||||
#include "appenv.h"
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "errors.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpprogress.h"
|
||||
|
@ -954,7 +953,7 @@ blend (GimpImage *gimage,
|
|||
(opacity * 255) / 100, paint_mode, NULL, x1, y1);
|
||||
|
||||
/* update the image */
|
||||
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
gimp_drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
|
||||
/* free the temporary buffer */
|
||||
tile_manager_destroy (buf_tiles);
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include "tool_options.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "image_map.h"
|
||||
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
|
||||
#include "app_procs.h"
|
||||
#include "devices.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimprc.h"
|
||||
#include "undo.h"
|
||||
|
@ -1068,8 +1067,8 @@ gimp_paint_tool_finish (GimpPaintTool *paint_tool,
|
|||
undo_push_paint (gimage, pu);
|
||||
|
||||
/* push an undo */
|
||||
drawable_apply_image (drawable, paint_tool->x1, paint_tool->y1,
|
||||
paint_tool->x2, paint_tool->y2, undo_tiles, TRUE);
|
||||
gimp_drawable_apply_image (drawable, paint_tool->x1, paint_tool->y1,
|
||||
paint_tool->x2, paint_tool->y2, undo_tiles, TRUE);
|
||||
undo_tiles = NULL;
|
||||
|
||||
/* push the group end */
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
|
||||
#include "appenv.h"
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimprc.h"
|
||||
#include "undo.h"
|
||||
|
@ -600,7 +599,7 @@ bucket_fill (GimpImage *gimage,
|
|||
(opacity * 255) / 100, paint_mode, NULL, x1, y1);
|
||||
|
||||
/* update the image */
|
||||
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
gimp_drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
|
||||
/* free the temporary buffer */
|
||||
tile_manager_destroy (buf_tiles);
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
#include "tool_manager.h"
|
||||
#include "tool_options.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include "tool_options.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "image_map.h"
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include "tool_manager.h"
|
||||
#include "tool_options.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
#include "tool_options.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "image_map.h"
|
||||
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include "tool_options.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include "tool_options.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "image_map.h"
|
||||
|
||||
|
|
|
@ -41,17 +41,16 @@
|
|||
#include "core/gimpimage.h"
|
||||
#include "core/gimpimage-mask.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "gimprc.h"
|
||||
#include "undo.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "gimpinktool.h"
|
||||
#include "gimpinktool-blob.h"
|
||||
#include "gimptool.h"
|
||||
#include "paint_options.h"
|
||||
#include "tool_manager.h"
|
||||
|
||||
#include "gimprc.h"
|
||||
#include "undo.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#define WANT_INK_BITS
|
||||
|
@ -1233,8 +1232,8 @@ ink_finish (GimpInkTool *ink_tool,
|
|||
GimpDrawable *drawable)
|
||||
{
|
||||
/* push an undo */
|
||||
drawable_apply_image (drawable, ink_tool->x1, ink_tool->y1,
|
||||
ink_tool->x2, ink_tool->y2, undo_tiles, TRUE);
|
||||
gimp_drawable_apply_image (drawable, ink_tool->x1, ink_tool->y1,
|
||||
ink_tool->x2, ink_tool->y2, undo_tiles, TRUE);
|
||||
undo_tiles = NULL;
|
||||
|
||||
/* invalidate the drawable--have to do it here, because
|
||||
|
|
|
@ -63,7 +63,6 @@
|
|||
#include "selection_options.h"
|
||||
#include "tool_manager.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
#include "tool_options.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "image_map.h"
|
||||
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
|
||||
#include "app_procs.h"
|
||||
#include "devices.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimprc.h"
|
||||
#include "undo.h"
|
||||
|
@ -1068,8 +1067,8 @@ gimp_paint_tool_finish (GimpPaintTool *paint_tool,
|
|||
undo_push_paint (gimage, pu);
|
||||
|
||||
/* push an undo */
|
||||
drawable_apply_image (drawable, paint_tool->x1, paint_tool->y1,
|
||||
paint_tool->x2, paint_tool->y2, undo_tiles, TRUE);
|
||||
gimp_drawable_apply_image (drawable, paint_tool->x1, paint_tool->y1,
|
||||
paint_tool->x2, paint_tool->y2, undo_tiles, TRUE);
|
||||
undo_tiles = NULL;
|
||||
|
||||
/* push the group end */
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#include "tool_options.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "image_map.h"
|
||||
|
||||
|
|
|
@ -29,17 +29,16 @@
|
|||
#include "core/gimpimage.h"
|
||||
|
||||
#include "gui/info-dialog.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "gimpscaletool.h"
|
||||
#include "tool_manager.h"
|
||||
#include "tool_options.h"
|
||||
#include "transform_options.h"
|
||||
|
||||
#include "gdisplay.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#define WANT_SCALE_BITS
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
#include "tool_manager.h"
|
||||
#include "tool_options.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include "tool_options.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "image_map.h"
|
||||
|
||||
|
|
|
@ -59,7 +59,6 @@
|
|||
#include "gimpfliptool.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "undo.h"
|
||||
#include "path_transform.h"
|
||||
|
@ -1665,10 +1664,10 @@ gimp_transform_tool_paste (GimpImage *gimage,
|
|||
if (floating_layer)
|
||||
floating_sel_rigor (floating_layer, TRUE);
|
||||
|
||||
drawable_update (drawable,
|
||||
0, 0,
|
||||
gimp_drawable_width (drawable),
|
||||
gimp_drawable_height (drawable));
|
||||
gimp_drawable_update (drawable,
|
||||
0, 0,
|
||||
gimp_drawable_width (drawable),
|
||||
gimp_drawable_height (drawable));
|
||||
|
||||
/* if we were operating on the floating selection, then it's boundary
|
||||
* and previews need invalidating
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "gui/brush-select.h"
|
||||
|
||||
#include "gimptool.h"
|
||||
#include "gimprectselecttool.h"
|
||||
#include "paint_options.h"
|
||||
#include "tool_manager.h"
|
||||
#include "tool_options.h"
|
||||
|
@ -285,45 +286,34 @@ tool_manager_initialize_tool (Gimp *gimp,
|
|||
{
|
||||
GimpToolManager *tool_manager;
|
||||
GimpToolInfo *tool_info;
|
||||
GtkType tool_type;
|
||||
|
||||
tool_manager = tool_manager_get (gimp);
|
||||
|
||||
tool_type = GTK_OBJECT (tool)->klass->type;
|
||||
|
||||
/* Tools which have an init function have dialogs and
|
||||
* cannot be initialized without a display
|
||||
*/
|
||||
if (GIMP_TOOL_CLASS (GTK_OBJECT (tool)->klass)->initialize && ! gdisp)
|
||||
{
|
||||
#ifdef __GNUC__
|
||||
#warning FIXME tool_type = RECT_SELECT;
|
||||
#endif
|
||||
tool_info = tool_manager_get_info_by_type (gimp,
|
||||
GIMP_TYPE_RECT_SELECT_TOOL);
|
||||
}
|
||||
else
|
||||
{
|
||||
tool_info = gimp_context_get_tool (gimp_get_user_context (gimp));
|
||||
}
|
||||
|
||||
/* Force the emission of the "tool_changed" signal
|
||||
*/
|
||||
tool_info = gimp_context_get_tool (gimp_get_user_context (gimp));
|
||||
|
||||
if (GTK_OBJECT (tool)->klass->type == tool_info->tool_type)
|
||||
if (tool_type == tool_info->tool_type)
|
||||
{
|
||||
gimp_context_tool_changed (gimp_get_user_context (gimp));
|
||||
}
|
||||
else
|
||||
{
|
||||
GList *list;
|
||||
tool_info = tool_manager_get_info_by_type (gimp, tool_type);
|
||||
|
||||
for (list = GIMP_LIST (gimp->tool_info_list)->list;
|
||||
list;
|
||||
list = g_list_next (list))
|
||||
{
|
||||
tool_info = GIMP_TOOL_INFO (list->data);
|
||||
|
||||
if (tool_info->tool_type == GTK_OBJECT (tool)->klass->type)
|
||||
{
|
||||
gimp_context_set_tool (gimp_get_user_context (gimp),
|
||||
tool_info);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
gimp_context_set_tool (gimp_get_user_context (gimp), tool_info);
|
||||
}
|
||||
|
||||
gimp_tool_initialize (tool_manager->active_tool, gdisp);
|
||||
|
|
73
app/undo.c
73
app/undo.c
|
@ -50,7 +50,6 @@
|
|||
#include "tools/tool_manager.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gdisplay_ops.h"
|
||||
|
@ -976,7 +975,7 @@ undo_pop_image (GimpImage *gimage,
|
|||
}
|
||||
}
|
||||
|
||||
drawable_update (image_undo->drawable, x, y, w, h);
|
||||
gimp_drawable_update (image_undo->drawable, x, y, w, h);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1186,23 +1185,26 @@ undo_pop_layer_displace (GimpImage *gimage,
|
|||
{
|
||||
old_offsets[0] = GIMP_DRAWABLE (layer)->offset_x;
|
||||
old_offsets[1] = GIMP_DRAWABLE (layer)->offset_y;
|
||||
drawable_update (GIMP_DRAWABLE (layer), 0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
|
||||
GIMP_DRAWABLE (layer)->offset_x = ldu->info[1];
|
||||
GIMP_DRAWABLE (layer)->offset_y = ldu->info[2];
|
||||
drawable_update (GIMP_DRAWABLE (layer), 0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE (layer)->height);
|
||||
|
||||
if (layer->mask)
|
||||
{
|
||||
GIMP_DRAWABLE (layer->mask)->offset_x = ldu->info[1];
|
||||
GIMP_DRAWABLE (layer->mask)->offset_y = ldu->info[2];
|
||||
drawable_update (GIMP_DRAWABLE (layer->mask), 0, 0,
|
||||
GIMP_DRAWABLE (layer->mask)->width,
|
||||
GIMP_DRAWABLE (layer->mask)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer->mask),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer->mask)->width,
|
||||
GIMP_DRAWABLE (layer->mask)->height);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1492,9 +1494,10 @@ undo_pop_layer (GimpImage *gimage,
|
|||
gimp_image_floating_selection_changed (gimage);
|
||||
}
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (lu->layer), 0, 0,
|
||||
GIMP_DRAWABLE (lu->layer)->width,
|
||||
GIMP_DRAWABLE (lu->layer)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (lu->layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (lu->layer)->width,
|
||||
GIMP_DRAWABLE (lu->layer)->height);
|
||||
}
|
||||
/* restore layer */
|
||||
else
|
||||
|
@ -1518,9 +1521,10 @@ undo_pop_layer (GimpImage *gimage,
|
|||
if (gimp_layer_is_floating_sel (lu->layer))
|
||||
gimp_image_floating_selection_changed (gimage);
|
||||
|
||||
drawable_update (GIMP_DRAWABLE (lu->layer), 0, 0,
|
||||
GIMP_DRAWABLE (lu->layer)->width,
|
||||
GIMP_DRAWABLE (lu->layer)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (lu->layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (lu->layer)->width,
|
||||
GIMP_DRAWABLE (lu->layer)->height);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -1643,9 +1647,10 @@ undo_pop_layer_mod (GimpImage *gimage,
|
|||
data[1] = temp;
|
||||
|
||||
/* Issue the second update */
|
||||
drawable_update (GIMP_DRAWABLE (layer), 0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE(layer)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (layer)->width,
|
||||
GIMP_DRAWABLE(layer)->height);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1813,9 +1818,10 @@ undo_pop_channel (GimpImage *gimage,
|
|||
gimp_image_set_active_channel (gimage, cu->prev_channel);
|
||||
|
||||
/* update the area */
|
||||
drawable_update (GIMP_DRAWABLE (cu->channel), 0, 0,
|
||||
GIMP_DRAWABLE (cu->channel)->width,
|
||||
GIMP_DRAWABLE (cu->channel)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (cu->channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (cu->channel)->width,
|
||||
GIMP_DRAWABLE (cu->channel)->height);
|
||||
}
|
||||
/* restore channel */
|
||||
else
|
||||
|
@ -1831,9 +1837,10 @@ undo_pop_channel (GimpImage *gimage,
|
|||
gimp_image_set_active_channel (gimage, cu->channel);
|
||||
|
||||
/* update the area */
|
||||
drawable_update (GIMP_DRAWABLE (cu->channel), 0, 0,
|
||||
GIMP_DRAWABLE (cu->channel)->width,
|
||||
GIMP_DRAWABLE (cu->channel)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (cu->channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (cu->channel)->width,
|
||||
GIMP_DRAWABLE (cu->channel)->height);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -1912,9 +1919,10 @@ undo_pop_channel_mod (GimpImage *gimage,
|
|||
tiles = (TileManager *) data[1];
|
||||
|
||||
/* Issue the first update */
|
||||
drawable_update (GIMP_DRAWABLE (channel), 0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
|
||||
temp = GIMP_DRAWABLE (channel)->tiles;
|
||||
GIMP_DRAWABLE (channel)->tiles = tiles;
|
||||
|
@ -1928,9 +1936,10 @@ undo_pop_channel_mod (GimpImage *gimage,
|
|||
data[1] = temp;
|
||||
|
||||
/* Issue the second update */
|
||||
drawable_update (GIMP_DRAWABLE (channel), 0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (channel),
|
||||
0, 0,
|
||||
GIMP_DRAWABLE (channel)->width,
|
||||
GIMP_DRAWABLE (channel)->height);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue