From 37ce6b9ac8ac7be446f227d593bc64111a190e1a Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Sat, 7 Jul 2001 22:49:01 +0000 Subject: [PATCH] app/Makefile.am removed. 2001-07-08 Michael Natterer * 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. --- ChangeLog | 70 +++++++++++++ app/Makefile.am | 2 - app/actions/channels-commands.c | 14 +-- app/actions/layers-commands.c | 9 +- app/actions/qmask-commands.c | 124 +++++++++++------------ app/actions/quick-mask-commands.c | 124 +++++++++++------------ app/base/color-balance.c | 1 - app/base/curves.c | 1 - app/base/hue-saturation.c | 1 - app/base/threshold.c | 1 - app/core/gimp-edit.c | 13 ++- app/core/gimp-transform-region.c | 9 +- app/core/gimpchannel-combine.c | 44 ++++---- app/core/gimpchannel.c | 44 ++++---- app/core/gimpdrawable-blend.c | 3 +- app/core/gimpdrawable-desaturate.c | 3 +- app/core/gimpdrawable-equalize.c | 8 +- app/core/gimpdrawable-invert.c | 8 +- app/core/gimpdrawable-offset.c | 22 ++-- app/core/gimpdrawable-transform.c | 9 +- app/core/gimpdrawable.c | 122 ++++++++++++++++++++-- app/core/gimpdrawable.h | 22 +++- app/core/gimpedit.c | 13 ++- app/core/gimpimage-duplicate.c | 1 - app/core/gimpimage-guides.c | 75 +++++++------- app/core/gimpimage-guides.h | 19 ++-- app/core/gimpimage-mask.c | 13 ++- app/core/gimpimage-merge.c | 75 +++++++------- app/core/gimpimage-merge.h | 19 ++-- app/core/gimpimage-new.c | 8 +- app/core/gimpimage-projection.c | 75 +++++++------- app/core/gimpimage-projection.h | 19 ++-- app/core/gimpimage-qmask.c | 124 +++++++++++------------ app/core/gimpimage-quick-mask.c | 124 +++++++++++------------ app/core/gimpimage-resize.c | 75 +++++++------- app/core/gimpimage-resize.h | 19 ++-- app/core/gimpimage-scale.c | 75 +++++++------- app/core/gimpimage-scale.h | 19 ++-- app/core/gimpimage-undo-push.c | 73 +++++++------ app/core/gimpimage.c | 75 +++++++------- app/core/gimpimage.h | 19 ++-- app/core/gimpimagemap.c | 14 ++- app/core/gimplayer-floating-sel.c | 9 +- app/core/gimplayer.c | 86 +++++++++------- app/core/gimplayermask.c | 17 ++-- app/core/gimpprojection-construct.c | 75 +++++++------- app/core/gimpprojection-construct.h | 19 ++-- app/disp_callbacks.c | 7 +- app/display/gimpdisplay-callbacks.c | 7 +- app/display/gimpdisplayshell-callbacks.c | 7 +- app/display/gimpdisplayshell-qmask.c | 124 +++++++++++------------ app/drawable.c | 122 ---------------------- app/drawable.h | 41 -------- app/floating_sel.c | 9 +- app/gui/channels-commands.c | 14 +-- app/gui/gui.c | 26 ++--- app/gui/layers-commands.c | 9 +- app/gui/qmask-commands.c | 124 +++++++++++------------ app/image_map.c | 14 ++- app/paint/gimpairbrush.c | 5 +- app/paint/gimpclone.c | 1 - app/paint/gimpconvolve.c | 1 - app/paint/gimpink.c | 13 ++- app/paint/gimppaintcore.c | 5 +- app/paint/gimpsourcecore.c | 1 - app/pdb/channel_cmds.c | 1 - app/pdb/color_cmds.c | 17 ++-- app/pdb/drawable_cmds.c | 5 +- app/pdb/edit_cmds.c | 2 +- app/pdb/floating_sel_cmds.c | 2 +- app/pdb/image_cmds.c | 2 +- app/pdb/layer_cmds.c | 1 - app/pdb/parasite_cmds.c | 1 - app/pdb/selection_cmds.c | 2 +- app/pdb/text_tool_cmds.c | 2 +- app/pdb/tools_cmds.c | 1 - app/qmask.c | 124 +++++++++++------------ app/tools/gimpairbrushtool.c | 5 +- app/tools/gimpbezierselecttool.c | 1 - app/tools/gimpblendtool.c | 3 +- app/tools/gimpbrightnesscontrasttool.c | 1 - app/tools/gimpbrushtool.c | 5 +- app/tools/gimpbucketfilltool.c | 3 +- app/tools/gimpclonetool.c | 1 - app/tools/gimpcolorbalancetool.c | 1 - app/tools/gimpconvolvetool.c | 1 - app/tools/gimpcurvestool.c | 1 - app/tools/gimphistogramtool.c | 1 - app/tools/gimphuesaturationtool.c | 1 - app/tools/gimpinktool.c | 13 ++- app/tools/gimpiscissorstool.c | 1 - app/tools/gimplevelstool.c | 1 - app/tools/gimppainttool.c | 5 +- app/tools/gimpposterizetool.c | 1 - app/tools/gimpscaletool.c | 9 +- app/tools/gimpsourcetool.c | 1 - app/tools/gimpthresholdtool.c | 1 - app/tools/gimptransformtool.c | 9 +- app/tools/tool_manager.c | 36 +++---- app/undo.c | 73 +++++++------ app/widgets/gimpchannellistitem.c | 1 - app/widgets/gimpchannellistview.c | 1 - app/widgets/gimpchanneltreeview.c | 1 - app/widgets/gimpdrawablelistitem.c | 6 -- app/widgets/gimplayerlistitem.c | 1 - app/widgets/gimplayerlistview.c | 9 -- app/widgets/gimplayertreeview.c | 9 -- tools/pdbgen/pdb.pl | 10 +- tools/pdbgen/pdb/color.pdb | 16 +-- tools/pdbgen/pdb/drawable.pdb | 6 +- 110 files changed, 1363 insertions(+), 1355 deletions(-) delete mode 100644 app/drawable.c delete mode 100644 app/drawable.h diff --git a/ChangeLog b/ChangeLog index 022d7aff05..2ca212fc99 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,73 @@ +2001-07-08 Michael Natterer + + * 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 * app/Makefile.am diff --git a/app/Makefile.am b/app/Makefile.am index 5c346cc7f0..a520bf8746 100644 --- a/app/Makefile.am +++ b/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 \ diff --git a/app/actions/channels-commands.c b/app/actions/channels-commands.c index c0c396cdce..438c8f9b1b 100644 --- a/app/actions/channels-commands.c +++ b/app/actions/channels-commands.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 (); } diff --git a/app/actions/layers-commands.c b/app/actions/layers-commands.c index 36b0d63324..26bdd8ec9a 100644 --- a/app/actions/layers-commands.c +++ b/app/actions/layers-commands.c @@ -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 */ diff --git a/app/actions/qmask-commands.c b/app/actions/qmask-commands.c index 4161b32b02..ba701b595c 100644 --- a/app/actions/qmask-commands.c +++ b/app/actions/qmask-commands.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 (); } diff --git a/app/actions/quick-mask-commands.c b/app/actions/quick-mask-commands.c index 4161b32b02..ba701b595c 100644 --- a/app/actions/quick-mask-commands.c +++ b/app/actions/quick-mask-commands.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 (); } diff --git a/app/base/color-balance.c b/app/base/color-balance.c index 2da856b21b..28087ae08c 100644 --- a/app/base/color-balance.c +++ b/app/base/color-balance.c @@ -39,7 +39,6 @@ #include "tool_options.h" #include "app_procs.h" -#include "drawable.h" #include "gdisplay.h" #include "image_map.h" diff --git a/app/base/curves.c b/app/base/curves.c index ef90c1a0f4..e896d50aa8 100644 --- a/app/base/curves.c +++ b/app/base/curves.c @@ -44,7 +44,6 @@ #include "tool_options.h" #include "app_procs.h" -#include "drawable.h" #include "gdisplay.h" #include "image_map.h" diff --git a/app/base/hue-saturation.c b/app/base/hue-saturation.c index 7f3826b34e..38c47c5eb8 100644 --- a/app/base/hue-saturation.c +++ b/app/base/hue-saturation.c @@ -39,7 +39,6 @@ #include "tool_options.h" #include "app_procs.h" -#include "drawable.h" #include "gdisplay.h" #include "image_map.h" diff --git a/app/base/threshold.c b/app/base/threshold.c index 07dd4fd210..2e5121a01a 100644 --- a/app/base/threshold.c +++ b/app/base/threshold.c @@ -41,7 +41,6 @@ #include "tool_options.h" #include "app_procs.h" -#include "drawable.h" #include "gdisplay.h" #include "image_map.h" diff --git a/app/core/gimp-edit.c b/app/core/gimp-edit.c index 86f92d67af..527b38c566 100644 --- a/app/core/gimp-edit.c +++ b/app/core/gimp-edit.c @@ -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); diff --git a/app/core/gimp-transform-region.c b/app/core/gimp-transform-region.c index 42205f5a91..403c5dd5dc 100644 --- a/app/core/gimp-transform-region.c +++ b/app/core/gimp-transform-region.c @@ -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 diff --git a/app/core/gimpchannel-combine.c b/app/core/gimpchannel-combine.c index 5f6980f2b0..78ffe94e95 100644 --- a/app/core/gimpchannel-combine.c +++ b/app/core/gimpchannel-combine.c @@ -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); } diff --git a/app/core/gimpchannel.c b/app/core/gimpchannel.c index 5f6980f2b0..78ffe94e95 100644 --- a/app/core/gimpchannel.c +++ b/app/core/gimpchannel.c @@ -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); } diff --git a/app/core/gimpdrawable-blend.c b/app/core/gimpdrawable-blend.c index ffc371d346..72033584a3 100644 --- a/app/core/gimpdrawable-blend.c +++ b/app/core/gimpdrawable-blend.c @@ -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); diff --git a/app/core/gimpdrawable-desaturate.c b/app/core/gimpdrawable-desaturate.c index 18554a0a6b..ed3bc85cb7 100644 --- a/app/core/gimpdrawable-desaturate.c +++ b/app/core/gimpdrawable-desaturate.c @@ -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)); } diff --git a/app/core/gimpdrawable-equalize.c b/app/core/gimpdrawable-equalize.c index fb8e471473..ec947e72e7 100644 --- a/app/core/gimpdrawable-equalize.c +++ b/app/core/gimpdrawable-equalize.c @@ -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)); } diff --git a/app/core/gimpdrawable-invert.c b/app/core/gimpdrawable-invert.c index 799ed3ff00..17278af978 100644 --- a/app/core/gimpdrawable-invert.c +++ b/app/core/gimpdrawable-invert.c @@ -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)); } diff --git a/app/core/gimpdrawable-offset.c b/app/core/gimpdrawable-offset.c index 02f41f0097..392090fa5f 100644 --- a/app/core/gimpdrawable-offset.c +++ b/app/core/gimpdrawable-offset.c @@ -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)); } diff --git a/app/core/gimpdrawable-transform.c b/app/core/gimpdrawable-transform.c index 42205f5a91..403c5dd5dc 100644 --- a/app/core/gimpdrawable-transform.c +++ b/app/core/gimpdrawable-transform.c @@ -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 diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c index 3ba041b678..eb99d55d50 100644 --- a/app/core/gimpdrawable.c +++ b/app/core/gimpdrawable.c @@ -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); } } diff --git a/app/core/gimpdrawable.h b/app/core/gimpdrawable.h index 518883d2a3..47ce0cd229 100644 --- a/app/core/gimpdrawable.h +++ b/app/core/gimpdrawable.h @@ -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); diff --git a/app/core/gimpedit.c b/app/core/gimpedit.c index 86f92d67af..527b38c566 100644 --- a/app/core/gimpedit.c +++ b/app/core/gimpedit.c @@ -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); diff --git a/app/core/gimpimage-duplicate.c b/app/core/gimpimage-duplicate.c index 7156e041b6..466ea47144 100644 --- a/app/core/gimpimage-duplicate.c +++ b/app/core/gimpimage-duplicate.c @@ -44,7 +44,6 @@ #include "gimplist.h" #include "app_procs.h" -#include "drawable.h" #include "floating_sel.h" #include "gdisplay.h" #include "parasitelist.h" diff --git a/app/core/gimpimage-guides.c b/app/core/gimpimage-guides.c index 708fd3d3e6..08528bbb76 100644 --- a/app/core/gimpimage-guides.c +++ b/app/core/gimpimage-guides.c @@ -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; } diff --git a/app/core/gimpimage-guides.h b/app/core/gimpimage-guides.h index 88f653e0c1..3c6c5fa3cf 100644 --- a/app/core/gimpimage-guides.h +++ b/app/core/gimpimage-guides.h @@ -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 */ diff --git a/app/core/gimpimage-mask.c b/app/core/gimpimage-mask.c index 0e09d0f567..a247a7e060 100644 --- a/app/core/gimpimage-mask.c +++ b/app/core/gimpimage-mask.c @@ -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); diff --git a/app/core/gimpimage-merge.c b/app/core/gimpimage-merge.c index 708fd3d3e6..08528bbb76 100644 --- a/app/core/gimpimage-merge.c +++ b/app/core/gimpimage-merge.c @@ -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; } diff --git a/app/core/gimpimage-merge.h b/app/core/gimpimage-merge.h index 88f653e0c1..3c6c5fa3cf 100644 --- a/app/core/gimpimage-merge.h +++ b/app/core/gimpimage-merge.h @@ -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 */ diff --git a/app/core/gimpimage-new.c b/app/core/gimpimage-new.c index a43c5d6b11..712697617c 100644 --- a/app/core/gimpimage-new.c +++ b/app/core/gimpimage-new.c @@ -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); diff --git a/app/core/gimpimage-projection.c b/app/core/gimpimage-projection.c index 708fd3d3e6..08528bbb76 100644 --- a/app/core/gimpimage-projection.c +++ b/app/core/gimpimage-projection.c @@ -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; } diff --git a/app/core/gimpimage-projection.h b/app/core/gimpimage-projection.h index 88f653e0c1..3c6c5fa3cf 100644 --- a/app/core/gimpimage-projection.h +++ b/app/core/gimpimage-projection.h @@ -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 */ diff --git a/app/core/gimpimage-qmask.c b/app/core/gimpimage-qmask.c index 4161b32b02..ba701b595c 100644 --- a/app/core/gimpimage-qmask.c +++ b/app/core/gimpimage-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 (); } diff --git a/app/core/gimpimage-quick-mask.c b/app/core/gimpimage-quick-mask.c index 4161b32b02..ba701b595c 100644 --- a/app/core/gimpimage-quick-mask.c +++ b/app/core/gimpimage-quick-mask.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 (); } diff --git a/app/core/gimpimage-resize.c b/app/core/gimpimage-resize.c index 708fd3d3e6..08528bbb76 100644 --- a/app/core/gimpimage-resize.c +++ b/app/core/gimpimage-resize.c @@ -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; } diff --git a/app/core/gimpimage-resize.h b/app/core/gimpimage-resize.h index 88f653e0c1..3c6c5fa3cf 100644 --- a/app/core/gimpimage-resize.h +++ b/app/core/gimpimage-resize.h @@ -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 */ diff --git a/app/core/gimpimage-scale.c b/app/core/gimpimage-scale.c index 708fd3d3e6..08528bbb76 100644 --- a/app/core/gimpimage-scale.c +++ b/app/core/gimpimage-scale.c @@ -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; } diff --git a/app/core/gimpimage-scale.h b/app/core/gimpimage-scale.h index 88f653e0c1..3c6c5fa3cf 100644 --- a/app/core/gimpimage-scale.h +++ b/app/core/gimpimage-scale.h @@ -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 */ diff --git a/app/core/gimpimage-undo-push.c b/app/core/gimpimage-undo-push.c index 01b856aab4..6a10e72d6b 100644 --- a/app/core/gimpimage-undo-push.c +++ b/app/core/gimpimage-undo-push.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; } diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c index 708fd3d3e6..08528bbb76 100644 --- a/app/core/gimpimage.c +++ b/app/core/gimpimage.c @@ -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; } diff --git a/app/core/gimpimage.h b/app/core/gimpimage.h index 88f653e0c1..3c6c5fa3cf 100644 --- a/app/core/gimpimage.h +++ b/app/core/gimpimage.h @@ -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 */ diff --git a/app/core/gimpimagemap.c b/app/core/gimpimagemap.c index 79e7a3f313..755bf441ed 100644 --- a/app/core/gimpimagemap.c +++ b/app/core/gimpimagemap.c @@ -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); diff --git a/app/core/gimplayer-floating-sel.c b/app/core/gimplayer-floating-sel.c index dd6d79c84f..89a0460921 100644 --- a/app/core/gimplayer-floating-sel.c +++ b/app/core/gimplayer-floating-sel.c @@ -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);*/ diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c index f8c8e3de3a..eb20efec8d 100644 --- a/app/core/gimplayer.c +++ b/app/core/gimplayer.c @@ -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); } } diff --git a/app/core/gimplayermask.c b/app/core/gimplayermask.c index 3894a3bcf0..4045a4dae5 100644 --- a/app/core/gimplayermask.c +++ b/app/core/gimplayermask.c @@ -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), diff --git a/app/core/gimpprojection-construct.c b/app/core/gimpprojection-construct.c index 708fd3d3e6..08528bbb76 100644 --- a/app/core/gimpprojection-construct.c +++ b/app/core/gimpprojection-construct.c @@ -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; } diff --git a/app/core/gimpprojection-construct.h b/app/core/gimpprojection-construct.h index 88f653e0c1..3c6c5fa3cf 100644 --- a/app/core/gimpprojection-construct.h +++ b/app/core/gimpprojection-construct.h @@ -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 */ diff --git a/app/disp_callbacks.c b/app/disp_callbacks.c index 410ff6fb68..724e79f7aa 100644 --- a/app/disp_callbacks.c +++ b/app/disp_callbacks.c @@ -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) diff --git a/app/display/gimpdisplay-callbacks.c b/app/display/gimpdisplay-callbacks.c index 410ff6fb68..724e79f7aa 100644 --- a/app/display/gimpdisplay-callbacks.c +++ b/app/display/gimpdisplay-callbacks.c @@ -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) diff --git a/app/display/gimpdisplayshell-callbacks.c b/app/display/gimpdisplayshell-callbacks.c index 410ff6fb68..724e79f7aa 100644 --- a/app/display/gimpdisplayshell-callbacks.c +++ b/app/display/gimpdisplayshell-callbacks.c @@ -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) diff --git a/app/display/gimpdisplayshell-qmask.c b/app/display/gimpdisplayshell-qmask.c index 4161b32b02..ba701b595c 100644 --- a/app/display/gimpdisplayshell-qmask.c +++ b/app/display/gimpdisplayshell-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 (); } diff --git a/app/drawable.c b/app/drawable.c deleted file mode 100644 index 4589b90c90..0000000000 --- a/app/drawable.c +++ /dev/null @@ -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 - -#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); -} diff --git a/app/drawable.h b/app/drawable.h deleted file mode 100644 index 604fb4cc9c..0000000000 --- a/app/drawable.h +++ /dev/null @@ -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__ */ diff --git a/app/floating_sel.c b/app/floating_sel.c index dd6d79c84f..89a0460921 100644 --- a/app/floating_sel.c +++ b/app/floating_sel.c @@ -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);*/ diff --git a/app/gui/channels-commands.c b/app/gui/channels-commands.c index c0c396cdce..438c8f9b1b 100644 --- a/app/gui/channels-commands.c +++ b/app/gui/channels-commands.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 (); } diff --git a/app/gui/gui.c b/app/gui/gui.c index c1680db307..1278d2bff6 100644 --- a/app/gui/gui.c +++ b/app/gui/gui.c @@ -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; diff --git a/app/gui/layers-commands.c b/app/gui/layers-commands.c index 36b0d63324..26bdd8ec9a 100644 --- a/app/gui/layers-commands.c +++ b/app/gui/layers-commands.c @@ -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 */ diff --git a/app/gui/qmask-commands.c b/app/gui/qmask-commands.c index 4161b32b02..ba701b595c 100644 --- a/app/gui/qmask-commands.c +++ b/app/gui/qmask-commands.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 (); } diff --git a/app/image_map.c b/app/image_map.c index 79e7a3f313..755bf441ed 100644 --- a/app/image_map.c +++ b/app/image_map.c @@ -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); diff --git a/app/paint/gimpairbrush.c b/app/paint/gimpairbrush.c index 6e29aa82de..6ee976b577 100644 --- a/app/paint/gimpairbrush.c +++ b/app/paint/gimpairbrush.c @@ -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 diff --git a/app/paint/gimpclone.c b/app/paint/gimpclone.c index c2c854c533..709d8320c1 100644 --- a/app/paint/gimpclone.c +++ b/app/paint/gimpclone.c @@ -45,7 +45,6 @@ #include "tool_manager.h" #include "tool_options.h" -#include "drawable.h" #include "gdisplay.h" #include "libgimp/gimpintl.h" diff --git a/app/paint/gimpconvolve.c b/app/paint/gimpconvolve.c index 47aa155909..ceb0bfdfb3 100644 --- a/app/paint/gimpconvolve.c +++ b/app/paint/gimpconvolve.c @@ -41,7 +41,6 @@ #include "tool_manager.h" #include "tool_options.h" -#include "drawable.h" #include "gdisplay.h" #include "libgimp/gimpintl.h" diff --git a/app/paint/gimpink.c b/app/paint/gimpink.c index 001c5b0eff..9855a75d73 100644 --- a/app/paint/gimpink.c +++ b/app/paint/gimpink.c @@ -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 diff --git a/app/paint/gimppaintcore.c b/app/paint/gimppaintcore.c index 528faa95f6..102bb77a0b 100644 --- a/app/paint/gimppaintcore.c +++ b/app/paint/gimppaintcore.c @@ -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 */ diff --git a/app/paint/gimpsourcecore.c b/app/paint/gimpsourcecore.c index c2c854c533..709d8320c1 100644 --- a/app/paint/gimpsourcecore.c +++ b/app/paint/gimpsourcecore.c @@ -45,7 +45,6 @@ #include "tool_manager.h" #include "tool_options.h" -#include "drawable.h" #include "gdisplay.h" #include "libgimp/gimpintl.h" diff --git a/app/pdb/channel_cmds.c b/app/pdb/channel_cmds.c index 9839e73b6b..5d8770c775 100644 --- a/app/pdb/channel_cmds.c +++ b/app/pdb/channel_cmds.c @@ -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" diff --git a/app/pdb/color_cmds.c b/app/pdb/color_cmds.c index 429bd88f53..3a0b98a538 100644 --- a/app/pdb/color_cmds.c +++ b/app/pdb/color_cmds.c @@ -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)); } } diff --git a/app/pdb/drawable_cmds.c b/app/pdb/drawable_cmds.c index 2c65f0abd6..9b5c90e8d8 100644 --- a/app/pdb/drawable_cmds.c +++ b/app/pdb/drawable_cmds.c @@ -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); } diff --git a/app/pdb/edit_cmds.c b/app/pdb/edit_cmds.c index e526e40a6d..802ec615e2 100644 --- a/app/pdb/edit_cmds.c +++ b/app/pdb/edit_cmds.c @@ -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; diff --git a/app/pdb/floating_sel_cmds.c b/app/pdb/floating_sel_cmds.c index bee07b95ec..cd57968d84 100644 --- a/app/pdb/floating_sel_cmds.c +++ b/app/pdb/floating_sel_cmds.c @@ -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; diff --git a/app/pdb/image_cmds.c b/app/pdb/image_cmds.c index 9be8651579..c49535737f 100644 --- a/app/pdb/image_cmds.c +++ b/app/pdb/image_cmds.c @@ -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" diff --git a/app/pdb/layer_cmds.c b/app/pdb/layer_cmds.c index 6f2372a471..6f472a5156 100644 --- a/app/pdb/layer_cmds.c +++ b/app/pdb/layer_cmds.c @@ -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" diff --git a/app/pdb/parasite_cmds.c b/app/pdb/parasite_cmds.c index 1d3d8bc2ee..c01661f772 100644 --- a/app/pdb/parasite_cmds.c +++ b/app/pdb/parasite_cmds.c @@ -30,7 +30,6 @@ #include "core/gimpdrawable.h" #include "core/gimpimage.h" -#include "drawable.h" #include "gimpparasite.h" #include "libgimpbase/gimpparasite.h" diff --git a/app/pdb/selection_cmds.c b/app/pdb/selection_cmds.c index 12404c8e8f..08f0d47c05 100644 --- a/app/pdb/selection_cmds.c +++ b/app/pdb/selection_cmds.c @@ -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; diff --git a/app/pdb/text_tool_cmds.c b/app/pdb/text_tool_cmds.c index 875fcada40..b66cff8217 100644 --- a/app/pdb/text_tool_cmds.c +++ b/app/pdb/text_tool_cmds.c @@ -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" diff --git a/app/pdb/tools_cmds.c b/app/pdb/tools_cmds.c index aa69cd8f16..d16da5f784 100644 --- a/app/pdb/tools_cmds.c +++ b/app/pdb/tools_cmds.c @@ -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" diff --git a/app/qmask.c b/app/qmask.c index 4161b32b02..ba701b595c 100644 --- a/app/qmask.c +++ b/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 (); } diff --git a/app/tools/gimpairbrushtool.c b/app/tools/gimpairbrushtool.c index 6e29aa82de..6ee976b577 100644 --- a/app/tools/gimpairbrushtool.c +++ b/app/tools/gimpairbrushtool.c @@ -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 diff --git a/app/tools/gimpbezierselecttool.c b/app/tools/gimpbezierselecttool.c index 13cefc1444..361c93965a 100644 --- a/app/tools/gimpbezierselecttool.c +++ b/app/tools/gimpbezierselecttool.c @@ -48,7 +48,6 @@ #include "tool_manager.h" #include "app_procs.h" -#include "drawable.h" #include "errors.h" #include "gdisplay.h" #include "undo.h" diff --git a/app/tools/gimpblendtool.c b/app/tools/gimpblendtool.c index ffc371d346..72033584a3 100644 --- a/app/tools/gimpblendtool.c +++ b/app/tools/gimpblendtool.c @@ -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); diff --git a/app/tools/gimpbrightnesscontrasttool.c b/app/tools/gimpbrightnesscontrasttool.c index 1eb4519dee..a773180568 100644 --- a/app/tools/gimpbrightnesscontrasttool.c +++ b/app/tools/gimpbrightnesscontrasttool.c @@ -38,7 +38,6 @@ #include "tool_options.h" #include "app_procs.h" -#include "drawable.h" #include "gdisplay.h" #include "image_map.h" diff --git a/app/tools/gimpbrushtool.c b/app/tools/gimpbrushtool.c index 528faa95f6..102bb77a0b 100644 --- a/app/tools/gimpbrushtool.c +++ b/app/tools/gimpbrushtool.c @@ -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 */ diff --git a/app/tools/gimpbucketfilltool.c b/app/tools/gimpbucketfilltool.c index f8e2733a25..9df98726e5 100644 --- a/app/tools/gimpbucketfilltool.c +++ b/app/tools/gimpbucketfilltool.c @@ -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); diff --git a/app/tools/gimpclonetool.c b/app/tools/gimpclonetool.c index c2c854c533..709d8320c1 100644 --- a/app/tools/gimpclonetool.c +++ b/app/tools/gimpclonetool.c @@ -45,7 +45,6 @@ #include "tool_manager.h" #include "tool_options.h" -#include "drawable.h" #include "gdisplay.h" #include "libgimp/gimpintl.h" diff --git a/app/tools/gimpcolorbalancetool.c b/app/tools/gimpcolorbalancetool.c index 2da856b21b..28087ae08c 100644 --- a/app/tools/gimpcolorbalancetool.c +++ b/app/tools/gimpcolorbalancetool.c @@ -39,7 +39,6 @@ #include "tool_options.h" #include "app_procs.h" -#include "drawable.h" #include "gdisplay.h" #include "image_map.h" diff --git a/app/tools/gimpconvolvetool.c b/app/tools/gimpconvolvetool.c index 47aa155909..ceb0bfdfb3 100644 --- a/app/tools/gimpconvolvetool.c +++ b/app/tools/gimpconvolvetool.c @@ -41,7 +41,6 @@ #include "tool_manager.h" #include "tool_options.h" -#include "drawable.h" #include "gdisplay.h" #include "libgimp/gimpintl.h" diff --git a/app/tools/gimpcurvestool.c b/app/tools/gimpcurvestool.c index ef90c1a0f4..e896d50aa8 100644 --- a/app/tools/gimpcurvestool.c +++ b/app/tools/gimpcurvestool.c @@ -44,7 +44,6 @@ #include "tool_options.h" #include "app_procs.h" -#include "drawable.h" #include "gdisplay.h" #include "image_map.h" diff --git a/app/tools/gimphistogramtool.c b/app/tools/gimphistogramtool.c index 67aeeb5b63..ae59a18a35 100644 --- a/app/tools/gimphistogramtool.c +++ b/app/tools/gimphistogramtool.c @@ -39,7 +39,6 @@ #include "tool_options.h" #include "app_procs.h" -#include "drawable.h" #include "gdisplay.h" #include "libgimp/gimpintl.h" diff --git a/app/tools/gimphuesaturationtool.c b/app/tools/gimphuesaturationtool.c index 7f3826b34e..38c47c5eb8 100644 --- a/app/tools/gimphuesaturationtool.c +++ b/app/tools/gimphuesaturationtool.c @@ -39,7 +39,6 @@ #include "tool_options.h" #include "app_procs.h" -#include "drawable.h" #include "gdisplay.h" #include "image_map.h" diff --git a/app/tools/gimpinktool.c b/app/tools/gimpinktool.c index 001c5b0eff..9855a75d73 100644 --- a/app/tools/gimpinktool.c +++ b/app/tools/gimpinktool.c @@ -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 diff --git a/app/tools/gimpiscissorstool.c b/app/tools/gimpiscissorstool.c index 226a56b9e2..9eb5a6f1c7 100644 --- a/app/tools/gimpiscissorstool.c +++ b/app/tools/gimpiscissorstool.c @@ -63,7 +63,6 @@ #include "selection_options.h" #include "tool_manager.h" -#include "drawable.h" #include "gdisplay.h" #include "libgimp/gimpintl.h" diff --git a/app/tools/gimplevelstool.c b/app/tools/gimplevelstool.c index 5e5ca8b572..c37b49b342 100644 --- a/app/tools/gimplevelstool.c +++ b/app/tools/gimplevelstool.c @@ -47,7 +47,6 @@ #include "tool_options.h" #include "app_procs.h" -#include "drawable.h" #include "gdisplay.h" #include "image_map.h" diff --git a/app/tools/gimppainttool.c b/app/tools/gimppainttool.c index 528faa95f6..102bb77a0b 100644 --- a/app/tools/gimppainttool.c +++ b/app/tools/gimppainttool.c @@ -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 */ diff --git a/app/tools/gimpposterizetool.c b/app/tools/gimpposterizetool.c index 7e6c0ff226..b0cd4ab9f1 100644 --- a/app/tools/gimpposterizetool.c +++ b/app/tools/gimpposterizetool.c @@ -37,7 +37,6 @@ #include "tool_options.h" #include "app_procs.h" -#include "drawable.h" #include "gdisplay.h" #include "image_map.h" diff --git a/app/tools/gimpscaletool.c b/app/tools/gimpscaletool.c index 7b171fa4e3..bc2ec72bb6 100644 --- a/app/tools/gimpscaletool.c +++ b/app/tools/gimpscaletool.c @@ -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 diff --git a/app/tools/gimpsourcetool.c b/app/tools/gimpsourcetool.c index c2c854c533..709d8320c1 100644 --- a/app/tools/gimpsourcetool.c +++ b/app/tools/gimpsourcetool.c @@ -45,7 +45,6 @@ #include "tool_manager.h" #include "tool_options.h" -#include "drawable.h" #include "gdisplay.h" #include "libgimp/gimpintl.h" diff --git a/app/tools/gimpthresholdtool.c b/app/tools/gimpthresholdtool.c index 07dd4fd210..2e5121a01a 100644 --- a/app/tools/gimpthresholdtool.c +++ b/app/tools/gimpthresholdtool.c @@ -41,7 +41,6 @@ #include "tool_options.h" #include "app_procs.h" -#include "drawable.h" #include "gdisplay.h" #include "image_map.h" diff --git a/app/tools/gimptransformtool.c b/app/tools/gimptransformtool.c index 42205f5a91..403c5dd5dc 100644 --- a/app/tools/gimptransformtool.c +++ b/app/tools/gimptransformtool.c @@ -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 diff --git a/app/tools/tool_manager.c b/app/tools/tool_manager.c index 34af5f2b05..960ebe6bfb 100644 --- a/app/tools/tool_manager.c +++ b/app/tools/tool_manager.c @@ -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); diff --git a/app/undo.c b/app/undo.c index 01b856aab4..6a10e72d6b 100644 --- a/app/undo.c +++ b/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; } diff --git a/app/widgets/gimpchannellistitem.c b/app/widgets/gimpchannellistitem.c index 6136c8b717..7a927d0274 100644 --- a/app/widgets/gimpchannellistitem.c +++ b/app/widgets/gimpchannellistitem.c @@ -33,7 +33,6 @@ #include "gimpchannellistitem.h" #include "gimppreview.h" -#include "drawable.h" #include "gdisplay.h" diff --git a/app/widgets/gimpchannellistview.c b/app/widgets/gimpchannellistview.c index 3196dbc15b..f952cbc2cf 100644 --- a/app/widgets/gimpchannellistview.c +++ b/app/widgets/gimpchannellistview.c @@ -40,7 +40,6 @@ #include "gimpimagepreview.h" #include "gimplistitem.h" -#include "drawable.h" #include "gdisplay.h" #include "libgimp/gimpintl.h" diff --git a/app/widgets/gimpchanneltreeview.c b/app/widgets/gimpchanneltreeview.c index 3196dbc15b..f952cbc2cf 100644 --- a/app/widgets/gimpchanneltreeview.c +++ b/app/widgets/gimpchanneltreeview.c @@ -40,7 +40,6 @@ #include "gimpimagepreview.h" #include "gimplistitem.h" -#include "drawable.h" #include "gdisplay.h" #include "libgimp/gimpintl.h" diff --git a/app/widgets/gimpdrawablelistitem.c b/app/widgets/gimpdrawablelistitem.c index 5a5105c719..6a293268b2 100644 --- a/app/widgets/gimpdrawablelistitem.c +++ b/app/widgets/gimpdrawablelistitem.c @@ -36,8 +36,6 @@ #include "gdisplay.h" -#include "drawable.h" - #include "pixmaps/eye.xpm" @@ -306,10 +304,6 @@ gimp_drawable_list_item_eye_toggled (GtkWidget *widget, gimp_drawable_list_item_visibility_changed, list_item); - drawable_update (drawable, 0, 0, - drawable->width, - drawable->height); - gdisplays_flush (); } } diff --git a/app/widgets/gimplayerlistitem.c b/app/widgets/gimplayerlistitem.c index ed86326262..4d7d50a872 100644 --- a/app/widgets/gimplayerlistitem.c +++ b/app/widgets/gimplayerlistitem.c @@ -37,7 +37,6 @@ #include "gimplayerlistitem.h" #include "gimppreview.h" -#include "drawable.h" #include "gdisplay.h" #include "pixmaps/linked.xpm" diff --git a/app/widgets/gimplayerlistview.c b/app/widgets/gimplayerlistview.c index d9b0cdc924..7fb6fde64e 100644 --- a/app/widgets/gimplayerlistview.c +++ b/app/widgets/gimplayerlistview.c @@ -38,7 +38,6 @@ #include "gimplistitem.h" #include "gimpwidgets-constructors.h" -#include "drawable.h" #include "gdisplay.h" #include "libgimp/gimpintl.h" @@ -422,10 +421,6 @@ gimp_layer_list_view_paint_mode_menu_callback (GtkWidget *widget, gimp_layer_set_mode (layer, mode); UNBLOCK(); - drawable_update (GIMP_DRAWABLE (layer), 0, 0, - GIMP_DRAWABLE (layer)->width, - GIMP_DRAWABLE (layer)->height); - gdisplays_flush (); } } @@ -480,10 +475,6 @@ gimp_layer_list_view_opacity_scale_changed (GtkAdjustment *adjustment, gimp_layer_set_opacity (layer, opacity); UNBLOCK(); - drawable_update (GIMP_DRAWABLE (layer), 0, 0, - GIMP_DRAWABLE (layer)->width, - GIMP_DRAWABLE (layer)->height); - gdisplays_flush (); } } diff --git a/app/widgets/gimplayertreeview.c b/app/widgets/gimplayertreeview.c index d9b0cdc924..7fb6fde64e 100644 --- a/app/widgets/gimplayertreeview.c +++ b/app/widgets/gimplayertreeview.c @@ -38,7 +38,6 @@ #include "gimplistitem.h" #include "gimpwidgets-constructors.h" -#include "drawable.h" #include "gdisplay.h" #include "libgimp/gimpintl.h" @@ -422,10 +421,6 @@ gimp_layer_list_view_paint_mode_menu_callback (GtkWidget *widget, gimp_layer_set_mode (layer, mode); UNBLOCK(); - drawable_update (GIMP_DRAWABLE (layer), 0, 0, - GIMP_DRAWABLE (layer)->width, - GIMP_DRAWABLE (layer)->height); - gdisplays_flush (); } } @@ -480,10 +475,6 @@ gimp_layer_list_view_opacity_scale_changed (GtkAdjustment *adjustment, gimp_layer_set_opacity (layer, opacity); UNBLOCK(); - drawable_update (GIMP_DRAWABLE (layer), 0, 0, - GIMP_DRAWABLE (layer)->width, - GIMP_DRAWABLE (layer)->height); - gdisplays_flush (); } } diff --git a/tools/pdbgen/pdb.pl b/tools/pdbgen/pdb.pl index 6eb078b4f4..498512e91d 100644 --- a/tools/pdbgen/pdb.pl +++ b/tools/pdbgen/pdb.pl @@ -47,27 +47,27 @@ package Gimp::CodeGen::pdb; id_ret_func => 'gimp_image_get_ID ($var)' }, layer => { name => 'LAYER', type => 'GimpLayer *', - headers => [ qw("drawable.h" "core/gimplayer.h") ], + headers => [ qw("core/gimplayer.h") ], id_func => '(GimpLayer *) gimp_drawable_get_by_ID', id_ret_func => 'gimp_drawable_get_ID (GIMP_DRAWABLE ($var))' }, channel => { name => 'CHANNEL', type => 'GimpChannel *', - headers => [ qw("drawable.h" "core/gimpchannel.h") ], + headers => [ qw("core/gimpchannel.h") ], id_func => '(GimpChannel *) gimp_drawable_get_by_ID', id_ret_func => 'gimp_drawable_get_ID (GIMP_DRAWABLE ($var))' }, drawable => { name => 'DRAWABLE', type => 'GimpDrawable *', - headers => [ qw("drawable.h") ], + headers => [ qw("core/gimpdrawable.h") ], id_func => 'gimp_drawable_get_by_ID', id_ret_func => 'gimp_drawable_get_ID (GIMP_DRAWABLE ($var))' }, selection => { name => 'SELECTION', type => 'GimpChannel *', - headers => [ qw("drawable.h" "core/gimpchannel.h") ], + headers => [ qw("core/gimpchannel.h") ], id_func => '(GimpChannel *) gimp_drawable_get_by_ID', id_ret_func => 'gimp_drawable_get_ID (GIMP_DRAWABLE ($var))' }, layer_mask => { name => 'CHANNEL', type => 'GimpLayerMask *', - headers => [ qw("drawable.h" "core/gimplayermask.h") ], + headers => [ qw("core/gimplayermask.h") ], id_func => '(GimpLayerMask *) gimp_drawable_get_by_ID', id_ret_func => 'gimp_drawable_get_ID (GIMP_DRAWABLE ($var))' }, parasite => { name => 'PARASITE', diff --git a/tools/pdbgen/pdb/color.pdb b/tools/pdbgen/pdb/color.pdb index c216bffd7a..07b8741502 100644 --- a/tools/pdbgen/pdb/color.pdb +++ b/tools/pdbgen/pdb/color.pdb @@ -75,7 +75,7 @@ HELP 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)); } } CODE @@ -163,7 +163,7 @@ HELP 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)); } } CODE @@ -218,7 +218,7 @@ HELP 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)); } } CODE @@ -386,7 +386,7 @@ HELP 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)); } } CODE @@ -455,7 +455,7 @@ HELP 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)); } } CODE @@ -530,7 +530,7 @@ HELP 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)); } } CODE @@ -703,7 +703,7 @@ HELP 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)); } } CODE @@ -754,7 +754,7 @@ HELP &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)); } } CODE diff --git a/tools/pdbgen/pdb/drawable.pdb b/tools/pdbgen/pdb/drawable.pdb index a7990dc546..db4fc8bebe 100644 --- a/tools/pdbgen/pdb/drawable.pdb +++ b/tools/pdbgen/pdb/drawable.pdb @@ -128,7 +128,7 @@ HELP desc => 'The type of fill: %%desc%%' } ); - %invoke = ( code => 'drawable_fill (drawable, gimp_get_current_context (gimp), (GimpFillType) fill_type);' ); + %invoke = ( code => 'gimp_drawable_fill_by_type (drawable, gimp_get_current_context (gimp), (GimpFillType) fill_type);' ); } sub drawable_update { @@ -155,7 +155,7 @@ HELP desc => 'Height of update region' } ); - %invoke = ( code => 'drawable_update (drawable, x, y, width, height);' ); + %invoke = ( code => 'gimp_drawable_update (drawable, x, y, width, height);' ); } sub drawable_mask_bounds { @@ -537,7 +537,7 @@ CODE } @headers = qw("core/gimp.h" "core/gimplayermask.h" "core/gimpchannel.h" - "core/gimpdrawable.h" "drawable.h" + "core/gimpdrawable.h" "pdb_glue.h" "base/tile.h" "base/tile-manager.h" "base/temp-buf.h");