diff --git a/ChangeLog b/ChangeLog index 1ee3caaf12..d237d63de1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,87 @@ +2000-12-29 Michael Natterer + + * app/Makefile.am + * app/channel_pvt.h + * app/drawable_pvt.h + * app/gdisplayF.h + * app/gimpdrawableP.h + * app/gimpimageP.h + * app/layer_pvt.h + * app/toolsF.h: removed these files. + + * app/apptypes.h + * tools/pdbgen/enums.pl: added tons of opaque typedefs and enums. + + * tools/pdbgen/pdb/brush_select.pdb + * tools/pdbgen/pdb/brushes.pdb + * tools/pdbgen/pdb/channel.pdb + * tools/pdbgen/pdb/color.pdb + * tools/pdbgen/pdb/convert.pdb + * tools/pdbgen/pdb/display.pdb + * tools/pdbgen/pdb/drawable.pdb + * tools/pdbgen/pdb/fileops.pdb + * tools/pdbgen/pdb/gradient_select.pdb + * tools/pdbgen/pdb/gradients.pdb + * tools/pdbgen/pdb/help.pdb + * tools/pdbgen/pdb/image.pdb + * tools/pdbgen/pdb/layer.pdb + * tools/pdbgen/pdb/pattern_select.pdb + * tools/pdbgen/pdb/patterns.pdb + * tools/pdbgen/pdb/selection.pdb + * tools/pdbgen/pdb/tools.pdb + * app/*: chainsaw #include cleanup: + + - Never (never!!) include stuff in header files except where we + need access to structures' contents (like derived objects). + - Added prototypes and proper formating in many files. + - The #include order in *all* *.c files is as follows: + + #include "config.h" + + #include + + #include + + #include "apptypes.h" + + #include "gimp stuff" + + #include "libgimp stuff" + + #include "libgimp/gimpintl.h" + + By following this scheme we can easily see a file's dependencies + from it's #include's and can grep for the inclusion to find out + where a file is used. + + * tools/pdbgen/app.pl: changed to follow the include scheme above. + + * libgimp/Makefile.am + * libgimp/gimpuitypes.h: new file, included from libgimp/gimpui.h + and from app/apptypes.h. + + * libgimp/gimpcolorbutton.[ch] + * libgimp/gimpdialog.[ch] + * libgimp/gimphelpui.[ch] + * libgimp/gimpparasite.[ch] + * libgimp/gimppatheditor.[ch] + * libgimp/gimpprotocol.c + * libgimp/gimpquerybox.[ch] + * libgimp/gimpsizeentry.[ch] + * libgimp/gimptypes.h + * libgimp/gimpui.h + * libgimp/gimpunit.h + * libgimp/gimpunitmenu.[ch] + * libgimp/gimpwidgets.[ch]: changed accordingly. + + * plug-ins/FractalExplorer/Dialogs.c + * plug-ins/gdyntext/message_window.c + * plug-ins/imagemap/imap_default_dialog.c + * plug-ins/imagemap/imap_file.c: these files used to include + "libgimp/gimpui.h" without including "libgimp/gimp.h". This is + no longer possible because the libgimpui headers don't inlcude + "libgimp/gimpunit.h" any more. + 2000-12-29 Asbjorn Pettersen * app/module_db.c: OS/2 fix. remove gimp_color_display_register(),, diff --git a/app/Makefile.am b/app/Makefile.am index a9495b469d..ffa5d3c3d1 100644 --- a/app/Makefile.am +++ b/app/Makefile.am @@ -8,10 +8,8 @@ noinst_LIBRARIES = libgimpim.a libgimpim_a_SOURCES = \ gimpdrawable.c \ gimpdrawable.h \ - gimpdrawableP.h \ gimpimage.c \ gimpimage.h \ - gimpimageP.h \ gimpobject.c \ gimpobject.h \ gimppreviewcache.h \ @@ -61,7 +59,6 @@ gimp_SOURCES = \ by_color_select.h \ channel.c \ channel.h \ - channel_pvt.h \ channel_cmds.c \ channels_dialog.c \ channels_dialog.h \ @@ -157,7 +154,6 @@ gimp_SOURCES = \ fuzzy_select.h \ gdisplay.c \ gdisplay.h \ - gdisplayF.h \ gdisplay_ops.c \ gdisplay_ops.h \ general.c \ @@ -249,7 +245,6 @@ gimp_SOURCES = \ iscissors.h \ layer.c \ layer.h \ - layer_pvt.h \ layer_cmds.c \ layer_select.c \ layer_select.h \ @@ -388,7 +383,6 @@ gimp_SOURCES = \ tool_options.h \ tools.c \ tools.h \ - toolsF.h \ tools_cmds.c \ transform_core.c \ transform_core.h \ diff --git a/app/about_dialog.c b/app/about_dialog.c index e6b2bcc3d4..6bcca1f4dc 100644 --- a/app/about_dialog.c +++ b/app/about_dialog.c @@ -37,9 +37,11 @@ #include "libgimp/gimpfeatures.h" #include "libgimp/gimpenv.h" -#include "libgimp/gimpintl.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpmath.h" +#include "libgimp/gimpintl.h" + #include "pixmaps/wilber2.xpm" diff --git a/app/about_dialog.h b/app/about_dialog.h index 602df14466..38cd925696 100644 --- a/app/about_dialog.h +++ b/app/about_dialog.h @@ -15,6 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __ABOUT_DIALOG_H__ #define __ABOUT_DIALOG_H__ diff --git a/app/actions/help-commands.c b/app/actions/help-commands.c index 435754c8ac..01f3a86d85 100644 --- a/app/actions/help-commands.c +++ b/app/actions/help-commands.c @@ -18,7 +18,10 @@ #include "config.h" -#include +#include +#include + +#include #include "apptypes.h" @@ -41,13 +44,17 @@ #include "floating_sel.h" #include "gdisplay_ops.h" #include "gimage_mask.h" +#include "gimpcontext.h" #include "gimphelp.h" +#include "gimpimage.h" #include "gimprc.h" #include "gimpui.h" #include "global_edit.h" #include "gradient_select.h" #include "image_render.h" +#include "info_dialog.h" #include "info_window.h" +#include "layer.h" #include "nav_window.h" #include "invert.h" #include "lc_dialog.h" @@ -58,6 +65,7 @@ #include "plug_in.h" #include "resize.h" #include "scale.h" +#include "selection.h" #include "tips_dialog.h" #include "tools.h" #include "undo.h" @@ -66,9 +74,12 @@ #include "gdisplay_color_ui.h" #endif /* DISPLAY_FILTERS */ +#include "libgimp/gimphelpui.h" #include "libgimp/gimpmath.h" + #include "libgimp/gimpintl.h" + #define return_if_no_display(gdisp) \ gdisp = gdisplay_active (); \ if (!gdisp) return @@ -252,7 +263,7 @@ edit_clear_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - edit_clear (gdisp->gimage, gimage_active_drawable (gdisp->gimage)); + edit_clear (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage)); gdisplays_flush (); } @@ -266,7 +277,8 @@ edit_fill_cmd_callback (GtkWidget *widget, return_if_no_display (gdisp); fill_type = (GimpFillType) callback_action; - edit_fill (gdisp->gimage, gimage_active_drawable (gdisp->gimage), fill_type); + edit_fill (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage), + fill_type); gdisplays_flush (); } @@ -277,7 +289,7 @@ edit_stroke_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_mask_stroke (gdisp->gimage, gimage_active_drawable (gdisp->gimage)); + gimage_mask_stroke (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage)); gdisplays_flush (); } @@ -323,7 +335,7 @@ select_float_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_mask_float (gdisp->gimage, gimage_active_drawable (gdisp->gimage), + gimage_mask_float (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage), 0, 0); gdisplays_flush (); } @@ -892,13 +904,13 @@ layers_previous_cmd_callback (GtkWidget *widget, return_if_no_display (gdisp); current_layer = - gimage_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer); + gimp_image_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer); - new_layer = gimage_get_layer_by_index (gdisp->gimage, current_layer - 1); + new_layer = gimp_image_get_layer_by_index (gdisp->gimage, current_layer - 1); if (new_layer) { - gimage_set_active_layer (gdisp->gimage, new_layer); + gimp_image_set_active_layer (gdisp->gimage, new_layer); gdisplays_flush (); layer_select_init (gdisp->gimage, 0, GDK_CURRENT_TIME); } @@ -915,13 +927,13 @@ layers_next_cmd_callback (GtkWidget *widget, return_if_no_display (gdisp); current_layer = - gimage_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer); + gimp_image_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer); - new_layer = gimage_get_layer_by_index (gdisp->gimage, current_layer + 1); + new_layer = gimp_image_get_layer_by_index (gdisp->gimage, current_layer + 1); if (new_layer) { - gimage_set_active_layer (gdisp->gimage, new_layer); + gimp_image_set_active_layer (gdisp->gimage, new_layer); gdisplays_flush (); layer_select_init (gdisp->gimage, 0, GDK_CURRENT_TIME); } @@ -934,7 +946,7 @@ layers_raise_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_raise_layer (gdisp->gimage, gdisp->gimage->active_layer); + gimp_image_raise_layer (gdisp->gimage, gdisp->gimage->active_layer); gdisplays_flush (); } @@ -945,7 +957,7 @@ layers_lower_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_lower_layer (gdisp->gimage, gdisp->gimage->active_layer); + gimp_image_lower_layer (gdisp->gimage, gdisp->gimage->active_layer); gdisplays_flush (); } @@ -956,7 +968,7 @@ layers_raise_to_top_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_raise_layer_to_top (gdisp->gimage, gdisp->gimage->active_layer); + gimp_image_raise_layer_to_top (gdisp->gimage, gdisp->gimage->active_layer); gdisplays_flush (); } @@ -967,7 +979,7 @@ layers_lower_to_bottom_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_lower_layer_to_bottom (gdisp->gimage, gdisp->gimage->active_layer); + gimp_image_lower_layer_to_bottom (gdisp->gimage, gdisp->gimage->active_layer); gdisplays_flush (); } @@ -978,7 +990,7 @@ layers_anchor_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - floating_sel_anchor (gimage_get_active_layer (gdisp->gimage)); + floating_sel_anchor (gimp_image_get_active_layer (gdisp->gimage)); gdisplays_flush (); } @@ -999,7 +1011,7 @@ layers_flatten_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_flatten (gdisp->gimage); + gimp_image_flatten (gdisp->gimage); gdisplays_flush (); } @@ -1086,7 +1098,7 @@ tools_select_cmd_callback (GtkWidget *widget, { (* tool_info[tool_type].init_func) (gdisp); - active_tool->drawable = gimage_active_drawable (gdisp->gimage); + active_tool->drawable = gimp_image_active_drawable (gdisp->gimage); } /* setting the gdisp_ptr here is a HACK to allow the tools' @@ -1316,11 +1328,11 @@ image_resize_callback (GtkWidget *widget, if (image_resize->resize->width > 0 && image_resize->resize->height > 0) { - gimage_resize (gimage, - image_resize->resize->width, - image_resize->resize->height, - image_resize->resize->offset_x, - image_resize->resize->offset_y); + gimp_image_resize (gimage, + image_resize->resize->width, + image_resize->resize->height, + image_resize->resize->offset_x, + image_resize->resize->offset_y); gdisplays_flush (); lc_dialog_update_image_list (); } diff --git a/app/actions/plug-in-commands.c b/app/actions/plug-in-commands.c index 55ca59c2c1..03e7a8c016 100644 --- a/app/actions/plug-in-commands.c +++ b/app/actions/plug-in-commands.c @@ -22,7 +22,7 @@ #include #endif -#include +#include #include #include @@ -88,13 +88,14 @@ #include "gdisplay.h" #include "general.h" #include "gimage.h" +#include "gimpprogress.h" #include "gimprc.h" #include "gradient_select.h" #include "menus.h" #include "pattern_select.h" /* Needed for closing pattern dialogs */ #include "plug_in.h" - -#include "tile.h" /* ick. */ +#include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpenv.h" #include "libgimp/gimpprotocol.h" diff --git a/app/actions/qmask-commands.c b/app/actions/qmask-commands.c index 34be73025d..1c4af4b114 100644 --- a/app/actions/qmask-commands.c +++ b/app/actions/qmask-commands.c @@ -29,11 +29,12 @@ #include "appenv.h" #include "channel.h" #include "color_panel.h" +#include "drawable.h" #include "floating_sel.h" -#include "gdisplayF.h" -#include "gimpcontext.h" +#include "gdisplay.h" #include "gimage_mask.h" #include "gimpimage.h" +#include "gimpcontext.h" #include "gimpui.h" #include "global_edit.h" #include "qmask.h" @@ -163,7 +164,7 @@ qmask_deactivate (GtkWidget *widget, the qmask_state to FALSE */ undo_push_qmask (gimg); gimage_mask_load (gimg, gmask); - gimage_remove_channel (gimg, gmask); + gimp_image_remove_channel (gimg, gmask); undo_push_group_end (gimg); } @@ -207,9 +208,9 @@ qmask_activate (GtkWidget *widget, undo_push_group_start (gimg, QMASK_UNDO); - if (gimage_mask_is_empty(gimg)) + if (gimage_mask_is_empty (gimg)) { - if ((layer = gimage_floating_sel (gimg))) + if ((layer = gimp_image_floating_sel (gimg))) { floating_sel_to_layer (layer); } @@ -217,7 +218,7 @@ qmask_activate (GtkWidget *widget, gmask = channel_new (gimg, gimg->width, gimg->height, - "Qmask", + "Qmask", (gint)(255*opacity)/100, color); gimp_image_add_channel (gimg, gmask, 0); @@ -225,7 +226,7 @@ qmask_activate (GtkWidget *widget, } else { /* if selection */ - gmask = channel_copy (gimage_get_mask (gimg)); + gmask = channel_copy (gimp_image_get_mask (gimg)); gimp_image_add_channel (gimg, gmask, 0); channel_set_color (gmask, color); drawable_set_name (GIMP_DRAWABLE (gmask), "Qmask"); @@ -331,12 +332,12 @@ edit_qmask_query_ok_callback (GtkWidget *widget, gpointer client_data) { EditQmaskOptions *options; - Channel *channel; - guchar *tmpcolp; - guchar tmpcol[3]; - gboolean update = FALSE; - gint opacity; - gint i; + Channel *channel; + const guchar *tmpcolp; + guchar tmpcol[3]; + gboolean update = FALSE; + gint opacity; + gint i; options = (EditQmaskOptions *) client_data; channel = gimp_image_get_channel_by_name (options->gimage, "Qmask"); @@ -348,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget, { update = TRUE; } - tmpcolp = channel_get_color(channel); + tmpcolp = channel_get_color (channel); for (i = 0; i < 3; i++) { /* don't update if color hasn't changed */ tmpcol[i] = tmpcolp[i]; /* initialize to same values */ diff --git a/app/actions/quick-mask-commands.c b/app/actions/quick-mask-commands.c index 34be73025d..1c4af4b114 100644 --- a/app/actions/quick-mask-commands.c +++ b/app/actions/quick-mask-commands.c @@ -29,11 +29,12 @@ #include "appenv.h" #include "channel.h" #include "color_panel.h" +#include "drawable.h" #include "floating_sel.h" -#include "gdisplayF.h" -#include "gimpcontext.h" +#include "gdisplay.h" #include "gimage_mask.h" #include "gimpimage.h" +#include "gimpcontext.h" #include "gimpui.h" #include "global_edit.h" #include "qmask.h" @@ -163,7 +164,7 @@ qmask_deactivate (GtkWidget *widget, the qmask_state to FALSE */ undo_push_qmask (gimg); gimage_mask_load (gimg, gmask); - gimage_remove_channel (gimg, gmask); + gimp_image_remove_channel (gimg, gmask); undo_push_group_end (gimg); } @@ -207,9 +208,9 @@ qmask_activate (GtkWidget *widget, undo_push_group_start (gimg, QMASK_UNDO); - if (gimage_mask_is_empty(gimg)) + if (gimage_mask_is_empty (gimg)) { - if ((layer = gimage_floating_sel (gimg))) + if ((layer = gimp_image_floating_sel (gimg))) { floating_sel_to_layer (layer); } @@ -217,7 +218,7 @@ qmask_activate (GtkWidget *widget, gmask = channel_new (gimg, gimg->width, gimg->height, - "Qmask", + "Qmask", (gint)(255*opacity)/100, color); gimp_image_add_channel (gimg, gmask, 0); @@ -225,7 +226,7 @@ qmask_activate (GtkWidget *widget, } else { /* if selection */ - gmask = channel_copy (gimage_get_mask (gimg)); + gmask = channel_copy (gimp_image_get_mask (gimg)); gimp_image_add_channel (gimg, gmask, 0); channel_set_color (gmask, color); drawable_set_name (GIMP_DRAWABLE (gmask), "Qmask"); @@ -331,12 +332,12 @@ edit_qmask_query_ok_callback (GtkWidget *widget, gpointer client_data) { EditQmaskOptions *options; - Channel *channel; - guchar *tmpcolp; - guchar tmpcol[3]; - gboolean update = FALSE; - gint opacity; - gint i; + Channel *channel; + const guchar *tmpcolp; + guchar tmpcol[3]; + gboolean update = FALSE; + gint opacity; + gint i; options = (EditQmaskOptions *) client_data; channel = gimp_image_get_channel_by_name (options->gimage, "Qmask"); @@ -348,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget, { update = TRUE; } - tmpcolp = channel_get_color(channel); + tmpcolp = channel_get_color (channel); for (i = 0; i < 3; i++) { /* don't update if color hasn't changed */ tmpcol[i] = tmpcolp[i]; /* initialize to same values */ diff --git a/app/airbrush.c b/app/airbrush.c index 3a518af92a..e12e0d2fd4 100644 --- a/app/airbrush.c +++ b/app/airbrush.c @@ -28,11 +28,14 @@ #include "gdisplay.h" #include "gradient.h" #include "gimage.h" +#include "gimpbrush.h" +#include "gimpcontext.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" #include "paint_options.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" #include "libgimp/gimpintl.h" @@ -295,10 +298,10 @@ airbrush_motion (PaintCore *paint_core, double pressure, PaintApplicationMode mode) { - GImage *gimage; - TempBuf * area; - unsigned char col[MAX_CHANNELS]; - gdouble scale; + GImage *gimage; + TempBuf *area; + guchar col[MAX_CHANNELS]; + gdouble scale; if (!drawable) return; diff --git a/app/airbrush.h b/app/airbrush.h index adae83e6c7..ea4e64954b 100644 --- a/app/airbrush.h +++ b/app/airbrush.h @@ -15,17 +15,23 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __AIRBRUSH_H__ #define __AIRBRUSH_H__ -#include "tools.h" -#include "paint_core.h" -void * airbrush_paint_func (PaintCore *, GimpDrawable *, int); -gboolean airbrush_non_gui (GimpDrawable *, double, int, double *); -gboolean airbrush_non_gui_default (GimpDrawable *, int, double *); -Tool * tools_new_airbrush (void); -void tools_free_airbrush (Tool *); +void * airbrush_paint_func (PaintCore *, + GimpDrawable *, + gint); +gboolean airbrush_non_gui (GimpDrawable *, + gdouble, + gint, + gdouble *); +gboolean airbrush_non_gui_default (GimpDrawable *, + gint, + gdouble *); +Tool * tools_new_airbrush (void); +void tools_free_airbrush (Tool *); #endif /* __AIRBRUSH_H__ */ diff --git a/app/app_procs.c b/app/app_procs.c index 8548f55bf8..71aa4a7168 100644 --- a/app/app_procs.c +++ b/app/app_procs.c @@ -15,6 +15,7 @@ * 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 @@ -38,9 +39,6 @@ #include -#include "libgimp/gimpfeatures.h" -#include "libgimp/gimpenv.h" - #include "apptypes.h" #include "appenv.h" @@ -57,6 +55,7 @@ #include "gdisplay.h" #include "gdisplay_ops.h" #include "gimpbrushlist.h" +#include "gimpcontext.h" #include "gimprc.h" #include "gimpparasite.h" #include "gimpset.h" @@ -100,8 +99,13 @@ #include "gimpparasite.h" #include "libgimp/gimplimits.h" +#include "libgimp/gimpfeatures.h" +#include "libgimp/gimpenv.h" +#include "libgimp/gimphelpui.h" + #include "libgimp/gimpintl.h" + #define LOGO_WIDTH_MIN 300 #define LOGO_HEIGHT_MIN 110 #define AUTHORS "Spencer Kimball & Peter Mattis" diff --git a/app/app_procs.h b/app/app_procs.h index 4bafe670e3..59f75ec631 100644 --- a/app/app_procs.h +++ b/app/app_procs.h @@ -15,15 +15,20 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __APP_PROCS_H__ #define __APP_PROCS_H__ -/* Function declarations */ -void gimp_init (int, char **); -void app_init (void); -void app_exit (gboolean); -void app_exit_finish (void); -int app_exit_finish_done (void); -void app_init_update_status(char *label1val, char *label2val, float pct_progress); + +void gimp_init (gint, + gchar **); +void app_init (void); +void app_exit (gboolean ); +void app_exit_finish (void); +gint app_exit_finish_done (void); +void app_init_update_status (gchar *label1val, + gchar *label2val, + gfloat pct_progress); + #endif /* APP_PROCS_H */ diff --git a/app/apptypes.h b/app/apptypes.h index 3fc3933539..2ebc24b099 100644 --- a/app/apptypes.h +++ b/app/apptypes.h @@ -15,6 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __APPTYPES_H__ #define __APPTYPES_H__ @@ -24,7 +25,15 @@ * this file defines those enumeration and opaque struct types that * don't depend on any other header. These problems began creeping up * when we started to actually use these enums in function prototypes. -*/ + */ + +#include "undo_types.h" +#include "libgimp/gimpmatrix.h" +#include "libgimp/gimpvector.h" +#include "libgimp/gimpunit.h" + +#include "libgimp/gimpuitypes.h" + /* Should we instead use the enums in libgimp/gimpenums.h? */ @@ -118,7 +127,8 @@ typedef enum /*< chop=ADD_ >*/ } AddMaskType; /* gradient paint modes */ -typedef enum { +typedef enum +{ ONCE_FORWARD, /* paint through once, then stop */ ONCE_BACKWARDS, /* paint once, then stop, but run the gradient the other way */ LOOP_SAWTOOTH, /* keep painting, looping through the grad start->end,start->end /|/|/| */ @@ -135,13 +145,215 @@ typedef enum NEAREST_NEIGHBOR_INTERPOLATION } InterpolationType; +typedef enum /*< skip >*/ +{ + ORIENTATION_UNKNOWN, + ORIENTATION_HORIZONTAL, + ORIENTATION_VERTICAL +} InternalOrientationType; + +typedef enum +{ + HORIZONTAL, + VERTICAL, + UNKNOWN +} OrientationType; + +/* Procedural database types */ +typedef enum +{ + PDB_INT32, + PDB_INT16, + PDB_INT8, + PDB_FLOAT, + PDB_STRING, + PDB_INT32ARRAY, + PDB_INT16ARRAY, + PDB_INT8ARRAY, + PDB_FLOATARRAY, + PDB_STRINGARRAY, + PDB_COLOR, + PDB_REGION, + PDB_DISPLAY, + PDB_IMAGE, + PDB_LAYER, + PDB_CHANNEL, + PDB_DRAWABLE, + PDB_SELECTION, + PDB_BOUNDARY, + PDB_PATH, + PDB_PARASITE, + PDB_STATUS, + PDB_END +} PDBArgType; + +/* Error types */ +typedef enum +{ + PDB_EXECUTION_ERROR, + PDB_CALLING_ERROR, + PDB_PASS_THROUGH, + PDB_SUCCESS, + PDB_CANCEL +} PDBStatusType; + + +/* Procedure types */ +typedef enum /*< chop=PDB_ >*/ +{ + PDB_INTERNAL, + PDB_PLUGIN, + PDB_EXTENSION, + PDB_TEMPORARY +} PDBProcType; + +/* Selection Boolean operations */ +typedef enum /*< chop=CHANNEL_OP_ >*/ +{ + CHANNEL_OP_ADD, + CHANNEL_OP_SUB, + CHANNEL_OP_REPLACE, + CHANNEL_OP_INTERSECT +} ChannelOps; + +typedef enum /*< skip >*/ +{ + SELECTION_ADD = CHANNEL_OP_ADD, + SELECTION_SUB = CHANNEL_OP_SUB, + SELECTION_REPLACE = CHANNEL_OP_REPLACE, + SELECTION_INTERSECT = CHANNEL_OP_INTERSECT, + SELECTION_MOVE_MASK, + SELECTION_MOVE, + SELECTION_ANCHOR +} SelectOps; + +/* The possible states for tools */ +typedef enum /*< skip >*/ +{ + INACTIVE, + ACTIVE, + PAUSED +} ToolState; + +/* Tool control actions */ +typedef enum /*< skip >*/ +{ + PAUSE, + RESUME, + HALT, + CURSOR_UPDATE, + DESTROY, + RECREATE +} ToolAction; + +/* Tool types */ +typedef enum /*< skip >*/ +{ + TOOL_TYPE_NONE = -1, + FIRST_TOOLBOX_TOOL = 0, + RECT_SELECT = FIRST_TOOLBOX_TOOL, + ELLIPSE_SELECT, + FREE_SELECT, + FUZZY_SELECT, + BEZIER_SELECT, + ISCISSORS, + MOVE, + MAGNIFY, + CROP, + ROTATE, + SCALE, + SHEAR, + PERSPECTIVE, + FLIP, + TEXT, + COLOR_PICKER, + BUCKET_FILL, + BLEND, + PENCIL, + PAINTBRUSH, + ERASER, + AIRBRUSH, + CLONE, + CONVOLVE, + INK, + DODGEBURN, + SMUDGE, + MEASURE, + LAST_TOOLBOX_TOOL = MEASURE, + + /* Non-toolbox tools */ + BY_COLOR_SELECT, + COLOR_BALANCE, + BRIGHTNESS_CONTRAST, + HUE_SATURATION, + POSTERIZE, + THRESHOLD, + CURVES, + LEVELS, + HISTOGRAM +} ToolType; + +/* possible transform functions */ +typedef enum /*< skip >*/ +{ + TRANSFORM_CREATING, + TRANSFORM_HANDLE_1, + TRANSFORM_HANDLE_2, + TRANSFORM_HANDLE_3, + TRANSFORM_HANDLE_4, + TRANSFORM_HANDLE_CENTER +} TransformAction; + +/* the different states that the transformation function can be called with */ +typedef enum /*< skip >*/ +{ + TRANSFORM_INIT, + TRANSFORM_MOTION, + TRANSFORM_RECALC, + TRANSFORM_FINISH +} TransformState; + +typedef enum /*< skip >*/ +{ + CURSOR_MODE_TOOL_ICON, + CURSOR_MODE_TOOL_CROSSHAIR, + CURSOR_MODE_CROSSHAIR +} CursorMode; + +typedef enum /*< skip >*/ +{ + CURSOR_MODIFIER_NONE, + CURSOR_MODIFIER_PLUS, + CURSOR_MODIFIER_MINUS, + CURSOR_MODIFIER_INTERSECT, + CURSOR_MODIFIER_MOVE, + CURSOR_MODIFIER_RESIZE, + CURSOR_MODIFIER_CONTROL, + CURSOR_MODIFIER_ANCHOR, + CURSOR_MODIFIER_FOREGROUND, + CURSOR_MODIFIER_BACKGROUND, + CURSOR_MODIFIER_PATTERN, + CURSOR_MODIFIER_HAND +} CursorModifier; + + +typedef struct _GimpContext GimpContext; +typedef struct _GimpContextPreview GimpContextPreview; + typedef struct _GimpChannel GimpChannel; typedef struct _GimpChannelClass GimpChannelClass; -typedef GimpChannel Channel; /* convenience */ +typedef GimpChannel Channel; /* convenience */ typedef struct _GDisplay GDisplay; +typedef struct _GPattern GPattern; + +typedef struct _gradient_t gradient_t; + +typedef struct _PaletteEntries PaletteEntries; +typedef struct _PaletteEntry PaletteEntry; + typedef struct _GimpDrawable GimpDrawable; typedef struct _GimpLayer GimpLayer; @@ -149,10 +361,11 @@ typedef struct _GimpLayerClass GimpLayerClass; typedef struct _GimpLayerMask GimpLayerMask; typedef struct _GimpLayerMaskClass GimpLayerMaskClass; -typedef GimpLayer Layer; /* convenience */ -typedef GimpLayerMask LayerMask; /* convenience */ +typedef GimpLayer Layer; /* convenience */ +typedef GimpLayerMask LayerMask; /* convenience */ typedef struct _GimpImage GimpImage; +typedef GimpImage GImage; typedef struct _GimpSet GimpSet; typedef struct _GimpList GimpList; @@ -160,10 +373,13 @@ typedef struct _GimpList GimpList; typedef struct _Guide Guide; typedef guint32 Tattoo; -typedef struct _paint_core PaintCore; +typedef struct _PaintCore PaintCore; +typedef struct _DrawCore DrawCore; typedef struct _GimpBrush GimpBrush; typedef struct _GimpBrushList GimpBrushList; +typedef struct _GimpBrushGenerated GimpBrushGenerated; +typedef struct _GimpBrushPipe GimpBrushPipe; typedef struct _GimpObject GimpObject; @@ -178,11 +394,68 @@ typedef struct _layer_mask_undo LayerMaskUndo; typedef struct _fs_to_layer_undo FStoLayerUndo; +typedef struct _Argument Argument; +typedef struct _ProcArg ProcArg; +typedef struct _ProcRecord ProcRecord; + typedef struct _PlugIn PlugIn; typedef struct _PlugInDef PlugInDef; typedef struct _PlugInProcDef PlugInProcDef; typedef struct _ParasiteList ParasiteList; +typedef struct _Tile Tile; +typedef struct _TileManager TileManager; + +typedef void (* TileValidateProc) (TileManager *tm, + Tile *tile); + +typedef struct _PixelRegionIterator PixelRegionIterator; +typedef struct _PixelRegion PixelRegion; +typedef struct _PixelRegionHolder PixelRegionHolder; + +typedef struct _GimpParasite GimpParasite; + +typedef struct _Path Path; +typedef struct _PathPoint PathPoint; +typedef struct _PathList PathList; +typedef GSList PathUndo; + +typedef struct _TempBuf TempBuf; +typedef struct _TempBuf MaskBuf; + +typedef struct _Tool Tool; +typedef struct _ToolInfo ToolInfo; +typedef struct _ToolOptions ToolOptions; +typedef struct _SelectionOptions SelectionOptions; + +typedef void (* ToolOptionsResetFunc) (void); + +typedef struct _BezierPoint BezierPoint; +typedef struct _BezierSelect BezierSelect; + +typedef struct gimp_progress_pvt gimp_progress; +typedef void (* progress_func_t) (gint ymin, + gint ymax, + gint curr_y, + gpointer progress_data); + +typedef gpointer ImageMap; +typedef void (* ImageMapApplyFunc) (PixelRegion *, + PixelRegion *, + gpointer); + +typedef struct _TransformCore TransformCore; + +typedef struct _ScanConvertPoint ScanConvertPoint; + +typedef struct _InfoDialog InfoDialog; + +typedef struct _Selection Selection; + +typedef struct _HistogramWidget HistogramWidget; + +typedef struct _GimpImageNewValues GimpImageNewValues; + #endif /* __APPTYPES_H__ */ diff --git a/app/asupsample.c b/app/asupsample.c index 4014d8366a..f9368cacd2 100644 --- a/app/asupsample.c +++ b/app/asupsample.c @@ -30,7 +30,6 @@ #include "config.h" -#include #include #include @@ -39,303 +38,351 @@ #include "appenv.h" #include "asupsample.h" +#include "gimpprogress.h" + +#include "libgimp/gimpmath.h" -/***** Types *****/ - -typedef struct { - char ready; - color_t color; +typedef struct +{ + gchar ready; + color_t color; } sample_t; /***** Local functions *****/ -static unsigned long render_sub_pixel(int max_depth, int depth, sample_t **block, - int x, int y, int x1, int y1, int x3, int y3, - double threshold, int sub_pixel_size, render_func_t render_func, - color_t *color, void *render_data); +static gulong render_sub_pixel (gint max_depth, + gint depth, + sample_t **block, + gint x, + gint y, + gint x1, + gint y1, + gint x3, + gint y3, + gdouble threshold, + gint sub_pixel_size, + render_func_t render_func, + color_t *color, + gpointer render_data); -static double color_dist(color_t c1, color_t c2); +static gdouble color_dist (color_t c1, + color_t c2); /***** Functions *****/ -/*****/ - -unsigned long -adaptive_supersample_area(int x1, int y1, int x2, int y2, int max_depth, double threshold, - render_func_t render_func, void *render_data, - put_pixel_func_t put_pixel_func, void *put_pixel_data, - progress_func_t progress_func, void *progress_data) +gulong +adaptive_supersample_area (gint x1, + gint y1, + gint x2, + gint y2, + gint max_depth, + gdouble threshold, + render_func_t render_func, + gpointer render_data, + put_pixel_func_t put_pixel_func, + gpointer put_pixel_data, + progress_func_t progress_func, + gpointer progress_data) { - int x, y, width; /* Counters, width of region */ - int xt, xtt, yt; /* Temporary counters */ - int sub_pixel_size; /* Numbe of samples per pixel (1D) */ - size_t row_size; /* Memory needed for one row */ - color_t color; /* Rendered pixel's color */ - sample_t tmp_sample; /* For swapping samples */ - sample_t *top_row, *bot_row, *tmp_row; /* Sample rows */ - sample_t **block; /* Sample block matrix */ - unsigned long num_samples; + int x, y, width; /* Counters, width of region */ + int xt, xtt, yt; /* Temporary counters */ + int sub_pixel_size; /* Numbe of samples per pixel (1D) */ + size_t row_size; /* Memory needed for one row */ + color_t color; /* Rendered pixel's color */ + sample_t tmp_sample; /* For swapping samples */ + sample_t *top_row, *bot_row, *tmp_row; /* Sample rows */ + sample_t **block; /* Sample block matrix */ + unsigned long num_samples; - /* Initialize color */ + /* Initialize color */ - color.r = 0.0; - color.g = 0.0; - color.b = 0.0; - color.a = 0.0; + color.r = 0.0; + color.g = 0.0; + color.b = 0.0; + color.a = 0.0; - /* Calculate sub-pixel size */ + /* Calculate sub-pixel size */ - sub_pixel_size = 1 << max_depth; /* 2**max_depth */ + sub_pixel_size = 1 << max_depth; /* 2**max_depth */ - /* Create row arrays */ + /* Create row arrays */ - width = x2 - x1 + 1; + width = x2 - x1 + 1; - row_size = (sub_pixel_size * width + 1) * sizeof(sample_t); + row_size = (sub_pixel_size * width + 1) * sizeof(sample_t); - top_row = g_malloc(row_size); - bot_row = g_malloc(row_size); + top_row = g_malloc(row_size); + bot_row = g_malloc(row_size); - for (x = 0; x < (sub_pixel_size * width + 1); x++) { - top_row[x].ready = 0; + for (x = 0; x < (sub_pixel_size * width + 1); x++) + { + top_row[x].ready = 0; - top_row[x].color.r = 0.0; - top_row[x].color.g = 0.0; - top_row[x].color.b = 0.0; - top_row[x].color.a = 0.0; + top_row[x].color.r = 0.0; + top_row[x].color.g = 0.0; + top_row[x].color.b = 0.0; + top_row[x].color.a = 0.0; - bot_row[x].ready = 0; + bot_row[x].ready = 0; - bot_row[x].color.r = 0.0; - bot_row[x].color.g = 0.0; - bot_row[x].color.b = 0.0; - bot_row[x].color.a = 0.0; - } /* for */ + bot_row[x].color.r = 0.0; + bot_row[x].color.g = 0.0; + bot_row[x].color.b = 0.0; + bot_row[x].color.a = 0.0; + } - /* Allocate block matrix */ + /* Allocate block matrix */ - block = g_malloc((sub_pixel_size + 1) * sizeof(sample_t *)); /* Rows */ + block = g_malloc((sub_pixel_size + 1) * sizeof(sample_t *)); /* Rows */ - for (y = 0; y < (sub_pixel_size + 1); y++) { - block[y] = g_malloc((sub_pixel_size + 1) * sizeof(sample_t)); /* Columns */ + for (y = 0; y < (sub_pixel_size + 1); y++) + { + block[y] = g_malloc((sub_pixel_size + 1) * sizeof(sample_t)); /* Columns */ - for (x = 0; x < (sub_pixel_size + 1); x++) { - block[y][x].ready = 0; + for (x = 0; x < (sub_pixel_size + 1); x++) + { + block[y][x].ready = 0; - block[y][x].color.r = 0; - block[y][x].color.g = 0; - block[y][x].color.b = 0; - block[y][x].color.a = 0; - } + block[y][x].color.r = 0; + block[y][x].color.g = 0; + block[y][x].color.b = 0; + block[y][x].color.a = 0; + } + } + + /* Render region */ + + num_samples = 0; + + for (y = y1; y <= y2; y++) + { + /* Clear the bottom row */ + + for (xt = 0; xt < (sub_pixel_size * width + 1); xt++) + bot_row[xt].ready = 0; + + /* Clear first column */ + + for (yt = 0; yt < (sub_pixel_size + 1); yt++) + block[yt][0].ready = 0; + + /* Render row */ + + for (x = x1; x <= x2; x++) + { + /* Initialize block by clearing all but first row/column */ + + for (yt = 1; yt < (sub_pixel_size + 1); yt++) + for (xt = 1; xt < (sub_pixel_size + 1); xt++) + block[yt][xt].ready = 0; + + /* Copy samples from top row to block */ + + for (xtt = 0, xt = (x - x1) * sub_pixel_size; + xtt < (sub_pixel_size + 1); + xtt++, xt++) + block[0][xtt] = top_row[xt]; + + /* Render pixel on (x, y) */ + + num_samples += render_sub_pixel (max_depth, 1, block, x, y, 0, 0, + sub_pixel_size, sub_pixel_size, + threshold, sub_pixel_size, + render_func, &color, + render_data); + + if (put_pixel_func) + (*put_pixel_func)(x, y, color, put_pixel_data); + + /* Copy block information to rows */ + + top_row[((x - x1) + 1) * sub_pixel_size] = block[0][sub_pixel_size]; + + for (xtt = 0, xt = (x - x1) * sub_pixel_size; + xtt < (sub_pixel_size + 1); + xtt++, xt++) + bot_row[xt] = block[sub_pixel_size][xtt]; + + /* Swap first and last columns */ + + for (yt = 0; yt < (sub_pixel_size + 1); yt++) + { + tmp_sample = block[yt][0]; + block[yt][0] = block[yt][sub_pixel_size]; + block[yt][sub_pixel_size] = tmp_sample; + } } - /* Render region */ + /* Swap rows */ - num_samples = 0; + tmp_row = top_row; + top_row = bot_row; + bot_row = tmp_row; - for (y = y1; y <= y2; y++) { - /* Clear the bottom row */ + /* Call progress display function */ - for (xt = 0; xt < (sub_pixel_size * width + 1); xt++) - bot_row[xt].ready = 0; + if (progress_func && !(y & 0xf)) + (*progress_func)(y1, y2, y, progress_data); + } - /* Clear first column */ + /* Free memory */ - for (yt = 0; yt < (sub_pixel_size + 1); yt++) - block[yt][0].ready = 0; + for (y = 0; y < (sub_pixel_size + 1); y++) + g_free (block[y]); - /* Render row */ + g_free (block); + g_free (top_row); + g_free (bot_row); - for (x = x1; x <= x2; x++) { - /* Initialize block by clearing all but first row/column */ + return num_samples; +} - for (yt = 1; yt < (sub_pixel_size + 1); yt++) - for (xt = 1; xt < (sub_pixel_size + 1); xt++) - block[yt][xt].ready = 0; - - /* Copy samples from top row to block */ - - for (xtt = 0, xt = (x - x1) * sub_pixel_size; - xtt < (sub_pixel_size + 1); - xtt++, xt++) - block[0][xtt] = top_row[xt]; - - /* Render pixel on (x, y) */ - - num_samples += render_sub_pixel(max_depth, 1, block, x, y, 0, 0, - sub_pixel_size, sub_pixel_size, - threshold, sub_pixel_size, render_func, &color, - render_data); - - if (put_pixel_func) - (*put_pixel_func)(x, y, color, put_pixel_data); - - /* Copy block information to rows */ - - top_row[((x - x1) + 1) * sub_pixel_size] = block[0][sub_pixel_size]; - - for (xtt = 0, xt = (x - x1) * sub_pixel_size; - xtt < (sub_pixel_size + 1); - xtt++, xt++) - bot_row[xt] = block[sub_pixel_size][xtt]; - - /* Swap first and last columns */ - - for (yt = 0; yt < (sub_pixel_size + 1); yt++) { - tmp_sample = block[yt][0]; - block[yt][0] = block[yt][sub_pixel_size]; - block[yt][sub_pixel_size] = tmp_sample; - } /* for */ - } /* for */ - - /* Swap rows */ - - tmp_row = top_row; - top_row = bot_row; - bot_row = tmp_row; - - /* Call progress display function */ - - if (progress_func && !(y & 0xf)) - (*progress_func)(y1, y2, y, progress_data); - } /* for */ - - /* Free memory */ - - for (y = 0; y < (sub_pixel_size + 1); y++) - g_free(block[y]); - - g_free(block); - g_free(top_row); - g_free(bot_row); - - return num_samples; -} /* adaptive_supersample_area */ - - -/*****/ - -static unsigned long -render_sub_pixel(int max_depth, int depth, sample_t **block, - int x, int y, int x1, int y1, int x3, int y3, - double threshold, int sub_pixel_size, render_func_t render_func, - color_t *color, void *render_data) +static gulong +render_sub_pixel (gint max_depth, + gint depth, + sample_t **block, + gint x, + gint y, + gint x1, + gint y1, + gint x3, + gint y3, + double threshold, + gint sub_pixel_size, + render_func_t render_func, + color_t *color, + gpointer render_data) { - int x2, y2; /* Coords of center sample */ - double dx1, dy1; /* Delta to upper left sample */ - double dx3, dy3; /* Delta to lower right sample */ - color_t c1, c2, c3, c4; /* Sample colors */ - unsigned long num_samples; + int x2, y2; /* Coords of center sample */ + double dx1, dy1; /* Delta to upper left sample */ + double dx3, dy3; /* Delta to lower right sample */ + color_t c1, c2, c3, c4; /* Sample colors */ + unsigned long num_samples; - /* Get offsets for corners */ + /* Get offsets for corners */ - dx1 = (double) (x1 - sub_pixel_size / 2) / sub_pixel_size; - dx3 = (double) (x3 - sub_pixel_size / 2) / sub_pixel_size; + dx1 = (double) (x1 - sub_pixel_size / 2) / sub_pixel_size; + dx3 = (double) (x3 - sub_pixel_size / 2) / sub_pixel_size; - dy1 = (double) (y1 - sub_pixel_size / 2) / sub_pixel_size; - dy3 = (double) (y3 - sub_pixel_size / 2) / sub_pixel_size; + dy1 = (double) (y1 - sub_pixel_size / 2) / sub_pixel_size; + dy3 = (double) (y3 - sub_pixel_size / 2) / sub_pixel_size; - num_samples = 0; + num_samples = 0; - /* Render upper left sample */ + /* Render upper left sample */ - if (!block[y1][x1].ready) { - num_samples++; - (*render_func)(x + dx1, y + dy1, &c1, render_data); + if (!block[y1][x1].ready) + { + num_samples++; + (*render_func)(x + dx1, y + dy1, &c1, render_data); - block[y1][x1].ready = 1; - block[y1][x1].color = c1; - } else - c1 = block[y1][x1].color; + block[y1][x1].ready = 1; + block[y1][x1].color = c1; + } + else + { + c1 = block[y1][x1].color; + } - /* Render upper right sample */ + /* Render upper right sample */ - if (!block[y1][x3].ready) { - num_samples++; - (*render_func)(x + dx3, y + dy1, &c2, render_data); + if (!block[y1][x3].ready) + { + num_samples++; + (*render_func)(x + dx3, y + dy1, &c2, render_data); - block[y1][x3].ready = 1; - block[y1][x3].color = c2; - } else - c2 = block[y1][x3].color; + block[y1][x3].ready = 1; + block[y1][x3].color = c2; + } + else + { + c2 = block[y1][x3].color; + } - /* Render lower left sample */ + /* Render lower left sample */ - if (!block[y3][x1].ready) { - num_samples++; - (*render_func)(x + dx1, y + dy3, &c3, render_data); + if (!block[y3][x1].ready) + { + num_samples++; + (*render_func)(x + dx1, y + dy3, &c3, render_data); - block[y3][x1].ready = 1; - block[y3][x1].color = c3; - } else - c3 = block[y3][x1].color; + block[y3][x1].ready = 1; + block[y3][x1].color = c3; + } + else + { + c3 = block[y3][x1].color; + } - /* Render lower right sample */ + /* Render lower right sample */ - if (!block[y3][x3].ready) { - num_samples++; - (*render_func)(x + dx3, y + dy3, &c4, render_data); + if (!block[y3][x3].ready) + { + num_samples++; + (*render_func)(x + dx3, y + dy3, &c4, render_data); - block[y3][x3].ready = 1; - block[y3][x3].color = c4; - } else - c4 = block[y3][x3].color; + block[y3][x3].ready = 1; + block[y3][x3].color = c4; + } + else + { + c4 = block[y3][x3].color; + } - /* Check for supersampling */ + /* Check for supersampling */ - if (depth <= max_depth) { - /* Check whether we have tu supersample */ + if (depth <= max_depth) + { + /* Check whether we have tu supersample */ - if ((color_dist(c1, c2) >= threshold) || - (color_dist(c1, c3) >= threshold) || - (color_dist(c1, c4) >= threshold) || - (color_dist(c2, c3) >= threshold) || - (color_dist(c2, c4) >= threshold) || - (color_dist(c3, c4) >= threshold)) { - /* Calc coordinates of center subsample */ + if ((color_dist(c1, c2) >= threshold) || + (color_dist(c1, c3) >= threshold) || + (color_dist(c1, c4) >= threshold) || + (color_dist(c2, c3) >= threshold) || + (color_dist(c2, c4) >= threshold) || + (color_dist(c3, c4) >= threshold)) { + /* Calc coordinates of center subsample */ - x2 = (x1 + x3) / 2; - y2 = (y1 + y3) / 2; + x2 = (x1 + x3) / 2; + y2 = (y1 + y3) / 2; - /* Render sub-blocks */ + /* Render sub-blocks */ - num_samples += render_sub_pixel(max_depth, depth + 1, block, x, y, x1, y1, x2, y2, - threshold, sub_pixel_size, render_func, &c1, - render_data); + num_samples += render_sub_pixel (max_depth, depth + 1, block, x, y, x1, y1, x2, y2, + threshold, sub_pixel_size, render_func, &c1, + render_data); - num_samples += render_sub_pixel(max_depth, depth + 1, block, x, y, x2, y1, x3, y2, - threshold, sub_pixel_size, render_func, &c2, - render_data); + num_samples += render_sub_pixel(max_depth, depth + 1, block, x, y, x2, y1, x3, y2, + threshold, sub_pixel_size, render_func, &c2, + render_data); - num_samples += render_sub_pixel(max_depth, depth + 1, block, x, y, x1, y2, x2, y3, - threshold, sub_pixel_size, render_func, &c3, - render_data); + num_samples += render_sub_pixel(max_depth, depth + 1, block, x, y, x1, y2, x2, y3, + threshold, sub_pixel_size, render_func, &c3, + render_data); - num_samples += render_sub_pixel(max_depth, depth + 1, block, x, y, x2, y2, x3, y3, - threshold, sub_pixel_size, render_func, &c4, - render_data); - } /* if */ - } /* if */ + num_samples += render_sub_pixel(max_depth, depth + 1, block, x, y, x2, y2, x3, y3, + threshold, sub_pixel_size, render_func, &c4, + render_data); + } + } - color->r = 0.25 * (c1.r + c2.r + c3.r + c4.r); - color->g = 0.25 * (c1.g + c2.g + c3.g + c4.g); - color->b = 0.25 * (c1.b + c2.b + c3.b + c4.b); - color->a = 0.25 * (c1.a + c2.a + c3.a + c4.a); + color->r = 0.25 * (c1.r + c2.r + c3.r + c4.r); + color->g = 0.25 * (c1.g + c2.g + c3.g + c4.g); + color->b = 0.25 * (c1.b + c2.b + c3.b + c4.b); + color->a = 0.25 * (c1.a + c2.a + c3.a + c4.a); - return num_samples; -} /* render_sub_pixel */ + return num_samples; +} - -/*****/ - -static double -color_dist(color_t c1, color_t c2) +static gdouble +color_dist (color_t c1, + color_t c2) { - return fabs(c1.r - c2.r) + - fabs(c1.g - c2.g) + - fabs(c1.b - c2.b) + - fabs(c1.a - c2.a); -} /* color_dist */ + return (fabs (c1.r - c2.r) + + fabs (c1.g - c2.g) + + fabs (c1.b - c2.b) + + fabs (c1.a - c2.a)); +} diff --git a/app/asupsample.h b/app/asupsample.h index 121134a40c..0714065e9e 100644 --- a/app/asupsample.h +++ b/app/asupsample.h @@ -20,28 +20,37 @@ * */ - #ifndef __ASUPSAMPLE_H__ #define __ASUPSAMPLE_H__ -#include "gimpprogress.h" -/***** Types *****/ - -typedef struct { - double r, g, b, a; /* Range is [0, 1] */ +typedef struct +{ + gdouble r, g, b, a; /* Range is [0, 1] */ } color_t; -typedef void (*render_func_t) (double x, double y, color_t *color, void *render_data); -typedef void (*put_pixel_func_t) (int x, int y, color_t color, void *put_pixel_data); +typedef void (* render_func_t) (gdouble x, + gdouble y, + color_t *color, + gpointer render_data); +typedef void (* put_pixel_func_t) (gint x, + gint y, + color_t color, + gpointer put_pixel_data); -/***** Functions *****/ - -unsigned long adaptive_supersample_area(int x1, int y1, int x2, int y2, int max_depth, double threshold, - render_func_t render_func, void *render_data, - put_pixel_func_t put_pixel_func, void *put_pixel_data, - progress_func_t progress_func, void *progress_data); +gulong adaptive_supersample_area (gint x1, + gint y1, + gint x2, + gint y2, + gint max_depth, + gdouble threshold, + render_func_t render_func, + gpointer render_data, + put_pixel_func_t put_pixel_func, + gpointer put_pixel_data, + progress_func_t progress_func, + gpointer progress_data); -#endif +#endif /* __ASUPSAMPLE_H__ */ diff --git a/app/base/boundary.c b/app/base/boundary.c index 3fd9c06c3b..b0457a5bb6 100644 --- a/app/base/boundary.c +++ b/app/base/boundary.c @@ -27,7 +27,10 @@ #include "appenv.h" #include "errors.h" #include "boundary.h" +#include "pixel_region.h" #include "tile.h" +#include "tile_manager.h" + /* half intensity for mask */ #define HALF_WAY 127 diff --git a/app/base/brush-scale.c b/app/base/brush-scale.c index b1cd47fef2..8420939d4c 100644 --- a/app/base/brush-scale.c +++ b/app/base/brush-scale.c @@ -16,25 +16,31 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "config.h" + #include + +#include "apptypes.h" + #include "brush_scale.h" +#include "temp_buf.h" MaskBuf * brush_scale_mask (MaskBuf *brush_mask, - int dest_width, - int dest_height) + gint dest_width, + gint dest_height) { MaskBuf *scale_brush; - int src_width; - int src_height; - int value; - int area; - int i, j; - int x, x0, y, y0; - int dx, dx0, dy, dy0; - int fx, fx0, fy, fy0; - unsigned char *src, *dest; + gint src_width; + gint src_height; + gint value; + gint area; + gint i, j; + gint x, x0, y, y0; + gint dx, dx0, dy, dy0; + gint fx, fx0, fy, fy0; + guchar *src, *dest; g_return_val_if_fail (brush_mask != NULL && dest_width != 0 && dest_height != 0, NULL); @@ -174,20 +180,20 @@ brush_scale_mask (MaskBuf *brush_mask, MaskBuf * brush_scale_pixmap (MaskBuf *pixmap, - int dest_width, - int dest_height) + gint dest_width, + gint dest_height) { MaskBuf *scale_brush; - int src_width; - int src_height; - int value[3]; - int factor; - int area; - int i, j; - int x, x0, y, y0; - int dx, dx0, dy, dy0; - int fx, fx0, fy, fy0; - unsigned char *src, *src_ptr, *dest; + gint src_width; + gint src_height; + gint value[3]; + gint factor; + gint area; + gint i, j; + gint x, x0, y, y0; + gint dx, dx0, dy, dy0; + gint fx, fx0, fy, fy0; + guchar *src, *src_ptr, *dest; g_return_val_if_fail (pixmap != NULL && pixmap->bytes == 3 && dest_width != 0 && dest_height != 0, NULL); diff --git a/app/base/brush-scale.h b/app/base/brush-scale.h index c8c00f1dc7..3566a89f04 100644 --- a/app/base/brush-scale.h +++ b/app/base/brush-scale.h @@ -15,15 +15,18 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __BRUSH_SCALE_H__ #define __BRUSH_SCALE_H__ -#include "temp_buf.h" -/* functions */ +MaskBuf * brush_scale_mask (MaskBuf *brush_mask, + gint dest_width, + gint dest_height); +MaskBuf * brush_scale_pixmap (MaskBuf *pixmap, + gint dest_width, + gint dest_height); -MaskBuf * brush_scale_mask (MaskBuf *, int, int); -MaskBuf * brush_scale_pixmap (MaskBuf *, int, int); #endif /* __BRUSH_SCALE_H__ */ diff --git a/app/base/color-balance.c b/app/base/color-balance.c index 6eec211d82..b74246cfdc 100644 --- a/app/base/color-balance.c +++ b/app/base/color-balance.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include "apptypes.h" @@ -27,13 +27,18 @@ #include "color_transfer.h" #include "drawable.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimpui.h" #include "image_map.h" +#include "pixel_region.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpintl.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpcolorspace.h" + #define CYAN_RED 0x1 #define MAGENTA_GREEN 0x2 #define YELLOW_BLUE 0x4 @@ -212,7 +217,7 @@ color_balance_initialize (GDisplay *gdisp) { gint i; - if (! drawable_color (gimage_active_drawable (gdisp->gimage))) + if (! drawable_color (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Color balance operates only on RGB color drawables.")); return; @@ -232,7 +237,7 @@ color_balance_initialize (GDisplay *gdisp) color_balance_dialog->yellow_blue[i] = 0.0; } - color_balance_dialog->drawable = gimage_active_drawable (gdisp->gimage); + color_balance_dialog->drawable = gimp_image_active_drawable (gdisp->gimage); color_balance_dialog->image_map = image_map_create (gdisp, color_balance_dialog->drawable); diff --git a/app/base/color-balance.h b/app/base/color-balance.h index 72221fdae8..0f14e5fac4 100644 --- a/app/base/color-balance.h +++ b/app/base/color-balance.h @@ -20,9 +20,6 @@ #define __COLOR_BALANCE_H__ -#include "image_map.h" -#include "tools.h" - typedef enum { SHADOWS, diff --git a/app/base/curves.c b/app/base/curves.c index 692a2a8a71..7ba6f1ab76 100644 --- a/app/base/curves.c +++ b/app/base/curves.c @@ -26,18 +26,24 @@ #include "appenv.h" #include "cursorutil.h" +#include "curves.h" #include "drawable.h" #include "gdisplay.h" #include "gimphistogram.h" +#include "gimpimage.h" #include "gimpui.h" -#include "curves.h" #include "gimplut.h" +#include "image_map.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpenv.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" + #define GRAPH 0x1 #define XRANGE_TOP 0x2 #define XRANGE_BOTTOM 0x4 @@ -284,7 +290,7 @@ curves_button_press (Tool *tool, GimpDrawable *drawable; gdisp = gdisp_ptr; - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); tool->gdisp_ptr = gdisp; @@ -322,7 +328,7 @@ curves_button_release (Tool *tool, if(!curves_dialog || !gdisp || - !(drawable = gimage_active_drawable (gdisp->gimage))) + !(drawable = gimp_image_active_drawable (gdisp->gimage))) return; gdisplay_untransform_coords (gdisp, bevent->x, bevent->y, &x, &y, FALSE, FALSE); @@ -357,9 +363,9 @@ curves_motion (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; - if(!curves_dialog || - !gdisp || - !(drawable = gimage_active_drawable (gdisp->gimage))) + if (! curves_dialog || + ! gdisp || + ! (drawable = gimp_image_active_drawable (gdisp->gimage))) return; gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, FALSE, FALSE); @@ -443,7 +449,7 @@ curves_initialize (GDisplay *gdisp) { gint i, j; - if (drawable_indexed (gimage_active_drawable (gdisp->gimage))) + if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Curves for indexed drawables cannot be adjusted.")); return; @@ -466,7 +472,7 @@ curves_initialize (GDisplay *gdisp) curves_channel_reset (i); } - curves_dialog->drawable = gimage_active_drawable (gdisp->gimage); + curves_dialog->drawable = gimp_image_active_drawable (gdisp->gimage); curves_dialog->color = drawable_color (curves_dialog->drawable); curves_dialog->image_map = image_map_create (gdisp, curves_dialog->drawable); diff --git a/app/base/curves.h b/app/base/curves.h index 86daeefd40..d209de2d82 100644 --- a/app/base/curves.h +++ b/app/base/curves.h @@ -19,9 +19,6 @@ #ifndef __CURVES_H__ #define __CURVES_H__ -#include "image_map.h" -#include "lut_funcs.h" -#include "tools.h" #define SMOOTH 0 #define GFREE 1 @@ -63,16 +60,17 @@ struct _CurvesDialog GimpLut *lut; }; -Tool * tools_new_curves (void); -void tools_free_curves (Tool *tool); +Tool * tools_new_curves (void); +void tools_free_curves (Tool *tool); + +void curves_dialog_hide (void); +void curves_initialize (GDisplay *gdisp); +void curves_free (void); +gfloat curves_lut_func (CurvesDialog *cd, + gint nchannels, + gint channel, + gfloat value); +void curves_calculate_curve (CurvesDialog *cd); -void curves_dialog_hide (void); -void curves_initialize (GDisplay *gdisp); -void curves_free (void); -float curves_lut_func (CurvesDialog *cd, - gint nchannels, - gint channel, - gfloat value); -void curves_calculate_curve (CurvesDialog *cd); #endif /* __CURVES_H__ */ diff --git a/app/base/gimphistogram.c b/app/base/gimphistogram.c index 36240ce809..6def3a2093 100644 --- a/app/base/gimphistogram.c +++ b/app/base/gimphistogram.c @@ -24,16 +24,21 @@ #include #endif /* ENABLE_MP */ -#include +#include -#include +#include "apptypes.h" +#include "drawable.h" #include "gimphistogram.h" #include "pixel_region.h" #include "gimpdrawable.h" #include "channel.h" #include "gimpimage.h" #include "gimprc.h" +#include "pixel_processor.h" + +#include +#include struct _GimpHistogram diff --git a/app/base/gimphistogram.h b/app/base/gimphistogram.h index 83c0735e7f..073e5f4ec6 100644 --- a/app/base/gimphistogram.h +++ b/app/base/gimphistogram.h @@ -21,8 +21,6 @@ #ifndef __GIMP_HISTOGRAM_H__ #define __GIMP_HISTOGRAM_H__ -#include "pixel_region.h" -#include "gimpdrawable.h" typedef enum { diff --git a/app/base/gimplut.c b/app/base/gimplut.c index 62e90def8d..7bca4744db 100644 --- a/app/base/gimplut.c +++ b/app/base/gimplut.c @@ -27,67 +27,73 @@ #include "apptypes.h" #include "gimplut.h" +#include "pixel_region.h" GimpLut * -gimp_lut_new () +gimp_lut_new (void) { GimpLut *lut; - lut = g_new(GimpLut, 1); - lut->luts = NULL; + + lut = g_new (GimpLut, 1); + + lut->luts = NULL; lut->nchannels = 0; + return lut; } void gimp_lut_free (GimpLut *lut) { - int i; + gint i; + for (i = 0; i < lut->nchannels; i++) - g_free(lut->luts[i]); - if (lut->luts) - g_free(lut->luts); + g_free (lut->luts[i]); + g_free (lut->luts); } void gimp_lut_setup (GimpLut *lut, GimpLutFunc func, void *user_data, - int nchannels) + gint nchannels) { - int i, v; - double val; + gint i, v; + gdouble val; + if (lut->luts) - { - for (i = 0; i < lut->nchannels; i++) - g_free(lut->luts[i]); - g_free(lut->luts); - } - lut->nchannels = nchannels; - lut->luts = g_new(unsigned char*, lut->nchannels); - for (i = 0; i < lut->nchannels; i++) - { - lut->luts[i] = g_new(unsigned char, 256); - for (v = 0; v < 256; v++) - { /* to add gamma correction use func(v ^ g) ^ 1/g instead. */ - val = 255.0 * func(user_data, lut->nchannels, i, v/255.0) + 0.5; - if (val < 0.0) - lut->luts[i][v] = 0; - else if (val >= 255.0) - lut->luts[i][v] = 255; - else - lut->luts[i][v] = val; + { + for (i = 0; i < lut->nchannels; i++) + g_free (lut->luts[i]); + g_free (lut->luts); + } + lut->nchannels = nchannels; + lut->luts = g_new (guchar*, lut->nchannels); + + for (i = 0; i < lut->nchannels; i++) + { + lut->luts[i] = g_new (guchar, 256); + for (v = 0; v < 256; v++) + { /* to add gamma correction use func(v ^ g) ^ 1/g instead. */ + val = 255.0 * func (user_data, lut->nchannels, i, v/255.0) + 0.5; + if (val < 0.0) + lut->luts[i][v] = 0; + else if (val >= 255.0) + lut->luts[i][v] = 255; + else + lut->luts[i][v] = val; + } } - } } void gimp_lut_setup_exact (GimpLut *lut, GimpLutFunc func, void *user_data, - int nchannels) + gint nchannels) { - gimp_lut_setup(lut, func, user_data, nchannels); + gimp_lut_setup (lut, func, user_data, nchannels); } void @@ -95,9 +101,9 @@ gimp_lut_process (GimpLut *lut, PixelRegion *srcPR, PixelRegion *destPR) { - int h, width, src_r_i, dest_r_i; - unsigned char *src, *dest; - unsigned char *lut0 = NULL, *lut1 = NULL, *lut2 = NULL, *lut3 = NULL; + gint h, width, src_r_i, dest_r_i; + guchar *src, *dest; + guchar *lut0 = NULL, *lut1 = NULL, *lut2 = NULL, *lut3 = NULL; if (lut->nchannels > 0) lut0 = lut->luts[0]; @@ -116,68 +122,70 @@ gimp_lut_process (GimpLut *lut, dest_r_i = destPR->rowstride - (destPR->bytes * srcPR->w); if (src_r_i == 0 && dest_r_i == 0) - { - width *= h; - h = 1; - } - while (h--) - { - switch (lut->nchannels) { - case 1: - while (width--) - { - *dest = lut0[*src]; - src++; - dest++; - } - break; - case 2: - while (width--) - { - dest[0] = lut0[src[0]]; - dest[1] = lut1[src[1]]; - src += 2; - dest += 2; - } - break; - case 3: - while (width--) - { - dest[0] = lut0[src[0]]; - dest[1] = lut1[src[1]]; - dest[2] = lut2[src[2]]; - src += 3; - dest += 3; - } - break; - case 4: - while (width--) - { - dest[0] = lut0[src[0]]; - dest[1] = lut1[src[1]]; - dest[2] = lut2[src[2]]; - dest[3] = lut3[src[3]]; - src += 4; - dest += 4; - } - break; - default: - fprintf(stderr, "gimplut: Error: nchannels = %d\n", lut->nchannels); + width *= h; + h = 1; + } + + while (h--) + { + switch (lut->nchannels) + { + case 1: + while (width--) + { + *dest = lut0[*src]; + src++; + dest++; + } + break; + case 2: + while (width--) + { + dest[0] = lut0[src[0]]; + dest[1] = lut1[src[1]]; + src += 2; + dest += 2; + } + break; + case 3: + while (width--) + { + dest[0] = lut0[src[0]]; + dest[1] = lut1[src[1]]; + dest[2] = lut2[src[2]]; + src += 3; + dest += 3; + } + break; + case 4: + while (width--) + { + dest[0] = lut0[src[0]]; + dest[1] = lut1[src[1]]; + dest[2] = lut2[src[2]]; + dest[3] = lut3[src[3]]; + src += 4; + dest += 4; + } + break; + default: + g_warning ("gimplut: Error: nchannels = %d\n", lut->nchannels); + } + + width = srcPR->w; + src += src_r_i; + dest += dest_r_i; } - width = srcPR->w; - src += src_r_i; - dest += dest_r_i; - } } void gimp_lut_process_inline (GimpLut *lut, PixelRegion *srcPR) { - int h, width, src_r_i; - unsigned char *src; - unsigned char *lut0 = NULL, *lut1 = NULL, *lut2 = NULL, *lut3 = NULL; + gint h, width, src_r_i; + guchar *src; + guchar *lut0 = NULL, *lut1 = NULL, *lut2 = NULL, *lut3 = NULL; if (lut->nchannels > 0) lut0 = lut->luts[0]; @@ -194,54 +202,55 @@ gimp_lut_process_inline (GimpLut *lut, src_r_i = srcPR->rowstride - (srcPR->bytes * srcPR->w); if (src_r_i == 0) - { - width *= h; - h = 1; - } - while (h--) - { - switch (lut->nchannels) { - case 1: - while (width--) - { - *src = lut0[*src]; - src++; - } - break; - case 2: - while (width--) - { - src[0] = lut0[src[0]]; - src[1] = lut1[src[1]]; - src += 2; - } - break; - case 3: - while (width--) - { - src[0] = lut0[src[0]]; - src[1] = lut1[src[1]]; - src[2] = lut2[src[2]]; - src += 3; - } - break; - case 4: - while (width--) - { - src[0] = lut0[src[0]]; - src[1] = lut1[src[1]]; - src[2] = lut2[src[2]]; - src[3] = lut3[src[3]]; - src += 4; - } - break; - default: - fprintf(stderr, "gimplut: Error: nchannels = %d\n", lut->nchannels); + width *= h; + h = 1; + } + + while (h--) + { + switch (lut->nchannels) + { + case 1: + while (width--) + { + *src = lut0[*src]; + src++; + } + break; + case 2: + while (width--) + { + src[0] = lut0[src[0]]; + src[1] = lut1[src[1]]; + src += 2; + } + break; + case 3: + while (width--) + { + src[0] = lut0[src[0]]; + src[1] = lut1[src[1]]; + src[2] = lut2[src[2]]; + src += 3; + } + break; + case 4: + while (width--) + { + src[0] = lut0[src[0]]; + src[1] = lut1[src[1]]; + src[2] = lut2[src[2]]; + src[3] = lut3[src[3]]; + src += 4; + } + break; + default: + g_warning ("gimplut: Error: nchannels = %d\n", lut->nchannels); + } + width = srcPR->w; + src += src_r_i; } - width = srcPR->w; - src += src_r_i; - } } void @@ -249,5 +258,5 @@ gimp_lut_process_2 (PixelRegion *srcPR, PixelRegion *destPR, GimpLut *lut) { - gimp_lut_process(lut, srcPR, destPR); + gimp_lut_process (lut, srcPR, destPR); } diff --git a/app/base/gimplut.h b/app/base/gimplut.h index a8b206a5b4..24f31ccf2f 100644 --- a/app/base/gimplut.h +++ b/app/base/gimplut.h @@ -22,9 +22,6 @@ #define __GIMP_LUT_H__ -#include "pixel_region.h" - - struct _GimpLut { guchar **luts; diff --git a/app/base/hue-saturation.c b/app/base/hue-saturation.c index a02a97b84b..0caf2f0a6f 100644 --- a/app/base/hue-saturation.c +++ b/app/base/hue-saturation.c @@ -15,9 +15,10 @@ * 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 #include "apptypes.h" @@ -25,8 +26,13 @@ #include "drawable.h" #include "gimage_mask.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimpui.h" #include "hue_saturation.h" +#include "image_map.h" +#include "pixel_region.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpcolorspace.h" #include "libgimp/gimpmath.h" @@ -287,7 +293,7 @@ hue_saturation_initialize (GDisplay *gdisp) { gint i; - if (! drawable_color (gimage_active_drawable (gdisp->gimage))) + if (! drawable_color (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Hue-Saturation operates only on RGB color drawables.")); return; @@ -307,7 +313,7 @@ hue_saturation_initialize (GDisplay *gdisp) hue_saturation_dialog->saturation[i] = 0.0; } - hue_saturation_dialog->drawable = gimage_active_drawable (gdisp->gimage); + hue_saturation_dialog->drawable = gimp_image_active_drawable (gdisp->gimage); hue_saturation_dialog->image_map = image_map_create (gdisp, hue_saturation_dialog->drawable); diff --git a/app/base/hue-saturation.h b/app/base/hue-saturation.h index b796dba946..80ee176884 100644 --- a/app/base/hue-saturation.h +++ b/app/base/hue-saturation.h @@ -19,9 +19,6 @@ #ifndef __HUE_SATURATION_H__ #define __HUE_SATURATION_H__ -#include "image_map.h" -#include "tools.h" - typedef enum { @@ -57,16 +54,17 @@ struct _HueSaturationDialog gboolean preview; }; -Tool * tools_new_hue_saturation (void); -void tools_free_hue_saturation (Tool *tool); +Tool * tools_new_hue_saturation (void); +void tools_free_hue_saturation (Tool *tool); -void hue_saturation_initialize (GDisplay *gdisp); -void hue_saturation_free (void); -void hue_saturation_dialog_hide (void); -void hue_saturation (PixelRegion *srcPR, - PixelRegion *destPR, - void *data); +void hue_saturation_initialize (GDisplay *gdisp); +void hue_saturation_free (void); +void hue_saturation_dialog_hide (void); +void hue_saturation (PixelRegion *srcPR, + PixelRegion *destPR, + void *data); + +void hue_saturation_calculate_transfers (HueSaturationDialog *hsd); -void hue_saturation_calculate_transfers (HueSaturationDialog *hsd); #endif /* __HUE_SATURATION_H__ */ diff --git a/app/base/lut-funcs.c b/app/base/lut-funcs.c index dded28db1d..4251e64e1f 100644 --- a/app/base/lut-funcs.c +++ b/app/base/lut-funcs.c @@ -19,7 +19,6 @@ #include "config.h" #include -#include #include @@ -31,6 +30,7 @@ #include "libgimp/gimpmath.h" + /* ---------- Brightness/Contrast -----------*/ typedef struct B_C_struct diff --git a/app/base/pixel-processor.c b/app/base/pixel-processor.c index 9fe4693466..4600d478e2 100644 --- a/app/base/pixel-processor.c +++ b/app/base/pixel-processor.c @@ -20,45 +20,53 @@ #include "config.h" -#include "pixel_processor.h" -#include "pixel_region.h" -#include "gimprc.h" #include #include #include #ifdef ENABLE_MP - #include - #define IF_THREAD(statement) statement - #else /* !ENABLE_MP */ - #define IF_THREAD(statement) - #endif /* ENABLE_MP */ +#include + +#include + +#include "pixel_processor.h" +#include "pixel_region.h" +#include "gimprc.h" -typedef void (*p1_func)(void *, PixelRegion *); -typedef void (*p2_func)(void *, PixelRegion * ,PixelRegion *); -typedef void (*p3_func)(void *, PixelRegion * ,PixelRegion *, PixelRegion *); -typedef void (*p4_func)(void *, PixelRegion * ,PixelRegion *, PixelRegion *, - PixelRegion *); +typedef void (* p1_func) (gpointer , + PixelRegion *); +typedef void (* p2_func) (gpointer , + PixelRegion * , + PixelRegion *); +typedef void (* p3_func) (gpointer , + PixelRegion *, + PixelRegion *, + PixelRegion *); +typedef void (* p4_func) (gpointer , + PixelRegion *, + PixelRegion *, + PixelRegion *, + PixelRegion *); struct _PixelProcessor { - void *data; - p_func f; + gpointer data; + p_func f; PixelRegionIterator *PRI; IF_THREAD(pthread_mutex_t mutex;) - int nthreads; - int n_regions; - PixelRegion *r[4]; + gint nthreads; + gint n_regions; + PixelRegion *r[4]; - void *progress_report_data; - ProgressReportFunc progress_report_func; + void *progress_report_data; + ProgressReportFunc progress_report_func; }; IF_THREAD( diff --git a/app/base/pixel-processor.h b/app/base/pixel-processor.h index 96ff634d33..b1888c36b8 100644 --- a/app/base/pixel-processor.h +++ b/app/base/pixel-processor.h @@ -21,20 +21,31 @@ #ifndef __PIXEL_PROCESSOR_H__ #define __PIXEL_PROCESSOR_H__ + typedef struct _PixelProcessor PixelProcessor; -typedef void (*p_func)(void); -typedef int (*ProgressReportFunc)(void *, int, int, int, int); +typedef void (* p_func) (void); +typedef gint (* ProgressReportFunc) (void *, + gint, + gint, + gint, + gint); -void pixel_regions_process_parallel (p_func f, void *data, int num_regions, - ...); -PixelProcessor *pixel_process_progress (p_func f, void *data, - ProgressReportFunc progress_func, - void *progress_data, - int num_regions, ...); -void pixel_processor_free (PixelProcessor *); -void pixel_processor_stop (PixelProcessor *); -PixelProcessor *pixel_processor_cont (PixelProcessor *); +void pixel_regions_process_parallel (p_func f, + gpointer data, + gint num_regions, + ...); +PixelProcessor * pixel_process_progress (p_func f, + gpointer data, + ProgressReportFunc progress_func, + gpointer progress_data, + gint num_regions, + ...); + +void pixel_processor_free (PixelProcessor *); +void pixel_processor_stop (PixelProcessor *); +PixelProcessor * pixel_processor_cont (PixelProcessor *); + #endif /* __PIXEL_PROCESSOR_H__ */ diff --git a/app/base/pixel-region.c b/app/base/pixel-region.c index 32f9f34f0a..65d38e8a24 100644 --- a/app/base/pixel-region.c +++ b/app/base/pixel-region.c @@ -21,15 +21,17 @@ #include #include -#include +#include #include "apptypes.h" #include "appenv.h" +#include "gimpprogress.h" #include "gimprc.h" #include "pixel_region.h" +#include "tile_manager.h" #include "tile_manager_pvt.h" -#include "tile.h" /* ick. */ +#include "tile.h" /*********************/ diff --git a/app/base/pixel-region.h b/app/base/pixel-region.h index e35943d525..b34b197ec9 100644 --- a/app/base/pixel-region.h +++ b/app/base/pixel-region.h @@ -15,15 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __PIXEL_REGION_H__ #define __PIXEL_REGION_H__ -#include "tile_manager.h" -#include "pixel_processor.h" /* this is temporary, */ - - -typedef struct _PixelRegion PixelRegion; - struct _PixelRegion { guchar *data; /* pointer to region data */ @@ -41,9 +36,6 @@ struct _PixelRegion gint process_count; /* used internally */ }; - -typedef struct _PixelRegionHolder PixelRegionHolder; - struct _PixelRegionHolder { PixelRegion *PR; @@ -53,9 +45,6 @@ struct _PixelRegionHolder gint count; }; - -typedef struct _PixelRegionIterator PixelRegionIterator; - struct _PixelRegionIterator { GSList *pixel_regions; diff --git a/app/base/temp-buf.c b/app/base/temp-buf.c index aad23f369f..09ebdba2bb 100644 --- a/app/base/temp-buf.c +++ b/app/base/temp-buf.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include #include @@ -39,16 +39,20 @@ #include "appenv.h" #include "drawable.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimprc.h" #include "paint_funcs.h" +#include "pixel_region.h" #include "temp_buf.h" #include "libgimp/gimpcolorspace.h" static guchar * temp_buf_allocate (guint); -static void temp_buf_to_color (TempBuf *, TempBuf *); -static void temp_buf_to_gray (TempBuf *, TempBuf *); +static void temp_buf_to_color (TempBuf *, + TempBuf *); +static void temp_buf_to_gray (TempBuf *, + TempBuf *); /* Memory management */ diff --git a/app/base/temp-buf.h b/app/base/temp-buf.h index 2da2a83872..3e07e3480f 100644 --- a/app/base/temp-buf.h +++ b/app/base/temp-buf.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __TEMP_BUF_H__ #define __TEMP_BUF_H__ -typedef struct _TempBuf TempBuf; -typedef struct _TempBuf MaskBuf; struct _TempBuf { @@ -37,17 +36,34 @@ struct _TempBuf /* The temp buffer functions */ -TempBuf * temp_buf_new (gint, gint, gint, gint, gint, guchar *); -TempBuf * temp_buf_copy (TempBuf *, TempBuf *); -TempBuf * temp_buf_resize (TempBuf *, gint, gint, gint, gint, gint); -TempBuf * temp_buf_copy_area (TempBuf *, TempBuf *, - gint, gint, gint, gint, gint); +TempBuf * temp_buf_new (gint , + gint , + gint , + gint , + gint , + guchar *); +TempBuf * temp_buf_copy (TempBuf *, + TempBuf *); +TempBuf * temp_buf_resize (TempBuf *, + gint , + gint , + gint , + gint , + gint ); +TempBuf * temp_buf_copy_area (TempBuf *, + TempBuf *, + gint , + gint , + gint , + gint , + gint ); void temp_buf_free (TempBuf *); guchar * temp_buf_data (TempBuf *); /* The mask buffer functions */ -MaskBuf * mask_buf_new (gint, gint); +MaskBuf * mask_buf_new (gint , + gint ); void mask_buf_free (MaskBuf *); guchar * mask_buf_data (MaskBuf *); @@ -62,4 +78,5 @@ void temp_buf_swap_free (TempBuf *); void swapping_free (void); + #endif /* __TEMP_BUF_H__ */ diff --git a/app/base/threshold.c b/app/base/threshold.c index dbe84f3c7a..90d6cea647 100644 --- a/app/base/threshold.c +++ b/app/base/threshold.c @@ -18,15 +18,23 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" #include "drawable.h" #include "gdisplay.h" +#include "gimphistogram.h" +#include "gimpimage.h" #include "gimpui.h" +#include "histogramwidget.h" +#include "image_map.h" +#include "paint_funcs.h" +#include "pixel_region.h" #include "threshold.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpintl.h" @@ -212,7 +220,7 @@ tools_free_threshold (Tool *tool) void threshold_initialize (GDisplay *gdisp) { - if (drawable_indexed (gimage_active_drawable (gdisp->gimage))) + if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Threshold does not operate on indexed drawables.")); return; @@ -228,7 +236,7 @@ threshold_initialize (GDisplay *gdisp) threshold_dialog->low_threshold = 127; threshold_dialog->high_threshold = 255; - threshold_dialog->drawable = gimage_active_drawable (gdisp->gimage); + threshold_dialog->drawable = gimp_image_active_drawable (gdisp->gimage); threshold_dialog->color = drawable_color (threshold_dialog->drawable); threshold_dialog->image_map = image_map_create (gdisp, threshold_dialog->drawable); diff --git a/app/base/threshold.h b/app/base/threshold.h index 608c4f67a8..92f8934157 100644 --- a/app/base/threshold.h +++ b/app/base/threshold.h @@ -19,10 +19,6 @@ #ifndef __THRESHOLD_H__ #define __THRESHOLD_H__ -#include "image_map.h" -#include "histogramwidget.h" -#include "tools.h" - typedef struct _ThresholdDialog ThresholdDialog; @@ -46,14 +42,15 @@ struct _ThresholdDialog gboolean preview; }; -Tool * tools_new_threshold (void); -void tools_free_threshold (Tool *tool); + +Tool * tools_new_threshold (void); +void tools_free_threshold (Tool *tool); void threshold_dialog_hide (void); -void threshold_initialize (GDisplay *gdisp); -void threshold_2 (void *data, - PixelRegion *srcPR, - PixelRegion *destPR); +void threshold_initialize (GDisplay *gdisp); +void threshold_2 (gpointer data, + PixelRegion *srcPR, + PixelRegion *destPR); #endif /* __THRESHOLD_H__ */ diff --git a/app/base/tile-cache.c b/app/base/tile-cache.c index d2d0ef9168..42f6219807 100644 --- a/app/base/tile-cache.c +++ b/app/base/tile-cache.c @@ -1,16 +1,38 @@ -#include -#include -#include "gimprc.h" -#include "tile.h" -#include "tile_cache.h" -#include "tile_swap.h" +/* 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 #ifdef USE_PTHREADS #include #endif -#include "tile_pvt.h" /* ick. */ +#include + +#include "apptypes.h" + +#include "gimprc.h" +#include "tile.h" +#include "tile_cache.h" +#include "tile_swap.h" +#include "tile_pvt.h" -#include "stdio.h" /* This is the percentage of the maximum cache size that should be cleared * from the cache when an eviction is necessary diff --git a/app/base/tile-cache.h b/app/base/tile-cache.h index 12e86ec389..2f6b873207 100644 --- a/app/base/tile-cache.h +++ b/app/base/tile-cache.h @@ -1,13 +1,28 @@ +/* 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 __TILE_CACHE_H__ #define __TILE_CACHE_H__ -#include "tile.h" - - -void tile_cache_insert (Tile *tile); -void tile_cache_flush (Tile *tile); -void tile_cache_set_size (unsigned long cache_size); +void tile_cache_insert (Tile *tile); +void tile_cache_flush (Tile *tile); +void tile_cache_set_size (gulong cache_size); #endif /* __TILE_CACHE_H__ */ diff --git a/app/base/tile-manager-private.h b/app/base/tile-manager-private.h index 806e72a704..ba3e5c641c 100644 --- a/app/base/tile-manager-private.h +++ b/app/base/tile-manager-private.h @@ -15,27 +15,28 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __TILE_MANAGER_PVT_H__ #define __TILE_MANAGER_PVT_H__ -#include "tile.h" struct _TileManager { - int x, y; /* tile manager offsets */ + gint x, y; /* tile manager offsets */ - int width; /* the width of the tiled area */ - int height; /* the height of the tiled area */ - int bpp; /* the bpp of each tile */ + gint width; /* the width of the tiled area */ + gint height; /* the height of the tiled area */ + gint bpp; /* the bpp of each tile */ - int ntile_rows; /* the number of tiles in each row */ - int ntile_cols; /* the number of tiles in each columns */ + gint ntile_rows; /* the number of tiles in each row */ + gint ntile_cols; /* the number of tiles in each columns */ - Tile **tiles; /* the tiles for this level */ - TileValidateProc validate_proc; /* this proc is called when an attempt to get an - * invalid tile is made. - */ - void *user_data; /* hook for hanging data off of */ + Tile **tiles; /* the tiles for this level */ + TileValidateProc validate_proc; /* this proc is called when an attempt + * to get an invalid tile is made. + */ + + gpointer user_data; /* hook for hanging data off of */ }; diff --git a/app/base/tile-manager.c b/app/base/tile-manager.c index 0a8f1f7672..c7a8352d55 100644 --- a/app/base/tile-manager.c +++ b/app/base/tile-manager.c @@ -16,8 +16,14 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "config.h" + #include +#include + +#include "apptypes.h" + #include "tile_cache.h" #include "tile_manager.h" #include "tile_swap.h" @@ -26,33 +32,34 @@ #include "tile_pvt.h" /* ick. */ -static int tile_manager_get_tile_num (TileManager *tm, - int xpixel, - int ypixel); +static gint tile_manager_get_tile_num (TileManager *tm, + gint xpixel, + gint ypixel); -TileManager* -tile_manager_new (int toplevel_width, - int toplevel_height, - int bpp) +TileManager * +tile_manager_new (gint toplevel_width, + gint toplevel_height, + gint bpp) { TileManager *tm; - int width, height; + gint width; + gint height; tm = g_new (TileManager, 1); - tm->user_data = NULL; + tm->user_data = NULL; tm->validate_proc = NULL; - width = toplevel_width; + width = toplevel_width; height = toplevel_height; - tm->width = width; - tm->height = height; - tm->bpp = bpp; + tm->width = width; + tm->height = height; + tm->bpp = bpp; tm->ntile_rows = (height + TILE_HEIGHT - 1) / TILE_HEIGHT; - tm->ntile_cols = (width + TILE_WIDTH - 1) / TILE_WIDTH; - tm->tiles = NULL; + tm->ntile_cols = (width + TILE_WIDTH - 1) / TILE_WIDTH; + tm->tiles = NULL; return tm; } @@ -60,8 +67,8 @@ tile_manager_new (int toplevel_width, void tile_manager_destroy (TileManager *tm) { - int ntiles; - int i; + gint ntiles; + gint i; if (tm->tiles) { @@ -88,14 +95,14 @@ tile_manager_set_validate_proc (TileManager *tm, } -Tile* +Tile * tile_manager_get_tile (TileManager *tm, - int xpixel, - int ypixel, - int wantread, - int wantwrite) + gint xpixel, + gint ypixel, + gint wantread, + gint wantwrite) { - int tile_num; + gint tile_num; tile_num = tile_manager_get_tile_num (tm, xpixel, ypixel); if (tile_num < 0) @@ -104,19 +111,19 @@ tile_manager_get_tile (TileManager *tm, return tile_manager_get (tm, tile_num, wantread, wantwrite); } -Tile* +Tile * tile_manager_get (TileManager *tm, - int tile_num, - int wantread, - int wantwrite) + gint tile_num, + gint wantread, + gint wantwrite) { Tile **tiles; Tile **tile_ptr; - int ntiles; - int nrows, ncols; - int right_tile; - int bottom_tile; - int i, j, k; + gint ntiles; + gint nrows, ncols; + gint right_tile; + gint bottom_tile; + gint i, j, k; ntiles = tm->ntile_rows * tm->ntile_cols; @@ -125,13 +132,13 @@ tile_manager_get (TileManager *tm, if (!tm->tiles) { - tm->tiles = g_new (Tile*, ntiles); + tm->tiles = g_new (Tile *, ntiles); tiles = tm->tiles; nrows = tm->ntile_rows; ncols = tm->ntile_cols; - right_tile = tm->width - ((ncols - 1) * TILE_WIDTH); + right_tile = tm->width - ((ncols - 1) * TILE_WIDTH); bottom_tile = tm->height - ((nrows - 1) * TILE_HEIGHT); for (i = 0, k = 0; i < nrows; i++) @@ -229,11 +236,11 @@ tile_manager_get (TileManager *tm, void tile_manager_get_async (TileManager *tm, - int xpixel, - int ypixel) + gint xpixel, + gint ypixel) { Tile *tile_ptr; - int tile_num; + gint tile_num; tile_num = tile_manager_get_tile_num (tm, xpixel, ypixel); if (tile_num < 0) @@ -269,9 +276,9 @@ void tile_manager_invalidate_tiles (TileManager *tm, Tile *toplevel_tile) { - double x, y; - int row, col; - int num; + gdouble x, y; + gint row, col; + gint num; col = toplevel_tile->tlink->tile_num % tm->ntile_cols; row = toplevel_tile->tlink->tile_num / tm->ntile_cols; @@ -290,26 +297,31 @@ tile_manager_invalidate_tiles (TileManager *tm, void -tile_invalidate_tile (Tile **tile_ptr, TileManager *tm, - int xpixel, int ypixel) +tile_invalidate_tile (Tile **tile_ptr, + TileManager *tm, + gint xpixel, + gint ypixel) { - int tile_num; + gint tile_num; tile_num = tile_manager_get_tile_num (tm, xpixel, ypixel); - if (tile_num < 0) return; + if (tile_num < 0) + return; tile_invalidate (tile_ptr, tm, tile_num); } void -tile_invalidate (Tile **tile_ptr, TileManager *tm, int tile_num) +tile_invalidate (Tile **tile_ptr, + TileManager *tm, + gint tile_num) { Tile *tile = *tile_ptr; TILE_MUTEX_LOCK (tile); - if (!tile->valid) + if (!tile->valid) goto leave; if (tile->share_count > 1) @@ -350,13 +362,13 @@ leave: void tile_manager_map_tile (TileManager *tm, - int xpixel, - int ypixel, + gint xpixel, + gint ypixel, Tile *srctile) { - int tile_row; - int tile_col; - int tile_num; + gint tile_row; + gint tile_col; + gint tile_num; if ((xpixel < 0) || (xpixel >= tm->width) || (ypixel < 0) || (ypixel >= tm->height)) @@ -374,16 +386,16 @@ tile_manager_map_tile (TileManager *tm, void tile_manager_map (TileManager *tm, - int tile_num, + gint tile_num, Tile *srctile) { Tile **tiles; Tile **tile_ptr; - int ntiles; - int nrows, ncols; - int right_tile; - int bottom_tile; - int i, j, k; + gint ntiles; + gint nrows, ncols; + gint right_tile; + gint bottom_tile; + gint i, j, k; ntiles = tm->ntile_rows * tm->ntile_cols; @@ -397,13 +409,13 @@ tile_manager_map (TileManager *tm, { g_warning ("tile_manager_map: empty tile level - init'ing."); - tm->tiles = g_new (Tile*, ntiles); + tm->tiles = g_new (Tile *, ntiles); tiles = tm->tiles; nrows = tm->ntile_rows; ncols = tm->ntile_cols; - right_tile = tm->width - ((ncols - 1) * TILE_WIDTH); + right_tile = tm->width - ((ncols - 1) * TILE_WIDTH); bottom_tile = tm->height - ((nrows - 1) * TILE_HEIGHT); for (i = 0, k = 0; i < nrows; i++) @@ -437,10 +449,11 @@ tile_manager_map (TileManager *tm, TILE_MUTEX_LOCK (*tile_ptr); if ((*tile_ptr)->ewidth != srctile->ewidth || (*tile_ptr)->eheight != srctile->eheight || - (*tile_ptr)->bpp != srctile->bpp) { - g_warning ("tile_manager_map: nonconformant map (%p -> %p)", - srctile, *tile_ptr); - } + (*tile_ptr)->bpp != srctile->bpp) + { + g_warning ("tile_manager_map: nonconformant map (%p -> %p)", + srctile, *tile_ptr); + } tile_detach (*tile_ptr, tm, tile_num); @@ -460,12 +473,12 @@ tile_manager_map (TileManager *tm, static int tile_manager_get_tile_num (TileManager *tm, - int xpixel, - int ypixel) + gint xpixel, + gint ypixel) { - int tile_row; - int tile_col; - int tile_num; + gint tile_row; + gint tile_col; + gint tile_num; if ((xpixel < 0) || (xpixel >= tm->width) || (ypixel < 0) || (ypixel >= tm->height)) @@ -480,37 +493,40 @@ tile_manager_get_tile_num (TileManager *tm, void tile_manager_set_user_data (TileManager *tm, - void *user_data) + gpointer user_data) { tm->user_data = user_data; } -void * -tile_manager_get_user_data (TileManager *tm) +gpointer +tile_manager_get_user_data (const TileManager *tm) { return tm->user_data; } int -tile_manager_level_width (TileManager *tm) +tile_manager_level_width (const TileManager *tm) { return tm->width; } int -tile_manager_level_height (TileManager *tm) +tile_manager_level_height (const TileManager *tm) { return tm->height; } int -tile_manager_level_bpp (TileManager *tm) +tile_manager_level_bpp (const TileManager *tm) { return tm->bpp; } void -tile_manager_get_tile_coordinates (TileManager *tm, Tile *tile, int *x, int *y) +tile_manager_get_tile_coordinates (TileManager *tm, + Tile *tile, + gint *x, + gint *y) { TileLink *tl; @@ -531,7 +547,9 @@ tile_manager_get_tile_coordinates (TileManager *tm, Tile *tile, int *x, int *y) void -tile_manager_map_over_tile (TileManager *tm, Tile *tile, Tile *srctile) +tile_manager_map_over_tile (TileManager *tm, + Tile *tile, + Tile *srctile) { TileLink *tl; @@ -548,7 +566,3 @@ tile_manager_map_over_tile (TileManager *tm, Tile *tile, Tile *srctile) tile_manager_map (tm, tl->tile_num, srctile); } - - - - diff --git a/app/base/tile-manager.h b/app/base/tile-manager.h index 379f6a18d4..ab550a217d 100644 --- a/app/base/tile-manager.h +++ b/app/base/tile-manager.h @@ -15,19 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __TILE_MANAGER_H__ #define __TILE_MANAGER_H__ -#include "tile.h" - - -typedef struct _TileManager TileManager; - -typedef void (*TileValidateProc) (TileManager *tm, - Tile *tile); - - /* Creates a new tile manager with the specified * width for the toplevel. The toplevel sizes is * used to compute the number of levels and there @@ -37,13 +29,13 @@ typedef void (*TileValidateProc) (TileManager *tm, * hierarchy is "nlevels - 1". That level will be smaller * than TILE_WIDTH x TILE_HEIGHT */ -TileManager* tile_manager_new (int toplevel_width, - int toplevel_height, - int bpp); +TileManager * tile_manager_new (gint toplevel_width, + gint toplevel_height, + gint bpp); /* Destroy a tile manager and all the tiles it contains. */ -void tile_manager_destroy (TileManager *tm); +void tile_manager_destroy (TileManager *tm); /* Set the validate procedure for the tile manager. * The validate procedure is called when an invalid tile @@ -51,70 +43,76 @@ void tile_manager_destroy (TileManager *tm); * is set to valid and its memory is allocated, but * not initialized. */ -void tile_manager_set_validate_proc (TileManager *tm, - TileValidateProc proc); +void tile_manager_set_validate_proc (TileManager *tm, + TileValidateProc proc); /* Get a specified tile from a tile manager. */ -Tile* tile_manager_get_tile (TileManager *tm, - int xpixel, - int ypixel, - int wantread, - int wantwrite); +Tile * tile_manager_get_tile (TileManager *tm, + gint xpixel, + gint ypixel, + gint wantread, + gint wantwrite); /* Get a specified tile from a tile manager. */ -Tile* tile_manager_get (TileManager *tm, - int tile_num, - int wantread, - int wantwrite); +Tile * tile_manager_get (TileManager *tm, + gint tile_num, + gint wantread, + gint wantwrite); /* Request that (if possible) the tile at x,y be swapped * in. This is only a hint to improve performance; no guarantees. * The tile may be swapped in or otherwise made more accessible * if it is convenient... */ -void tile_manager_get_async (TileManager *tm, - int xpixel, - int ypixel); +void tile_manager_get_async (TileManager *tm, + gint xpixel, + gint ypixel); -void tile_manager_map_tile (TileManager *tm, - int xpixel, - int ypixel, - Tile *srctile); +void tile_manager_map_tile (TileManager *tm, + gint xpixel, + gint ypixel, + Tile *srctile); -void tile_manager_map (TileManager *tm, - int time_num, - Tile *srctile); +void tile_manager_map (TileManager *tm, + gint time_num, + Tile *srctile); /* Validate a tiles memory. */ -void tile_manager_validate (TileManager *tm, - Tile *tile); +void tile_manager_validate (TileManager *tm, + Tile *tile); -void tile_invalidate (Tile **tile_ptr, TileManager *tm, int tile_num); -void tile_invalidate_tile (Tile **tile_ptr, TileManager *tm, - int xpixel, int ypixel); +void tile_invalidate (Tile **tile_ptr, + TileManager *tm, + gint tile_num); +void tile_invalidate_tile (Tile **tile_ptr, + TileManager *tm, + gint xpixel, + gint ypixel); /* Given a toplevel tile, this procedure will invalidate * (set the dirty bit) for this toplevel tile. */ -void tile_manager_invalidate_tiles (TileManager *tm, - Tile *toplevel_tile); +void tile_manager_invalidate_tiles (TileManager *tm, + Tile *toplevel_tile); -void tile_manager_set_user_data (TileManager *tm, - void *user_data); +void tile_manager_set_user_data (TileManager *tm, + gpointer user_data); +gpointer tile_manager_get_user_data (const TileManager *tm); -void *tile_manager_get_user_data (TileManager *tm); +gint tile_manager_level_width (const TileManager *tm); +gint tile_manager_level_height (const TileManager *tm); +gint tile_manager_level_bpp (const TileManager *tm); -int tile_manager_level_width (TileManager *tm); -int tile_manager_level_height (TileManager *tm); -int tile_manager_level_bpp (TileManager *tm); - -void tile_manager_get_tile_coordinates (TileManager *tm, Tile *tile, - int *x, int *y); - -void tile_manager_map_over_tile (TileManager *tm, Tile *tile, Tile *srctile); +void tile_manager_get_tile_coordinates (TileManager *tm, + Tile *tile, + gint *x, + gint *y); +void tile_manager_map_over_tile (TileManager *tm, + Tile *tile, + Tile *srctile); #endif /* __TILE_MANAGER_H__ */ diff --git a/app/base/tile-private.h b/app/base/tile-private.h index 16fdc0aca8..0445806462 100644 --- a/app/base/tile-private.h +++ b/app/base/tile-private.h @@ -1,11 +1,11 @@ #ifndef __TILE_PVT_H__ #define __TILE_PVT_H__ + #ifdef USE_PTHREADS #include #endif - #include #include @@ -27,26 +27,26 @@ struct _TileLink struct _Tile { - short ref_count; /* reference count. when the reference count is + gshort ref_count; /* reference count. when the reference count is * non-zero then the "data" for this tile must * be valid. when the reference count for a tile * is 0 then the "data" for this tile must be * NULL. */ - short write_count; /* write count: number of references that are + gshort write_count; /* write count: number of references that are for write access */ - short share_count; /* share count: number of tile managers that + gshort share_count; /* share count: number of tile managers that hold this tile */ guint dirty : 1; /* is the tile dirty? has it been modified? */ guint valid : 1; /* is the tile valid? */ - unsigned char bpp; /* the bytes per pixel (1, 2, 3 or 4) */ - unsigned short ewidth; /* the effective width of the tile */ - unsigned short eheight; /* the effective height of the tile */ - /* a tile's effective width and height may be smaller - * (but not larger) than TILE_WIDTH and TILE_HEIGHT. - * this is to handle edge tiles of a drawable. - */ + guchar bpp; /* the bytes per pixel (1, 2, 3 or 4) */ + gushort ewidth; /* the effective width of the tile */ + gushort eheight; /* the effective height of the tile + * a tile's effective width and height may be smaller + * (but not larger) than TILE_WIDTH and TILE_HEIGHT. + * this is to handle edge tiles of a drawable. + */ TileRowHint *rowhint; /* An array of hints for rendering purposes */ @@ -54,24 +54,26 @@ struct _Tile * case the tile data is on disk. */ - int swap_num; /* the index into the file table of the file to be used - * for swapping. swap_num 1 is always the global swap file. - */ + gint swap_num; /* the index into the file table of the file to be used + * for swapping. swap_num 1 is always the global + * swap file. + */ off_t swap_offset; /* the offset within the swap file of the tile data. - * if the tile data is in memory this will be set to -1. + * if the tile data is in memory this will be set to -1. */ TileLink *tlink; - Tile *next; - Tile *prev; /* List pointers for the tile cache lists */ - void *listhead; /* Pointer to the head of the list this tile is on */ + Tile *next; + Tile *prev; /* List pointers for the tile cache lists */ + gpointer listhead; /* Pointer to the head of the list this tile is on */ + #ifdef USE_PTHREADS pthread_mutex_t mutex; #endif }; #ifdef USE_PTHREADS -#define TILE_MUTEX_LOCK(tile) pthread_mutex_lock(&((tile)->mutex)) +#define TILE_MUTEX_LOCK(tile) pthread_mutex_lock(&((tile)->mutex)) #define TILE_MUTEX_UNLOCK(tile) pthread_mutex_unlock(&((tile)->mutex)) #else #define TILE_MUTEX_LOCK(tile) /* nothing */ diff --git a/app/base/tile-swap.c b/app/base/tile-swap.c index d6ca029dbe..af86ef910d 100644 --- a/app/base/tile-swap.c +++ b/app/base/tile-swap.c @@ -1,6 +1,24 @@ +/* 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 #include #include @@ -26,12 +44,14 @@ #define _O_TEMPORARY 0 #endif -#define MAX_OPEN_SWAP_FILES 16 +#include "apptypes.h" #include "tile.h" #include "tile_swap.h" #include "tile_pvt.h" /* ick. */ +#define MAX_OPEN_SWAP_FILES 16 + typedef struct _SwapFile SwapFile; typedef struct _DefSwapFile DefSwapFile; typedef struct _Gap Gap; diff --git a/app/base/tile-swap.h b/app/base/tile-swap.h index 5b30e6ec11..68ef479e0d 100644 --- a/app/base/tile-swap.h +++ b/app/base/tile-swap.h @@ -1,11 +1,27 @@ +/* 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 __TILE_SWAP_H__ #define __TILE_SWAP_H__ -#include "tile.h" - - -typedef enum { +typedef enum +{ SWAP_IN = 1, SWAP_IN_ASYNC, SWAP_OUT, @@ -13,22 +29,22 @@ typedef enum { SWAP_COMPRESS } SwapCommand; -typedef int (*SwapFunc) (int fd, - Tile *tile, - int cmd, - gpointer user_data); +typedef gint (*SwapFunc) (gint fd, + Tile *tile, + gint cmd, + gpointer user_data); -void tile_swap_exit (void); -int tile_swap_add (char *filename, - SwapFunc swap_func, - gpointer user_data); -void tile_swap_remove (int swap_num); -void tile_swap_in (Tile *tile); -void tile_swap_in_async (Tile *tile); -void tile_swap_out (Tile *tile); -void tile_swap_delete (Tile *tile); -void tile_swap_compress (int swap_num); +void tile_swap_exit (void); +gint tile_swap_add (gchar *filename, + SwapFunc swap_func, + gpointer user_data); +void tile_swap_remove (gint swap_num); +void tile_swap_in (Tile *tile); +void tile_swap_in_async (Tile *tile); +void tile_swap_out (Tile *tile); +void tile_swap_delete (Tile *tile); +void tile_swap_compress (gint swap_num); #endif /* __TILE_SWAP_H__ */ diff --git a/app/base/tile.c b/app/base/tile.c index 3e63aecff9..64fd8bf5b7 100644 --- a/app/base/tile.c +++ b/app/base/tile.c @@ -1,5 +1,29 @@ +/* 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 + +#include + #include "tile.h" #include "tile_pvt.h" #include "tile_cache.h" @@ -14,7 +38,7 @@ int tile_count = 0; void tile_sanitize_rowhints (Tile *tile) { - int height, y; + gint height, y; /* If tile has rowhints array already, do nothing. */ if (tile->rowhint) @@ -31,7 +55,8 @@ tile_sanitize_rowhints (Tile *tile) } TileRowHint -tile_get_rowhint (Tile *tile, int yoff) +tile_get_rowhint (Tile *tile, + gint yoff) { #ifdef HINTS_SANITY if (yoff < tile_eheight(tile) && yoff>=0) @@ -47,7 +72,9 @@ tile_get_rowhint (Tile *tile, int yoff) } void -tile_set_rowhint (Tile *tile, int yoff, TileRowHint rowhint) +tile_set_rowhint (Tile *tile, + gint yoff, + TileRowHint rowhint) { #ifdef HINTS_SANITY if (yoff < tile_eheight(tile) && yoff>=0) @@ -63,23 +90,24 @@ tile_set_rowhint (Tile *tile, int yoff, TileRowHint rowhint) void tile_init (Tile *tile, - int bpp) + gint bpp) { - tile->ref_count = 0; + tile->ref_count = 0; tile->write_count = 0; tile->share_count = 0; - tile->dirty = FALSE; - tile->valid = FALSE; - tile->data = NULL; - tile->ewidth = TILE_WIDTH; - tile->eheight = TILE_HEIGHT; - tile->bpp = bpp; - tile->swap_num = 1; + tile->dirty = FALSE; + tile->valid = FALSE; + tile->data = NULL; + tile->ewidth = TILE_WIDTH; + tile->eheight = TILE_HEIGHT; + tile->bpp = bpp; + tile->swap_num = 1; tile->swap_offset = -1; - tile->tlink = NULL; - tile->next = tile->prev = NULL; - tile->listhead = NULL; - tile->rowhint = NULL; + tile->tlink = NULL; + tile->next = NULL; + tile->prev = NULL; + tile->listhead = NULL; + tile->rowhint = NULL; #ifdef USE_PTHREADS { diff --git a/app/base/tile.h b/app/base/tile.h index 651782a487..9a1bab5dea 100644 --- a/app/base/tile.h +++ b/app/base/tile.h @@ -1,3 +1,21 @@ +/* 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 __TILE_H__ #define __TILE_H__ @@ -12,18 +30,12 @@ /* sanity checking on new tile hinting code */ /* #define HINTS_SANITY */ -#include -#include - -#include "config.h" - -typedef struct _Tile Tile; - /* explicit guchar type rather than enum since gcc chooses an int * representation but arrays of TileRowHints are quite space-critical * in GIMP. */ typedef guchar TileRowHint; + #define TILEROWHINT_BROKEN 0 #define TILEROWHINT_OPAQUE 1 #define TILEROWHINT_TRANSPARENT 2 @@ -35,8 +47,8 @@ typedef guchar TileRowHint; /* Initializes the fields of a tile to "good" values. */ -void tile_init (Tile *tile, - int bpp); +void tile_init (Tile *tile, + gint bpp); /* @@ -48,31 +60,37 @@ void tile_init (Tile *tile, * write access. (This is a hack, and should be handled better.) */ -void tile_lock (Tile *); -void tile_release (Tile *, int); +void tile_lock (Tile *tile); +void tile_release (Tile *tile, + gint); /* Allocate the data for the tile. */ -void tile_alloc (Tile *tile); +void tile_alloc (Tile *tile); /* Return the size in bytes of the tiles data. */ -int tile_size (Tile *tile); +gint tile_size (Tile *tile); -int tile_ewidth (Tile *tile); -int tile_eheight (Tile *tile); -int tile_bpp (Tile *tile); +gint tile_ewidth (Tile *tile); +gint tile_eheight (Tile *tile); +gint tile_bpp (Tile *tile); -int tile_is_valid (Tile *tile); +gint tile_is_valid (Tile *tile); -void tile_mark_valid (Tile *tile); +void tile_mark_valid (Tile *tile); /* DOCUMENT ME -- adm */ -TileRowHint tile_get_rowhint (Tile *tile, int yoff); -void tile_set_rowhint (Tile *tile, int yoff, TileRowHint rowhint); -void tile_sanitize_rowhints (Tile *tile); +TileRowHint tile_get_rowhint (Tile *tile, + gint yoff); +void tile_set_rowhint (Tile *tile, + gint yoff, + TileRowHint rowhint); +void tile_sanitize_rowhints (Tile *tile); -void *tile_data_pointer (Tile *tile, int xoff, int yoff); +void * tile_data_pointer (Tile *tile, + gint xoff, + gint yoff); /* tile_attach attaches a tile to a tile manager: this function * increments the tile's share count and inserts a tilelink into the @@ -81,8 +99,12 @@ void *tile_data_pointer (Tile *tile, int xoff, int yoff); * discarded. */ -void tile_attach (Tile *tile, void *tm, int tile_num); -void tile_detach (Tile *tile, void *tm, int tile_num); +void tile_attach (Tile *tile, + void *tm, + gint tile_num); +void tile_detach (Tile *tile, + void *tm, + gint tile_num); #endif /* __TILE_H__ */ diff --git a/app/bezier_select.c b/app/bezier_select.c index 2440f19004..b29fb669c3 100644 --- a/app/bezier_select.c +++ b/app/bezier_select.c @@ -24,17 +24,25 @@ #include "apptypes.h" +#include "channel.h" #include "cursorutil.h" #include "draw_core.h" +#include "drawable.h" #include "edit_selection.h" #include "errors.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimage_mask.h" +#include "gimpcontext.h" #include "rect_select.h" #include "bezier_select.h" #include "bezier_selectP.h" #include "paths_dialogP.h" +#include "pixel_region.h" +#include "procedural_db.h" #include "selection_options.h" +#include "tools.h" +#include "tool_options.h" #include "undo.h" #include "libgimp/gimpmath.h" @@ -972,7 +980,7 @@ bezier_select_button_press (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; - tool->drawable = gimage_active_drawable (gdisp->gimage); + tool->drawable = gimp_image_active_drawable (gdisp->gimage); bezier_sel = tool->private; grab_pointer = FALSE; @@ -1020,7 +1028,7 @@ bezier_select_button_press (Tool *tool, /* break; */ /* } */ /* else if (!(bevent->state & GDK_SHIFT_MASK) && !(bevent->state & GDK_CONTROL_MASK)) */ -/* if (! (layer_is_floating_sel (gimage_get_active_layer (gdisp->gimage))) && */ +/* if (! (layer_is_floating_sel (gimp_image_get_active_layer (gdisp->gimage))) && */ /* gdisplay_mask_value (gdisp, bevent->x, bevent->y) > HALF_WAY) */ /* { */ /* init_edit_selection (tool, gdisp_ptr, bevent, EDIT_MASK_TO_LAYER_TRANSLATE); */ @@ -1249,16 +1257,16 @@ bezier_select_button_press (Tool *tool, if ((bevent->state & GDK_SHIFT_MASK) && !(bevent->state & GDK_CONTROL_MASK)) - op = ADD; + op = CHANNEL_OP_ADD; else if ((bevent->state & GDK_CONTROL_MASK) && !(bevent->state & GDK_SHIFT_MASK)) - op = SUB; + op = CHANNEL_OP_SUB; else if ((bevent->state & GDK_CONTROL_MASK) && (bevent->state & GDK_SHIFT_MASK)) - op = INTERSECT; + op = CHANNEL_OP_INTERSECT; else { - op = ADD; + op = CHANNEL_OP_ADD; replace = TRUE; } @@ -2514,10 +2522,13 @@ bezier_convert (BezierSelect *bezier_sel, points = next_curve; } while (next_curve); - pixel_region_init (&maskPR, drawable_data (GIMP_DRAWABLE(bezier_sel->mask)), + pixel_region_init (&maskPR, + gimp_drawable_data (GIMP_DRAWABLE (bezier_sel->mask)), 0, 0, - drawable_width (GIMP_DRAWABLE(bezier_sel->mask)), - drawable_height (GIMP_DRAWABLE(bezier_sel->mask)), TRUE); + gimp_drawable_width (GIMP_DRAWABLE (bezier_sel->mask)), + gimp_drawable_height (GIMP_DRAWABLE (bezier_sel->mask)), + TRUE); + for (i = 0; i < height; i++) { list = bezier_sel->scanlines[i]; @@ -2567,7 +2578,7 @@ bezier_convert (BezierSelect *bezier_sel, } pixel_region_set_row (&maskPR, 0, (i / SUPERSAMPLE), - drawable_width (GIMP_DRAWABLE(bezier_sel->mask)), buf); + gimp_drawable_width (GIMP_DRAWABLE (bezier_sel->mask)), buf); } g_slist_free (bezier_sel->scanlines[i]); @@ -2794,7 +2805,7 @@ bezier_paste_bezierselect_to_current(GDisplay *gdisp,BezierSelect *bsel) gimp_context_set_tool (gimp_context_get_user (), BEZIER_SELECT); active_tool->paused_count = 0; active_tool->gdisp_ptr = gdisp; - active_tool->drawable = gimage_active_drawable (gdisp->gimage); + active_tool->drawable = gimp_image_active_drawable (gdisp->gimage); tool = active_tool; @@ -2894,12 +2905,12 @@ bezier_to_sel_internal(BezierSelect *bezier_sel, if (bezier_options->feather) channel_feather (bezier_sel->mask, - gimage_get_mask (gdisp->gimage), + gimp_image_get_mask (gdisp->gimage), bezier_options->feather_radius, bezier_options->feather_radius, op, 0, 0); else - channel_combine_mask (gimage_get_mask (gdisp->gimage), + channel_combine_mask (gimp_image_get_mask (gdisp->gimage), bezier_sel->mask, op, 0, 0); /* show selection on all views */ @@ -3167,7 +3178,7 @@ bezier_to_selection (BezierSelect *bezier_sel, * This loads it into curSel for this image */ bezier_paste_bezierselect_to_current (gdisp, bezier_sel); - bezier_to_sel_internal (curSel, curTool, gdisp, ADD, TRUE); + bezier_to_sel_internal (curSel, curTool, gdisp, CHANNEL_OP_ADD, TRUE); } /* unused @@ -3456,7 +3467,7 @@ bezier_stroke (BezierSelect *bezier_sel, gint offset_x, offset_y; gdouble *ptr; - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); gimp_drawable_offsets (drawable, &offset_x, &offset_y); ptr = rpnts->stroke_points; diff --git a/app/bezier_select.h b/app/bezier_select.h index e34cdecb5e..6ec0e61cc8 100644 --- a/app/bezier_select.h +++ b/app/bezier_select.h @@ -19,16 +19,11 @@ #ifndef __BEZIER_SELECT_H__ #define __BEZIER_SELECT_H__ -#include "toolsF.h" - -typedef struct _BezierPoint BezierPoint; -typedef struct _BezierSelect BezierSelect; - -/* bezier select functions */ Tool * tools_new_bezier_select (void); void tools_free_bezier_select (Tool *tool); gboolean bezier_tool_selected (void); + #endif /* __BEZIER_SELECT_H__ */ diff --git a/app/blend.c b/app/blend.c index 1f47c174e6..ebb5915c43 100644 --- a/app/blend.c +++ b/app/blend.c @@ -33,16 +33,22 @@ #include "errors.h" #include "fuzzy_select.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimage_mask.h" +#include "gimpcontext.h" #include "gimpdnd.h" +#include "gimpprogress.h" #include "gimpui.h" #include "gradient.h" +#include "paint_funcs.h" #include "paint_options.h" +#include "pixel_region.h" #include "selection.h" #include "tools.h" #include "undo.h" #include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpcolorspace.h" #include "libgimp/gimpmath.h" @@ -434,7 +440,7 @@ blend_button_press (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; blend_tool = (BlendTool *) tool->private; - switch (drawable_type (gimage_active_drawable (gdisp->gimage))) + switch (drawable_type (gimp_image_active_drawable (gdisp->gimage))) { case INDEXED_GIMAGE: case INDEXEDA_GIMAGE: g_message (_("Blend: Invalid for indexed images.")); @@ -506,7 +512,7 @@ blend_button_release (Tool *tool, return_vals = procedural_db_run_proc ("gimp_blend", &nreturn_vals, - PDB_DRAWABLE, drawable_ID (gimage_active_drawable (gimage)), + PDB_DRAWABLE, drawable_ID (gimp_image_active_drawable (gimage)), PDB_INT32, (gint32) blend_options->blend_mode, PDB_INT32, (gint32) PAINT_OPTIONS_GET_PAINT_MODE (blend_options), PDB_INT32, (gint32) blend_options->gradient_type, @@ -534,7 +540,7 @@ blend_button_release (Tool *tool, progress = progress_start (gdisp, _("Blending..."), FALSE, NULL, NULL); blend (gimage, - gimage_active_drawable (gimage), + gimp_image_active_drawable (gimage), blend_options->blend_mode, gimp_context_get_paint_mode (NULL), blend_options->gradient_type, @@ -642,7 +648,7 @@ blend_cursor_update (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; - switch (drawable_type (gimage_active_drawable (gdisp->gimage))) + switch (drawable_type (gimp_image_active_drawable (gdisp->gimage))) { case INDEXED_GIMAGE: case INDEXEDA_GIMAGE: @@ -800,8 +806,8 @@ blend (GImage *gimage, progress_callback, progress_data); pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE); - gimage_apply_image (gimage, drawable, &bufPR, TRUE, - (opacity * 255) / 100, paint_mode, NULL, x1, y1); + gimp_image_apply_image (gimage, drawable, &bufPR, TRUE, + (opacity * 255) / 100, paint_mode, NULL, x1, y1); /* update the image */ drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1)); @@ -1186,14 +1192,14 @@ gradient_precalc_shapeburst (GImage *gimage, if (! gimage_mask_is_empty (gimage)) { PixelRegion maskR; - int x1, y1, x2, y2; - int offx, offy; + gint x1, y1, x2, y2; + gint offx, offy; drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2); drawable_offsets (drawable, &offx, &offy); /* the selection mask */ - mask = gimage_get_mask (gimage); + mask = gimp_image_get_mask (gimage); pixel_region_init (&maskR, drawable_data (GIMP_DRAWABLE(mask)), x1 + offx, y1 + offy, (x2 - x1), (y2 - y1), FALSE); diff --git a/app/blend.h b/app/blend.h index 66b7b1bf7e..3c25e17344 100644 --- a/app/blend.h +++ b/app/blend.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __BLEND_H__ #define __BLEND_H__ -#include "gimpprogress.h" -#include "tools.h" typedef enum { @@ -54,11 +53,26 @@ typedef enum REPEAT_LAST /*< skip >*/ } RepeatMode; -void blend (GimpImage *, GimpDrawable *, BlendMode, int, GradientType, - double, double, RepeatMode, int, int, double, double, - double, double, double, progress_func_t, void *); +void blend (GimpImage *, + GimpDrawable *, + BlendMode, + gint, + GradientType, + gdouble, + gdouble, + RepeatMode, + gint, + gint, + gdouble, + gdouble, + gdouble, + gdouble, + gdouble, + progress_func_t, + gpointer); + +Tool * tools_new_blend (void); +void tools_free_blend (Tool *tool); -Tool * tools_new_blend (void); -void tools_free_blend (Tool *); #endif /* __BLEND_H__ */ diff --git a/app/blob.h b/app/blob.h index 6151f607c9..3f7fd96646 100644 --- a/app/blob.h +++ b/app/blob.h @@ -25,32 +25,58 @@ #ifndef __BLOB_H__ #define __BLOB_H__ + typedef struct _BlobPoint BlobPoint; -typedef struct _BlobSpan BlobSpan; -typedef struct _Blob Blob; +typedef struct _BlobSpan BlobSpan; +typedef struct _Blob Blob; -struct _BlobPoint { - int x; - int y; +struct _BlobPoint +{ + gint x; + gint y; }; -struct _BlobSpan { - int left; - int right; +struct _BlobSpan +{ + gint left; + gint right; }; -struct _Blob { - int y; - int height; +struct _Blob +{ + gint y; + gint height; BlobSpan data[1]; }; -Blob *blob_convex_union (Blob *b1, Blob *b2); -Blob *blob_polygon (BlobPoint *points, int npoints); -Blob *blob_square (double xc, double yc, double xp, double yp, double xq, double yq); -Blob *blob_diamond (double xc, double yc, double xp, double yp, double xq, double yq); -Blob *blob_ellipse (double xc, double yc, double xp, double yp, double xq, double yq); -void blob_bounds(Blob *b, int *x, int *y, int *width, int *height); +Blob * blob_convex_union (Blob *b1, + Blob *b2); +Blob * blob_polygon (BlobPoint *points, + gint npoints); +Blob * blob_square (gdouble xc, + gdouble yc, + gdouble xp, + gdouble yp, + gdouble xq, + gdouble yq); +Blob * blob_diamond (gdouble xc, + gdouble yc, + gdouble xp, + gdouble yp, + gdouble xq, + gdouble yq); +Blob * blob_ellipse (gdouble xc, + gdouble yc, + gdouble xp, + gdouble yp, + gdouble xq, + gdouble yq); +void blob_bounds (Blob *b, + gint *x, + gint *y, + gint *width, + gint *height); + #endif /* __BLOB_H__ */ diff --git a/app/boundary.c b/app/boundary.c index 3fd9c06c3b..b0457a5bb6 100644 --- a/app/boundary.c +++ b/app/boundary.c @@ -27,7 +27,10 @@ #include "appenv.h" #include "errors.h" #include "boundary.h" +#include "pixel_region.h" #include "tile.h" +#include "tile_manager.h" + /* half intensity for mask */ #define HALF_WAY 127 diff --git a/app/brightness_contrast.c b/app/brightness_contrast.c index 71da9a888e..20a16dcbc3 100644 --- a/app/brightness_contrast.c +++ b/app/brightness_contrast.c @@ -25,11 +25,15 @@ #include "appenv.h" #include "brightness_contrast.h" #include "drawable.h" +#include "gimpcontext.h" #include "gimplut.h" #include "gimpui.h" #include "gdisplay.h" +#include "gimpimage.h" #include "image_map.h" #include "lut_funcs.h" +#include "tool_options.h" +#include "tools.h" #include "libgimp/gimpintl.h" @@ -170,7 +174,7 @@ tools_free_brightness_contrast (Tool *tool) void brightness_contrast_initialize (GDisplay *gdisp) { - if (drawable_indexed (gimage_active_drawable (gdisp->gimage))) + if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Brightness-Contrast does not operate on indexed drawables.")); return; @@ -186,7 +190,8 @@ brightness_contrast_initialize (GDisplay *gdisp) brightness_contrast_dialog->brightness = 0.0; brightness_contrast_dialog->contrast = 0.0; - brightness_contrast_dialog->drawable = gimage_active_drawable (gdisp->gimage); + brightness_contrast_dialog->drawable = + gimp_image_active_drawable (gdisp->gimage); brightness_contrast_dialog->image_map = image_map_create (gdisp, brightness_contrast_dialog->drawable); diff --git a/app/brightness_contrast.h b/app/brightness_contrast.h index 82ff8ce7d7..41e909dc68 100644 --- a/app/brightness_contrast.h +++ b/app/brightness_contrast.h @@ -15,10 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __BRIGHTNESS_CONTRAST_H__ #define __BRIGHTNESS_CONTRAST_H__ -#include "tools.h" Tool * tools_new_brightness_contrast (void); void tools_free_brightness_contrast (Tool *tool); @@ -27,4 +27,5 @@ void brightness_contrast_dialog_hide (void); void brightness_contrast_initialize (GDisplay *gdisp); + #endif /* __BRIGHTNESS_CONTRAST_H__ */ diff --git a/app/brush_edit.c b/app/brush_edit.c index f9b22b5cad..2ea93642f2 100644 --- a/app/brush_edit.c +++ b/app/brush_edit.c @@ -30,7 +30,9 @@ #include "gimpbrushgenerated.h" #include "brush_edit.h" #include "gimpui.h" +#include "temp_buf.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" diff --git a/app/brush_edit.h b/app/brush_edit.h index e376b0b2f7..2c221792bd 100644 --- a/app/brush_edit.h +++ b/app/brush_edit.h @@ -21,7 +21,6 @@ #ifndef __BRUSH_EDIT_H__ #define __BRUSH_EDIT_H__ -#include "gimpbrushgenerated.h" typedef struct _BrushEditGeneratedWindow BrushEditGeneratedWindow; @@ -46,7 +45,7 @@ struct _BrushEditGeneratedWindow BrushEditGeneratedWindow * brush_edit_generated_new (void); -void brush_edit_generated_set_brush (BrushEditGeneratedWindow *begw, - GimpBrush *brush); +void brush_edit_generated_set_brush (BrushEditGeneratedWindow *begw, + GimpBrush *brush); #endif /* __BRUSH_EDIT_H__ */ diff --git a/app/brush_scale.c b/app/brush_scale.c index b1cd47fef2..8420939d4c 100644 --- a/app/brush_scale.c +++ b/app/brush_scale.c @@ -16,25 +16,31 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "config.h" + #include + +#include "apptypes.h" + #include "brush_scale.h" +#include "temp_buf.h" MaskBuf * brush_scale_mask (MaskBuf *brush_mask, - int dest_width, - int dest_height) + gint dest_width, + gint dest_height) { MaskBuf *scale_brush; - int src_width; - int src_height; - int value; - int area; - int i, j; - int x, x0, y, y0; - int dx, dx0, dy, dy0; - int fx, fx0, fy, fy0; - unsigned char *src, *dest; + gint src_width; + gint src_height; + gint value; + gint area; + gint i, j; + gint x, x0, y, y0; + gint dx, dx0, dy, dy0; + gint fx, fx0, fy, fy0; + guchar *src, *dest; g_return_val_if_fail (brush_mask != NULL && dest_width != 0 && dest_height != 0, NULL); @@ -174,20 +180,20 @@ brush_scale_mask (MaskBuf *brush_mask, MaskBuf * brush_scale_pixmap (MaskBuf *pixmap, - int dest_width, - int dest_height) + gint dest_width, + gint dest_height) { MaskBuf *scale_brush; - int src_width; - int src_height; - int value[3]; - int factor; - int area; - int i, j; - int x, x0, y, y0; - int dx, dx0, dy, dy0; - int fx, fx0, fy, fy0; - unsigned char *src, *src_ptr, *dest; + gint src_width; + gint src_height; + gint value[3]; + gint factor; + gint area; + gint i, j; + gint x, x0, y, y0; + gint dx, dx0, dy, dy0; + gint fx, fx0, fy, fy0; + guchar *src, *src_ptr, *dest; g_return_val_if_fail (pixmap != NULL && pixmap->bytes == 3 && dest_width != 0 && dest_height != 0, NULL); diff --git a/app/brush_scale.h b/app/brush_scale.h index c8c00f1dc7..3566a89f04 100644 --- a/app/brush_scale.h +++ b/app/brush_scale.h @@ -15,15 +15,18 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __BRUSH_SCALE_H__ #define __BRUSH_SCALE_H__ -#include "temp_buf.h" -/* functions */ +MaskBuf * brush_scale_mask (MaskBuf *brush_mask, + gint dest_width, + gint dest_height); +MaskBuf * brush_scale_pixmap (MaskBuf *pixmap, + gint dest_width, + gint dest_height); -MaskBuf * brush_scale_mask (MaskBuf *, int, int); -MaskBuf * brush_scale_pixmap (MaskBuf *, int, int); #endif /* __BRUSH_SCALE_H__ */ diff --git a/app/brush_select.c b/app/brush_select.c index 5bf62f59d2..24bb569a16 100644 --- a/app/brush_select.c +++ b/app/brush_select.c @@ -38,11 +38,15 @@ #include "gimprc.h" #include "gimpui.h" #include "paint_options.h" +#include "procedural_db.h" #include "session.h" +#include "temp_buf.h" + +#include "libgimp/gimphelpui.h" -#include "config.h" #include "libgimp/gimpintl.h" + #define MIN_CELL_SIZE 25 #define MAX_CELL_SIZE 25 /* disable variable brush preview size */ diff --git a/app/brush_select.h b/app/brush_select.h index f3c00cb5b8..941cf7932e 100644 --- a/app/brush_select.h +++ b/app/brush_select.h @@ -20,29 +20,25 @@ #define __BRUSH_SELECT_H__ -#include "gimpbrush.h" -#include "gimpcontext.h" - - typedef struct _BrushSelect BrushSelect; struct _BrushSelect { - GtkWidget *shell; + GtkWidget *shell; /* Place holders which enable global<->per-tool paint options switching */ - GtkWidget *left_box; - GtkWidget *right_box; - GtkWidget *brush_selection_box; - GtkWidget *paint_options_box; + GtkWidget *left_box; + GtkWidget *right_box; + GtkWidget *brush_selection_box; + GtkWidget *paint_options_box; /* The preview and it's vscale data */ GtkWidget *preview; GtkAdjustment *sbar_data; - GtkWidget *options_box; - GtkWidget *brush_name; - GtkWidget *brush_size; + GtkWidget *options_box; + GtkWidget *brush_name; + GtkWidget *brush_size; GtkAdjustment *opacity_data; GtkAdjustment *spacing_data; @@ -51,32 +47,32 @@ struct _BrushSelect GtkWidget *option_menu; /* Brush popup */ - GtkWidget *brush_popup; - GtkWidget *brush_preview; - guint popup_timeout_tag; - guint popup_anim_timeout_tag; - guint popup_pipe_index; + GtkWidget *brush_popup; + GtkWidget *brush_preview; + guint popup_timeout_tag; + guint popup_anim_timeout_tag; + guint popup_pipe_index; /* Callback function name */ - gchar *callback_name; + gchar *callback_name; /* Context to store the current brush & paint options */ - GimpContext *context; - gint spacing_value; + GimpContext *context; + gint spacing_value; - GimpBrush *dnd_brush; + GimpBrush *dnd_brush; /* Some variables to keep the GUI consistent */ - gint cell_width; - gint cell_height; - gint scroll_offset; - gint old_row; - gint old_col; - gint NUM_BRUSH_COLUMNS; - gint NUM_BRUSH_ROWS; + gint cell_width; + gint cell_height; + gint scroll_offset; + gint old_row; + gint old_col; + gint NUM_BRUSH_COLUMNS; + gint NUM_BRUSH_ROWS; - gboolean redraw; - gboolean freeze; /* so we don't waste so much time during refresh */ + gboolean redraw; + gboolean freeze; /* so we don't waste so much time during refresh */ }; /* list of active dialogs */ diff --git a/app/brush_select_cmds.c b/app/brush_select_cmds.c index c3a4a6b7a9..8e25417431 100644 --- a/app/brush_select_cmds.c +++ b/app/brush_select_cmds.c @@ -18,13 +18,18 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ -#include "procedural_db.h" +#include "config.h" #include +#include + #include "apptypes.h" +#include "procedural_db.h" + #include "brush_select.h" #include "gimpbrushlist.h" +#include "gimpcontext.h" static ProcRecord brushes_popup_proc; static ProcRecord brushes_close_popup_proc; diff --git a/app/brushes_cmds.c b/app/brushes_cmds.c index 5aeaa48d7e..15b2d0bc46 100644 --- a/app/brushes_cmds.c +++ b/app/brushes_cmds.c @@ -18,15 +18,20 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ -#include "procedural_db.h" +#include "config.h" #include +#include + #include "apptypes.h" +#include "procedural_db.h" + #include "gimpbrush.h" #include "gimpbrushlist.h" #include "gimpcontext.h" #include "gimplist.h" +#include "temp_buf.h" static ProcRecord brushes_refresh_proc; static ProcRecord brushes_get_brush_proc; diff --git a/app/bucket_fill.c b/app/bucket_fill.c index b2313e810c..d227994b71 100644 --- a/app/bucket_fill.c +++ b/app/bucket_fill.c @@ -25,24 +25,34 @@ #include "appenv.h" #include "bucket_fill.h" +#include "channel.h" #include "cursorutil.h" #include "drawable.h" #include "fuzzy_select.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimage_mask.h" +#include "gimpcontext.h" #include "gimprc.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_options.h" +#include "patterns.h" +#include "pixel_region.h" +#include "procedural_db.h" #include "selection.h" +#include "temp_buf.h" +#include "tile_manager.h" #include "tools.h" #include "undo.h" #include "libgimp/gimpintl.h" + /* the bucket fill structures */ typedef struct _BucketTool BucketTool; + struct _BucketTool { gint target_x; /* starting x coord */ @@ -50,6 +60,7 @@ struct _BucketTool }; typedef struct _BucketOptions BucketOptions; + struct _BucketOptions { PaintOptions paint_options; @@ -232,7 +243,7 @@ bucket_fill_button_release (Tool *tool, return_vals = procedural_db_run_proc ("gimp_bucket_fill", &nreturn_vals, - PDB_DRAWABLE, drawable_ID (gimage_active_drawable (gdisp->gimage)), + PDB_DRAWABLE, drawable_ID (gimp_image_active_drawable (gdisp->gimage)), PDB_INT32, (gint32) bucket_options->fill_mode, PDB_INT32, (gint32) gimp_context_get_paint_mode (NULL), PDB_FLOAT, (gdouble) gimp_context_get_opacity (NULL) * 100, @@ -269,7 +280,7 @@ bucket_fill_cursor_update (Tool *tool, gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, FALSE, FALSE); - if ((layer = gimage_get_active_layer (gdisp->gimage))) + if ((layer = gimp_image_get_active_layer (gdisp->gimage))) { drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y); @@ -360,9 +371,9 @@ bucket_fill (GimpImage *gimage, pat_buf = NULL; if (fill_mode == FG_BUCKET_FILL) - gimage_get_foreground (gimage, drawable, col); + gimp_image_get_foreground (gimage, drawable, col); else if (fill_mode == BG_BUCKET_FILL) - gimage_get_background (gimage, drawable, col); + gimp_image_get_background (gimage, drawable, col); else if (fill_mode == PATTERN_BUCKET_FILL) { pattern = gimp_context_get_pattern (NULL); @@ -392,8 +403,8 @@ bucket_fill (GimpImage *gimage, size = pattern->mask->width * pattern->mask->height; while (size--) { - gimage_transform_color (gimage, drawable, d1, d2, - (pattern->mask->bytes == 3) ? RGB : GRAY); + gimp_image_transform_color (gimage, drawable, d1, d2, + (pattern->mask->bytes == 3) ? RGB : GRAY); d1 += pattern->mask->bytes; d2 += pat_buf->bytes; } @@ -464,8 +475,8 @@ bucket_fill (GimpImage *gimage, bucket_fill_region (fill_mode, &bufPR, NULL, col, pat_buf, x1, y1, has_alpha); pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE); - gimage_apply_image (gimage, drawable, &bufPR, TRUE, - (opacity * 255) / 100, paint_mode, NULL, x1, y1); + gimp_image_apply_image (gimage, drawable, &bufPR, TRUE, + (opacity * 255) / 100, paint_mode, NULL, x1, y1); /* update the image */ drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1)); diff --git a/app/bucket_fill.h b/app/bucket_fill.h index e4ad5e485a..195b5098fd 100644 --- a/app/bucket_fill.h +++ b/app/bucket_fill.h @@ -19,8 +19,6 @@ #ifndef __BUCKET_FILL_H__ #define __BUCKET_FILL_H__ -#include "tools.h" - typedef enum { @@ -29,27 +27,28 @@ typedef enum PATTERN_BUCKET_FILL } BucketFillMode; -void bucket_fill (GimpImage *gimage, - GimpDrawable *drawable, - BucketFillMode fill_mode, - gint paint_mode, - gdouble opacity, - gdouble threshold, - gboolean sample_merged, - gdouble x, - gdouble y); -void bucket_fill_region (BucketFillMode fill_mode, - PixelRegion *bufPR, - PixelRegion *maskPR, - guchar *col, - TempBuf *pattern, - gint off_x, - gint off_y, - gboolean has_alpha); +void bucket_fill (GimpImage *gimage, + GimpDrawable *drawable, + BucketFillMode fill_mode, + gint paint_mode, + gdouble opacity, + gdouble threshold, + gboolean sample_merged, + gdouble x, + gdouble y); -Tool * tools_new_bucket_fill (void); -void tools_free_bucket_fill (Tool *tool); +void bucket_fill_region (BucketFillMode fill_mode, + PixelRegion *bufPR, + PixelRegion *maskPR, + guchar *col, + TempBuf *pattern, + gint off_x, + gint off_y, + gboolean has_alpha); + +Tool * tools_new_bucket_fill (void); +void tools_free_bucket_fill (Tool *tool); #endif /* __BUCKET_FILL_H__ */ diff --git a/app/by_color_select.c b/app/by_color_select.c index f8195ac06f..45210650c9 100644 --- a/app/by_color_select.c +++ b/app/by_color_select.c @@ -26,21 +26,29 @@ #include "appenv.h" #include "boundary.h" #include "by_color_select.h" +#include "channel.h" #include "cursorutil.h" #include "drawable.h" #include "draw_core.h" #include "gimage_mask.h" #include "gimpdnd.h" +#include "gimpimage.h" #include "gimprc.h" #include "gimpset.h" #include "gimpui.h" #include "gdisplay.h" +#include "paint_funcs.h" +#include "pixel_region.h" #include "selection_options.h" - -#include "tile.h" /* ick. */ +#include "temp_buf.h" +#include "tile.h" +#include "tile_manager.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpintl.h" + #define PREVIEW_WIDTH 256 #define PREVIEW_HEIGHT 256 #define PREVIEW_EVENT_MASK GDK_EXPOSURE_MASK | \ @@ -204,15 +212,15 @@ by_color_select_color (GImage *gimage, /* Get the image information */ if (sample_merged) { - bytes = gimage_composite_bytes (gimage); - d_type = gimage_composite_type (gimage); + bytes = gimp_image_composite_bytes (gimage); + d_type = gimp_image_composite_type (gimage); has_alpha = (d_type == RGBA_GIMAGE || d_type == GRAYA_GIMAGE || d_type == INDEXEDA_GIMAGE); indexed = d_type == INDEXEDA_GIMAGE || d_type == INDEXED_GIMAGE; width = gimage->width; height = gimage->height; - pixel_region_init (&imagePR, gimage_composite (gimage), + pixel_region_init (&imagePR, gimp_image_composite (gimage), 0, 0, width, height, FALSE); } else @@ -259,7 +267,7 @@ by_color_select_color (GImage *gimage, for (j = 0; j < imagePR.w; j++) { /* Get the rgb values for the color */ - gimage_get_color (gimage, d_type, rgb, idata); + gimp_image_get_color (gimage, d_type, rgb, idata); /* Plug the alpha channel in there */ if (has_alpha) @@ -318,12 +326,12 @@ by_color_select (GImage *gimage, drawable_offsets (drawable, &off_x, &off_y); if (feather) - channel_feather (new_mask, gimage_get_mask (gimage), + channel_feather (new_mask, gimp_image_get_mask (gimage), feather_radius, feather_radius, op, off_x, off_y); else - channel_combine_mask (gimage_get_mask (gimage), + channel_combine_mask (gimp_image_get_mask (gimage), new_mask, op, off_x, off_y); channel_delete (new_mask); @@ -342,7 +350,7 @@ by_color_select_button_press (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; by_color_sel = (ByColorSelect *) tool->private; - tool->drawable = gimage_active_drawable (gdisp->gimage); + tool->drawable = gimp_image_active_drawable (gdisp->gimage); if (!by_color_dialog) return; @@ -396,7 +404,7 @@ by_color_select_button_release (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; by_color_sel = (ByColorSelect *) tool->private; - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); gdk_pointer_ungrab (bevent->time); @@ -462,7 +470,7 @@ by_color_select_cursor_update (Tool *tool, &x, &y, FALSE, FALSE); if (by_color_options->sample_merged || - ((layer = gimage_pick_correlate_layer (gdisp->gimage, x, y)) && + ((layer = gimp_image_pick_correlate_layer (gdisp->gimage, x, y)) && layer == gdisp->gimage->active_layer)) { switch (by_col_sel->operation) @@ -878,7 +886,7 @@ by_color_select_render (ByColorDialog *bcd, gint i; gint scale; - mask = gimage_get_mask (gimage); + mask = gimp_image_get_mask (gimage); if ((drawable_width (GIMP_DRAWABLE(mask)) > PREVIEW_WIDTH) || (drawable_height (GIMP_DRAWABLE(mask)) > PREVIEW_HEIGHT)) { @@ -986,7 +994,7 @@ by_color_select_draw (ByColorDialog *bcd, /* Update the gimage label to reflect the displayed gimage name */ gtk_label_set_text (GTK_LABEL (bcd->gimage_name), - g_basename (gimage_filename (gimage))); + g_basename (gimp_image_filename (gimage))); } static gint @@ -1032,7 +1040,7 @@ by_color_select_invert_callback (GtkWidget *widget, return; /* check if the image associated to the mask still exists */ - if (!drawable_gimage (GIMP_DRAWABLE (gimage_get_mask (bcd->gimage)))) + if (!drawable_gimage (GIMP_DRAWABLE (gimp_image_get_mask (bcd->gimage)))) return; /* invert the mask */ @@ -1058,7 +1066,7 @@ by_color_select_select_all_callback (GtkWidget *widget, return; /* check if the image associated to the mask still exists */ - if (!drawable_gimage (GIMP_DRAWABLE (gimage_get_mask (bcd->gimage)))) + if (!drawable_gimage (GIMP_DRAWABLE (gimp_image_get_mask (bcd->gimage)))) return; /* fill the mask */ @@ -1084,7 +1092,7 @@ by_color_select_select_none_callback (GtkWidget *widget, return; /* check if the image associated to the mask still exists */ - if (!drawable_gimage (GIMP_DRAWABLE (gimage_get_mask (bcd->gimage)))) + if (!drawable_gimage (GIMP_DRAWABLE (gimp_image_get_mask (bcd->gimage)))) return; /* reset the mask */ @@ -1129,7 +1137,7 @@ by_color_select_preview_button_press (ByColorDialog *bcd, if (!bcd->gimage) return; - drawable = gimage_active_drawable (bcd->gimage); + drawable = gimp_image_active_drawable (bcd->gimage); /* check if the gimage associated to the drawable still exists */ if (!drawable_gimage (drawable)) @@ -1161,7 +1169,7 @@ by_color_select_preview_button_press (ByColorDialog *bcd, y = bcd->gimage->height * bevent->y / bcd->preview->requisition.height; if (x < 0 || y < 0 || x >= bcd->gimage->width || y >= bcd->gimage->height) return; - tile = tile_manager_get_tile (gimage_composite (bcd->gimage), + tile = tile_manager_get_tile (gimp_image_composite (bcd->gimage), x, y, TRUE, FALSE); col = tile_data_pointer (tile, x % TILE_WIDTH, y % TILE_HEIGHT); } @@ -1205,12 +1213,12 @@ by_color_select_color_drop (GtkWidget *widget, gpointer data) { - GimpDrawable *drawable; + GimpDrawable *drawable; ByColorDialog *bcd; - guchar col[3]; + guchar col[3]; bcd = (ByColorDialog*) data; - drawable = gimage_active_drawable (bcd->gimage); + drawable = gimp_image_active_drawable (bcd->gimage); col[0] = r; col[1] = g; diff --git a/app/by_color_select.h b/app/by_color_select.h index c1ed753ac2..b75f1145ed 100644 --- a/app/by_color_select.h +++ b/app/by_color_select.h @@ -15,12 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __BY_COLOR_SELECT_H__ #define __BY_COLOR_SELECT_H__ -#include "tools.h" -#include "gdisplayF.h" -#include "gimage.h" Tool * tools_new_by_color_select (void); void tools_free_by_color_select (Tool *tool); @@ -38,4 +36,5 @@ void by_color_select (GimpImage *gimage, gdouble feather_radius, gboolean sample_merged); + #endif /* __BY_COLOR_SELECT_H__ */ diff --git a/app/channel.c b/app/channel.c index 20ecb6bdbf..077577e220 100644 --- a/app/channel.c +++ b/app/channel.c @@ -26,23 +26,25 @@ #include "apptypes.h" #include "appenv.h" +#include "boundary.h" #include "channel.h" #include "drawable.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimage_mask.h" +#include "gimpsignal.h" +#include "gimppreviewcache.h" +#include "gimplut.h" #include "layer.h" #include "paint_funcs.h" #include "parasitelist.h" -#include "temp_buf.h" -#include "undo.h" -#include "gimpsignal.h" -#include "gimppreviewcache.h" - -#include "channel_pvt.h" -#include "tile.h" - -#include "gimplut.h" +#include "pixel_processor.h" +#include "pixel_region.h" #include "lut_funcs.h" +#include "temp_buf.h" +#include "tile.h" +#include "tile_manager.h" +#include "undo.h" #include "libgimp/gimpmath.h" @@ -1004,14 +1006,14 @@ channel_combine_rect (Channel *mask, pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, x, y, x2 - x, y2 - y, TRUE); - if (op == ADD || op == REPLACE) + if (op == CHANNEL_OP_ADD || op == CHANNEL_OP_REPLACE) color = 255; else color = 0; color_region (&maskPR, &color); /* Determine new boundary */ - if (mask->bounds_known && (op == ADD) && !mask->empty) + if (mask->bounds_known && (op == CHANNEL_OP_ADD) && !mask->empty) { if (x < mask->x1) mask->x1 = x; @@ -1022,7 +1024,7 @@ channel_combine_rect (Channel *mask, if ((y + h) > mask->y2) mask->y2 = (y + h); } - else if (op == REPLACE || mask->empty) + else if (op == CHANNEL_OP_REPLACE || mask->empty) { mask->empty = FALSE; mask->x1 = x; @@ -1084,10 +1086,11 @@ channel_combine_ellipse (Channel *mask, switch (op) { - case ADD: case REPLACE: + case CHANNEL_OP_ADD: + case CHANNEL_OP_REPLACE: channel_add_segment (mask, x1, i, (x2 - x1), 255); break; - case SUB : + case CHANNEL_OP_SUB: channel_sub_segment (mask, x1, i, (x2 - x1), 255); break; default: @@ -1127,10 +1130,11 @@ channel_combine_ellipse (Channel *mask, { switch (op) { - case ADD: case REPLACE: + case CHANNEL_OP_ADD: + case CHANNEL_OP_REPLACE: channel_add_segment (mask, x0, i, j - x0, last); break; - case SUB: + case CHANNEL_OP_SUB: channel_sub_segment (mask, x0, i, j - x0, last); break; default: @@ -1152,9 +1156,9 @@ channel_combine_ellipse (Channel *mask, if (last) { - if (op == ADD || op == REPLACE) + if (op == CHANNEL_OP_ADD || op == CHANNEL_OP_REPLACE) channel_add_segment (mask, x0, i, j - x0, last); - else if (op == SUB) + else if (op == CHANNEL_OP_SUB) channel_sub_segment (mask, x0, i, j - x0, last); else g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); @@ -1165,7 +1169,7 @@ channel_combine_ellipse (Channel *mask, } /* Determine new boundary */ - if (mask->bounds_known && (op == ADD) && !mask->empty) + if (mask->bounds_known && (op == CHANNEL_OP_ADD) && !mask->empty) { if (x < mask->x1) mask->x1 = x; @@ -1176,7 +1180,7 @@ channel_combine_ellipse (Channel *mask, if ((y + h) > mask->y2) mask->y2 = (y + h); } - else if (op == REPLACE || mask->empty) + else if (op == CHANNEL_OP_REPLACE || mask->empty) { mask->empty = FALSE; mask->x1 = x; @@ -1293,15 +1297,16 @@ channel_combine_mask (Channel *mask, switch (op) { - case ADD: case REPLACE: + case CHANNEL_OP_ADD: + case CHANNEL_OP_REPLACE: pixel_regions_process_parallel ((p_func) channel_combine_sub_region_add, NULL, 2, &srcPR, &destPR); break; - case SUB: + case CHANNEL_OP_SUB: pixel_regions_process_parallel ((p_func) channel_combine_sub_region_sub, NULL, 2, &srcPR, &destPR); break; - case INTERSECT: + case CHANNEL_OP_INTERSECT: pixel_regions_process_parallel ((p_func) channel_combine_sub_region_intersect, NULL, 2, &srcPR, &destPR); diff --git a/app/channel.h b/app/channel.h index 5ae6ae1fbe..51dd13f148 100644 --- a/app/channel.h +++ b/app/channel.h @@ -19,35 +19,49 @@ #ifndef __CHANNEL_H__ #define __CHANNEL_H__ -#include "apptypes.h" -#include "drawable.h" -#include "boundary.h" -#include "temp_buf.h" -#include "tile_manager.h" + +#include "gimpdrawable.h" /* OPERATIONS */ -typedef enum -{ - ADD, - SUB, - REPLACE, - INTERSECT -} ChannelOps; - /* Half way point where a region is no longer visible in a selection */ #define HALF_WAY 127 /* structure declarations */ -#define GIMP_TYPE_CHANNEL (gimp_channel_get_type ()) -#define GIMP_CHANNEL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_CHANNEL, GimpChannel)) -#define GIMP_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CHANNEL, GimpChannelClass)) -#define GIMP_IS_CHANNEL(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_CHANNEL)) -#define GIMP_IS_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CHANNEL)) +#define GIMP_TYPE_CHANNEL (gimp_channel_get_type ()) +#define GIMP_CHANNEL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_CHANNEL, GimpChannel)) +#define GIMP_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CHANNEL, GimpChannelClass)) +#define GIMP_IS_CHANNEL(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_CHANNEL)) +#define GIMP_IS_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CHANNEL)) + +struct _GimpChannel +{ + GimpDrawable drawable; + + guchar col[3]; /* RGB triplet for channel color */ + gint opacity; /* Channel opacity */ + gboolean show_masked; /* Show masked areas--as */ + /* opposed to selected areas */ + + /* Selection mask variables */ + gboolean boundary_known; /* is the current boundary valid */ + BoundSeg *segs_in; /* outline of selected region */ + BoundSeg *segs_out; /* outline of selected region */ + gint num_segs_in; /* number of lines in boundary */ + gint num_segs_out; /* number of lines in boundary */ + gboolean empty; /* is the region empty? */ + gboolean bounds_known; /* recalculate the bounds? */ + gint x1, y1; /* coordinates for bounding box */ + gint x2, y2; /* lower right hand coordinate */ +}; + +struct _GimpChannelClass +{ + GimpDrawableClass parent_class; +}; -GtkType gimp_channel_get_type (void); /* Special undo type */ @@ -72,6 +86,8 @@ struct _MaskUndo /* function declarations */ +GtkType gimp_channel_get_type (void); + Channel * channel_new (GimpImage *gimage, gint width, gint height, diff --git a/app/channel_cmds.c b/app/channel_cmds.c index 93a994e7c1..98bb55d190 100644 --- a/app/channel_cmds.c +++ b/app/channel_cmds.c @@ -18,10 +18,15 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ +#include "config.h" + + +#include + +#include "apptypes.h" #include "procedural_db.h" #include "channel.h" -#include "channel_pvt.h" #include "drawable.h" #include "gimpimage.h" diff --git a/app/channel_ops.c b/app/channel_ops.c index ab57fa2f97..9097106e66 100644 --- a/app/channel_ops.c +++ b/app/channel_ops.c @@ -32,12 +32,16 @@ #include "floating_sel.h" #include "gdisplay.h" #include "gimpcontext.h" +#include "gimage.h" #include "gimpui.h" +#include "layer.h" +#include "paint_funcs.h" #include "parasitelist.h" +#include "path.h" +#include "pixel_region.h" +#include "tile_manager.h" -#include "channel_pvt.h" -#include "layer_pvt.h" - +#include "libgimp/gimphelpui.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" @@ -69,23 +73,23 @@ void channel_ops_offset (GimpImage* gimage) { OffsetDialog *off_d; - GtkWidget *label; - GtkWidget *check; - GtkWidget *push; - GtkWidget *vbox; - GtkWidget *table; - GtkObject *adjustment; - GtkWidget *spinbutton; - GtkWidget *frame; - GtkWidget *radio_button; + GtkWidget *label; + GtkWidget *check; + GtkWidget *push; + GtkWidget *vbox; + GtkWidget *table; + GtkObject *adjustment; + GtkWidget *spinbutton; + GtkWidget *frame; + GtkWidget *radio_button; GimpDrawable *drawable; - drawable = gimage_active_drawable (gimage); + drawable = gimp_image_active_drawable (gimage); off_d = g_new (OffsetDialog, 1); off_d->wrap_around = TRUE; - off_d->fill_type = drawable_has_alpha (drawable); + off_d->fill_type = gimp_drawable_has_alpha (drawable); off_d->gimage = gimage; off_d->dlg = gimp_dialog_new (_("Offset"), "offset", @@ -186,7 +190,7 @@ channel_ops_offset (GimpImage* gimage) gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); - if (!drawable_has_alpha (drawable)) + if (! gimp_drawable_has_alpha (drawable)) gtk_widget_set_sensitive (radio_button, FALSE); /* The by half height and half width option */ @@ -229,8 +233,8 @@ offset (GimpImage *gimage, if (!drawable) return; - width = drawable_width (drawable); - height = drawable_height (drawable); + width = gimp_drawable_width (drawable); + height = gimp_drawable_height (drawable); if (wrap_around) { @@ -252,7 +256,7 @@ offset (GimpImage *gimage, if (offset_x == 0 && offset_y == 0) return; - new_tiles = tile_manager_new (width, height, drawable_bytes (drawable)); + new_tiles = tile_manager_new (width, height, gimp_drawable_bytes (drawable)); if (offset_x >= 0) { src_x = 0; @@ -282,8 +286,10 @@ offset (GimpImage *gimage, /* Copy the center region */ if (width && height) { - pixel_region_init (&srcPR, drawable_data (drawable), src_x, src_y, width, height, FALSE); - pixel_region_init (&destPR, new_tiles, dest_x, dest_y, width, height, TRUE); + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + src_x, src_y, width, height, FALSE); + pixel_region_init (&destPR, new_tiles, + dest_x, dest_y, width, height, TRUE); copy_region (&srcPR, &destPR); } @@ -293,18 +299,18 @@ offset (GimpImage *gimage, { if (offset_x >= 0 && offset_y >= 0) { - src_x = drawable_width (drawable) - offset_x; - src_y = drawable_height (drawable) - offset_y; + src_x = gimp_drawable_width (drawable) - offset_x; + src_y = gimp_drawable_height (drawable) - offset_y; } else if (offset_x >= 0 && offset_y < 0) { - src_x = drawable_width (drawable) - offset_x; + src_x = gimp_drawable_width (drawable) - offset_x; src_y = 0; } else if (offset_x < 0 && offset_y >= 0) { src_x = 0; - src_y = drawable_height (drawable) - offset_y; + src_y = gimp_drawable_height (drawable) - offset_y; } else if (offset_x < 0 && offset_y < 0) { @@ -312,19 +318,22 @@ offset (GimpImage *gimage, src_y = 0; } - dest_x = (src_x + offset_x) % drawable_width (drawable); + dest_x = (src_x + offset_x) % gimp_drawable_width (drawable); if (dest_x < 0) - dest_x = drawable_width (drawable) + dest_x; - dest_y = (src_y + offset_y) % drawable_height (drawable); + dest_x = gimp_drawable_width (drawable) + dest_x; + dest_y = (src_y + offset_y) % gimp_drawable_height (drawable); if (dest_y < 0) - dest_y = drawable_height (drawable) + dest_y; + dest_y = gimp_drawable_height (drawable) + dest_y; /* intersecting region */ if (offset_x != 0 && offset_y != 0) { - pixel_region_init (&srcPR, drawable_data (drawable), src_x, src_y, - ABS (offset_x), ABS (offset_y), FALSE); - pixel_region_init (&destPR, new_tiles, dest_x, dest_y, ABS (offset_x), ABS (offset_y), TRUE); + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + src_x, src_y, ABS (offset_x), ABS (offset_y) + , FALSE); + pixel_region_init (&destPR, new_tiles, + dest_x, dest_y, ABS (offset_x), ABS (offset_y), + TRUE); copy_region (&srcPR, &destPR); } @@ -333,17 +342,28 @@ offset (GimpImage *gimage, { if (offset_y >= 0) { - pixel_region_init (&srcPR, drawable_data (drawable), src_x, 0, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), FALSE); - pixel_region_init (&destPR, new_tiles, dest_x, dest_y + offset_y, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), TRUE); + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + src_x, 0, ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + FALSE); + pixel_region_init (&destPR, new_tiles, + dest_x, dest_y + offset_y, + ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + TRUE); } else if (offset_y < 0) { - pixel_region_init (&srcPR, drawable_data (drawable), src_x, src_y - offset_y, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), FALSE); - pixel_region_init (&destPR, new_tiles, dest_x, 0, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), TRUE); + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + src_x, src_y - offset_y, + ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + FALSE); + pixel_region_init (&destPR, new_tiles, + dest_x, 0, + ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + TRUE); } copy_region (&srcPR, &destPR); @@ -354,21 +374,22 @@ offset (GimpImage *gimage, { if (offset_x >= 0) { - pixel_region_init (&srcPR, drawable_data (drawable), 0, src_y, - drawable_width (drawable) - ABS (offset_x), + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + 0, src_y, + gimp_drawable_width (drawable) - ABS (offset_x), ABS (offset_y), FALSE); pixel_region_init (&destPR, new_tiles, dest_x + offset_x, dest_y, - drawable_width (drawable) - ABS (offset_x), + gimp_drawable_width (drawable) - ABS (offset_x), ABS (offset_y), TRUE); } else if (offset_x < 0) { - pixel_region_init (&srcPR, drawable_data (drawable), + pixel_region_init (&srcPR, gimp_drawable_data (drawable), src_x - offset_x, src_y, - drawable_width (drawable) - ABS (offset_x), + gimp_drawable_width (drawable) - ABS (offset_x), ABS (offset_y), FALSE); pixel_region_init (&destPR, new_tiles, 0, dest_y, - drawable_width (drawable) - ABS (offset_x), + gimp_drawable_width (drawable) - ABS (offset_x), ABS (offset_y), TRUE); } @@ -381,8 +402,8 @@ offset (GimpImage *gimage, if (fill_type == OFFSET_BACKGROUND) { gimp_context_get_background (NULL, &fill[0], &fill[1], &fill[2]); - if (drawable_has_alpha (drawable)) - fill[drawable_bytes (drawable) - 1] = OPAQUE_OPACITY; + if (gimp_drawable_has_alpha (drawable)) + fill[gimp_drawable_bytes (drawable) - 1] = OPAQUE_OPACITY; } if (offset_x >= 0 && offset_y >= 0) @@ -393,17 +414,17 @@ offset (GimpImage *gimage, else if (offset_x >= 0 && offset_y < 0) { dest_x = 0; - dest_y = drawable_height (drawable) + offset_y; + dest_y = gimp_drawable_height (drawable) + offset_y; } else if (offset_x < 0 && offset_y >= 0) { - dest_x = drawable_width (drawable) + offset_x; + dest_x = gimp_drawable_width (drawable) + offset_x; dest_y = 0; } else if (offset_x < 0 && offset_y < 0) { - dest_x = drawable_width (drawable) + offset_x; - dest_y = drawable_height (drawable) + offset_y; + dest_x = gimp_drawable_width (drawable) + offset_x; + dest_y = gimp_drawable_height (drawable) + offset_y; } /* intersecting region */ @@ -418,11 +439,17 @@ offset (GimpImage *gimage, if (offset_x != 0) { if (offset_y >= 0) - pixel_region_init (&destPR, new_tiles, dest_x, dest_y + offset_y, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), TRUE); + pixel_region_init (&destPR, new_tiles, + dest_x, dest_y + offset_y, + ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + TRUE); else if (offset_y < 0) - pixel_region_init (&destPR, new_tiles, dest_x, 0, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), TRUE); + pixel_region_init (&destPR, new_tiles, + dest_x, 0, + ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + TRUE); color_region (&destPR, fill); } @@ -431,11 +458,18 @@ offset (GimpImage *gimage, if (offset_y != 0) { if (offset_x >= 0) - pixel_region_init (&destPR, new_tiles, dest_x + offset_x, dest_y, - drawable_width (drawable) - ABS (offset_x), ABS (offset_y), TRUE); + pixel_region_init (&destPR, new_tiles, + dest_x + offset_x, + dest_y, + gimp_drawable_width (drawable) - ABS (offset_x), + ABS (offset_y), + TRUE); else if (offset_x < 0) - pixel_region_init (&destPR, new_tiles, 0, dest_y, - drawable_width (drawable) - ABS (offset_x), ABS (offset_y), TRUE); + pixel_region_init (&destPR, new_tiles, + 0, dest_y, + gimp_drawable_width (drawable) - ABS (offset_x), + ABS (offset_y), + TRUE); color_region (&destPR, fill); } @@ -443,8 +477,9 @@ offset (GimpImage *gimage, /* push an undo */ drawable_apply_image (drawable, 0, 0, - drawable_width (drawable), drawable_height (drawable), - drawable_data (drawable), FALSE); + gimp_drawable_width (drawable), + gimp_drawable_height (drawable), + gimp_drawable_data (drawable), FALSE); /* swap the tiles */ drawable->tiles = new_tiles; @@ -452,7 +487,8 @@ offset (GimpImage *gimage, /* update the drawable */ drawable_update (drawable, 0, 0, - drawable_width (drawable), drawable_height (drawable)); + gimp_drawable_width (drawable), + gimp_drawable_height (drawable)); } /* @@ -473,7 +509,7 @@ offset_ok_callback (GtkWidget *widget, if ((gimage = off_d->gimage) != NULL) { - drawable = gimage_active_drawable (gimage); + drawable = gimp_image_active_drawable (gimage); offset_x = (gint) RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 0)); @@ -505,7 +541,7 @@ offset_halfheight_callback (GtkWidget *widget, gpointer data) { OffsetDialog *off_d; - GImage *gimage; + GImage *gimage; off_d = (OffsetDialog *) data; gimage = off_d->gimage; @@ -519,27 +555,27 @@ offset_halfheight_callback (GtkWidget *widget, GimpImage * duplicate (GimpImage *gimage) { - PixelRegion srcPR, destPR; - GimpImage *new_gimage; - Layer *layer, *new_layer; - Layer *floating_layer; - Channel *channel, *new_channel; - GSList *list; - GList *glist; - Guide *guide = NULL; - Layer *active_layer = NULL; - Channel *active_channel = NULL; + PixelRegion srcPR, destPR; + GimpImage *new_gimage; + Layer *layer, *new_layer; + Layer *floating_layer; + Channel *channel, *new_channel; + GSList *list; + GList *glist; + Guide *guide = NULL; + Layer *active_layer = NULL; + Channel *active_channel = NULL; GimpDrawable *new_floating_sel_drawable = NULL; GimpDrawable *floating_sel_drawable = NULL; ParasiteList *parasites; - PathList *paths; - gint count; + PathList *paths; + gint count; gimp_add_busy_cursors_until_idle (); /* Create a new image */ new_gimage = gimage_new (gimage->width, gimage->height, gimage->base_type); - gimage_disable_undo (new_gimage); + gimp_image_undo_disable (new_gimage); /* Copy resolution and unit information */ new_gimage->xresolution = gimage->xresolution; @@ -547,7 +583,7 @@ duplicate (GimpImage *gimage) new_gimage->unit = gimage->unit; /* Copy floating layer */ - floating_layer = gimage_floating_sel (gimage); + floating_layer = gimp_image_floating_sel (gimage); if (floating_layer) { floating_sel_relax (floating_layer, FALSE); @@ -591,7 +627,7 @@ duplicate (GimpImage *gimage) /* Add the layer */ if (floating_layer != new_layer) - gimage_add_layer (new_gimage, new_layer, count++); + gimp_image_add_layer (new_gimage, new_layer, count++); } /* Copy the channels */ @@ -617,13 +653,13 @@ duplicate (GimpImage *gimage) new_floating_sel_drawable = GIMP_DRAWABLE(new_channel); /* Add the channel */ - gimage_add_channel (new_gimage, new_channel, count++); + gimp_image_add_channel (new_gimage, new_channel, count++); } /* Copy the selection mask */ - pixel_region_init (&srcPR, drawable_data (GIMP_DRAWABLE(gimage->selection_mask)), + pixel_region_init (&srcPR, gimp_drawable_data (GIMP_DRAWABLE (gimage->selection_mask)), 0, 0, gimage->width, gimage->height, FALSE); - pixel_region_init (&destPR, drawable_data (GIMP_DRAWABLE(new_gimage->selection_mask)), + pixel_region_init (&destPR, gimp_drawable_data (GIMP_DRAWABLE (new_gimage->selection_mask)), 0, 0, gimage->width, gimage->height, TRUE); copy_region (&srcPR, &destPR); new_gimage->selection_mask->bounds_known = FALSE; @@ -700,7 +736,7 @@ duplicate (GimpImage *gimage) gimp_image_set_paths (new_gimage, new_paths); } - gimage_enable_undo (new_gimage); + gimp_image_undo_enable (new_gimage); return new_gimage; } @@ -708,8 +744,9 @@ duplicate (GimpImage *gimage) #ifdef I_LIKE_BOGUS_CRAP static void -duplicate_projection (GimpImage *oldgimage, GimpImage *newgimage, - GDisplay *newgdisplay) +duplicate_projection (GimpImage *oldgimage, + GimpImage *newgimage, + GDisplay *newgdisplay) { PixelRegion srcPR, destPR; diff --git a/app/channel_ops_cmds.c b/app/channel_ops_cmds.c index ef25af2b91..e8943fa2a6 100644 --- a/app/channel_ops_cmds.c +++ b/app/channel_ops_cmds.c @@ -18,6 +18,12 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ +#include "config.h" + + +#include + +#include "apptypes.h" #include "procedural_db.h" #include "channel_ops.h" diff --git a/app/channel_pvt.h b/app/channel_pvt.h deleted file mode 100644 index b0ee612804..0000000000 --- a/app/channel_pvt.h +++ /dev/null @@ -1,55 +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 __CHANNEL_PVT_H__ -#define __CHANNEL_PVT_H__ - -#include "drawable.h" - -#include "boundary.h" -#include "temp_buf.h" -#include "tile_manager.h" - -#include "drawable_pvt.h" - -struct _GimpChannel -{ - GimpDrawable drawable; - - guchar col[3]; /* RGB triplet for channel color */ - gint opacity; /* Channel opacity */ - gboolean show_masked; /* Show masked areas--as */ - /* opposed to selected areas */ - - /* Selection mask variables */ - gboolean boundary_known; /* is the current boundary valid */ - BoundSeg *segs_in; /* outline of selected region */ - BoundSeg *segs_out; /* outline of selected region */ - gint num_segs_in; /* number of lines in boundary */ - gint num_segs_out; /* number of lines in boundary */ - gboolean empty; /* is the region empty? */ - gboolean bounds_known; /* recalculate the bounds? */ - gint x1, y1; /* coordinates for bounding box */ - gint x2, y2; /* lower right hand coordinate */ -}; - -struct _GimpChannelClass -{ - GimpDrawableClass parent_class; -}; - -#endif /* __CHANNEL_PVT_H__ */ diff --git a/app/channels_dialog.c b/app/channels_dialog.c index 6bd774d785..ede94c19df 100644 --- a/app/channels_dialog.c +++ b/app/channels_dialog.c @@ -24,6 +24,8 @@ #include "apptypes.h" #include "appenv.h" + +#include "channel.h" #include "channels_dialog.h" #include "color_panel.h" #include "drawable.h" @@ -41,10 +43,10 @@ #include "paint_funcs.h" #include "undo.h" -#include "channel_pvt.h" +#include "libgimp/gimphelpui.h" +#include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" -#include "libgimp/gimpmath.h" #include "pixmaps/eye.xbm" #include "pixmaps/channel.xbm" @@ -55,6 +57,7 @@ #include "pixmaps/delete.xpm" #include "pixmaps/toselection.xpm" + #define COMPONENT_BASE_ID 0x10000000 typedef struct _ChannelsDialog ChannelsDialog; @@ -1099,7 +1102,7 @@ channels_dialog_add_channel_to_sel_callback (GtkWidget *widget, new_channel = channel_copy (gimp_image_get_mask (gimage)); channel_combine_mask (new_channel, active_channel, - ADD, + CHANNEL_OP_ADD, 0, 0); /* off x/y */ gimage_mask_load (gimage, new_channel); channel_delete (new_channel); @@ -1123,7 +1126,7 @@ channels_dialog_sub_channel_from_sel_callback (GtkWidget *widget, new_channel = channel_copy (gimp_image_get_mask (gimage)); channel_combine_mask (new_channel, active_channel, - SUB, + CHANNEL_OP_SUB, 0, 0); /* off x/y */ gimage_mask_load (gimage, new_channel); channel_delete (new_channel); @@ -1147,7 +1150,7 @@ channels_dialog_intersect_channel_with_sel_callback (GtkWidget *widget, new_channel = channel_copy (gimp_image_get_mask (gimage)); channel_combine_mask (new_channel, active_channel, - INTERSECT, + CHANNEL_OP_INTERSECT, 0, 0); /* off x/y */ gimage_mask_load (gimage, new_channel); channel_delete (new_channel); diff --git a/app/channels_dialog.h b/app/channels_dialog.h index 4861605e1b..63a77b77eb 100644 --- a/app/channels_dialog.h +++ b/app/channels_dialog.h @@ -15,18 +15,31 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __CHANNELS_DIALOG_H__ #define __CHANNELS_DIALOG_H__ -void channels_dialog_new_channel_callback (GtkWidget *, gpointer); -void channels_dialog_raise_channel_callback (GtkWidget *, gpointer); -void channels_dialog_lower_channel_callback (GtkWidget *, gpointer); -void channels_dialog_duplicate_channel_callback (GtkWidget *, gpointer); -void channels_dialog_delete_channel_callback (GtkWidget *, gpointer); -void channels_dialog_channel_to_sel_callback (GtkWidget *, gpointer); -void channels_dialog_add_channel_to_sel_callback (GtkWidget *, gpointer); -void channels_dialog_sub_channel_from_sel_callback (GtkWidget *, gpointer); -void channels_dialog_intersect_channel_with_sel_callback(GtkWidget *, gpointer); -void channels_dialog_edit_channel_attributes_callback (GtkWidget *, gpointer); + +void channels_dialog_new_channel_callback (GtkWidget *widget, + gpointer data); +void channels_dialog_raise_channel_callback (GtkWidget *widget, + gpointer data); +void channels_dialog_lower_channel_callback (GtkWidget *widget, + gpointer data); +void channels_dialog_duplicate_channel_callback (GtkWidget *widget, + gpointer data); +void channels_dialog_delete_channel_callback (GtkWidget *widget, + gpointer data); +void channels_dialog_channel_to_sel_callback (GtkWidget *widget, + gpointer data); +void channels_dialog_add_channel_to_sel_callback (GtkWidget *widget, + gpointer data); +void channels_dialog_sub_channel_from_sel_callback (GtkWidget *widget, + gpointer data); +void channels_dialog_intersect_channel_with_sel_callback(GtkWidget *widget, + gpointer data); +void channels_dialog_edit_channel_attributes_callback (GtkWidget *widget, + gpointer data); + #endif /* __CHANNELS_DIALOG_H__ */ diff --git a/app/clone.c b/app/clone.c index 0db3c5e312..7c16c6f684 100644 --- a/app/clone.c +++ b/app/clone.c @@ -26,20 +26,27 @@ #include "apptypes.h" #include "appenv.h" +#include "draw_core.h" #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpcontext.h" +#include "gimpimage.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" #include "paint_options.h" +#include "patterns.h" +#include "pixel_region.h" #include "clone.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" #include "cursorutil.h" #include "libgimp/gimpintl.h" + #define TARGET_HEIGHT 15 #define TARGET_WIDTH 15 @@ -325,7 +332,7 @@ clone_cursor_update (Tool *tool, gdisplay_untransform_coords (gdisp, (double) mevent->x, (double) mevent->y, &x, &y, TRUE, FALSE); - if ((layer = gimage_get_active_layer (gdisp->gimage))) + if ((layer = gimp_image_get_active_layer (gdisp->gimage))) { int off_x, off_y; drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y); @@ -602,8 +609,8 @@ clone_line_image (GImage *dest, while (width--) { - gimage_get_color (src, drawable_type (s_drawable), rgb, s); - gimage_transform_color (dest, d_drawable, rgb, d, RGB); + gimp_image_get_color (src, drawable_type (s_drawable), rgb, s); + gimp_image_transform_color (dest, d_drawable, rgb, d, RGB); if (has_alpha) d[dest_alpha] = s[src_alpha]; @@ -625,9 +632,9 @@ clone_line_pattern (GImage *dest, int bytes, int width) { - unsigned char *pat, *p; - int color, alpha; - int i; + guchar *pat, *p; + gint color, alpha; + gint i; /* Make sure x, y are positive */ while (x < 0) @@ -646,7 +653,7 @@ clone_line_pattern (GImage *dest, { p = pat + ((i + x) % pattern->mask->width) * pattern->mask->bytes; - gimage_transform_color (dest, drawable, p, d, color); + gimp_image_transform_color (dest, drawable, p, d, color); d[alpha] = OPAQUE_OPACITY; @@ -659,7 +666,8 @@ clone_non_gui_paint_func (PaintCore *paint_core, GimpDrawable *drawable, int state) { - clone_motion (paint_core, drawable, non_gui_src_drawable, &non_gui_pressure_options, + clone_motion (paint_core, drawable, non_gui_src_drawable, + &non_gui_pressure_options, non_gui_type, non_gui_offset_x, non_gui_offset_y); return NULL; diff --git a/app/clone.h b/app/clone.h index ca55cfb2cf..0433bc488e 100644 --- a/app/clone.h +++ b/app/clone.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __CLONE_H__ #define __CLONE_H__ -#include "paint_core.h" -#include "tools.h" typedef enum { @@ -27,11 +26,21 @@ typedef enum PATTERN_CLONE } CloneType; -void * clone_paint_func (PaintCore *, GimpDrawable *, int); -gboolean clone_non_gui (GimpDrawable *, GimpDrawable *, CloneType, - double, double, int, double *); -gboolean clone_non_gui_default (GimpDrawable *, int, double *); -Tool * tools_new_clone (void); -void tools_free_clone (Tool *); +void * clone_paint_func (PaintCore *, + GimpDrawable *, + gint); +gboolean clone_non_gui (GimpDrawable *, + GimpDrawable *, + CloneType, + gdouble, + gdouble, + gint, + gdouble *); +gboolean clone_non_gui_default (GimpDrawable *, + gint, + gdouble *); +Tool * tools_new_clone (void); +void tools_free_clone (Tool *); + #endif /* __CLONE_H__ */ diff --git a/app/color_area.h b/app/color_area.h index 998d2a7eca..be57b96f14 100644 --- a/app/color_area.h +++ b/app/color_area.h @@ -15,13 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __COLOR_AREA_H__ #define __COLOR_AREA_H__ -#include "gdisplayF.h" - - #define FOREGROUND 0 #define BACKGROUND 1 @@ -55,4 +53,5 @@ void color_area_draw_rect (GdkDrawable *drawable, guchar g, guchar b); + #endif /* __COLOR_AREA_H__ */ diff --git a/app/color_balance.c b/app/color_balance.c index 6eec211d82..b74246cfdc 100644 --- a/app/color_balance.c +++ b/app/color_balance.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include "apptypes.h" @@ -27,13 +27,18 @@ #include "color_transfer.h" #include "drawable.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimpui.h" #include "image_map.h" +#include "pixel_region.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpintl.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpcolorspace.h" + #define CYAN_RED 0x1 #define MAGENTA_GREEN 0x2 #define YELLOW_BLUE 0x4 @@ -212,7 +217,7 @@ color_balance_initialize (GDisplay *gdisp) { gint i; - if (! drawable_color (gimage_active_drawable (gdisp->gimage))) + if (! drawable_color (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Color balance operates only on RGB color drawables.")); return; @@ -232,7 +237,7 @@ color_balance_initialize (GDisplay *gdisp) color_balance_dialog->yellow_blue[i] = 0.0; } - color_balance_dialog->drawable = gimage_active_drawable (gdisp->gimage); + color_balance_dialog->drawable = gimp_image_active_drawable (gdisp->gimage); color_balance_dialog->image_map = image_map_create (gdisp, color_balance_dialog->drawable); diff --git a/app/color_balance.h b/app/color_balance.h index 72221fdae8..0f14e5fac4 100644 --- a/app/color_balance.h +++ b/app/color_balance.h @@ -20,9 +20,6 @@ #define __COLOR_BALANCE_H__ -#include "image_map.h" -#include "tools.h" - typedef enum { SHADOWS, diff --git a/app/color_cmds.c b/app/color_cmds.c index a65c407c2e..d2775a59dc 100644 --- a/app/color_cmds.c +++ b/app/color_cmds.c @@ -18,6 +18,12 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ +#include "config.h" + + +#include + +#include "apptypes.h" #include "procedural_db.h" #include "color_balance.h" @@ -27,12 +33,16 @@ #include "equalize.h" #include "gimage.h" #include "gimpdrawable.h" +#include "gimphistogram.h" #include "gimpimage.h" #include "gimplut.h" #include "histogram_tool.h" +#include "histogramwidget.h" #include "hue_saturation.h" #include "invert.h" #include "lut_funcs.h" +#include "pixel_processor.h" +#include "pixel_region.h" #include "threshold.h" static ProcRecord brightness_contrast_proc; diff --git a/app/color_notebook.c b/app/color_notebook.c index 817f5fa7a6..d3370c299d 100644 --- a/app/color_notebook.c +++ b/app/color_notebook.c @@ -21,16 +21,19 @@ #include "config.h" -#include -#include - #include #include #include +#include +#include + +#include "apptypes.h" + #include "color_notebook.h" #include "gimpui.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpcolorselector.h" #include "libgimp/gimpintl.h" diff --git a/app/color_panel.h b/app/color_panel.h index 1b09e00edb..d288aaaf57 100644 --- a/app/color_panel.h +++ b/app/color_panel.h @@ -15,6 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __COLOR_PANEL_H__ #define __COLOR_PANEL_H__ @@ -39,4 +40,5 @@ ColorPanel * color_panel_new (guchar *initial, void color_panel_set_color (ColorPanel *color_panel, guchar *col); + #endif /* __COLOR_PANEL_H__ */ diff --git a/app/color_picker.c b/app/color_picker.c index f8d2b1a2a2..17fda5b902 100644 --- a/app/color_picker.c +++ b/app/color_picker.c @@ -28,15 +28,18 @@ #include "draw_core.h" #include "drawable.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimpui.h" +#include "gimprc.h" #include "cursorutil.h" #include "info_dialog.h" #include "palette.h" #include "tools.h" -#include "gimprc.h" +#include "tool_options.h" #include "libgimp/gimpintl.h" + /* maximum information buffer size */ #define MAX_INFO_BUF 8 @@ -243,7 +246,7 @@ color_picker_button_press (Tool *tool, /* Make the tool active and set it's gdisplay & drawable */ tool->gdisp_ptr = gdisp; - tool->drawable = gimage_active_drawable (gdisp->gimage); + tool->drawable = gimp_image_active_drawable (gdisp->gimage); tool->state = ACTIVE; /* create the info dialog if it doesn't exist */ @@ -428,7 +431,7 @@ color_picker_cursor_update (Tool *tool, gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, FALSE, FALSE); - if (gimage_pick_correlate_layer (gdisp->gimage, x, y)) + if (gimp_image_pick_correlate_layer (gdisp->gimage, x, y)) gdisplay_install_tool_cursor (gdisp, GIMP_COLOR_PICKER_CURSOR, COLOR_PICKER, CURSOR_MODIFIER_NONE, diff --git a/app/color_picker.h b/app/color_picker.h index 6ee830b792..66ba4ded50 100644 --- a/app/color_picker.h +++ b/app/color_picker.h @@ -19,7 +19,8 @@ #ifndef __COLOR_PICKER_H__ #define __COLOR_PICKER_H__ -#include "tools.h" + +extern gint col_value[5]; gboolean pick_color (GimpImage *gimage, @@ -34,7 +35,5 @@ gboolean pick_color (GimpImage *gimage, Tool * tools_new_color_picker (void); void tools_free_color_picker (Tool *tool); -extern gint col_value[5]; - #endif /* __COLOR_PICKER_H__ */ diff --git a/app/color_select.c b/app/color_select.c index d82a7112e4..2235aaac8c 100644 --- a/app/color_select.c +++ b/app/color_select.c @@ -18,6 +18,7 @@ #include "config.h" +#include #include #include @@ -33,9 +34,10 @@ #include "gimprc.h" #include "gimpui.h" #include "session.h" -#include "color_area.h" /* for color_area_draw_rect */ +#include "color_area.h" #include "libgimp/gimpcolorselector.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpintl.h" diff --git a/app/color_select.h b/app/color_select.h index 6486277f7b..0cedaccb0c 100644 --- a/app/color_select.h +++ b/app/color_select.h @@ -15,9 +15,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __COLOR_SELECT_H__ #define __COLOR_SELECT_H__ -void color_select_init (void); + +void color_select_init (void); + #endif /* __COLOR_SELECT_H__ */ diff --git a/app/colormap_dialog.i.c b/app/colormap_dialog.i.c index 25ec33399f..8be9a512b2 100644 --- a/app/colormap_dialog.i.c +++ b/app/colormap_dialog.i.c @@ -11,9 +11,13 @@ #include "dialog_handler.h" #include "colormaps.h" #include "color_area.h" +#include "gdisplay.h" #include "gimpdnd.h" +#include "gimpimage.h" #include "gimpui.h" +#include "procedural_db.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" @@ -715,7 +719,7 @@ ipal_set_image (GimpColormapDialog *ipal, gtk_signal_handler_unblock (GTK_OBJECT (ipal->palette), ipal->event_handler); g_return_if_fail (gimp_set_have (ipal->context, gimage)); - g_return_if_fail (gimage_base_type (gimage) == INDEXED); + g_return_if_fail (gimp_image_base_type (gimage) == INDEXED); ipal->image = gimage; ipal_draw (ipal); gtk_container_queue_resize (GTK_CONTAINER (ipal)); @@ -916,13 +920,13 @@ static void create_image_menu_cb (gpointer im, gpointer d) { - GimpImage* gimage = GIMP_IMAGE (im); - IMCBData* data = (IMCBData *) d; - gchar* image_name; - gchar* menu_item_label; + GimpImage *gimage = GIMP_IMAGE (im); + IMCBData *data = (IMCBData *) d; + gchar *image_name; + gchar *menu_item_label; GtkWidget *menu_item; - if (gimage_base_type (gimage) != INDEXED) + if (gimp_image_base_type (gimage) != INDEXED) return; /* make sure the default index gets set to _something_, if possible */ @@ -938,13 +942,13 @@ create_image_menu_cb (gpointer im, *data->default_index = data->num_items; } - image_name = g_basename (gimage_filename (gimage)); + image_name = g_basename (gimp_image_filename (gimage)); menu_item_label = g_strdup_printf ("%s-%d", image_name, pdb_image_to_id (gimage)); menu_item = gtk_menu_item_new_with_label (menu_item_label); gtk_object_set_data (GTK_OBJECT (menu_item), "colormap_dialog", data->ipal); gtk_signal_connect (GTK_OBJECT (menu_item), "activate", - (GtkSignalFunc) data->callback, + data->callback, gimage); gtk_container_add (GTK_CONTAINER (data->menu), menu_item); gtk_widget_show (menu_item); diff --git a/app/colormaps.c b/app/colormaps.c index 70cc6e9f57..da36425679 100644 --- a/app/colormaps.c +++ b/app/colormaps.c @@ -15,12 +15,18 @@ * 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 "apptypes.h" + #include "app_procs.h" #include "colormaps.h" #include "gimprc.h" + GdkVisual *g_visual = NULL; GdkColormap *g_cmap = NULL; diff --git a/app/colormaps.h b/app/colormaps.h index 8aed6552f8..d0b4ccf4bf 100644 --- a/app/colormaps.h +++ b/app/colormaps.h @@ -15,10 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __COLORMAPS_H__ #define __COLORMAPS_H__ -#include extern GdkVisual *g_visual; extern GdkColormap *g_cmap; @@ -36,9 +36,10 @@ extern gulong g_active_guide_pixel; /* Colormap entries reserved for color cycled marching ants--optional */ extern gulong marching_ants_pixels[8]; -gulong get_color (int red, - int green, - int blue); +gulong get_color (gint red, + gint green, + gint blue); void get_standard_colormaps (void); + #endif /* __COLORMAPS_H__ */ diff --git a/app/commands.c b/app/commands.c index 435754c8ac..01f3a86d85 100644 --- a/app/commands.c +++ b/app/commands.c @@ -18,7 +18,10 @@ #include "config.h" -#include +#include +#include + +#include #include "apptypes.h" @@ -41,13 +44,17 @@ #include "floating_sel.h" #include "gdisplay_ops.h" #include "gimage_mask.h" +#include "gimpcontext.h" #include "gimphelp.h" +#include "gimpimage.h" #include "gimprc.h" #include "gimpui.h" #include "global_edit.h" #include "gradient_select.h" #include "image_render.h" +#include "info_dialog.h" #include "info_window.h" +#include "layer.h" #include "nav_window.h" #include "invert.h" #include "lc_dialog.h" @@ -58,6 +65,7 @@ #include "plug_in.h" #include "resize.h" #include "scale.h" +#include "selection.h" #include "tips_dialog.h" #include "tools.h" #include "undo.h" @@ -66,9 +74,12 @@ #include "gdisplay_color_ui.h" #endif /* DISPLAY_FILTERS */ +#include "libgimp/gimphelpui.h" #include "libgimp/gimpmath.h" + #include "libgimp/gimpintl.h" + #define return_if_no_display(gdisp) \ gdisp = gdisplay_active (); \ if (!gdisp) return @@ -252,7 +263,7 @@ edit_clear_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - edit_clear (gdisp->gimage, gimage_active_drawable (gdisp->gimage)); + edit_clear (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage)); gdisplays_flush (); } @@ -266,7 +277,8 @@ edit_fill_cmd_callback (GtkWidget *widget, return_if_no_display (gdisp); fill_type = (GimpFillType) callback_action; - edit_fill (gdisp->gimage, gimage_active_drawable (gdisp->gimage), fill_type); + edit_fill (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage), + fill_type); gdisplays_flush (); } @@ -277,7 +289,7 @@ edit_stroke_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_mask_stroke (gdisp->gimage, gimage_active_drawable (gdisp->gimage)); + gimage_mask_stroke (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage)); gdisplays_flush (); } @@ -323,7 +335,7 @@ select_float_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_mask_float (gdisp->gimage, gimage_active_drawable (gdisp->gimage), + gimage_mask_float (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage), 0, 0); gdisplays_flush (); } @@ -892,13 +904,13 @@ layers_previous_cmd_callback (GtkWidget *widget, return_if_no_display (gdisp); current_layer = - gimage_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer); + gimp_image_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer); - new_layer = gimage_get_layer_by_index (gdisp->gimage, current_layer - 1); + new_layer = gimp_image_get_layer_by_index (gdisp->gimage, current_layer - 1); if (new_layer) { - gimage_set_active_layer (gdisp->gimage, new_layer); + gimp_image_set_active_layer (gdisp->gimage, new_layer); gdisplays_flush (); layer_select_init (gdisp->gimage, 0, GDK_CURRENT_TIME); } @@ -915,13 +927,13 @@ layers_next_cmd_callback (GtkWidget *widget, return_if_no_display (gdisp); current_layer = - gimage_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer); + gimp_image_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer); - new_layer = gimage_get_layer_by_index (gdisp->gimage, current_layer + 1); + new_layer = gimp_image_get_layer_by_index (gdisp->gimage, current_layer + 1); if (new_layer) { - gimage_set_active_layer (gdisp->gimage, new_layer); + gimp_image_set_active_layer (gdisp->gimage, new_layer); gdisplays_flush (); layer_select_init (gdisp->gimage, 0, GDK_CURRENT_TIME); } @@ -934,7 +946,7 @@ layers_raise_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_raise_layer (gdisp->gimage, gdisp->gimage->active_layer); + gimp_image_raise_layer (gdisp->gimage, gdisp->gimage->active_layer); gdisplays_flush (); } @@ -945,7 +957,7 @@ layers_lower_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_lower_layer (gdisp->gimage, gdisp->gimage->active_layer); + gimp_image_lower_layer (gdisp->gimage, gdisp->gimage->active_layer); gdisplays_flush (); } @@ -956,7 +968,7 @@ layers_raise_to_top_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_raise_layer_to_top (gdisp->gimage, gdisp->gimage->active_layer); + gimp_image_raise_layer_to_top (gdisp->gimage, gdisp->gimage->active_layer); gdisplays_flush (); } @@ -967,7 +979,7 @@ layers_lower_to_bottom_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_lower_layer_to_bottom (gdisp->gimage, gdisp->gimage->active_layer); + gimp_image_lower_layer_to_bottom (gdisp->gimage, gdisp->gimage->active_layer); gdisplays_flush (); } @@ -978,7 +990,7 @@ layers_anchor_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - floating_sel_anchor (gimage_get_active_layer (gdisp->gimage)); + floating_sel_anchor (gimp_image_get_active_layer (gdisp->gimage)); gdisplays_flush (); } @@ -999,7 +1011,7 @@ layers_flatten_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_flatten (gdisp->gimage); + gimp_image_flatten (gdisp->gimage); gdisplays_flush (); } @@ -1086,7 +1098,7 @@ tools_select_cmd_callback (GtkWidget *widget, { (* tool_info[tool_type].init_func) (gdisp); - active_tool->drawable = gimage_active_drawable (gdisp->gimage); + active_tool->drawable = gimp_image_active_drawable (gdisp->gimage); } /* setting the gdisp_ptr here is a HACK to allow the tools' @@ -1316,11 +1328,11 @@ image_resize_callback (GtkWidget *widget, if (image_resize->resize->width > 0 && image_resize->resize->height > 0) { - gimage_resize (gimage, - image_resize->resize->width, - image_resize->resize->height, - image_resize->resize->offset_x, - image_resize->resize->offset_y); + gimp_image_resize (gimage, + image_resize->resize->width, + image_resize->resize->height, + image_resize->resize->offset_x, + image_resize->resize->offset_y); gdisplays_flush (); lc_dialog_update_image_list (); } diff --git a/app/context_manager.c b/app/context_manager.c index 3cbb6a9151..6e3f96103a 100644 --- a/app/context_manager.c +++ b/app/context_manager.c @@ -26,10 +26,12 @@ #include "cursorutil.h" #include "context_manager.h" #include "gdisplay.h" +#include "gimpcontext.h" #include "gimprc.h" #include "paint_options.h" #include "tools.h" + static GimpContext * global_tool_context; #define PAINT_OPTIONS_MASK GIMP_CONTEXT_OPACITY_MASK | \ diff --git a/app/context_manager.h b/app/context_manager.h index c21cff9ddc..23cb24a533 100644 --- a/app/context_manager.h +++ b/app/context_manager.h @@ -15,15 +15,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __CONTEXT_MANAGER_H__ #define __CONTEXT_MANAGER_H__ -#include "gimpcontext.h" -#include "toolsF.h" -void context_manager_init (void); -void context_manager_free (void); +void context_manager_init (void); +void context_manager_free (void); void context_manager_set_global_paint_options (gboolean global); + #endif /* __CONTEXT_MANAGER_H__ */ diff --git a/app/convert.c b/app/convert.c index c5f80585b0..803e6beaba 100644 --- a/app/convert.c +++ b/app/convert.c @@ -89,7 +89,7 @@ #include #include -#include +#include #include "apptypes.h" @@ -103,23 +103,27 @@ #include "floating_sel.h" #include "fsdither.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimpui.h" #include "hue_saturation.h" +#include "layer.h" #include "levels.h" #include "undo.h" #include "palette.h" +#include "palette_entries.h" #include "palette_select.h" +#include "pixel_region.h" #include "posterize.h" #include "threshold.h" +#include "tile_manager.h" +#include "tile_manager_pvt.h" /* ick ick ick. */ #include "libgimp/gimpcolorspace.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" -#include "layer_pvt.h" /* ick. */ -#include "drawable_pvt.h" /* ick ick. */ -#include "tile_manager_pvt.h" /* ick ick ick. */ #define PRECISION_R 6 #define PRECISION_G 6 @@ -550,7 +554,7 @@ convert_to_indexed (GimpImage *gimage) if (dialog->num_cols == 256) { - if ((!gimage_is_empty (gimage)) + if ((!gimp_image_is_empty (gimage)) && ( gimage->layers->next @@ -754,7 +758,7 @@ convert_to_indexed (GimpImage *gimage) /* if the image isn't non-alpha/layered, set the default number of colours to one less than max, to leave room for a transparent index for transparent/animated GIFs */ - if ((!gimage_is_empty (gimage)) + if ((!gimp_image_is_empty (gimage)) && ( gimage->layers->next @@ -1211,7 +1215,7 @@ convert_image (GImage *gimage, gimp_add_busy_cursors(); /* Get the floating layer if one exists */ - floating_layer = gimage_floating_sel (gimage); + floating_layer = gimp_image_floating_sel (gimage); undo_push_group_start (gimage, GIMAGE_MOD_UNDO); @@ -1442,7 +1446,7 @@ convert_image (GImage *gimage, quantobj->delete_func (quantobj); /* Make sure the projection is up to date */ - gimage_projection_realloc (gimage); + gimp_image_projection_realloc (gimage); /* Rigor the floating selection */ if (floating_layer) @@ -1452,7 +1456,7 @@ convert_image (GImage *gimage, /* shrink wrap and update all views */ layer_invalidate_previews (gimage); - gimage_invalidate_preview (gimage); + gimp_image_invalidate_preview (gimage); gdisplays_update_title (gimage); gdisplays_update_full (gimage); diff --git a/app/convert.h b/app/convert.h index 282f4ce9fa..bae74db72c 100644 --- a/app/convert.h +++ b/app/convert.h @@ -19,9 +19,6 @@ #ifndef __CONVERT_H__ #define __CONVERT_H__ -#include "procedural_db.h" -#include "palette_entries.h" - /* adam's extra palette stuff */ typedef enum @@ -47,17 +44,18 @@ typedef enum #define MAXNUMCOLORS 256 /* convert functions */ -void convert_to_rgb (GimpImage *); -void convert_to_grayscale (GimpImage *); -void convert_to_indexed (GimpImage *); +void convert_to_rgb (GimpImage *gimage); +void convert_to_grayscale (GimpImage *gimage); +void convert_to_indexed (GimpImage *gimage); + +void convert_image (GimpImage *gimage, + GimpImageBaseType , + gint num_cols, + ConvertDitherType , + gint alpha_dither, + gint remdups, + ConvertPaletteType ); -void convert_image (GimpImage *, - GimpImageBaseType, - gint num_cols, - ConvertDitherType, - gint alpha_dither, - gint remdups, - ConvertPaletteType); extern PaletteEntries *theCustomPalette; diff --git a/app/convert_cmds.c b/app/convert_cmds.c index f2ed9fcb62..ff86a5fd3c 100644 --- a/app/convert_cmds.c +++ b/app/convert_cmds.c @@ -18,13 +18,19 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ -#include "procedural_db.h" +#include "config.h" #include +#include + +#include "apptypes.h" +#include "procedural_db.h" + #include "convert.h" #include "gimage.h" #include "palette.h" +#include "palette_entries.h" static ProcRecord convert_rgb_proc; static ProcRecord convert_grayscale_proc; diff --git a/app/convolve.c b/app/convolve.c index 558d2a526b..bcf8bd2580 100644 --- a/app/convolve.c +++ b/app/convolve.c @@ -27,11 +27,15 @@ #include "drawable.h" #include "convolve.h" #include "gdisplay.h" +#include "gimpbrush.h" +#include "gimpcontext.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" #include "paint_options.h" +#include "pixel_region.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" #include "gimage.h" @@ -344,7 +348,8 @@ convolve_motion (PaintCore *paint_core, /* If the brush is smaller than the convolution matrix, don't convolve */ - if((paint_core->brush->mask->width < matrix_size) || (paint_core->brush->mask->height < matrix_size)) + if ((paint_core->brush->mask->width < matrix_size) || + (paint_core->brush->mask->height < matrix_size)) return; if (pressure_options->size) diff --git a/app/convolve.h b/app/convolve.h index e93cdf46d6..3a6058ef5c 100644 --- a/app/convolve.h +++ b/app/convolve.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __CONVOLVE_H__ #define __CONVOLVE_H__ -#include "paint_core.h" -#include "tools.h" typedef enum { @@ -29,10 +28,19 @@ typedef enum } ConvolveType; -void * convolve_paint_func (PaintCore *, GimpDrawable *, int); -gboolean convolve_non_gui (GimpDrawable *, double, ConvolveType, int, double *); -gboolean convolve_non_gui_default (GimpDrawable *, int, double *); -Tool * tools_new_convolve (void); -void tools_free_convolve (Tool *); +void * convolve_paint_func (PaintCore *, + GimpDrawable *, + gint ); +gboolean convolve_non_gui (GimpDrawable *, + gdouble , + ConvolveType , + gint , + gdouble *); +gboolean convolve_non_gui_default (GimpDrawable *, + gint , + gdouble *); +Tool * tools_new_convolve (void ); +void tools_free_convolve (Tool *); + #endif /* __CONVOLVE_H__ */ diff --git a/app/core/gimp-edit.c b/app/core/gimp-edit.c index 730bb6390e..6ef4bf7fd1 100644 --- a/app/core/gimp-edit.c +++ b/app/core/gimp-edit.c @@ -20,7 +20,7 @@ #include -#include +#include #include "apptypes.h" @@ -31,17 +31,20 @@ #include "gdisplay.h" #include "gimage.h" #include "gimage_mask.h" +#include "gimpcontext.h" #include "gimpui.h" #include "global_edit.h" #include "layer.h" #include "paint_funcs.h" +#include "pixel_region.h" +#include "tile_manager.h" #include "tools.h" #include "undo.h" #include "libgimp/gimpintl.h" #include "tile_manager_pvt.h" -#include "drawable_pvt.h" + typedef enum { @@ -62,9 +65,9 @@ struct _PasteNamedDlg }; /* The named buffer structure... */ -typedef struct _named_buffer NamedBuffer; +typedef struct _NamedBuffer NamedBuffer; -struct _named_buffer +struct _NamedBuffer { TileManager *buf; gchar *name; diff --git a/app/core/gimp-edit.h b/app/core/gimp-edit.h index 267cc95c2e..aea017ff18 100644 --- a/app/core/gimp-edit.h +++ b/app/core/gimp-edit.h @@ -15,10 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __GLOBAL_EDIT_H__ #define __GLOBAL_EDIT_H__ -#include "gimage.h" TileManager * crop_buffer (TileManager *tiles, gint border); @@ -51,4 +51,5 @@ gboolean named_edit_copy (GDisplay *gdisp); gboolean named_edit_paste (GDisplay *gdisp); void named_buffers_free (void); + #endif /* __GLOBAL_EDIT_H__ */ diff --git a/app/core/gimp-parasites.h b/app/core/gimp-parasites.h index 9cf21a7d8b..8b7be6d268 100644 --- a/app/core/gimp-parasites.h +++ b/app/core/gimp-parasites.h @@ -14,10 +14,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __APP_GIMP_PARASITE_H__ #define __APP_GIMP_PARASITE_H__ -#include "libgimp/gimpparasite.h" void gimp_init_parasites (void); @@ -30,4 +30,5 @@ gchar ** gimp_parasite_list (gint *count); void gimp_parasiterc_save (void); void gimp_parasiterc_load (void); + #endif /* __APP_GIMP_PARASITE_H__ */ diff --git a/app/core/gimpbrush-load.c b/app/core/gimpbrush-load.c index b1bea28395..03687610ad 100644 --- a/app/core/gimpbrush-load.c +++ b/app/core/gimpbrush-load.c @@ -44,9 +44,8 @@ #include "apptypes.h" -#include "libgimp/gimpvector.h" - #include "brush_header.h" +#include "patterns.h" #include "pattern_header.h" #include "gimpbrush.h" #include "gimpbrushlist.h" diff --git a/app/core/gimpbrush.c b/app/core/gimpbrush.c index b1bea28395..03687610ad 100644 --- a/app/core/gimpbrush.c +++ b/app/core/gimpbrush.c @@ -44,9 +44,8 @@ #include "apptypes.h" -#include "libgimp/gimpvector.h" - #include "brush_header.h" +#include "patterns.h" #include "pattern_header.h" #include "gimpbrush.h" #include "gimpbrushlist.h" diff --git a/app/core/gimpbrush.h b/app/core/gimpbrush.h index d6f0cc26f5..19e0e4c2da 100644 --- a/app/core/gimpbrush.h +++ b/app/core/gimpbrush.h @@ -21,9 +21,6 @@ #include "gimpobject.h" -#include "temp_buf.h" - -#include "libgimp/gimpvector.h" typedef struct _GimpBrushClass GimpBrushClass; diff --git a/app/core/gimpbrushgenerated-load.c b/app/core/gimpbrushgenerated-load.c index 8e6dd38eed..11111a6454 100644 --- a/app/core/gimpbrushgenerated-load.c +++ b/app/core/gimpbrushgenerated-load.c @@ -27,7 +27,7 @@ #include #endif -#include +#include #include "apptypes.h" @@ -36,9 +36,11 @@ #include "paint_core.h" #include "gimprc.h" #include "gimpbrush.h" +#include "temp_buf.h" #include "libgimp/gimpmath.h" + #define OVERSAMPLING 5 diff --git a/app/core/gimpbrushgenerated-save.c b/app/core/gimpbrushgenerated-save.c index 8e6dd38eed..11111a6454 100644 --- a/app/core/gimpbrushgenerated-save.c +++ b/app/core/gimpbrushgenerated-save.c @@ -27,7 +27,7 @@ #include #endif -#include +#include #include "apptypes.h" @@ -36,9 +36,11 @@ #include "paint_core.h" #include "gimprc.h" #include "gimpbrush.h" +#include "temp_buf.h" #include "libgimp/gimpmath.h" + #define OVERSAMPLING 5 diff --git a/app/core/gimpbrushgenerated.c b/app/core/gimpbrushgenerated.c index 8e6dd38eed..11111a6454 100644 --- a/app/core/gimpbrushgenerated.c +++ b/app/core/gimpbrushgenerated.c @@ -27,7 +27,7 @@ #include #endif -#include +#include #include "apptypes.h" @@ -36,9 +36,11 @@ #include "paint_core.h" #include "gimprc.h" #include "gimpbrush.h" +#include "temp_buf.h" #include "libgimp/gimpmath.h" + #define OVERSAMPLING 5 diff --git a/app/core/gimpbrushgenerated.h b/app/core/gimpbrushgenerated.h index c4e51bd409..3b9e325165 100644 --- a/app/core/gimpbrushgenerated.h +++ b/app/core/gimpbrushgenerated.h @@ -21,6 +21,7 @@ #ifndef __GIMP_BRUSH_GENERATED_H__ #define __GIMP_BRUSH_GENERATED_H__ + #include "gimpbrush.h" @@ -28,7 +29,6 @@ #define GIMP_BRUSH_GENERATED(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_BRUSH_GENERATED, GimpBrushGenerated)) #define GIMP_IS_BRUSH_GENERATED(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_BRUSH_GENERATED)) -typedef struct _GimpBrushGenerated GimpBrushGenerated; typedef struct _GimpBrushGeneratedClass GimpBrushGeneratedClass; struct _GimpBrushGenerated diff --git a/app/core/gimpbrushpipe.h b/app/core/gimpbrushpipe.h index 0cfe006768..930f449b40 100644 --- a/app/core/gimpbrushpipe.h +++ b/app/core/gimpbrushpipe.h @@ -21,13 +21,7 @@ #define __GIMP_BRUSH_PIPE_H__ -#include "tools.h" -#include "paint_core.h" #include "gimpbrush.h" -#include "temp_buf.h" - - -typedef struct _GimpBrushPipe GimpBrushPipe; #define GIMP_TYPE_BRUSH_PIPE (gimp_brush_pipe_get_type ()) @@ -48,6 +42,8 @@ typedef enum } PipeSelectModes; +typedef struct _GimpBrushPipeClass GimpBrushPipeClass; + struct _GimpBrushPipe { GimpBrush gbrush; /* Also itself a brush */ @@ -65,8 +61,6 @@ struct _GimpBrushPipe GimpBrush *current; /* Currently selected brush */ }; -typedef struct _GimpBrushPipeClass GimpBrushPipeClass; - struct _GimpBrushPipeClass { GimpBrushClass parent_class; diff --git a/app/core/gimpchannel-combine.c b/app/core/gimpchannel-combine.c index 20ecb6bdbf..077577e220 100644 --- a/app/core/gimpchannel-combine.c +++ b/app/core/gimpchannel-combine.c @@ -26,23 +26,25 @@ #include "apptypes.h" #include "appenv.h" +#include "boundary.h" #include "channel.h" #include "drawable.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimage_mask.h" +#include "gimpsignal.h" +#include "gimppreviewcache.h" +#include "gimplut.h" #include "layer.h" #include "paint_funcs.h" #include "parasitelist.h" -#include "temp_buf.h" -#include "undo.h" -#include "gimpsignal.h" -#include "gimppreviewcache.h" - -#include "channel_pvt.h" -#include "tile.h" - -#include "gimplut.h" +#include "pixel_processor.h" +#include "pixel_region.h" #include "lut_funcs.h" +#include "temp_buf.h" +#include "tile.h" +#include "tile_manager.h" +#include "undo.h" #include "libgimp/gimpmath.h" @@ -1004,14 +1006,14 @@ channel_combine_rect (Channel *mask, pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, x, y, x2 - x, y2 - y, TRUE); - if (op == ADD || op == REPLACE) + if (op == CHANNEL_OP_ADD || op == CHANNEL_OP_REPLACE) color = 255; else color = 0; color_region (&maskPR, &color); /* Determine new boundary */ - if (mask->bounds_known && (op == ADD) && !mask->empty) + if (mask->bounds_known && (op == CHANNEL_OP_ADD) && !mask->empty) { if (x < mask->x1) mask->x1 = x; @@ -1022,7 +1024,7 @@ channel_combine_rect (Channel *mask, if ((y + h) > mask->y2) mask->y2 = (y + h); } - else if (op == REPLACE || mask->empty) + else if (op == CHANNEL_OP_REPLACE || mask->empty) { mask->empty = FALSE; mask->x1 = x; @@ -1084,10 +1086,11 @@ channel_combine_ellipse (Channel *mask, switch (op) { - case ADD: case REPLACE: + case CHANNEL_OP_ADD: + case CHANNEL_OP_REPLACE: channel_add_segment (mask, x1, i, (x2 - x1), 255); break; - case SUB : + case CHANNEL_OP_SUB: channel_sub_segment (mask, x1, i, (x2 - x1), 255); break; default: @@ -1127,10 +1130,11 @@ channel_combine_ellipse (Channel *mask, { switch (op) { - case ADD: case REPLACE: + case CHANNEL_OP_ADD: + case CHANNEL_OP_REPLACE: channel_add_segment (mask, x0, i, j - x0, last); break; - case SUB: + case CHANNEL_OP_SUB: channel_sub_segment (mask, x0, i, j - x0, last); break; default: @@ -1152,9 +1156,9 @@ channel_combine_ellipse (Channel *mask, if (last) { - if (op == ADD || op == REPLACE) + if (op == CHANNEL_OP_ADD || op == CHANNEL_OP_REPLACE) channel_add_segment (mask, x0, i, j - x0, last); - else if (op == SUB) + else if (op == CHANNEL_OP_SUB) channel_sub_segment (mask, x0, i, j - x0, last); else g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); @@ -1165,7 +1169,7 @@ channel_combine_ellipse (Channel *mask, } /* Determine new boundary */ - if (mask->bounds_known && (op == ADD) && !mask->empty) + if (mask->bounds_known && (op == CHANNEL_OP_ADD) && !mask->empty) { if (x < mask->x1) mask->x1 = x; @@ -1176,7 +1180,7 @@ channel_combine_ellipse (Channel *mask, if ((y + h) > mask->y2) mask->y2 = (y + h); } - else if (op == REPLACE || mask->empty) + else if (op == CHANNEL_OP_REPLACE || mask->empty) { mask->empty = FALSE; mask->x1 = x; @@ -1293,15 +1297,16 @@ channel_combine_mask (Channel *mask, switch (op) { - case ADD: case REPLACE: + case CHANNEL_OP_ADD: + case CHANNEL_OP_REPLACE: pixel_regions_process_parallel ((p_func) channel_combine_sub_region_add, NULL, 2, &srcPR, &destPR); break; - case SUB: + case CHANNEL_OP_SUB: pixel_regions_process_parallel ((p_func) channel_combine_sub_region_sub, NULL, 2, &srcPR, &destPR); break; - case INTERSECT: + case CHANNEL_OP_INTERSECT: pixel_regions_process_parallel ((p_func) channel_combine_sub_region_intersect, NULL, 2, &srcPR, &destPR); diff --git a/app/core/gimpchannel-combine.h b/app/core/gimpchannel-combine.h index 5ae6ae1fbe..51dd13f148 100644 --- a/app/core/gimpchannel-combine.h +++ b/app/core/gimpchannel-combine.h @@ -19,35 +19,49 @@ #ifndef __CHANNEL_H__ #define __CHANNEL_H__ -#include "apptypes.h" -#include "drawable.h" -#include "boundary.h" -#include "temp_buf.h" -#include "tile_manager.h" + +#include "gimpdrawable.h" /* OPERATIONS */ -typedef enum -{ - ADD, - SUB, - REPLACE, - INTERSECT -} ChannelOps; - /* Half way point where a region is no longer visible in a selection */ #define HALF_WAY 127 /* structure declarations */ -#define GIMP_TYPE_CHANNEL (gimp_channel_get_type ()) -#define GIMP_CHANNEL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_CHANNEL, GimpChannel)) -#define GIMP_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CHANNEL, GimpChannelClass)) -#define GIMP_IS_CHANNEL(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_CHANNEL)) -#define GIMP_IS_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CHANNEL)) +#define GIMP_TYPE_CHANNEL (gimp_channel_get_type ()) +#define GIMP_CHANNEL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_CHANNEL, GimpChannel)) +#define GIMP_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CHANNEL, GimpChannelClass)) +#define GIMP_IS_CHANNEL(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_CHANNEL)) +#define GIMP_IS_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CHANNEL)) + +struct _GimpChannel +{ + GimpDrawable drawable; + + guchar col[3]; /* RGB triplet for channel color */ + gint opacity; /* Channel opacity */ + gboolean show_masked; /* Show masked areas--as */ + /* opposed to selected areas */ + + /* Selection mask variables */ + gboolean boundary_known; /* is the current boundary valid */ + BoundSeg *segs_in; /* outline of selected region */ + BoundSeg *segs_out; /* outline of selected region */ + gint num_segs_in; /* number of lines in boundary */ + gint num_segs_out; /* number of lines in boundary */ + gboolean empty; /* is the region empty? */ + gboolean bounds_known; /* recalculate the bounds? */ + gint x1, y1; /* coordinates for bounding box */ + gint x2, y2; /* lower right hand coordinate */ +}; + +struct _GimpChannelClass +{ + GimpDrawableClass parent_class; +}; -GtkType gimp_channel_get_type (void); /* Special undo type */ @@ -72,6 +86,8 @@ struct _MaskUndo /* function declarations */ +GtkType gimp_channel_get_type (void); + Channel * channel_new (GimpImage *gimage, gint width, gint height, diff --git a/app/core/gimpchannel.c b/app/core/gimpchannel.c index 20ecb6bdbf..077577e220 100644 --- a/app/core/gimpchannel.c +++ b/app/core/gimpchannel.c @@ -26,23 +26,25 @@ #include "apptypes.h" #include "appenv.h" +#include "boundary.h" #include "channel.h" #include "drawable.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimage_mask.h" +#include "gimpsignal.h" +#include "gimppreviewcache.h" +#include "gimplut.h" #include "layer.h" #include "paint_funcs.h" #include "parasitelist.h" -#include "temp_buf.h" -#include "undo.h" -#include "gimpsignal.h" -#include "gimppreviewcache.h" - -#include "channel_pvt.h" -#include "tile.h" - -#include "gimplut.h" +#include "pixel_processor.h" +#include "pixel_region.h" #include "lut_funcs.h" +#include "temp_buf.h" +#include "tile.h" +#include "tile_manager.h" +#include "undo.h" #include "libgimp/gimpmath.h" @@ -1004,14 +1006,14 @@ channel_combine_rect (Channel *mask, pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, x, y, x2 - x, y2 - y, TRUE); - if (op == ADD || op == REPLACE) + if (op == CHANNEL_OP_ADD || op == CHANNEL_OP_REPLACE) color = 255; else color = 0; color_region (&maskPR, &color); /* Determine new boundary */ - if (mask->bounds_known && (op == ADD) && !mask->empty) + if (mask->bounds_known && (op == CHANNEL_OP_ADD) && !mask->empty) { if (x < mask->x1) mask->x1 = x; @@ -1022,7 +1024,7 @@ channel_combine_rect (Channel *mask, if ((y + h) > mask->y2) mask->y2 = (y + h); } - else if (op == REPLACE || mask->empty) + else if (op == CHANNEL_OP_REPLACE || mask->empty) { mask->empty = FALSE; mask->x1 = x; @@ -1084,10 +1086,11 @@ channel_combine_ellipse (Channel *mask, switch (op) { - case ADD: case REPLACE: + case CHANNEL_OP_ADD: + case CHANNEL_OP_REPLACE: channel_add_segment (mask, x1, i, (x2 - x1), 255); break; - case SUB : + case CHANNEL_OP_SUB: channel_sub_segment (mask, x1, i, (x2 - x1), 255); break; default: @@ -1127,10 +1130,11 @@ channel_combine_ellipse (Channel *mask, { switch (op) { - case ADD: case REPLACE: + case CHANNEL_OP_ADD: + case CHANNEL_OP_REPLACE: channel_add_segment (mask, x0, i, j - x0, last); break; - case SUB: + case CHANNEL_OP_SUB: channel_sub_segment (mask, x0, i, j - x0, last); break; default: @@ -1152,9 +1156,9 @@ channel_combine_ellipse (Channel *mask, if (last) { - if (op == ADD || op == REPLACE) + if (op == CHANNEL_OP_ADD || op == CHANNEL_OP_REPLACE) channel_add_segment (mask, x0, i, j - x0, last); - else if (op == SUB) + else if (op == CHANNEL_OP_SUB) channel_sub_segment (mask, x0, i, j - x0, last); else g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); @@ -1165,7 +1169,7 @@ channel_combine_ellipse (Channel *mask, } /* Determine new boundary */ - if (mask->bounds_known && (op == ADD) && !mask->empty) + if (mask->bounds_known && (op == CHANNEL_OP_ADD) && !mask->empty) { if (x < mask->x1) mask->x1 = x; @@ -1176,7 +1180,7 @@ channel_combine_ellipse (Channel *mask, if ((y + h) > mask->y2) mask->y2 = (y + h); } - else if (op == REPLACE || mask->empty) + else if (op == CHANNEL_OP_REPLACE || mask->empty) { mask->empty = FALSE; mask->x1 = x; @@ -1293,15 +1297,16 @@ channel_combine_mask (Channel *mask, switch (op) { - case ADD: case REPLACE: + case CHANNEL_OP_ADD: + case CHANNEL_OP_REPLACE: pixel_regions_process_parallel ((p_func) channel_combine_sub_region_add, NULL, 2, &srcPR, &destPR); break; - case SUB: + case CHANNEL_OP_SUB: pixel_regions_process_parallel ((p_func) channel_combine_sub_region_sub, NULL, 2, &srcPR, &destPR); break; - case INTERSECT: + case CHANNEL_OP_INTERSECT: pixel_regions_process_parallel ((p_func) channel_combine_sub_region_intersect, NULL, 2, &srcPR, &destPR); diff --git a/app/core/gimpchannel.h b/app/core/gimpchannel.h index 5ae6ae1fbe..51dd13f148 100644 --- a/app/core/gimpchannel.h +++ b/app/core/gimpchannel.h @@ -19,35 +19,49 @@ #ifndef __CHANNEL_H__ #define __CHANNEL_H__ -#include "apptypes.h" -#include "drawable.h" -#include "boundary.h" -#include "temp_buf.h" -#include "tile_manager.h" + +#include "gimpdrawable.h" /* OPERATIONS */ -typedef enum -{ - ADD, - SUB, - REPLACE, - INTERSECT -} ChannelOps; - /* Half way point where a region is no longer visible in a selection */ #define HALF_WAY 127 /* structure declarations */ -#define GIMP_TYPE_CHANNEL (gimp_channel_get_type ()) -#define GIMP_CHANNEL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_CHANNEL, GimpChannel)) -#define GIMP_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CHANNEL, GimpChannelClass)) -#define GIMP_IS_CHANNEL(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_CHANNEL)) -#define GIMP_IS_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CHANNEL)) +#define GIMP_TYPE_CHANNEL (gimp_channel_get_type ()) +#define GIMP_CHANNEL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_CHANNEL, GimpChannel)) +#define GIMP_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CHANNEL, GimpChannelClass)) +#define GIMP_IS_CHANNEL(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_CHANNEL)) +#define GIMP_IS_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CHANNEL)) + +struct _GimpChannel +{ + GimpDrawable drawable; + + guchar col[3]; /* RGB triplet for channel color */ + gint opacity; /* Channel opacity */ + gboolean show_masked; /* Show masked areas--as */ + /* opposed to selected areas */ + + /* Selection mask variables */ + gboolean boundary_known; /* is the current boundary valid */ + BoundSeg *segs_in; /* outline of selected region */ + BoundSeg *segs_out; /* outline of selected region */ + gint num_segs_in; /* number of lines in boundary */ + gint num_segs_out; /* number of lines in boundary */ + gboolean empty; /* is the region empty? */ + gboolean bounds_known; /* recalculate the bounds? */ + gint x1, y1; /* coordinates for bounding box */ + gint x2, y2; /* lower right hand coordinate */ +}; + +struct _GimpChannelClass +{ + GimpDrawableClass parent_class; +}; -GtkType gimp_channel_get_type (void); /* Special undo type */ @@ -72,6 +86,8 @@ struct _MaskUndo /* function declarations */ +GtkType gimp_channel_get_type (void); + Channel * channel_new (GimpImage *gimage, gint width, gint height, diff --git a/app/core/gimpcontext.c b/app/core/gimpcontext.c index 72c77b5ce7..23df3bdd74 100644 --- a/app/core/gimpcontext.c +++ b/app/core/gimpcontext.c @@ -25,13 +25,17 @@ #include "apptypes.h" #include "appenv.h" +#include "gdisplay.h" #include "gimpbrush.h" #include "gimpbrushlist.h" #include "gimpcontext.h" #include "gimprc.h" #include "gimpsignal.h" #include "gradient_header.h" +#include "gradient.h" #include "patterns.h" +#include "temp_buf.h" + #define context_return_if_fail(context) \ g_return_if_fail ((context) != NULL); \ @@ -381,7 +385,7 @@ gimp_context_destroy (GtkObject *object) } if (GTK_OBJECT_CLASS (parent_class)->destroy) - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); + GTK_OBJECT_CLASS (parent_class)->destroy (object); context_list = g_slist_remove (context_list, context); } diff --git a/app/core/gimpcontext.h b/app/core/gimpcontext.h index e557a8794d..493b5b70a2 100644 --- a/app/core/gimpcontext.h +++ b/app/core/gimpcontext.h @@ -22,11 +22,7 @@ #define __GIMP_CONTEXT_H__ -#include "apptypes.h" -#include "gdisplay.h" -#include "gradient.h" -#include "patterns.h" -#include "toolsF.h" +#include "gimpobject.h" #define GIMP_TYPE_CONTEXT (gimp_context_get_type ()) @@ -77,7 +73,6 @@ typedef enum GIMP_CONTEXT_PAINT_ARGS_MASK } GimpContextArgMask; -typedef struct _GimpContext GimpContext; typedef struct _GimpContextClass GimpContextClass; struct _GimpContext diff --git a/app/core/gimpdatafiles.c b/app/core/gimpdatafiles.c index 2984131418..5523f08de5 100644 --- a/app/core/gimpdatafiles.c +++ b/app/core/gimpdatafiles.c @@ -18,6 +18,7 @@ * 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 @@ -44,11 +45,14 @@ #endif #endif /* G_OS_WIN32 */ +#include "apptypes.h" + #include "datafiles.h" #include "gimprc.h" #include "libgimp/gimpenv.h" + /***** Functions *****/ static gboolean filestat_valid = FALSE; diff --git a/app/core/gimpdatafiles.h b/app/core/gimpdatafiles.h index d94b463398..d5c721e02b 100644 --- a/app/core/gimpdatafiles.h +++ b/app/core/gimpdatafiles.h @@ -23,11 +23,6 @@ #define __DATAFILES_H__ -#include - - -/***** Types *****/ - typedef enum { INCLUDE_TEMP_DIR = 1 << 0, diff --git a/app/core/gimpdrawable-blend.c b/app/core/gimpdrawable-blend.c index 1f47c174e6..ebb5915c43 100644 --- a/app/core/gimpdrawable-blend.c +++ b/app/core/gimpdrawable-blend.c @@ -33,16 +33,22 @@ #include "errors.h" #include "fuzzy_select.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimage_mask.h" +#include "gimpcontext.h" #include "gimpdnd.h" +#include "gimpprogress.h" #include "gimpui.h" #include "gradient.h" +#include "paint_funcs.h" #include "paint_options.h" +#include "pixel_region.h" #include "selection.h" #include "tools.h" #include "undo.h" #include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpcolorspace.h" #include "libgimp/gimpmath.h" @@ -434,7 +440,7 @@ blend_button_press (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; blend_tool = (BlendTool *) tool->private; - switch (drawable_type (gimage_active_drawable (gdisp->gimage))) + switch (drawable_type (gimp_image_active_drawable (gdisp->gimage))) { case INDEXED_GIMAGE: case INDEXEDA_GIMAGE: g_message (_("Blend: Invalid for indexed images.")); @@ -506,7 +512,7 @@ blend_button_release (Tool *tool, return_vals = procedural_db_run_proc ("gimp_blend", &nreturn_vals, - PDB_DRAWABLE, drawable_ID (gimage_active_drawable (gimage)), + PDB_DRAWABLE, drawable_ID (gimp_image_active_drawable (gimage)), PDB_INT32, (gint32) blend_options->blend_mode, PDB_INT32, (gint32) PAINT_OPTIONS_GET_PAINT_MODE (blend_options), PDB_INT32, (gint32) blend_options->gradient_type, @@ -534,7 +540,7 @@ blend_button_release (Tool *tool, progress = progress_start (gdisp, _("Blending..."), FALSE, NULL, NULL); blend (gimage, - gimage_active_drawable (gimage), + gimp_image_active_drawable (gimage), blend_options->blend_mode, gimp_context_get_paint_mode (NULL), blend_options->gradient_type, @@ -642,7 +648,7 @@ blend_cursor_update (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; - switch (drawable_type (gimage_active_drawable (gdisp->gimage))) + switch (drawable_type (gimp_image_active_drawable (gdisp->gimage))) { case INDEXED_GIMAGE: case INDEXEDA_GIMAGE: @@ -800,8 +806,8 @@ blend (GImage *gimage, progress_callback, progress_data); pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE); - gimage_apply_image (gimage, drawable, &bufPR, TRUE, - (opacity * 255) / 100, paint_mode, NULL, x1, y1); + gimp_image_apply_image (gimage, drawable, &bufPR, TRUE, + (opacity * 255) / 100, paint_mode, NULL, x1, y1); /* update the image */ drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1)); @@ -1186,14 +1192,14 @@ gradient_precalc_shapeburst (GImage *gimage, if (! gimage_mask_is_empty (gimage)) { PixelRegion maskR; - int x1, y1, x2, y2; - int offx, offy; + gint x1, y1, x2, y2; + gint offx, offy; drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2); drawable_offsets (drawable, &offx, &offy); /* the selection mask */ - mask = gimage_get_mask (gimage); + mask = gimp_image_get_mask (gimage); pixel_region_init (&maskR, drawable_data (GIMP_DRAWABLE(mask)), x1 + offx, y1 + offy, (x2 - x1), (y2 - y1), FALSE); diff --git a/app/core/gimpdrawable-desaturate.c b/app/core/gimpdrawable-desaturate.c index 9dcec4941a..263b2775f3 100644 --- a/app/core/gimpdrawable-desaturate.c +++ b/app/core/gimpdrawable-desaturate.c @@ -18,19 +18,20 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" #include "drawable.h" #include "desaturate.h" -#include "paint_funcs.h" #include "gimage.h" +#include "paint_funcs.h" +#include "pixel_region.h" -#include "config.h" #include "libgimp/gimpintl.h" + void image_desaturate (GimpImage *gimage) { @@ -52,24 +53,29 @@ image_desaturate (GimpImage *gimage) void desaturate (GimpDrawable *drawable) { - PixelRegion srcPR, destPR; - unsigned char *src, *s; - unsigned char *dest, *d; - int h, j; - int lightness, min, max; - int has_alpha; - void *pr; - int x1, y1, x2, y2; + PixelRegion srcPR, destPR; + guchar *src, *s; + guchar *dest, *d; + gint h, j; + gint lightness, min, max; + gint has_alpha; + gpointer pr; + gint x1, y1, x2, y2; if (!drawable) return; - has_alpha = drawable_has_alpha (drawable); - drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2); - pixel_region_init (&srcPR, drawable_data (drawable), x1, y1, (x2 - x1), (y2 - y1), FALSE); - pixel_region_init (&destPR, drawable_shadow (drawable), x1, y1, (x2 - x1), (y2 - y1), TRUE); + has_alpha = gimp_drawable_has_alpha (drawable); + gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2); - for (pr = pixel_regions_register (2, &srcPR, &destPR); pr != NULL; pr = pixel_regions_process (pr)) + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + x1, y1, (x2 - x1), (y2 - y1), FALSE); + pixel_region_init (&destPR, gimp_drawable_shadow (drawable), + x1, y1, (x2 - x1), (y2 - y1), TRUE); + + for (pr = pixel_regions_register (2, &srcPR, &destPR); + pr != NULL; + pr = pixel_regions_process (pr)) { src = srcPR.data; dest = destPR.data; diff --git a/app/core/gimpdrawable-desaturate.h b/app/core/gimpdrawable-desaturate.h index 33b5d68153..1b0e8017d3 100644 --- a/app/core/gimpdrawable-desaturate.h +++ b/app/core/gimpdrawable-desaturate.h @@ -20,9 +20,8 @@ #define __DESATURATE_H__ -/* desaturate functions */ -void image_desaturate (GimpImage *gimage); -void desaturate (GimpDrawable *drawable); +void image_desaturate (GimpImage *gimage); +void desaturate (GimpDrawable *drawable); #endif /* __DESATURATE_H__ */ diff --git a/app/core/gimpdrawable-equalize.c b/app/core/gimpdrawable-equalize.c index 435952a437..3fc778037b 100644 --- a/app/core/gimpdrawable-equalize.c +++ b/app/core/gimpdrawable-equalize.c @@ -20,16 +20,20 @@ #include +#include "apptypes.h" + #include "drawable.h" #include "equalize.h" #include "gimage.h" #include "gimplut.h" #include "lut_funcs.h" #include "gimphistogram.h" +#include "pixel_processor.h" +#include "pixel_region.h" -#include "config.h" #include "libgimp/gimpintl.h" + void image_equalize (GimpImage *gimage) { @@ -52,39 +56,41 @@ equalize (GimpImage *gimage, GimpDrawable *drawable, gboolean mask_only) { - PixelRegion srcPR, destPR; - unsigned char *mask; - int has_alpha; - int alpha, bytes; - int x1, y1, x2, y2; + PixelRegion srcPR, destPR; + guchar *mask; + gint has_alpha; + gint alpha, bytes; + gint x1, y1, x2, y2; GimpHistogram *hist; - GimpLut *lut; + GimpLut *lut; mask = NULL; - bytes = drawable_bytes (drawable); - has_alpha = drawable_has_alpha (drawable); - alpha = has_alpha ? (bytes - 1) : bytes; + bytes = gimp_drawable_bytes (drawable); + has_alpha = gimp_drawable_has_alpha (drawable); + alpha = has_alpha ? (bytes - 1) : bytes; - hist = gimp_histogram_new(); - gimp_histogram_calculate_drawable(hist, drawable); + hist = gimp_histogram_new (); + gimp_histogram_calculate_drawable (hist, drawable); /* Build equalization LUT */ lut = eq_histogram_lut_new (hist, bytes); /* Apply the histogram */ - drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2); + gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2); - pixel_region_init (&srcPR, drawable_data (drawable), x1, y1, (x2 - x1), (y2 - y1), FALSE); - pixel_region_init (&destPR, drawable_shadow (drawable), x1, y1, (x2 - x1), (y2 - y1), TRUE); + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + x1, y1, (x2 - x1), (y2 - y1), FALSE); + pixel_region_init (&destPR, gimp_drawable_shadow (drawable), + x1, y1, (x2 - x1), (y2 - y1), TRUE); - pixel_regions_process_parallel((p_func)gimp_lut_process, lut, - 2, &srcPR, &destPR); + pixel_regions_process_parallel ((p_func) gimp_lut_process, lut, + 2, &srcPR, &destPR); - gimp_lut_free(lut); - gimp_histogram_free(hist); + gimp_lut_free (lut); + gimp_histogram_free (hist); - drawable_merge_shadow (drawable, TRUE); + gimp_drawable_merge_shadow (drawable, TRUE); drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1)); } diff --git a/app/core/gimpdrawable-equalize.h b/app/core/gimpdrawable-equalize.h index 5a27a7bc89..efbc8646ef 100644 --- a/app/core/gimpdrawable-equalize.h +++ b/app/core/gimpdrawable-equalize.h @@ -20,11 +20,10 @@ #define __EQUALIZE_H__ -/* equalize functions */ -void image_equalize (GimpImage *gimage); -void equalize (GimpImage *gimage, - GimpDrawable *drawable, - gboolean mask_only); +void image_equalize (GimpImage *gimage); +void equalize (GimpImage *gimage, + GimpDrawable *drawable, + gboolean mask_only); #endif /* __INVERT_H__ */ diff --git a/app/core/gimpdrawable-invert.c b/app/core/gimpdrawable-invert.c index 65d4e71085..005d0d4aaf 100644 --- a/app/core/gimpdrawable-invert.c +++ b/app/core/gimpdrawable-invert.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include "apptypes.h" @@ -28,6 +28,9 @@ #include "gimage.h" #include "gimplut.h" #include "lut_funcs.h" +#include "pixel_processor.h" +#include "pixel_region.h" +#include "procedural_db.h" #include "libgimp/gimpintl.h" diff --git a/app/core/gimpdrawable-invert.h b/app/core/gimpdrawable-invert.h index bc50e0fd8a..921189b4e2 100644 --- a/app/core/gimpdrawable-invert.h +++ b/app/core/gimpdrawable-invert.h @@ -19,9 +19,9 @@ #ifndef __INVERT_H__ #define __INVERT_H__ -/* invert functions */ -void image_invert (GimpImage *); -void invert (GimpDrawable *); + +void image_invert (GimpImage *gimage); +void invert (GimpDrawable *drawable); #endif /* __INVERT_H__ */ diff --git a/app/core/gimpdrawable-offset.c b/app/core/gimpdrawable-offset.c index ab57fa2f97..9097106e66 100644 --- a/app/core/gimpdrawable-offset.c +++ b/app/core/gimpdrawable-offset.c @@ -32,12 +32,16 @@ #include "floating_sel.h" #include "gdisplay.h" #include "gimpcontext.h" +#include "gimage.h" #include "gimpui.h" +#include "layer.h" +#include "paint_funcs.h" #include "parasitelist.h" +#include "path.h" +#include "pixel_region.h" +#include "tile_manager.h" -#include "channel_pvt.h" -#include "layer_pvt.h" - +#include "libgimp/gimphelpui.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" @@ -69,23 +73,23 @@ void channel_ops_offset (GimpImage* gimage) { OffsetDialog *off_d; - GtkWidget *label; - GtkWidget *check; - GtkWidget *push; - GtkWidget *vbox; - GtkWidget *table; - GtkObject *adjustment; - GtkWidget *spinbutton; - GtkWidget *frame; - GtkWidget *radio_button; + GtkWidget *label; + GtkWidget *check; + GtkWidget *push; + GtkWidget *vbox; + GtkWidget *table; + GtkObject *adjustment; + GtkWidget *spinbutton; + GtkWidget *frame; + GtkWidget *radio_button; GimpDrawable *drawable; - drawable = gimage_active_drawable (gimage); + drawable = gimp_image_active_drawable (gimage); off_d = g_new (OffsetDialog, 1); off_d->wrap_around = TRUE; - off_d->fill_type = drawable_has_alpha (drawable); + off_d->fill_type = gimp_drawable_has_alpha (drawable); off_d->gimage = gimage; off_d->dlg = gimp_dialog_new (_("Offset"), "offset", @@ -186,7 +190,7 @@ channel_ops_offset (GimpImage* gimage) gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); - if (!drawable_has_alpha (drawable)) + if (! gimp_drawable_has_alpha (drawable)) gtk_widget_set_sensitive (radio_button, FALSE); /* The by half height and half width option */ @@ -229,8 +233,8 @@ offset (GimpImage *gimage, if (!drawable) return; - width = drawable_width (drawable); - height = drawable_height (drawable); + width = gimp_drawable_width (drawable); + height = gimp_drawable_height (drawable); if (wrap_around) { @@ -252,7 +256,7 @@ offset (GimpImage *gimage, if (offset_x == 0 && offset_y == 0) return; - new_tiles = tile_manager_new (width, height, drawable_bytes (drawable)); + new_tiles = tile_manager_new (width, height, gimp_drawable_bytes (drawable)); if (offset_x >= 0) { src_x = 0; @@ -282,8 +286,10 @@ offset (GimpImage *gimage, /* Copy the center region */ if (width && height) { - pixel_region_init (&srcPR, drawable_data (drawable), src_x, src_y, width, height, FALSE); - pixel_region_init (&destPR, new_tiles, dest_x, dest_y, width, height, TRUE); + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + src_x, src_y, width, height, FALSE); + pixel_region_init (&destPR, new_tiles, + dest_x, dest_y, width, height, TRUE); copy_region (&srcPR, &destPR); } @@ -293,18 +299,18 @@ offset (GimpImage *gimage, { if (offset_x >= 0 && offset_y >= 0) { - src_x = drawable_width (drawable) - offset_x; - src_y = drawable_height (drawable) - offset_y; + src_x = gimp_drawable_width (drawable) - offset_x; + src_y = gimp_drawable_height (drawable) - offset_y; } else if (offset_x >= 0 && offset_y < 0) { - src_x = drawable_width (drawable) - offset_x; + src_x = gimp_drawable_width (drawable) - offset_x; src_y = 0; } else if (offset_x < 0 && offset_y >= 0) { src_x = 0; - src_y = drawable_height (drawable) - offset_y; + src_y = gimp_drawable_height (drawable) - offset_y; } else if (offset_x < 0 && offset_y < 0) { @@ -312,19 +318,22 @@ offset (GimpImage *gimage, src_y = 0; } - dest_x = (src_x + offset_x) % drawable_width (drawable); + dest_x = (src_x + offset_x) % gimp_drawable_width (drawable); if (dest_x < 0) - dest_x = drawable_width (drawable) + dest_x; - dest_y = (src_y + offset_y) % drawable_height (drawable); + dest_x = gimp_drawable_width (drawable) + dest_x; + dest_y = (src_y + offset_y) % gimp_drawable_height (drawable); if (dest_y < 0) - dest_y = drawable_height (drawable) + dest_y; + dest_y = gimp_drawable_height (drawable) + dest_y; /* intersecting region */ if (offset_x != 0 && offset_y != 0) { - pixel_region_init (&srcPR, drawable_data (drawable), src_x, src_y, - ABS (offset_x), ABS (offset_y), FALSE); - pixel_region_init (&destPR, new_tiles, dest_x, dest_y, ABS (offset_x), ABS (offset_y), TRUE); + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + src_x, src_y, ABS (offset_x), ABS (offset_y) + , FALSE); + pixel_region_init (&destPR, new_tiles, + dest_x, dest_y, ABS (offset_x), ABS (offset_y), + TRUE); copy_region (&srcPR, &destPR); } @@ -333,17 +342,28 @@ offset (GimpImage *gimage, { if (offset_y >= 0) { - pixel_region_init (&srcPR, drawable_data (drawable), src_x, 0, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), FALSE); - pixel_region_init (&destPR, new_tiles, dest_x, dest_y + offset_y, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), TRUE); + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + src_x, 0, ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + FALSE); + pixel_region_init (&destPR, new_tiles, + dest_x, dest_y + offset_y, + ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + TRUE); } else if (offset_y < 0) { - pixel_region_init (&srcPR, drawable_data (drawable), src_x, src_y - offset_y, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), FALSE); - pixel_region_init (&destPR, new_tiles, dest_x, 0, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), TRUE); + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + src_x, src_y - offset_y, + ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + FALSE); + pixel_region_init (&destPR, new_tiles, + dest_x, 0, + ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + TRUE); } copy_region (&srcPR, &destPR); @@ -354,21 +374,22 @@ offset (GimpImage *gimage, { if (offset_x >= 0) { - pixel_region_init (&srcPR, drawable_data (drawable), 0, src_y, - drawable_width (drawable) - ABS (offset_x), + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + 0, src_y, + gimp_drawable_width (drawable) - ABS (offset_x), ABS (offset_y), FALSE); pixel_region_init (&destPR, new_tiles, dest_x + offset_x, dest_y, - drawable_width (drawable) - ABS (offset_x), + gimp_drawable_width (drawable) - ABS (offset_x), ABS (offset_y), TRUE); } else if (offset_x < 0) { - pixel_region_init (&srcPR, drawable_data (drawable), + pixel_region_init (&srcPR, gimp_drawable_data (drawable), src_x - offset_x, src_y, - drawable_width (drawable) - ABS (offset_x), + gimp_drawable_width (drawable) - ABS (offset_x), ABS (offset_y), FALSE); pixel_region_init (&destPR, new_tiles, 0, dest_y, - drawable_width (drawable) - ABS (offset_x), + gimp_drawable_width (drawable) - ABS (offset_x), ABS (offset_y), TRUE); } @@ -381,8 +402,8 @@ offset (GimpImage *gimage, if (fill_type == OFFSET_BACKGROUND) { gimp_context_get_background (NULL, &fill[0], &fill[1], &fill[2]); - if (drawable_has_alpha (drawable)) - fill[drawable_bytes (drawable) - 1] = OPAQUE_OPACITY; + if (gimp_drawable_has_alpha (drawable)) + fill[gimp_drawable_bytes (drawable) - 1] = OPAQUE_OPACITY; } if (offset_x >= 0 && offset_y >= 0) @@ -393,17 +414,17 @@ offset (GimpImage *gimage, else if (offset_x >= 0 && offset_y < 0) { dest_x = 0; - dest_y = drawable_height (drawable) + offset_y; + dest_y = gimp_drawable_height (drawable) + offset_y; } else if (offset_x < 0 && offset_y >= 0) { - dest_x = drawable_width (drawable) + offset_x; + dest_x = gimp_drawable_width (drawable) + offset_x; dest_y = 0; } else if (offset_x < 0 && offset_y < 0) { - dest_x = drawable_width (drawable) + offset_x; - dest_y = drawable_height (drawable) + offset_y; + dest_x = gimp_drawable_width (drawable) + offset_x; + dest_y = gimp_drawable_height (drawable) + offset_y; } /* intersecting region */ @@ -418,11 +439,17 @@ offset (GimpImage *gimage, if (offset_x != 0) { if (offset_y >= 0) - pixel_region_init (&destPR, new_tiles, dest_x, dest_y + offset_y, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), TRUE); + pixel_region_init (&destPR, new_tiles, + dest_x, dest_y + offset_y, + ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + TRUE); else if (offset_y < 0) - pixel_region_init (&destPR, new_tiles, dest_x, 0, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), TRUE); + pixel_region_init (&destPR, new_tiles, + dest_x, 0, + ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + TRUE); color_region (&destPR, fill); } @@ -431,11 +458,18 @@ offset (GimpImage *gimage, if (offset_y != 0) { if (offset_x >= 0) - pixel_region_init (&destPR, new_tiles, dest_x + offset_x, dest_y, - drawable_width (drawable) - ABS (offset_x), ABS (offset_y), TRUE); + pixel_region_init (&destPR, new_tiles, + dest_x + offset_x, + dest_y, + gimp_drawable_width (drawable) - ABS (offset_x), + ABS (offset_y), + TRUE); else if (offset_x < 0) - pixel_region_init (&destPR, new_tiles, 0, dest_y, - drawable_width (drawable) - ABS (offset_x), ABS (offset_y), TRUE); + pixel_region_init (&destPR, new_tiles, + 0, dest_y, + gimp_drawable_width (drawable) - ABS (offset_x), + ABS (offset_y), + TRUE); color_region (&destPR, fill); } @@ -443,8 +477,9 @@ offset (GimpImage *gimage, /* push an undo */ drawable_apply_image (drawable, 0, 0, - drawable_width (drawable), drawable_height (drawable), - drawable_data (drawable), FALSE); + gimp_drawable_width (drawable), + gimp_drawable_height (drawable), + gimp_drawable_data (drawable), FALSE); /* swap the tiles */ drawable->tiles = new_tiles; @@ -452,7 +487,8 @@ offset (GimpImage *gimage, /* update the drawable */ drawable_update (drawable, 0, 0, - drawable_width (drawable), drawable_height (drawable)); + gimp_drawable_width (drawable), + gimp_drawable_height (drawable)); } /* @@ -473,7 +509,7 @@ offset_ok_callback (GtkWidget *widget, if ((gimage = off_d->gimage) != NULL) { - drawable = gimage_active_drawable (gimage); + drawable = gimp_image_active_drawable (gimage); offset_x = (gint) RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 0)); @@ -505,7 +541,7 @@ offset_halfheight_callback (GtkWidget *widget, gpointer data) { OffsetDialog *off_d; - GImage *gimage; + GImage *gimage; off_d = (OffsetDialog *) data; gimage = off_d->gimage; @@ -519,27 +555,27 @@ offset_halfheight_callback (GtkWidget *widget, GimpImage * duplicate (GimpImage *gimage) { - PixelRegion srcPR, destPR; - GimpImage *new_gimage; - Layer *layer, *new_layer; - Layer *floating_layer; - Channel *channel, *new_channel; - GSList *list; - GList *glist; - Guide *guide = NULL; - Layer *active_layer = NULL; - Channel *active_channel = NULL; + PixelRegion srcPR, destPR; + GimpImage *new_gimage; + Layer *layer, *new_layer; + Layer *floating_layer; + Channel *channel, *new_channel; + GSList *list; + GList *glist; + Guide *guide = NULL; + Layer *active_layer = NULL; + Channel *active_channel = NULL; GimpDrawable *new_floating_sel_drawable = NULL; GimpDrawable *floating_sel_drawable = NULL; ParasiteList *parasites; - PathList *paths; - gint count; + PathList *paths; + gint count; gimp_add_busy_cursors_until_idle (); /* Create a new image */ new_gimage = gimage_new (gimage->width, gimage->height, gimage->base_type); - gimage_disable_undo (new_gimage); + gimp_image_undo_disable (new_gimage); /* Copy resolution and unit information */ new_gimage->xresolution = gimage->xresolution; @@ -547,7 +583,7 @@ duplicate (GimpImage *gimage) new_gimage->unit = gimage->unit; /* Copy floating layer */ - floating_layer = gimage_floating_sel (gimage); + floating_layer = gimp_image_floating_sel (gimage); if (floating_layer) { floating_sel_relax (floating_layer, FALSE); @@ -591,7 +627,7 @@ duplicate (GimpImage *gimage) /* Add the layer */ if (floating_layer != new_layer) - gimage_add_layer (new_gimage, new_layer, count++); + gimp_image_add_layer (new_gimage, new_layer, count++); } /* Copy the channels */ @@ -617,13 +653,13 @@ duplicate (GimpImage *gimage) new_floating_sel_drawable = GIMP_DRAWABLE(new_channel); /* Add the channel */ - gimage_add_channel (new_gimage, new_channel, count++); + gimp_image_add_channel (new_gimage, new_channel, count++); } /* Copy the selection mask */ - pixel_region_init (&srcPR, drawable_data (GIMP_DRAWABLE(gimage->selection_mask)), + pixel_region_init (&srcPR, gimp_drawable_data (GIMP_DRAWABLE (gimage->selection_mask)), 0, 0, gimage->width, gimage->height, FALSE); - pixel_region_init (&destPR, drawable_data (GIMP_DRAWABLE(new_gimage->selection_mask)), + pixel_region_init (&destPR, gimp_drawable_data (GIMP_DRAWABLE (new_gimage->selection_mask)), 0, 0, gimage->width, gimage->height, TRUE); copy_region (&srcPR, &destPR); new_gimage->selection_mask->bounds_known = FALSE; @@ -700,7 +736,7 @@ duplicate (GimpImage *gimage) gimp_image_set_paths (new_gimage, new_paths); } - gimage_enable_undo (new_gimage); + gimp_image_undo_enable (new_gimage); return new_gimage; } @@ -708,8 +744,9 @@ duplicate (GimpImage *gimage) #ifdef I_LIKE_BOGUS_CRAP static void -duplicate_projection (GimpImage *oldgimage, GimpImage *newgimage, - GDisplay *newgdisplay) +duplicate_projection (GimpImage *oldgimage, + GimpImage *newgimage, + GDisplay *newgdisplay) { PixelRegion srcPR, destPR; diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c index 1347274c21..b7d30b6809 100644 --- a/app/core/gimpdrawable.c +++ b/app/core/gimpdrawable.c @@ -24,13 +24,21 @@ #include -#include "gimpdrawableP.h" +#include "apptypes.h" + +#include "channel.h" +#include "gimpdrawable.h" +#include "layer.h" #include "gimppreviewcache.h" #include "gimpsignal.h" #include "gimage.h" #include "gimage_mask.h" #include "gimpparasite.h" +#include "paint_funcs.h" #include "parasitelist.h" +#include "pixel_region.h" +#include "tile.h" +#include "tile_manager.h" #include "undo.h" #include "libgimp/gimpmath.h" diff --git a/app/core/gimpdrawable.h b/app/core/gimpdrawable.h index cdd1f9f43e..7c5de8ecb6 100644 --- a/app/core/gimpdrawable.h +++ b/app/core/gimpdrawable.h @@ -19,17 +19,49 @@ #ifndef __GIMP_DRAWABLE_H__ #define __GIMP_DRAWABLE_H__ -#include "apptypes.h" + #include "gimpobject.h" -#include "tile_manager.h" -#include "temp_buf.h" - -#include "libgimp/gimpparasite.h" -#define GIMP_TYPE_DRAWABLE (gimp_drawable_get_type ()) -#define GIMP_DRAWABLE(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_DRAWABLE, GimpDrawable)) -#define GIMP_IS_DRAWABLE(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_DRAWABLE)) +#define GIMP_TYPE_DRAWABLE (gimp_drawable_get_type ()) +#define GIMP_DRAWABLE(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_DRAWABLE, GimpDrawable)) +#define GIMP_IS_DRAWABLE(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_DRAWABLE)) +#define GIMP_DRAWABLE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_DRAWABLE, GimpDrawableClass)) +#define GIMP_IS_DRAWABLE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_DRAWABLE)) + + +typedef struct _GimpDrawableClass GimpDrawableClass; + +struct _GimpDrawable +{ + GimpObject data; + + gchar *name; /* name of drawable */ + TileManager *tiles; /* tiles for drawable data */ + gboolean visible; /* controls visibility */ + gint width, height; /* size of drawable */ + gint offset_x, offset_y; /* offset of layer in image */ + + gint bytes; /* bytes per pixel */ + gint ID; /* provides a unique ID */ + guint32 tattoo; /* provides a perminant ID */ + GimpImage *gimage; /* gimage owner */ + GimpImageType type; /* type of drawable */ + gboolean has_alpha; /* drawable has alpha */ + + ParasiteList *parasites; /* Plug-in parasite data */ + + /* Preview variables */ + GSList *preview_cache; /* preview caches of the channel */ + gboolean preview_valid; /* is the preview valid? */ +}; + +struct _GimpDrawableClass +{ + GimpObjectClass parent_class; + + void (* invalidate_preview) (GimpDrawable *drawable); +}; /* drawable access functions */ @@ -94,4 +126,11 @@ GimpImage * gimp_drawable_gimage (const GimpDrawable *drawable); void gimp_drawable_set_gimage (GimpDrawable *drawable, GimpImage *gimage); +void gimp_drawable_configure (GimpDrawable *drawable, + GimpImage *gimage, + gint width, + gint height, + GimpImageType type, + const gchar *name); + #endif /* __GIMP_DRAWABLE_H__ */ diff --git a/app/core/gimpedit.c b/app/core/gimpedit.c index 730bb6390e..6ef4bf7fd1 100644 --- a/app/core/gimpedit.c +++ b/app/core/gimpedit.c @@ -20,7 +20,7 @@ #include -#include +#include #include "apptypes.h" @@ -31,17 +31,20 @@ #include "gdisplay.h" #include "gimage.h" #include "gimage_mask.h" +#include "gimpcontext.h" #include "gimpui.h" #include "global_edit.h" #include "layer.h" #include "paint_funcs.h" +#include "pixel_region.h" +#include "tile_manager.h" #include "tools.h" #include "undo.h" #include "libgimp/gimpintl.h" #include "tile_manager_pvt.h" -#include "drawable_pvt.h" + typedef enum { @@ -62,9 +65,9 @@ struct _PasteNamedDlg }; /* The named buffer structure... */ -typedef struct _named_buffer NamedBuffer; +typedef struct _NamedBuffer NamedBuffer; -struct _named_buffer +struct _NamedBuffer { TileManager *buf; gchar *name; diff --git a/app/core/gimpedit.h b/app/core/gimpedit.h index 267cc95c2e..aea017ff18 100644 --- a/app/core/gimpedit.h +++ b/app/core/gimpedit.h @@ -15,10 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __GLOBAL_EDIT_H__ #define __GLOBAL_EDIT_H__ -#include "gimage.h" TileManager * crop_buffer (TileManager *tiles, gint border); @@ -51,4 +51,5 @@ gboolean named_edit_copy (GDisplay *gdisp); gboolean named_edit_paste (GDisplay *gdisp); void named_buffers_free (void); + #endif /* __GLOBAL_EDIT_H__ */ diff --git a/app/core/gimpimage-convert.c b/app/core/gimpimage-convert.c index c5f80585b0..803e6beaba 100644 --- a/app/core/gimpimage-convert.c +++ b/app/core/gimpimage-convert.c @@ -89,7 +89,7 @@ #include #include -#include +#include #include "apptypes.h" @@ -103,23 +103,27 @@ #include "floating_sel.h" #include "fsdither.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimpui.h" #include "hue_saturation.h" +#include "layer.h" #include "levels.h" #include "undo.h" #include "palette.h" +#include "palette_entries.h" #include "palette_select.h" +#include "pixel_region.h" #include "posterize.h" #include "threshold.h" +#include "tile_manager.h" +#include "tile_manager_pvt.h" /* ick ick ick. */ #include "libgimp/gimpcolorspace.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" -#include "layer_pvt.h" /* ick. */ -#include "drawable_pvt.h" /* ick ick. */ -#include "tile_manager_pvt.h" /* ick ick ick. */ #define PRECISION_R 6 #define PRECISION_G 6 @@ -550,7 +554,7 @@ convert_to_indexed (GimpImage *gimage) if (dialog->num_cols == 256) { - if ((!gimage_is_empty (gimage)) + if ((!gimp_image_is_empty (gimage)) && ( gimage->layers->next @@ -754,7 +758,7 @@ convert_to_indexed (GimpImage *gimage) /* if the image isn't non-alpha/layered, set the default number of colours to one less than max, to leave room for a transparent index for transparent/animated GIFs */ - if ((!gimage_is_empty (gimage)) + if ((!gimp_image_is_empty (gimage)) && ( gimage->layers->next @@ -1211,7 +1215,7 @@ convert_image (GImage *gimage, gimp_add_busy_cursors(); /* Get the floating layer if one exists */ - floating_layer = gimage_floating_sel (gimage); + floating_layer = gimp_image_floating_sel (gimage); undo_push_group_start (gimage, GIMAGE_MOD_UNDO); @@ -1442,7 +1446,7 @@ convert_image (GImage *gimage, quantobj->delete_func (quantobj); /* Make sure the projection is up to date */ - gimage_projection_realloc (gimage); + gimp_image_projection_realloc (gimage); /* Rigor the floating selection */ if (floating_layer) @@ -1452,7 +1456,7 @@ convert_image (GImage *gimage, /* shrink wrap and update all views */ layer_invalidate_previews (gimage); - gimage_invalidate_preview (gimage); + gimp_image_invalidate_preview (gimage); gdisplays_update_title (gimage); gdisplays_update_full (gimage); diff --git a/app/core/gimpimage-convert.h b/app/core/gimpimage-convert.h index 282f4ce9fa..bae74db72c 100644 --- a/app/core/gimpimage-convert.h +++ b/app/core/gimpimage-convert.h @@ -19,9 +19,6 @@ #ifndef __CONVERT_H__ #define __CONVERT_H__ -#include "procedural_db.h" -#include "palette_entries.h" - /* adam's extra palette stuff */ typedef enum @@ -47,17 +44,18 @@ typedef enum #define MAXNUMCOLORS 256 /* convert functions */ -void convert_to_rgb (GimpImage *); -void convert_to_grayscale (GimpImage *); -void convert_to_indexed (GimpImage *); +void convert_to_rgb (GimpImage *gimage); +void convert_to_grayscale (GimpImage *gimage); +void convert_to_indexed (GimpImage *gimage); + +void convert_image (GimpImage *gimage, + GimpImageBaseType , + gint num_cols, + ConvertDitherType , + gint alpha_dither, + gint remdups, + ConvertPaletteType ); -void convert_image (GimpImage *, - GimpImageBaseType, - gint num_cols, - ConvertDitherType, - gint alpha_dither, - gint remdups, - ConvertPaletteType); extern PaletteEntries *theCustomPalette; diff --git a/app/core/gimpimage-duplicate.c b/app/core/gimpimage-duplicate.c index ab57fa2f97..9097106e66 100644 --- a/app/core/gimpimage-duplicate.c +++ b/app/core/gimpimage-duplicate.c @@ -32,12 +32,16 @@ #include "floating_sel.h" #include "gdisplay.h" #include "gimpcontext.h" +#include "gimage.h" #include "gimpui.h" +#include "layer.h" +#include "paint_funcs.h" #include "parasitelist.h" +#include "path.h" +#include "pixel_region.h" +#include "tile_manager.h" -#include "channel_pvt.h" -#include "layer_pvt.h" - +#include "libgimp/gimphelpui.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" @@ -69,23 +73,23 @@ void channel_ops_offset (GimpImage* gimage) { OffsetDialog *off_d; - GtkWidget *label; - GtkWidget *check; - GtkWidget *push; - GtkWidget *vbox; - GtkWidget *table; - GtkObject *adjustment; - GtkWidget *spinbutton; - GtkWidget *frame; - GtkWidget *radio_button; + GtkWidget *label; + GtkWidget *check; + GtkWidget *push; + GtkWidget *vbox; + GtkWidget *table; + GtkObject *adjustment; + GtkWidget *spinbutton; + GtkWidget *frame; + GtkWidget *radio_button; GimpDrawable *drawable; - drawable = gimage_active_drawable (gimage); + drawable = gimp_image_active_drawable (gimage); off_d = g_new (OffsetDialog, 1); off_d->wrap_around = TRUE; - off_d->fill_type = drawable_has_alpha (drawable); + off_d->fill_type = gimp_drawable_has_alpha (drawable); off_d->gimage = gimage; off_d->dlg = gimp_dialog_new (_("Offset"), "offset", @@ -186,7 +190,7 @@ channel_ops_offset (GimpImage* gimage) gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); - if (!drawable_has_alpha (drawable)) + if (! gimp_drawable_has_alpha (drawable)) gtk_widget_set_sensitive (radio_button, FALSE); /* The by half height and half width option */ @@ -229,8 +233,8 @@ offset (GimpImage *gimage, if (!drawable) return; - width = drawable_width (drawable); - height = drawable_height (drawable); + width = gimp_drawable_width (drawable); + height = gimp_drawable_height (drawable); if (wrap_around) { @@ -252,7 +256,7 @@ offset (GimpImage *gimage, if (offset_x == 0 && offset_y == 0) return; - new_tiles = tile_manager_new (width, height, drawable_bytes (drawable)); + new_tiles = tile_manager_new (width, height, gimp_drawable_bytes (drawable)); if (offset_x >= 0) { src_x = 0; @@ -282,8 +286,10 @@ offset (GimpImage *gimage, /* Copy the center region */ if (width && height) { - pixel_region_init (&srcPR, drawable_data (drawable), src_x, src_y, width, height, FALSE); - pixel_region_init (&destPR, new_tiles, dest_x, dest_y, width, height, TRUE); + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + src_x, src_y, width, height, FALSE); + pixel_region_init (&destPR, new_tiles, + dest_x, dest_y, width, height, TRUE); copy_region (&srcPR, &destPR); } @@ -293,18 +299,18 @@ offset (GimpImage *gimage, { if (offset_x >= 0 && offset_y >= 0) { - src_x = drawable_width (drawable) - offset_x; - src_y = drawable_height (drawable) - offset_y; + src_x = gimp_drawable_width (drawable) - offset_x; + src_y = gimp_drawable_height (drawable) - offset_y; } else if (offset_x >= 0 && offset_y < 0) { - src_x = drawable_width (drawable) - offset_x; + src_x = gimp_drawable_width (drawable) - offset_x; src_y = 0; } else if (offset_x < 0 && offset_y >= 0) { src_x = 0; - src_y = drawable_height (drawable) - offset_y; + src_y = gimp_drawable_height (drawable) - offset_y; } else if (offset_x < 0 && offset_y < 0) { @@ -312,19 +318,22 @@ offset (GimpImage *gimage, src_y = 0; } - dest_x = (src_x + offset_x) % drawable_width (drawable); + dest_x = (src_x + offset_x) % gimp_drawable_width (drawable); if (dest_x < 0) - dest_x = drawable_width (drawable) + dest_x; - dest_y = (src_y + offset_y) % drawable_height (drawable); + dest_x = gimp_drawable_width (drawable) + dest_x; + dest_y = (src_y + offset_y) % gimp_drawable_height (drawable); if (dest_y < 0) - dest_y = drawable_height (drawable) + dest_y; + dest_y = gimp_drawable_height (drawable) + dest_y; /* intersecting region */ if (offset_x != 0 && offset_y != 0) { - pixel_region_init (&srcPR, drawable_data (drawable), src_x, src_y, - ABS (offset_x), ABS (offset_y), FALSE); - pixel_region_init (&destPR, new_tiles, dest_x, dest_y, ABS (offset_x), ABS (offset_y), TRUE); + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + src_x, src_y, ABS (offset_x), ABS (offset_y) + , FALSE); + pixel_region_init (&destPR, new_tiles, + dest_x, dest_y, ABS (offset_x), ABS (offset_y), + TRUE); copy_region (&srcPR, &destPR); } @@ -333,17 +342,28 @@ offset (GimpImage *gimage, { if (offset_y >= 0) { - pixel_region_init (&srcPR, drawable_data (drawable), src_x, 0, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), FALSE); - pixel_region_init (&destPR, new_tiles, dest_x, dest_y + offset_y, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), TRUE); + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + src_x, 0, ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + FALSE); + pixel_region_init (&destPR, new_tiles, + dest_x, dest_y + offset_y, + ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + TRUE); } else if (offset_y < 0) { - pixel_region_init (&srcPR, drawable_data (drawable), src_x, src_y - offset_y, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), FALSE); - pixel_region_init (&destPR, new_tiles, dest_x, 0, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), TRUE); + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + src_x, src_y - offset_y, + ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + FALSE); + pixel_region_init (&destPR, new_tiles, + dest_x, 0, + ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + TRUE); } copy_region (&srcPR, &destPR); @@ -354,21 +374,22 @@ offset (GimpImage *gimage, { if (offset_x >= 0) { - pixel_region_init (&srcPR, drawable_data (drawable), 0, src_y, - drawable_width (drawable) - ABS (offset_x), + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + 0, src_y, + gimp_drawable_width (drawable) - ABS (offset_x), ABS (offset_y), FALSE); pixel_region_init (&destPR, new_tiles, dest_x + offset_x, dest_y, - drawable_width (drawable) - ABS (offset_x), + gimp_drawable_width (drawable) - ABS (offset_x), ABS (offset_y), TRUE); } else if (offset_x < 0) { - pixel_region_init (&srcPR, drawable_data (drawable), + pixel_region_init (&srcPR, gimp_drawable_data (drawable), src_x - offset_x, src_y, - drawable_width (drawable) - ABS (offset_x), + gimp_drawable_width (drawable) - ABS (offset_x), ABS (offset_y), FALSE); pixel_region_init (&destPR, new_tiles, 0, dest_y, - drawable_width (drawable) - ABS (offset_x), + gimp_drawable_width (drawable) - ABS (offset_x), ABS (offset_y), TRUE); } @@ -381,8 +402,8 @@ offset (GimpImage *gimage, if (fill_type == OFFSET_BACKGROUND) { gimp_context_get_background (NULL, &fill[0], &fill[1], &fill[2]); - if (drawable_has_alpha (drawable)) - fill[drawable_bytes (drawable) - 1] = OPAQUE_OPACITY; + if (gimp_drawable_has_alpha (drawable)) + fill[gimp_drawable_bytes (drawable) - 1] = OPAQUE_OPACITY; } if (offset_x >= 0 && offset_y >= 0) @@ -393,17 +414,17 @@ offset (GimpImage *gimage, else if (offset_x >= 0 && offset_y < 0) { dest_x = 0; - dest_y = drawable_height (drawable) + offset_y; + dest_y = gimp_drawable_height (drawable) + offset_y; } else if (offset_x < 0 && offset_y >= 0) { - dest_x = drawable_width (drawable) + offset_x; + dest_x = gimp_drawable_width (drawable) + offset_x; dest_y = 0; } else if (offset_x < 0 && offset_y < 0) { - dest_x = drawable_width (drawable) + offset_x; - dest_y = drawable_height (drawable) + offset_y; + dest_x = gimp_drawable_width (drawable) + offset_x; + dest_y = gimp_drawable_height (drawable) + offset_y; } /* intersecting region */ @@ -418,11 +439,17 @@ offset (GimpImage *gimage, if (offset_x != 0) { if (offset_y >= 0) - pixel_region_init (&destPR, new_tiles, dest_x, dest_y + offset_y, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), TRUE); + pixel_region_init (&destPR, new_tiles, + dest_x, dest_y + offset_y, + ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + TRUE); else if (offset_y < 0) - pixel_region_init (&destPR, new_tiles, dest_x, 0, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), TRUE); + pixel_region_init (&destPR, new_tiles, + dest_x, 0, + ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + TRUE); color_region (&destPR, fill); } @@ -431,11 +458,18 @@ offset (GimpImage *gimage, if (offset_y != 0) { if (offset_x >= 0) - pixel_region_init (&destPR, new_tiles, dest_x + offset_x, dest_y, - drawable_width (drawable) - ABS (offset_x), ABS (offset_y), TRUE); + pixel_region_init (&destPR, new_tiles, + dest_x + offset_x, + dest_y, + gimp_drawable_width (drawable) - ABS (offset_x), + ABS (offset_y), + TRUE); else if (offset_x < 0) - pixel_region_init (&destPR, new_tiles, 0, dest_y, - drawable_width (drawable) - ABS (offset_x), ABS (offset_y), TRUE); + pixel_region_init (&destPR, new_tiles, + 0, dest_y, + gimp_drawable_width (drawable) - ABS (offset_x), + ABS (offset_y), + TRUE); color_region (&destPR, fill); } @@ -443,8 +477,9 @@ offset (GimpImage *gimage, /* push an undo */ drawable_apply_image (drawable, 0, 0, - drawable_width (drawable), drawable_height (drawable), - drawable_data (drawable), FALSE); + gimp_drawable_width (drawable), + gimp_drawable_height (drawable), + gimp_drawable_data (drawable), FALSE); /* swap the tiles */ drawable->tiles = new_tiles; @@ -452,7 +487,8 @@ offset (GimpImage *gimage, /* update the drawable */ drawable_update (drawable, 0, 0, - drawable_width (drawable), drawable_height (drawable)); + gimp_drawable_width (drawable), + gimp_drawable_height (drawable)); } /* @@ -473,7 +509,7 @@ offset_ok_callback (GtkWidget *widget, if ((gimage = off_d->gimage) != NULL) { - drawable = gimage_active_drawable (gimage); + drawable = gimp_image_active_drawable (gimage); offset_x = (gint) RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 0)); @@ -505,7 +541,7 @@ offset_halfheight_callback (GtkWidget *widget, gpointer data) { OffsetDialog *off_d; - GImage *gimage; + GImage *gimage; off_d = (OffsetDialog *) data; gimage = off_d->gimage; @@ -519,27 +555,27 @@ offset_halfheight_callback (GtkWidget *widget, GimpImage * duplicate (GimpImage *gimage) { - PixelRegion srcPR, destPR; - GimpImage *new_gimage; - Layer *layer, *new_layer; - Layer *floating_layer; - Channel *channel, *new_channel; - GSList *list; - GList *glist; - Guide *guide = NULL; - Layer *active_layer = NULL; - Channel *active_channel = NULL; + PixelRegion srcPR, destPR; + GimpImage *new_gimage; + Layer *layer, *new_layer; + Layer *floating_layer; + Channel *channel, *new_channel; + GSList *list; + GList *glist; + Guide *guide = NULL; + Layer *active_layer = NULL; + Channel *active_channel = NULL; GimpDrawable *new_floating_sel_drawable = NULL; GimpDrawable *floating_sel_drawable = NULL; ParasiteList *parasites; - PathList *paths; - gint count; + PathList *paths; + gint count; gimp_add_busy_cursors_until_idle (); /* Create a new image */ new_gimage = gimage_new (gimage->width, gimage->height, gimage->base_type); - gimage_disable_undo (new_gimage); + gimp_image_undo_disable (new_gimage); /* Copy resolution and unit information */ new_gimage->xresolution = gimage->xresolution; @@ -547,7 +583,7 @@ duplicate (GimpImage *gimage) new_gimage->unit = gimage->unit; /* Copy floating layer */ - floating_layer = gimage_floating_sel (gimage); + floating_layer = gimp_image_floating_sel (gimage); if (floating_layer) { floating_sel_relax (floating_layer, FALSE); @@ -591,7 +627,7 @@ duplicate (GimpImage *gimage) /* Add the layer */ if (floating_layer != new_layer) - gimage_add_layer (new_gimage, new_layer, count++); + gimp_image_add_layer (new_gimage, new_layer, count++); } /* Copy the channels */ @@ -617,13 +653,13 @@ duplicate (GimpImage *gimage) new_floating_sel_drawable = GIMP_DRAWABLE(new_channel); /* Add the channel */ - gimage_add_channel (new_gimage, new_channel, count++); + gimp_image_add_channel (new_gimage, new_channel, count++); } /* Copy the selection mask */ - pixel_region_init (&srcPR, drawable_data (GIMP_DRAWABLE(gimage->selection_mask)), + pixel_region_init (&srcPR, gimp_drawable_data (GIMP_DRAWABLE (gimage->selection_mask)), 0, 0, gimage->width, gimage->height, FALSE); - pixel_region_init (&destPR, drawable_data (GIMP_DRAWABLE(new_gimage->selection_mask)), + pixel_region_init (&destPR, gimp_drawable_data (GIMP_DRAWABLE (new_gimage->selection_mask)), 0, 0, gimage->width, gimage->height, TRUE); copy_region (&srcPR, &destPR); new_gimage->selection_mask->bounds_known = FALSE; @@ -700,7 +736,7 @@ duplicate (GimpImage *gimage) gimp_image_set_paths (new_gimage, new_paths); } - gimage_enable_undo (new_gimage); + gimp_image_undo_enable (new_gimage); return new_gimage; } @@ -708,8 +744,9 @@ duplicate (GimpImage *gimage) #ifdef I_LIKE_BOGUS_CRAP static void -duplicate_projection (GimpImage *oldgimage, GimpImage *newgimage, - GDisplay *newgdisplay) +duplicate_projection (GimpImage *oldgimage, + GimpImage *newgimage, + GDisplay *newgdisplay) { PixelRegion srcPR, destPR; diff --git a/app/core/gimpimage-guides.c b/app/core/gimpimage-guides.c index b5c83f7333..1b8a798b66 100644 --- a/app/core/gimpimage-guides.c +++ b/app/core/gimpimage-guides.c @@ -24,24 +24,26 @@ #include "apptypes.h" +#include "channel.h" #include "cursorutil.h" #include "drawable.h" #include "floating_sel.h" #include "gdisplay.h" #include "gimage_mask.h" #include "gimpcontext.h" -#include "paint_funcs.h" -#include "parasitelist.h" -#include "undo.h" +#include "gimpimage.h" +#include "gimprc.h" #include "gimpsignal.h" #include "gimpparasite.h" +#include "layer.h" +#include "paint_funcs.h" +#include "parasitelist.h" #include "path.h" -#include "gimprc.h" - +#include "pixel_region.h" +#include "temp_buf.h" #include "tile_manager.h" #include "tile.h" -#include "layer_pvt.h" -#include "drawable_pvt.h" /* ick ick. */ +#include "undo.h" #include "libgimp/gimpcolorspace.h" #include "libgimp/gimplimits.h" @@ -656,7 +658,7 @@ gimp_image_scale (GimpImage *gimage, for (list = remove; list; list = g_slist_next (list)) { layer = list->data; - gimage_remove_layer (gimage, layer); + gimp_image_remove_layer (gimage, layer); } g_slist_free (remove); @@ -3117,7 +3119,7 @@ gimp_image_remove_layer (GimpImage *gimage, if (gimage->active_layer == layer) { if (gimage->layers) - gimage_set_active_layer (gimage, gimage->layer_stack->data); + gimp_image_set_active_layer (gimage, gimage->layer_stack->data); else gimage->active_layer = NULL; } diff --git a/app/core/gimpimage-guides.h b/app/core/gimpimage-guides.h index 40164882b9..7663816033 100644 --- a/app/core/gimpimage-guides.h +++ b/app/core/gimpimage-guides.h @@ -1,5 +1,5 @@ /* The GIMP -- an image manipulation program - * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * Copyright (C) 1995 Spencer Kimball and Peter Mattisbvf * * 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 @@ -16,29 +16,14 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __GIMPIMAGE_H__ -#define __GIMPIMAGE_H__ - -#include "apptypes.h" -#include "procedural_db.h" -#include "boundary.h" -#include "drawable.h" -#include "channel.h" -#include "layer.h" -#include "plug_in.h" -#include "temp_buf.h" -#include "tile_manager.h" -#include "path.h" - -#include "libgimp/gimpparasite.h" -#include "libgimp/gimpunit.h" +#ifndef __GIMP_IMAGE_H__ +#define __GIMP_IMAGE_H__ -#define GIMP_TYPE_IMAGE gimp_image_get_type() -#define GIMP_IMAGE(obj) GTK_CHECK_CAST (obj, GIMP_TYPE_IMAGE, GimpImage) -#define GIMP_IS_IMAGE(obj) GTK_CHECK_TYPE (obj, GIMP_TYPE_IMAGE) - -#define GIMP_IMAGE_TYPE_HAS_ALPHA(t) ((t)==RGBA_GIMAGE || (t)==GRAYA_GIMAGE || (t)==INDEXEDA_GIMAGE) +#include "gimpobject.h" + + +#define MAX_CHANNELS 4 #define GRAY_PIX 0 #define ALPHA_G_PIX 1 @@ -51,19 +36,104 @@ #define COLORMAP_SIZE 768 -typedef enum /*< skip >*/ -{ - ORIENTATION_UNKNOWN, - ORIENTATION_HORIZONTAL, - ORIENTATION_VERTICAL -} InternalOrientationType; -typedef enum +#define GIMP_TYPE_IMAGE (gimp_image_get_type ()) +#define GIMP_IMAGE(obj) (GTK_CHECK_CAST (obj, GIMP_TYPE_IMAGE, GimpImage)) +#define GIMP_IS_IMAGE(obj) (GTK_CHECK_TYPE (obj, GIMP_TYPE_IMAGE)) +#define GIMP_IMAGE_CLASS(klass) (GTK_CHECK_CLASS_CAST (klass, GIMP_TYPE_IMAGE, GimpImageClass)) + +typedef struct _GimpImageClass GimpImageClass; + +struct _GimpImage { - HORIZONTAL, - VERTICAL, - UNKNOWN -} OrientationType; + GimpObject gobject; + + gchar *filename; /* original filename */ + gboolean has_filename; /* has a valid filename */ + PlugInProcDef *save_proc; /* last PDB save proc used */ + + gint width, height; /* width and height attributes */ + gdouble xresolution; /* image x-res, in dpi */ + gdouble yresolution; /* image y-res, in dpi */ + GimpUnit unit; /* image unit */ + GimpImageBaseType base_type; /* base gimp_image type */ + + guchar *cmap; /* colormap--for indexed */ + gint num_cols; /* number of cols--for indexed */ + + gint dirty; /* dirty flag -- # of ops */ + gboolean undo_on; /* Is undo enabled? */ + + gint instance_count; /* number of instances */ + gint disp_count; /* number of displays */ + + Tattoo tattoo_state; /* the next unique tattoo to use*/ + + TileManager *shadow; /* shadow buffer tiles */ + + /* Projection attributes */ + gint construct_flag; /* flag for construction */ + GimpImageType proj_type; /* type of the projection image */ + gint proj_bytes; /* bpp in projection image */ + gint proj_level; /* projection level */ + TileManager *projection; /* The projection--layers & */ + /* channels */ + + GList *guides; /* guides */ + + /* Layer/Channel attributes */ + GSList *layers; /* the list of layers */ + GSList *channels; /* the list of masks */ + GSList *layer_stack; /* the layers in MRU order */ + + Layer *active_layer; /* ID of active layer */ + Channel *active_channel; /* ID of active channel */ + Layer *floating_sel; /* ID of fs layer */ + Channel *selection_mask; /* selection mask channel */ + + ParasiteList *parasites; /* Plug-in parasite data */ + + PathList *paths; /* Paths data for this image */ + + gboolean visible[MAX_CHANNELS]; /* visible channels */ + gboolean active[MAX_CHANNELS]; /* active channels */ + + gboolean by_color_select; /* TRUE if there's an active */ + /* "by color" selection dialog */ + + gboolean qmask_state; /* TRUE if qmask is on */ + gdouble qmask_opacity; /* opacity of the qmask channel */ + guchar qmask_color[3]; /* rgb triplet of the color */ + + /* Undo apparatus */ + GSList *undo_stack; /* stack for undo operations */ + GSList *redo_stack; /* stack for redo operations */ + gint undo_bytes; /* bytes in undo stack */ + gint undo_levels; /* levels in undo stack */ + gint group_count; /* nested undo groups */ + UndoType pushing_undo_group; /* undo group status flag */ + GtkWidget *undo_history; /* history viewer, or NULL */ + + /* Composite preview */ + TempBuf *comp_preview; /* the composite preview */ + gboolean comp_preview_valid[3]; /* preview valid-1/channel */ +}; + +struct _GimpImageClass +{ + GimpObjectClass parent_class; + + void (* clean) (GimpImage *gimage); + void (* dirty) (GimpImage *gimage); + void (* repaint) (GimpImage *gimage); + void (* rename) (GimpImage *gimage); + void (* resize) (GimpImage *gimage); + void (* restructure) (GimpImage *gimage); + void (* colormap_changed) (GimpImage *gimage); + void (* undo_event) (GimpImage *gimage); +}; + +#define GIMP_IMAGE_TYPE_HAS_ALPHA(t) ((t)==RGBA_GIMAGE || (t)==GRAYA_GIMAGE || (t)==INDEXEDA_GIMAGE) typedef enum { @@ -374,4 +444,4 @@ TempBuf * gimp_image_construct_composite_preview (GimpImage *gimage, gint width, gint height); -#endif /* __GIMPIMAGE_H__ */ +#endif /* __GIMP_IMAGE_H__ */ diff --git a/app/core/gimpimage-mask.c b/app/core/gimpimage-mask.c index ad7c74aa36..7bbd540230 100644 --- a/app/core/gimpimage-mask.c +++ b/app/core/gimpimage-mask.c @@ -18,23 +18,27 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" +#include "boundary.h" #include "drawable.h" #include "floating_sel.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimage_mask.h" #include "gimprc.h" #include "layer.h" #include "paint_core.h" +#include "paint_funcs.h" #include "paint_options.h" -#include "undo.h" - -#include "channel_pvt.h" +#include "pixel_region.h" +#include "procedural_db.h" +#include "tile_manager.h" #include "tile_manager_pvt.h" +#include "undo.h" #include "libgimp/gimpintl.h" @@ -51,11 +55,11 @@ gimage_mask_boundary (GImage *gimage, gint *num_segs_out) { GimpDrawable *d; - Layer *layer; - gint x1, y1; - gint x2, y2; + Layer *layer; + gint x1, y1; + gint x2, y2; - if ((layer = gimage_floating_sel (gimage))) + if ((layer = gimp_image_floating_sel (gimage))) { /* If there is a floating selection, then * we need to do some slightly different boundaries. @@ -67,7 +71,7 @@ gimage_mask_boundary (GImage *gimage, */ /* Find the selection mask boundary */ - channel_boundary (gimage_get_mask (gimage), + channel_boundary (gimp_image_get_mask (gimage), segs_in, segs_out, num_segs_in, num_segs_out, 0, 0, 0, 0); @@ -78,16 +82,16 @@ gimage_mask_boundary (GImage *gimage, return TRUE; } /* Otherwise, return the boundary...if a channel is active */ - else if ((d = gimage_active_drawable (gimage)) && + else if ((d = gimp_image_active_drawable (gimage)) && GIMP_IS_CHANNEL (d)) { - return channel_boundary (gimage_get_mask (gimage), + return channel_boundary (gimp_image_get_mask (gimage), segs_in, segs_out, num_segs_in, num_segs_out, 0, 0, gimage->width, gimage->height); } /* if a layer is active, we return multiple boundaries based on the extents */ - else if ((layer = gimage_get_active_layer (gimage))) + else if ((layer = gimp_image_get_active_layer (gimage))) { gint off_x, off_y; @@ -99,7 +103,7 @@ gimage_mask_boundary (GImage *gimage, y2 = CLAMP (off_y + drawable_height (GIMP_DRAWABLE(layer)), 0, gimage->height); - return channel_boundary (gimage_get_mask (gimage), + return channel_boundary (gimp_image_get_mask (gimage), segs_in, segs_out, num_segs_in, num_segs_out, x1, y1, x2, y2); @@ -122,7 +126,7 @@ gimage_mask_bounds (GImage *gimage, gint *x2, gint *y2) { - return channel_bounds (gimage_get_mask (gimage), x1, y1, x2, y2); + return channel_bounds (gimp_image_get_mask (gimage), x1, y1, x2, y2); } @@ -135,14 +139,14 @@ gimage_mask_invalidate (GImage *gimage) /* Turn the current selection off */ gdisplays_selection_visibility (gimage, SelectionOff); - mask = gimage_get_mask (gimage); + mask = gimp_image_get_mask (gimage); mask->boundary_known = FALSE; /* If there is a floating selection, update it's area... * we need to do this since this selection mask can act as an additional * mask in the composition of the floating selection */ - layer = gimage_get_active_layer (gimage); + layer = gimp_image_get_active_layer (gimage); if (layer && layer_is_floating_sel (layer)) drawable_update (GIMP_DRAWABLE(layer), 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height); @@ -154,7 +158,7 @@ gimage_mask_value (GImage *gimage, int x, int y) { - return channel_value (gimage_get_mask (gimage), x, y); + return channel_value (gimp_image_get_mask (gimage), x, y); } @@ -168,7 +172,7 @@ gimage_mask_is_empty (GImage *gimage) if (gimage_mask_stroking) return TRUE; else - return channel_is_empty (gimage_get_mask (gimage)); + return channel_is_empty (gimp_image_get_mask (gimage)); } @@ -177,7 +181,7 @@ gimage_mask_translate (GImage *gimage, gint off_x, gint off_y) { - channel_translate (gimage_get_mask (gimage), off_x, off_y); + channel_translate (gimp_image_get_mask (gimage), off_x, off_y); } @@ -246,11 +250,11 @@ gimage_mask_extract (GImage *gimage, /* get the selection mask */ if (non_empty) - sel_mask = gimage_get_mask (gimage); + sel_mask = gimp_image_get_mask (gimage); else sel_mask = NULL; - gimage_get_background (gimage, drawable, bg); + gimp_image_get_background (gimage, drawable, bg); /* If a cut was specified, and the selection mask is not empty, * push an undo @@ -283,7 +287,7 @@ gimage_mask_extract (GImage *gimage, if (cut_gimage) { /* Clear the region */ - channel_clear (gimage_get_mask (gimage)); + channel_clear (gimp_image_get_mask (gimage)); /* Update the region */ gdisplays_update_area (gimage, tiles->x, tiles->y, @@ -315,16 +319,16 @@ gimage_mask_extract (GImage *gimage, if (layer_is_floating_sel (GIMP_LAYER (drawable))) floating_sel_remove (GIMP_LAYER (drawable)); else - gimage_remove_layer (gimage, GIMP_LAYER (drawable)); + gimp_image_remove_layer (gimage, GIMP_LAYER (drawable)); } else if (cut_gimage && GIMP_IS_LAYER_MASK (drawable)) { - gimage_remove_layer_mask (gimage, - layer_mask_get_layer (GIMP_LAYER_MASK (drawable)), - DISCARD); + gimp_image_remove_layer_mask (gimage, + layer_mask_get_layer (GIMP_LAYER_MASK (drawable)), + DISCARD); } else if (cut_gimage && GIMP_IS_CHANNEL (drawable)) - gimage_remove_channel (gimage, GIMP_CHANNEL (drawable)); + gimp_image_remove_channel (gimage, GIMP_CHANNEL (drawable)); } return tiles; @@ -337,12 +341,12 @@ gimage_mask_float (GImage *gimage, gint off_x, /* optional offset */ gint off_y) { - Layer *layer; - Channel *mask = gimage_get_mask (gimage); - TileManager* tiles; - gboolean non_empty; - gint x1, y1; - gint x2, y2; + Layer *layer; + Channel *mask = gimp_image_get_mask (gimage); + TileManager *tiles; + gboolean non_empty; + gint x1, y1; + gint x2, y2; /* Make sure there is a region to float... */ non_empty = drawable_mask_bounds ( (drawable), &x1, &y1, &x2, &y2); @@ -363,8 +367,8 @@ gimage_mask_float (GImage *gimage, _("Floated Layer"), OPAQUE_OPACITY, NORMAL_MODE); /* Set the offsets */ - GIMP_DRAWABLE(layer)->offset_x = tiles->x + off_x; - GIMP_DRAWABLE(layer)->offset_y = tiles->y + off_y; + GIMP_DRAWABLE (layer)->offset_x = tiles->x + off_x; + GIMP_DRAWABLE (layer)->offset_y = tiles->y + off_y; /* Free the temp buffer */ tile_manager_destroy (tiles); @@ -385,21 +389,21 @@ gimage_mask_float (GImage *gimage, void gimage_mask_clear (GImage *gimage) { - channel_clear (gimage_get_mask (gimage)); + channel_clear (gimp_image_get_mask (gimage)); } void gimage_mask_undo (GImage *gimage) { - channel_push_undo (gimage_get_mask (gimage)); + channel_push_undo (gimp_image_get_mask (gimage)); } void gimage_mask_invert (GImage *gimage) { - channel_invert (gimage_get_mask (gimage)); + channel_invert (gimp_image_get_mask (gimage)); } @@ -409,21 +413,21 @@ gimage_mask_sharpen (GImage *gimage) /* No need to play with the selection visibility * because sharpen will not change the outline */ - channel_sharpen (gimage_get_mask (gimage)); + channel_sharpen (gimp_image_get_mask (gimage)); } void gimage_mask_all (GImage *gimage) { - channel_all (gimage_get_mask (gimage)); + channel_all (gimp_image_get_mask (gimage)); } void gimage_mask_none (GImage *gimage) { - channel_clear (gimage_get_mask (gimage)); + channel_clear (gimp_image_get_mask (gimage)); } @@ -435,14 +439,14 @@ gimage_mask_feather (GImage *gimage, /* push the current mask onto the undo stack--need to do this here because * channel_feather doesn't do it */ - channel_push_undo (gimage_get_mask (gimage)); + channel_push_undo (gimp_image_get_mask (gimage)); /* feather the region */ - channel_feather (gimage_get_mask (gimage), - gimage_get_mask (gimage), + channel_feather (gimp_image_get_mask (gimage), + gimp_image_get_mask (gimage), feather_radius_x, feather_radius_y, - REPLACE, 0, 0); + CHANNEL_OP_REPLACE, 0, 0); } @@ -452,7 +456,7 @@ gimage_mask_border (GImage *gimage, gint border_radius_y) { /* feather the region */ - channel_border (gimage_get_mask (gimage), + channel_border (gimp_image_get_mask (gimage), border_radius_x, border_radius_y); } @@ -464,7 +468,7 @@ gimage_mask_grow (GImage *gimage, int grow_pixels_y) { /* feather the region */ - channel_grow (gimage_get_mask (gimage), + channel_grow (gimp_image_get_mask (gimage), grow_pixels_x, grow_pixels_y); } @@ -477,7 +481,7 @@ gimage_mask_shrink (GImage *gimage, gboolean edge_lock) { /* feather the region */ - channel_shrink (gimage_get_mask (gimage), + channel_shrink (gimp_image_get_mask (gimage), shrink_pixels_x, shrink_pixels_y, edge_lock); @@ -492,7 +496,7 @@ gimage_mask_layer_alpha (GImage *gimage, if (drawable_has_alpha (GIMP_DRAWABLE (layer))) { /* load the mask with the given layer's alpha channel */ - channel_layer_alpha (gimage_get_mask (gimage), layer); + channel_layer_alpha (gimp_image_get_mask (gimage), layer); } else { @@ -511,7 +515,7 @@ gimage_mask_layer_mask (GImage *gimage, if (layer_get_mask (layer)) { /* load the mask with the given layer's alpha channel */ - channel_layer_mask (gimage_get_mask (gimage), layer); + channel_layer_mask (gimp_image_get_mask (gimage), layer); } else { @@ -527,7 +531,7 @@ gimage_mask_load (GImage *gimage, Channel *channel) { /* Load the specified channel to the gimage mask */ - channel_load (gimage_get_mask (gimage), (channel)); + channel_load (gimp_image_get_mask (gimage), (channel)); } @@ -536,11 +540,11 @@ gimage_mask_save (GImage *gimage) { Channel *new_channel; - new_channel = channel_copy (gimage_get_mask (gimage)); + new_channel = channel_copy (gimp_image_get_mask (gimage)); /* saved selections are not visible by default */ GIMP_DRAWABLE(new_channel)->visible = FALSE; - gimage_add_channel (gimage, new_channel, -1); + gimp_image_add_channel (gimage, new_channel, -1); return new_channel; } @@ -642,9 +646,3 @@ gimage_mask_stroke (GImage *gimage, return TRUE; } - - - - - - diff --git a/app/core/gimpimage-mask.h b/app/core/gimpimage-mask.h index 094a6768a5..50a65593e6 100644 --- a/app/core/gimpimage-mask.h +++ b/app/core/gimpimage-mask.h @@ -15,13 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __GIMAGE_MASK_H__ #define __GIMAGE_MASK_H__ -#include "boundary.h" -#include "gimage.h" -/* mask functions */ gboolean gimage_mask_boundary (GImage *gimage, BoundSeg **segs_in, BoundSeg **segs_out, @@ -95,4 +93,5 @@ Channel * gimage_mask_save (GImage *gimage); gboolean gimage_mask_stroke (GImage *gimage, GimpDrawable *drawable); + #endif /* __GIMAGE_MASK_H__ */ diff --git a/app/core/gimpimage-merge.c b/app/core/gimpimage-merge.c index b5c83f7333..1b8a798b66 100644 --- a/app/core/gimpimage-merge.c +++ b/app/core/gimpimage-merge.c @@ -24,24 +24,26 @@ #include "apptypes.h" +#include "channel.h" #include "cursorutil.h" #include "drawable.h" #include "floating_sel.h" #include "gdisplay.h" #include "gimage_mask.h" #include "gimpcontext.h" -#include "paint_funcs.h" -#include "parasitelist.h" -#include "undo.h" +#include "gimpimage.h" +#include "gimprc.h" #include "gimpsignal.h" #include "gimpparasite.h" +#include "layer.h" +#include "paint_funcs.h" +#include "parasitelist.h" #include "path.h" -#include "gimprc.h" - +#include "pixel_region.h" +#include "temp_buf.h" #include "tile_manager.h" #include "tile.h" -#include "layer_pvt.h" -#include "drawable_pvt.h" /* ick ick. */ +#include "undo.h" #include "libgimp/gimpcolorspace.h" #include "libgimp/gimplimits.h" @@ -656,7 +658,7 @@ gimp_image_scale (GimpImage *gimage, for (list = remove; list; list = g_slist_next (list)) { layer = list->data; - gimage_remove_layer (gimage, layer); + gimp_image_remove_layer (gimage, layer); } g_slist_free (remove); @@ -3117,7 +3119,7 @@ gimp_image_remove_layer (GimpImage *gimage, if (gimage->active_layer == layer) { if (gimage->layers) - gimage_set_active_layer (gimage, gimage->layer_stack->data); + gimp_image_set_active_layer (gimage, gimage->layer_stack->data); else gimage->active_layer = NULL; } diff --git a/app/core/gimpimage-merge.h b/app/core/gimpimage-merge.h index 40164882b9..7663816033 100644 --- a/app/core/gimpimage-merge.h +++ b/app/core/gimpimage-merge.h @@ -1,5 +1,5 @@ /* The GIMP -- an image manipulation program - * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * Copyright (C) 1995 Spencer Kimball and Peter Mattisbvf * * 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 @@ -16,29 +16,14 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __GIMPIMAGE_H__ -#define __GIMPIMAGE_H__ - -#include "apptypes.h" -#include "procedural_db.h" -#include "boundary.h" -#include "drawable.h" -#include "channel.h" -#include "layer.h" -#include "plug_in.h" -#include "temp_buf.h" -#include "tile_manager.h" -#include "path.h" - -#include "libgimp/gimpparasite.h" -#include "libgimp/gimpunit.h" +#ifndef __GIMP_IMAGE_H__ +#define __GIMP_IMAGE_H__ -#define GIMP_TYPE_IMAGE gimp_image_get_type() -#define GIMP_IMAGE(obj) GTK_CHECK_CAST (obj, GIMP_TYPE_IMAGE, GimpImage) -#define GIMP_IS_IMAGE(obj) GTK_CHECK_TYPE (obj, GIMP_TYPE_IMAGE) - -#define GIMP_IMAGE_TYPE_HAS_ALPHA(t) ((t)==RGBA_GIMAGE || (t)==GRAYA_GIMAGE || (t)==INDEXEDA_GIMAGE) +#include "gimpobject.h" + + +#define MAX_CHANNELS 4 #define GRAY_PIX 0 #define ALPHA_G_PIX 1 @@ -51,19 +36,104 @@ #define COLORMAP_SIZE 768 -typedef enum /*< skip >*/ -{ - ORIENTATION_UNKNOWN, - ORIENTATION_HORIZONTAL, - ORIENTATION_VERTICAL -} InternalOrientationType; -typedef enum +#define GIMP_TYPE_IMAGE (gimp_image_get_type ()) +#define GIMP_IMAGE(obj) (GTK_CHECK_CAST (obj, GIMP_TYPE_IMAGE, GimpImage)) +#define GIMP_IS_IMAGE(obj) (GTK_CHECK_TYPE (obj, GIMP_TYPE_IMAGE)) +#define GIMP_IMAGE_CLASS(klass) (GTK_CHECK_CLASS_CAST (klass, GIMP_TYPE_IMAGE, GimpImageClass)) + +typedef struct _GimpImageClass GimpImageClass; + +struct _GimpImage { - HORIZONTAL, - VERTICAL, - UNKNOWN -} OrientationType; + GimpObject gobject; + + gchar *filename; /* original filename */ + gboolean has_filename; /* has a valid filename */ + PlugInProcDef *save_proc; /* last PDB save proc used */ + + gint width, height; /* width and height attributes */ + gdouble xresolution; /* image x-res, in dpi */ + gdouble yresolution; /* image y-res, in dpi */ + GimpUnit unit; /* image unit */ + GimpImageBaseType base_type; /* base gimp_image type */ + + guchar *cmap; /* colormap--for indexed */ + gint num_cols; /* number of cols--for indexed */ + + gint dirty; /* dirty flag -- # of ops */ + gboolean undo_on; /* Is undo enabled? */ + + gint instance_count; /* number of instances */ + gint disp_count; /* number of displays */ + + Tattoo tattoo_state; /* the next unique tattoo to use*/ + + TileManager *shadow; /* shadow buffer tiles */ + + /* Projection attributes */ + gint construct_flag; /* flag for construction */ + GimpImageType proj_type; /* type of the projection image */ + gint proj_bytes; /* bpp in projection image */ + gint proj_level; /* projection level */ + TileManager *projection; /* The projection--layers & */ + /* channels */ + + GList *guides; /* guides */ + + /* Layer/Channel attributes */ + GSList *layers; /* the list of layers */ + GSList *channels; /* the list of masks */ + GSList *layer_stack; /* the layers in MRU order */ + + Layer *active_layer; /* ID of active layer */ + Channel *active_channel; /* ID of active channel */ + Layer *floating_sel; /* ID of fs layer */ + Channel *selection_mask; /* selection mask channel */ + + ParasiteList *parasites; /* Plug-in parasite data */ + + PathList *paths; /* Paths data for this image */ + + gboolean visible[MAX_CHANNELS]; /* visible channels */ + gboolean active[MAX_CHANNELS]; /* active channels */ + + gboolean by_color_select; /* TRUE if there's an active */ + /* "by color" selection dialog */ + + gboolean qmask_state; /* TRUE if qmask is on */ + gdouble qmask_opacity; /* opacity of the qmask channel */ + guchar qmask_color[3]; /* rgb triplet of the color */ + + /* Undo apparatus */ + GSList *undo_stack; /* stack for undo operations */ + GSList *redo_stack; /* stack for redo operations */ + gint undo_bytes; /* bytes in undo stack */ + gint undo_levels; /* levels in undo stack */ + gint group_count; /* nested undo groups */ + UndoType pushing_undo_group; /* undo group status flag */ + GtkWidget *undo_history; /* history viewer, or NULL */ + + /* Composite preview */ + TempBuf *comp_preview; /* the composite preview */ + gboolean comp_preview_valid[3]; /* preview valid-1/channel */ +}; + +struct _GimpImageClass +{ + GimpObjectClass parent_class; + + void (* clean) (GimpImage *gimage); + void (* dirty) (GimpImage *gimage); + void (* repaint) (GimpImage *gimage); + void (* rename) (GimpImage *gimage); + void (* resize) (GimpImage *gimage); + void (* restructure) (GimpImage *gimage); + void (* colormap_changed) (GimpImage *gimage); + void (* undo_event) (GimpImage *gimage); +}; + +#define GIMP_IMAGE_TYPE_HAS_ALPHA(t) ((t)==RGBA_GIMAGE || (t)==GRAYA_GIMAGE || (t)==INDEXEDA_GIMAGE) typedef enum { @@ -374,4 +444,4 @@ TempBuf * gimp_image_construct_composite_preview (GimpImage *gimage, gint width, gint height); -#endif /* __GIMPIMAGE_H__ */ +#endif /* __GIMP_IMAGE_H__ */ diff --git a/app/core/gimpimage-projection.c b/app/core/gimpimage-projection.c index b5c83f7333..1b8a798b66 100644 --- a/app/core/gimpimage-projection.c +++ b/app/core/gimpimage-projection.c @@ -24,24 +24,26 @@ #include "apptypes.h" +#include "channel.h" #include "cursorutil.h" #include "drawable.h" #include "floating_sel.h" #include "gdisplay.h" #include "gimage_mask.h" #include "gimpcontext.h" -#include "paint_funcs.h" -#include "parasitelist.h" -#include "undo.h" +#include "gimpimage.h" +#include "gimprc.h" #include "gimpsignal.h" #include "gimpparasite.h" +#include "layer.h" +#include "paint_funcs.h" +#include "parasitelist.h" #include "path.h" -#include "gimprc.h" - +#include "pixel_region.h" +#include "temp_buf.h" #include "tile_manager.h" #include "tile.h" -#include "layer_pvt.h" -#include "drawable_pvt.h" /* ick ick. */ +#include "undo.h" #include "libgimp/gimpcolorspace.h" #include "libgimp/gimplimits.h" @@ -656,7 +658,7 @@ gimp_image_scale (GimpImage *gimage, for (list = remove; list; list = g_slist_next (list)) { layer = list->data; - gimage_remove_layer (gimage, layer); + gimp_image_remove_layer (gimage, layer); } g_slist_free (remove); @@ -3117,7 +3119,7 @@ gimp_image_remove_layer (GimpImage *gimage, if (gimage->active_layer == layer) { if (gimage->layers) - gimage_set_active_layer (gimage, gimage->layer_stack->data); + gimp_image_set_active_layer (gimage, gimage->layer_stack->data); else gimage->active_layer = NULL; } diff --git a/app/core/gimpimage-projection.h b/app/core/gimpimage-projection.h index 40164882b9..7663816033 100644 --- a/app/core/gimpimage-projection.h +++ b/app/core/gimpimage-projection.h @@ -1,5 +1,5 @@ /* The GIMP -- an image manipulation program - * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * Copyright (C) 1995 Spencer Kimball and Peter Mattisbvf * * 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 @@ -16,29 +16,14 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __GIMPIMAGE_H__ -#define __GIMPIMAGE_H__ - -#include "apptypes.h" -#include "procedural_db.h" -#include "boundary.h" -#include "drawable.h" -#include "channel.h" -#include "layer.h" -#include "plug_in.h" -#include "temp_buf.h" -#include "tile_manager.h" -#include "path.h" - -#include "libgimp/gimpparasite.h" -#include "libgimp/gimpunit.h" +#ifndef __GIMP_IMAGE_H__ +#define __GIMP_IMAGE_H__ -#define GIMP_TYPE_IMAGE gimp_image_get_type() -#define GIMP_IMAGE(obj) GTK_CHECK_CAST (obj, GIMP_TYPE_IMAGE, GimpImage) -#define GIMP_IS_IMAGE(obj) GTK_CHECK_TYPE (obj, GIMP_TYPE_IMAGE) - -#define GIMP_IMAGE_TYPE_HAS_ALPHA(t) ((t)==RGBA_GIMAGE || (t)==GRAYA_GIMAGE || (t)==INDEXEDA_GIMAGE) +#include "gimpobject.h" + + +#define MAX_CHANNELS 4 #define GRAY_PIX 0 #define ALPHA_G_PIX 1 @@ -51,19 +36,104 @@ #define COLORMAP_SIZE 768 -typedef enum /*< skip >*/ -{ - ORIENTATION_UNKNOWN, - ORIENTATION_HORIZONTAL, - ORIENTATION_VERTICAL -} InternalOrientationType; -typedef enum +#define GIMP_TYPE_IMAGE (gimp_image_get_type ()) +#define GIMP_IMAGE(obj) (GTK_CHECK_CAST (obj, GIMP_TYPE_IMAGE, GimpImage)) +#define GIMP_IS_IMAGE(obj) (GTK_CHECK_TYPE (obj, GIMP_TYPE_IMAGE)) +#define GIMP_IMAGE_CLASS(klass) (GTK_CHECK_CLASS_CAST (klass, GIMP_TYPE_IMAGE, GimpImageClass)) + +typedef struct _GimpImageClass GimpImageClass; + +struct _GimpImage { - HORIZONTAL, - VERTICAL, - UNKNOWN -} OrientationType; + GimpObject gobject; + + gchar *filename; /* original filename */ + gboolean has_filename; /* has a valid filename */ + PlugInProcDef *save_proc; /* last PDB save proc used */ + + gint width, height; /* width and height attributes */ + gdouble xresolution; /* image x-res, in dpi */ + gdouble yresolution; /* image y-res, in dpi */ + GimpUnit unit; /* image unit */ + GimpImageBaseType base_type; /* base gimp_image type */ + + guchar *cmap; /* colormap--for indexed */ + gint num_cols; /* number of cols--for indexed */ + + gint dirty; /* dirty flag -- # of ops */ + gboolean undo_on; /* Is undo enabled? */ + + gint instance_count; /* number of instances */ + gint disp_count; /* number of displays */ + + Tattoo tattoo_state; /* the next unique tattoo to use*/ + + TileManager *shadow; /* shadow buffer tiles */ + + /* Projection attributes */ + gint construct_flag; /* flag for construction */ + GimpImageType proj_type; /* type of the projection image */ + gint proj_bytes; /* bpp in projection image */ + gint proj_level; /* projection level */ + TileManager *projection; /* The projection--layers & */ + /* channels */ + + GList *guides; /* guides */ + + /* Layer/Channel attributes */ + GSList *layers; /* the list of layers */ + GSList *channels; /* the list of masks */ + GSList *layer_stack; /* the layers in MRU order */ + + Layer *active_layer; /* ID of active layer */ + Channel *active_channel; /* ID of active channel */ + Layer *floating_sel; /* ID of fs layer */ + Channel *selection_mask; /* selection mask channel */ + + ParasiteList *parasites; /* Plug-in parasite data */ + + PathList *paths; /* Paths data for this image */ + + gboolean visible[MAX_CHANNELS]; /* visible channels */ + gboolean active[MAX_CHANNELS]; /* active channels */ + + gboolean by_color_select; /* TRUE if there's an active */ + /* "by color" selection dialog */ + + gboolean qmask_state; /* TRUE if qmask is on */ + gdouble qmask_opacity; /* opacity of the qmask channel */ + guchar qmask_color[3]; /* rgb triplet of the color */ + + /* Undo apparatus */ + GSList *undo_stack; /* stack for undo operations */ + GSList *redo_stack; /* stack for redo operations */ + gint undo_bytes; /* bytes in undo stack */ + gint undo_levels; /* levels in undo stack */ + gint group_count; /* nested undo groups */ + UndoType pushing_undo_group; /* undo group status flag */ + GtkWidget *undo_history; /* history viewer, or NULL */ + + /* Composite preview */ + TempBuf *comp_preview; /* the composite preview */ + gboolean comp_preview_valid[3]; /* preview valid-1/channel */ +}; + +struct _GimpImageClass +{ + GimpObjectClass parent_class; + + void (* clean) (GimpImage *gimage); + void (* dirty) (GimpImage *gimage); + void (* repaint) (GimpImage *gimage); + void (* rename) (GimpImage *gimage); + void (* resize) (GimpImage *gimage); + void (* restructure) (GimpImage *gimage); + void (* colormap_changed) (GimpImage *gimage); + void (* undo_event) (GimpImage *gimage); +}; + +#define GIMP_IMAGE_TYPE_HAS_ALPHA(t) ((t)==RGBA_GIMAGE || (t)==GRAYA_GIMAGE || (t)==INDEXEDA_GIMAGE) typedef enum { @@ -374,4 +444,4 @@ TempBuf * gimp_image_construct_composite_preview (GimpImage *gimage, gint width, gint height); -#endif /* __GIMPIMAGE_H__ */ +#endif /* __GIMP_IMAGE_H__ */ diff --git a/app/core/gimpimage-qmask.c b/app/core/gimpimage-qmask.c index 34be73025d..1c4af4b114 100644 --- a/app/core/gimpimage-qmask.c +++ b/app/core/gimpimage-qmask.c @@ -29,11 +29,12 @@ #include "appenv.h" #include "channel.h" #include "color_panel.h" +#include "drawable.h" #include "floating_sel.h" -#include "gdisplayF.h" -#include "gimpcontext.h" +#include "gdisplay.h" #include "gimage_mask.h" #include "gimpimage.h" +#include "gimpcontext.h" #include "gimpui.h" #include "global_edit.h" #include "qmask.h" @@ -163,7 +164,7 @@ qmask_deactivate (GtkWidget *widget, the qmask_state to FALSE */ undo_push_qmask (gimg); gimage_mask_load (gimg, gmask); - gimage_remove_channel (gimg, gmask); + gimp_image_remove_channel (gimg, gmask); undo_push_group_end (gimg); } @@ -207,9 +208,9 @@ qmask_activate (GtkWidget *widget, undo_push_group_start (gimg, QMASK_UNDO); - if (gimage_mask_is_empty(gimg)) + if (gimage_mask_is_empty (gimg)) { - if ((layer = gimage_floating_sel (gimg))) + if ((layer = gimp_image_floating_sel (gimg))) { floating_sel_to_layer (layer); } @@ -217,7 +218,7 @@ qmask_activate (GtkWidget *widget, gmask = channel_new (gimg, gimg->width, gimg->height, - "Qmask", + "Qmask", (gint)(255*opacity)/100, color); gimp_image_add_channel (gimg, gmask, 0); @@ -225,7 +226,7 @@ qmask_activate (GtkWidget *widget, } else { /* if selection */ - gmask = channel_copy (gimage_get_mask (gimg)); + gmask = channel_copy (gimp_image_get_mask (gimg)); gimp_image_add_channel (gimg, gmask, 0); channel_set_color (gmask, color); drawable_set_name (GIMP_DRAWABLE (gmask), "Qmask"); @@ -331,12 +332,12 @@ edit_qmask_query_ok_callback (GtkWidget *widget, gpointer client_data) { EditQmaskOptions *options; - Channel *channel; - guchar *tmpcolp; - guchar tmpcol[3]; - gboolean update = FALSE; - gint opacity; - gint i; + Channel *channel; + const guchar *tmpcolp; + guchar tmpcol[3]; + gboolean update = FALSE; + gint opacity; + gint i; options = (EditQmaskOptions *) client_data; channel = gimp_image_get_channel_by_name (options->gimage, "Qmask"); @@ -348,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget, { update = TRUE; } - tmpcolp = channel_get_color(channel); + tmpcolp = channel_get_color (channel); for (i = 0; i < 3; i++) { /* don't update if color hasn't changed */ tmpcol[i] = tmpcolp[i]; /* initialize to same values */ diff --git a/app/core/gimpimage-quick-mask.c b/app/core/gimpimage-quick-mask.c index 34be73025d..1c4af4b114 100644 --- a/app/core/gimpimage-quick-mask.c +++ b/app/core/gimpimage-quick-mask.c @@ -29,11 +29,12 @@ #include "appenv.h" #include "channel.h" #include "color_panel.h" +#include "drawable.h" #include "floating_sel.h" -#include "gdisplayF.h" -#include "gimpcontext.h" +#include "gdisplay.h" #include "gimage_mask.h" #include "gimpimage.h" +#include "gimpcontext.h" #include "gimpui.h" #include "global_edit.h" #include "qmask.h" @@ -163,7 +164,7 @@ qmask_deactivate (GtkWidget *widget, the qmask_state to FALSE */ undo_push_qmask (gimg); gimage_mask_load (gimg, gmask); - gimage_remove_channel (gimg, gmask); + gimp_image_remove_channel (gimg, gmask); undo_push_group_end (gimg); } @@ -207,9 +208,9 @@ qmask_activate (GtkWidget *widget, undo_push_group_start (gimg, QMASK_UNDO); - if (gimage_mask_is_empty(gimg)) + if (gimage_mask_is_empty (gimg)) { - if ((layer = gimage_floating_sel (gimg))) + if ((layer = gimp_image_floating_sel (gimg))) { floating_sel_to_layer (layer); } @@ -217,7 +218,7 @@ qmask_activate (GtkWidget *widget, gmask = channel_new (gimg, gimg->width, gimg->height, - "Qmask", + "Qmask", (gint)(255*opacity)/100, color); gimp_image_add_channel (gimg, gmask, 0); @@ -225,7 +226,7 @@ qmask_activate (GtkWidget *widget, } else { /* if selection */ - gmask = channel_copy (gimage_get_mask (gimg)); + gmask = channel_copy (gimp_image_get_mask (gimg)); gimp_image_add_channel (gimg, gmask, 0); channel_set_color (gmask, color); drawable_set_name (GIMP_DRAWABLE (gmask), "Qmask"); @@ -331,12 +332,12 @@ edit_qmask_query_ok_callback (GtkWidget *widget, gpointer client_data) { EditQmaskOptions *options; - Channel *channel; - guchar *tmpcolp; - guchar tmpcol[3]; - gboolean update = FALSE; - gint opacity; - gint i; + Channel *channel; + const guchar *tmpcolp; + guchar tmpcol[3]; + gboolean update = FALSE; + gint opacity; + gint i; options = (EditQmaskOptions *) client_data; channel = gimp_image_get_channel_by_name (options->gimage, "Qmask"); @@ -348,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget, { update = TRUE; } - tmpcolp = channel_get_color(channel); + tmpcolp = channel_get_color (channel); for (i = 0; i < 3; i++) { /* don't update if color hasn't changed */ tmpcol[i] = tmpcolp[i]; /* initialize to same values */ diff --git a/app/core/gimpimage-resize.c b/app/core/gimpimage-resize.c index b5c83f7333..1b8a798b66 100644 --- a/app/core/gimpimage-resize.c +++ b/app/core/gimpimage-resize.c @@ -24,24 +24,26 @@ #include "apptypes.h" +#include "channel.h" #include "cursorutil.h" #include "drawable.h" #include "floating_sel.h" #include "gdisplay.h" #include "gimage_mask.h" #include "gimpcontext.h" -#include "paint_funcs.h" -#include "parasitelist.h" -#include "undo.h" +#include "gimpimage.h" +#include "gimprc.h" #include "gimpsignal.h" #include "gimpparasite.h" +#include "layer.h" +#include "paint_funcs.h" +#include "parasitelist.h" #include "path.h" -#include "gimprc.h" - +#include "pixel_region.h" +#include "temp_buf.h" #include "tile_manager.h" #include "tile.h" -#include "layer_pvt.h" -#include "drawable_pvt.h" /* ick ick. */ +#include "undo.h" #include "libgimp/gimpcolorspace.h" #include "libgimp/gimplimits.h" @@ -656,7 +658,7 @@ gimp_image_scale (GimpImage *gimage, for (list = remove; list; list = g_slist_next (list)) { layer = list->data; - gimage_remove_layer (gimage, layer); + gimp_image_remove_layer (gimage, layer); } g_slist_free (remove); @@ -3117,7 +3119,7 @@ gimp_image_remove_layer (GimpImage *gimage, if (gimage->active_layer == layer) { if (gimage->layers) - gimage_set_active_layer (gimage, gimage->layer_stack->data); + gimp_image_set_active_layer (gimage, gimage->layer_stack->data); else gimage->active_layer = NULL; } diff --git a/app/core/gimpimage-resize.h b/app/core/gimpimage-resize.h index 40164882b9..7663816033 100644 --- a/app/core/gimpimage-resize.h +++ b/app/core/gimpimage-resize.h @@ -1,5 +1,5 @@ /* The GIMP -- an image manipulation program - * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * Copyright (C) 1995 Spencer Kimball and Peter Mattisbvf * * 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 @@ -16,29 +16,14 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __GIMPIMAGE_H__ -#define __GIMPIMAGE_H__ - -#include "apptypes.h" -#include "procedural_db.h" -#include "boundary.h" -#include "drawable.h" -#include "channel.h" -#include "layer.h" -#include "plug_in.h" -#include "temp_buf.h" -#include "tile_manager.h" -#include "path.h" - -#include "libgimp/gimpparasite.h" -#include "libgimp/gimpunit.h" +#ifndef __GIMP_IMAGE_H__ +#define __GIMP_IMAGE_H__ -#define GIMP_TYPE_IMAGE gimp_image_get_type() -#define GIMP_IMAGE(obj) GTK_CHECK_CAST (obj, GIMP_TYPE_IMAGE, GimpImage) -#define GIMP_IS_IMAGE(obj) GTK_CHECK_TYPE (obj, GIMP_TYPE_IMAGE) - -#define GIMP_IMAGE_TYPE_HAS_ALPHA(t) ((t)==RGBA_GIMAGE || (t)==GRAYA_GIMAGE || (t)==INDEXEDA_GIMAGE) +#include "gimpobject.h" + + +#define MAX_CHANNELS 4 #define GRAY_PIX 0 #define ALPHA_G_PIX 1 @@ -51,19 +36,104 @@ #define COLORMAP_SIZE 768 -typedef enum /*< skip >*/ -{ - ORIENTATION_UNKNOWN, - ORIENTATION_HORIZONTAL, - ORIENTATION_VERTICAL -} InternalOrientationType; -typedef enum +#define GIMP_TYPE_IMAGE (gimp_image_get_type ()) +#define GIMP_IMAGE(obj) (GTK_CHECK_CAST (obj, GIMP_TYPE_IMAGE, GimpImage)) +#define GIMP_IS_IMAGE(obj) (GTK_CHECK_TYPE (obj, GIMP_TYPE_IMAGE)) +#define GIMP_IMAGE_CLASS(klass) (GTK_CHECK_CLASS_CAST (klass, GIMP_TYPE_IMAGE, GimpImageClass)) + +typedef struct _GimpImageClass GimpImageClass; + +struct _GimpImage { - HORIZONTAL, - VERTICAL, - UNKNOWN -} OrientationType; + GimpObject gobject; + + gchar *filename; /* original filename */ + gboolean has_filename; /* has a valid filename */ + PlugInProcDef *save_proc; /* last PDB save proc used */ + + gint width, height; /* width and height attributes */ + gdouble xresolution; /* image x-res, in dpi */ + gdouble yresolution; /* image y-res, in dpi */ + GimpUnit unit; /* image unit */ + GimpImageBaseType base_type; /* base gimp_image type */ + + guchar *cmap; /* colormap--for indexed */ + gint num_cols; /* number of cols--for indexed */ + + gint dirty; /* dirty flag -- # of ops */ + gboolean undo_on; /* Is undo enabled? */ + + gint instance_count; /* number of instances */ + gint disp_count; /* number of displays */ + + Tattoo tattoo_state; /* the next unique tattoo to use*/ + + TileManager *shadow; /* shadow buffer tiles */ + + /* Projection attributes */ + gint construct_flag; /* flag for construction */ + GimpImageType proj_type; /* type of the projection image */ + gint proj_bytes; /* bpp in projection image */ + gint proj_level; /* projection level */ + TileManager *projection; /* The projection--layers & */ + /* channels */ + + GList *guides; /* guides */ + + /* Layer/Channel attributes */ + GSList *layers; /* the list of layers */ + GSList *channels; /* the list of masks */ + GSList *layer_stack; /* the layers in MRU order */ + + Layer *active_layer; /* ID of active layer */ + Channel *active_channel; /* ID of active channel */ + Layer *floating_sel; /* ID of fs layer */ + Channel *selection_mask; /* selection mask channel */ + + ParasiteList *parasites; /* Plug-in parasite data */ + + PathList *paths; /* Paths data for this image */ + + gboolean visible[MAX_CHANNELS]; /* visible channels */ + gboolean active[MAX_CHANNELS]; /* active channels */ + + gboolean by_color_select; /* TRUE if there's an active */ + /* "by color" selection dialog */ + + gboolean qmask_state; /* TRUE if qmask is on */ + gdouble qmask_opacity; /* opacity of the qmask channel */ + guchar qmask_color[3]; /* rgb triplet of the color */ + + /* Undo apparatus */ + GSList *undo_stack; /* stack for undo operations */ + GSList *redo_stack; /* stack for redo operations */ + gint undo_bytes; /* bytes in undo stack */ + gint undo_levels; /* levels in undo stack */ + gint group_count; /* nested undo groups */ + UndoType pushing_undo_group; /* undo group status flag */ + GtkWidget *undo_history; /* history viewer, or NULL */ + + /* Composite preview */ + TempBuf *comp_preview; /* the composite preview */ + gboolean comp_preview_valid[3]; /* preview valid-1/channel */ +}; + +struct _GimpImageClass +{ + GimpObjectClass parent_class; + + void (* clean) (GimpImage *gimage); + void (* dirty) (GimpImage *gimage); + void (* repaint) (GimpImage *gimage); + void (* rename) (GimpImage *gimage); + void (* resize) (GimpImage *gimage); + void (* restructure) (GimpImage *gimage); + void (* colormap_changed) (GimpImage *gimage); + void (* undo_event) (GimpImage *gimage); +}; + +#define GIMP_IMAGE_TYPE_HAS_ALPHA(t) ((t)==RGBA_GIMAGE || (t)==GRAYA_GIMAGE || (t)==INDEXEDA_GIMAGE) typedef enum { @@ -374,4 +444,4 @@ TempBuf * gimp_image_construct_composite_preview (GimpImage *gimage, gint width, gint height); -#endif /* __GIMPIMAGE_H__ */ +#endif /* __GIMP_IMAGE_H__ */ diff --git a/app/core/gimpimage-scale.c b/app/core/gimpimage-scale.c index b5c83f7333..1b8a798b66 100644 --- a/app/core/gimpimage-scale.c +++ b/app/core/gimpimage-scale.c @@ -24,24 +24,26 @@ #include "apptypes.h" +#include "channel.h" #include "cursorutil.h" #include "drawable.h" #include "floating_sel.h" #include "gdisplay.h" #include "gimage_mask.h" #include "gimpcontext.h" -#include "paint_funcs.h" -#include "parasitelist.h" -#include "undo.h" +#include "gimpimage.h" +#include "gimprc.h" #include "gimpsignal.h" #include "gimpparasite.h" +#include "layer.h" +#include "paint_funcs.h" +#include "parasitelist.h" #include "path.h" -#include "gimprc.h" - +#include "pixel_region.h" +#include "temp_buf.h" #include "tile_manager.h" #include "tile.h" -#include "layer_pvt.h" -#include "drawable_pvt.h" /* ick ick. */ +#include "undo.h" #include "libgimp/gimpcolorspace.h" #include "libgimp/gimplimits.h" @@ -656,7 +658,7 @@ gimp_image_scale (GimpImage *gimage, for (list = remove; list; list = g_slist_next (list)) { layer = list->data; - gimage_remove_layer (gimage, layer); + gimp_image_remove_layer (gimage, layer); } g_slist_free (remove); @@ -3117,7 +3119,7 @@ gimp_image_remove_layer (GimpImage *gimage, if (gimage->active_layer == layer) { if (gimage->layers) - gimage_set_active_layer (gimage, gimage->layer_stack->data); + gimp_image_set_active_layer (gimage, gimage->layer_stack->data); else gimage->active_layer = NULL; } diff --git a/app/core/gimpimage-scale.h b/app/core/gimpimage-scale.h index 40164882b9..7663816033 100644 --- a/app/core/gimpimage-scale.h +++ b/app/core/gimpimage-scale.h @@ -1,5 +1,5 @@ /* The GIMP -- an image manipulation program - * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * Copyright (C) 1995 Spencer Kimball and Peter Mattisbvf * * 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 @@ -16,29 +16,14 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __GIMPIMAGE_H__ -#define __GIMPIMAGE_H__ - -#include "apptypes.h" -#include "procedural_db.h" -#include "boundary.h" -#include "drawable.h" -#include "channel.h" -#include "layer.h" -#include "plug_in.h" -#include "temp_buf.h" -#include "tile_manager.h" -#include "path.h" - -#include "libgimp/gimpparasite.h" -#include "libgimp/gimpunit.h" +#ifndef __GIMP_IMAGE_H__ +#define __GIMP_IMAGE_H__ -#define GIMP_TYPE_IMAGE gimp_image_get_type() -#define GIMP_IMAGE(obj) GTK_CHECK_CAST (obj, GIMP_TYPE_IMAGE, GimpImage) -#define GIMP_IS_IMAGE(obj) GTK_CHECK_TYPE (obj, GIMP_TYPE_IMAGE) - -#define GIMP_IMAGE_TYPE_HAS_ALPHA(t) ((t)==RGBA_GIMAGE || (t)==GRAYA_GIMAGE || (t)==INDEXEDA_GIMAGE) +#include "gimpobject.h" + + +#define MAX_CHANNELS 4 #define GRAY_PIX 0 #define ALPHA_G_PIX 1 @@ -51,19 +36,104 @@ #define COLORMAP_SIZE 768 -typedef enum /*< skip >*/ -{ - ORIENTATION_UNKNOWN, - ORIENTATION_HORIZONTAL, - ORIENTATION_VERTICAL -} InternalOrientationType; -typedef enum +#define GIMP_TYPE_IMAGE (gimp_image_get_type ()) +#define GIMP_IMAGE(obj) (GTK_CHECK_CAST (obj, GIMP_TYPE_IMAGE, GimpImage)) +#define GIMP_IS_IMAGE(obj) (GTK_CHECK_TYPE (obj, GIMP_TYPE_IMAGE)) +#define GIMP_IMAGE_CLASS(klass) (GTK_CHECK_CLASS_CAST (klass, GIMP_TYPE_IMAGE, GimpImageClass)) + +typedef struct _GimpImageClass GimpImageClass; + +struct _GimpImage { - HORIZONTAL, - VERTICAL, - UNKNOWN -} OrientationType; + GimpObject gobject; + + gchar *filename; /* original filename */ + gboolean has_filename; /* has a valid filename */ + PlugInProcDef *save_proc; /* last PDB save proc used */ + + gint width, height; /* width and height attributes */ + gdouble xresolution; /* image x-res, in dpi */ + gdouble yresolution; /* image y-res, in dpi */ + GimpUnit unit; /* image unit */ + GimpImageBaseType base_type; /* base gimp_image type */ + + guchar *cmap; /* colormap--for indexed */ + gint num_cols; /* number of cols--for indexed */ + + gint dirty; /* dirty flag -- # of ops */ + gboolean undo_on; /* Is undo enabled? */ + + gint instance_count; /* number of instances */ + gint disp_count; /* number of displays */ + + Tattoo tattoo_state; /* the next unique tattoo to use*/ + + TileManager *shadow; /* shadow buffer tiles */ + + /* Projection attributes */ + gint construct_flag; /* flag for construction */ + GimpImageType proj_type; /* type of the projection image */ + gint proj_bytes; /* bpp in projection image */ + gint proj_level; /* projection level */ + TileManager *projection; /* The projection--layers & */ + /* channels */ + + GList *guides; /* guides */ + + /* Layer/Channel attributes */ + GSList *layers; /* the list of layers */ + GSList *channels; /* the list of masks */ + GSList *layer_stack; /* the layers in MRU order */ + + Layer *active_layer; /* ID of active layer */ + Channel *active_channel; /* ID of active channel */ + Layer *floating_sel; /* ID of fs layer */ + Channel *selection_mask; /* selection mask channel */ + + ParasiteList *parasites; /* Plug-in parasite data */ + + PathList *paths; /* Paths data for this image */ + + gboolean visible[MAX_CHANNELS]; /* visible channels */ + gboolean active[MAX_CHANNELS]; /* active channels */ + + gboolean by_color_select; /* TRUE if there's an active */ + /* "by color" selection dialog */ + + gboolean qmask_state; /* TRUE if qmask is on */ + gdouble qmask_opacity; /* opacity of the qmask channel */ + guchar qmask_color[3]; /* rgb triplet of the color */ + + /* Undo apparatus */ + GSList *undo_stack; /* stack for undo operations */ + GSList *redo_stack; /* stack for redo operations */ + gint undo_bytes; /* bytes in undo stack */ + gint undo_levels; /* levels in undo stack */ + gint group_count; /* nested undo groups */ + UndoType pushing_undo_group; /* undo group status flag */ + GtkWidget *undo_history; /* history viewer, or NULL */ + + /* Composite preview */ + TempBuf *comp_preview; /* the composite preview */ + gboolean comp_preview_valid[3]; /* preview valid-1/channel */ +}; + +struct _GimpImageClass +{ + GimpObjectClass parent_class; + + void (* clean) (GimpImage *gimage); + void (* dirty) (GimpImage *gimage); + void (* repaint) (GimpImage *gimage); + void (* rename) (GimpImage *gimage); + void (* resize) (GimpImage *gimage); + void (* restructure) (GimpImage *gimage); + void (* colormap_changed) (GimpImage *gimage); + void (* undo_event) (GimpImage *gimage); +}; + +#define GIMP_IMAGE_TYPE_HAS_ALPHA(t) ((t)==RGBA_GIMAGE || (t)==GRAYA_GIMAGE || (t)==INDEXEDA_GIMAGE) typedef enum { @@ -374,4 +444,4 @@ TempBuf * gimp_image_construct_composite_preview (GimpImage *gimage, gint width, gint height); -#endif /* __GIMPIMAGE_H__ */ +#endif /* __GIMP_IMAGE_H__ */ diff --git a/app/core/gimpimage-undo-push.c b/app/core/gimpimage-undo-push.c index 4e11220d55..ecb99dbd50 100644 --- a/app/core/gimpimage-undo-push.c +++ b/app/core/gimpimage-undo-push.c @@ -21,17 +21,19 @@ #include #include -#include +#include #include "apptypes.h" #include "appenv.h" #include "by_color_select.h" #include "channel.h" +#include "draw_core.h" #include "drawable.h" #include "floating_sel.h" #include "gdisplay.h" #include "gdisplay_ops.h" +#include "gimage.h" #include "gimage_mask.h" #include "gimpparasite.h" #include "gimprc.h" @@ -40,21 +42,20 @@ #include "paint_funcs.h" #include "parasitelist.h" #include "path_transform.h" +#include "pixel_region.h" +#include "tile_manager.h" +#include "tile_manager_pvt.h" +#include "tile.h" #include "tools.h" #include "transform_core.h" #include "undo.h" -#include "drawable_pvt.h" -#include "layer_pvt.h" -#include "channel_pvt.h" -#include "tile_manager_pvt.h" -#include "tile.h" /* ick. */ - #include "libgimp/gimpparasite.h" #include "libgimp/gimpintl.h" + /*#define DEBUG*/ #ifdef DEBUG @@ -1031,7 +1032,7 @@ undo_pop_mask (GImage *gimage, mask_undo = (MaskUndo *) mask_ptr; /* save current selection mask */ - sel_mask = gimage_get_mask (gimage); + sel_mask = gimp_image_get_mask (gimage); selection = channel_bounds (sel_mask, &x1, &y1, &x2, &y2); pixel_region_init (&srcPR, GIMP_DRAWABLE (sel_mask)->tiles, x1, y1, (x2 - x1), (y2 - y1), FALSE); @@ -1452,9 +1453,9 @@ undo_pop_layer (GImage *gimage, (state == REDO && type == LAYER_REMOVE_UNDO)) { /* record the current position */ - lu->prev_position = gimage_get_layer_index (gimage, lu->layer); + lu->prev_position = gimp_image_get_layer_index (gimage, lu->layer); /* set the previous layer */ - gimage_set_active_layer (gimage, lu->prev_layer); + gimp_image_set_active_layer (gimage, lu->prev_layer); /* remove the layer */ gimage->layers = g_slist_remove (gimage->layers, lu->layer); @@ -1805,13 +1806,13 @@ undo_pop_channel (GImage *gimage, (state == REDO && type == CHANNEL_REMOVE_UNDO)) { /* record the current position */ - cu->prev_position = gimage_get_channel_index (gimage, cu->channel); + cu->prev_position = gimp_image_get_channel_index (gimage, cu->channel); /* remove the channel */ gimage->channels = g_slist_remove (gimage->channels, cu->channel); /* set the previous channel */ - gimage_set_active_channel (gimage, cu->prev_channel); + gimp_image_set_active_channel (gimage, cu->prev_channel); /* update the area */ drawable_update (GIMP_DRAWABLE (cu->channel), 0, 0, @@ -1829,7 +1830,7 @@ undo_pop_channel (GImage *gimage, cu->prev_position); /* set the new channel */ - gimage_set_active_channel (gimage, cu->channel); + gimp_image_set_active_channel (gimage, cu->channel); /* update the area */ drawable_update (GIMP_DRAWABLE (cu->channel), 0, 0, @@ -2268,12 +2269,12 @@ undo_pop_gimage_mod (GImage *gimage, data[2] = gimage->base_type; gimage->base_type = tmp; - gimage_projection_realloc (gimage); + gimp_image_projection_realloc (gimage); gimage_mask_invalidate (gimage); channel_invalidate_previews (gimage); layer_invalidate_previews (gimage); - gimage_invalidate_preview (gimage); + gimp_image_invalidate_preview (gimage); gdisplays_update_full (gimage); gdisplays_update_title (gimage); diff --git a/app/core/gimpimage-undo-push.h b/app/core/gimpimage-undo-push.h index b0fb003366..b92893c8c0 100644 --- a/app/core/gimpimage-undo-push.h +++ b/app/core/gimpimage-undo-push.h @@ -15,14 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __UNDO_H__ #define __UNDO_H__ -#include "gimage.h" -#include "undo_types.h" - - -/* Undo interface functions */ gboolean undo_push_group_start (GImage *gimage, UndoType type); @@ -131,4 +127,5 @@ typedef enum UNDO_FREE /* all undo and redo info has been cleared */ } undo_event_t; + #endif /* __UNDO_H__ */ diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c index b5c83f7333..1b8a798b66 100644 --- a/app/core/gimpimage.c +++ b/app/core/gimpimage.c @@ -24,24 +24,26 @@ #include "apptypes.h" +#include "channel.h" #include "cursorutil.h" #include "drawable.h" #include "floating_sel.h" #include "gdisplay.h" #include "gimage_mask.h" #include "gimpcontext.h" -#include "paint_funcs.h" -#include "parasitelist.h" -#include "undo.h" +#include "gimpimage.h" +#include "gimprc.h" #include "gimpsignal.h" #include "gimpparasite.h" +#include "layer.h" +#include "paint_funcs.h" +#include "parasitelist.h" #include "path.h" -#include "gimprc.h" - +#include "pixel_region.h" +#include "temp_buf.h" #include "tile_manager.h" #include "tile.h" -#include "layer_pvt.h" -#include "drawable_pvt.h" /* ick ick. */ +#include "undo.h" #include "libgimp/gimpcolorspace.h" #include "libgimp/gimplimits.h" @@ -656,7 +658,7 @@ gimp_image_scale (GimpImage *gimage, for (list = remove; list; list = g_slist_next (list)) { layer = list->data; - gimage_remove_layer (gimage, layer); + gimp_image_remove_layer (gimage, layer); } g_slist_free (remove); @@ -3117,7 +3119,7 @@ gimp_image_remove_layer (GimpImage *gimage, if (gimage->active_layer == layer) { if (gimage->layers) - gimage_set_active_layer (gimage, gimage->layer_stack->data); + gimp_image_set_active_layer (gimage, gimage->layer_stack->data); else gimage->active_layer = NULL; } diff --git a/app/core/gimpimage.h b/app/core/gimpimage.h index 40164882b9..7663816033 100644 --- a/app/core/gimpimage.h +++ b/app/core/gimpimage.h @@ -1,5 +1,5 @@ /* The GIMP -- an image manipulation program - * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * Copyright (C) 1995 Spencer Kimball and Peter Mattisbvf * * 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 @@ -16,29 +16,14 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __GIMPIMAGE_H__ -#define __GIMPIMAGE_H__ - -#include "apptypes.h" -#include "procedural_db.h" -#include "boundary.h" -#include "drawable.h" -#include "channel.h" -#include "layer.h" -#include "plug_in.h" -#include "temp_buf.h" -#include "tile_manager.h" -#include "path.h" - -#include "libgimp/gimpparasite.h" -#include "libgimp/gimpunit.h" +#ifndef __GIMP_IMAGE_H__ +#define __GIMP_IMAGE_H__ -#define GIMP_TYPE_IMAGE gimp_image_get_type() -#define GIMP_IMAGE(obj) GTK_CHECK_CAST (obj, GIMP_TYPE_IMAGE, GimpImage) -#define GIMP_IS_IMAGE(obj) GTK_CHECK_TYPE (obj, GIMP_TYPE_IMAGE) - -#define GIMP_IMAGE_TYPE_HAS_ALPHA(t) ((t)==RGBA_GIMAGE || (t)==GRAYA_GIMAGE || (t)==INDEXEDA_GIMAGE) +#include "gimpobject.h" + + +#define MAX_CHANNELS 4 #define GRAY_PIX 0 #define ALPHA_G_PIX 1 @@ -51,19 +36,104 @@ #define COLORMAP_SIZE 768 -typedef enum /*< skip >*/ -{ - ORIENTATION_UNKNOWN, - ORIENTATION_HORIZONTAL, - ORIENTATION_VERTICAL -} InternalOrientationType; -typedef enum +#define GIMP_TYPE_IMAGE (gimp_image_get_type ()) +#define GIMP_IMAGE(obj) (GTK_CHECK_CAST (obj, GIMP_TYPE_IMAGE, GimpImage)) +#define GIMP_IS_IMAGE(obj) (GTK_CHECK_TYPE (obj, GIMP_TYPE_IMAGE)) +#define GIMP_IMAGE_CLASS(klass) (GTK_CHECK_CLASS_CAST (klass, GIMP_TYPE_IMAGE, GimpImageClass)) + +typedef struct _GimpImageClass GimpImageClass; + +struct _GimpImage { - HORIZONTAL, - VERTICAL, - UNKNOWN -} OrientationType; + GimpObject gobject; + + gchar *filename; /* original filename */ + gboolean has_filename; /* has a valid filename */ + PlugInProcDef *save_proc; /* last PDB save proc used */ + + gint width, height; /* width and height attributes */ + gdouble xresolution; /* image x-res, in dpi */ + gdouble yresolution; /* image y-res, in dpi */ + GimpUnit unit; /* image unit */ + GimpImageBaseType base_type; /* base gimp_image type */ + + guchar *cmap; /* colormap--for indexed */ + gint num_cols; /* number of cols--for indexed */ + + gint dirty; /* dirty flag -- # of ops */ + gboolean undo_on; /* Is undo enabled? */ + + gint instance_count; /* number of instances */ + gint disp_count; /* number of displays */ + + Tattoo tattoo_state; /* the next unique tattoo to use*/ + + TileManager *shadow; /* shadow buffer tiles */ + + /* Projection attributes */ + gint construct_flag; /* flag for construction */ + GimpImageType proj_type; /* type of the projection image */ + gint proj_bytes; /* bpp in projection image */ + gint proj_level; /* projection level */ + TileManager *projection; /* The projection--layers & */ + /* channels */ + + GList *guides; /* guides */ + + /* Layer/Channel attributes */ + GSList *layers; /* the list of layers */ + GSList *channels; /* the list of masks */ + GSList *layer_stack; /* the layers in MRU order */ + + Layer *active_layer; /* ID of active layer */ + Channel *active_channel; /* ID of active channel */ + Layer *floating_sel; /* ID of fs layer */ + Channel *selection_mask; /* selection mask channel */ + + ParasiteList *parasites; /* Plug-in parasite data */ + + PathList *paths; /* Paths data for this image */ + + gboolean visible[MAX_CHANNELS]; /* visible channels */ + gboolean active[MAX_CHANNELS]; /* active channels */ + + gboolean by_color_select; /* TRUE if there's an active */ + /* "by color" selection dialog */ + + gboolean qmask_state; /* TRUE if qmask is on */ + gdouble qmask_opacity; /* opacity of the qmask channel */ + guchar qmask_color[3]; /* rgb triplet of the color */ + + /* Undo apparatus */ + GSList *undo_stack; /* stack for undo operations */ + GSList *redo_stack; /* stack for redo operations */ + gint undo_bytes; /* bytes in undo stack */ + gint undo_levels; /* levels in undo stack */ + gint group_count; /* nested undo groups */ + UndoType pushing_undo_group; /* undo group status flag */ + GtkWidget *undo_history; /* history viewer, or NULL */ + + /* Composite preview */ + TempBuf *comp_preview; /* the composite preview */ + gboolean comp_preview_valid[3]; /* preview valid-1/channel */ +}; + +struct _GimpImageClass +{ + GimpObjectClass parent_class; + + void (* clean) (GimpImage *gimage); + void (* dirty) (GimpImage *gimage); + void (* repaint) (GimpImage *gimage); + void (* rename) (GimpImage *gimage); + void (* resize) (GimpImage *gimage); + void (* restructure) (GimpImage *gimage); + void (* colormap_changed) (GimpImage *gimage); + void (* undo_event) (GimpImage *gimage); +}; + +#define GIMP_IMAGE_TYPE_HAS_ALPHA(t) ((t)==RGBA_GIMAGE || (t)==GRAYA_GIMAGE || (t)==INDEXEDA_GIMAGE) typedef enum { @@ -374,4 +444,4 @@ TempBuf * gimp_image_construct_composite_preview (GimpImage *gimage, gint width, gint height); -#endif /* __GIMPIMAGE_H__ */ +#endif /* __GIMP_IMAGE_H__ */ diff --git a/app/core/gimpimagemap.c b/app/core/gimpimagemap.c index 7fcbd822fd..e4ba40e097 100644 --- a/app/core/gimpimagemap.c +++ b/app/core/gimpimagemap.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include "apptypes.h" @@ -28,8 +28,10 @@ #include "gimage.h" #include "gimage_mask.h" #include "image_map.h" +#include "paint_funcs.h" +#include "pixel_region.h" +#include "tile.h" #include "tile_manager.h" - #include "tile_manager_pvt.h" diff --git a/app/core/gimpimagemap.h b/app/core/gimpimagemap.h index 76f867dbc9..8af03f09a8 100644 --- a/app/core/gimpimagemap.h +++ b/app/core/gimpimagemap.h @@ -15,15 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __IMAGE_MAP_H__ #define __IMAGE_MAP_H__ -#include "apptypes.h" -#include "pixel_region.h" - -/* Image map apply function */ -typedef void * ImageMap; -typedef void (* ImageMapApplyFunc) (PixelRegion *, PixelRegion *, void *); /* Image Map functions */ @@ -31,11 +26,17 @@ typedef void (* ImageMapApplyFunc) (PixelRegion *, PixelRegion *, void *); * MUST be followed with an image_map_commit or an image_map_abort call * The image map is no longer valid after a call to commit or abort. */ -ImageMap image_map_create (void *, GimpDrawable *); -void image_map_apply (ImageMap, ImageMapApplyFunc, void *); -void image_map_commit (ImageMap); -void image_map_clear (ImageMap); -void image_map_abort (ImageMap); -unsigned char *image_map_get_color_at (ImageMap, int, int); +ImageMap image_map_create (void *, + GimpDrawable *); +void image_map_apply (ImageMap, + ImageMapApplyFunc, + void *); +void image_map_commit (ImageMap); +void image_map_clear (ImageMap); +void image_map_abort (ImageMap); +guchar * image_map_get_color_at (ImageMap, + gint, + gint); + #endif /* __IMAGE_MAP_H__ */ diff --git a/app/core/gimplayer-floating-sel.c b/app/core/gimplayer-floating-sel.c index 8b913827da..7e01429026 100644 --- a/app/core/gimplayer-floating-sel.c +++ b/app/core/gimplayer-floating-sel.c @@ -18,11 +18,12 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" +#include "boundary.h" #include "drawable.h" #include "layer.h" #include "floating_sel.h" @@ -30,9 +31,10 @@ #include "gimage.h" #include "gimage_mask.h" #include "paint_funcs.h" +#include "pixel_region.h" +#include "tile_manager.h" #include "undo.h" -#include "layer_pvt.h" #include "tile_manager_pvt.h" /* ick. */ #include "libgimp/gimpmath.h" diff --git a/app/core/gimplayer-floating-sel.h b/app/core/gimplayer-floating-sel.h index 017b2e16ca..e5d0689e3d 100644 --- a/app/core/gimplayer-floating-sel.h +++ b/app/core/gimplayer-floating-sel.h @@ -19,23 +19,41 @@ #ifndef __FLOATING_SEL_H__ #define __FLOATING_SEL_H__ -#include "apptypes.h" +void floating_sel_attach (Layer *, + GimpDrawable *); +void floating_sel_remove (Layer *); +void floating_sel_anchor (Layer *); +void floating_sel_reset (Layer *); +void floating_sel_to_layer (Layer *); +void floating_sel_store (Layer *, + gint , + gint , + gint , + gint ); +void floating_sel_restore (Layer *, + gint , + gint , + gint , + gint ); +void floating_sel_rigor (Layer *, + gint ); +void floating_sel_relax (Layer *, + gint ); +void floating_sel_composite (Layer *, + gint , + gint , + gint , + gint , + gint ); +BoundSeg * floating_sel_boundary (Layer *, + gint *); +void floating_sel_bounds (Layer *, + gint *, + gint *, + gint *, + gint *); +void floating_sel_invalidate (Layer *); -/* Functions */ - -void floating_sel_attach (Layer *, GimpDrawable *); -void floating_sel_remove (Layer *); -void floating_sel_anchor (Layer *); -void floating_sel_reset (Layer *); -void floating_sel_to_layer (Layer *); -void floating_sel_store (Layer *, int, int, int, int); -void floating_sel_restore (Layer *, int, int, int, int); -void floating_sel_rigor (Layer *, int); -void floating_sel_relax (Layer *, int); -void floating_sel_composite (Layer *, int, int, int, int, int); -BoundSeg * floating_sel_boundary (Layer *, int *); -void floating_sel_bounds (Layer *, int *, int *, int *, int *); -void floating_sel_invalidate (Layer *); #endif /* __FLOATING_SEL_H__ */ diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c index 2efcb7e6ac..58e99a0651 100644 --- a/app/core/gimplayer.c +++ b/app/core/gimplayer.c @@ -23,24 +23,26 @@ #include #include -#include +#include +#include "apptypes.h" + +#include "boundary.h" #include "drawable.h" #include "floating_sel.h" #include "gdisplay.h" -#include "gimage.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "layer.h" #include "paint_funcs.h" +#include "pixel_region.h" #include "temp_buf.h" #include "parasitelist.h" #include "undo.h" #include "gimpsignal.h" #include "gimppreviewcache.h" - -#include "layer_pvt.h" -#include "tile_manager_pvt.h" -#include "tile.h" /* ick. */ +#include "tile_manager.h" +#include "tile.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpparasite.h" @@ -242,9 +244,9 @@ transform_color (GImage *gimage, { for (i = 0; i < layerPR->w; i++) { - gimage_transform_color (gimage, drawable, - s + (i * bufPR->bytes), - d + (i * layerPR->bytes), type); + gimp_image_transform_color (gimage, drawable, + s + (i * bufPR->bytes), + d + (i * layerPR->bytes), type); /* copy alpha channel */ d[(i + 1) * layerPR->bytes - 1] = s[(i + 1) * bufPR->bytes - 1]; } @@ -449,7 +451,9 @@ layer_new_from_tiles (GimpImage *gimage, g_return_val_if_fail (GIMP_IMAGE_TYPE_HAS_ALPHA (layer_type), NULL); /* Create the new layer */ - new_layer = layer_new (0, tiles->width, tiles->height, + new_layer = layer_new (0, + tile_manager_level_width (tiles), + tile_manager_level_height (tiles), layer_type, name, opacity, mode); if (!new_layer) @@ -467,17 +471,19 @@ layer_new_from_tiles (GimpImage *gimage, pixel_region_init (&bufPR, tiles, 0, 0, GIMP_DRAWABLE (new_layer)->width, - GIMP_DRAWABLE (new_layer)->height, + GIMP_DRAWABLE (new_layer)->height, FALSE); - if ((tiles->bpp == 4 && GIMP_DRAWABLE (new_layer)->type == RGBA_GIMAGE) || - (tiles->bpp == 2 && GIMP_DRAWABLE (new_layer)->type == GRAYA_GIMAGE)) + if ((tile_manager_level_bpp (tiles) == 4 && + GIMP_DRAWABLE (new_layer)->type == RGBA_GIMAGE) || + (tile_manager_level_bpp (tiles) == 2 && + GIMP_DRAWABLE (new_layer)->type == GRAYA_GIMAGE)) /* If we want a layer the same type as the buffer */ copy_region (&bufPR, &layerPR); else /* Transform the contents of the buf to the new_layer */ transform_color (gimage, &layerPR, &bufPR, GIMP_DRAWABLE (new_layer), - (tiles->bpp == 4) ? RGB : GRAY); + (tile_manager_level_bpp (tiles) == 4) ? RGB : GRAY); return new_layer; } @@ -1069,8 +1075,8 @@ layer_resize (Layer *layer, else { unsigned char bg[3]; - gimage_get_background (GIMP_DRAWABLE(layer)->gimage, - GIMP_DRAWABLE(layer), bg); + gimp_image_get_background (GIMP_DRAWABLE (layer)->gimage, + GIMP_DRAWABLE (layer), bg); color_region (&destPR, bg); } pixel_region_init (&destPR, new_tiles, @@ -1160,28 +1166,28 @@ layer_boundary (Layer *layer, layer = GIMP_LAYER (layer->fs.drawable); } - new_segs[0].x1 = GIMP_DRAWABLE(layer)->offset_x; - new_segs[0].y1 = GIMP_DRAWABLE(layer)->offset_y; - new_segs[0].x2 = GIMP_DRAWABLE(layer)->offset_x; - new_segs[0].y2 = GIMP_DRAWABLE(layer)->offset_y + GIMP_DRAWABLE(layer)->height; + new_segs[0].x1 = GIMP_DRAWABLE (layer)->offset_x; + new_segs[0].y1 = GIMP_DRAWABLE (layer)->offset_y; + new_segs[0].x2 = GIMP_DRAWABLE (layer)->offset_x; + new_segs[0].y2 = GIMP_DRAWABLE (layer)->offset_y + GIMP_DRAWABLE (layer)->height; new_segs[0].open = 1; - new_segs[1].x1 = GIMP_DRAWABLE(layer)->offset_x; - new_segs[1].y1 = GIMP_DRAWABLE(layer)->offset_y; - new_segs[1].x2 = GIMP_DRAWABLE(layer)->offset_x + GIMP_DRAWABLE(layer)->width; - new_segs[1].y2 = GIMP_DRAWABLE(layer)->offset_y; + new_segs[1].x1 = GIMP_DRAWABLE (layer)->offset_x; + new_segs[1].y1 = GIMP_DRAWABLE (layer)->offset_y; + new_segs[1].x2 = GIMP_DRAWABLE (layer)->offset_x + GIMP_DRAWABLE (layer)->width; + new_segs[1].y2 = GIMP_DRAWABLE (layer)->offset_y; new_segs[1].open = 1; - new_segs[2].x1 = GIMP_DRAWABLE(layer)->offset_x + GIMP_DRAWABLE(layer)->width; - new_segs[2].y1 = GIMP_DRAWABLE(layer)->offset_y; - new_segs[2].x2 = GIMP_DRAWABLE(layer)->offset_x + GIMP_DRAWABLE(layer)->width; - new_segs[2].y2 = GIMP_DRAWABLE(layer)->offset_y + GIMP_DRAWABLE(layer)->height; + new_segs[2].x1 = GIMP_DRAWABLE (layer)->offset_x + GIMP_DRAWABLE (layer)->width; + new_segs[2].y1 = GIMP_DRAWABLE (layer)->offset_y; + new_segs[2].x2 = GIMP_DRAWABLE (layer)->offset_x + GIMP_DRAWABLE (layer)->width; + new_segs[2].y2 = GIMP_DRAWABLE (layer)->offset_y + GIMP_DRAWABLE (layer)->height; new_segs[2].open = 0; - new_segs[3].x1 = GIMP_DRAWABLE(layer)->offset_x; - new_segs[3].y1 = GIMP_DRAWABLE(layer)->offset_y + GIMP_DRAWABLE(layer)->height; - new_segs[3].x2 = GIMP_DRAWABLE(layer)->offset_x + GIMP_DRAWABLE(layer)->width; - new_segs[3].y2 = GIMP_DRAWABLE(layer)->offset_y + GIMP_DRAWABLE(layer)->height; + new_segs[3].x1 = GIMP_DRAWABLE (layer)->offset_x; + new_segs[3].y1 = GIMP_DRAWABLE (layer)->offset_y + GIMP_DRAWABLE (layer)->height; + new_segs[3].x2 = GIMP_DRAWABLE (layer)->offset_x + GIMP_DRAWABLE (layer)->width; + new_segs[3].y2 = GIMP_DRAWABLE (layer)->offset_y + GIMP_DRAWABLE (layer)->height; new_segs[3].open = 0; return new_segs; @@ -1190,7 +1196,7 @@ layer_boundary (Layer *layer, void layer_invalidate_boundary (Layer *layer) { - GImage *gimage; + GImage *gimage; Channel *mask; /* first get the selection mask channel */ @@ -1203,7 +1209,7 @@ layer_invalidate_boundary (Layer *layer) /* clear the affected region surrounding the layer */ gdisplays_selection_visibility (gimage, SelectionLayerOff); - mask = gimage_get_mask (gimage); + mask = gimp_image_get_mask (gimage); /* Only bother with the bounds if there is a selection */ if (! channel_is_empty (mask)) diff --git a/app/core/gimplayer.h b/app/core/gimplayer.h index 0670f80fb2..80a5865fb5 100644 --- a/app/core/gimplayer.h +++ b/app/core/gimplayer.h @@ -19,16 +19,11 @@ #ifndef __LAYER_H__ #define __LAYER_H__ -#include "apptypes.h" -#include "drawable.h" -#include "boundary.h" + #include "channel.h" -#include "temp_buf.h" -#include "tile_manager.h" +#include "gimpdrawable.h" -/* structure declarations */ - #define GIMP_TYPE_LAYER (gimp_layer_get_type ()) #define GIMP_LAYER(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_LAYER, GimpLayer)) #define GIMP_LAYER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LAYER, GimpLayerClass)) @@ -41,8 +36,53 @@ #define GIMP_IS_LAYER_MASK(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_LAYER_MASK)) #define GIMP_IS_LAYER_MASK_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_LAYER_MASK)) -GtkType gimp_layer_get_type (void); -GtkType gimp_layer_mask_get_type (void); + +struct _GimpLayer +{ + GimpDrawable drawable; + + gboolean linked; /* control linkage */ + gboolean preserve_trans; /* preserve transparency */ + + LayerMask *mask; /* possible layer mask */ + gint apply_mask; /* controls mask application */ + gboolean edit_mask; /* edit mask or layer? */ + gboolean show_mask; /* show mask or layer? */ + + gint opacity; /* layer opacity */ + LayerModeEffects mode; /* layer combination mode */ + + /* Floating selections */ + struct + { + TileManager *backing_store; /* for obscured regions */ + GimpDrawable *drawable; /* floating sel is attached to */ + gboolean initial; /* is fs composited yet? */ + + gboolean boundary_known; /* is the current boundary valid */ + BoundSeg *segs; /* boundary of floating sel */ + gint num_segs; /* number of segs in boundary */ + } fs; +}; + +struct _GimpLayerClass +{ + GimpDrawableClass parent_class; + + void (* removed) (GimpLayer *layer); +}; + +struct _GimpLayerMask +{ + GimpChannel drawable; + + Layer *layer; +}; + +struct _GimpLayerMaskClass +{ + GimpChannelClass parent_class; +}; /* Special undo types */ @@ -71,6 +111,8 @@ struct _fs_to_layer_undo /* function declarations */ +GtkType gimp_layer_get_type (void); + Layer * layer_new (GimpImage *gimage, gint width, gint height, @@ -124,6 +166,9 @@ gint layer_pick_correlate (Layer *layer, gint x, gint y); + +GtkType gimp_layer_mask_get_type (void); + LayerMask * layer_mask_new (GimpImage *gimage, gint width, gint height, diff --git a/app/core/gimpobject.h b/app/core/gimpobject.h index f5e2736195..d38d933648 100644 --- a/app/core/gimpobject.h +++ b/app/core/gimpobject.h @@ -20,24 +20,26 @@ #define __GIMP_OBJECT_H__ -#include +#include -#define GIMP_TYPE_OBJECT gimp_object_get_type () -#define GIMP_OBJECT(obj) GTK_CHECK_CAST (obj, GIMP_TYPE_OBJECT, GimpObject) -#define GIMP_IS_OBJECT(obj) GTK_CHECK_TYPE (obj, GIMP_TYPE_OBJECT) -#define GIMP_OBJECT_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, GIMP_TYPE_OBJECT, GimpObjectClass) +#define GIMP_TYPE_OBJECT (gimp_object_get_type ()) +#define GIMP_OBJECT(obj) (GTK_CHECK_CAST (obj, GIMP_TYPE_OBJECT, GimpObject)) +#define GIMP_IS_OBJECT(obj) (GTK_CHECK_TYPE (obj, GIMP_TYPE_OBJECT)) +#define GIMP_OBJECT_CLASS(klass) (GTK_CHECK_CLASS_CAST (klass, GIMP_TYPE_OBJECT, GimpObjectClass)) +typedef struct _GimpObjectClass GimpObjectClass; + struct _GimpObject { GtkObject object; }; -typedef struct +struct _GimpObjectClass { GtkObjectClass parent_class; -} GimpObjectClass; +}; #define GIMP_TYPE_INIT(typevar, obtype, classtype, obinit, classinit, parent) \ diff --git a/app/core/gimpparasite.h b/app/core/gimpparasite.h index 9cf21a7d8b..8b7be6d268 100644 --- a/app/core/gimpparasite.h +++ b/app/core/gimpparasite.h @@ -14,10 +14,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __APP_GIMP_PARASITE_H__ #define __APP_GIMP_PARASITE_H__ -#include "libgimp/gimpparasite.h" void gimp_init_parasites (void); @@ -30,4 +30,5 @@ gchar ** gimp_parasite_list (gint *count); void gimp_parasiterc_save (void); void gimp_parasiterc_load (void); + #endif /* __APP_GIMP_PARASITE_H__ */ diff --git a/app/core/gimpparasitelist.h b/app/core/gimpparasitelist.h index b888e6a15f..2c62105dd9 100644 --- a/app/core/gimpparasitelist.h +++ b/app/core/gimpparasitelist.h @@ -19,7 +19,6 @@ #define __PARASITE_LIST_H__ -#include "libgimp/gimpparasite.h" #include "gimpobject.h" @@ -31,6 +30,7 @@ struct _ParasiteList { GimpObject object; + GHashTable *table; }; diff --git a/app/core/gimppreviewcache.c b/app/core/gimppreviewcache.c index b7ffdf63fd..541d3c2c5e 100644 --- a/app/core/gimppreviewcache.c +++ b/app/core/gimppreviewcache.c @@ -18,7 +18,9 @@ #include "config.h" -#include +#include + +#include "apptypes.h" #include "gimppreviewcache.h" diff --git a/app/core/gimpprojection-construct.c b/app/core/gimpprojection-construct.c index b5c83f7333..1b8a798b66 100644 --- a/app/core/gimpprojection-construct.c +++ b/app/core/gimpprojection-construct.c @@ -24,24 +24,26 @@ #include "apptypes.h" +#include "channel.h" #include "cursorutil.h" #include "drawable.h" #include "floating_sel.h" #include "gdisplay.h" #include "gimage_mask.h" #include "gimpcontext.h" -#include "paint_funcs.h" -#include "parasitelist.h" -#include "undo.h" +#include "gimpimage.h" +#include "gimprc.h" #include "gimpsignal.h" #include "gimpparasite.h" +#include "layer.h" +#include "paint_funcs.h" +#include "parasitelist.h" #include "path.h" -#include "gimprc.h" - +#include "pixel_region.h" +#include "temp_buf.h" #include "tile_manager.h" #include "tile.h" -#include "layer_pvt.h" -#include "drawable_pvt.h" /* ick ick. */ +#include "undo.h" #include "libgimp/gimpcolorspace.h" #include "libgimp/gimplimits.h" @@ -656,7 +658,7 @@ gimp_image_scale (GimpImage *gimage, for (list = remove; list; list = g_slist_next (list)) { layer = list->data; - gimage_remove_layer (gimage, layer); + gimp_image_remove_layer (gimage, layer); } g_slist_free (remove); @@ -3117,7 +3119,7 @@ gimp_image_remove_layer (GimpImage *gimage, if (gimage->active_layer == layer) { if (gimage->layers) - gimage_set_active_layer (gimage, gimage->layer_stack->data); + gimp_image_set_active_layer (gimage, gimage->layer_stack->data); else gimage->active_layer = NULL; } diff --git a/app/core/gimpprojection-construct.h b/app/core/gimpprojection-construct.h index 40164882b9..7663816033 100644 --- a/app/core/gimpprojection-construct.h +++ b/app/core/gimpprojection-construct.h @@ -1,5 +1,5 @@ /* The GIMP -- an image manipulation program - * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * Copyright (C) 1995 Spencer Kimball and Peter Mattisbvf * * 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 @@ -16,29 +16,14 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __GIMPIMAGE_H__ -#define __GIMPIMAGE_H__ - -#include "apptypes.h" -#include "procedural_db.h" -#include "boundary.h" -#include "drawable.h" -#include "channel.h" -#include "layer.h" -#include "plug_in.h" -#include "temp_buf.h" -#include "tile_manager.h" -#include "path.h" - -#include "libgimp/gimpparasite.h" -#include "libgimp/gimpunit.h" +#ifndef __GIMP_IMAGE_H__ +#define __GIMP_IMAGE_H__ -#define GIMP_TYPE_IMAGE gimp_image_get_type() -#define GIMP_IMAGE(obj) GTK_CHECK_CAST (obj, GIMP_TYPE_IMAGE, GimpImage) -#define GIMP_IS_IMAGE(obj) GTK_CHECK_TYPE (obj, GIMP_TYPE_IMAGE) - -#define GIMP_IMAGE_TYPE_HAS_ALPHA(t) ((t)==RGBA_GIMAGE || (t)==GRAYA_GIMAGE || (t)==INDEXEDA_GIMAGE) +#include "gimpobject.h" + + +#define MAX_CHANNELS 4 #define GRAY_PIX 0 #define ALPHA_G_PIX 1 @@ -51,19 +36,104 @@ #define COLORMAP_SIZE 768 -typedef enum /*< skip >*/ -{ - ORIENTATION_UNKNOWN, - ORIENTATION_HORIZONTAL, - ORIENTATION_VERTICAL -} InternalOrientationType; -typedef enum +#define GIMP_TYPE_IMAGE (gimp_image_get_type ()) +#define GIMP_IMAGE(obj) (GTK_CHECK_CAST (obj, GIMP_TYPE_IMAGE, GimpImage)) +#define GIMP_IS_IMAGE(obj) (GTK_CHECK_TYPE (obj, GIMP_TYPE_IMAGE)) +#define GIMP_IMAGE_CLASS(klass) (GTK_CHECK_CLASS_CAST (klass, GIMP_TYPE_IMAGE, GimpImageClass)) + +typedef struct _GimpImageClass GimpImageClass; + +struct _GimpImage { - HORIZONTAL, - VERTICAL, - UNKNOWN -} OrientationType; + GimpObject gobject; + + gchar *filename; /* original filename */ + gboolean has_filename; /* has a valid filename */ + PlugInProcDef *save_proc; /* last PDB save proc used */ + + gint width, height; /* width and height attributes */ + gdouble xresolution; /* image x-res, in dpi */ + gdouble yresolution; /* image y-res, in dpi */ + GimpUnit unit; /* image unit */ + GimpImageBaseType base_type; /* base gimp_image type */ + + guchar *cmap; /* colormap--for indexed */ + gint num_cols; /* number of cols--for indexed */ + + gint dirty; /* dirty flag -- # of ops */ + gboolean undo_on; /* Is undo enabled? */ + + gint instance_count; /* number of instances */ + gint disp_count; /* number of displays */ + + Tattoo tattoo_state; /* the next unique tattoo to use*/ + + TileManager *shadow; /* shadow buffer tiles */ + + /* Projection attributes */ + gint construct_flag; /* flag for construction */ + GimpImageType proj_type; /* type of the projection image */ + gint proj_bytes; /* bpp in projection image */ + gint proj_level; /* projection level */ + TileManager *projection; /* The projection--layers & */ + /* channels */ + + GList *guides; /* guides */ + + /* Layer/Channel attributes */ + GSList *layers; /* the list of layers */ + GSList *channels; /* the list of masks */ + GSList *layer_stack; /* the layers in MRU order */ + + Layer *active_layer; /* ID of active layer */ + Channel *active_channel; /* ID of active channel */ + Layer *floating_sel; /* ID of fs layer */ + Channel *selection_mask; /* selection mask channel */ + + ParasiteList *parasites; /* Plug-in parasite data */ + + PathList *paths; /* Paths data for this image */ + + gboolean visible[MAX_CHANNELS]; /* visible channels */ + gboolean active[MAX_CHANNELS]; /* active channels */ + + gboolean by_color_select; /* TRUE if there's an active */ + /* "by color" selection dialog */ + + gboolean qmask_state; /* TRUE if qmask is on */ + gdouble qmask_opacity; /* opacity of the qmask channel */ + guchar qmask_color[3]; /* rgb triplet of the color */ + + /* Undo apparatus */ + GSList *undo_stack; /* stack for undo operations */ + GSList *redo_stack; /* stack for redo operations */ + gint undo_bytes; /* bytes in undo stack */ + gint undo_levels; /* levels in undo stack */ + gint group_count; /* nested undo groups */ + UndoType pushing_undo_group; /* undo group status flag */ + GtkWidget *undo_history; /* history viewer, or NULL */ + + /* Composite preview */ + TempBuf *comp_preview; /* the composite preview */ + gboolean comp_preview_valid[3]; /* preview valid-1/channel */ +}; + +struct _GimpImageClass +{ + GimpObjectClass parent_class; + + void (* clean) (GimpImage *gimage); + void (* dirty) (GimpImage *gimage); + void (* repaint) (GimpImage *gimage); + void (* rename) (GimpImage *gimage); + void (* resize) (GimpImage *gimage); + void (* restructure) (GimpImage *gimage); + void (* colormap_changed) (GimpImage *gimage); + void (* undo_event) (GimpImage *gimage); +}; + +#define GIMP_IMAGE_TYPE_HAS_ALPHA(t) ((t)==RGBA_GIMAGE || (t)==GRAYA_GIMAGE || (t)==INDEXEDA_GIMAGE) typedef enum { @@ -374,4 +444,4 @@ TempBuf * gimp_image_construct_composite_preview (GimpImage *gimage, gint width, gint height); -#endif /* __GIMPIMAGE_H__ */ +#endif /* __GIMP_IMAGE_H__ */ diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c index 29522d42a9..1f09287c71 100644 --- a/app/core/gimpprojection.c +++ b/app/core/gimpprojection.c @@ -26,6 +26,7 @@ #include "apptypes.h" #include "appenv.h" +#include "channel.h" #include "colormaps.h" #include "cursorutil.h" #include "disp_callbacks.h" @@ -33,6 +34,7 @@ #include "draw_core.h" #include "gdisplay.h" #include "gdisplay_ops.h" +#include "gimage.h" #include "gimage_mask.h" #include "gimpcontext.h" #include "gimprc.h" @@ -40,6 +42,7 @@ #include "image_render.h" #include "info_window.h" #include "interface.h" +#include "layer.h" #include "lc_dialog.h" #include "menus.h" #include "nav_window.h" @@ -47,15 +50,16 @@ #include "qmask.h" #include "scale.h" #include "scroll.h" +#include "selection.h" #include "tools.h" #include "undo.h" + #ifdef DISPLAY_FILTERS #include "gdisplay_color.h" #endif /* DISPLAY_FILTERS */ #include "bezier_selectP.h" -#include "layer_pvt.h" /* ick. (not alone either) */ #include "libgimp/gimpmath.h" @@ -77,22 +81,42 @@ struct _GimpArea /* variable declarations */ -GSList * display_list = NULL; -static gint display_num = 1; +GSList * display_list = NULL; +static gint display_num = 1; static GdkCursorType default_gdisplay_cursor = GDK_TOP_LEFT_ARROW; /* Local functions */ -static void gdisplay_format_title (GDisplay *, char *, int); -static void gdisplay_delete (GDisplay *); -static GSList * gdisplay_free_area_list (GSList *); -static GSList * gdisplay_process_area_list (GSList *, GimpArea *); -static void gdisplay_add_update_area (GDisplay *, int, int, int, int); -static void gdisplay_add_display_area (GDisplay *, int, int, int, int); -static void gdisplay_paint_area (GDisplay *, int, int, int, int); -static void gdisplay_draw_cursor (GDisplay *); -static void gdisplay_display_area (GDisplay *, int, int, int, int); -static guint gdisplay_hash (GDisplay *); -static void gdisplay_cleandirty_handler (GimpImage *, void *); +static void gdisplay_format_title (GDisplay *, + gchar *, + gint ); +static void gdisplay_delete (GDisplay *); +static GSList * gdisplay_free_area_list (GSList *); +static GSList * gdisplay_process_area_list (GSList *, + GimpArea *); +static void gdisplay_add_update_area (GDisplay *, + gint , + gint , + gint , + gint ); +static void gdisplay_add_display_area (GDisplay *, + gint , + gint , + gint , + gint ); +static void gdisplay_paint_area (GDisplay *, + gint , + gint , + gint , + gint ); +static void gdisplay_draw_cursor (GDisplay *); +static void gdisplay_display_area (GDisplay *, + gint , + gint , + gint , + gint ); +static guint gdisplay_hash (GDisplay *); +static void gdisplay_cleandirty_handler (GimpImage *, + gpointer ); static GHashTable *display_ht = NULL; @@ -165,13 +189,13 @@ gdisplay_new (GimpImage *gimage, /* create the shell for the image */ create_display_shell (gdisp, gimage->width, gimage->height, - title, gimage_base_type (gimage)); + title, gimp_image_base_type (gimage)); /* update the title to correct the initially displayed scale */ gdisplay_update_title (gdisp); /* set the gdisplay colormap type and install the appropriate colormap */ - gdisp->color_type = (gimage_base_type (gimage) == GRAY) ? GRAY : RGB; + gdisp->color_type = (gimp_image_base_type (gimage) == GRAY) ? GRAY : RGB; /* set the qmask buttons */ qmask_buttons_update(gdisp); @@ -237,9 +261,9 @@ gdisplay_format_title (GDisplay *gdisp, gimage = gdisp->gimage; - empty = gimage_is_empty (gimage); + empty = gimp_image_is_empty (gimage); - switch (gimage_base_type (gimage)) + switch (gimp_image_base_type (gimage)) { case RGB: image_type_str = (empty) ? _("RGB-empty") : _("RGB"); @@ -273,11 +297,11 @@ gdisplay_format_title (GDisplay *gdisp, case 'f': /* pruned filename */ i += print (title, title_len, i, - "%s", g_basename (gimage_filename (gimage))); + "%s", g_basename (gimp_image_filename (gimage))); break; case 'F': /* full filename */ - i += print (title, title_len, i, "%s", gimage_filename (gimage)); + i += print (title, title_len, i, "%s", gimp_image_filename (gimage)); break; case 'p': /* PDB id */ @@ -1271,7 +1295,7 @@ gdisplay_paint_area (GDisplay *gdisp, gdisplay_untransform_coords (gdisp, gdisp->disp_width, gdisp->disp_height, &x2, &y2, FALSE, FALSE); - gimage_invalidate (gdisp->gimage, x, y, w, h, x1, y1, x2, y2); + gimp_image_invalidate (gdisp->gimage, x, y, w, h, x1, y1, x2, y2); /* display the area */ gdisplay_transform_coords (gdisp, x, y, &x1, &y1, FALSE); @@ -1373,11 +1397,11 @@ gdisplay_display_area (GDisplay *gdisp, dx, dy); #if 0 /* Invalidate the projection just after we render it! */ - gimage_invalidate_without_render (gdisp->gimage, - j - gdisp->disp_xoffset, - i - gdisp->disp_yoffset, - dx, dy, - 0, 0, 0, 0); + gimp_image_invalidate_without_render (gdisp->gimage, + j - gdisp->disp_xoffset, + i - gdisp->disp_yoffset, + dx, dy, + 0, 0, 0, 0); #endif #ifdef DISPLAY_FILTERS @@ -1422,10 +1446,10 @@ gdisplay_mask_bounds (GDisplay *gdisp, gint off_y; /* If there is a floating selection, handle things differently */ - if ((layer = gimage_floating_sel (gdisp->gimage))) + if ((layer = gimp_image_floating_sel (gdisp->gimage))) { drawable_offsets (GIMP_DRAWABLE(layer), &off_x, &off_y); - if (! channel_bounds (gimage_get_mask (gdisp->gimage), x1, y1, x2, y2)) + if (! channel_bounds (gimp_image_get_mask (gdisp->gimage), x1, y1, x2, y2)) { *x1 = off_x; *y1 = off_y; @@ -1440,7 +1464,7 @@ gdisplay_mask_bounds (GDisplay *gdisp, *y2 = MAX (off_y + drawable_height (GIMP_DRAWABLE (layer)), *y2); } } - else if (! channel_bounds (gimage_get_mask (gdisp->gimage), x1, y1, x2, y2)) + else if (! channel_bounds (gimp_image_get_mask (gdisp->gimage), x1, y1, x2, y2)) return FALSE; gdisplay_transform_coords (gdisp, *x1, *y1, x1, y1, 0); @@ -1474,7 +1498,8 @@ gdisplay_transform_coords (GDisplay *gdisp, scaley = SCALEFACTOR_Y (gdisp); if (use_offsets) - drawable_offsets (gimage_active_drawable (gdisp->gimage), &offset_x, &offset_y); + drawable_offsets (gimp_image_active_drawable (gdisp->gimage), + &offset_x, &offset_y); else { offset_x = offset_y = 0; @@ -1510,7 +1535,8 @@ gdisplay_untransform_coords (GDisplay *gdisp, scaley = SCALEFACTOR_Y (gdisp); if (use_offsets) - drawable_offsets (gimage_active_drawable (gdisp->gimage), &offset_x, &offset_y); + drawable_offsets (gimp_image_active_drawable (gdisp->gimage), + &offset_x, &offset_y); else { offset_x = offset_y = 0; @@ -1547,7 +1573,8 @@ gdisplay_transform_coords_f (GDisplay *gdisp, scaley = SCALEFACTOR_Y (gdisp); if (use_offsets) - drawable_offsets (gimage_active_drawable (gdisp->gimage), &offset_x, &offset_y); + drawable_offsets (gimp_image_active_drawable (gdisp->gimage), + &offset_x, &offset_y); else { offset_x = offset_y = 0; @@ -1582,7 +1609,8 @@ gdisplay_untransform_coords_f (GDisplay *gdisp, scaley = SCALEFACTOR_Y (gdisp); if (use_offsets) - drawable_offsets (gimage_active_drawable (gdisp->gimage), &offset_x, &offset_y); + drawable_offsets (gimp_image_active_drawable (gdisp->gimage), + &offset_x, &offset_y); else { offset_x = offset_y = 0; @@ -1718,27 +1746,27 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp) if (gdisp) { - base_type = gimage_base_type (gdisp->gimage); + base_type = gimp_image_base_type (gdisp->gimage); - fs = (gimage_floating_sel (gdisp->gimage) != NULL); - aux = (gimage_get_active_channel (gdisp->gimage) != NULL); + fs = (gimp_image_floating_sel (gdisp->gimage) != NULL); + aux = (gimp_image_get_active_channel (gdisp->gimage) != NULL); lp = (gdisp->gimage->layers != NULL); - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); if (drawable) type = drawable_type (drawable); if (lp) { - layer = gimage_get_active_layer (gdisp->gimage); + layer = gimp_image_get_active_layer (gdisp->gimage); if (layer) { lm = layer_get_mask (layer) ? TRUE : FALSE; alpha = layer_has_alpha (layer); } - lind = gimage_get_layer_index (gdisp->gimage, - gdisp->gimage->active_layer); + lind = gimp_image_get_layer_index (gdisp->gimage, + gdisp->gimage->active_layer); lnum = g_slist_length (gdisp->gimage->layers); } } diff --git a/app/core/gimpprojection.h b/app/core/gimpprojection.h index d414f67ca9..ad6b2e764f 100644 --- a/app/core/gimpprojection.h +++ b/app/core/gimpprojection.h @@ -15,16 +15,18 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __GDISPLAY_H__ #define __GDISPLAY_H__ - -#include "cursorutil.h" -#include "gimage.h" -#include "info_dialog.h" -#include "selection.h" - -#include "gdisplayF.h" +typedef enum +{ + SelectionOff, + SelectionLayerOff, + SelectionOn, + SelectionPause, + SelectionResume +} SelectionControl; /* * Global variables diff --git a/app/core/gimpscanconvert.c b/app/core/gimpscanconvert.c index 5c12886cbb..b331a5d535 100644 --- a/app/core/gimpscanconvert.c +++ b/app/core/gimpscanconvert.c @@ -18,13 +18,20 @@ #include "config.h" -#include +#include +#include + +#include "apptypes.h" + +#include "channel.h" +#include "drawable.h" #include "gimpimage.h" +#include "pixel_region.h" #include "scan_convert.h" + #include "libgimp/gimpmath.h" -#include #ifdef DEBUG #define TRC(x) printf x @@ -36,17 +43,17 @@ /* Reveal our private structure */ struct ScanConverterPrivate { - guint width; - guint height; - GSList **scanlines; /* array of height*antialias scanlines */ + guint width; + guint height; + GSList **scanlines; /* array of height*antialias scanlines */ - guint antialias; /* how much to oversample by */ + guint antialias; /* how much to oversample by */ - /* record the first and last points so we can close the curve */ - gboolean got_first; - ScanConvertPoint first; - gboolean got_last; - ScanConvertPoint last; + /* record the first and last points so we can close the curve */ + gboolean got_first; + ScanConvertPoint first; + gboolean got_last; + ScanConvertPoint last; }; @@ -55,7 +62,7 @@ struct ScanConverterPrivate static GSList * insert_into_sorted_list (GSList *list, - int x) + gint x) { GSList *orig = list; GSList *rest; @@ -87,265 +94,262 @@ insert_into_sorted_list (GSList *list, static void convert_segment (ScanConverter *sc, - int x1, - int y1, - int x2, - int y2) + gint x1, + gint y1, + gint x2, + gint y2) { - int ydiff, y, tmp; - gint width; - gint height; - GSList **scanlines; - float xinc, xstart; + gint ydiff, y, tmp; + gint width; + gint height; + GSList **scanlines; + gfloat xinc, xstart; - /* pre-calculate invariant commonly used values */ - width = sc->width * sc->antialias; - height = sc->height * sc->antialias; - scanlines = sc->scanlines; + /* pre-calculate invariant commonly used values */ + width = sc->width * sc->antialias; + height = sc->height * sc->antialias; + scanlines = sc->scanlines; - x1 = CLAMP (x1, 0, width - 1); - y1 = CLAMP (y1, 0, height - 1); - x2 = CLAMP (x2, 0, width - 1); - y2 = CLAMP (y2, 0, height - 1); + x1 = CLAMP (x1, 0, width - 1); + y1 = CLAMP (y1, 0, height - 1); + x2 = CLAMP (x2, 0, width - 1); + y2 = CLAMP (y2, 0, height - 1); - if (y1 > y2) + if (y1 > y2) { - tmp = y2; y2 = y1; y1 = tmp; - tmp = x2; x2 = x1; x1 = tmp; + tmp = y2; y2 = y1; y1 = tmp; + tmp = x2; x2 = x1; x1 = tmp; } - ydiff = (y2 - y1); + ydiff = (y2 - y1); - if (ydiff) + if (ydiff) { - xinc = (float) (x2 - x1) / (float) ydiff; - xstart = x1 + 0.5 * xinc; - for (y = y1 ; y < y2; y++) + xinc = (float) (x2 - x1) / (float) ydiff; + xstart = x1 + 0.5 * xinc; + for (y = y1 ; y < y2; y++) { scanlines[y] = insert_into_sorted_list (scanlines[y], ROUND (xstart)); xstart += xinc; } } - else + else { - /* horizontal line */ - scanlines[y1] = insert_into_sorted_list (scanlines[y1], ROUND (x1)); - scanlines[y1] = insert_into_sorted_list (scanlines[y1], ROUND (x2)); + /* horizontal line */ + scanlines[y1] = insert_into_sorted_list (scanlines[y1], ROUND (x1)); + scanlines[y1] = insert_into_sorted_list (scanlines[y1], ROUND (x2)); } } - /**************************************************************/ /* Exported functions */ - /* Create a new scan conversion context */ ScanConverter * -scan_converter_new (guint width, guint height, guint antialias) +scan_converter_new (guint width, + guint height, + guint antialias) { - ScanConverter *sc; + ScanConverter *sc; - g_return_val_if_fail (width > 0, NULL); - g_return_val_if_fail (height > 0, NULL); - g_return_val_if_fail (antialias > 0, NULL); + g_return_val_if_fail (width > 0, NULL); + g_return_val_if_fail (height > 0, NULL); + g_return_val_if_fail (antialias > 0, NULL); - sc = g_new0 (ScanConverter, 1); + sc = g_new0 (ScanConverter, 1); - sc->antialias = antialias; - sc->width = width; - sc->height = height; - sc->scanlines = g_new0 (GSList *, height*antialias); + sc->antialias = antialias; + sc->width = width; + sc->height = height; + sc->scanlines = g_new0 (GSList *, height * antialias); - return sc; + return sc; } +void +scan_converter_free (ScanConverter *sc) +{ + g_free (sc->scanlines); + g_free (sc); +} /* Add "npoints" from "pointlist" to the polygon currently being * described by "scan_converter". */ void -scan_converter_add_points (ScanConverter *sc, - guint npoints, +scan_converter_add_points (ScanConverter *sc, + guint npoints, ScanConvertPoint *pointlist) { - int i; - guint antialias; + gint i; + guint antialias; - g_return_if_fail (sc != NULL); - g_return_if_fail (pointlist != NULL); + g_return_if_fail (sc != NULL); + g_return_if_fail (pointlist != NULL); - antialias = sc->antialias; + antialias = sc->antialias; - if (!sc->got_first && npoints > 0) + if (!sc->got_first && npoints > 0) { - sc->got_first = TRUE; - sc->first = pointlist[0]; + sc->got_first = TRUE; + sc->first = pointlist[0]; } - /* link from previous point */ - if (sc->got_last && npoints > 0) + /* link from previous point */ + if (sc->got_last && npoints > 0) { - TRC (("|| %g,%g -> %g,%g\n", - sc->last.x, sc->last.y, - pointlist[0].x, pointlist[0].y)); - convert_segment (sc, - (int)sc->last.x * antialias, - (int)sc->last.y * antialias, - (int)pointlist[0].x * antialias, - (int)pointlist[0].y * antialias); + TRC (("|| %g,%g -> %g,%g\n", + sc->last.x, sc->last.y, + pointlist[0].x, pointlist[0].y)); + convert_segment (sc, + (int)sc->last.x * antialias, + (int)sc->last.y * antialias, + (int)pointlist[0].x * antialias, + (int)pointlist[0].y * antialias); } - for (i = 0; i < (npoints - 1); i++) + for (i = 0; i < (npoints - 1); i++) { - convert_segment (sc, - (int) pointlist[i].x * antialias, - (int) pointlist[i].y * antialias, - (int) pointlist[i + 1].x * antialias, - (int) pointlist[i + 1].y * antialias); + convert_segment (sc, + (int) pointlist[i].x * antialias, + (int) pointlist[i].y * antialias, + (int) pointlist[i + 1].x * antialias, + (int) pointlist[i + 1].y * antialias); } - TRC (("[] %g,%g -> %g,%g\n", - pointlist[0].x, pointlist[0].y, - pointlist[npoints-1].x, pointlist[npoints-1].y)); + TRC (("[] %g,%g -> %g,%g\n", + pointlist[0].x, pointlist[0].y, + pointlist[npoints-1].x, pointlist[npoints-1].y)); - if (npoints > 0) + if (npoints > 0) { - sc->got_last = TRUE; - sc->last = pointlist[npoints - 1]; + sc->got_last = TRUE; + sc->last = pointlist[npoints - 1]; } } - /* Scan convert the polygon described by the list of points passed to * scan_convert_add_points, and return a channel with a bits set if * they fall within the polygon defined. The polygon is filled * according to the even-odd rule. The polygon is closed by - * joining the final point to the initial point. */ + * joining the final point to the initial point. + */ Channel * scan_converter_to_channel (ScanConverter *sc, - GimpImage *gimage) + GimpImage *gimage) { - Channel *mask; - GSList *list; - PixelRegion maskPR; - guint widtha; - guint heighta; - guint antialias; - guint antialias2; - unsigned char *buf, *b; - int * vals, val; - int x, x2, w; - int i, j; + Channel *mask; + GSList *list; + PixelRegion maskPR; + guint widtha; + guint heighta; + guint antialias; + guint antialias2; + guchar *buf; + guchar *b; + gint *vals; + gint val; + gint x, x2, w; + gint i, j; - antialias = sc->antialias; - antialias2 = antialias * antialias; + antialias = sc->antialias; + antialias2 = antialias * antialias; - /* do we need to close the polygon? */ - if (sc->got_first && sc->got_last && - (sc->first.x != sc->last.x || sc->first.y != sc->last.y)) + /* do we need to close the polygon? */ + if (sc->got_first && sc->got_last && + (sc->first.x != sc->last.x || sc->first.y != sc->last.y)) { - convert_segment (sc, - (int) sc->last.x * antialias, - (int) sc->last.y * antialias, - (int) sc->first.x * antialias, - (int) sc->first.y * antialias); + convert_segment (sc, + (int) sc->last.x * antialias, + (int) sc->last.y * antialias, + (int) sc->first.x * antialias, + (int) sc->first.y * antialias); } - mask = channel_new_mask (gimage, sc->width, sc->height); + mask = channel_new_mask (gimage, sc->width, sc->height); - buf = g_new0 (unsigned char, sc->width); - widtha = sc->width * antialias; - heighta = sc->height * antialias; - /* allocate value array */ - vals = g_new (int, widtha); + buf = g_new0 (guchar, sc->width); + widtha = sc->width * antialias; + heighta = sc->height * antialias; + /* allocate value array */ + vals = g_new (gint, widtha); - /* dump scanlines */ - for(i=0; iscanlines[i]; - TRC (("%03d: ", i)); - while (list) + list = sc->scanlines[i]; + TRC (("%03d: ", i)); + while (list) { - TRC (("%3d ", GPOINTER_TO_INT (list->data))); - list = g_slist_next (list); + TRC (("%3d ", GPOINTER_TO_INT (list->data))); + list = g_slist_next (list); } - TRC (("\n")); + TRC (("\n")); } - pixel_region_init (&maskPR, drawable_data (GIMP_DRAWABLE(mask)), 0, 0, - drawable_width (GIMP_DRAWABLE(mask)), - drawable_height (GIMP_DRAWABLE(mask)), TRUE); + pixel_region_init (&maskPR, drawable_data (GIMP_DRAWABLE(mask)), 0, 0, + drawable_width (GIMP_DRAWABLE(mask)), + drawable_height (GIMP_DRAWABLE(mask)), TRUE); - for (i = 0; i < heighta; i++) + for (i = 0; i < heighta; i++) { - list = sc->scanlines[i]; + list = sc->scanlines[i]; - /* zero the vals array */ - if (!(i % antialias)) - memset (vals, 0, widtha * sizeof (int)); + /* zero the vals array */ + if (!(i % antialias)) + memset (vals, 0, widtha * sizeof (int)); - while (list) + while (list) { - x = GPOINTER_TO_INT (list->data); - list = g_slist_next (list); - if (!list) + x = GPOINTER_TO_INT (list->data); + list = g_slist_next (list); + if (!list) { - g_message ("Cannot properly scanline convert polygon!\n"); + g_message ("Cannot properly scanline convert polygon!\n"); } - else + else { - /* bounds checking */ - x = CLAMP (x, 0, widtha); - x2 = CLAMP (GPOINTER_TO_INT (list->data), 0, widtha); + /* bounds checking */ + x = CLAMP (x, 0, widtha); + x2 = CLAMP (GPOINTER_TO_INT (list->data), 0, widtha); - w = x2 - x; + w = x2 - x; - if (w > 0) + if (w > 0) { - if (antialias == 1) + if (antialias == 1) { - channel_add_segment (mask, x, i, w, 255); + channel_add_segment (mask, x, i, w, 255); } - else + else { - for (j = 0; j < w; j++) - vals[j + x] += 255; + for (j = 0; j < w; j++) + vals[j + x] += 255; } } - list = g_slist_next (list); + list = g_slist_next (list); } } - if (antialias != 1 && !((i+1) % antialias)) + if (antialias != 1 && !((i+1) % antialias)) { - b = buf; - for (j = 0; j < widtha; j += antialias) + b = buf; + for (j = 0; j < widtha; j += antialias) { - val = 0; - for (x = 0; x < antialias; x++) - val += vals[j + x]; + val = 0; + for (x = 0; x < antialias; x++) + val += vals[j + x]; - *b++ = (unsigned char) (val / antialias2); + *b++ = (guchar) (val / antialias2); } pixel_region_set_row (&maskPR, 0, (i / antialias), sc->width, buf); } } - g_free (vals); - g_free (buf); + g_free (vals); + g_free (buf); - return mask; + return mask; } - - -void -scan_converter_free (ScanConverter *sc) -{ - g_free (sc->scanlines); - g_free (sc); -} - - -/* End of scan_convert.c */ diff --git a/app/core/gimpscanconvert.h b/app/core/gimpscanconvert.h index de3d510f79..df691179cd 100644 --- a/app/core/gimpscanconvert.h +++ b/app/core/gimpscanconvert.h @@ -20,39 +20,41 @@ #define SCAN_CONVERT_H -typedef struct +struct _ScanConvertPoint { gdouble x; gdouble y; -} ScanConvertPoint; +}; typedef struct ScanConverterPrivate ScanConverter; /* Create a new scan conversion context. Set "antialias" to 1 for no - * supersampling, or the amount to supersample by otherwise. */ -ScanConverter * scan_converter_new (guint width, guint height, - guint antialias); + * supersampling, or the amount to supersample by otherwise. + */ +ScanConverter * scan_converter_new (guint width, + guint height, + guint antialias); +void scan_converter_free (ScanConverter *scan_converter); /* Add "npoints" from "pointlist" to the polygon currently being - * described by "scan_converter". */ -void scan_converter_add_points (ScanConverter *scan_converter, - guint npoints, - ScanConvertPoint *pointlist); + * described by "scan_converter". + */ +void scan_converter_add_points (ScanConverter *scan_converter, + guint npoints, + ScanConvertPoint *pointlist); /* Scan convert the polygon described by the list of points passed to * scan_convert_add_points, and return a channel with a bits set if * they fall within the polygon defined. The polygon is filled * according to the even-odd rule. The polygon is closed by - * joining the final point to the initial point. */ -Channel * scan_converter_to_channel (ScanConverter *scan_converter, - GimpImage *gimage); - - -void scan_converter_free (ScanConverter *scan_converter); + * joining the final point to the initial point. + */ +Channel * scan_converter_to_channel (ScanConverter *scan_converter, + GimpImage *gimage); #endif /* SCAN_CONVERT_H */ diff --git a/app/core/gimptooloptions.c b/app/core/gimptooloptions.c index babd80151c..b89dab896d 100644 --- a/app/core/gimptooloptions.c +++ b/app/core/gimptooloptions.c @@ -18,11 +18,12 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "brush_select.h" +#include "gimpcontext.h" #include "gimprc.h" #include "gimpui.h" #include "paint_funcs.h" diff --git a/app/core/gimptooloptions.h b/app/core/gimptooloptions.h index 378f534494..fe00fa2fe9 100644 --- a/app/core/gimptooloptions.h +++ b/app/core/gimptooloptions.h @@ -20,14 +20,8 @@ #define __TOOL_OPTIONS_H__ -/* tool options function declarations */ - -typedef void (* ToolOptionsResetFunc) (void); - - /* the tool options structures */ -typedef struct _ToolOptions ToolOptions; struct _ToolOptions { GtkWidget *main_vbox; @@ -49,4 +43,5 @@ void tool_options_init (ToolOptions *options, gchar *title, ToolOptionsResetFunc reset_func); + #endif /* __TOOL_OPTIONS_H__ */ diff --git a/app/core/gimpunit.c b/app/core/gimpunit.c index b09350fe07..90f3b55641 100644 --- a/app/core/gimpunit.c +++ b/app/core/gimpunit.c @@ -26,10 +26,12 @@ #include -#include "unitrc.h" +#include "apptypes.h" #include "app_procs.h" #include "gimprc.h" +#include "unitrc.h" + /* NOTE: * diff --git a/app/core/gimpunit.h b/app/core/gimpunit.h index 1afe409b0e..3c194797a6 100644 --- a/app/core/gimpunit.h +++ b/app/core/gimpunit.h @@ -19,7 +19,9 @@ #ifndef __UNITRC_H__ #define __UNITRC_H__ -void parse_unitrc (void); -void save_unitrc (void); + +void parse_unitrc (void); +void save_unitrc (void); + #endif /* __UNITRC_H__ */ diff --git a/app/crop.c b/app/crop.c index ff5de63cf3..a792147af9 100644 --- a/app/crop.c +++ b/app/crop.c @@ -26,22 +26,29 @@ #include "apptypes.h" #include "appenv.h" +#include "channel.h" #include "crop.h" #include "cursorutil.h" #include "draw_core.h" #include "drawable.h" #include "floating_sel.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimage_mask.h" #include "gimphelp.h" #include "gimpui.h" #include "info_dialog.h" +#include "layer.h" +#include "pixel_region.h" +#include "tools.h" +#include "tool_options.h" #include "undo.h" #include "libgimp/gimpsizeentry.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" + #define STATUSBAR_SIZE 128 /* possible crop functions */ @@ -285,7 +292,7 @@ crop_button_press (Tool *tool, draw_core_stop (crop->core, tool); tool->gdisp_ptr = gdisp_ptr; - tool->drawable = gimage_active_drawable (gdisp->gimage); + tool->drawable = gimp_image_active_drawable (gdisp->gimage); gdisplay_untransform_coords (gdisp, bevent->x, bevent->y, &crop->tx1, &crop->ty1, TRUE, FALSE); @@ -402,14 +409,15 @@ crop_motion (Tool *tool, GdkEventMotion *mevent, gpointer gdisp_ptr) { - Crop * crop; - GDisplay * gdisp; - Layer * layer; - int x1, y1, x2, y2; - int curx, cury; - int inc_x, inc_y; - gchar size[STATUSBAR_SIZE]; - int min_x, min_y, max_x, max_y; + Crop *crop; + GDisplay *gdisp; + Layer *layer; + gint x1, y1, x2, y2; + gint curx, cury; + gint inc_x, inc_y; + gchar size[STATUSBAR_SIZE]; + gint min_x, min_y, max_x, max_y; + crop = (Crop *) tool->private; gdisp = (GDisplay *) gdisp_ptr; @@ -871,7 +879,7 @@ crop_image (GImage *gimage, } else { - floating_layer = gimage_floating_sel (gimage); + floating_layer = gimp_image_floating_sel (gimage); undo_push_group_start (gimage, CROP_UNDO); @@ -930,14 +938,14 @@ crop_image (GImage *gimage, -(lx1 - off_x), -(ly1 - off_y)); else - gimage_remove_layer (gimage, layer); + gimp_image_remove_layer (gimage, layer); } list = next; } /* Make sure the projection matches the gimage size */ - gimage_projection_realloc (gimage); + gimp_image_projection_realloc (gimage); /* rigor the floating layer */ if (floating_layer) @@ -957,7 +965,7 @@ crop_image (GImage *gimage, /* shrink wrap and update all views */ channel_invalidate_previews (gimage); layer_invalidate_previews (gimage); - gimage_invalidate_preview (gimage); + gimp_image_invalidate_preview (gimage); gdisplays_update_full (gimage); gdisplays_shrink_wrap (gimage); } @@ -1287,7 +1295,7 @@ crop_automatic_callback (GtkWidget *widget, if (crop_options->layer_only) { - if (!(active_drawable = gimage_active_drawable (gdisp->gimage))) + if (!(active_drawable = gimp_image_active_drawable (gdisp->gimage))) return; width = drawable_width (GIMP_DRAWABLE (active_drawable)); height = drawable_height (GIMP_DRAWABLE (active_drawable)); diff --git a/app/crop.h b/app/crop.h index 33be8451bf..b698b95634 100644 --- a/app/crop.h +++ b/app/crop.h @@ -19,8 +19,6 @@ #ifndef __CROP_H__ #define __CROP_H__ -#include "tools.h" - typedef enum { @@ -29,12 +27,17 @@ typedef enum } CropType; -/* select functions */ -void crop_draw (Tool *); -void crop_image (GimpImage *gimage, int, int, int, int, int, int); +void crop_draw (Tool *tool); +void crop_image (GimpImage *gimage, + gint, + gint, + gint, + gint, + gint, + gint); Tool * tools_new_crop (void); -void tools_free_crop (Tool *); +void tools_free_crop (Tool *tool); #endif /* __CROP_H__ */ diff --git a/app/cursorutil.h b/app/cursorutil.h index b73024f282..02f9703a82 100644 --- a/app/cursorutil.h +++ b/app/cursorutil.h @@ -15,21 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __CURSORUTIL_H__ #define __CURSORUTIL_H__ -#include - -#include -#if defined (GDK_WINDOWING_WIN32) || defined (GDK_WINDOWING_X11) -/* Stopgap measure to detect build with current CVS GTk+ */ -#include -#endif - -#include "toolsF.h" - - typedef struct { guchar *bits; @@ -41,29 +31,6 @@ typedef struct GdkCursor *cursor; } BitmapCursor; -typedef enum -{ - CURSOR_MODE_TOOL_ICON, - CURSOR_MODE_TOOL_CROSSHAIR, - CURSOR_MODE_CROSSHAIR -} CursorMode; - -typedef enum -{ - CURSOR_MODIFIER_NONE, - CURSOR_MODIFIER_PLUS, - CURSOR_MODIFIER_MINUS, - CURSOR_MODIFIER_INTERSECT, - CURSOR_MODIFIER_MOVE, - CURSOR_MODIFIER_RESIZE, - CURSOR_MODIFIER_CONTROL, - CURSOR_MODIFIER_ANCHOR, - CURSOR_MODIFIER_FOREGROUND, - CURSOR_MODIFIER_BACKGROUND, - CURSOR_MODIFIER_PATTERN, - CURSOR_MODIFIER_HAND -} CursorModifier; - typedef enum { GIMP_MOUSE_CURSOR = (GDK_LAST_CURSOR + 2), diff --git a/app/curves.c b/app/curves.c index 692a2a8a71..7ba6f1ab76 100644 --- a/app/curves.c +++ b/app/curves.c @@ -26,18 +26,24 @@ #include "appenv.h" #include "cursorutil.h" +#include "curves.h" #include "drawable.h" #include "gdisplay.h" #include "gimphistogram.h" +#include "gimpimage.h" #include "gimpui.h" -#include "curves.h" #include "gimplut.h" +#include "image_map.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpenv.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" + #define GRAPH 0x1 #define XRANGE_TOP 0x2 #define XRANGE_BOTTOM 0x4 @@ -284,7 +290,7 @@ curves_button_press (Tool *tool, GimpDrawable *drawable; gdisp = gdisp_ptr; - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); tool->gdisp_ptr = gdisp; @@ -322,7 +328,7 @@ curves_button_release (Tool *tool, if(!curves_dialog || !gdisp || - !(drawable = gimage_active_drawable (gdisp->gimage))) + !(drawable = gimp_image_active_drawable (gdisp->gimage))) return; gdisplay_untransform_coords (gdisp, bevent->x, bevent->y, &x, &y, FALSE, FALSE); @@ -357,9 +363,9 @@ curves_motion (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; - if(!curves_dialog || - !gdisp || - !(drawable = gimage_active_drawable (gdisp->gimage))) + if (! curves_dialog || + ! gdisp || + ! (drawable = gimp_image_active_drawable (gdisp->gimage))) return; gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, FALSE, FALSE); @@ -443,7 +449,7 @@ curves_initialize (GDisplay *gdisp) { gint i, j; - if (drawable_indexed (gimage_active_drawable (gdisp->gimage))) + if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Curves for indexed drawables cannot be adjusted.")); return; @@ -466,7 +472,7 @@ curves_initialize (GDisplay *gdisp) curves_channel_reset (i); } - curves_dialog->drawable = gimage_active_drawable (gdisp->gimage); + curves_dialog->drawable = gimp_image_active_drawable (gdisp->gimage); curves_dialog->color = drawable_color (curves_dialog->drawable); curves_dialog->image_map = image_map_create (gdisp, curves_dialog->drawable); diff --git a/app/curves.h b/app/curves.h index 86daeefd40..d209de2d82 100644 --- a/app/curves.h +++ b/app/curves.h @@ -19,9 +19,6 @@ #ifndef __CURVES_H__ #define __CURVES_H__ -#include "image_map.h" -#include "lut_funcs.h" -#include "tools.h" #define SMOOTH 0 #define GFREE 1 @@ -63,16 +60,17 @@ struct _CurvesDialog GimpLut *lut; }; -Tool * tools_new_curves (void); -void tools_free_curves (Tool *tool); +Tool * tools_new_curves (void); +void tools_free_curves (Tool *tool); + +void curves_dialog_hide (void); +void curves_initialize (GDisplay *gdisp); +void curves_free (void); +gfloat curves_lut_func (CurvesDialog *cd, + gint nchannels, + gint channel, + gfloat value); +void curves_calculate_curve (CurvesDialog *cd); -void curves_dialog_hide (void); -void curves_initialize (GDisplay *gdisp); -void curves_free (void); -float curves_lut_func (CurvesDialog *cd, - gint nchannels, - gint channel, - gfloat value); -void curves_calculate_curve (CurvesDialog *cd); #endif /* __CURVES_H__ */ diff --git a/app/datafiles.c b/app/datafiles.c index 2984131418..5523f08de5 100644 --- a/app/datafiles.c +++ b/app/datafiles.c @@ -18,6 +18,7 @@ * 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 @@ -44,11 +45,14 @@ #endif #endif /* G_OS_WIN32 */ +#include "apptypes.h" + #include "datafiles.h" #include "gimprc.h" #include "libgimp/gimpenv.h" + /***** Functions *****/ static gboolean filestat_valid = FALSE; diff --git a/app/datafiles.h b/app/datafiles.h index d94b463398..d5c721e02b 100644 --- a/app/datafiles.h +++ b/app/datafiles.h @@ -23,11 +23,6 @@ #define __DATAFILES_H__ -#include - - -/***** Types *****/ - typedef enum { INCLUDE_TEMP_DIR = 1 << 0, diff --git a/app/desaturate.c b/app/desaturate.c index 9dcec4941a..263b2775f3 100644 --- a/app/desaturate.c +++ b/app/desaturate.c @@ -18,19 +18,20 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" #include "drawable.h" #include "desaturate.h" -#include "paint_funcs.h" #include "gimage.h" +#include "paint_funcs.h" +#include "pixel_region.h" -#include "config.h" #include "libgimp/gimpintl.h" + void image_desaturate (GimpImage *gimage) { @@ -52,24 +53,29 @@ image_desaturate (GimpImage *gimage) void desaturate (GimpDrawable *drawable) { - PixelRegion srcPR, destPR; - unsigned char *src, *s; - unsigned char *dest, *d; - int h, j; - int lightness, min, max; - int has_alpha; - void *pr; - int x1, y1, x2, y2; + PixelRegion srcPR, destPR; + guchar *src, *s; + guchar *dest, *d; + gint h, j; + gint lightness, min, max; + gint has_alpha; + gpointer pr; + gint x1, y1, x2, y2; if (!drawable) return; - has_alpha = drawable_has_alpha (drawable); - drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2); - pixel_region_init (&srcPR, drawable_data (drawable), x1, y1, (x2 - x1), (y2 - y1), FALSE); - pixel_region_init (&destPR, drawable_shadow (drawable), x1, y1, (x2 - x1), (y2 - y1), TRUE); + has_alpha = gimp_drawable_has_alpha (drawable); + gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2); - for (pr = pixel_regions_register (2, &srcPR, &destPR); pr != NULL; pr = pixel_regions_process (pr)) + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + x1, y1, (x2 - x1), (y2 - y1), FALSE); + pixel_region_init (&destPR, gimp_drawable_shadow (drawable), + x1, y1, (x2 - x1), (y2 - y1), TRUE); + + for (pr = pixel_regions_register (2, &srcPR, &destPR); + pr != NULL; + pr = pixel_regions_process (pr)) { src = srcPR.data; dest = destPR.data; diff --git a/app/desaturate.h b/app/desaturate.h index 33b5d68153..1b0e8017d3 100644 --- a/app/desaturate.h +++ b/app/desaturate.h @@ -20,9 +20,8 @@ #define __DESATURATE_H__ -/* desaturate functions */ -void image_desaturate (GimpImage *gimage); -void desaturate (GimpDrawable *drawable); +void image_desaturate (GimpImage *gimage); +void desaturate (GimpDrawable *drawable); #endif /* __DESATURATE_H__ */ diff --git a/app/devices.c b/app/devices.c index 5af69ee420..15edcf6da5 100644 --- a/app/devices.c +++ b/app/devices.c @@ -18,15 +18,17 @@ #include "config.h" +#include #include -#include +#include #include "apptypes.h" #include "appenv.h" #include "devices.h" #include "dialog_handler.h" +#include "gimpbrush.h" #include "gimpcontextpreview.h" #include "gimpdnd.h" #include "gimpbrushlist.h" @@ -35,13 +37,16 @@ #include "gimpui.h" #include "gradient.h" #include "gradient_header.h" +#include "patterns.h" #include "session.h" #include "tools.h" #include "libgimp/gimpenv.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpintl.h" + #define CELL_SIZE 20 /* The size of the preview cells */ #define PREVIEW_EVENT_MASK GDK_BUTTON_PRESS_MASK | \ diff --git a/app/devices.h b/app/devices.h index ca6a110c1d..817bfcb678 100644 --- a/app/devices.h +++ b/app/devices.h @@ -15,10 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + #ifndef __DEVICES_H__ #define __DEVICES_H__ -#include "tools.h" typedef enum { @@ -71,7 +71,9 @@ void devices_rc_update (gchar *name, /* Free device status (only for session-managment) */ void device_status_free (void); + /* Current device id */ extern gint current_device; + #endif /* __DEVICES_H__ */ diff --git a/app/dialog_handler.c b/app/dialog_handler.c index 538bde77b5..0ee4e09f29 100644 --- a/app/dialog_handler.c +++ b/app/dialog_handler.c @@ -16,8 +16,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #define __DIALOG_HANDLER_C__ 1 +#include "config.h" + #include #include @@ -26,13 +29,14 @@ #include "cursorutil.h" #include "dialog_handler.h" + /* State of individual dialogs */ typedef enum { - INVISIBLE, - VISIBLE, - UNKNOWN + VISIBILITY_INVISIBLE, + VISIBILITY_VISIBLE, + VISIBILITY_UNKNOWN } VisibilityState; typedef struct _DialogState DialogState; @@ -90,12 +94,12 @@ dialog_hide_all (void) if (GTK_WIDGET_VISIBLE (dstate->dialog)) { - dstate->saved_state = VISIBLE; + dstate->saved_state = VISIBILITY_VISIBLE; gtk_widget_hide (dstate->dialog); } else { - dstate->saved_state = INVISIBLE; + dstate->saved_state = VISIBILITY_INVISIBLE; } } } @@ -112,7 +116,8 @@ dialog_show_all (void) { dstate = (DialogState *) list->data; - if (dstate->saved_state == VISIBLE && !GTK_WIDGET_VISIBLE (dstate->dialog)) + if (dstate->saved_state == VISIBILITY_VISIBLE && + !GTK_WIDGET_VISIBLE (dstate->dialog)) gtk_widget_show(dstate->dialog); } } @@ -125,7 +130,7 @@ dialog_hide_toolbox (void) if (toolbox_shell && GTK_WIDGET_VISIBLE (toolbox_shell->dialog)) { gtk_widget_hide (toolbox_shell->dialog); - toolbox_shell->saved_state = VISIBLE; + toolbox_shell->saved_state = VISIBILITY_VISIBLE; } } @@ -135,7 +140,7 @@ void dialog_show_toolbox (void) { if (toolbox_shell && - toolbox_shell->saved_state == VISIBLE && + toolbox_shell->saved_state == VISIBILITY_VISIBLE && !GTK_WIDGET_VISIBLE (toolbox_shell->dialog)) { gtk_widget_show (toolbox_shell->dialog); @@ -154,8 +159,8 @@ dialog_idle_all (void) { dstate = (DialogState *) list->data; - if(!GTK_IS_WIDGET(dstate->dialog) || - (GTK_WIDGET_VISIBLE(dstate->dialog) && !dstate->dialog->window)) + if(!GTK_IS_WIDGET (dstate->dialog) || + (GTK_WIDGET_VISIBLE (dstate->dialog) && !dstate->dialog->window)) { g_warning("%s discovered non-widget thing %p in list of " "active_dialogs. Calling dialog_unregister on it.\n", @@ -163,7 +168,7 @@ dialog_idle_all (void) error_tmp_list.next=list->next; list=&error_tmp_list; - dialog_unregister(dstate->dialog); + dialog_unregister (dstate->dialog); } else if(GTK_WIDGET_VISIBLE (dstate->dialog)) { @@ -198,7 +203,7 @@ dialog_unidle_all (void) dstate = (DialogState *) list->data; if(!GTK_IS_WIDGET(dstate->dialog) || - (GTK_WIDGET_VISIBLE(dstate->dialog) && !dstate->dialog->window)) + (GTK_WIDGET_VISIBLE (dstate->dialog) && !dstate->dialog->window)) { g_warning("%s discovered non-widget thing %p in list of " "active_dialogs. Calling dialog_unregister on it.\n", @@ -236,7 +241,7 @@ dialog_register (GtkWidget *dialog) dstate = g_new (DialogState, 1); dstate->dialog = dialog; - dstate->saved_state = UNKNOWN; + dstate->saved_state = VISIBILITY_UNKNOWN; active_dialogs = g_slist_append (active_dialogs, dstate); } @@ -247,7 +252,7 @@ dialog_register_toolbox (GtkWidget *dialog) toolbox_shell = g_new (DialogState, 1); toolbox_shell->dialog = dialog; - toolbox_shell->saved_state = UNKNOWN; + toolbox_shell->saved_state = VISIBILITY_UNKNOWN; } void @@ -256,7 +261,7 @@ dialog_register_fileload (GtkWidget *dialog) fileload_shell = g_new (DialogState, 1); fileload_shell->dialog = dialog; - fileload_shell->saved_state = UNKNOWN; + fileload_shell->saved_state = VISIBILITY_UNKNOWN; } /* unregister dialog */ diff --git a/app/dialog_handler.h b/app/dialog_handler.h index 104c39d947..d4494e96e3 100644 --- a/app/dialog_handler.h +++ b/app/dialog_handler.h @@ -16,23 +16,21 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __DIALOG_HANDLER_H_ -#define __DIALOG_HANDLER_H_ -#ifndef __DIALOG_HANDLER_C_ -/* Bypass these declarations when compiling the file with the definitions, - * because of the G_MODULE_EXPORT attribute in it. - */ -void dialog_register (GtkWidget *dialog); -void dialog_unregister (GtkWidget *dialog); -#endif +#ifndef __DIALOG_HANDLER_H__ +#define __DIALOG_HANDLER_H__ -void dialog_register_toolbox (GtkWidget *dialog); -void dialog_register_fileload (GtkWidget *dialog); -void dialog_toggle (void); -void dialog_idle_all (void); -void dialog_unidle_all (void); -void dialog_show_toolbox (void); +void dialog_register (GtkWidget *dialog); +void dialog_unregister (GtkWidget *dialog); -#endif /* __DIALOG_HANDLER_H_ */ +void dialog_register_toolbox (GtkWidget *dialog); +void dialog_register_fileload (GtkWidget *dialog); + +void dialog_toggle (void); +void dialog_idle_all (void); +void dialog_unidle_all (void); +void dialog_show_toolbox (void); + + +#endif /* __DIALOG_HANDLER_H__ */ diff --git a/app/dialogs/about-dialog.c b/app/dialogs/about-dialog.c index e6b2bcc3d4..6bcca1f4dc 100644 --- a/app/dialogs/about-dialog.c +++ b/app/dialogs/about-dialog.c @@ -37,9 +37,11 @@ #include "libgimp/gimpfeatures.h" #include "libgimp/gimpenv.h" -#include "libgimp/gimpintl.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpmath.h" +#include "libgimp/gimpintl.h" + #include "pixmaps/wilber2.xpm" diff --git a/app/dialogs/about-dialog.h b/app/dialogs/about-dialog.h index 602df14466..38cd925696 100644 --- a/app/dialogs/about-dialog.h +++ b/app/dialogs/about-dialog.h @@ -15,6 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __ABOUT_DIALOG_H__ #define __ABOUT_DIALOG_H__ diff --git a/app/dialogs/color-dialog.c b/app/dialogs/color-dialog.c index 817f5fa7a6..d3370c299d 100644 --- a/app/dialogs/color-dialog.c +++ b/app/dialogs/color-dialog.c @@ -21,16 +21,19 @@ #include "config.h" -#include -#include - #include #include #include +#include +#include + +#include "apptypes.h" + #include "color_notebook.h" #include "gimpui.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpcolorselector.h" #include "libgimp/gimpintl.h" diff --git a/app/dialogs/image-new-dialog.c b/app/dialogs/image-new-dialog.c index 93f4089dba..0d94a16a8f 100644 --- a/app/dialogs/image-new-dialog.c +++ b/app/dialogs/image-new-dialog.c @@ -20,17 +20,23 @@ #include +#include "apptypes.h" + +#include "image_new.h" #include "file_new_dialog.h" #include "gimprc.h" #include "gimpui.h" #include "gdisplay.h" #include "libgimp/gimpchainbutton.h" -#include "libgimp/gimpmath.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimplimits.h" +#include "libgimp/gimpmath.h" #include "libgimp/gimpsizeentry.h" + #include "libgimp/gimpintl.h" + typedef struct { GtkWidget *dlg; diff --git a/app/dialogs/image-new-dialog.h b/app/dialogs/image-new-dialog.h index 403409ffbe..51629ba395 100644 --- a/app/dialogs/image-new-dialog.h +++ b/app/dialogs/image-new-dialog.h @@ -19,14 +19,12 @@ #ifndef __FILE_NEW_DIALOG_H__ #define __FILE_NEW_DIALOG_H__ -#include "image_new.h" +void file_new_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action); -void file_new_cmd_callback (GtkWidget *widget, - gpointer callback_data, - guint callback_action); - -void ui_new_image_window_create (const GimpImageNewValues *values); +void ui_new_image_window_create (const GimpImageNewValues *values); #endif /* __FILE_NEW_DIALOG_H_H__ */ diff --git a/app/dialogs/info-dialog.h b/app/dialogs/info-dialog.h index e033e33048..ce903888c7 100644 --- a/app/dialogs/info-dialog.h +++ b/app/dialogs/info-dialog.h @@ -19,11 +19,6 @@ #ifndef __INFO_DIALOG_H__ #define __INFO_DIALOG_H__ -#include "gimphelp.h" - -#include "libgimp/gimpsizeentry.h" -#include "libgimp/gimpunit.h" - typedef enum { @@ -35,7 +30,6 @@ typedef enum } InfoFieldType; typedef struct _InfoField InfoField; -typedef struct _InfoDialog InfoDialog; struct _InfoField { diff --git a/app/dialogs/info-window.c b/app/dialogs/info-window.c index cf29082be5..6c12d5df5a 100644 --- a/app/dialogs/info-window.c +++ b/app/dialogs/info-window.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include "apptypes.h" @@ -27,11 +27,13 @@ #include "colormaps.h" #include "gdisplay.h" #include "gimpcontext.h" +#include "gimpimage.h" #include "gimpset.h" #include "gimpui.h" #include "gximage.h" #include "info_dialog.h" #include "info_window.h" +#include "procedural_db.h" #include "scroll.h" #include "tools.h" @@ -39,6 +41,7 @@ #include "libgimp/gimpintl.h" + #define MAX_BUF 256 typedef struct _InfoWinData InfoWinData; @@ -245,8 +248,8 @@ info_window_create (GDisplay *gdisp) gchar *title, *title_buf; gint type; - title = g_basename (gimage_filename (gdisp->gimage)); - type = gimage_base_type (gdisp->gimage); + title = g_basename (gimp_image_filename (gdisp->gimage)); + type = gimp_image_base_type (gdisp->gimage); /* create the info dialog */ title_buf = info_window_title (gdisp); @@ -314,7 +317,7 @@ info_window_title (GDisplay *gdisp) gchar *title; gchar *title_buf; - title = g_basename (gimage_filename (gdisp->gimage)); + title = g_basename (gimp_image_filename (gdisp->gimage)); /* create the info dialog */ title_buf = g_strdup_printf (_("Info: %s-%d.%d"), @@ -421,7 +424,7 @@ info_window_update_RGB (GDisplay *gdisp, if (!iwd || iwd->showingPreview == FALSE) return; - /* gimage_active_drawable (gdisp->gimage) */ + /* gimp_image_active_drawable (gdisp->gimage) */ if (!(color = gimp_image_get_color_at (gdisp->gimage, tx, ty)) || (tx < 0.0 && ty < 0.0)) { @@ -531,7 +534,7 @@ info_window_update (GDisplay *gdisp) g_snprintf (iwd->scale_str, MAX_BUF, "%d:%d", SCALEDEST (gdisp), SCALESRC (gdisp)); - type = gimage_base_type (gdisp->gimage); + type = gimp_image_base_type (gdisp->gimage); /* color type */ if (type == RGB) diff --git a/app/dialogs/info-window.h b/app/dialogs/info-window.h index 51be465741..6c5c90e858 100644 --- a/app/dialogs/info-window.h +++ b/app/dialogs/info-window.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __INFO_WINDOW_H__ #define __INFO_WINDOW_H__ -#include "gdisplayF.h" -#include "info_dialog.h" InfoDialog * info_window_create (GDisplay *gdisp); void info_window_free (InfoDialog *info_win); @@ -29,4 +28,6 @@ void info_window_update_RGB (GDisplay *gdisp, gdouble tx, gdouble ty); void info_window_follow_auto (void); + + #endif /* __INFO_WINDOW_H__ */ diff --git a/app/dialogs/module-dialog.h b/app/dialogs/module-dialog.h index f178502b8e..fa1ecc49e2 100644 --- a/app/dialogs/module-dialog.h +++ b/app/dialogs/module-dialog.h @@ -17,16 +17,17 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __MODULE_DB_H__ /* Load any modules we find on the module-path set in the gimprc */ -void module_db_init (void); +void module_db_init (void); /* Unload all modules, in case a module needs some cleanups */ -void module_db_free (void); +void module_db_free (void); -GtkWidget *module_db_browser_new (void); +GtkWidget * module_db_browser_new (void); #endif /* __MODULE_DB_H__ */ diff --git a/app/dialogs/preferences-dialog.c b/app/dialogs/preferences-dialog.c index 044b51bad6..a85f2838c0 100644 --- a/app/dialogs/preferences-dialog.c +++ b/app/dialogs/preferences-dialog.c @@ -20,7 +20,7 @@ #include -#include +#include #include "apptypes.h" @@ -30,9 +30,12 @@ #include "cursorutil.h" #include "gdisplay_ops.h" #include "gdisplay.h" +#include "gimage.h" +#include "gimphelp.h" #include "gimprc.h" #include "gimpui.h" #include "image_render.h" +#include "layer.h" #include "lc_dialog.h" #include "layer_select.h" #include "resolution_calibrate.h" @@ -44,6 +47,7 @@ #include "libgimp/gimpintl.h" + /* gimprc will be parsed with a buffer size of 1024, so don't set this too large */ #define MAX_COMMENT_LENGTH 512 @@ -896,7 +900,7 @@ prefs_cancel_callback (GtkWidget *widget, transparency_size = old_transparency_size; render_setup (transparency_type, transparency_size); - gimage_foreach ((GFunc)layer_invalidate_previews, NULL); + gimage_foreach ((GFunc) layer_invalidate_previews, NULL); gimage_invalidate_previews (); gdisplays_expose_full (); gdisplays_flush (); diff --git a/app/dialogs/preferences-dialog.h b/app/dialogs/preferences-dialog.h index 6248568da9..9ee76ba152 100644 --- a/app/dialogs/preferences-dialog.h +++ b/app/dialogs/preferences-dialog.h @@ -20,7 +20,8 @@ #define __PREFERENCES_DIALOG_H__ -void prefs_cmd_callback (GtkWidget *widget, gpointer data); +void prefs_cmd_callback (GtkWidget *widget, + gpointer data); #endif /* __PREFERENCES_DIALOG_H__ */ diff --git a/app/dialogs/resize-dialog.c b/app/dialogs/resize-dialog.c index af13080eb3..cfec13b91f 100644 --- a/app/dialogs/resize-dialog.c +++ b/app/dialogs/resize-dialog.c @@ -23,7 +23,9 @@ #include "apptypes.h" #include "appenv.h" +#include "layer.h" #include "gdisplay.h" +#include "gimpimage.h" #include "resize.h" #include "undo.h" #include "gimprc.h" @@ -36,6 +38,7 @@ #include "libgimp/gimpintl.h" + #define EVENT_MASK GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK #define DRAWING_AREA_SIZE 200 #define TEXT_WIDTH 35 @@ -1253,12 +1256,12 @@ resize_events (GtkWidget *widget, void resize_scale_implement (ImageResize *image_scale) { - GImage *gimage = NULL; - gboolean rulers_flush = FALSE; - gboolean display_flush = FALSE; /* this is a bit ugly: - we hijack the flush variable - to check if an undo_group was - already started */ + GimpImage *gimage = NULL; + gboolean rulers_flush = FALSE; + gboolean display_flush = FALSE; /* this is a bit ugly: + we hijack the flush variable + to check if an undo_group was + already started */ g_assert (image_scale != NULL); gimage = image_scale->gimage; @@ -1269,9 +1272,9 @@ resize_scale_implement (ImageResize *image_scale) { undo_push_group_start (gimage, IMAGE_SCALE_UNDO); - gimage_set_resolution (gimage, - image_scale->resize->resolution_x, - image_scale->resize->resolution_y); + gimp_image_set_resolution (gimage, + image_scale->resize->resolution_x, + image_scale->resize->resolution_y); rulers_flush = TRUE; display_flush = TRUE; @@ -1282,7 +1285,7 @@ resize_scale_implement (ImageResize *image_scale) if (!display_flush) undo_push_group_start (gimage, IMAGE_SCALE_UNDO); - gimage_set_unit (gimage, image_scale->resize->unit); + gimp_image_set_unit (gimage, image_scale->resize->unit); gdisplays_setup_scale (gimage); gdisplays_resize_cursor_label (gimage); @@ -1299,9 +1302,9 @@ resize_scale_implement (ImageResize *image_scale) if (!display_flush) undo_push_group_start (gimage, IMAGE_SCALE_UNDO); - gimage_scale (gimage, - image_scale->resize->width, - image_scale->resize->height); + gimp_image_scale (gimage, + image_scale->resize->width, + image_scale->resize->height); display_flush = TRUE; } diff --git a/app/dialogs/resize-dialog.h b/app/dialogs/resize-dialog.h index 327bf4c103..a03fbfacf4 100644 --- a/app/dialogs/resize-dialog.h +++ b/app/dialogs/resize-dialog.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __RESIZE_H__ #define __RESIZE_H__ -#include "libgimp/gimpunit.h" -#include "gimage.h" typedef enum { @@ -73,23 +72,24 @@ typedef struct * If cancel_callback is NULL, then the dialog will be destroyed on "Cancel". */ -Resize * resize_widget_new (ResizeType type, - ResizeTarget target, - GtkObject *object, - gchar *signal, - gint width, - gint height, - gdouble resolution_x, - gdouble resolution_y, - GimpUnit unit, - gboolean dot_for_dot, - GtkSignalFunc ok_cb, - GtkSignalFunc cancel_cb, - gpointer user_data); +Resize * resize_widget_new (ResizeType type, + ResizeTarget target, + GtkObject *object, + gchar *signal, + gint width, + gint height, + gdouble resolution_x, + gdouble resolution_y, + GimpUnit unit, + gboolean dot_for_dot, + GtkSignalFunc ok_cb, + GtkSignalFunc cancel_cb, + gpointer user_data); /* Layer scaling sanity check and warning dialogs */ -gboolean resize_check_layer_scaling (ImageResize *image_resize); -void resize_scale_implement (ImageResize *image_resize); +gboolean resize_check_layer_scaling (ImageResize *image_resize); +void resize_scale_implement (ImageResize *image_resize); + #endif /* __RESIZE_H__ */ diff --git a/app/dialogs/tips-dialog.c b/app/dialogs/tips-dialog.c index 2096d21019..ed538bc748 100644 --- a/app/dialogs/tips-dialog.c +++ b/app/dialogs/tips-dialog.c @@ -25,6 +25,8 @@ #include +#include "apptypes.h" + #include "tips_dialog.h" #include "gimprc.h" #include "gimpui.h" diff --git a/app/dialogs/tips-dialog.h b/app/dialogs/tips-dialog.h index a50a0a0663..bde7ba8ee6 100644 --- a/app/dialogs/tips-dialog.h +++ b/app/dialogs/tips-dialog.h @@ -15,9 +15,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __TIPS_DIALOG_H__ #define __TIPS_DIALOG_H__ -void tips_dialog_create (void); + +void tips_dialog_create (void); + #endif /* __TIPS_DIALOG_H__ */ diff --git a/app/dialogs/user-install-dialog.c b/app/dialogs/user-install-dialog.c index baf1078ad0..817c212098 100644 --- a/app/dialogs/user-install-dialog.c +++ b/app/dialogs/user-install-dialog.c @@ -19,7 +19,7 @@ #include "config.h" -#include +#include #include #include @@ -49,6 +49,7 @@ #include "pixmaps/new.xpm" #include "pixmaps/wilber.xpm" + #ifndef G_OS_WIN32 # ifndef __EMX__ # define USER_INSTALL "user_install" diff --git a/app/disp_callbacks.c b/app/disp_callbacks.c index b3ffdaef50..4d60c74ef3 100644 --- a/app/disp_callbacks.c +++ b/app/disp_callbacks.c @@ -15,11 +15,12 @@ * 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 +#include #include #include "apptypes.h" @@ -28,23 +29,31 @@ #include "bucket_fill.h" #include "cursorutil.h" #include "devices.h" +#include "dialog_handler.h" #include "disp_callbacks.h" #include "gdisplay.h" +#include "gimage.h" #include "gimpcontext.h" +#include "drawable.h" #include "gimprc.h" #include "info_window.h" +#include "layer.h" #include "layer_select.h" #include "move.h" +#include "paint_funcs.h" #include "patterns.h" +#include "pixel_region.h" #include "scale.h" #include "scroll.h" +#include "selection.h" +#include "temp_buf.h" +#include "tile_manager.h" #include "tools.h" #include "undo.h" -#include "gimage.h" -#include "dialog_handler.h" #include "libgimp/gimpintl.h" + /* Function declarations */ static void gdisplay_check_device_cursor (GDisplay *gdisp); @@ -795,7 +804,7 @@ gdisplay_drag_drop (GtkWidget *widget, src_height = gimp_drawable_height (drawable); /* How many bytes in the temp buffer? */ - switch (drawable_type (drawable)) + switch (gimp_drawable_type (drawable)) { case RGB_GIMAGE: case RGBA_GIMAGE: bytes = 4; type = RGB; @@ -815,7 +824,7 @@ gdisplay_drag_drop (GtkWidget *widget, tiles = tile_manager_new (src_width, src_height, bytes); - pixel_region_init (&srcPR, drawable_data (drawable), + pixel_region_init (&srcPR, gimp_drawable_data (drawable), 0, 0, src_width, src_height, FALSE); pixel_region_init (&destPR, tiles, 0, 0, src_width, src_height, TRUE); @@ -823,8 +832,8 @@ gdisplay_drag_drop (GtkWidget *widget, if (type == INDEXED) /* If the layer is indexed...we need to extract pixels */ extract_from_region (&srcPR, &destPR, NULL, - drawable_cmap (drawable), bg, type, - drawable_has_alpha (drawable), FALSE); + gimp_drawable_cmap (drawable), bg, type, + gimp_drawable_has_alpha (drawable), FALSE); else if (bytes > srcPR.bytes) /* If the layer doesn't have an alpha channel, add one */ add_alpha_region (&srcPR, &destPR); @@ -918,13 +927,13 @@ gdisplay_bucket_fill (GtkWidget *widget, } else { - if (((orig_pat_buf->bytes == 3) && !drawable_color (drawable)) || - ((orig_pat_buf->bytes == 1) && !drawable_gray (drawable))) + if (((orig_pat_buf->bytes == 3) && ! gimp_drawable_is_rgb (drawable)) || + ((orig_pat_buf->bytes == 1) && ! gimp_drawable_is_gray (drawable))) { guchar *d1, *d2; gint size; - if ((orig_pat_buf->bytes == 1) && drawable_color (drawable)) + if ((orig_pat_buf->bytes == 1) && gimp_drawable_is_rgb (drawable)) pat_buf = temp_buf_new (orig_pat_buf->width, orig_pat_buf->height, 3, 0, 0, NULL); else @@ -951,9 +960,9 @@ gdisplay_bucket_fill (GtkWidget *widget, } } - drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2); - bytes = drawable_bytes (drawable); - has_alpha = drawable_has_alpha (drawable); + gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2); + bytes = gimp_drawable_bytes (drawable); + has_alpha = gimp_drawable_has_alpha (drawable); /* Fill the region */ buf_tiles = tile_manager_new ((x2 - x1), (y2 - y1), bytes); diff --git a/app/disp_callbacks.h b/app/disp_callbacks.h index 29648e5e4b..f666c525b2 100644 --- a/app/disp_callbacks.h +++ b/app/disp_callbacks.h @@ -15,39 +15,54 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __DISP_CALLBACKS_H__ #define __DISP_CALLBACKS_H__ -#include "gdisplay.h" -#include "patterns.h" -#define CANVAS_EVENT_MASK GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | \ - GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | \ - GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK | \ - GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | \ - GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | \ - GDK_PROXIMITY_OUT_MASK +#define CANVAS_EVENT_MASK (GDK_EXPOSURE_MASK | \ + GDK_POINTER_MOTION_MASK | \ + GDK_POINTER_MOTION_HINT_MASK | \ + GDK_BUTTON_PRESS_MASK | \ + GDK_BUTTON_RELEASE_MASK | \ + GDK_STRUCTURE_MASK | \ + GDK_ENTER_NOTIFY_MASK | \ + GDK_LEAVE_NOTIFY_MASK | \ + GDK_KEY_PRESS_MASK | \ + GDK_KEY_RELEASE_MASK | \ + GDK_PROXIMITY_OUT_MASK) -gint gdisplay_shell_events (GtkWidget *, GdkEvent *, GDisplay *); -gint gdisplay_canvas_events (GtkWidget *, GdkEvent *); -gint gdisplay_hruler_button_press (GtkWidget *, GdkEventButton *, gpointer); -gint gdisplay_vruler_button_press (GtkWidget *, GdkEventButton *, gpointer); -gint gdisplay_origin_button_press (GtkWidget *, GdkEventButton *, gpointer); +gint gdisplay_shell_events (GtkWidget *widget, + GdkEvent *event, + GDisplay *gdisp); +gint gdisplay_canvas_events (GtkWidget *widget, + GdkEvent *event); + +gint gdisplay_hruler_button_press (GtkWidget *widget, + GdkEventButton *bevent, + gpointer dtata); +gint gdisplay_vruler_button_press (GtkWidget *widget, + GdkEventButton *bevent, + gpointer data); +gint gdisplay_origin_button_press (GtkWidget *widget, + GdkEventButton *bevent, + gpointer data); + +gboolean gdisplay_drag_drop (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + guint time, + gpointer data); +void gdisplay_drop_color (GtkWidget *widget, + guchar r, + guchar g, + guchar b, + gpointer data); +void gdisplay_drop_pattern (GtkWidget *widget, + GPattern *pattern, + gpointer data); -gboolean gdisplay_drag_drop (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time, - gpointer data); -void gdisplay_drop_color (GtkWidget *widget, - guchar r, - guchar g, - guchar b, - gpointer data); -void gdisplay_drop_pattern (GtkWidget *widget, - GPattern *pattern, - gpointer data); #endif /* __DISP_CALLBACKS_H__ */ diff --git a/app/display/gimpdisplay-callbacks.c b/app/display/gimpdisplay-callbacks.c index b3ffdaef50..4d60c74ef3 100644 --- a/app/display/gimpdisplay-callbacks.c +++ b/app/display/gimpdisplay-callbacks.c @@ -15,11 +15,12 @@ * 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 +#include #include #include "apptypes.h" @@ -28,23 +29,31 @@ #include "bucket_fill.h" #include "cursorutil.h" #include "devices.h" +#include "dialog_handler.h" #include "disp_callbacks.h" #include "gdisplay.h" +#include "gimage.h" #include "gimpcontext.h" +#include "drawable.h" #include "gimprc.h" #include "info_window.h" +#include "layer.h" #include "layer_select.h" #include "move.h" +#include "paint_funcs.h" #include "patterns.h" +#include "pixel_region.h" #include "scale.h" #include "scroll.h" +#include "selection.h" +#include "temp_buf.h" +#include "tile_manager.h" #include "tools.h" #include "undo.h" -#include "gimage.h" -#include "dialog_handler.h" #include "libgimp/gimpintl.h" + /* Function declarations */ static void gdisplay_check_device_cursor (GDisplay *gdisp); @@ -795,7 +804,7 @@ gdisplay_drag_drop (GtkWidget *widget, src_height = gimp_drawable_height (drawable); /* How many bytes in the temp buffer? */ - switch (drawable_type (drawable)) + switch (gimp_drawable_type (drawable)) { case RGB_GIMAGE: case RGBA_GIMAGE: bytes = 4; type = RGB; @@ -815,7 +824,7 @@ gdisplay_drag_drop (GtkWidget *widget, tiles = tile_manager_new (src_width, src_height, bytes); - pixel_region_init (&srcPR, drawable_data (drawable), + pixel_region_init (&srcPR, gimp_drawable_data (drawable), 0, 0, src_width, src_height, FALSE); pixel_region_init (&destPR, tiles, 0, 0, src_width, src_height, TRUE); @@ -823,8 +832,8 @@ gdisplay_drag_drop (GtkWidget *widget, if (type == INDEXED) /* If the layer is indexed...we need to extract pixels */ extract_from_region (&srcPR, &destPR, NULL, - drawable_cmap (drawable), bg, type, - drawable_has_alpha (drawable), FALSE); + gimp_drawable_cmap (drawable), bg, type, + gimp_drawable_has_alpha (drawable), FALSE); else if (bytes > srcPR.bytes) /* If the layer doesn't have an alpha channel, add one */ add_alpha_region (&srcPR, &destPR); @@ -918,13 +927,13 @@ gdisplay_bucket_fill (GtkWidget *widget, } else { - if (((orig_pat_buf->bytes == 3) && !drawable_color (drawable)) || - ((orig_pat_buf->bytes == 1) && !drawable_gray (drawable))) + if (((orig_pat_buf->bytes == 3) && ! gimp_drawable_is_rgb (drawable)) || + ((orig_pat_buf->bytes == 1) && ! gimp_drawable_is_gray (drawable))) { guchar *d1, *d2; gint size; - if ((orig_pat_buf->bytes == 1) && drawable_color (drawable)) + if ((orig_pat_buf->bytes == 1) && gimp_drawable_is_rgb (drawable)) pat_buf = temp_buf_new (orig_pat_buf->width, orig_pat_buf->height, 3, 0, 0, NULL); else @@ -951,9 +960,9 @@ gdisplay_bucket_fill (GtkWidget *widget, } } - drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2); - bytes = drawable_bytes (drawable); - has_alpha = drawable_has_alpha (drawable); + gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2); + bytes = gimp_drawable_bytes (drawable); + has_alpha = gimp_drawable_has_alpha (drawable); /* Fill the region */ buf_tiles = tile_manager_new ((x2 - x1), (y2 - y1), bytes); diff --git a/app/display/gimpdisplay-callbacks.h b/app/display/gimpdisplay-callbacks.h index 29648e5e4b..f666c525b2 100644 --- a/app/display/gimpdisplay-callbacks.h +++ b/app/display/gimpdisplay-callbacks.h @@ -15,39 +15,54 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __DISP_CALLBACKS_H__ #define __DISP_CALLBACKS_H__ -#include "gdisplay.h" -#include "patterns.h" -#define CANVAS_EVENT_MASK GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | \ - GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | \ - GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK | \ - GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | \ - GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | \ - GDK_PROXIMITY_OUT_MASK +#define CANVAS_EVENT_MASK (GDK_EXPOSURE_MASK | \ + GDK_POINTER_MOTION_MASK | \ + GDK_POINTER_MOTION_HINT_MASK | \ + GDK_BUTTON_PRESS_MASK | \ + GDK_BUTTON_RELEASE_MASK | \ + GDK_STRUCTURE_MASK | \ + GDK_ENTER_NOTIFY_MASK | \ + GDK_LEAVE_NOTIFY_MASK | \ + GDK_KEY_PRESS_MASK | \ + GDK_KEY_RELEASE_MASK | \ + GDK_PROXIMITY_OUT_MASK) -gint gdisplay_shell_events (GtkWidget *, GdkEvent *, GDisplay *); -gint gdisplay_canvas_events (GtkWidget *, GdkEvent *); -gint gdisplay_hruler_button_press (GtkWidget *, GdkEventButton *, gpointer); -gint gdisplay_vruler_button_press (GtkWidget *, GdkEventButton *, gpointer); -gint gdisplay_origin_button_press (GtkWidget *, GdkEventButton *, gpointer); +gint gdisplay_shell_events (GtkWidget *widget, + GdkEvent *event, + GDisplay *gdisp); +gint gdisplay_canvas_events (GtkWidget *widget, + GdkEvent *event); + +gint gdisplay_hruler_button_press (GtkWidget *widget, + GdkEventButton *bevent, + gpointer dtata); +gint gdisplay_vruler_button_press (GtkWidget *widget, + GdkEventButton *bevent, + gpointer data); +gint gdisplay_origin_button_press (GtkWidget *widget, + GdkEventButton *bevent, + gpointer data); + +gboolean gdisplay_drag_drop (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + guint time, + gpointer data); +void gdisplay_drop_color (GtkWidget *widget, + guchar r, + guchar g, + guchar b, + gpointer data); +void gdisplay_drop_pattern (GtkWidget *widget, + GPattern *pattern, + gpointer data); -gboolean gdisplay_drag_drop (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time, - gpointer data); -void gdisplay_drop_color (GtkWidget *widget, - guchar r, - guchar g, - guchar b, - gpointer data); -void gdisplay_drop_pattern (GtkWidget *widget, - GPattern *pattern, - gpointer data); #endif /* __DISP_CALLBACKS_H__ */ diff --git a/app/display/gimpdisplay-ops.c b/app/display/gimpdisplay-ops.c index 1e71b7207a..455e7b3d51 100644 --- a/app/display/gimpdisplay-ops.c +++ b/app/display/gimpdisplay-ops.c @@ -34,8 +34,11 @@ #include "scale.h" #include "gimprc.h" +#include "libgimp/gimphelpui.h" + #include "libgimp/gimpintl.h" + static void gdisplay_close_warning_callback (GtkWidget *widget, gboolean close, gpointer data); diff --git a/app/display/gimpdisplay-render.c b/app/display/gimpdisplay-render.c index a81e0bb405..9b05ab8b33 100644 --- a/app/display/gimpdisplay-render.c +++ b/app/display/gimpdisplay-render.c @@ -26,13 +26,16 @@ #include "apptypes.h" #include "appenv.h" +#include "gdisplay.h" +#include "gimpimage.h" #include "gimprc.h" #include "gximage.h" #include "image_render.h" #include "pixel_region.h" #include "scale.h" +#include "tile.h" +#include "tile_manager.h" -#include "tile.h" /* ick. */ typedef struct _RenderInfo RenderInfo; typedef void (*RenderFunc) (RenderInfo *info); @@ -230,11 +233,11 @@ render_image (GDisplay *gdisp, render_image_init_info (&info, gdisp, x, y, w, h); - image_type = gimage_projection_type (gdisp->gimage); + image_type = gimp_image_projection_type (gdisp->gimage); if ((image_type < 0) || (image_type > 5)) { g_message ("unknown gimage projection type: %d", - gimage_projection_type (gdisp->gimage)); + gimp_image_projection_type (gdisp->gimage)); return; } @@ -272,7 +275,7 @@ render_image_indexed (RenderInfo *info) float error; float step; - cmap = gimage_cmap (info->gdisp->gimage); + cmap = gimp_image_cmap (info->gdisp->gimage); y = info->y; ye = info->y + info->h; @@ -344,7 +347,7 @@ render_image_indexed_a (RenderInfo *info) float error; float step; - cmap = gimage_cmap (info->gdisp->gimage); + cmap = gimp_image_cmap (info->gdisp->gimage); alpha = info->alpha; y = info->y; @@ -725,7 +728,7 @@ render_image_init_info (RenderInfo *info, int h) { info->gdisp = gdisp; - info->src_tiles = gimage_projection (gdisp->gimage); + info->src_tiles = gimp_image_projection (gdisp->gimage); info->x = x + gdisp->offset_x; info->y = y + gdisp->offset_y; info->w = w; @@ -734,7 +737,7 @@ render_image_init_info (RenderInfo *info, info->scaley = SCALEFACTOR_Y (gdisp); info->src_x = UNSCALEX (gdisp, info->x); info->src_y = UNSCALEY (gdisp, info->y); - info->src_bpp = gimage_projection_bytes (gdisp->gimage); + info->src_bpp = gimp_image_projection_bytes (gdisp->gimage); info->dest = gximage_get_data (); info->dest_bpp = gximage_get_bpp (); info->dest_bpl = gximage_get_bpl (); @@ -743,12 +746,12 @@ render_image_init_info (RenderInfo *info, info->scale = render_image_accelerate_scaling (w, info->x, info->scalex); info->alpha = NULL; - switch (gimage_projection_type (gdisp->gimage)) + switch (gimp_image_projection_type (gdisp->gimage)) { case RGBA_GIMAGE: case GRAYA_GIMAGE: case INDEXEDA_GIMAGE: - info->alpha = render_image_init_alpha (gimage_projection_opacity (gdisp->gimage)); + info->alpha = render_image_init_alpha (gimp_image_projection_opacity (gdisp->gimage)); break; default: /* nothing special needs doing */ diff --git a/app/display/gimpdisplay-render.h b/app/display/gimpdisplay-render.h index 5a5d0ba72c..e9b7ac4d2e 100644 --- a/app/display/gimpdisplay-render.h +++ b/app/display/gimpdisplay-render.h @@ -15,10 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __IMAGE_RENDER_H__ #define __IMAGE_RENDER_H__ -#include "gdisplay.h" /* Transparency representation */ @@ -34,14 +34,14 @@ #define LARGE_CHECKS 2 /* Functions */ -void render_setup (int check_type, - int check_size); +void render_setup (gint check_type, + gint check_size); void render_free (void); void render_image (GDisplay *gdisp, - int x, - int y, - int w, - int h); + gint x, + gint y, + gint w, + gint h); /* * Extern variables diff --git a/app/display/gimpdisplay-scale.c b/app/display/gimpdisplay-scale.c index cb3cf20bb2..f1d8c5763c 100644 --- a/app/display/gimpdisplay-scale.c +++ b/app/display/gimpdisplay-scale.c @@ -20,18 +20,20 @@ #include -#include +#include #include "apptypes.h" #include "appenv.h" #include "gdisplay.h" #include "gdisplay_ops.h" +#include "gimpimage.h" #include "gimprc.h" #include "nav_window.h" #include "scale.h" #include "tools.h" + void bounds_checking (GDisplay *gdisp) { diff --git a/app/display/gimpdisplay-scale.h b/app/display/gimpdisplay-scale.h index 54707452d2..9664600ea1 100644 --- a/app/display/gimpdisplay-scale.h +++ b/app/display/gimpdisplay-scale.h @@ -15,10 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __SCALE_H__ #define __SCALE_H__ -#include "gdisplay.h" typedef enum { @@ -26,7 +26,6 @@ typedef enum ZOOMOUT } ZoomType; -/* Functions */ void change_scale (GDisplay *gdisp, ZoomType zoom_type); @@ -37,4 +36,5 @@ void shrink_wrap_display (GDisplay *gdisp); void setup_scale (GDisplay *gdisp); void bounds_checking (GDisplay *gdisp); + #endif /* __SCALE_H__ */ diff --git a/app/display/gimpdisplay-scroll.c b/app/display/gimpdisplay-scroll.c index d1fe448746..9f9526beb9 100644 --- a/app/display/gimpdisplay-scroll.c +++ b/app/display/gimpdisplay-scroll.c @@ -20,17 +20,17 @@ #include -#include +#include #include "apptypes.h" #include "appenv.h" -#include "apptypes.h" +#include "cursorutil.h" +#include "gdisplay.h" #include "scale.h" #include "scroll.h" -#include "cursorutil.h" -#include "tools.h" #include "nav_window.h" +#include "tools.h" /* This is the delay before dithering begins diff --git a/app/display/gimpdisplay-scroll.h b/app/display/gimpdisplay-scroll.h index 24b1525162..17d27b490a 100644 --- a/app/display/gimpdisplay-scroll.h +++ b/app/display/gimpdisplay-scroll.h @@ -15,28 +15,37 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __SCROLL_H__ #define __SCROLL_H__ -#include "gdisplay.h" /* app init and exit routines */ -void init_scrolling (void); -void free_scrolling (void); +void init_scrolling (void); +void free_scrolling (void); /* routines for scrolling the image via the scrollbars */ -void scrollbar_disconnect (GtkAdjustment *, gpointer); -gint scrollbar_vert_update (GtkAdjustment *, gpointer); -gint scrollbar_horz_update (GtkAdjustment *, gpointer); +void scrollbar_disconnect (GtkAdjustment *adjuatment, + gpointer data); +gint scrollbar_vert_update (GtkAdjustment *adjuatment, + gpointer data); +gint scrollbar_horz_update (GtkAdjustment *adjuatment, + gpointer data); /* routines for grabbing the image and scrolling via the pointer */ -void start_grab_and_scroll (GDisplay *, GdkEventButton *); -void end_grab_and_scroll (GDisplay *, GdkEventButton *); -void grab_and_scroll (GDisplay *, GdkEventMotion *); -void scroll_to_pointer_position (GDisplay *, GdkEventMotion *); +void start_grab_and_scroll (GDisplay *gdisp, + GdkEventButton *bevent); +void end_grab_and_scroll (GDisplay *gdisp, + GdkEventButton *bevent); +void grab_and_scroll (GDisplay *gdisp, + GdkEventMotion *mevent); +void scroll_to_pointer_position (GDisplay *gdisp, + GdkEventMotion *mevent); /* generic scroll-by-offset function */ -gint scroll_display (GDisplay *, gint, gint); +gint scroll_display (GDisplay *, + gint , + gint ); #endif /* __SCROLL_H__ */ diff --git a/app/display/gimpdisplay-selection.c b/app/display/gimpdisplay-selection.c index 27ee7579e4..2810e66f0c 100644 --- a/app/display/gimpdisplay-selection.c +++ b/app/display/gimpdisplay-selection.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include "apptypes.h" @@ -28,10 +28,12 @@ #include "gdisplay.h" #include "gdisplay_ops.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "gimprc.h" #include "selection.h" #include "marching_ants.h" + #define USE_XDRAWPOINTS #undef VERBOSE @@ -342,33 +344,44 @@ selection_generate_segs (Selection *select) &select->num_segs_in, &select->num_segs_out); if (select->num_segs_in) { - select->segs_in = (GdkSegment *) g_malloc (sizeof (GdkSegment) * select->num_segs_in); - selection_transform_segs (select, segs_in, select->segs_in, select->num_segs_in); + select->segs_in = g_new (GdkSegment, select->num_segs_in); + selection_transform_segs (select, segs_in, select->segs_in, + select->num_segs_in); #ifdef USE_XDRAWPOINTS selection_render_points (select); #endif } else - select->segs_in = NULL; + { + select->segs_in = NULL; + } /* Possible secondary boundary representation */ if (select->num_segs_out) { - select->segs_out = (GdkSegment *) g_malloc (sizeof (GdkSegment) * select->num_segs_out); - selection_transform_segs (select, segs_out, select->segs_out, select->num_segs_out); + select->segs_out = g_new (GdkSegment, select->num_segs_out); + selection_transform_segs (select, segs_out, select->segs_out, + select->num_segs_out); } else - select->segs_out = NULL; + { + select->segs_out = NULL; + } /* The active layer's boundary */ - gimage_layer_boundary (gdisp->gimage, &segs_layer, &select->num_segs_layer); + gimp_image_layer_boundary (gdisp->gimage, &segs_layer, + &select->num_segs_layer); + if (select->num_segs_layer) { - select->segs_layer = (GdkSegment *) g_malloc (sizeof (GdkSegment) * select->num_segs_layer); - selection_transform_segs (select, segs_layer, select->segs_layer, select->num_segs_layer); + select->segs_layer = g_new (GdkSegment, select->num_segs_layer); + selection_transform_segs (select, segs_layer, select->segs_layer, + select->num_segs_layer); } else - select->segs_layer = NULL; + { + select->segs_layer = NULL; + } g_free (segs_layer); } @@ -500,7 +513,7 @@ selection_create (GdkWindow *win, gdisp = (GDisplay *) gdisp_ptr; new = (Selection *) g_malloc (sizeof (Selection)); - base_type = gimage_base_type (gdisp->gimage); + base_type = gimp_image_base_type (gdisp->gimage); if (cycled_marching_ants) { diff --git a/app/display/gimpdisplay-selection.h b/app/display/gimpdisplay-selection.h index f5736b7d41..08a5d7698c 100644 --- a/app/display/gimpdisplay-selection.h +++ b/app/display/gimpdisplay-selection.h @@ -15,12 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __SELECTION_H__ #define __SELECTION_H__ -typedef struct _selection Selection; - -struct _selection +struct _Selection { /* This information is for maintaining the selection's appearance */ GdkWindow * win; /* Window to draw to */ @@ -33,37 +32,44 @@ struct _selection GdkSegment * segs_in; /* gdk segments of area boundary */ GdkSegment * segs_out; /* gdk segments of area boundary */ GdkSegment * segs_layer; /* gdk segments of area boundary */ - int num_segs_in; /* number of segments in segs1 */ - int num_segs_out; /* number of segments in segs2 */ - int num_segs_layer; /* number of segments in segs3 */ - int index_in; /* index of current stipple pattern */ - int index_out; /* index of current stipple pattern */ - int index_layer; /* index of current stipple pattern */ - int state; /* internal drawing state */ - int paused; /* count of pause requests */ - int recalc; /* flag to recalculate the selection */ - int speed; /* speed of marching ants */ - int hidden; /* is the selection hidden? */ + gint num_segs_in; /* number of segments in segs1 */ + gint num_segs_out; /* number of segments in segs2 */ + gint num_segs_layer; /* number of segments in segs3 */ + gint index_in; /* index of current stipple pattern */ + gint index_out; /* index of current stipple pattern */ + gint index_layer; /* index of current stipple pattern */ + gint state; /* internal drawing state */ + gint paused; /* count of pause requests */ + gint recalc; /* flag to recalculate the selection */ + gint speed; /* speed of marching ants */ + gint hidden; /* is the selection hidden? */ gint timer; /* timer for successive draws */ - int cycle; /* color cycling turned on */ + gint cycle; /* color cycling turned on */ GdkPixmap * cycle_pix; /* cycling pixmap */ /* These are used only if USE_XDRAWPOINTS is defined. */ GdkPoint * points_in[8]; /* points of segs_in for fast ants */ - int num_points_in[8]; /* number of points in points_in */ + gint num_points_in[8]; /* number of points in points_in */ GdkGC * gc_white; /* gc for drawing white points */ GdkGC * gc_black; /* gc for drawing black points */ }; /* Function declarations */ -Selection * selection_create (GdkWindow *, gpointer, int, int, int); +Selection * selection_create (GdkWindow *, + gpointer , + gint , + gint , + gint ); void selection_pause (Selection *); void selection_resume (Selection *); -void selection_start (Selection *, int); +void selection_start (Selection *, + gint ); void selection_invis (Selection *); void selection_layer_invis (Selection *); -void selection_hide (Selection *, void *); +void selection_hide (Selection *, + gpointer ); void selection_free (Selection *); + #endif /* __SELECTION_H__ */ diff --git a/app/display/gimpdisplay.c b/app/display/gimpdisplay.c index 29522d42a9..1f09287c71 100644 --- a/app/display/gimpdisplay.c +++ b/app/display/gimpdisplay.c @@ -26,6 +26,7 @@ #include "apptypes.h" #include "appenv.h" +#include "channel.h" #include "colormaps.h" #include "cursorutil.h" #include "disp_callbacks.h" @@ -33,6 +34,7 @@ #include "draw_core.h" #include "gdisplay.h" #include "gdisplay_ops.h" +#include "gimage.h" #include "gimage_mask.h" #include "gimpcontext.h" #include "gimprc.h" @@ -40,6 +42,7 @@ #include "image_render.h" #include "info_window.h" #include "interface.h" +#include "layer.h" #include "lc_dialog.h" #include "menus.h" #include "nav_window.h" @@ -47,15 +50,16 @@ #include "qmask.h" #include "scale.h" #include "scroll.h" +#include "selection.h" #include "tools.h" #include "undo.h" + #ifdef DISPLAY_FILTERS #include "gdisplay_color.h" #endif /* DISPLAY_FILTERS */ #include "bezier_selectP.h" -#include "layer_pvt.h" /* ick. (not alone either) */ #include "libgimp/gimpmath.h" @@ -77,22 +81,42 @@ struct _GimpArea /* variable declarations */ -GSList * display_list = NULL; -static gint display_num = 1; +GSList * display_list = NULL; +static gint display_num = 1; static GdkCursorType default_gdisplay_cursor = GDK_TOP_LEFT_ARROW; /* Local functions */ -static void gdisplay_format_title (GDisplay *, char *, int); -static void gdisplay_delete (GDisplay *); -static GSList * gdisplay_free_area_list (GSList *); -static GSList * gdisplay_process_area_list (GSList *, GimpArea *); -static void gdisplay_add_update_area (GDisplay *, int, int, int, int); -static void gdisplay_add_display_area (GDisplay *, int, int, int, int); -static void gdisplay_paint_area (GDisplay *, int, int, int, int); -static void gdisplay_draw_cursor (GDisplay *); -static void gdisplay_display_area (GDisplay *, int, int, int, int); -static guint gdisplay_hash (GDisplay *); -static void gdisplay_cleandirty_handler (GimpImage *, void *); +static void gdisplay_format_title (GDisplay *, + gchar *, + gint ); +static void gdisplay_delete (GDisplay *); +static GSList * gdisplay_free_area_list (GSList *); +static GSList * gdisplay_process_area_list (GSList *, + GimpArea *); +static void gdisplay_add_update_area (GDisplay *, + gint , + gint , + gint , + gint ); +static void gdisplay_add_display_area (GDisplay *, + gint , + gint , + gint , + gint ); +static void gdisplay_paint_area (GDisplay *, + gint , + gint , + gint , + gint ); +static void gdisplay_draw_cursor (GDisplay *); +static void gdisplay_display_area (GDisplay *, + gint , + gint , + gint , + gint ); +static guint gdisplay_hash (GDisplay *); +static void gdisplay_cleandirty_handler (GimpImage *, + gpointer ); static GHashTable *display_ht = NULL; @@ -165,13 +189,13 @@ gdisplay_new (GimpImage *gimage, /* create the shell for the image */ create_display_shell (gdisp, gimage->width, gimage->height, - title, gimage_base_type (gimage)); + title, gimp_image_base_type (gimage)); /* update the title to correct the initially displayed scale */ gdisplay_update_title (gdisp); /* set the gdisplay colormap type and install the appropriate colormap */ - gdisp->color_type = (gimage_base_type (gimage) == GRAY) ? GRAY : RGB; + gdisp->color_type = (gimp_image_base_type (gimage) == GRAY) ? GRAY : RGB; /* set the qmask buttons */ qmask_buttons_update(gdisp); @@ -237,9 +261,9 @@ gdisplay_format_title (GDisplay *gdisp, gimage = gdisp->gimage; - empty = gimage_is_empty (gimage); + empty = gimp_image_is_empty (gimage); - switch (gimage_base_type (gimage)) + switch (gimp_image_base_type (gimage)) { case RGB: image_type_str = (empty) ? _("RGB-empty") : _("RGB"); @@ -273,11 +297,11 @@ gdisplay_format_title (GDisplay *gdisp, case 'f': /* pruned filename */ i += print (title, title_len, i, - "%s", g_basename (gimage_filename (gimage))); + "%s", g_basename (gimp_image_filename (gimage))); break; case 'F': /* full filename */ - i += print (title, title_len, i, "%s", gimage_filename (gimage)); + i += print (title, title_len, i, "%s", gimp_image_filename (gimage)); break; case 'p': /* PDB id */ @@ -1271,7 +1295,7 @@ gdisplay_paint_area (GDisplay *gdisp, gdisplay_untransform_coords (gdisp, gdisp->disp_width, gdisp->disp_height, &x2, &y2, FALSE, FALSE); - gimage_invalidate (gdisp->gimage, x, y, w, h, x1, y1, x2, y2); + gimp_image_invalidate (gdisp->gimage, x, y, w, h, x1, y1, x2, y2); /* display the area */ gdisplay_transform_coords (gdisp, x, y, &x1, &y1, FALSE); @@ -1373,11 +1397,11 @@ gdisplay_display_area (GDisplay *gdisp, dx, dy); #if 0 /* Invalidate the projection just after we render it! */ - gimage_invalidate_without_render (gdisp->gimage, - j - gdisp->disp_xoffset, - i - gdisp->disp_yoffset, - dx, dy, - 0, 0, 0, 0); + gimp_image_invalidate_without_render (gdisp->gimage, + j - gdisp->disp_xoffset, + i - gdisp->disp_yoffset, + dx, dy, + 0, 0, 0, 0); #endif #ifdef DISPLAY_FILTERS @@ -1422,10 +1446,10 @@ gdisplay_mask_bounds (GDisplay *gdisp, gint off_y; /* If there is a floating selection, handle things differently */ - if ((layer = gimage_floating_sel (gdisp->gimage))) + if ((layer = gimp_image_floating_sel (gdisp->gimage))) { drawable_offsets (GIMP_DRAWABLE(layer), &off_x, &off_y); - if (! channel_bounds (gimage_get_mask (gdisp->gimage), x1, y1, x2, y2)) + if (! channel_bounds (gimp_image_get_mask (gdisp->gimage), x1, y1, x2, y2)) { *x1 = off_x; *y1 = off_y; @@ -1440,7 +1464,7 @@ gdisplay_mask_bounds (GDisplay *gdisp, *y2 = MAX (off_y + drawable_height (GIMP_DRAWABLE (layer)), *y2); } } - else if (! channel_bounds (gimage_get_mask (gdisp->gimage), x1, y1, x2, y2)) + else if (! channel_bounds (gimp_image_get_mask (gdisp->gimage), x1, y1, x2, y2)) return FALSE; gdisplay_transform_coords (gdisp, *x1, *y1, x1, y1, 0); @@ -1474,7 +1498,8 @@ gdisplay_transform_coords (GDisplay *gdisp, scaley = SCALEFACTOR_Y (gdisp); if (use_offsets) - drawable_offsets (gimage_active_drawable (gdisp->gimage), &offset_x, &offset_y); + drawable_offsets (gimp_image_active_drawable (gdisp->gimage), + &offset_x, &offset_y); else { offset_x = offset_y = 0; @@ -1510,7 +1535,8 @@ gdisplay_untransform_coords (GDisplay *gdisp, scaley = SCALEFACTOR_Y (gdisp); if (use_offsets) - drawable_offsets (gimage_active_drawable (gdisp->gimage), &offset_x, &offset_y); + drawable_offsets (gimp_image_active_drawable (gdisp->gimage), + &offset_x, &offset_y); else { offset_x = offset_y = 0; @@ -1547,7 +1573,8 @@ gdisplay_transform_coords_f (GDisplay *gdisp, scaley = SCALEFACTOR_Y (gdisp); if (use_offsets) - drawable_offsets (gimage_active_drawable (gdisp->gimage), &offset_x, &offset_y); + drawable_offsets (gimp_image_active_drawable (gdisp->gimage), + &offset_x, &offset_y); else { offset_x = offset_y = 0; @@ -1582,7 +1609,8 @@ gdisplay_untransform_coords_f (GDisplay *gdisp, scaley = SCALEFACTOR_Y (gdisp); if (use_offsets) - drawable_offsets (gimage_active_drawable (gdisp->gimage), &offset_x, &offset_y); + drawable_offsets (gimp_image_active_drawable (gdisp->gimage), + &offset_x, &offset_y); else { offset_x = offset_y = 0; @@ -1718,27 +1746,27 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp) if (gdisp) { - base_type = gimage_base_type (gdisp->gimage); + base_type = gimp_image_base_type (gdisp->gimage); - fs = (gimage_floating_sel (gdisp->gimage) != NULL); - aux = (gimage_get_active_channel (gdisp->gimage) != NULL); + fs = (gimp_image_floating_sel (gdisp->gimage) != NULL); + aux = (gimp_image_get_active_channel (gdisp->gimage) != NULL); lp = (gdisp->gimage->layers != NULL); - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); if (drawable) type = drawable_type (drawable); if (lp) { - layer = gimage_get_active_layer (gdisp->gimage); + layer = gimp_image_get_active_layer (gdisp->gimage); if (layer) { lm = layer_get_mask (layer) ? TRUE : FALSE; alpha = layer_has_alpha (layer); } - lind = gimage_get_layer_index (gdisp->gimage, - gdisp->gimage->active_layer); + lind = gimp_image_get_layer_index (gdisp->gimage, + gdisp->gimage->active_layer); lnum = g_slist_length (gdisp->gimage->layers); } } diff --git a/app/display/gimpdisplay.h b/app/display/gimpdisplay.h index d414f67ca9..ad6b2e764f 100644 --- a/app/display/gimpdisplay.h +++ b/app/display/gimpdisplay.h @@ -15,16 +15,18 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __GDISPLAY_H__ #define __GDISPLAY_H__ - -#include "cursorutil.h" -#include "gimage.h" -#include "info_dialog.h" -#include "selection.h" - -#include "gdisplayF.h" +typedef enum +{ + SelectionOff, + SelectionLayerOff, + SelectionOn, + SelectionPause, + SelectionResume +} SelectionControl; /* * Global variables diff --git a/app/display/gimpdisplayshell-callbacks.c b/app/display/gimpdisplayshell-callbacks.c index b3ffdaef50..4d60c74ef3 100644 --- a/app/display/gimpdisplayshell-callbacks.c +++ b/app/display/gimpdisplayshell-callbacks.c @@ -15,11 +15,12 @@ * 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 +#include #include #include "apptypes.h" @@ -28,23 +29,31 @@ #include "bucket_fill.h" #include "cursorutil.h" #include "devices.h" +#include "dialog_handler.h" #include "disp_callbacks.h" #include "gdisplay.h" +#include "gimage.h" #include "gimpcontext.h" +#include "drawable.h" #include "gimprc.h" #include "info_window.h" +#include "layer.h" #include "layer_select.h" #include "move.h" +#include "paint_funcs.h" #include "patterns.h" +#include "pixel_region.h" #include "scale.h" #include "scroll.h" +#include "selection.h" +#include "temp_buf.h" +#include "tile_manager.h" #include "tools.h" #include "undo.h" -#include "gimage.h" -#include "dialog_handler.h" #include "libgimp/gimpintl.h" + /* Function declarations */ static void gdisplay_check_device_cursor (GDisplay *gdisp); @@ -795,7 +804,7 @@ gdisplay_drag_drop (GtkWidget *widget, src_height = gimp_drawable_height (drawable); /* How many bytes in the temp buffer? */ - switch (drawable_type (drawable)) + switch (gimp_drawable_type (drawable)) { case RGB_GIMAGE: case RGBA_GIMAGE: bytes = 4; type = RGB; @@ -815,7 +824,7 @@ gdisplay_drag_drop (GtkWidget *widget, tiles = tile_manager_new (src_width, src_height, bytes); - pixel_region_init (&srcPR, drawable_data (drawable), + pixel_region_init (&srcPR, gimp_drawable_data (drawable), 0, 0, src_width, src_height, FALSE); pixel_region_init (&destPR, tiles, 0, 0, src_width, src_height, TRUE); @@ -823,8 +832,8 @@ gdisplay_drag_drop (GtkWidget *widget, if (type == INDEXED) /* If the layer is indexed...we need to extract pixels */ extract_from_region (&srcPR, &destPR, NULL, - drawable_cmap (drawable), bg, type, - drawable_has_alpha (drawable), FALSE); + gimp_drawable_cmap (drawable), bg, type, + gimp_drawable_has_alpha (drawable), FALSE); else if (bytes > srcPR.bytes) /* If the layer doesn't have an alpha channel, add one */ add_alpha_region (&srcPR, &destPR); @@ -918,13 +927,13 @@ gdisplay_bucket_fill (GtkWidget *widget, } else { - if (((orig_pat_buf->bytes == 3) && !drawable_color (drawable)) || - ((orig_pat_buf->bytes == 1) && !drawable_gray (drawable))) + if (((orig_pat_buf->bytes == 3) && ! gimp_drawable_is_rgb (drawable)) || + ((orig_pat_buf->bytes == 1) && ! gimp_drawable_is_gray (drawable))) { guchar *d1, *d2; gint size; - if ((orig_pat_buf->bytes == 1) && drawable_color (drawable)) + if ((orig_pat_buf->bytes == 1) && gimp_drawable_is_rgb (drawable)) pat_buf = temp_buf_new (orig_pat_buf->width, orig_pat_buf->height, 3, 0, 0, NULL); else @@ -951,9 +960,9 @@ gdisplay_bucket_fill (GtkWidget *widget, } } - drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2); - bytes = drawable_bytes (drawable); - has_alpha = drawable_has_alpha (drawable); + gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2); + bytes = gimp_drawable_bytes (drawable); + has_alpha = gimp_drawable_has_alpha (drawable); /* Fill the region */ buf_tiles = tile_manager_new ((x2 - x1), (y2 - y1), bytes); diff --git a/app/display/gimpdisplayshell-callbacks.h b/app/display/gimpdisplayshell-callbacks.h index 29648e5e4b..f666c525b2 100644 --- a/app/display/gimpdisplayshell-callbacks.h +++ b/app/display/gimpdisplayshell-callbacks.h @@ -15,39 +15,54 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __DISP_CALLBACKS_H__ #define __DISP_CALLBACKS_H__ -#include "gdisplay.h" -#include "patterns.h" -#define CANVAS_EVENT_MASK GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | \ - GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | \ - GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK | \ - GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | \ - GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | \ - GDK_PROXIMITY_OUT_MASK +#define CANVAS_EVENT_MASK (GDK_EXPOSURE_MASK | \ + GDK_POINTER_MOTION_MASK | \ + GDK_POINTER_MOTION_HINT_MASK | \ + GDK_BUTTON_PRESS_MASK | \ + GDK_BUTTON_RELEASE_MASK | \ + GDK_STRUCTURE_MASK | \ + GDK_ENTER_NOTIFY_MASK | \ + GDK_LEAVE_NOTIFY_MASK | \ + GDK_KEY_PRESS_MASK | \ + GDK_KEY_RELEASE_MASK | \ + GDK_PROXIMITY_OUT_MASK) -gint gdisplay_shell_events (GtkWidget *, GdkEvent *, GDisplay *); -gint gdisplay_canvas_events (GtkWidget *, GdkEvent *); -gint gdisplay_hruler_button_press (GtkWidget *, GdkEventButton *, gpointer); -gint gdisplay_vruler_button_press (GtkWidget *, GdkEventButton *, gpointer); -gint gdisplay_origin_button_press (GtkWidget *, GdkEventButton *, gpointer); +gint gdisplay_shell_events (GtkWidget *widget, + GdkEvent *event, + GDisplay *gdisp); +gint gdisplay_canvas_events (GtkWidget *widget, + GdkEvent *event); + +gint gdisplay_hruler_button_press (GtkWidget *widget, + GdkEventButton *bevent, + gpointer dtata); +gint gdisplay_vruler_button_press (GtkWidget *widget, + GdkEventButton *bevent, + gpointer data); +gint gdisplay_origin_button_press (GtkWidget *widget, + GdkEventButton *bevent, + gpointer data); + +gboolean gdisplay_drag_drop (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + guint time, + gpointer data); +void gdisplay_drop_color (GtkWidget *widget, + guchar r, + guchar g, + guchar b, + gpointer data); +void gdisplay_drop_pattern (GtkWidget *widget, + GPattern *pattern, + gpointer data); -gboolean gdisplay_drag_drop (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time, - gpointer data); -void gdisplay_drop_color (GtkWidget *widget, - guchar r, - guchar g, - guchar b, - gpointer data); -void gdisplay_drop_pattern (GtkWidget *widget, - GPattern *pattern, - gpointer data); #endif /* __DISP_CALLBACKS_H__ */ diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c index b1edbf3929..5e3df5b2a2 100644 --- a/app/display/gimpdisplayshell-draw.c +++ b/app/display/gimpdisplayshell-draw.c @@ -35,7 +35,9 @@ #include "gdisplay.h" #include "gdisplay_ops.h" #include "gimage.h" +#include "gimpcontext.h" #include "gimpdnd.h" +#include "gimpdrawable.h" #include "gimphelp.h" #include "gimprc.h" #include "gimpui.h" @@ -43,10 +45,15 @@ #include "gtkvwrapbox.h" #include "indicator_area.h" #include "interface.h" +#include "layer.h" #include "menus.h" #include "nav_window.h" +#include "paint_funcs.h" +#include "pixel_region.h" #include "qmask.h" #include "session.h" +#include "pixel_region.h" +#include "tile_manager.h" #include "tools.h" #include "pixmaps.h" @@ -1211,7 +1218,7 @@ toolbox_drag_drop (GtkWidget *widget, } new_gimage = gimage_new (width, height, type); - gimage_disable_undo (new_gimage); + gimp_image_undo_disable (new_gimage); if (type == INDEXED) /* copy the colormap */ { @@ -1219,8 +1226,9 @@ toolbox_drag_drop (GtkWidget *widget, memcpy (new_gimage->cmap, gimage->cmap, COLORMAP_SIZE); } - gimage_set_resolution (new_gimage, gimage->xresolution, gimage->yresolution); - gimage_set_unit (new_gimage, gimage->unit); + gimp_image_set_resolution (new_gimage, + gimage->xresolution, gimage->yresolution); + gimp_image_set_unit (new_gimage, gimage->unit); if (layer) { @@ -1274,12 +1282,12 @@ toolbox_drag_drop (GtkWidget *widget, gimp_drawable_offsets (GIMP_DRAWABLE (new_layer), &off_x, &off_y); layer_translate (new_layer, -off_x, -off_y); - gimage_add_layer (new_gimage, new_layer, 0); + gimp_image_add_layer (new_gimage, new_layer, 0); gimp_context_set_display (gimp_context_get_user (), gdisplay_new (new_gimage, 0x0101)); - gimage_enable_undo (new_gimage); + gimp_image_undo_enable (new_gimage); return_val = TRUE; } diff --git a/app/display/gimpdisplayshell-draw.h b/app/display/gimpdisplayshell-draw.h index 7fe1acd8d4..3590b7f649 100644 --- a/app/display/gimpdisplayshell-draw.h +++ b/app/display/gimpdisplayshell-draw.h @@ -15,13 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __INTERFACE_H__ #define __INTERFACE_H__ -#include "toolsF.h" -#include "gdisplayF.h" -/* function declarations */ GtkWidget * create_pixmap_widget (GdkWindow *parent, gchar **data, gint width, @@ -39,4 +37,5 @@ void create_display_shell (GDisplay *gdisp, gchar *title, gint type); + #endif /* __INTERFACE_H__ */ diff --git a/app/display/gimpdisplayshell-layer-select.c b/app/display/gimpdisplayshell-layer-select.c index f03d9ada6d..b37e1a0315 100644 --- a/app/display/gimpdisplayshell-layer-select.c +++ b/app/display/gimpdisplayshell-layer-select.c @@ -24,10 +24,14 @@ #include "apptypes.h" #include "appenv.h" +#include "drawable.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimprc.h" +#include "layer.h" #include "layer_select.h" #include "layers_dialogP.h" +#include "temp_buf.h" #include "libgimp/gimpintl.h" @@ -210,7 +214,7 @@ layer_select_advance (LayerSelect *layer_select, return; /* If there is a floating selection, allow no advancement */ - if (gimage_floating_sel (layer_select->gimage)) + if (gimp_image_floating_sel (layer_select->gimage)) return; for (list = layer_select->gimage->layer_stack, count = 0; @@ -263,8 +267,8 @@ layer_select_end (LayerSelect *layer_select, /* only reset the active layer if a new layer was specified */ if (layer_select->current_layer != layer_select->gimage->active_layer) { - gimage_set_active_layer (layer_select->gimage, - layer_select->current_layer); + gimp_image_set_active_layer (layer_select->gimage, + layer_select->current_layer); gdisplays_flush (); } } diff --git a/app/display/gimpdisplayshell-layer-select.h b/app/display/gimpdisplayshell-layer-select.h index 656745a26c..6d6260760a 100644 --- a/app/display/gimpdisplayshell-layer-select.h +++ b/app/display/gimpdisplayshell-layer-select.h @@ -19,8 +19,6 @@ #ifndef __LAYER_SELECT_H__ #define __LAYER_SELECT_H__ -#include "gimage.h" - void layer_select_init (GImage *gimage, gint move, diff --git a/app/display/gimpdisplayshell-qmask.c b/app/display/gimpdisplayshell-qmask.c index 34be73025d..1c4af4b114 100644 --- a/app/display/gimpdisplayshell-qmask.c +++ b/app/display/gimpdisplayshell-qmask.c @@ -29,11 +29,12 @@ #include "appenv.h" #include "channel.h" #include "color_panel.h" +#include "drawable.h" #include "floating_sel.h" -#include "gdisplayF.h" -#include "gimpcontext.h" +#include "gdisplay.h" #include "gimage_mask.h" #include "gimpimage.h" +#include "gimpcontext.h" #include "gimpui.h" #include "global_edit.h" #include "qmask.h" @@ -163,7 +164,7 @@ qmask_deactivate (GtkWidget *widget, the qmask_state to FALSE */ undo_push_qmask (gimg); gimage_mask_load (gimg, gmask); - gimage_remove_channel (gimg, gmask); + gimp_image_remove_channel (gimg, gmask); undo_push_group_end (gimg); } @@ -207,9 +208,9 @@ qmask_activate (GtkWidget *widget, undo_push_group_start (gimg, QMASK_UNDO); - if (gimage_mask_is_empty(gimg)) + if (gimage_mask_is_empty (gimg)) { - if ((layer = gimage_floating_sel (gimg))) + if ((layer = gimp_image_floating_sel (gimg))) { floating_sel_to_layer (layer); } @@ -217,7 +218,7 @@ qmask_activate (GtkWidget *widget, gmask = channel_new (gimg, gimg->width, gimg->height, - "Qmask", + "Qmask", (gint)(255*opacity)/100, color); gimp_image_add_channel (gimg, gmask, 0); @@ -225,7 +226,7 @@ qmask_activate (GtkWidget *widget, } else { /* if selection */ - gmask = channel_copy (gimage_get_mask (gimg)); + gmask = channel_copy (gimp_image_get_mask (gimg)); gimp_image_add_channel (gimg, gmask, 0); channel_set_color (gmask, color); drawable_set_name (GIMP_DRAWABLE (gmask), "Qmask"); @@ -331,12 +332,12 @@ edit_qmask_query_ok_callback (GtkWidget *widget, gpointer client_data) { EditQmaskOptions *options; - Channel *channel; - guchar *tmpcolp; - guchar tmpcol[3]; - gboolean update = FALSE; - gint opacity; - gint i; + Channel *channel; + const guchar *tmpcolp; + guchar tmpcol[3]; + gboolean update = FALSE; + gint opacity; + gint i; options = (EditQmaskOptions *) client_data; channel = gimp_image_get_channel_by_name (options->gimage, "Qmask"); @@ -348,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget, { update = TRUE; } - tmpcolp = channel_get_color(channel); + tmpcolp = channel_get_color (channel); for (i = 0; i < 3; i++) { /* don't update if color hasn't changed */ tmpcol[i] = tmpcolp[i]; /* initialize to same values */ diff --git a/app/display/gimpdisplayshell-qmask.h b/app/display/gimpdisplayshell-qmask.h index e47b40f493..66664516f4 100644 --- a/app/display/gimpdisplayshell-qmask.h +++ b/app/display/gimpdisplayshell-qmask.h @@ -15,13 +15,20 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __QMASK_H__ #define __QMASK_H__ -void qmask_click_handler(GtkWidget *widget, GdkEventButton *event, gpointer data); -void qmask_activate(GtkWidget *w, GDisplay *gdisp); -void qmask_deactivate(GtkWidget *w, GDisplay *gdisp); -void qmask_buttons_update (GDisplay *gdisp); + +void qmask_click_handler (GtkWidget *widget, + GdkEventButton *event, + gpointer data); +void qmask_activate (GtkWidget *widget, + GDisplay *gdisp); +void qmask_deactivate (GtkWidget *widget, + GDisplay *gdisp); +void qmask_buttons_update (GDisplay *gdisp); + #endif /* __QMASK_H__ */ diff --git a/app/display/gimpdisplayshell-render.c b/app/display/gimpdisplayshell-render.c index a81e0bb405..9b05ab8b33 100644 --- a/app/display/gimpdisplayshell-render.c +++ b/app/display/gimpdisplayshell-render.c @@ -26,13 +26,16 @@ #include "apptypes.h" #include "appenv.h" +#include "gdisplay.h" +#include "gimpimage.h" #include "gimprc.h" #include "gximage.h" #include "image_render.h" #include "pixel_region.h" #include "scale.h" +#include "tile.h" +#include "tile_manager.h" -#include "tile.h" /* ick. */ typedef struct _RenderInfo RenderInfo; typedef void (*RenderFunc) (RenderInfo *info); @@ -230,11 +233,11 @@ render_image (GDisplay *gdisp, render_image_init_info (&info, gdisp, x, y, w, h); - image_type = gimage_projection_type (gdisp->gimage); + image_type = gimp_image_projection_type (gdisp->gimage); if ((image_type < 0) || (image_type > 5)) { g_message ("unknown gimage projection type: %d", - gimage_projection_type (gdisp->gimage)); + gimp_image_projection_type (gdisp->gimage)); return; } @@ -272,7 +275,7 @@ render_image_indexed (RenderInfo *info) float error; float step; - cmap = gimage_cmap (info->gdisp->gimage); + cmap = gimp_image_cmap (info->gdisp->gimage); y = info->y; ye = info->y + info->h; @@ -344,7 +347,7 @@ render_image_indexed_a (RenderInfo *info) float error; float step; - cmap = gimage_cmap (info->gdisp->gimage); + cmap = gimp_image_cmap (info->gdisp->gimage); alpha = info->alpha; y = info->y; @@ -725,7 +728,7 @@ render_image_init_info (RenderInfo *info, int h) { info->gdisp = gdisp; - info->src_tiles = gimage_projection (gdisp->gimage); + info->src_tiles = gimp_image_projection (gdisp->gimage); info->x = x + gdisp->offset_x; info->y = y + gdisp->offset_y; info->w = w; @@ -734,7 +737,7 @@ render_image_init_info (RenderInfo *info, info->scaley = SCALEFACTOR_Y (gdisp); info->src_x = UNSCALEX (gdisp, info->x); info->src_y = UNSCALEY (gdisp, info->y); - info->src_bpp = gimage_projection_bytes (gdisp->gimage); + info->src_bpp = gimp_image_projection_bytes (gdisp->gimage); info->dest = gximage_get_data (); info->dest_bpp = gximage_get_bpp (); info->dest_bpl = gximage_get_bpl (); @@ -743,12 +746,12 @@ render_image_init_info (RenderInfo *info, info->scale = render_image_accelerate_scaling (w, info->x, info->scalex); info->alpha = NULL; - switch (gimage_projection_type (gdisp->gimage)) + switch (gimp_image_projection_type (gdisp->gimage)) { case RGBA_GIMAGE: case GRAYA_GIMAGE: case INDEXEDA_GIMAGE: - info->alpha = render_image_init_alpha (gimage_projection_opacity (gdisp->gimage)); + info->alpha = render_image_init_alpha (gimp_image_projection_opacity (gdisp->gimage)); break; default: /* nothing special needs doing */ diff --git a/app/display/gimpdisplayshell-render.h b/app/display/gimpdisplayshell-render.h index 5a5d0ba72c..e9b7ac4d2e 100644 --- a/app/display/gimpdisplayshell-render.h +++ b/app/display/gimpdisplayshell-render.h @@ -15,10 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __IMAGE_RENDER_H__ #define __IMAGE_RENDER_H__ -#include "gdisplay.h" /* Transparency representation */ @@ -34,14 +34,14 @@ #define LARGE_CHECKS 2 /* Functions */ -void render_setup (int check_type, - int check_size); +void render_setup (gint check_type, + gint check_size); void render_free (void); void render_image (GDisplay *gdisp, - int x, - int y, - int w, - int h); + gint x, + gint y, + gint w, + gint h); /* * Extern variables diff --git a/app/display/gimpdisplayshell-scale.c b/app/display/gimpdisplayshell-scale.c index cb3cf20bb2..f1d8c5763c 100644 --- a/app/display/gimpdisplayshell-scale.c +++ b/app/display/gimpdisplayshell-scale.c @@ -20,18 +20,20 @@ #include -#include +#include #include "apptypes.h" #include "appenv.h" #include "gdisplay.h" #include "gdisplay_ops.h" +#include "gimpimage.h" #include "gimprc.h" #include "nav_window.h" #include "scale.h" #include "tools.h" + void bounds_checking (GDisplay *gdisp) { diff --git a/app/display/gimpdisplayshell-scale.h b/app/display/gimpdisplayshell-scale.h index 54707452d2..9664600ea1 100644 --- a/app/display/gimpdisplayshell-scale.h +++ b/app/display/gimpdisplayshell-scale.h @@ -15,10 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __SCALE_H__ #define __SCALE_H__ -#include "gdisplay.h" typedef enum { @@ -26,7 +26,6 @@ typedef enum ZOOMOUT } ZoomType; -/* Functions */ void change_scale (GDisplay *gdisp, ZoomType zoom_type); @@ -37,4 +36,5 @@ void shrink_wrap_display (GDisplay *gdisp); void setup_scale (GDisplay *gdisp); void bounds_checking (GDisplay *gdisp); + #endif /* __SCALE_H__ */ diff --git a/app/display/gimpdisplayshell-scroll.c b/app/display/gimpdisplayshell-scroll.c index d1fe448746..9f9526beb9 100644 --- a/app/display/gimpdisplayshell-scroll.c +++ b/app/display/gimpdisplayshell-scroll.c @@ -20,17 +20,17 @@ #include -#include +#include #include "apptypes.h" #include "appenv.h" -#include "apptypes.h" +#include "cursorutil.h" +#include "gdisplay.h" #include "scale.h" #include "scroll.h" -#include "cursorutil.h" -#include "tools.h" #include "nav_window.h" +#include "tools.h" /* This is the delay before dithering begins diff --git a/app/display/gimpdisplayshell-scroll.h b/app/display/gimpdisplayshell-scroll.h index 24b1525162..17d27b490a 100644 --- a/app/display/gimpdisplayshell-scroll.h +++ b/app/display/gimpdisplayshell-scroll.h @@ -15,28 +15,37 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __SCROLL_H__ #define __SCROLL_H__ -#include "gdisplay.h" /* app init and exit routines */ -void init_scrolling (void); -void free_scrolling (void); +void init_scrolling (void); +void free_scrolling (void); /* routines for scrolling the image via the scrollbars */ -void scrollbar_disconnect (GtkAdjustment *, gpointer); -gint scrollbar_vert_update (GtkAdjustment *, gpointer); -gint scrollbar_horz_update (GtkAdjustment *, gpointer); +void scrollbar_disconnect (GtkAdjustment *adjuatment, + gpointer data); +gint scrollbar_vert_update (GtkAdjustment *adjuatment, + gpointer data); +gint scrollbar_horz_update (GtkAdjustment *adjuatment, + gpointer data); /* routines for grabbing the image and scrolling via the pointer */ -void start_grab_and_scroll (GDisplay *, GdkEventButton *); -void end_grab_and_scroll (GDisplay *, GdkEventButton *); -void grab_and_scroll (GDisplay *, GdkEventMotion *); -void scroll_to_pointer_position (GDisplay *, GdkEventMotion *); +void start_grab_and_scroll (GDisplay *gdisp, + GdkEventButton *bevent); +void end_grab_and_scroll (GDisplay *gdisp, + GdkEventButton *bevent); +void grab_and_scroll (GDisplay *gdisp, + GdkEventMotion *mevent); +void scroll_to_pointer_position (GDisplay *gdisp, + GdkEventMotion *mevent); /* generic scroll-by-offset function */ -gint scroll_display (GDisplay *, gint, gint); +gint scroll_display (GDisplay *, + gint , + gint ); #endif /* __SCROLL_H__ */ diff --git a/app/display/gimpdisplayshell-selection.c b/app/display/gimpdisplayshell-selection.c index 27ee7579e4..2810e66f0c 100644 --- a/app/display/gimpdisplayshell-selection.c +++ b/app/display/gimpdisplayshell-selection.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include "apptypes.h" @@ -28,10 +28,12 @@ #include "gdisplay.h" #include "gdisplay_ops.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "gimprc.h" #include "selection.h" #include "marching_ants.h" + #define USE_XDRAWPOINTS #undef VERBOSE @@ -342,33 +344,44 @@ selection_generate_segs (Selection *select) &select->num_segs_in, &select->num_segs_out); if (select->num_segs_in) { - select->segs_in = (GdkSegment *) g_malloc (sizeof (GdkSegment) * select->num_segs_in); - selection_transform_segs (select, segs_in, select->segs_in, select->num_segs_in); + select->segs_in = g_new (GdkSegment, select->num_segs_in); + selection_transform_segs (select, segs_in, select->segs_in, + select->num_segs_in); #ifdef USE_XDRAWPOINTS selection_render_points (select); #endif } else - select->segs_in = NULL; + { + select->segs_in = NULL; + } /* Possible secondary boundary representation */ if (select->num_segs_out) { - select->segs_out = (GdkSegment *) g_malloc (sizeof (GdkSegment) * select->num_segs_out); - selection_transform_segs (select, segs_out, select->segs_out, select->num_segs_out); + select->segs_out = g_new (GdkSegment, select->num_segs_out); + selection_transform_segs (select, segs_out, select->segs_out, + select->num_segs_out); } else - select->segs_out = NULL; + { + select->segs_out = NULL; + } /* The active layer's boundary */ - gimage_layer_boundary (gdisp->gimage, &segs_layer, &select->num_segs_layer); + gimp_image_layer_boundary (gdisp->gimage, &segs_layer, + &select->num_segs_layer); + if (select->num_segs_layer) { - select->segs_layer = (GdkSegment *) g_malloc (sizeof (GdkSegment) * select->num_segs_layer); - selection_transform_segs (select, segs_layer, select->segs_layer, select->num_segs_layer); + select->segs_layer = g_new (GdkSegment, select->num_segs_layer); + selection_transform_segs (select, segs_layer, select->segs_layer, + select->num_segs_layer); } else - select->segs_layer = NULL; + { + select->segs_layer = NULL; + } g_free (segs_layer); } @@ -500,7 +513,7 @@ selection_create (GdkWindow *win, gdisp = (GDisplay *) gdisp_ptr; new = (Selection *) g_malloc (sizeof (Selection)); - base_type = gimage_base_type (gdisp->gimage); + base_type = gimp_image_base_type (gdisp->gimage); if (cycled_marching_ants) { diff --git a/app/display/gimpdisplayshell-selection.h b/app/display/gimpdisplayshell-selection.h index f5736b7d41..08a5d7698c 100644 --- a/app/display/gimpdisplayshell-selection.h +++ b/app/display/gimpdisplayshell-selection.h @@ -15,12 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __SELECTION_H__ #define __SELECTION_H__ -typedef struct _selection Selection; - -struct _selection +struct _Selection { /* This information is for maintaining the selection's appearance */ GdkWindow * win; /* Window to draw to */ @@ -33,37 +32,44 @@ struct _selection GdkSegment * segs_in; /* gdk segments of area boundary */ GdkSegment * segs_out; /* gdk segments of area boundary */ GdkSegment * segs_layer; /* gdk segments of area boundary */ - int num_segs_in; /* number of segments in segs1 */ - int num_segs_out; /* number of segments in segs2 */ - int num_segs_layer; /* number of segments in segs3 */ - int index_in; /* index of current stipple pattern */ - int index_out; /* index of current stipple pattern */ - int index_layer; /* index of current stipple pattern */ - int state; /* internal drawing state */ - int paused; /* count of pause requests */ - int recalc; /* flag to recalculate the selection */ - int speed; /* speed of marching ants */ - int hidden; /* is the selection hidden? */ + gint num_segs_in; /* number of segments in segs1 */ + gint num_segs_out; /* number of segments in segs2 */ + gint num_segs_layer; /* number of segments in segs3 */ + gint index_in; /* index of current stipple pattern */ + gint index_out; /* index of current stipple pattern */ + gint index_layer; /* index of current stipple pattern */ + gint state; /* internal drawing state */ + gint paused; /* count of pause requests */ + gint recalc; /* flag to recalculate the selection */ + gint speed; /* speed of marching ants */ + gint hidden; /* is the selection hidden? */ gint timer; /* timer for successive draws */ - int cycle; /* color cycling turned on */ + gint cycle; /* color cycling turned on */ GdkPixmap * cycle_pix; /* cycling pixmap */ /* These are used only if USE_XDRAWPOINTS is defined. */ GdkPoint * points_in[8]; /* points of segs_in for fast ants */ - int num_points_in[8]; /* number of points in points_in */ + gint num_points_in[8]; /* number of points in points_in */ GdkGC * gc_white; /* gc for drawing white points */ GdkGC * gc_black; /* gc for drawing black points */ }; /* Function declarations */ -Selection * selection_create (GdkWindow *, gpointer, int, int, int); +Selection * selection_create (GdkWindow *, + gpointer , + gint , + gint , + gint ); void selection_pause (Selection *); void selection_resume (Selection *); -void selection_start (Selection *, int); +void selection_start (Selection *, + gint ); void selection_invis (Selection *); void selection_layer_invis (Selection *); -void selection_hide (Selection *, void *); +void selection_hide (Selection *, + gpointer ); void selection_free (Selection *); + #endif /* __SELECTION_H__ */ diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c index b1edbf3929..5e3df5b2a2 100644 --- a/app/display/gimpdisplayshell.c +++ b/app/display/gimpdisplayshell.c @@ -35,7 +35,9 @@ #include "gdisplay.h" #include "gdisplay_ops.h" #include "gimage.h" +#include "gimpcontext.h" #include "gimpdnd.h" +#include "gimpdrawable.h" #include "gimphelp.h" #include "gimprc.h" #include "gimpui.h" @@ -43,10 +45,15 @@ #include "gtkvwrapbox.h" #include "indicator_area.h" #include "interface.h" +#include "layer.h" #include "menus.h" #include "nav_window.h" +#include "paint_funcs.h" +#include "pixel_region.h" #include "qmask.h" #include "session.h" +#include "pixel_region.h" +#include "tile_manager.h" #include "tools.h" #include "pixmaps.h" @@ -1211,7 +1218,7 @@ toolbox_drag_drop (GtkWidget *widget, } new_gimage = gimage_new (width, height, type); - gimage_disable_undo (new_gimage); + gimp_image_undo_disable (new_gimage); if (type == INDEXED) /* copy the colormap */ { @@ -1219,8 +1226,9 @@ toolbox_drag_drop (GtkWidget *widget, memcpy (new_gimage->cmap, gimage->cmap, COLORMAP_SIZE); } - gimage_set_resolution (new_gimage, gimage->xresolution, gimage->yresolution); - gimage_set_unit (new_gimage, gimage->unit); + gimp_image_set_resolution (new_gimage, + gimage->xresolution, gimage->yresolution); + gimp_image_set_unit (new_gimage, gimage->unit); if (layer) { @@ -1274,12 +1282,12 @@ toolbox_drag_drop (GtkWidget *widget, gimp_drawable_offsets (GIMP_DRAWABLE (new_layer), &off_x, &off_y); layer_translate (new_layer, -off_x, -off_y); - gimage_add_layer (new_gimage, new_layer, 0); + gimp_image_add_layer (new_gimage, new_layer, 0); gimp_context_set_display (gimp_context_get_user (), gdisplay_new (new_gimage, 0x0101)); - gimage_enable_undo (new_gimage); + gimp_image_undo_enable (new_gimage); return_val = TRUE; } diff --git a/app/display/gimpdisplayshell.h b/app/display/gimpdisplayshell.h index 7fe1acd8d4..3590b7f649 100644 --- a/app/display/gimpdisplayshell.h +++ b/app/display/gimpdisplayshell.h @@ -15,13 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __INTERFACE_H__ #define __INTERFACE_H__ -#include "toolsF.h" -#include "gdisplayF.h" -/* function declarations */ GtkWidget * create_pixmap_widget (GdkWindow *parent, gchar **data, gint width, @@ -39,4 +37,5 @@ void create_display_shell (GDisplay *gdisp, gchar *title, gint type); + #endif /* __INTERFACE_H__ */ diff --git a/app/display/gimpnavigationeditor.c b/app/display/gimpnavigationeditor.c index fef90262e3..6f434f3e1a 100644 --- a/app/display/gimpnavigationeditor.c +++ b/app/display/gimpnavigationeditor.c @@ -32,12 +32,14 @@ #include "info_window.h" #include "gdisplay.h" #include "gimpcontext.h" +#include "gimage.h" #include "gimppreviewcache.h" #include "gimpset.h" #include "gimprc.h" #include "gimpui.h" #include "gximage.h" #include "nav_window.h" +#include "procedural_db.h" #include "scroll.h" #include "scale.h" @@ -1302,7 +1304,7 @@ nav_window_title(GDisplay *gdisp) gchar *title; gchar *title_buf; - title = g_basename (gimage_filename (gdisp->gimage)); + title = g_basename (gimp_image_filename (gdisp->gimage)); /* create the info dialog */ title_buf = g_strdup_printf (_("Navigation: %s-%d.%d"), @@ -1409,7 +1411,7 @@ nav_window_create (void *gdisp_ptr) gdisp = (GDisplay *) gdisp_ptr; - type = gimage_base_type (gdisp->gimage); + type = gimp_image_base_type (gdisp->gimage); title_buf = nav_window_title(gdisp); diff --git a/app/display/gimpnavigationview.c b/app/display/gimpnavigationview.c index fef90262e3..6f434f3e1a 100644 --- a/app/display/gimpnavigationview.c +++ b/app/display/gimpnavigationview.c @@ -32,12 +32,14 @@ #include "info_window.h" #include "gdisplay.h" #include "gimpcontext.h" +#include "gimage.h" #include "gimppreviewcache.h" #include "gimpset.h" #include "gimprc.h" #include "gimpui.h" #include "gximage.h" #include "nav_window.h" +#include "procedural_db.h" #include "scroll.h" #include "scale.h" @@ -1302,7 +1304,7 @@ nav_window_title(GDisplay *gdisp) gchar *title; gchar *title_buf; - title = g_basename (gimage_filename (gdisp->gimage)); + title = g_basename (gimp_image_filename (gdisp->gimage)); /* create the info dialog */ title_buf = g_strdup_printf (_("Navigation: %s-%d.%d"), @@ -1409,7 +1411,7 @@ nav_window_create (void *gdisp_ptr) gdisp = (GDisplay *) gdisp_ptr; - type = gimage_base_type (gdisp->gimage); + type = gimp_image_base_type (gdisp->gimage); title_buf = nav_window_title(gdisp); diff --git a/app/display/gimpprogress.c b/app/display/gimpprogress.c index 31af92ba22..9f93c22f04 100644 --- a/app/display/gimpprogress.c +++ b/app/display/gimpprogress.c @@ -30,7 +30,8 @@ #include "libgimp/gimpintl.h" -struct gimp_progress_pvt { +struct gimp_progress_pvt +{ GDisplay *gdisp; /* gdisp in use, or NULL*/ /* next four fields are only valid if gdisp is NULL */ diff --git a/app/display/gimpprogress.h b/app/display/gimpprogress.h index 970c5b9893..798a4ee55d 100644 --- a/app/display/gimpprogress.h +++ b/app/display/gimpprogress.h @@ -16,11 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __GIMPPROGRESS_H__ -#define __GIMPPROGRESS_H__ - -#include /* eeek */ - +#ifndef __GIMPP_ROGRESS_H__ +#define __GIMPP_ROGRESS_H__ /* Progress bars for use internally by the main GIMP application. */ @@ -28,27 +25,26 @@ /* structures */ struct gimp_progress_pvt; -/* typedefs */ -typedef struct gimp_progress_pvt gimp_progress; -typedef void (*progress_func_t) (gint ymin, gint ymax, gint curr_y, - gpointer progress_data); /* functions */ -gimp_progress * progress_start (GDisplay *, - const gchar *, - gboolean, - GtkSignalFunc, - gpointer); -gimp_progress * progress_restart (gimp_progress *, - const gchar *, - GtkSignalFunc, - gpointer); -void progress_update (gimp_progress *, - float); -void progress_step (gimp_progress *); -void progress_end (gimp_progress *); +gimp_progress * progress_start (GDisplay *, + const gchar *, + gboolean , + GtkSignalFunc , + gpointer ); +gimp_progress * progress_restart (gimp_progress *, + const gchar *, + GtkSignalFunc , + gpointer ); +void progress_update (gimp_progress *, + gfloat ); +void progress_step (gimp_progress *); +void progress_end (gimp_progress *); -void progress_update_and_flush (gint, gint, gint, gpointer); +void progress_update_and_flush (gint , + gint , + gint , + gpointer ); -#endif /* __GIMPPROGRESS_H__ */ +#endif /* __GIMP_PROGRESS_H__ */ diff --git a/app/display_cmds.c b/app/display_cmds.c index d8a9784a6f..b23a45842b 100644 --- a/app/display_cmds.c +++ b/app/display_cmds.c @@ -18,9 +18,16 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ +#include "config.h" + + +#include + +#include "apptypes.h" #include "procedural_db.h" #include "gdisplay.h" +#include "gimpimage.h" static ProcRecord display_new_proc; static ProcRecord display_delete_proc; diff --git a/app/docindex.c b/app/docindex.c index 0b6df586a7..102a9060dd 100644 --- a/app/docindex.c +++ b/app/docindex.c @@ -12,6 +12,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ + #include "config.h" #include @@ -21,17 +22,20 @@ #include +#include "apptypes.h" + #include "dialog_handler.h" #include "docindex.h" #include "fileops.h" #include "gdisplay.h" -#include "gimpimageP.h" +#include "gimpimage.h" #include "gimpui.h" #include "gimpdnd.h" #include "ops_buttons.h" #include "session.h" #include "libgimp/gimpenv.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpintl.h" @@ -62,7 +66,7 @@ static void idea_add_in_position (gchar *label, gint position); static void open_idea_window (void); static void open_or_raise (gchar *file_name, - gboolean try_raise); + gboolean try_raise); static void idea_open_callback (GtkWidget *widget, gpointer data); diff --git a/app/dodgeburn.c b/app/dodgeburn.c index c873c16347..8ffe8968ce 100644 --- a/app/dodgeburn.c +++ b/app/dodgeburn.c @@ -15,6 +15,7 @@ * 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 @@ -27,11 +28,14 @@ #include "dodgeburn.h" #include "gdisplay.h" #include "gimplut.h" +#include "gimpcontext.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" #include "paint_options.h" +#include "pixel_region.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" #include "gimage.h" diff --git a/app/dodgeburn.h b/app/dodgeburn.h index 569ee8e675..341fe445ea 100644 --- a/app/dodgeburn.h +++ b/app/dodgeburn.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __DODGEBURN_H__ #define __DODGEBURN_H__ -#include "paint_core.h" -#include "tools.h" typedef enum { @@ -34,10 +33,22 @@ typedef enum DODGEBURN_SHADOWS } DodgeBurnMode; -void * dodgeburn_paint_func (PaintCore *, GimpDrawable *, int); -gboolean dodgeburn_non_gui (GimpDrawable *, double, DodgeBurnType, DodgeBurnMode, int, double *); -gboolean dodgeburn_non_gui_default (GimpDrawable *, int, double *); -Tool * tools_new_dodgeburn (void); -void tools_free_dodgeburn (Tool *); + +void * dodgeburn_paint_func (PaintCore *, + GimpDrawable *, + gint); +gboolean dodgeburn_non_gui (GimpDrawable *, + gdouble, + DodgeBurnType, + DodgeBurnMode, + gint, + gdouble *); +gboolean dodgeburn_non_gui_default (GimpDrawable *, + gint, + gdouble *); + +Tool * tools_new_dodgeburn (void); +void tools_free_dodgeburn (Tool *); + #endif /* __DODGEBURN_H__ */ diff --git a/app/draw_core.c b/app/draw_core.c index a094f4ff41..e3bf3cb892 100644 --- a/app/draw_core.c +++ b/app/draw_core.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include "apptypes.h" diff --git a/app/draw_core.h b/app/draw_core.h index 35645b7a62..0db2163e60 100644 --- a/app/draw_core.h +++ b/app/draw_core.h @@ -15,10 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __DRAW_CORE_H__ #define __DRAW_CORE_H__ -#include "tools.h" /* drawing states */ #define INVISIBLE 0 @@ -26,39 +26,41 @@ /* Structure definitions */ -typedef struct _draw_core DrawCore; typedef void (* DrawCoreDraw) (Tool *); -struct _draw_core +struct _DrawCore { - GdkGC * gc; /* Grahpics context for drawing functions */ - GdkWindow * win; /* Window to draw draw operation to */ + GdkGC * gc; /* Grahpics context for drawing functions */ + GdkWindow * win; /* Window to draw draw operation to */ - int draw_state; /* Current state in the drawing process */ + gint draw_state; /* Current state in the drawing process */ - int line_width; /**/ - int line_style; /**/ - int cap_style; /* line attributes */ - int join_style; /**/ + gint line_width; /**/ + gint line_style; /**/ + gint cap_style; /* line attributes */ + gint join_style; /**/ - int paused_count; /* count to keep track of multiple pauses */ + gint paused_count; /* count to keep track of multiple pauses */ - gpointer data; /* data to pass to draw_func */ + gpointer data; /* data to pass to draw_func */ - DrawCoreDraw draw_func; /* Member function for actual drawing */ + DrawCoreDraw draw_func; /* Member function for actual drawing */ }; /* draw core functions */ -DrawCore * draw_core_new (DrawCoreDraw); -void draw_core_start (DrawCore *, GdkWindow *, Tool *); -void draw_core_stop (DrawCore *, Tool *); -void draw_core_pause (DrawCore *, Tool *); -void draw_core_resume (DrawCore *, Tool *); -void draw_core_free (DrawCore *); - - +DrawCore * draw_core_new (DrawCoreDraw ); +void draw_core_start (DrawCore *, + GdkWindow *, + Tool *); +void draw_core_stop (DrawCore *, + Tool *); +void draw_core_pause (DrawCore *, + Tool *); +void draw_core_resume (DrawCore *, + Tool *); +void draw_core_free (DrawCore *); #endif /* __DRAW_CORE_H__ */ diff --git a/app/drawable.c b/app/drawable.c index 0107968008..274ab02294 100644 --- a/app/drawable.c +++ b/app/drawable.c @@ -20,8 +20,9 @@ #include +#include "apptypes.h" + #include "drawable.h" -#include "drawable_pvt.h" #include "gimpcontext.h" #include "gdisplay.h" #include "undo.h" diff --git a/app/drawable.h b/app/drawable.h index 0baf2e8f3e..22006d9416 100644 --- a/app/drawable.h +++ b/app/drawable.h @@ -19,8 +19,10 @@ #ifndef __DRAWABLE_H__ #define __DRAWABLE_H__ + #include "gimpdrawable.h" + gint drawable_ID (GimpDrawable *); void drawable_fill (GimpDrawable *drawable, GimpFillType fill_type); void drawable_update (GimpDrawable *drawable, diff --git a/app/drawable_cmds.c b/app/drawable_cmds.c index 5e9d92a83f..1dd9cbcffe 100644 --- a/app/drawable_cmds.c +++ b/app/drawable_cmds.c @@ -18,14 +18,21 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ -#include "procedural_db.h" +#include "config.h" #include +#include + #include "apptypes.h" +#include "procedural_db.h" + #include "channel.h" #include "drawable.h" #include "layer.h" +#include "temp_buf.h" +#include "tile.h" +#include "tile_manager.h" static ProcRecord drawable_merge_shadow_proc; static ProcRecord drawable_fill_proc; diff --git a/app/drawable_pvt.h b/app/drawable_pvt.h deleted file mode 100644 index bee474fdf5..0000000000 --- a/app/drawable_pvt.h +++ /dev/null @@ -1,23 +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_PVT_H__ -#define __DRAWABLE_PVT_H__ - -#include "gimpdrawableP.h" - -#endif /* __DRAWABLE_PVT_H__ */ diff --git a/app/edit_cmds.c b/app/edit_cmds.c index 787b4830c7..3ab9cf7a72 100644 --- a/app/edit_cmds.c +++ b/app/edit_cmds.c @@ -18,9 +18,14 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ -#include "procedural_db.h" +#include "config.h" + + +#include #include "apptypes.h" +#include "procedural_db.h" + #include "drawable.h" #include "gimage_mask.h" #include "global_edit.h" diff --git a/app/edit_selection.c b/app/edit_selection.c index 128b96268d..ab759aa00c 100644 --- a/app/edit_selection.c +++ b/app/edit_selection.c @@ -27,20 +27,25 @@ #include "apptypes.h" #include "appenv.h" +#include "boundary.h" #include "cursorutil.h" #include "draw_core.h" #include "drawable.h" #include "tools.h" #include "edit_selection.h" #include "floating_sel.h" +#include "gimpimage.h" #include "gimage_mask.h" -#include "gdisplay.h" -#include "undo.h" #include "gimprc.h" +#include "gdisplay.h" +#include "layer.h" #include "path_transform.h" +#include "selection.h" +#include "undo.h" + +#include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" -#include "libgimp/gimpmath.h" #define EDIT_SELECT_SCROLL_LOCK FALSE @@ -49,6 +54,7 @@ typedef struct _EditSelection EditSelection; + struct _EditSelection { gint origx, origy; /* last x and y coords */ @@ -149,12 +155,13 @@ init_edit_selection (Tool *tool, &edit_select.num_segs_out); /* Make a check to see if it should be a floating selection translation */ - if (edit_type == EDIT_MASK_TO_LAYER_TRANSLATE && gimage_floating_sel (gdisp->gimage)) + if (edit_type == EDIT_MASK_TO_LAYER_TRANSLATE && + gimp_image_floating_sel (gdisp->gimage)) edit_type = EDIT_FLOATING_SEL_TRANSLATE; if (edit_type == EDIT_LAYER_TRANSLATE) { - layer = gimage_get_active_layer (gdisp->gimage); + layer = gimp_image_get_active_layer (gdisp->gimage); if (layer_is_floating_sel (layer)) edit_type = EDIT_FLOATING_SEL_TRANSLATE; } @@ -175,7 +182,7 @@ init_edit_selection (Tool *tool, * where the translation will result in floating the selection * mask and translating the resulting layer */ - drawable_mask_bounds (gimage_active_drawable (gdisp->gimage), + drawable_mask_bounds (gimp_image_active_drawable (gdisp->gimage), &edit_select.x1, &edit_select.y1, &edit_select.x2, &edit_select.y2); @@ -277,7 +284,7 @@ edit_selection_button_release (Tool *tool, check if the layer is a floating selection. If so, anchor. */ if (edit_select.edit_type == EDIT_FLOATING_SEL_TRANSLATE) { - layer = gimage_get_active_layer (gdisp->gimage); + layer = gimp_image_get_active_layer (gdisp->gimage); if (layer_is_floating_sel (layer)) floating_sel_anchor (layer); } @@ -286,7 +293,7 @@ edit_selection_button_release (Tool *tool, { path_transform_xy (gdisp->gimage, edit_select.cumlx, edit_select.cumly); - layer = gimage_get_active_layer (gdisp->gimage); + layer = gimp_image_get_active_layer (gdisp->gimage); gimp_drawable_invalidate_preview (GIMP_DRAWABLE (layer), TRUE); } @@ -307,9 +314,9 @@ edit_selection_motion (Tool *tool, GdkEventMotion *mevent, gpointer gdisp_ptr) { - GDisplay * gdisp; - gchar offset[STATUSBAR_SIZE]; - gdouble lastmotion_x, lastmotion_y; + GDisplay *gdisp; + gchar offset[STATUSBAR_SIZE]; + gdouble lastmotion_x, lastmotion_y; if (tool->state != ACTIVE) { @@ -368,7 +375,7 @@ edit_selection_motion (Tool *tool, break; case EDIT_LAYER_TRANSLATE: - if ((floating_layer = gimage_floating_sel (gdisp->gimage))) + if ((floating_layer = gimp_image_floating_sel (gdisp->gimage))) floating_sel_relax (floating_layer, TRUE); /* translate the layer--and any "linked" layers as well */ @@ -396,7 +403,7 @@ edit_selection_motion (Tool *tool, case EDIT_MASK_TO_LAYER_TRANSLATE: if (!gimage_mask_float (gdisp->gimage, - gimage_active_drawable (gdisp->gimage), + gimp_image_active_drawable (gdisp->gimage), 0, 0)) { /* no region to float, abort safely */ @@ -420,7 +427,7 @@ edit_selection_motion (Tool *tool, break; case EDIT_FLOATING_SEL_TRANSLATE: - layer = gimage_get_active_layer (gdisp->gimage); + layer = gimp_image_get_active_layer (gdisp->gimage); floating_sel_relax (layer, TRUE); layer_translate (layer, xoffset, yoffset); @@ -504,14 +511,14 @@ selection_transform_segs (GDisplay *gdisp, void edit_selection_draw (Tool *tool) { - GDisplay * gdisp; - Selection * select; - Layer *layer; - GSList *layer_list; - gint floating_sel; - gint x1, y1, x2, y2; - gint x3, y3, x4, y4; - gint off_x, off_y; + GDisplay *gdisp; + Selection *select; + Layer *layer; + GSList *layer_list; + gint floating_sel; + gint x1, y1, x2, y2; + gint x3, y3, x4, y4; + gint off_x, off_y; GdkSegment *segs_copy; gdisp = (GDisplay *) tool->gdisp_ptr; @@ -520,7 +527,7 @@ edit_selection_draw (Tool *tool) switch (edit_select.edit_type) { case EDIT_MASK_TRANSLATE: - layer = gimage_get_active_layer (gdisp->gimage); + layer = gimp_image_get_active_layer (gdisp->gimage); floating_sel = layer_is_floating_sel (layer); if (!floating_sel) @@ -675,17 +682,17 @@ process_event_queue_keys (GdkEventKey *kevent, * by other tools? */ { #define FILTER_MAX_KEYS 50 - va_list argp; - GdkEvent *event; - GList *event_list = NULL; - GList *list; - guint keys[FILTER_MAX_KEYS]; - GdkModifierType modifiers[FILTER_MAX_KEYS]; - gint values[FILTER_MAX_KEYS]; - gint i = 0, nkeys = 0, value = 0; - gboolean done = FALSE; - gboolean discard_event; - GtkWidget *orig_widget; + va_list argp; + GdkEvent *event; + GList *event_list = NULL; + GList *list; + guint keys[FILTER_MAX_KEYS]; + GdkModifierType modifiers[FILTER_MAX_KEYS]; + gint values[FILTER_MAX_KEYS]; + gint i = 0, nkeys = 0, value = 0; + gboolean done = FALSE; + gboolean discard_event; + GtkWidget *orig_widget; va_start (argp, kevent); while (nkeys gimage); + layer = gimp_image_get_active_layer (gdisp->gimage); if (layer_is_floating_sel (layer)) edit_type = EDIT_FLOATING_SEL_TRANSLATE; @@ -832,7 +839,7 @@ edit_sel_arrow_keys_func (Tool *tool, case EDIT_LAYER_TRANSLATE: - if ((floating_layer = gimage_floating_sel (gdisp->gimage))) + if ((floating_layer = gimp_image_floating_sel (gdisp->gimage))) floating_sel_relax (floating_layer, TRUE); /* translate the layer -- and any "linked" layers as well */ diff --git a/app/edit_selection.h b/app/edit_selection.h index dcd0e851bb..c1e8914d71 100644 --- a/app/edit_selection.h +++ b/app/edit_selection.h @@ -20,9 +20,6 @@ #define __EDIT_SELECTION_H__ -#include "tools.h" - - typedef enum { EDIT_MASK_TRANSLATE, diff --git a/app/ellipse_select.c b/app/ellipse_select.c index fb0f9bb576..b65dd27a06 100644 --- a/app/ellipse_select.c +++ b/app/ellipse_select.c @@ -20,19 +20,23 @@ #include -#include +#include #include "apptypes.h" #include "appenv.h" +#include "channel.h" +#include "draw_core.h" #include "edit_selection.h" #include "ellipse_select.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "rect_select.h" -/* private header file for rect_select data structure */ #include "rect_selectP.h" #include "selection_options.h" +#include "tools.h" +#include "tool_options.h" /* the ellipse selection tool options */ @@ -67,8 +71,8 @@ ellipse_select (GimpImage *gimage, if (feather) { new_mask = channel_new_mask (gimage, gimage->width, gimage->height); - channel_combine_ellipse (new_mask, ADD, x, y, w, h, antialias); - channel_feather (new_mask, gimage_get_mask (gimage), + channel_combine_ellipse (new_mask, CHANNEL_OP_ADD, x, y, w, h, antialias); + channel_feather (new_mask, gimp_image_get_mask (gimage), feather_radius, feather_radius, op, 0, 0); @@ -77,12 +81,12 @@ ellipse_select (GimpImage *gimage, else if (op == SELECTION_INTERSECT) { new_mask = channel_new_mask (gimage, gimage->width, gimage->height); - channel_combine_ellipse (new_mask, ADD, x, y, w, h, antialias); - channel_combine_mask (gimage_get_mask (gimage), new_mask, op, 0, 0); + channel_combine_ellipse (new_mask, CHANNEL_OP_ADD, x, y, w, h, antialias); + channel_combine_mask (gimp_image_get_mask (gimage), new_mask, op, 0, 0); channel_delete (new_mask); } else - channel_combine_ellipse (gimage_get_mask (gimage), op, + channel_combine_ellipse (gimp_image_get_mask (gimage), op, x, y, w, h, antialias); } @@ -91,8 +95,8 @@ ellipse_select_draw (Tool *tool) { GDisplay *gdisp; EllipseSelect *ellipse_sel; - gint x1, y1; - gint x2, y2; + gint x1, y1; + gint x2, y2; gdisp = (GDisplay *) tool->gdisp_ptr; ellipse_sel = (EllipseSelect *) tool->private; diff --git a/app/ellipse_select.h b/app/ellipse_select.h index 9bde4e105d..cce7e01273 100644 --- a/app/ellipse_select.h +++ b/app/ellipse_select.h @@ -19,9 +19,6 @@ #ifndef __ELLIPSE_SELECT_H__ #define __ELLIPSE_SELECT_H__ -#include "tools.h" - -/* ellipse select functions */ void ellipse_select (GimpImage *gimage, gint x, @@ -37,4 +34,5 @@ void ellipse_select_draw (Tool *tool); Tool * tools_new_ellipse_select (void); void tools_free_ellipse_select (Tool *tool); + #endif /* __ELLIPSE_SELECT_H__ */ diff --git a/app/equalize.c b/app/equalize.c index 435952a437..3fc778037b 100644 --- a/app/equalize.c +++ b/app/equalize.c @@ -20,16 +20,20 @@ #include +#include "apptypes.h" + #include "drawable.h" #include "equalize.h" #include "gimage.h" #include "gimplut.h" #include "lut_funcs.h" #include "gimphistogram.h" +#include "pixel_processor.h" +#include "pixel_region.h" -#include "config.h" #include "libgimp/gimpintl.h" + void image_equalize (GimpImage *gimage) { @@ -52,39 +56,41 @@ equalize (GimpImage *gimage, GimpDrawable *drawable, gboolean mask_only) { - PixelRegion srcPR, destPR; - unsigned char *mask; - int has_alpha; - int alpha, bytes; - int x1, y1, x2, y2; + PixelRegion srcPR, destPR; + guchar *mask; + gint has_alpha; + gint alpha, bytes; + gint x1, y1, x2, y2; GimpHistogram *hist; - GimpLut *lut; + GimpLut *lut; mask = NULL; - bytes = drawable_bytes (drawable); - has_alpha = drawable_has_alpha (drawable); - alpha = has_alpha ? (bytes - 1) : bytes; + bytes = gimp_drawable_bytes (drawable); + has_alpha = gimp_drawable_has_alpha (drawable); + alpha = has_alpha ? (bytes - 1) : bytes; - hist = gimp_histogram_new(); - gimp_histogram_calculate_drawable(hist, drawable); + hist = gimp_histogram_new (); + gimp_histogram_calculate_drawable (hist, drawable); /* Build equalization LUT */ lut = eq_histogram_lut_new (hist, bytes); /* Apply the histogram */ - drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2); + gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2); - pixel_region_init (&srcPR, drawable_data (drawable), x1, y1, (x2 - x1), (y2 - y1), FALSE); - pixel_region_init (&destPR, drawable_shadow (drawable), x1, y1, (x2 - x1), (y2 - y1), TRUE); + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + x1, y1, (x2 - x1), (y2 - y1), FALSE); + pixel_region_init (&destPR, gimp_drawable_shadow (drawable), + x1, y1, (x2 - x1), (y2 - y1), TRUE); - pixel_regions_process_parallel((p_func)gimp_lut_process, lut, - 2, &srcPR, &destPR); + pixel_regions_process_parallel ((p_func) gimp_lut_process, lut, + 2, &srcPR, &destPR); - gimp_lut_free(lut); - gimp_histogram_free(hist); + gimp_lut_free (lut); + gimp_histogram_free (hist); - drawable_merge_shadow (drawable, TRUE); + gimp_drawable_merge_shadow (drawable, TRUE); drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1)); } diff --git a/app/equalize.h b/app/equalize.h index 5a27a7bc89..efbc8646ef 100644 --- a/app/equalize.h +++ b/app/equalize.h @@ -20,11 +20,10 @@ #define __EQUALIZE_H__ -/* equalize functions */ -void image_equalize (GimpImage *gimage); -void equalize (GimpImage *gimage, - GimpDrawable *drawable, - gboolean mask_only); +void image_equalize (GimpImage *gimage); +void equalize (GimpImage *gimage, + GimpDrawable *drawable, + gboolean mask_only); #endif /* __INVERT_H__ */ diff --git a/app/eraser.c b/app/eraser.c index a368d13146..1ffa616c08 100644 --- a/app/eraser.c +++ b/app/eraser.c @@ -28,12 +28,15 @@ #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpcontext.h" +#include "gimpimage.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" #include "paint_options.h" #include "eraser.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" #include "libgimp/gimpintl.h" @@ -229,16 +232,16 @@ eraser_motion (PaintCore *paint_core, gboolean incremental, gboolean anti_erase) { - GImage *gimage; - gint opacity; - TempBuf * area; - unsigned char col[MAX_CHANNELS]; - gdouble scale; + GImage *gimage; + gint opacity; + TempBuf *area; + guchar col[MAX_CHANNELS]; + gdouble scale; if (! (gimage = drawable_gimage (drawable))) return; - gimage_get_background (gimage, drawable, col); + gimp_image_get_background (gimage, drawable, col); if (pressure_options->size) scale = paint_core->curpressure; diff --git a/app/eraser.h b/app/eraser.h index cdf728f85d..5a94a4c044 100644 --- a/app/eraser.h +++ b/app/eraser.h @@ -15,17 +15,26 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __ERASER_H__ #define __ERASER_H__ -#include "paint_core.h" -#include "tools.h" -void * eraser_paint_func (PaintCore *, GimpDrawable *, int); -gboolean eraser_non_gui (GimpDrawable *, int, double *, int, int, int); -gboolean eraser_non_gui_default (GimpDrawable *, int, double *); +void * eraser_paint_func (PaintCore *, + GimpDrawable *, + gint ); +gboolean eraser_non_gui (GimpDrawable *, + gint , + gdouble *, + gint , + gint , + gint ); +gboolean eraser_non_gui_default (GimpDrawable *, + gint , + gdouble *); + +Tool * tools_new_eraser (void ); +void tools_free_eraser (Tool *); -Tool * tools_new_eraser (void); -void tools_free_eraser (Tool *); #endif /* __ERASER_H__ */ diff --git a/app/errorconsole.c b/app/errorconsole.c index ed3a1894e2..cb8451d2e5 100644 --- a/app/errorconsole.c +++ b/app/errorconsole.c @@ -57,8 +57,11 @@ #include "session.h" #include "dialog_handler.h" +#include "libgimp/gimphelpui.h" + #include "libgimp/gimpintl.h" + #define ERRORS_ALL 0 #define ERRORS_SELECTION 1 diff --git a/app/errorconsole.h b/app/errorconsole.h index 77a3f5a6f7..d531c238c1 100644 --- a/app/errorconsole.h +++ b/app/errorconsole.h @@ -18,13 +18,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __ERRORCONSOLE_H__ -#define __ERRORCONSOLE_H__ -void error_console_add (gchar *errormsg); +#ifndef __ERROR_CONSOLE_H__ +#define __ERROR_CONSOLE_H__ + + +void error_console_add (gchar *errormsg); /* Free error_console (only for session-managment) */ -void error_console_free (void); +void error_console_free (void); -#endif /* __ERRORCONSOLE_H__ */ +#endif /* __ERROR_CONSOLE_H__ */ diff --git a/app/errors.h b/app/errors.h index 5755e29087..c357801710 100644 --- a/app/errors.h +++ b/app/errors.h @@ -15,9 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __ERRORS_H__ #define __ERRORS_H__ + typedef enum { STACK_TRACE_NEVER, @@ -25,7 +27,6 @@ typedef enum STACK_TRACE_ALWAYS } StackTraceMode; -extern StackTraceMode stack_trace_mode; void gimp_message_func (const gchar *log_domain, GLogLevelFlags log_level, @@ -35,4 +36,8 @@ void gimp_message_func (const gchar *log_domain, void gimp_fatal_error (gchar *, ...); void gimp_terminate (gchar *, ...); + +extern StackTraceMode stack_trace_mode; + + #endif /* __ERRORS_H__ */ diff --git a/app/file_new_dialog.c b/app/file_new_dialog.c index 93f4089dba..0d94a16a8f 100644 --- a/app/file_new_dialog.c +++ b/app/file_new_dialog.c @@ -20,17 +20,23 @@ #include +#include "apptypes.h" + +#include "image_new.h" #include "file_new_dialog.h" #include "gimprc.h" #include "gimpui.h" #include "gdisplay.h" #include "libgimp/gimpchainbutton.h" -#include "libgimp/gimpmath.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimplimits.h" +#include "libgimp/gimpmath.h" #include "libgimp/gimpsizeentry.h" + #include "libgimp/gimpintl.h" + typedef struct { GtkWidget *dlg; diff --git a/app/file_new_dialog.h b/app/file_new_dialog.h index 403409ffbe..51629ba395 100644 --- a/app/file_new_dialog.h +++ b/app/file_new_dialog.h @@ -19,14 +19,12 @@ #ifndef __FILE_NEW_DIALOG_H__ #define __FILE_NEW_DIALOG_H__ -#include "image_new.h" +void file_new_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action); -void file_new_cmd_callback (GtkWidget *widget, - gpointer callback_data, - guint callback_action); - -void ui_new_image_window_create (const GimpImageNewValues *values); +void ui_new_image_window_create (const GimpImageNewValues *values); #endif /* __FILE_NEW_DIALOG_H_H__ */ diff --git a/app/fileops.c b/app/fileops.c index a0d838b49b..4338d37f58 100644 --- a/app/fileops.c +++ b/app/fileops.c @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -63,24 +64,27 @@ #include "apptypes.h" #include "appenv.h" +#include "channel.h" #include "cursorutil.h" #include "dialog_handler.h" +#include "docindex.h" +#include "drawable.h" #include "gdisplay.h" #include "gimage.h" #include "gimpcontext.h" -#include "gimpdrawableP.h" +#include "gimpdrawable.h" #include "gimpui.h" +#include "gimprc.h" #include "fileops.h" #include "fileopsP.h" -#include "menus.h" #include "layer.h" -#include "channel.h" +#include "menus.h" #include "plug_in.h" #include "procedural_db.h" -#include "gimprc.h" -#include "docindex.h" +#include "temp_buf.h" #include "undo.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" @@ -562,7 +566,7 @@ file_save_as_callback (GtkWidget *widget, save_options, FALSE, FALSE, 0); } - switch (drawable_type (gimage_active_drawable (gdisplay->gimage))) + switch (gimp_drawable_type (gimage_active_drawable (gdisplay->gimage))) { case RGB_GIMAGE: file_update_menus (save_procs, PLUG_IN_RGB_IMAGE); diff --git a/app/fileops.h b/app/fileops.h index 368a5c0996..30018320ef 100644 --- a/app/fileops.h +++ b/app/fileops.h @@ -19,40 +19,35 @@ #ifndef __FILEOPS_H__ #define __FILEOPS_H__ -#ifdef G_OS_WIN32 -#include /* For _getpid() */ -#endif - -#include "plug_in.h" - extern GSList *load_procs; extern GSList *save_procs; -void file_ops_pre_init (void); -void file_ops_post_init (void); +void file_ops_pre_init (void); +void file_ops_post_init (void); -void file_open_callback (GtkWidget *widget, - gpointer data); +void file_open_callback (GtkWidget *widget, + gpointer data); -void file_save_callback (GtkWidget *widget, - gpointer data); -void file_save_as_callback (GtkWidget *widget, - gpointer data); +void file_save_callback (GtkWidget *widget, + gpointer data); +void file_save_as_callback (GtkWidget *widget, + gpointer data); -void file_revert_callback (GtkWidget *widget, - gpointer data); +void file_revert_callback (GtkWidget *widget, + gpointer data); -void file_open_by_extension_callback (GtkWidget *widget, - gpointer data); -void file_save_by_extension_callback (GtkWidget *widget, - gpointer data); +void file_open_by_extension_callback (GtkWidget *widget, + gpointer data); +void file_save_by_extension_callback (GtkWidget *widget, + gpointer data); -gint file_open (gchar *filename, - gchar *raw_filename); +gint file_open (gchar *filename, + gchar *raw_filename); + +PlugInProcDef * file_proc_find (GSList *procs, + const gchar *filename); -PlugInProcDef * file_proc_find (GSList *procs, - const gchar *filename); #endif /* __FILEOPS_H__ */ diff --git a/app/fileops_cmds.c b/app/fileops_cmds.c index f2f3569c82..347f6f57d2 100644 --- a/app/fileops_cmds.c +++ b/app/fileops_cmds.c @@ -18,16 +18,21 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ -#include "procedural_db.h" - #include "config.h" #include +#include #ifdef HAVE_UNISTD_H #include #endif + +#include + +#include "apptypes.h" +#include "procedural_db.h" + #include "fileops.h" #include "fileopsP.h" #include "gimprc.h" diff --git a/app/flip_tool.c b/app/flip_tool.c index 22c97be367..c6db3abda3 100644 --- a/app/flip_tool.c +++ b/app/flip_tool.c @@ -31,13 +31,21 @@ #include "flip_tool.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "gimpui.h" +#include "paint_funcs.h" #include "path_transform.h" - -#include "tile_manager_pvt.h" /* ick. */ +#include "pixel_region.h" +#include "temp_buf.h" +#include "tile_manager.h" +#include "tile_manager_pvt.h" +#include "tools.h" +#include "tool_options.h" +#include "transform_core.h" #include "libgimp/gimpintl.h" + #define FLIP_INFO 0 /* the flip structures */ @@ -145,20 +153,20 @@ flip_tool_transform (Tool *tool, switch (state) { - case INIT: + case TRANSFORM_INIT: transform_info = NULL; break; - case MOTION: + case TRANSFORM_MOTION: break; - case RECALC: + case TRANSFORM_RECALC: break; - case FINISH: + case TRANSFORM_FINISH: /* transform_core->trans_info[FLIP] *= -1.0;*/ return flip_tool_flip (gdisp->gimage, - gimage_active_drawable (gdisp->gimage), + gimp_image_active_drawable (gdisp->gimage), transform_core->original, (int) transform_core->trans_info[FLIP_INFO], flip_options->type); @@ -179,7 +187,7 @@ flip_cursor_update (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; - if ((drawable = gimage_active_drawable (gdisp->gimage))) + if ((drawable = gimp_image_active_drawable (gdisp->gimage))) { gint x, y; gint off_x, off_y; @@ -250,16 +258,25 @@ flip_tool_flip (GimpImage *gimage, { TileManager *new; PixelRegion srcPR, destPR; - gint i; + gint orig_width; + gint orig_height; + gint orig_bpp; + gint i; - if (!orig) + if (! orig) return NULL; + orig_width = tile_manager_level_width (orig); + orig_height = tile_manager_level_height (orig); + orig_bpp = tile_manager_level_bpp (orig); + if (flip > 0) { - new = tile_manager_new (orig->width, orig->height, orig->bpp); - pixel_region_init (&srcPR, orig, 0, 0, orig->width, orig->height, FALSE); - pixel_region_init (&destPR, new, 0, 0, orig->width, orig->height, TRUE); + new = tile_manager_new (orig_width, orig_height, orig_bpp); + pixel_region_init (&srcPR, orig, + 0, 0, orig_width, orig_height, FALSE); + pixel_region_init (&destPR, new, + 0, 0, orig_width, orig_height, TRUE); copy_region (&srcPR, &destPR); new->x = orig->x; @@ -267,24 +284,24 @@ flip_tool_flip (GimpImage *gimage, } else { - new = tile_manager_new (orig->width, orig->height, orig->bpp); + new = tile_manager_new (orig_width, orig_height, orig_bpp); new->x = orig->x; new->y = orig->y; if (type == ORIENTATION_HORIZONTAL) for (i = 0; i < orig->width; i++) { - pixel_region_init (&srcPR, orig, i, 0, 1, orig->height, FALSE); + pixel_region_init (&srcPR, orig, i, 0, 1, orig_height, FALSE); pixel_region_init (&destPR, new, - (orig->width - i - 1), 0, 1, orig->height, TRUE); + (orig_width - i - 1), 0, 1, orig_height, TRUE); copy_region (&srcPR, &destPR); } else for (i = 0; i < orig->height; i++) { - pixel_region_init (&srcPR, orig, 0, i, orig->width, 1, FALSE); + pixel_region_init (&srcPR, orig, 0, i, orig_width, 1, FALSE); pixel_region_init (&destPR, new, - 0, (orig->height - i - 1), orig->width, 1, TRUE); + 0, (orig_height - i - 1), orig_width, 1, TRUE); copy_region (&srcPR, &destPR); } diff --git a/app/flip_tool.h b/app/flip_tool.h index 6ead0b5ac9..0f74a6bb3b 100644 --- a/app/flip_tool.h +++ b/app/flip_tool.h @@ -15,13 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __FLIP_TOOL_H__ #define __FLIP_TOOL_H__ -#include "tools.h" -#include "transform_core.h" - -/* Flip tool functions */ TileManager * flip_tool_transform (Tool *tool, gpointer gdisp_ptr, @@ -36,4 +33,5 @@ TileManager * flip_tool_flip (GimpImage *gimage, Tool * tools_new_flip (void); void tools_free_flip_tool (Tool *tool); + #endif /* __FLIP_TOOL_H__ */ diff --git a/app/floating_sel.c b/app/floating_sel.c index 8b913827da..7e01429026 100644 --- a/app/floating_sel.c +++ b/app/floating_sel.c @@ -18,11 +18,12 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" +#include "boundary.h" #include "drawable.h" #include "layer.h" #include "floating_sel.h" @@ -30,9 +31,10 @@ #include "gimage.h" #include "gimage_mask.h" #include "paint_funcs.h" +#include "pixel_region.h" +#include "tile_manager.h" #include "undo.h" -#include "layer_pvt.h" #include "tile_manager_pvt.h" /* ick. */ #include "libgimp/gimpmath.h" diff --git a/app/floating_sel.h b/app/floating_sel.h index 017b2e16ca..e5d0689e3d 100644 --- a/app/floating_sel.h +++ b/app/floating_sel.h @@ -19,23 +19,41 @@ #ifndef __FLOATING_SEL_H__ #define __FLOATING_SEL_H__ -#include "apptypes.h" +void floating_sel_attach (Layer *, + GimpDrawable *); +void floating_sel_remove (Layer *); +void floating_sel_anchor (Layer *); +void floating_sel_reset (Layer *); +void floating_sel_to_layer (Layer *); +void floating_sel_store (Layer *, + gint , + gint , + gint , + gint ); +void floating_sel_restore (Layer *, + gint , + gint , + gint , + gint ); +void floating_sel_rigor (Layer *, + gint ); +void floating_sel_relax (Layer *, + gint ); +void floating_sel_composite (Layer *, + gint , + gint , + gint , + gint , + gint ); +BoundSeg * floating_sel_boundary (Layer *, + gint *); +void floating_sel_bounds (Layer *, + gint *, + gint *, + gint *, + gint *); +void floating_sel_invalidate (Layer *); -/* Functions */ - -void floating_sel_attach (Layer *, GimpDrawable *); -void floating_sel_remove (Layer *); -void floating_sel_anchor (Layer *); -void floating_sel_reset (Layer *); -void floating_sel_to_layer (Layer *); -void floating_sel_store (Layer *, int, int, int, int); -void floating_sel_restore (Layer *, int, int, int, int); -void floating_sel_rigor (Layer *, int); -void floating_sel_relax (Layer *, int); -void floating_sel_composite (Layer *, int, int, int, int, int); -BoundSeg * floating_sel_boundary (Layer *, int *); -void floating_sel_bounds (Layer *, int *, int *, int *, int *); -void floating_sel_invalidate (Layer *); #endif /* __FLOATING_SEL_H__ */ diff --git a/app/floating_sel_cmds.c b/app/floating_sel_cmds.c index 1fb8bfa6a1..0f724ed2f8 100644 --- a/app/floating_sel_cmds.c +++ b/app/floating_sel_cmds.c @@ -18,6 +18,12 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ +#include "config.h" + + +#include + +#include "apptypes.h" #include "procedural_db.h" #include "drawable.h" diff --git a/app/free_select.c b/app/free_select.c index 5f0313cc31..fb7de4eb17 100644 --- a/app/free_select.c +++ b/app/free_select.c @@ -21,21 +21,25 @@ #include #include -#include +#include #include "apptypes.h" #include "appenv.h" +#include "channel.h" #include "draw_core.h" #include "edit_selection.h" #include "errors.h" #include "floating_sel.h" #include "free_select.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "gdisplay.h" #include "rect_select.h" #include "selection_options.h" #include "scan_convert.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpmath.h" @@ -142,12 +146,12 @@ free_select (GImage *gimage, if (mask) { if (feather) - channel_feather (mask, gimage_get_mask (gimage), + channel_feather (mask, gimp_image_get_mask (gimage), feather_radius, feather_radius, op, 0, 0); else - channel_combine_mask (gimage_get_mask (gimage), + channel_combine_mask (gimp_image_get_mask (gimage), mask, op, 0, 0); channel_delete (mask); } @@ -219,8 +223,8 @@ free_select_button_release (Tool *tool, if (free_sel->op == SELECTION_ANCHOR) { /* If there is a floating selection, anchor it */ - if (gimage_floating_sel (gdisp->gimage)) - floating_sel_anchor (gimage_floating_sel (gdisp->gimage)); + if (gimp_image_floating_sel (gdisp->gimage)) + floating_sel_anchor (gimp_image_floating_sel (gdisp->gimage)); /* Otherwise, clear the selection mask */ else gimage_mask_clear (gdisp->gimage); diff --git a/app/free_select.h b/app/free_select.h index a1dc6b8a27..98fd07dfd1 100644 --- a/app/free_select.h +++ b/app/free_select.h @@ -19,14 +19,18 @@ #ifndef __FREE_SELECT_H__ #define __FREE_SELECT_H__ -#include "scan_convert.h" - /* free select action functions */ -void free_select_button_press (Tool *, GdkEventButton *, gpointer); -void free_select_button_release (Tool *, GdkEventButton *, gpointer); -void free_select_motion (Tool *, GdkEventMotion *, gpointer); +void free_select_button_press (Tool *tool, + GdkEventButton *bevent, + gpointer gdisp_ptr); +void free_select_button_release (Tool *tool, + GdkEventButton *bevent, + gpointer gdisp_ptr); +void free_select_motion (Tool *tool, + GdkEventMotion *mevent, + gpointer gdisp_ptr); /* free select functions */ diff --git a/app/fuzzy_select.c b/app/fuzzy_select.c index cf66542ce2..906acff785 100644 --- a/app/fuzzy_select.c +++ b/app/fuzzy_select.c @@ -26,26 +26,34 @@ #include "appenv.h" #include "boundary.h" +#include "channel.h" #include "cursorutil.h" #include "draw_core.h" #include "drawable.h" #include "edit_selection.h" #include "fuzzy_select.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "gimprc.h" #include "gimpui.h" #include "gdisplay.h" +#include "pixel_region.h" #include "rect_select.h" #include "selection_options.h" - -#include "tile.h" /* ick. */ +#include "tile_manager.h" +#include "tile.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpmath.h" + #include "libgimp/gimpintl.h" + /* the fuzzy selection structures */ typedef struct _FuzzySelect FuzzySelect; + struct _FuzzySelect { DrawCore *core; /* Core select object */ @@ -302,9 +310,9 @@ find_contiguous_region (GImage *gimage, if (sample_merged) { - pixel_region_init (&srcPR, gimage_composite (gimage), 0, 0, + pixel_region_init (&srcPR, gimp_image_composite (gimage), 0, 0, gimage->width, gimage->height, FALSE); - type = gimage_composite_type (gimage); + type = gimp_image_composite_type (gimage); has_alpha = (type == RGBA_GIMAGE || type == GRAYA_GIMAGE || type == INDEXEDA_GIMAGE); @@ -353,7 +361,7 @@ fuzzy_select (GImage *gimage, gint off_x, off_y; /* if applicable, replace the current selection */ - if (op == REPLACE) + if (op == CHANNEL_OP_REPLACE) gimage_mask_clear (gimage); else gimage_mask_undo (gimage); @@ -364,12 +372,12 @@ fuzzy_select (GImage *gimage, off_x = off_y = 0; if (feather) - channel_feather (fuzzy_mask, gimage_get_mask (gimage), + channel_feather (fuzzy_mask, gimp_image_get_mask (gimage), feather_radius, feather_radius, op, off_x, off_y); else - channel_combine_mask (gimage_get_mask (gimage), + channel_combine_mask (gimp_image_get_mask (gimage), fuzzy_mask, op, off_x, off_y); /* free the fuzzy region struct */ @@ -446,7 +454,7 @@ fuzzy_select_button_release (Tool *tool, if (! (bevent->state & GDK_BUTTON3_MASK)) { drawable = (fuzzy_options->sample_merged ? - NULL : gimage_active_drawable (gdisp->gimage)); + NULL : gimp_image_active_drawable (gdisp->gimage)); fuzzy_select (gdisp->gimage, drawable, fuzzy_sel->op, fuzzy_options->feather, @@ -531,7 +539,7 @@ fuzzy_select_calculate (Tool *tool, fuzzy_sel = (FuzzySelect *) tool->private; gdisp = (GDisplay *) gdisp_ptr; - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); gimp_add_busy_cursors (); diff --git a/app/fuzzy_select.h b/app/fuzzy_select.h index 5e3240d533..0211a4b81f 100644 --- a/app/fuzzy_select.h +++ b/app/fuzzy_select.h @@ -15,17 +15,17 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __FUZZY_SELECT_H__ #define __FUZZY_SELECT_H__ -#include "gimage.h" -#include "tools.h" extern Channel *fuzzy_mask; + /* fuzzy select functions */ Tool * tools_new_fuzzy_select (void); -void tools_free_fuzzy_select (Tool *tool); +void tools_free_fuzzy_select (Tool *tool); /* functions */ Channel * find_contiguous_region (GimpImage *gimage, @@ -41,4 +41,5 @@ void fuzzy_select (GimpImage *gimage, gboolean feather, gdouble feather_radius); + #endif /* __FUZZY_SELECT_H__ */ diff --git a/app/gdisplay.c b/app/gdisplay.c index 29522d42a9..1f09287c71 100644 --- a/app/gdisplay.c +++ b/app/gdisplay.c @@ -26,6 +26,7 @@ #include "apptypes.h" #include "appenv.h" +#include "channel.h" #include "colormaps.h" #include "cursorutil.h" #include "disp_callbacks.h" @@ -33,6 +34,7 @@ #include "draw_core.h" #include "gdisplay.h" #include "gdisplay_ops.h" +#include "gimage.h" #include "gimage_mask.h" #include "gimpcontext.h" #include "gimprc.h" @@ -40,6 +42,7 @@ #include "image_render.h" #include "info_window.h" #include "interface.h" +#include "layer.h" #include "lc_dialog.h" #include "menus.h" #include "nav_window.h" @@ -47,15 +50,16 @@ #include "qmask.h" #include "scale.h" #include "scroll.h" +#include "selection.h" #include "tools.h" #include "undo.h" + #ifdef DISPLAY_FILTERS #include "gdisplay_color.h" #endif /* DISPLAY_FILTERS */ #include "bezier_selectP.h" -#include "layer_pvt.h" /* ick. (not alone either) */ #include "libgimp/gimpmath.h" @@ -77,22 +81,42 @@ struct _GimpArea /* variable declarations */ -GSList * display_list = NULL; -static gint display_num = 1; +GSList * display_list = NULL; +static gint display_num = 1; static GdkCursorType default_gdisplay_cursor = GDK_TOP_LEFT_ARROW; /* Local functions */ -static void gdisplay_format_title (GDisplay *, char *, int); -static void gdisplay_delete (GDisplay *); -static GSList * gdisplay_free_area_list (GSList *); -static GSList * gdisplay_process_area_list (GSList *, GimpArea *); -static void gdisplay_add_update_area (GDisplay *, int, int, int, int); -static void gdisplay_add_display_area (GDisplay *, int, int, int, int); -static void gdisplay_paint_area (GDisplay *, int, int, int, int); -static void gdisplay_draw_cursor (GDisplay *); -static void gdisplay_display_area (GDisplay *, int, int, int, int); -static guint gdisplay_hash (GDisplay *); -static void gdisplay_cleandirty_handler (GimpImage *, void *); +static void gdisplay_format_title (GDisplay *, + gchar *, + gint ); +static void gdisplay_delete (GDisplay *); +static GSList * gdisplay_free_area_list (GSList *); +static GSList * gdisplay_process_area_list (GSList *, + GimpArea *); +static void gdisplay_add_update_area (GDisplay *, + gint , + gint , + gint , + gint ); +static void gdisplay_add_display_area (GDisplay *, + gint , + gint , + gint , + gint ); +static void gdisplay_paint_area (GDisplay *, + gint , + gint , + gint , + gint ); +static void gdisplay_draw_cursor (GDisplay *); +static void gdisplay_display_area (GDisplay *, + gint , + gint , + gint , + gint ); +static guint gdisplay_hash (GDisplay *); +static void gdisplay_cleandirty_handler (GimpImage *, + gpointer ); static GHashTable *display_ht = NULL; @@ -165,13 +189,13 @@ gdisplay_new (GimpImage *gimage, /* create the shell for the image */ create_display_shell (gdisp, gimage->width, gimage->height, - title, gimage_base_type (gimage)); + title, gimp_image_base_type (gimage)); /* update the title to correct the initially displayed scale */ gdisplay_update_title (gdisp); /* set the gdisplay colormap type and install the appropriate colormap */ - gdisp->color_type = (gimage_base_type (gimage) == GRAY) ? GRAY : RGB; + gdisp->color_type = (gimp_image_base_type (gimage) == GRAY) ? GRAY : RGB; /* set the qmask buttons */ qmask_buttons_update(gdisp); @@ -237,9 +261,9 @@ gdisplay_format_title (GDisplay *gdisp, gimage = gdisp->gimage; - empty = gimage_is_empty (gimage); + empty = gimp_image_is_empty (gimage); - switch (gimage_base_type (gimage)) + switch (gimp_image_base_type (gimage)) { case RGB: image_type_str = (empty) ? _("RGB-empty") : _("RGB"); @@ -273,11 +297,11 @@ gdisplay_format_title (GDisplay *gdisp, case 'f': /* pruned filename */ i += print (title, title_len, i, - "%s", g_basename (gimage_filename (gimage))); + "%s", g_basename (gimp_image_filename (gimage))); break; case 'F': /* full filename */ - i += print (title, title_len, i, "%s", gimage_filename (gimage)); + i += print (title, title_len, i, "%s", gimp_image_filename (gimage)); break; case 'p': /* PDB id */ @@ -1271,7 +1295,7 @@ gdisplay_paint_area (GDisplay *gdisp, gdisplay_untransform_coords (gdisp, gdisp->disp_width, gdisp->disp_height, &x2, &y2, FALSE, FALSE); - gimage_invalidate (gdisp->gimage, x, y, w, h, x1, y1, x2, y2); + gimp_image_invalidate (gdisp->gimage, x, y, w, h, x1, y1, x2, y2); /* display the area */ gdisplay_transform_coords (gdisp, x, y, &x1, &y1, FALSE); @@ -1373,11 +1397,11 @@ gdisplay_display_area (GDisplay *gdisp, dx, dy); #if 0 /* Invalidate the projection just after we render it! */ - gimage_invalidate_without_render (gdisp->gimage, - j - gdisp->disp_xoffset, - i - gdisp->disp_yoffset, - dx, dy, - 0, 0, 0, 0); + gimp_image_invalidate_without_render (gdisp->gimage, + j - gdisp->disp_xoffset, + i - gdisp->disp_yoffset, + dx, dy, + 0, 0, 0, 0); #endif #ifdef DISPLAY_FILTERS @@ -1422,10 +1446,10 @@ gdisplay_mask_bounds (GDisplay *gdisp, gint off_y; /* If there is a floating selection, handle things differently */ - if ((layer = gimage_floating_sel (gdisp->gimage))) + if ((layer = gimp_image_floating_sel (gdisp->gimage))) { drawable_offsets (GIMP_DRAWABLE(layer), &off_x, &off_y); - if (! channel_bounds (gimage_get_mask (gdisp->gimage), x1, y1, x2, y2)) + if (! channel_bounds (gimp_image_get_mask (gdisp->gimage), x1, y1, x2, y2)) { *x1 = off_x; *y1 = off_y; @@ -1440,7 +1464,7 @@ gdisplay_mask_bounds (GDisplay *gdisp, *y2 = MAX (off_y + drawable_height (GIMP_DRAWABLE (layer)), *y2); } } - else if (! channel_bounds (gimage_get_mask (gdisp->gimage), x1, y1, x2, y2)) + else if (! channel_bounds (gimp_image_get_mask (gdisp->gimage), x1, y1, x2, y2)) return FALSE; gdisplay_transform_coords (gdisp, *x1, *y1, x1, y1, 0); @@ -1474,7 +1498,8 @@ gdisplay_transform_coords (GDisplay *gdisp, scaley = SCALEFACTOR_Y (gdisp); if (use_offsets) - drawable_offsets (gimage_active_drawable (gdisp->gimage), &offset_x, &offset_y); + drawable_offsets (gimp_image_active_drawable (gdisp->gimage), + &offset_x, &offset_y); else { offset_x = offset_y = 0; @@ -1510,7 +1535,8 @@ gdisplay_untransform_coords (GDisplay *gdisp, scaley = SCALEFACTOR_Y (gdisp); if (use_offsets) - drawable_offsets (gimage_active_drawable (gdisp->gimage), &offset_x, &offset_y); + drawable_offsets (gimp_image_active_drawable (gdisp->gimage), + &offset_x, &offset_y); else { offset_x = offset_y = 0; @@ -1547,7 +1573,8 @@ gdisplay_transform_coords_f (GDisplay *gdisp, scaley = SCALEFACTOR_Y (gdisp); if (use_offsets) - drawable_offsets (gimage_active_drawable (gdisp->gimage), &offset_x, &offset_y); + drawable_offsets (gimp_image_active_drawable (gdisp->gimage), + &offset_x, &offset_y); else { offset_x = offset_y = 0; @@ -1582,7 +1609,8 @@ gdisplay_untransform_coords_f (GDisplay *gdisp, scaley = SCALEFACTOR_Y (gdisp); if (use_offsets) - drawable_offsets (gimage_active_drawable (gdisp->gimage), &offset_x, &offset_y); + drawable_offsets (gimp_image_active_drawable (gdisp->gimage), + &offset_x, &offset_y); else { offset_x = offset_y = 0; @@ -1718,27 +1746,27 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp) if (gdisp) { - base_type = gimage_base_type (gdisp->gimage); + base_type = gimp_image_base_type (gdisp->gimage); - fs = (gimage_floating_sel (gdisp->gimage) != NULL); - aux = (gimage_get_active_channel (gdisp->gimage) != NULL); + fs = (gimp_image_floating_sel (gdisp->gimage) != NULL); + aux = (gimp_image_get_active_channel (gdisp->gimage) != NULL); lp = (gdisp->gimage->layers != NULL); - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); if (drawable) type = drawable_type (drawable); if (lp) { - layer = gimage_get_active_layer (gdisp->gimage); + layer = gimp_image_get_active_layer (gdisp->gimage); if (layer) { lm = layer_get_mask (layer) ? TRUE : FALSE; alpha = layer_has_alpha (layer); } - lind = gimage_get_layer_index (gdisp->gimage, - gdisp->gimage->active_layer); + lind = gimp_image_get_layer_index (gdisp->gimage, + gdisp->gimage->active_layer); lnum = g_slist_length (gdisp->gimage->layers); } } diff --git a/app/gdisplay.h b/app/gdisplay.h index d414f67ca9..ad6b2e764f 100644 --- a/app/gdisplay.h +++ b/app/gdisplay.h @@ -15,16 +15,18 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __GDISPLAY_H__ #define __GDISPLAY_H__ - -#include "cursorutil.h" -#include "gimage.h" -#include "info_dialog.h" -#include "selection.h" - -#include "gdisplayF.h" +typedef enum +{ + SelectionOff, + SelectionLayerOff, + SelectionOn, + SelectionPause, + SelectionResume +} SelectionControl; /* * Global variables diff --git a/app/gdisplayF.h b/app/gdisplayF.h deleted file mode 100644 index 233c38a65d..0000000000 --- a/app/gdisplayF.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef __GDISPLAY_F_H__ -#define __GDISPLAY_F_H__ - -typedef enum -{ - SelectionOff, - SelectionLayerOff, - SelectionOn, - SelectionPause, - SelectionResume -} SelectionControl; - -#endif diff --git a/app/gdisplay_ops.c b/app/gdisplay_ops.c index 1e71b7207a..455e7b3d51 100644 --- a/app/gdisplay_ops.c +++ b/app/gdisplay_ops.c @@ -34,8 +34,11 @@ #include "scale.h" #include "gimprc.h" +#include "libgimp/gimphelpui.h" + #include "libgimp/gimpintl.h" + static void gdisplay_close_warning_callback (GtkWidget *widget, gboolean close, gpointer data); diff --git a/app/gimage.c b/app/gimage.c index 7a8e09b833..afb917895d 100644 --- a/app/gimage.c +++ b/app/gimage.c @@ -21,31 +21,28 @@ #include #include "apptypes.h" - -#include "gimpimageP.h" + +#include "appenv.h" +#include "channel.h" +#include "dialog_handler.h" +#include "drawable.h" #include "gimage.h" #include "gimpimage.h" -#include "lc_dialog.h" - -#include "drawable.h" -#include "gdisplay.h" -#include "procedural_db.h" - -#include "paletteP.h" -#include "undo.h" - -#include "layer.h" -#include "layer_pvt.h" -#include "channel.h" -#include "tools.h" -#include "appenv.h" #include "gimpset.h" -#include "dialog_handler.h" +#include "layer.h" +#include "lc_dialog.h" +#include "gdisplay.h" +#include "paint_funcs.h" +#include "paletteP.h" +#include "procedural_db.h" +#include "tools.h" +#include "undo.h" /* gimage.c: Junk (ugly dependencies) from gimpimage.c on its way - to proper places. That is, the handlers should be moved to - layers_dialog, gdisplay, tools, etc.. */ + * to proper places. That is, the handlers should be moved to + * layers_dialog, gdisplay, tools, etc.. + */ static void gimage_dirty_handler (GimpImage* gimage); static void gimage_destroy_handler (GimpImage* gimage); @@ -59,34 +56,41 @@ static void gimage_repaint_handler (GimpImage* gimage, gint, gint, gint, gint); -GImage* -gimage_new (int width, - int height, +GImage * +gimage_new (gint width, + gint height, GimpImageBaseType base_type) { - GimpImage* gimage = gimp_image_new (width, height, base_type); + GimpImage *gimage = gimp_image_new (width, height, base_type); gtk_signal_connect (GTK_OBJECT (gimage), "dirty", - GTK_SIGNAL_FUNC(gimage_dirty_handler), NULL); + GTK_SIGNAL_FUNC (gimage_dirty_handler), + NULL); gtk_signal_connect (GTK_OBJECT (gimage), "destroy", - GTK_SIGNAL_FUNC(gimage_destroy_handler), NULL); + GTK_SIGNAL_FUNC (gimage_destroy_handler), + NULL); gtk_signal_connect (GTK_OBJECT (gimage), "rename", - GTK_SIGNAL_FUNC(gimage_rename_handler), NULL); + GTK_SIGNAL_FUNC (gimage_rename_handler), + NULL); gtk_signal_connect (GTK_OBJECT (gimage), "resize", - GTK_SIGNAL_FUNC(gimage_resize_handler), NULL); + GTK_SIGNAL_FUNC (gimage_resize_handler), + NULL); gtk_signal_connect (GTK_OBJECT (gimage), "restructure", - GTK_SIGNAL_FUNC(gimage_restructure_handler), NULL); + GTK_SIGNAL_FUNC (gimage_restructure_handler), + NULL); gtk_signal_connect (GTK_OBJECT (gimage), "repaint", - GTK_SIGNAL_FUNC(gimage_repaint_handler), NULL); + GTK_SIGNAL_FUNC (gimage_repaint_handler), + NULL); gtk_signal_connect (GTK_OBJECT (gimage), "colormap_changed", - GTK_SIGNAL_FUNC(gimage_cmap_change_handler), NULL); + GTK_SIGNAL_FUNC (gimage_cmap_change_handler), + NULL); gimp_set_add (image_context, gimage); return gimage; } -GImage* +GImage * gimage_get_ID (gint ID) { return pdb_id_to_image (ID); @@ -113,7 +117,7 @@ static void invalidate_cb (gpointer image, gpointer user_data) { - gimp_image_invalidate_preview (GIMP_IMAGE(image)); + gimp_image_invalidate_preview (GIMP_IMAGE (image)); } void diff --git a/app/gimage.h b/app/gimage.h index 1ca876697b..7981686003 100644 --- a/app/gimage.h +++ b/app/gimage.h @@ -15,14 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __GIMAGE_H__ #define __GIMAGE_H__ #include "gimpimage.h" -/* icky.. this is temporary */ -#include "gimpimageP.h" - -typedef GimpImage GImage; GImage* gimage_new (gint width, gint height, diff --git a/app/gimage_mask.c b/app/gimage_mask.c index ad7c74aa36..7bbd540230 100644 --- a/app/gimage_mask.c +++ b/app/gimage_mask.c @@ -18,23 +18,27 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" +#include "boundary.h" #include "drawable.h" #include "floating_sel.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimage_mask.h" #include "gimprc.h" #include "layer.h" #include "paint_core.h" +#include "paint_funcs.h" #include "paint_options.h" -#include "undo.h" - -#include "channel_pvt.h" +#include "pixel_region.h" +#include "procedural_db.h" +#include "tile_manager.h" #include "tile_manager_pvt.h" +#include "undo.h" #include "libgimp/gimpintl.h" @@ -51,11 +55,11 @@ gimage_mask_boundary (GImage *gimage, gint *num_segs_out) { GimpDrawable *d; - Layer *layer; - gint x1, y1; - gint x2, y2; + Layer *layer; + gint x1, y1; + gint x2, y2; - if ((layer = gimage_floating_sel (gimage))) + if ((layer = gimp_image_floating_sel (gimage))) { /* If there is a floating selection, then * we need to do some slightly different boundaries. @@ -67,7 +71,7 @@ gimage_mask_boundary (GImage *gimage, */ /* Find the selection mask boundary */ - channel_boundary (gimage_get_mask (gimage), + channel_boundary (gimp_image_get_mask (gimage), segs_in, segs_out, num_segs_in, num_segs_out, 0, 0, 0, 0); @@ -78,16 +82,16 @@ gimage_mask_boundary (GImage *gimage, return TRUE; } /* Otherwise, return the boundary...if a channel is active */ - else if ((d = gimage_active_drawable (gimage)) && + else if ((d = gimp_image_active_drawable (gimage)) && GIMP_IS_CHANNEL (d)) { - return channel_boundary (gimage_get_mask (gimage), + return channel_boundary (gimp_image_get_mask (gimage), segs_in, segs_out, num_segs_in, num_segs_out, 0, 0, gimage->width, gimage->height); } /* if a layer is active, we return multiple boundaries based on the extents */ - else if ((layer = gimage_get_active_layer (gimage))) + else if ((layer = gimp_image_get_active_layer (gimage))) { gint off_x, off_y; @@ -99,7 +103,7 @@ gimage_mask_boundary (GImage *gimage, y2 = CLAMP (off_y + drawable_height (GIMP_DRAWABLE(layer)), 0, gimage->height); - return channel_boundary (gimage_get_mask (gimage), + return channel_boundary (gimp_image_get_mask (gimage), segs_in, segs_out, num_segs_in, num_segs_out, x1, y1, x2, y2); @@ -122,7 +126,7 @@ gimage_mask_bounds (GImage *gimage, gint *x2, gint *y2) { - return channel_bounds (gimage_get_mask (gimage), x1, y1, x2, y2); + return channel_bounds (gimp_image_get_mask (gimage), x1, y1, x2, y2); } @@ -135,14 +139,14 @@ gimage_mask_invalidate (GImage *gimage) /* Turn the current selection off */ gdisplays_selection_visibility (gimage, SelectionOff); - mask = gimage_get_mask (gimage); + mask = gimp_image_get_mask (gimage); mask->boundary_known = FALSE; /* If there is a floating selection, update it's area... * we need to do this since this selection mask can act as an additional * mask in the composition of the floating selection */ - layer = gimage_get_active_layer (gimage); + layer = gimp_image_get_active_layer (gimage); if (layer && layer_is_floating_sel (layer)) drawable_update (GIMP_DRAWABLE(layer), 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height); @@ -154,7 +158,7 @@ gimage_mask_value (GImage *gimage, int x, int y) { - return channel_value (gimage_get_mask (gimage), x, y); + return channel_value (gimp_image_get_mask (gimage), x, y); } @@ -168,7 +172,7 @@ gimage_mask_is_empty (GImage *gimage) if (gimage_mask_stroking) return TRUE; else - return channel_is_empty (gimage_get_mask (gimage)); + return channel_is_empty (gimp_image_get_mask (gimage)); } @@ -177,7 +181,7 @@ gimage_mask_translate (GImage *gimage, gint off_x, gint off_y) { - channel_translate (gimage_get_mask (gimage), off_x, off_y); + channel_translate (gimp_image_get_mask (gimage), off_x, off_y); } @@ -246,11 +250,11 @@ gimage_mask_extract (GImage *gimage, /* get the selection mask */ if (non_empty) - sel_mask = gimage_get_mask (gimage); + sel_mask = gimp_image_get_mask (gimage); else sel_mask = NULL; - gimage_get_background (gimage, drawable, bg); + gimp_image_get_background (gimage, drawable, bg); /* If a cut was specified, and the selection mask is not empty, * push an undo @@ -283,7 +287,7 @@ gimage_mask_extract (GImage *gimage, if (cut_gimage) { /* Clear the region */ - channel_clear (gimage_get_mask (gimage)); + channel_clear (gimp_image_get_mask (gimage)); /* Update the region */ gdisplays_update_area (gimage, tiles->x, tiles->y, @@ -315,16 +319,16 @@ gimage_mask_extract (GImage *gimage, if (layer_is_floating_sel (GIMP_LAYER (drawable))) floating_sel_remove (GIMP_LAYER (drawable)); else - gimage_remove_layer (gimage, GIMP_LAYER (drawable)); + gimp_image_remove_layer (gimage, GIMP_LAYER (drawable)); } else if (cut_gimage && GIMP_IS_LAYER_MASK (drawable)) { - gimage_remove_layer_mask (gimage, - layer_mask_get_layer (GIMP_LAYER_MASK (drawable)), - DISCARD); + gimp_image_remove_layer_mask (gimage, + layer_mask_get_layer (GIMP_LAYER_MASK (drawable)), + DISCARD); } else if (cut_gimage && GIMP_IS_CHANNEL (drawable)) - gimage_remove_channel (gimage, GIMP_CHANNEL (drawable)); + gimp_image_remove_channel (gimage, GIMP_CHANNEL (drawable)); } return tiles; @@ -337,12 +341,12 @@ gimage_mask_float (GImage *gimage, gint off_x, /* optional offset */ gint off_y) { - Layer *layer; - Channel *mask = gimage_get_mask (gimage); - TileManager* tiles; - gboolean non_empty; - gint x1, y1; - gint x2, y2; + Layer *layer; + Channel *mask = gimp_image_get_mask (gimage); + TileManager *tiles; + gboolean non_empty; + gint x1, y1; + gint x2, y2; /* Make sure there is a region to float... */ non_empty = drawable_mask_bounds ( (drawable), &x1, &y1, &x2, &y2); @@ -363,8 +367,8 @@ gimage_mask_float (GImage *gimage, _("Floated Layer"), OPAQUE_OPACITY, NORMAL_MODE); /* Set the offsets */ - GIMP_DRAWABLE(layer)->offset_x = tiles->x + off_x; - GIMP_DRAWABLE(layer)->offset_y = tiles->y + off_y; + GIMP_DRAWABLE (layer)->offset_x = tiles->x + off_x; + GIMP_DRAWABLE (layer)->offset_y = tiles->y + off_y; /* Free the temp buffer */ tile_manager_destroy (tiles); @@ -385,21 +389,21 @@ gimage_mask_float (GImage *gimage, void gimage_mask_clear (GImage *gimage) { - channel_clear (gimage_get_mask (gimage)); + channel_clear (gimp_image_get_mask (gimage)); } void gimage_mask_undo (GImage *gimage) { - channel_push_undo (gimage_get_mask (gimage)); + channel_push_undo (gimp_image_get_mask (gimage)); } void gimage_mask_invert (GImage *gimage) { - channel_invert (gimage_get_mask (gimage)); + channel_invert (gimp_image_get_mask (gimage)); } @@ -409,21 +413,21 @@ gimage_mask_sharpen (GImage *gimage) /* No need to play with the selection visibility * because sharpen will not change the outline */ - channel_sharpen (gimage_get_mask (gimage)); + channel_sharpen (gimp_image_get_mask (gimage)); } void gimage_mask_all (GImage *gimage) { - channel_all (gimage_get_mask (gimage)); + channel_all (gimp_image_get_mask (gimage)); } void gimage_mask_none (GImage *gimage) { - channel_clear (gimage_get_mask (gimage)); + channel_clear (gimp_image_get_mask (gimage)); } @@ -435,14 +439,14 @@ gimage_mask_feather (GImage *gimage, /* push the current mask onto the undo stack--need to do this here because * channel_feather doesn't do it */ - channel_push_undo (gimage_get_mask (gimage)); + channel_push_undo (gimp_image_get_mask (gimage)); /* feather the region */ - channel_feather (gimage_get_mask (gimage), - gimage_get_mask (gimage), + channel_feather (gimp_image_get_mask (gimage), + gimp_image_get_mask (gimage), feather_radius_x, feather_radius_y, - REPLACE, 0, 0); + CHANNEL_OP_REPLACE, 0, 0); } @@ -452,7 +456,7 @@ gimage_mask_border (GImage *gimage, gint border_radius_y) { /* feather the region */ - channel_border (gimage_get_mask (gimage), + channel_border (gimp_image_get_mask (gimage), border_radius_x, border_radius_y); } @@ -464,7 +468,7 @@ gimage_mask_grow (GImage *gimage, int grow_pixels_y) { /* feather the region */ - channel_grow (gimage_get_mask (gimage), + channel_grow (gimp_image_get_mask (gimage), grow_pixels_x, grow_pixels_y); } @@ -477,7 +481,7 @@ gimage_mask_shrink (GImage *gimage, gboolean edge_lock) { /* feather the region */ - channel_shrink (gimage_get_mask (gimage), + channel_shrink (gimp_image_get_mask (gimage), shrink_pixels_x, shrink_pixels_y, edge_lock); @@ -492,7 +496,7 @@ gimage_mask_layer_alpha (GImage *gimage, if (drawable_has_alpha (GIMP_DRAWABLE (layer))) { /* load the mask with the given layer's alpha channel */ - channel_layer_alpha (gimage_get_mask (gimage), layer); + channel_layer_alpha (gimp_image_get_mask (gimage), layer); } else { @@ -511,7 +515,7 @@ gimage_mask_layer_mask (GImage *gimage, if (layer_get_mask (layer)) { /* load the mask with the given layer's alpha channel */ - channel_layer_mask (gimage_get_mask (gimage), layer); + channel_layer_mask (gimp_image_get_mask (gimage), layer); } else { @@ -527,7 +531,7 @@ gimage_mask_load (GImage *gimage, Channel *channel) { /* Load the specified channel to the gimage mask */ - channel_load (gimage_get_mask (gimage), (channel)); + channel_load (gimp_image_get_mask (gimage), (channel)); } @@ -536,11 +540,11 @@ gimage_mask_save (GImage *gimage) { Channel *new_channel; - new_channel = channel_copy (gimage_get_mask (gimage)); + new_channel = channel_copy (gimp_image_get_mask (gimage)); /* saved selections are not visible by default */ GIMP_DRAWABLE(new_channel)->visible = FALSE; - gimage_add_channel (gimage, new_channel, -1); + gimp_image_add_channel (gimage, new_channel, -1); return new_channel; } @@ -642,9 +646,3 @@ gimage_mask_stroke (GImage *gimage, return TRUE; } - - - - - - diff --git a/app/gimage_mask.h b/app/gimage_mask.h index 094a6768a5..50a65593e6 100644 --- a/app/gimage_mask.h +++ b/app/gimage_mask.h @@ -15,13 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __GIMAGE_MASK_H__ #define __GIMAGE_MASK_H__ -#include "boundary.h" -#include "gimage.h" -/* mask functions */ gboolean gimage_mask_boundary (GImage *gimage, BoundSeg **segs_in, BoundSeg **segs_out, @@ -95,4 +93,5 @@ Channel * gimage_mask_save (GImage *gimage); gboolean gimage_mask_stroke (GImage *gimage, GimpDrawable *drawable); + #endif /* __GIMAGE_MASK_H__ */ diff --git a/app/gimpbrush.c b/app/gimpbrush.c index b1bea28395..03687610ad 100644 --- a/app/gimpbrush.c +++ b/app/gimpbrush.c @@ -44,9 +44,8 @@ #include "apptypes.h" -#include "libgimp/gimpvector.h" - #include "brush_header.h" +#include "patterns.h" #include "pattern_header.h" #include "gimpbrush.h" #include "gimpbrushlist.h" diff --git a/app/gimpbrush.h b/app/gimpbrush.h index d6f0cc26f5..19e0e4c2da 100644 --- a/app/gimpbrush.h +++ b/app/gimpbrush.h @@ -21,9 +21,6 @@ #include "gimpobject.h" -#include "temp_buf.h" - -#include "libgimp/gimpvector.h" typedef struct _GimpBrushClass GimpBrushClass; diff --git a/app/gimpbrushgenerated.c b/app/gimpbrushgenerated.c index 8e6dd38eed..11111a6454 100644 --- a/app/gimpbrushgenerated.c +++ b/app/gimpbrushgenerated.c @@ -27,7 +27,7 @@ #include #endif -#include +#include #include "apptypes.h" @@ -36,9 +36,11 @@ #include "paint_core.h" #include "gimprc.h" #include "gimpbrush.h" +#include "temp_buf.h" #include "libgimp/gimpmath.h" + #define OVERSAMPLING 5 diff --git a/app/gimpbrushgenerated.h b/app/gimpbrushgenerated.h index c4e51bd409..3b9e325165 100644 --- a/app/gimpbrushgenerated.h +++ b/app/gimpbrushgenerated.h @@ -21,6 +21,7 @@ #ifndef __GIMP_BRUSH_GENERATED_H__ #define __GIMP_BRUSH_GENERATED_H__ + #include "gimpbrush.h" @@ -28,7 +29,6 @@ #define GIMP_BRUSH_GENERATED(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_BRUSH_GENERATED, GimpBrushGenerated)) #define GIMP_IS_BRUSH_GENERATED(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_BRUSH_GENERATED)) -typedef struct _GimpBrushGenerated GimpBrushGenerated; typedef struct _GimpBrushGeneratedClass GimpBrushGeneratedClass; struct _GimpBrushGenerated diff --git a/app/gimpbrushlist.c b/app/gimpbrushlist.c index 8b7d584427..b21356eeeb 100644 --- a/app/gimpbrushlist.c +++ b/app/gimpbrushlist.c @@ -30,9 +30,8 @@ #ifdef HAVE_DIRENT_H #include #endif -#include -#include +#include #include "apptypes.h" @@ -42,6 +41,7 @@ #include "brush_header.h" #include "brush_select.h" #include "datafiles.h" +#include "gimpcontext.h" #include "gimprc.h" #include "gimpsignal.h" #include "gimplist.h" @@ -49,6 +49,7 @@ #include "gimpbrushlist.h" #include "libgimp/gimpenv.h" +#include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" diff --git a/app/gimpbrushlist.h b/app/gimpbrushlist.h index 8e299bc0bd..a7f4369bfa 100644 --- a/app/gimpbrushlist.h +++ b/app/gimpbrushlist.h @@ -22,11 +22,14 @@ #include "gimplist.h" + #define GIMP_TYPE_BRUSH_LIST (gimp_brush_list_get_type ()) #define GIMP_BRUSH_LIST(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_BRUSH_LIST, GimpBrushList)) #define GIMP_IS_BRUSH_LIST(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_BRUSH_LIST)) #define GIMP_BRUSH_LIST_CLASS(klass) (GTK_CHECK_CLASS_CAST (klass, gimp_brush_list_get_type(), GimpBrushListClass)) +typedef struct _GimpBrushListClass GimpBrushListClass; + struct _GimpBrushList { GimpList gimplist; @@ -34,8 +37,6 @@ struct _GimpBrushList gint num_brushes; }; -typedef struct _GimpBrushListClass GimpBrushListClass; - struct _GimpBrushListClass { GimpListClass parent_class; diff --git a/app/gimpbrushpipe.h b/app/gimpbrushpipe.h index 0cfe006768..930f449b40 100644 --- a/app/gimpbrushpipe.h +++ b/app/gimpbrushpipe.h @@ -21,13 +21,7 @@ #define __GIMP_BRUSH_PIPE_H__ -#include "tools.h" -#include "paint_core.h" #include "gimpbrush.h" -#include "temp_buf.h" - - -typedef struct _GimpBrushPipe GimpBrushPipe; #define GIMP_TYPE_BRUSH_PIPE (gimp_brush_pipe_get_type ()) @@ -48,6 +42,8 @@ typedef enum } PipeSelectModes; +typedef struct _GimpBrushPipeClass GimpBrushPipeClass; + struct _GimpBrushPipe { GimpBrush gbrush; /* Also itself a brush */ @@ -65,8 +61,6 @@ struct _GimpBrushPipe GimpBrush *current; /* Currently selected brush */ }; -typedef struct _GimpBrushPipeClass GimpBrushPipeClass; - struct _GimpBrushPipeClass { GimpBrushClass parent_class; diff --git a/app/gimpchannel.c b/app/gimpchannel.c index 20ecb6bdbf..077577e220 100644 --- a/app/gimpchannel.c +++ b/app/gimpchannel.c @@ -26,23 +26,25 @@ #include "apptypes.h" #include "appenv.h" +#include "boundary.h" #include "channel.h" #include "drawable.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimage_mask.h" +#include "gimpsignal.h" +#include "gimppreviewcache.h" +#include "gimplut.h" #include "layer.h" #include "paint_funcs.h" #include "parasitelist.h" -#include "temp_buf.h" -#include "undo.h" -#include "gimpsignal.h" -#include "gimppreviewcache.h" - -#include "channel_pvt.h" -#include "tile.h" - -#include "gimplut.h" +#include "pixel_processor.h" +#include "pixel_region.h" #include "lut_funcs.h" +#include "temp_buf.h" +#include "tile.h" +#include "tile_manager.h" +#include "undo.h" #include "libgimp/gimpmath.h" @@ -1004,14 +1006,14 @@ channel_combine_rect (Channel *mask, pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, x, y, x2 - x, y2 - y, TRUE); - if (op == ADD || op == REPLACE) + if (op == CHANNEL_OP_ADD || op == CHANNEL_OP_REPLACE) color = 255; else color = 0; color_region (&maskPR, &color); /* Determine new boundary */ - if (mask->bounds_known && (op == ADD) && !mask->empty) + if (mask->bounds_known && (op == CHANNEL_OP_ADD) && !mask->empty) { if (x < mask->x1) mask->x1 = x; @@ -1022,7 +1024,7 @@ channel_combine_rect (Channel *mask, if ((y + h) > mask->y2) mask->y2 = (y + h); } - else if (op == REPLACE || mask->empty) + else if (op == CHANNEL_OP_REPLACE || mask->empty) { mask->empty = FALSE; mask->x1 = x; @@ -1084,10 +1086,11 @@ channel_combine_ellipse (Channel *mask, switch (op) { - case ADD: case REPLACE: + case CHANNEL_OP_ADD: + case CHANNEL_OP_REPLACE: channel_add_segment (mask, x1, i, (x2 - x1), 255); break; - case SUB : + case CHANNEL_OP_SUB: channel_sub_segment (mask, x1, i, (x2 - x1), 255); break; default: @@ -1127,10 +1130,11 @@ channel_combine_ellipse (Channel *mask, { switch (op) { - case ADD: case REPLACE: + case CHANNEL_OP_ADD: + case CHANNEL_OP_REPLACE: channel_add_segment (mask, x0, i, j - x0, last); break; - case SUB: + case CHANNEL_OP_SUB: channel_sub_segment (mask, x0, i, j - x0, last); break; default: @@ -1152,9 +1156,9 @@ channel_combine_ellipse (Channel *mask, if (last) { - if (op == ADD || op == REPLACE) + if (op == CHANNEL_OP_ADD || op == CHANNEL_OP_REPLACE) channel_add_segment (mask, x0, i, j - x0, last); - else if (op == SUB) + else if (op == CHANNEL_OP_SUB) channel_sub_segment (mask, x0, i, j - x0, last); else g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); @@ -1165,7 +1169,7 @@ channel_combine_ellipse (Channel *mask, } /* Determine new boundary */ - if (mask->bounds_known && (op == ADD) && !mask->empty) + if (mask->bounds_known && (op == CHANNEL_OP_ADD) && !mask->empty) { if (x < mask->x1) mask->x1 = x; @@ -1176,7 +1180,7 @@ channel_combine_ellipse (Channel *mask, if ((y + h) > mask->y2) mask->y2 = (y + h); } - else if (op == REPLACE || mask->empty) + else if (op == CHANNEL_OP_REPLACE || mask->empty) { mask->empty = FALSE; mask->x1 = x; @@ -1293,15 +1297,16 @@ channel_combine_mask (Channel *mask, switch (op) { - case ADD: case REPLACE: + case CHANNEL_OP_ADD: + case CHANNEL_OP_REPLACE: pixel_regions_process_parallel ((p_func) channel_combine_sub_region_add, NULL, 2, &srcPR, &destPR); break; - case SUB: + case CHANNEL_OP_SUB: pixel_regions_process_parallel ((p_func) channel_combine_sub_region_sub, NULL, 2, &srcPR, &destPR); break; - case INTERSECT: + case CHANNEL_OP_INTERSECT: pixel_regions_process_parallel ((p_func) channel_combine_sub_region_intersect, NULL, 2, &srcPR, &destPR); diff --git a/app/gimpchannel.h b/app/gimpchannel.h index 5ae6ae1fbe..51dd13f148 100644 --- a/app/gimpchannel.h +++ b/app/gimpchannel.h @@ -19,35 +19,49 @@ #ifndef __CHANNEL_H__ #define __CHANNEL_H__ -#include "apptypes.h" -#include "drawable.h" -#include "boundary.h" -#include "temp_buf.h" -#include "tile_manager.h" + +#include "gimpdrawable.h" /* OPERATIONS */ -typedef enum -{ - ADD, - SUB, - REPLACE, - INTERSECT -} ChannelOps; - /* Half way point where a region is no longer visible in a selection */ #define HALF_WAY 127 /* structure declarations */ -#define GIMP_TYPE_CHANNEL (gimp_channel_get_type ()) -#define GIMP_CHANNEL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_CHANNEL, GimpChannel)) -#define GIMP_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CHANNEL, GimpChannelClass)) -#define GIMP_IS_CHANNEL(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_CHANNEL)) -#define GIMP_IS_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CHANNEL)) +#define GIMP_TYPE_CHANNEL (gimp_channel_get_type ()) +#define GIMP_CHANNEL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_CHANNEL, GimpChannel)) +#define GIMP_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CHANNEL, GimpChannelClass)) +#define GIMP_IS_CHANNEL(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_CHANNEL)) +#define GIMP_IS_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CHANNEL)) + +struct _GimpChannel +{ + GimpDrawable drawable; + + guchar col[3]; /* RGB triplet for channel color */ + gint opacity; /* Channel opacity */ + gboolean show_masked; /* Show masked areas--as */ + /* opposed to selected areas */ + + /* Selection mask variables */ + gboolean boundary_known; /* is the current boundary valid */ + BoundSeg *segs_in; /* outline of selected region */ + BoundSeg *segs_out; /* outline of selected region */ + gint num_segs_in; /* number of lines in boundary */ + gint num_segs_out; /* number of lines in boundary */ + gboolean empty; /* is the region empty? */ + gboolean bounds_known; /* recalculate the bounds? */ + gint x1, y1; /* coordinates for bounding box */ + gint x2, y2; /* lower right hand coordinate */ +}; + +struct _GimpChannelClass +{ + GimpDrawableClass parent_class; +}; -GtkType gimp_channel_get_type (void); /* Special undo type */ @@ -72,6 +86,8 @@ struct _MaskUndo /* function declarations */ +GtkType gimp_channel_get_type (void); + Channel * channel_new (GimpImage *gimage, gint width, gint height, diff --git a/app/gimpcontext.c b/app/gimpcontext.c index 72c77b5ce7..23df3bdd74 100644 --- a/app/gimpcontext.c +++ b/app/gimpcontext.c @@ -25,13 +25,17 @@ #include "apptypes.h" #include "appenv.h" +#include "gdisplay.h" #include "gimpbrush.h" #include "gimpbrushlist.h" #include "gimpcontext.h" #include "gimprc.h" #include "gimpsignal.h" #include "gradient_header.h" +#include "gradient.h" #include "patterns.h" +#include "temp_buf.h" + #define context_return_if_fail(context) \ g_return_if_fail ((context) != NULL); \ @@ -381,7 +385,7 @@ gimp_context_destroy (GtkObject *object) } if (GTK_OBJECT_CLASS (parent_class)->destroy) - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); + GTK_OBJECT_CLASS (parent_class)->destroy (object); context_list = g_slist_remove (context_list, context); } diff --git a/app/gimpcontext.h b/app/gimpcontext.h index e557a8794d..493b5b70a2 100644 --- a/app/gimpcontext.h +++ b/app/gimpcontext.h @@ -22,11 +22,7 @@ #define __GIMP_CONTEXT_H__ -#include "apptypes.h" -#include "gdisplay.h" -#include "gradient.h" -#include "patterns.h" -#include "toolsF.h" +#include "gimpobject.h" #define GIMP_TYPE_CONTEXT (gimp_context_get_type ()) @@ -77,7 +73,6 @@ typedef enum GIMP_CONTEXT_PAINT_ARGS_MASK } GimpContextArgMask; -typedef struct _GimpContext GimpContext; typedef struct _GimpContextClass GimpContextClass; struct _GimpContext diff --git a/app/gimpcontextpreview.c b/app/gimpcontextpreview.c index 2e6e14dc3e..87129cee5a 100644 --- a/app/gimpcontextpreview.c +++ b/app/gimpcontextpreview.c @@ -33,12 +33,15 @@ #include "gimpbrushpipe.h" #include "gimpcontextpreview.h" #include "gimpdnd.h" +#include "gradient.h" #include "gradient_header.h" #include "patterns.h" #include "temp_buf.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimplimits.h" + /* the pixmaps for the [scale|pipe]_indicators */ #define indicator_width 7 #define indicator_height 7 diff --git a/app/gimpcontextpreview.h b/app/gimpcontextpreview.h index 97e0d6d64a..b3a1aae448 100644 --- a/app/gimpcontextpreview.h +++ b/app/gimpcontextpreview.h @@ -22,11 +22,6 @@ #ifndef __GIMP_CONTEXT_PREVIEW_H__ #define __GIMP_CONTEXT_PREVIEW_H_ -#include "gimpbrush.h" -#include "gradient.h" -#include "patterns.h" - - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -37,7 +32,6 @@ extern "C" { #define GIMP_IS_CONTEXT_PREVIEW(obj) (GTK_CHECK_TYPE (obj, GIMP_TYPE_CONTEXT_PREVIEW)) #define GIMP_IS_CONTEXT_PREVIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CONTEXT_PREVIEW)) -typedef struct _GimpContextPreview GimpContextPreview; typedef struct _GimpContextPreviewClass GimpContextPreviewClass; typedef enum diff --git a/app/gimpdnd.c b/app/gimpdnd.c index 4875f10f3b..463634ce0e 100644 --- a/app/gimpdnd.c +++ b/app/gimpdnd.c @@ -15,15 +15,29 @@ * 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 + +#include "apptypes.h" + +#include "channel.h" +#include "drawable.h" #include "fileops.h" -#include "gimage.h" +#include "gimpimage.h" +#include "gimpbrush.h" #include "gimpcontextpreview.h" #include "gimpdnd.h" #include "gimpbrushlist.h" #include "gimprc.h" +#include "gradient.h" #include "gradient_header.h" +#include "layer.h" +#include "patterns.h" +#include "temp_buf.h" #include "tools.h" #include "libgimp/gimplimits.h" diff --git a/app/gimpdnd.h b/app/gimpdnd.h index e322d03279..89cd58436a 100644 --- a/app/gimpdnd.h +++ b/app/gimpdnd.h @@ -20,13 +20,6 @@ #define __GIMP_DND_H__ -#include "gimpbrush.h" -#include "gimpdrawable.h" -#include "palette_entries.h" -#include "patterns.h" -#include "gradient.h" -#include "toolsF.h" - enum { GIMP_DND_TYPE_URI_LIST, diff --git a/app/gimpdrawable-desaturate.c b/app/gimpdrawable-desaturate.c index 9dcec4941a..263b2775f3 100644 --- a/app/gimpdrawable-desaturate.c +++ b/app/gimpdrawable-desaturate.c @@ -18,19 +18,20 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" #include "drawable.h" #include "desaturate.h" -#include "paint_funcs.h" #include "gimage.h" +#include "paint_funcs.h" +#include "pixel_region.h" -#include "config.h" #include "libgimp/gimpintl.h" + void image_desaturate (GimpImage *gimage) { @@ -52,24 +53,29 @@ image_desaturate (GimpImage *gimage) void desaturate (GimpDrawable *drawable) { - PixelRegion srcPR, destPR; - unsigned char *src, *s; - unsigned char *dest, *d; - int h, j; - int lightness, min, max; - int has_alpha; - void *pr; - int x1, y1, x2, y2; + PixelRegion srcPR, destPR; + guchar *src, *s; + guchar *dest, *d; + gint h, j; + gint lightness, min, max; + gint has_alpha; + gpointer pr; + gint x1, y1, x2, y2; if (!drawable) return; - has_alpha = drawable_has_alpha (drawable); - drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2); - pixel_region_init (&srcPR, drawable_data (drawable), x1, y1, (x2 - x1), (y2 - y1), FALSE); - pixel_region_init (&destPR, drawable_shadow (drawable), x1, y1, (x2 - x1), (y2 - y1), TRUE); + has_alpha = gimp_drawable_has_alpha (drawable); + gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2); - for (pr = pixel_regions_register (2, &srcPR, &destPR); pr != NULL; pr = pixel_regions_process (pr)) + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + x1, y1, (x2 - x1), (y2 - y1), FALSE); + pixel_region_init (&destPR, gimp_drawable_shadow (drawable), + x1, y1, (x2 - x1), (y2 - y1), TRUE); + + for (pr = pixel_regions_register (2, &srcPR, &destPR); + pr != NULL; + pr = pixel_regions_process (pr)) { src = srcPR.data; dest = destPR.data; diff --git a/app/gimpdrawable-desaturate.h b/app/gimpdrawable-desaturate.h index 33b5d68153..1b0e8017d3 100644 --- a/app/gimpdrawable-desaturate.h +++ b/app/gimpdrawable-desaturate.h @@ -20,9 +20,8 @@ #define __DESATURATE_H__ -/* desaturate functions */ -void image_desaturate (GimpImage *gimage); -void desaturate (GimpDrawable *drawable); +void image_desaturate (GimpImage *gimage); +void desaturate (GimpDrawable *drawable); #endif /* __DESATURATE_H__ */ diff --git a/app/gimpdrawable-equalize.c b/app/gimpdrawable-equalize.c index 435952a437..3fc778037b 100644 --- a/app/gimpdrawable-equalize.c +++ b/app/gimpdrawable-equalize.c @@ -20,16 +20,20 @@ #include +#include "apptypes.h" + #include "drawable.h" #include "equalize.h" #include "gimage.h" #include "gimplut.h" #include "lut_funcs.h" #include "gimphistogram.h" +#include "pixel_processor.h" +#include "pixel_region.h" -#include "config.h" #include "libgimp/gimpintl.h" + void image_equalize (GimpImage *gimage) { @@ -52,39 +56,41 @@ equalize (GimpImage *gimage, GimpDrawable *drawable, gboolean mask_only) { - PixelRegion srcPR, destPR; - unsigned char *mask; - int has_alpha; - int alpha, bytes; - int x1, y1, x2, y2; + PixelRegion srcPR, destPR; + guchar *mask; + gint has_alpha; + gint alpha, bytes; + gint x1, y1, x2, y2; GimpHistogram *hist; - GimpLut *lut; + GimpLut *lut; mask = NULL; - bytes = drawable_bytes (drawable); - has_alpha = drawable_has_alpha (drawable); - alpha = has_alpha ? (bytes - 1) : bytes; + bytes = gimp_drawable_bytes (drawable); + has_alpha = gimp_drawable_has_alpha (drawable); + alpha = has_alpha ? (bytes - 1) : bytes; - hist = gimp_histogram_new(); - gimp_histogram_calculate_drawable(hist, drawable); + hist = gimp_histogram_new (); + gimp_histogram_calculate_drawable (hist, drawable); /* Build equalization LUT */ lut = eq_histogram_lut_new (hist, bytes); /* Apply the histogram */ - drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2); + gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2); - pixel_region_init (&srcPR, drawable_data (drawable), x1, y1, (x2 - x1), (y2 - y1), FALSE); - pixel_region_init (&destPR, drawable_shadow (drawable), x1, y1, (x2 - x1), (y2 - y1), TRUE); + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + x1, y1, (x2 - x1), (y2 - y1), FALSE); + pixel_region_init (&destPR, gimp_drawable_shadow (drawable), + x1, y1, (x2 - x1), (y2 - y1), TRUE); - pixel_regions_process_parallel((p_func)gimp_lut_process, lut, - 2, &srcPR, &destPR); + pixel_regions_process_parallel ((p_func) gimp_lut_process, lut, + 2, &srcPR, &destPR); - gimp_lut_free(lut); - gimp_histogram_free(hist); + gimp_lut_free (lut); + gimp_histogram_free (hist); - drawable_merge_shadow (drawable, TRUE); + gimp_drawable_merge_shadow (drawable, TRUE); drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1)); } diff --git a/app/gimpdrawable-equalize.h b/app/gimpdrawable-equalize.h index 5a27a7bc89..efbc8646ef 100644 --- a/app/gimpdrawable-equalize.h +++ b/app/gimpdrawable-equalize.h @@ -20,11 +20,10 @@ #define __EQUALIZE_H__ -/* equalize functions */ -void image_equalize (GimpImage *gimage); -void equalize (GimpImage *gimage, - GimpDrawable *drawable, - gboolean mask_only); +void image_equalize (GimpImage *gimage); +void equalize (GimpImage *gimage, + GimpDrawable *drawable, + gboolean mask_only); #endif /* __INVERT_H__ */ diff --git a/app/gimpdrawable-invert.c b/app/gimpdrawable-invert.c index 65d4e71085..005d0d4aaf 100644 --- a/app/gimpdrawable-invert.c +++ b/app/gimpdrawable-invert.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include "apptypes.h" @@ -28,6 +28,9 @@ #include "gimage.h" #include "gimplut.h" #include "lut_funcs.h" +#include "pixel_processor.h" +#include "pixel_region.h" +#include "procedural_db.h" #include "libgimp/gimpintl.h" diff --git a/app/gimpdrawable-invert.h b/app/gimpdrawable-invert.h index bc50e0fd8a..921189b4e2 100644 --- a/app/gimpdrawable-invert.h +++ b/app/gimpdrawable-invert.h @@ -19,9 +19,9 @@ #ifndef __INVERT_H__ #define __INVERT_H__ -/* invert functions */ -void image_invert (GimpImage *); -void invert (GimpDrawable *); + +void image_invert (GimpImage *gimage); +void invert (GimpDrawable *drawable); #endif /* __INVERT_H__ */ diff --git a/app/gimpdrawable-offset.c b/app/gimpdrawable-offset.c index ab57fa2f97..9097106e66 100644 --- a/app/gimpdrawable-offset.c +++ b/app/gimpdrawable-offset.c @@ -32,12 +32,16 @@ #include "floating_sel.h" #include "gdisplay.h" #include "gimpcontext.h" +#include "gimage.h" #include "gimpui.h" +#include "layer.h" +#include "paint_funcs.h" #include "parasitelist.h" +#include "path.h" +#include "pixel_region.h" +#include "tile_manager.h" -#include "channel_pvt.h" -#include "layer_pvt.h" - +#include "libgimp/gimphelpui.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" @@ -69,23 +73,23 @@ void channel_ops_offset (GimpImage* gimage) { OffsetDialog *off_d; - GtkWidget *label; - GtkWidget *check; - GtkWidget *push; - GtkWidget *vbox; - GtkWidget *table; - GtkObject *adjustment; - GtkWidget *spinbutton; - GtkWidget *frame; - GtkWidget *radio_button; + GtkWidget *label; + GtkWidget *check; + GtkWidget *push; + GtkWidget *vbox; + GtkWidget *table; + GtkObject *adjustment; + GtkWidget *spinbutton; + GtkWidget *frame; + GtkWidget *radio_button; GimpDrawable *drawable; - drawable = gimage_active_drawable (gimage); + drawable = gimp_image_active_drawable (gimage); off_d = g_new (OffsetDialog, 1); off_d->wrap_around = TRUE; - off_d->fill_type = drawable_has_alpha (drawable); + off_d->fill_type = gimp_drawable_has_alpha (drawable); off_d->gimage = gimage; off_d->dlg = gimp_dialog_new (_("Offset"), "offset", @@ -186,7 +190,7 @@ channel_ops_offset (GimpImage* gimage) gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); - if (!drawable_has_alpha (drawable)) + if (! gimp_drawable_has_alpha (drawable)) gtk_widget_set_sensitive (radio_button, FALSE); /* The by half height and half width option */ @@ -229,8 +233,8 @@ offset (GimpImage *gimage, if (!drawable) return; - width = drawable_width (drawable); - height = drawable_height (drawable); + width = gimp_drawable_width (drawable); + height = gimp_drawable_height (drawable); if (wrap_around) { @@ -252,7 +256,7 @@ offset (GimpImage *gimage, if (offset_x == 0 && offset_y == 0) return; - new_tiles = tile_manager_new (width, height, drawable_bytes (drawable)); + new_tiles = tile_manager_new (width, height, gimp_drawable_bytes (drawable)); if (offset_x >= 0) { src_x = 0; @@ -282,8 +286,10 @@ offset (GimpImage *gimage, /* Copy the center region */ if (width && height) { - pixel_region_init (&srcPR, drawable_data (drawable), src_x, src_y, width, height, FALSE); - pixel_region_init (&destPR, new_tiles, dest_x, dest_y, width, height, TRUE); + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + src_x, src_y, width, height, FALSE); + pixel_region_init (&destPR, new_tiles, + dest_x, dest_y, width, height, TRUE); copy_region (&srcPR, &destPR); } @@ -293,18 +299,18 @@ offset (GimpImage *gimage, { if (offset_x >= 0 && offset_y >= 0) { - src_x = drawable_width (drawable) - offset_x; - src_y = drawable_height (drawable) - offset_y; + src_x = gimp_drawable_width (drawable) - offset_x; + src_y = gimp_drawable_height (drawable) - offset_y; } else if (offset_x >= 0 && offset_y < 0) { - src_x = drawable_width (drawable) - offset_x; + src_x = gimp_drawable_width (drawable) - offset_x; src_y = 0; } else if (offset_x < 0 && offset_y >= 0) { src_x = 0; - src_y = drawable_height (drawable) - offset_y; + src_y = gimp_drawable_height (drawable) - offset_y; } else if (offset_x < 0 && offset_y < 0) { @@ -312,19 +318,22 @@ offset (GimpImage *gimage, src_y = 0; } - dest_x = (src_x + offset_x) % drawable_width (drawable); + dest_x = (src_x + offset_x) % gimp_drawable_width (drawable); if (dest_x < 0) - dest_x = drawable_width (drawable) + dest_x; - dest_y = (src_y + offset_y) % drawable_height (drawable); + dest_x = gimp_drawable_width (drawable) + dest_x; + dest_y = (src_y + offset_y) % gimp_drawable_height (drawable); if (dest_y < 0) - dest_y = drawable_height (drawable) + dest_y; + dest_y = gimp_drawable_height (drawable) + dest_y; /* intersecting region */ if (offset_x != 0 && offset_y != 0) { - pixel_region_init (&srcPR, drawable_data (drawable), src_x, src_y, - ABS (offset_x), ABS (offset_y), FALSE); - pixel_region_init (&destPR, new_tiles, dest_x, dest_y, ABS (offset_x), ABS (offset_y), TRUE); + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + src_x, src_y, ABS (offset_x), ABS (offset_y) + , FALSE); + pixel_region_init (&destPR, new_tiles, + dest_x, dest_y, ABS (offset_x), ABS (offset_y), + TRUE); copy_region (&srcPR, &destPR); } @@ -333,17 +342,28 @@ offset (GimpImage *gimage, { if (offset_y >= 0) { - pixel_region_init (&srcPR, drawable_data (drawable), src_x, 0, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), FALSE); - pixel_region_init (&destPR, new_tiles, dest_x, dest_y + offset_y, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), TRUE); + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + src_x, 0, ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + FALSE); + pixel_region_init (&destPR, new_tiles, + dest_x, dest_y + offset_y, + ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + TRUE); } else if (offset_y < 0) { - pixel_region_init (&srcPR, drawable_data (drawable), src_x, src_y - offset_y, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), FALSE); - pixel_region_init (&destPR, new_tiles, dest_x, 0, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), TRUE); + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + src_x, src_y - offset_y, + ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + FALSE); + pixel_region_init (&destPR, new_tiles, + dest_x, 0, + ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + TRUE); } copy_region (&srcPR, &destPR); @@ -354,21 +374,22 @@ offset (GimpImage *gimage, { if (offset_x >= 0) { - pixel_region_init (&srcPR, drawable_data (drawable), 0, src_y, - drawable_width (drawable) - ABS (offset_x), + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + 0, src_y, + gimp_drawable_width (drawable) - ABS (offset_x), ABS (offset_y), FALSE); pixel_region_init (&destPR, new_tiles, dest_x + offset_x, dest_y, - drawable_width (drawable) - ABS (offset_x), + gimp_drawable_width (drawable) - ABS (offset_x), ABS (offset_y), TRUE); } else if (offset_x < 0) { - pixel_region_init (&srcPR, drawable_data (drawable), + pixel_region_init (&srcPR, gimp_drawable_data (drawable), src_x - offset_x, src_y, - drawable_width (drawable) - ABS (offset_x), + gimp_drawable_width (drawable) - ABS (offset_x), ABS (offset_y), FALSE); pixel_region_init (&destPR, new_tiles, 0, dest_y, - drawable_width (drawable) - ABS (offset_x), + gimp_drawable_width (drawable) - ABS (offset_x), ABS (offset_y), TRUE); } @@ -381,8 +402,8 @@ offset (GimpImage *gimage, if (fill_type == OFFSET_BACKGROUND) { gimp_context_get_background (NULL, &fill[0], &fill[1], &fill[2]); - if (drawable_has_alpha (drawable)) - fill[drawable_bytes (drawable) - 1] = OPAQUE_OPACITY; + if (gimp_drawable_has_alpha (drawable)) + fill[gimp_drawable_bytes (drawable) - 1] = OPAQUE_OPACITY; } if (offset_x >= 0 && offset_y >= 0) @@ -393,17 +414,17 @@ offset (GimpImage *gimage, else if (offset_x >= 0 && offset_y < 0) { dest_x = 0; - dest_y = drawable_height (drawable) + offset_y; + dest_y = gimp_drawable_height (drawable) + offset_y; } else if (offset_x < 0 && offset_y >= 0) { - dest_x = drawable_width (drawable) + offset_x; + dest_x = gimp_drawable_width (drawable) + offset_x; dest_y = 0; } else if (offset_x < 0 && offset_y < 0) { - dest_x = drawable_width (drawable) + offset_x; - dest_y = drawable_height (drawable) + offset_y; + dest_x = gimp_drawable_width (drawable) + offset_x; + dest_y = gimp_drawable_height (drawable) + offset_y; } /* intersecting region */ @@ -418,11 +439,17 @@ offset (GimpImage *gimage, if (offset_x != 0) { if (offset_y >= 0) - pixel_region_init (&destPR, new_tiles, dest_x, dest_y + offset_y, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), TRUE); + pixel_region_init (&destPR, new_tiles, + dest_x, dest_y + offset_y, + ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + TRUE); else if (offset_y < 0) - pixel_region_init (&destPR, new_tiles, dest_x, 0, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), TRUE); + pixel_region_init (&destPR, new_tiles, + dest_x, 0, + ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + TRUE); color_region (&destPR, fill); } @@ -431,11 +458,18 @@ offset (GimpImage *gimage, if (offset_y != 0) { if (offset_x >= 0) - pixel_region_init (&destPR, new_tiles, dest_x + offset_x, dest_y, - drawable_width (drawable) - ABS (offset_x), ABS (offset_y), TRUE); + pixel_region_init (&destPR, new_tiles, + dest_x + offset_x, + dest_y, + gimp_drawable_width (drawable) - ABS (offset_x), + ABS (offset_y), + TRUE); else if (offset_x < 0) - pixel_region_init (&destPR, new_tiles, 0, dest_y, - drawable_width (drawable) - ABS (offset_x), ABS (offset_y), TRUE); + pixel_region_init (&destPR, new_tiles, + 0, dest_y, + gimp_drawable_width (drawable) - ABS (offset_x), + ABS (offset_y), + TRUE); color_region (&destPR, fill); } @@ -443,8 +477,9 @@ offset (GimpImage *gimage, /* push an undo */ drawable_apply_image (drawable, 0, 0, - drawable_width (drawable), drawable_height (drawable), - drawable_data (drawable), FALSE); + gimp_drawable_width (drawable), + gimp_drawable_height (drawable), + gimp_drawable_data (drawable), FALSE); /* swap the tiles */ drawable->tiles = new_tiles; @@ -452,7 +487,8 @@ offset (GimpImage *gimage, /* update the drawable */ drawable_update (drawable, 0, 0, - drawable_width (drawable), drawable_height (drawable)); + gimp_drawable_width (drawable), + gimp_drawable_height (drawable)); } /* @@ -473,7 +509,7 @@ offset_ok_callback (GtkWidget *widget, if ((gimage = off_d->gimage) != NULL) { - drawable = gimage_active_drawable (gimage); + drawable = gimp_image_active_drawable (gimage); offset_x = (gint) RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 0)); @@ -505,7 +541,7 @@ offset_halfheight_callback (GtkWidget *widget, gpointer data) { OffsetDialog *off_d; - GImage *gimage; + GImage *gimage; off_d = (OffsetDialog *) data; gimage = off_d->gimage; @@ -519,27 +555,27 @@ offset_halfheight_callback (GtkWidget *widget, GimpImage * duplicate (GimpImage *gimage) { - PixelRegion srcPR, destPR; - GimpImage *new_gimage; - Layer *layer, *new_layer; - Layer *floating_layer; - Channel *channel, *new_channel; - GSList *list; - GList *glist; - Guide *guide = NULL; - Layer *active_layer = NULL; - Channel *active_channel = NULL; + PixelRegion srcPR, destPR; + GimpImage *new_gimage; + Layer *layer, *new_layer; + Layer *floating_layer; + Channel *channel, *new_channel; + GSList *list; + GList *glist; + Guide *guide = NULL; + Layer *active_layer = NULL; + Channel *active_channel = NULL; GimpDrawable *new_floating_sel_drawable = NULL; GimpDrawable *floating_sel_drawable = NULL; ParasiteList *parasites; - PathList *paths; - gint count; + PathList *paths; + gint count; gimp_add_busy_cursors_until_idle (); /* Create a new image */ new_gimage = gimage_new (gimage->width, gimage->height, gimage->base_type); - gimage_disable_undo (new_gimage); + gimp_image_undo_disable (new_gimage); /* Copy resolution and unit information */ new_gimage->xresolution = gimage->xresolution; @@ -547,7 +583,7 @@ duplicate (GimpImage *gimage) new_gimage->unit = gimage->unit; /* Copy floating layer */ - floating_layer = gimage_floating_sel (gimage); + floating_layer = gimp_image_floating_sel (gimage); if (floating_layer) { floating_sel_relax (floating_layer, FALSE); @@ -591,7 +627,7 @@ duplicate (GimpImage *gimage) /* Add the layer */ if (floating_layer != new_layer) - gimage_add_layer (new_gimage, new_layer, count++); + gimp_image_add_layer (new_gimage, new_layer, count++); } /* Copy the channels */ @@ -617,13 +653,13 @@ duplicate (GimpImage *gimage) new_floating_sel_drawable = GIMP_DRAWABLE(new_channel); /* Add the channel */ - gimage_add_channel (new_gimage, new_channel, count++); + gimp_image_add_channel (new_gimage, new_channel, count++); } /* Copy the selection mask */ - pixel_region_init (&srcPR, drawable_data (GIMP_DRAWABLE(gimage->selection_mask)), + pixel_region_init (&srcPR, gimp_drawable_data (GIMP_DRAWABLE (gimage->selection_mask)), 0, 0, gimage->width, gimage->height, FALSE); - pixel_region_init (&destPR, drawable_data (GIMP_DRAWABLE(new_gimage->selection_mask)), + pixel_region_init (&destPR, gimp_drawable_data (GIMP_DRAWABLE (new_gimage->selection_mask)), 0, 0, gimage->width, gimage->height, TRUE); copy_region (&srcPR, &destPR); new_gimage->selection_mask->bounds_known = FALSE; @@ -700,7 +736,7 @@ duplicate (GimpImage *gimage) gimp_image_set_paths (new_gimage, new_paths); } - gimage_enable_undo (new_gimage); + gimp_image_undo_enable (new_gimage); return new_gimage; } @@ -708,8 +744,9 @@ duplicate (GimpImage *gimage) #ifdef I_LIKE_BOGUS_CRAP static void -duplicate_projection (GimpImage *oldgimage, GimpImage *newgimage, - GDisplay *newgdisplay) +duplicate_projection (GimpImage *oldgimage, + GimpImage *newgimage, + GDisplay *newgdisplay) { PixelRegion srcPR, destPR; diff --git a/app/gimpdrawable.c b/app/gimpdrawable.c index 1347274c21..b7d30b6809 100644 --- a/app/gimpdrawable.c +++ b/app/gimpdrawable.c @@ -24,13 +24,21 @@ #include -#include "gimpdrawableP.h" +#include "apptypes.h" + +#include "channel.h" +#include "gimpdrawable.h" +#include "layer.h" #include "gimppreviewcache.h" #include "gimpsignal.h" #include "gimage.h" #include "gimage_mask.h" #include "gimpparasite.h" +#include "paint_funcs.h" #include "parasitelist.h" +#include "pixel_region.h" +#include "tile.h" +#include "tile_manager.h" #include "undo.h" #include "libgimp/gimpmath.h" diff --git a/app/gimpdrawable.h b/app/gimpdrawable.h index cdd1f9f43e..7c5de8ecb6 100644 --- a/app/gimpdrawable.h +++ b/app/gimpdrawable.h @@ -19,17 +19,49 @@ #ifndef __GIMP_DRAWABLE_H__ #define __GIMP_DRAWABLE_H__ -#include "apptypes.h" + #include "gimpobject.h" -#include "tile_manager.h" -#include "temp_buf.h" - -#include "libgimp/gimpparasite.h" -#define GIMP_TYPE_DRAWABLE (gimp_drawable_get_type ()) -#define GIMP_DRAWABLE(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_DRAWABLE, GimpDrawable)) -#define GIMP_IS_DRAWABLE(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_DRAWABLE)) +#define GIMP_TYPE_DRAWABLE (gimp_drawable_get_type ()) +#define GIMP_DRAWABLE(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_DRAWABLE, GimpDrawable)) +#define GIMP_IS_DRAWABLE(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_DRAWABLE)) +#define GIMP_DRAWABLE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_DRAWABLE, GimpDrawableClass)) +#define GIMP_IS_DRAWABLE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_DRAWABLE)) + + +typedef struct _GimpDrawableClass GimpDrawableClass; + +struct _GimpDrawable +{ + GimpObject data; + + gchar *name; /* name of drawable */ + TileManager *tiles; /* tiles for drawable data */ + gboolean visible; /* controls visibility */ + gint width, height; /* size of drawable */ + gint offset_x, offset_y; /* offset of layer in image */ + + gint bytes; /* bytes per pixel */ + gint ID; /* provides a unique ID */ + guint32 tattoo; /* provides a perminant ID */ + GimpImage *gimage; /* gimage owner */ + GimpImageType type; /* type of drawable */ + gboolean has_alpha; /* drawable has alpha */ + + ParasiteList *parasites; /* Plug-in parasite data */ + + /* Preview variables */ + GSList *preview_cache; /* preview caches of the channel */ + gboolean preview_valid; /* is the preview valid? */ +}; + +struct _GimpDrawableClass +{ + GimpObjectClass parent_class; + + void (* invalidate_preview) (GimpDrawable *drawable); +}; /* drawable access functions */ @@ -94,4 +126,11 @@ GimpImage * gimp_drawable_gimage (const GimpDrawable *drawable); void gimp_drawable_set_gimage (GimpDrawable *drawable, GimpImage *gimage); +void gimp_drawable_configure (GimpDrawable *drawable, + GimpImage *gimage, + gint width, + gint height, + GimpImageType type, + const gchar *name); + #endif /* __GIMP_DRAWABLE_H__ */ diff --git a/app/gimpdrawableP.h b/app/gimpdrawableP.h deleted file mode 100644 index 0c43d095f7..0000000000 --- a/app/gimpdrawableP.h +++ /dev/null @@ -1,72 +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 __GIMP_DRAWABLE_P_H__ -#define __GIMP_DRAWABLE_P_H__ - -#include "gimpobject.h" -#include "gimpdrawable.h" - - -#define GIMP_DRAWABLE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_DRAWABLE, GimpDrawableClass)) - -#define GIMP_IS_DRAWABLE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_DRAWABLE)) - - -typedef struct _GimpDrawableClass GimpDrawableClass; - -struct _GimpDrawable -{ - GimpObject data; - - gchar *name; /* name of drawable */ - TileManager *tiles; /* tiles for drawable data */ - gboolean visible; /* controls visibility */ - gint width, height; /* size of drawable */ - gint offset_x, offset_y; /* offset of layer in image */ - - gint bytes; /* bytes per pixel */ - gint ID; /* provides a unique ID */ - guint32 tattoo; /* provides a perminant ID */ - GimpImage *gimage; /* gimage owner */ - GimpImageType type; /* type of drawable */ - gboolean has_alpha; /* drawable has alpha */ - - ParasiteList *parasites; /* Plug-in parasite data */ - - /* Preview variables */ - GSList *preview_cache; /* preview caches of the channel */ - gboolean preview_valid; /* is the preview valid? */ -}; - -struct _GimpDrawableClass -{ - GimpObjectClass parent_class; - - void (* invalidate_preview) (GimpDrawable *drawable); -}; - - -void gimp_drawable_configure (GimpDrawable *drawable, - GimpImage *gimage, - gint width, - gint height, - GimpImageType type, - const gchar *name); - -#endif /* __GIMP_DRAWABLE_P_H__ */ diff --git a/app/gimphelp.c b/app/gimphelp.c index 02f6b51b9c..1463957add 100644 --- a/app/gimphelp.c +++ b/app/gimphelp.c @@ -18,6 +18,7 @@ * 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" #ifdef HAVE_UNISTD_H @@ -26,9 +27,12 @@ #ifdef HAVE_STRING_H #include #endif +#include "sys/types.h" #include +#include "apptypes.h" + #include "gimphelp.h" #include "gimprc.h" #include "gimpui.h" @@ -36,6 +40,7 @@ #include "procedural_db.h" #include "libgimp/gimpenv.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpintl.h" diff --git a/app/gimphelp.h b/app/gimphelp.h index 9f749f526d..7a57b8c0d5 100644 --- a/app/gimphelp.h +++ b/app/gimphelp.h @@ -22,10 +22,6 @@ #ifndef __GIMP_HELP_H__ #define __GIMP_HELP_H__ -#include "gtk/gtk.h" - -#include "libgimp/gimphelpui.h" - enum { diff --git a/app/gimphistogram.c b/app/gimphistogram.c index 36240ce809..6def3a2093 100644 --- a/app/gimphistogram.c +++ b/app/gimphistogram.c @@ -24,16 +24,21 @@ #include #endif /* ENABLE_MP */ -#include +#include -#include +#include "apptypes.h" +#include "drawable.h" #include "gimphistogram.h" #include "pixel_region.h" #include "gimpdrawable.h" #include "channel.h" #include "gimpimage.h" #include "gimprc.h" +#include "pixel_processor.h" + +#include +#include struct _GimpHistogram diff --git a/app/gimphistogram.h b/app/gimphistogram.h index 83c0735e7f..073e5f4ec6 100644 --- a/app/gimphistogram.h +++ b/app/gimphistogram.h @@ -21,8 +21,6 @@ #ifndef __GIMP_HISTOGRAM_H__ #define __GIMP_HISTOGRAM_H__ -#include "pixel_region.h" -#include "gimpdrawable.h" typedef enum { diff --git a/app/gimpimage-convert.c b/app/gimpimage-convert.c index c5f80585b0..803e6beaba 100644 --- a/app/gimpimage-convert.c +++ b/app/gimpimage-convert.c @@ -89,7 +89,7 @@ #include #include -#include +#include #include "apptypes.h" @@ -103,23 +103,27 @@ #include "floating_sel.h" #include "fsdither.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimpui.h" #include "hue_saturation.h" +#include "layer.h" #include "levels.h" #include "undo.h" #include "palette.h" +#include "palette_entries.h" #include "palette_select.h" +#include "pixel_region.h" #include "posterize.h" #include "threshold.h" +#include "tile_manager.h" +#include "tile_manager_pvt.h" /* ick ick ick. */ #include "libgimp/gimpcolorspace.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" -#include "layer_pvt.h" /* ick. */ -#include "drawable_pvt.h" /* ick ick. */ -#include "tile_manager_pvt.h" /* ick ick ick. */ #define PRECISION_R 6 #define PRECISION_G 6 @@ -550,7 +554,7 @@ convert_to_indexed (GimpImage *gimage) if (dialog->num_cols == 256) { - if ((!gimage_is_empty (gimage)) + if ((!gimp_image_is_empty (gimage)) && ( gimage->layers->next @@ -754,7 +758,7 @@ convert_to_indexed (GimpImage *gimage) /* if the image isn't non-alpha/layered, set the default number of colours to one less than max, to leave room for a transparent index for transparent/animated GIFs */ - if ((!gimage_is_empty (gimage)) + if ((!gimp_image_is_empty (gimage)) && ( gimage->layers->next @@ -1211,7 +1215,7 @@ convert_image (GImage *gimage, gimp_add_busy_cursors(); /* Get the floating layer if one exists */ - floating_layer = gimage_floating_sel (gimage); + floating_layer = gimp_image_floating_sel (gimage); undo_push_group_start (gimage, GIMAGE_MOD_UNDO); @@ -1442,7 +1446,7 @@ convert_image (GImage *gimage, quantobj->delete_func (quantobj); /* Make sure the projection is up to date */ - gimage_projection_realloc (gimage); + gimp_image_projection_realloc (gimage); /* Rigor the floating selection */ if (floating_layer) @@ -1452,7 +1456,7 @@ convert_image (GImage *gimage, /* shrink wrap and update all views */ layer_invalidate_previews (gimage); - gimage_invalidate_preview (gimage); + gimp_image_invalidate_preview (gimage); gdisplays_update_title (gimage); gdisplays_update_full (gimage); diff --git a/app/gimpimage-convert.h b/app/gimpimage-convert.h index 282f4ce9fa..bae74db72c 100644 --- a/app/gimpimage-convert.h +++ b/app/gimpimage-convert.h @@ -19,9 +19,6 @@ #ifndef __CONVERT_H__ #define __CONVERT_H__ -#include "procedural_db.h" -#include "palette_entries.h" - /* adam's extra palette stuff */ typedef enum @@ -47,17 +44,18 @@ typedef enum #define MAXNUMCOLORS 256 /* convert functions */ -void convert_to_rgb (GimpImage *); -void convert_to_grayscale (GimpImage *); -void convert_to_indexed (GimpImage *); +void convert_to_rgb (GimpImage *gimage); +void convert_to_grayscale (GimpImage *gimage); +void convert_to_indexed (GimpImage *gimage); + +void convert_image (GimpImage *gimage, + GimpImageBaseType , + gint num_cols, + ConvertDitherType , + gint alpha_dither, + gint remdups, + ConvertPaletteType ); -void convert_image (GimpImage *, - GimpImageBaseType, - gint num_cols, - ConvertDitherType, - gint alpha_dither, - gint remdups, - ConvertPaletteType); extern PaletteEntries *theCustomPalette; diff --git a/app/gimpimage-duplicate.c b/app/gimpimage-duplicate.c index ab57fa2f97..9097106e66 100644 --- a/app/gimpimage-duplicate.c +++ b/app/gimpimage-duplicate.c @@ -32,12 +32,16 @@ #include "floating_sel.h" #include "gdisplay.h" #include "gimpcontext.h" +#include "gimage.h" #include "gimpui.h" +#include "layer.h" +#include "paint_funcs.h" #include "parasitelist.h" +#include "path.h" +#include "pixel_region.h" +#include "tile_manager.h" -#include "channel_pvt.h" -#include "layer_pvt.h" - +#include "libgimp/gimphelpui.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" @@ -69,23 +73,23 @@ void channel_ops_offset (GimpImage* gimage) { OffsetDialog *off_d; - GtkWidget *label; - GtkWidget *check; - GtkWidget *push; - GtkWidget *vbox; - GtkWidget *table; - GtkObject *adjustment; - GtkWidget *spinbutton; - GtkWidget *frame; - GtkWidget *radio_button; + GtkWidget *label; + GtkWidget *check; + GtkWidget *push; + GtkWidget *vbox; + GtkWidget *table; + GtkObject *adjustment; + GtkWidget *spinbutton; + GtkWidget *frame; + GtkWidget *radio_button; GimpDrawable *drawable; - drawable = gimage_active_drawable (gimage); + drawable = gimp_image_active_drawable (gimage); off_d = g_new (OffsetDialog, 1); off_d->wrap_around = TRUE; - off_d->fill_type = drawable_has_alpha (drawable); + off_d->fill_type = gimp_drawable_has_alpha (drawable); off_d->gimage = gimage; off_d->dlg = gimp_dialog_new (_("Offset"), "offset", @@ -186,7 +190,7 @@ channel_ops_offset (GimpImage* gimage) gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); - if (!drawable_has_alpha (drawable)) + if (! gimp_drawable_has_alpha (drawable)) gtk_widget_set_sensitive (radio_button, FALSE); /* The by half height and half width option */ @@ -229,8 +233,8 @@ offset (GimpImage *gimage, if (!drawable) return; - width = drawable_width (drawable); - height = drawable_height (drawable); + width = gimp_drawable_width (drawable); + height = gimp_drawable_height (drawable); if (wrap_around) { @@ -252,7 +256,7 @@ offset (GimpImage *gimage, if (offset_x == 0 && offset_y == 0) return; - new_tiles = tile_manager_new (width, height, drawable_bytes (drawable)); + new_tiles = tile_manager_new (width, height, gimp_drawable_bytes (drawable)); if (offset_x >= 0) { src_x = 0; @@ -282,8 +286,10 @@ offset (GimpImage *gimage, /* Copy the center region */ if (width && height) { - pixel_region_init (&srcPR, drawable_data (drawable), src_x, src_y, width, height, FALSE); - pixel_region_init (&destPR, new_tiles, dest_x, dest_y, width, height, TRUE); + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + src_x, src_y, width, height, FALSE); + pixel_region_init (&destPR, new_tiles, + dest_x, dest_y, width, height, TRUE); copy_region (&srcPR, &destPR); } @@ -293,18 +299,18 @@ offset (GimpImage *gimage, { if (offset_x >= 0 && offset_y >= 0) { - src_x = drawable_width (drawable) - offset_x; - src_y = drawable_height (drawable) - offset_y; + src_x = gimp_drawable_width (drawable) - offset_x; + src_y = gimp_drawable_height (drawable) - offset_y; } else if (offset_x >= 0 && offset_y < 0) { - src_x = drawable_width (drawable) - offset_x; + src_x = gimp_drawable_width (drawable) - offset_x; src_y = 0; } else if (offset_x < 0 && offset_y >= 0) { src_x = 0; - src_y = drawable_height (drawable) - offset_y; + src_y = gimp_drawable_height (drawable) - offset_y; } else if (offset_x < 0 && offset_y < 0) { @@ -312,19 +318,22 @@ offset (GimpImage *gimage, src_y = 0; } - dest_x = (src_x + offset_x) % drawable_width (drawable); + dest_x = (src_x + offset_x) % gimp_drawable_width (drawable); if (dest_x < 0) - dest_x = drawable_width (drawable) + dest_x; - dest_y = (src_y + offset_y) % drawable_height (drawable); + dest_x = gimp_drawable_width (drawable) + dest_x; + dest_y = (src_y + offset_y) % gimp_drawable_height (drawable); if (dest_y < 0) - dest_y = drawable_height (drawable) + dest_y; + dest_y = gimp_drawable_height (drawable) + dest_y; /* intersecting region */ if (offset_x != 0 && offset_y != 0) { - pixel_region_init (&srcPR, drawable_data (drawable), src_x, src_y, - ABS (offset_x), ABS (offset_y), FALSE); - pixel_region_init (&destPR, new_tiles, dest_x, dest_y, ABS (offset_x), ABS (offset_y), TRUE); + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + src_x, src_y, ABS (offset_x), ABS (offset_y) + , FALSE); + pixel_region_init (&destPR, new_tiles, + dest_x, dest_y, ABS (offset_x), ABS (offset_y), + TRUE); copy_region (&srcPR, &destPR); } @@ -333,17 +342,28 @@ offset (GimpImage *gimage, { if (offset_y >= 0) { - pixel_region_init (&srcPR, drawable_data (drawable), src_x, 0, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), FALSE); - pixel_region_init (&destPR, new_tiles, dest_x, dest_y + offset_y, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), TRUE); + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + src_x, 0, ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + FALSE); + pixel_region_init (&destPR, new_tiles, + dest_x, dest_y + offset_y, + ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + TRUE); } else if (offset_y < 0) { - pixel_region_init (&srcPR, drawable_data (drawable), src_x, src_y - offset_y, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), FALSE); - pixel_region_init (&destPR, new_tiles, dest_x, 0, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), TRUE); + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + src_x, src_y - offset_y, + ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + FALSE); + pixel_region_init (&destPR, new_tiles, + dest_x, 0, + ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + TRUE); } copy_region (&srcPR, &destPR); @@ -354,21 +374,22 @@ offset (GimpImage *gimage, { if (offset_x >= 0) { - pixel_region_init (&srcPR, drawable_data (drawable), 0, src_y, - drawable_width (drawable) - ABS (offset_x), + pixel_region_init (&srcPR, gimp_drawable_data (drawable), + 0, src_y, + gimp_drawable_width (drawable) - ABS (offset_x), ABS (offset_y), FALSE); pixel_region_init (&destPR, new_tiles, dest_x + offset_x, dest_y, - drawable_width (drawable) - ABS (offset_x), + gimp_drawable_width (drawable) - ABS (offset_x), ABS (offset_y), TRUE); } else if (offset_x < 0) { - pixel_region_init (&srcPR, drawable_data (drawable), + pixel_region_init (&srcPR, gimp_drawable_data (drawable), src_x - offset_x, src_y, - drawable_width (drawable) - ABS (offset_x), + gimp_drawable_width (drawable) - ABS (offset_x), ABS (offset_y), FALSE); pixel_region_init (&destPR, new_tiles, 0, dest_y, - drawable_width (drawable) - ABS (offset_x), + gimp_drawable_width (drawable) - ABS (offset_x), ABS (offset_y), TRUE); } @@ -381,8 +402,8 @@ offset (GimpImage *gimage, if (fill_type == OFFSET_BACKGROUND) { gimp_context_get_background (NULL, &fill[0], &fill[1], &fill[2]); - if (drawable_has_alpha (drawable)) - fill[drawable_bytes (drawable) - 1] = OPAQUE_OPACITY; + if (gimp_drawable_has_alpha (drawable)) + fill[gimp_drawable_bytes (drawable) - 1] = OPAQUE_OPACITY; } if (offset_x >= 0 && offset_y >= 0) @@ -393,17 +414,17 @@ offset (GimpImage *gimage, else if (offset_x >= 0 && offset_y < 0) { dest_x = 0; - dest_y = drawable_height (drawable) + offset_y; + dest_y = gimp_drawable_height (drawable) + offset_y; } else if (offset_x < 0 && offset_y >= 0) { - dest_x = drawable_width (drawable) + offset_x; + dest_x = gimp_drawable_width (drawable) + offset_x; dest_y = 0; } else if (offset_x < 0 && offset_y < 0) { - dest_x = drawable_width (drawable) + offset_x; - dest_y = drawable_height (drawable) + offset_y; + dest_x = gimp_drawable_width (drawable) + offset_x; + dest_y = gimp_drawable_height (drawable) + offset_y; } /* intersecting region */ @@ -418,11 +439,17 @@ offset (GimpImage *gimage, if (offset_x != 0) { if (offset_y >= 0) - pixel_region_init (&destPR, new_tiles, dest_x, dest_y + offset_y, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), TRUE); + pixel_region_init (&destPR, new_tiles, + dest_x, dest_y + offset_y, + ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + TRUE); else if (offset_y < 0) - pixel_region_init (&destPR, new_tiles, dest_x, 0, - ABS (offset_x), drawable_height (drawable) - ABS (offset_y), TRUE); + pixel_region_init (&destPR, new_tiles, + dest_x, 0, + ABS (offset_x), + gimp_drawable_height (drawable) - ABS (offset_y), + TRUE); color_region (&destPR, fill); } @@ -431,11 +458,18 @@ offset (GimpImage *gimage, if (offset_y != 0) { if (offset_x >= 0) - pixel_region_init (&destPR, new_tiles, dest_x + offset_x, dest_y, - drawable_width (drawable) - ABS (offset_x), ABS (offset_y), TRUE); + pixel_region_init (&destPR, new_tiles, + dest_x + offset_x, + dest_y, + gimp_drawable_width (drawable) - ABS (offset_x), + ABS (offset_y), + TRUE); else if (offset_x < 0) - pixel_region_init (&destPR, new_tiles, 0, dest_y, - drawable_width (drawable) - ABS (offset_x), ABS (offset_y), TRUE); + pixel_region_init (&destPR, new_tiles, + 0, dest_y, + gimp_drawable_width (drawable) - ABS (offset_x), + ABS (offset_y), + TRUE); color_region (&destPR, fill); } @@ -443,8 +477,9 @@ offset (GimpImage *gimage, /* push an undo */ drawable_apply_image (drawable, 0, 0, - drawable_width (drawable), drawable_height (drawable), - drawable_data (drawable), FALSE); + gimp_drawable_width (drawable), + gimp_drawable_height (drawable), + gimp_drawable_data (drawable), FALSE); /* swap the tiles */ drawable->tiles = new_tiles; @@ -452,7 +487,8 @@ offset (GimpImage *gimage, /* update the drawable */ drawable_update (drawable, 0, 0, - drawable_width (drawable), drawable_height (drawable)); + gimp_drawable_width (drawable), + gimp_drawable_height (drawable)); } /* @@ -473,7 +509,7 @@ offset_ok_callback (GtkWidget *widget, if ((gimage = off_d->gimage) != NULL) { - drawable = gimage_active_drawable (gimage); + drawable = gimp_image_active_drawable (gimage); offset_x = (gint) RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 0)); @@ -505,7 +541,7 @@ offset_halfheight_callback (GtkWidget *widget, gpointer data) { OffsetDialog *off_d; - GImage *gimage; + GImage *gimage; off_d = (OffsetDialog *) data; gimage = off_d->gimage; @@ -519,27 +555,27 @@ offset_halfheight_callback (GtkWidget *widget, GimpImage * duplicate (GimpImage *gimage) { - PixelRegion srcPR, destPR; - GimpImage *new_gimage; - Layer *layer, *new_layer; - Layer *floating_layer; - Channel *channel, *new_channel; - GSList *list; - GList *glist; - Guide *guide = NULL; - Layer *active_layer = NULL; - Channel *active_channel = NULL; + PixelRegion srcPR, destPR; + GimpImage *new_gimage; + Layer *layer, *new_layer; + Layer *floating_layer; + Channel *channel, *new_channel; + GSList *list; + GList *glist; + Guide *guide = NULL; + Layer *active_layer = NULL; + Channel *active_channel = NULL; GimpDrawable *new_floating_sel_drawable = NULL; GimpDrawable *floating_sel_drawable = NULL; ParasiteList *parasites; - PathList *paths; - gint count; + PathList *paths; + gint count; gimp_add_busy_cursors_until_idle (); /* Create a new image */ new_gimage = gimage_new (gimage->width, gimage->height, gimage->base_type); - gimage_disable_undo (new_gimage); + gimp_image_undo_disable (new_gimage); /* Copy resolution and unit information */ new_gimage->xresolution = gimage->xresolution; @@ -547,7 +583,7 @@ duplicate (GimpImage *gimage) new_gimage->unit = gimage->unit; /* Copy floating layer */ - floating_layer = gimage_floating_sel (gimage); + floating_layer = gimp_image_floating_sel (gimage); if (floating_layer) { floating_sel_relax (floating_layer, FALSE); @@ -591,7 +627,7 @@ duplicate (GimpImage *gimage) /* Add the layer */ if (floating_layer != new_layer) - gimage_add_layer (new_gimage, new_layer, count++); + gimp_image_add_layer (new_gimage, new_layer, count++); } /* Copy the channels */ @@ -617,13 +653,13 @@ duplicate (GimpImage *gimage) new_floating_sel_drawable = GIMP_DRAWABLE(new_channel); /* Add the channel */ - gimage_add_channel (new_gimage, new_channel, count++); + gimp_image_add_channel (new_gimage, new_channel, count++); } /* Copy the selection mask */ - pixel_region_init (&srcPR, drawable_data (GIMP_DRAWABLE(gimage->selection_mask)), + pixel_region_init (&srcPR, gimp_drawable_data (GIMP_DRAWABLE (gimage->selection_mask)), 0, 0, gimage->width, gimage->height, FALSE); - pixel_region_init (&destPR, drawable_data (GIMP_DRAWABLE(new_gimage->selection_mask)), + pixel_region_init (&destPR, gimp_drawable_data (GIMP_DRAWABLE (new_gimage->selection_mask)), 0, 0, gimage->width, gimage->height, TRUE); copy_region (&srcPR, &destPR); new_gimage->selection_mask->bounds_known = FALSE; @@ -700,7 +736,7 @@ duplicate (GimpImage *gimage) gimp_image_set_paths (new_gimage, new_paths); } - gimage_enable_undo (new_gimage); + gimp_image_undo_enable (new_gimage); return new_gimage; } @@ -708,8 +744,9 @@ duplicate (GimpImage *gimage) #ifdef I_LIKE_BOGUS_CRAP static void -duplicate_projection (GimpImage *oldgimage, GimpImage *newgimage, - GDisplay *newgdisplay) +duplicate_projection (GimpImage *oldgimage, + GimpImage *newgimage, + GDisplay *newgdisplay) { PixelRegion srcPR, destPR; diff --git a/app/gimpimage.c b/app/gimpimage.c index b5c83f7333..1b8a798b66 100644 --- a/app/gimpimage.c +++ b/app/gimpimage.c @@ -24,24 +24,26 @@ #include "apptypes.h" +#include "channel.h" #include "cursorutil.h" #include "drawable.h" #include "floating_sel.h" #include "gdisplay.h" #include "gimage_mask.h" #include "gimpcontext.h" -#include "paint_funcs.h" -#include "parasitelist.h" -#include "undo.h" +#include "gimpimage.h" +#include "gimprc.h" #include "gimpsignal.h" #include "gimpparasite.h" +#include "layer.h" +#include "paint_funcs.h" +#include "parasitelist.h" #include "path.h" -#include "gimprc.h" - +#include "pixel_region.h" +#include "temp_buf.h" #include "tile_manager.h" #include "tile.h" -#include "layer_pvt.h" -#include "drawable_pvt.h" /* ick ick. */ +#include "undo.h" #include "libgimp/gimpcolorspace.h" #include "libgimp/gimplimits.h" @@ -656,7 +658,7 @@ gimp_image_scale (GimpImage *gimage, for (list = remove; list; list = g_slist_next (list)) { layer = list->data; - gimage_remove_layer (gimage, layer); + gimp_image_remove_layer (gimage, layer); } g_slist_free (remove); @@ -3117,7 +3119,7 @@ gimp_image_remove_layer (GimpImage *gimage, if (gimage->active_layer == layer) { if (gimage->layers) - gimage_set_active_layer (gimage, gimage->layer_stack->data); + gimp_image_set_active_layer (gimage, gimage->layer_stack->data); else gimage->active_layer = NULL; } diff --git a/app/gimpimage.h b/app/gimpimage.h index 40164882b9..7663816033 100644 --- a/app/gimpimage.h +++ b/app/gimpimage.h @@ -1,5 +1,5 @@ /* The GIMP -- an image manipulation program - * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * Copyright (C) 1995 Spencer Kimball and Peter Mattisbvf * * 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 @@ -16,29 +16,14 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __GIMPIMAGE_H__ -#define __GIMPIMAGE_H__ - -#include "apptypes.h" -#include "procedural_db.h" -#include "boundary.h" -#include "drawable.h" -#include "channel.h" -#include "layer.h" -#include "plug_in.h" -#include "temp_buf.h" -#include "tile_manager.h" -#include "path.h" - -#include "libgimp/gimpparasite.h" -#include "libgimp/gimpunit.h" +#ifndef __GIMP_IMAGE_H__ +#define __GIMP_IMAGE_H__ -#define GIMP_TYPE_IMAGE gimp_image_get_type() -#define GIMP_IMAGE(obj) GTK_CHECK_CAST (obj, GIMP_TYPE_IMAGE, GimpImage) -#define GIMP_IS_IMAGE(obj) GTK_CHECK_TYPE (obj, GIMP_TYPE_IMAGE) - -#define GIMP_IMAGE_TYPE_HAS_ALPHA(t) ((t)==RGBA_GIMAGE || (t)==GRAYA_GIMAGE || (t)==INDEXEDA_GIMAGE) +#include "gimpobject.h" + + +#define MAX_CHANNELS 4 #define GRAY_PIX 0 #define ALPHA_G_PIX 1 @@ -51,19 +36,104 @@ #define COLORMAP_SIZE 768 -typedef enum /*< skip >*/ -{ - ORIENTATION_UNKNOWN, - ORIENTATION_HORIZONTAL, - ORIENTATION_VERTICAL -} InternalOrientationType; -typedef enum +#define GIMP_TYPE_IMAGE (gimp_image_get_type ()) +#define GIMP_IMAGE(obj) (GTK_CHECK_CAST (obj, GIMP_TYPE_IMAGE, GimpImage)) +#define GIMP_IS_IMAGE(obj) (GTK_CHECK_TYPE (obj, GIMP_TYPE_IMAGE)) +#define GIMP_IMAGE_CLASS(klass) (GTK_CHECK_CLASS_CAST (klass, GIMP_TYPE_IMAGE, GimpImageClass)) + +typedef struct _GimpImageClass GimpImageClass; + +struct _GimpImage { - HORIZONTAL, - VERTICAL, - UNKNOWN -} OrientationType; + GimpObject gobject; + + gchar *filename; /* original filename */ + gboolean has_filename; /* has a valid filename */ + PlugInProcDef *save_proc; /* last PDB save proc used */ + + gint width, height; /* width and height attributes */ + gdouble xresolution; /* image x-res, in dpi */ + gdouble yresolution; /* image y-res, in dpi */ + GimpUnit unit; /* image unit */ + GimpImageBaseType base_type; /* base gimp_image type */ + + guchar *cmap; /* colormap--for indexed */ + gint num_cols; /* number of cols--for indexed */ + + gint dirty; /* dirty flag -- # of ops */ + gboolean undo_on; /* Is undo enabled? */ + + gint instance_count; /* number of instances */ + gint disp_count; /* number of displays */ + + Tattoo tattoo_state; /* the next unique tattoo to use*/ + + TileManager *shadow; /* shadow buffer tiles */ + + /* Projection attributes */ + gint construct_flag; /* flag for construction */ + GimpImageType proj_type; /* type of the projection image */ + gint proj_bytes; /* bpp in projection image */ + gint proj_level; /* projection level */ + TileManager *projection; /* The projection--layers & */ + /* channels */ + + GList *guides; /* guides */ + + /* Layer/Channel attributes */ + GSList *layers; /* the list of layers */ + GSList *channels; /* the list of masks */ + GSList *layer_stack; /* the layers in MRU order */ + + Layer *active_layer; /* ID of active layer */ + Channel *active_channel; /* ID of active channel */ + Layer *floating_sel; /* ID of fs layer */ + Channel *selection_mask; /* selection mask channel */ + + ParasiteList *parasites; /* Plug-in parasite data */ + + PathList *paths; /* Paths data for this image */ + + gboolean visible[MAX_CHANNELS]; /* visible channels */ + gboolean active[MAX_CHANNELS]; /* active channels */ + + gboolean by_color_select; /* TRUE if there's an active */ + /* "by color" selection dialog */ + + gboolean qmask_state; /* TRUE if qmask is on */ + gdouble qmask_opacity; /* opacity of the qmask channel */ + guchar qmask_color[3]; /* rgb triplet of the color */ + + /* Undo apparatus */ + GSList *undo_stack; /* stack for undo operations */ + GSList *redo_stack; /* stack for redo operations */ + gint undo_bytes; /* bytes in undo stack */ + gint undo_levels; /* levels in undo stack */ + gint group_count; /* nested undo groups */ + UndoType pushing_undo_group; /* undo group status flag */ + GtkWidget *undo_history; /* history viewer, or NULL */ + + /* Composite preview */ + TempBuf *comp_preview; /* the composite preview */ + gboolean comp_preview_valid[3]; /* preview valid-1/channel */ +}; + +struct _GimpImageClass +{ + GimpObjectClass parent_class; + + void (* clean) (GimpImage *gimage); + void (* dirty) (GimpImage *gimage); + void (* repaint) (GimpImage *gimage); + void (* rename) (GimpImage *gimage); + void (* resize) (GimpImage *gimage); + void (* restructure) (GimpImage *gimage); + void (* colormap_changed) (GimpImage *gimage); + void (* undo_event) (GimpImage *gimage); +}; + +#define GIMP_IMAGE_TYPE_HAS_ALPHA(t) ((t)==RGBA_GIMAGE || (t)==GRAYA_GIMAGE || (t)==INDEXEDA_GIMAGE) typedef enum { @@ -374,4 +444,4 @@ TempBuf * gimp_image_construct_composite_preview (GimpImage *gimage, gint width, gint height); -#endif /* __GIMPIMAGE_H__ */ +#endif /* __GIMP_IMAGE_H__ */ diff --git a/app/gimpimageP.h b/app/gimpimageP.h deleted file mode 100644 index b62208e02c..0000000000 --- a/app/gimpimageP.h +++ /dev/null @@ -1,131 +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 __GIMP_IMAGE_P_H__ -#define __GIMP_IMAGE_P_H__ - - -#include /* eeeek */ - -#include "gimpobject.h" -#include "gimpimage.h" - -#include "tile_manager.h" -#include "temp_buf.h" -#include "channel.h" -#include "layer.h" -#include "path.h" -#include "undo_types.h" - - -#define MAX_CHANNELS 4 - -#define GIMP_IMAGE_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, GIMP_TYPE_IMAGE, GimpImageClass) - -typedef struct _GimpImageClass GimpImageClass; - -struct _GimpImage -{ - GimpObject gobject; - - gchar *filename; /* original filename */ - gboolean has_filename; /* has a valid filename */ - PlugInProcDef *save_proc; /* last PDB save proc used */ - - gint width, height; /* width and height attributes */ - gdouble xresolution; /* image x-res, in dpi */ - gdouble yresolution; /* image y-res, in dpi */ - GimpUnit unit; /* image unit */ - GimpImageBaseType base_type; /* base gimp_image type */ - - guchar *cmap; /* colormap--for indexed */ - gint num_cols; /* number of cols--for indexed */ - - gint dirty; /* dirty flag -- # of ops */ - gboolean undo_on; /* Is undo enabled? */ - - gint instance_count; /* number of instances */ - gint disp_count; /* number of displays */ - - Tattoo tattoo_state; /* the next unique tattoo to use*/ - - TileManager *shadow; /* shadow buffer tiles */ - - /* Projection attributes */ - gint construct_flag; /* flag for construction */ - GimpImageType proj_type; /* type of the projection image */ - gint proj_bytes; /* bpp in projection image */ - gint proj_level; /* projection level */ - TileManager *projection; /* The projection--layers & */ - /* channels */ - - GList *guides; /* guides */ - - /* Layer/Channel attributes */ - GSList *layers; /* the list of layers */ - GSList *channels; /* the list of masks */ - GSList *layer_stack; /* the layers in MRU order */ - - Layer *active_layer; /* ID of active layer */ - Channel *active_channel; /* ID of active channel */ - Layer *floating_sel; /* ID of fs layer */ - Channel *selection_mask; /* selection mask channel */ - - ParasiteList *parasites; /* Plug-in parasite data */ - - PathList *paths; /* Paths data for this image */ - - gboolean visible[MAX_CHANNELS]; /* visible channels */ - gboolean active[MAX_CHANNELS]; /* active channels */ - - gboolean by_color_select; /* TRUE if there's an active */ - /* "by color" selection dialog */ - - gboolean qmask_state; /* TRUE if qmask is on */ - gdouble qmask_opacity; /* opacity of the qmask channel */ - guchar qmask_color[3]; /* rgb triplet of the color */ - - /* Undo apparatus */ - GSList *undo_stack; /* stack for undo operations */ - GSList *redo_stack; /* stack for redo operations */ - gint undo_bytes; /* bytes in undo stack */ - gint undo_levels; /* levels in undo stack */ - gint group_count; /* nested undo groups */ - UndoType pushing_undo_group; /* undo group status flag */ - GtkWidget *undo_history; /* history viewer, or NULL */ - - /* Composite preview */ - TempBuf *comp_preview; /* the composite preview */ - gboolean comp_preview_valid[3]; /* preview valid-1/channel */ -}; - -struct _GimpImageClass -{ - GimpObjectClass parent_class; - - void (* clean) (GimpImage *gimage); - void (* dirty) (GimpImage *gimage); - void (* repaint) (GimpImage *gimage); - void (* rename) (GimpImage *gimage); - void (* resize) (GimpImage *gimage); - void (* restructure) (GimpImage *gimage); - void (* colormap_changed) (GimpImage *gimage); - void (* undo_event) (GimpImage *gimage); -}; - -#endif /* __GIMP_IMAGE_P_H__ */ diff --git a/app/gimplayer.c b/app/gimplayer.c index 2efcb7e6ac..58e99a0651 100644 --- a/app/gimplayer.c +++ b/app/gimplayer.c @@ -23,24 +23,26 @@ #include #include -#include +#include +#include "apptypes.h" + +#include "boundary.h" #include "drawable.h" #include "floating_sel.h" #include "gdisplay.h" -#include "gimage.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "layer.h" #include "paint_funcs.h" +#include "pixel_region.h" #include "temp_buf.h" #include "parasitelist.h" #include "undo.h" #include "gimpsignal.h" #include "gimppreviewcache.h" - -#include "layer_pvt.h" -#include "tile_manager_pvt.h" -#include "tile.h" /* ick. */ +#include "tile_manager.h" +#include "tile.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpparasite.h" @@ -242,9 +244,9 @@ transform_color (GImage *gimage, { for (i = 0; i < layerPR->w; i++) { - gimage_transform_color (gimage, drawable, - s + (i * bufPR->bytes), - d + (i * layerPR->bytes), type); + gimp_image_transform_color (gimage, drawable, + s + (i * bufPR->bytes), + d + (i * layerPR->bytes), type); /* copy alpha channel */ d[(i + 1) * layerPR->bytes - 1] = s[(i + 1) * bufPR->bytes - 1]; } @@ -449,7 +451,9 @@ layer_new_from_tiles (GimpImage *gimage, g_return_val_if_fail (GIMP_IMAGE_TYPE_HAS_ALPHA (layer_type), NULL); /* Create the new layer */ - new_layer = layer_new (0, tiles->width, tiles->height, + new_layer = layer_new (0, + tile_manager_level_width (tiles), + tile_manager_level_height (tiles), layer_type, name, opacity, mode); if (!new_layer) @@ -467,17 +471,19 @@ layer_new_from_tiles (GimpImage *gimage, pixel_region_init (&bufPR, tiles, 0, 0, GIMP_DRAWABLE (new_layer)->width, - GIMP_DRAWABLE (new_layer)->height, + GIMP_DRAWABLE (new_layer)->height, FALSE); - if ((tiles->bpp == 4 && GIMP_DRAWABLE (new_layer)->type == RGBA_GIMAGE) || - (tiles->bpp == 2 && GIMP_DRAWABLE (new_layer)->type == GRAYA_GIMAGE)) + if ((tile_manager_level_bpp (tiles) == 4 && + GIMP_DRAWABLE (new_layer)->type == RGBA_GIMAGE) || + (tile_manager_level_bpp (tiles) == 2 && + GIMP_DRAWABLE (new_layer)->type == GRAYA_GIMAGE)) /* If we want a layer the same type as the buffer */ copy_region (&bufPR, &layerPR); else /* Transform the contents of the buf to the new_layer */ transform_color (gimage, &layerPR, &bufPR, GIMP_DRAWABLE (new_layer), - (tiles->bpp == 4) ? RGB : GRAY); + (tile_manager_level_bpp (tiles) == 4) ? RGB : GRAY); return new_layer; } @@ -1069,8 +1075,8 @@ layer_resize (Layer *layer, else { unsigned char bg[3]; - gimage_get_background (GIMP_DRAWABLE(layer)->gimage, - GIMP_DRAWABLE(layer), bg); + gimp_image_get_background (GIMP_DRAWABLE (layer)->gimage, + GIMP_DRAWABLE (layer), bg); color_region (&destPR, bg); } pixel_region_init (&destPR, new_tiles, @@ -1160,28 +1166,28 @@ layer_boundary (Layer *layer, layer = GIMP_LAYER (layer->fs.drawable); } - new_segs[0].x1 = GIMP_DRAWABLE(layer)->offset_x; - new_segs[0].y1 = GIMP_DRAWABLE(layer)->offset_y; - new_segs[0].x2 = GIMP_DRAWABLE(layer)->offset_x; - new_segs[0].y2 = GIMP_DRAWABLE(layer)->offset_y + GIMP_DRAWABLE(layer)->height; + new_segs[0].x1 = GIMP_DRAWABLE (layer)->offset_x; + new_segs[0].y1 = GIMP_DRAWABLE (layer)->offset_y; + new_segs[0].x2 = GIMP_DRAWABLE (layer)->offset_x; + new_segs[0].y2 = GIMP_DRAWABLE (layer)->offset_y + GIMP_DRAWABLE (layer)->height; new_segs[0].open = 1; - new_segs[1].x1 = GIMP_DRAWABLE(layer)->offset_x; - new_segs[1].y1 = GIMP_DRAWABLE(layer)->offset_y; - new_segs[1].x2 = GIMP_DRAWABLE(layer)->offset_x + GIMP_DRAWABLE(layer)->width; - new_segs[1].y2 = GIMP_DRAWABLE(layer)->offset_y; + new_segs[1].x1 = GIMP_DRAWABLE (layer)->offset_x; + new_segs[1].y1 = GIMP_DRAWABLE (layer)->offset_y; + new_segs[1].x2 = GIMP_DRAWABLE (layer)->offset_x + GIMP_DRAWABLE (layer)->width; + new_segs[1].y2 = GIMP_DRAWABLE (layer)->offset_y; new_segs[1].open = 1; - new_segs[2].x1 = GIMP_DRAWABLE(layer)->offset_x + GIMP_DRAWABLE(layer)->width; - new_segs[2].y1 = GIMP_DRAWABLE(layer)->offset_y; - new_segs[2].x2 = GIMP_DRAWABLE(layer)->offset_x + GIMP_DRAWABLE(layer)->width; - new_segs[2].y2 = GIMP_DRAWABLE(layer)->offset_y + GIMP_DRAWABLE(layer)->height; + new_segs[2].x1 = GIMP_DRAWABLE (layer)->offset_x + GIMP_DRAWABLE (layer)->width; + new_segs[2].y1 = GIMP_DRAWABLE (layer)->offset_y; + new_segs[2].x2 = GIMP_DRAWABLE (layer)->offset_x + GIMP_DRAWABLE (layer)->width; + new_segs[2].y2 = GIMP_DRAWABLE (layer)->offset_y + GIMP_DRAWABLE (layer)->height; new_segs[2].open = 0; - new_segs[3].x1 = GIMP_DRAWABLE(layer)->offset_x; - new_segs[3].y1 = GIMP_DRAWABLE(layer)->offset_y + GIMP_DRAWABLE(layer)->height; - new_segs[3].x2 = GIMP_DRAWABLE(layer)->offset_x + GIMP_DRAWABLE(layer)->width; - new_segs[3].y2 = GIMP_DRAWABLE(layer)->offset_y + GIMP_DRAWABLE(layer)->height; + new_segs[3].x1 = GIMP_DRAWABLE (layer)->offset_x; + new_segs[3].y1 = GIMP_DRAWABLE (layer)->offset_y + GIMP_DRAWABLE (layer)->height; + new_segs[3].x2 = GIMP_DRAWABLE (layer)->offset_x + GIMP_DRAWABLE (layer)->width; + new_segs[3].y2 = GIMP_DRAWABLE (layer)->offset_y + GIMP_DRAWABLE (layer)->height; new_segs[3].open = 0; return new_segs; @@ -1190,7 +1196,7 @@ layer_boundary (Layer *layer, void layer_invalidate_boundary (Layer *layer) { - GImage *gimage; + GImage *gimage; Channel *mask; /* first get the selection mask channel */ @@ -1203,7 +1209,7 @@ layer_invalidate_boundary (Layer *layer) /* clear the affected region surrounding the layer */ gdisplays_selection_visibility (gimage, SelectionLayerOff); - mask = gimage_get_mask (gimage); + mask = gimp_image_get_mask (gimage); /* Only bother with the bounds if there is a selection */ if (! channel_is_empty (mask)) diff --git a/app/gimplayer.h b/app/gimplayer.h index 0670f80fb2..80a5865fb5 100644 --- a/app/gimplayer.h +++ b/app/gimplayer.h @@ -19,16 +19,11 @@ #ifndef __LAYER_H__ #define __LAYER_H__ -#include "apptypes.h" -#include "drawable.h" -#include "boundary.h" + #include "channel.h" -#include "temp_buf.h" -#include "tile_manager.h" +#include "gimpdrawable.h" -/* structure declarations */ - #define GIMP_TYPE_LAYER (gimp_layer_get_type ()) #define GIMP_LAYER(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_LAYER, GimpLayer)) #define GIMP_LAYER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LAYER, GimpLayerClass)) @@ -41,8 +36,53 @@ #define GIMP_IS_LAYER_MASK(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_LAYER_MASK)) #define GIMP_IS_LAYER_MASK_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_LAYER_MASK)) -GtkType gimp_layer_get_type (void); -GtkType gimp_layer_mask_get_type (void); + +struct _GimpLayer +{ + GimpDrawable drawable; + + gboolean linked; /* control linkage */ + gboolean preserve_trans; /* preserve transparency */ + + LayerMask *mask; /* possible layer mask */ + gint apply_mask; /* controls mask application */ + gboolean edit_mask; /* edit mask or layer? */ + gboolean show_mask; /* show mask or layer? */ + + gint opacity; /* layer opacity */ + LayerModeEffects mode; /* layer combination mode */ + + /* Floating selections */ + struct + { + TileManager *backing_store; /* for obscured regions */ + GimpDrawable *drawable; /* floating sel is attached to */ + gboolean initial; /* is fs composited yet? */ + + gboolean boundary_known; /* is the current boundary valid */ + BoundSeg *segs; /* boundary of floating sel */ + gint num_segs; /* number of segs in boundary */ + } fs; +}; + +struct _GimpLayerClass +{ + GimpDrawableClass parent_class; + + void (* removed) (GimpLayer *layer); +}; + +struct _GimpLayerMask +{ + GimpChannel drawable; + + Layer *layer; +}; + +struct _GimpLayerMaskClass +{ + GimpChannelClass parent_class; +}; /* Special undo types */ @@ -71,6 +111,8 @@ struct _fs_to_layer_undo /* function declarations */ +GtkType gimp_layer_get_type (void); + Layer * layer_new (GimpImage *gimage, gint width, gint height, @@ -124,6 +166,9 @@ gint layer_pick_correlate (Layer *layer, gint x, gint y); + +GtkType gimp_layer_mask_get_type (void); + LayerMask * layer_mask_new (GimpImage *gimage, gint width, gint height, diff --git a/app/gimplut.c b/app/gimplut.c index 62e90def8d..7bca4744db 100644 --- a/app/gimplut.c +++ b/app/gimplut.c @@ -27,67 +27,73 @@ #include "apptypes.h" #include "gimplut.h" +#include "pixel_region.h" GimpLut * -gimp_lut_new () +gimp_lut_new (void) { GimpLut *lut; - lut = g_new(GimpLut, 1); - lut->luts = NULL; + + lut = g_new (GimpLut, 1); + + lut->luts = NULL; lut->nchannels = 0; + return lut; } void gimp_lut_free (GimpLut *lut) { - int i; + gint i; + for (i = 0; i < lut->nchannels; i++) - g_free(lut->luts[i]); - if (lut->luts) - g_free(lut->luts); + g_free (lut->luts[i]); + g_free (lut->luts); } void gimp_lut_setup (GimpLut *lut, GimpLutFunc func, void *user_data, - int nchannels) + gint nchannels) { - int i, v; - double val; + gint i, v; + gdouble val; + if (lut->luts) - { - for (i = 0; i < lut->nchannels; i++) - g_free(lut->luts[i]); - g_free(lut->luts); - } - lut->nchannels = nchannels; - lut->luts = g_new(unsigned char*, lut->nchannels); - for (i = 0; i < lut->nchannels; i++) - { - lut->luts[i] = g_new(unsigned char, 256); - for (v = 0; v < 256; v++) - { /* to add gamma correction use func(v ^ g) ^ 1/g instead. */ - val = 255.0 * func(user_data, lut->nchannels, i, v/255.0) + 0.5; - if (val < 0.0) - lut->luts[i][v] = 0; - else if (val >= 255.0) - lut->luts[i][v] = 255; - else - lut->luts[i][v] = val; + { + for (i = 0; i < lut->nchannels; i++) + g_free (lut->luts[i]); + g_free (lut->luts); + } + lut->nchannels = nchannels; + lut->luts = g_new (guchar*, lut->nchannels); + + for (i = 0; i < lut->nchannels; i++) + { + lut->luts[i] = g_new (guchar, 256); + for (v = 0; v < 256; v++) + { /* to add gamma correction use func(v ^ g) ^ 1/g instead. */ + val = 255.0 * func (user_data, lut->nchannels, i, v/255.0) + 0.5; + if (val < 0.0) + lut->luts[i][v] = 0; + else if (val >= 255.0) + lut->luts[i][v] = 255; + else + lut->luts[i][v] = val; + } } - } } void gimp_lut_setup_exact (GimpLut *lut, GimpLutFunc func, void *user_data, - int nchannels) + gint nchannels) { - gimp_lut_setup(lut, func, user_data, nchannels); + gimp_lut_setup (lut, func, user_data, nchannels); } void @@ -95,9 +101,9 @@ gimp_lut_process (GimpLut *lut, PixelRegion *srcPR, PixelRegion *destPR) { - int h, width, src_r_i, dest_r_i; - unsigned char *src, *dest; - unsigned char *lut0 = NULL, *lut1 = NULL, *lut2 = NULL, *lut3 = NULL; + gint h, width, src_r_i, dest_r_i; + guchar *src, *dest; + guchar *lut0 = NULL, *lut1 = NULL, *lut2 = NULL, *lut3 = NULL; if (lut->nchannels > 0) lut0 = lut->luts[0]; @@ -116,68 +122,70 @@ gimp_lut_process (GimpLut *lut, dest_r_i = destPR->rowstride - (destPR->bytes * srcPR->w); if (src_r_i == 0 && dest_r_i == 0) - { - width *= h; - h = 1; - } - while (h--) - { - switch (lut->nchannels) { - case 1: - while (width--) - { - *dest = lut0[*src]; - src++; - dest++; - } - break; - case 2: - while (width--) - { - dest[0] = lut0[src[0]]; - dest[1] = lut1[src[1]]; - src += 2; - dest += 2; - } - break; - case 3: - while (width--) - { - dest[0] = lut0[src[0]]; - dest[1] = lut1[src[1]]; - dest[2] = lut2[src[2]]; - src += 3; - dest += 3; - } - break; - case 4: - while (width--) - { - dest[0] = lut0[src[0]]; - dest[1] = lut1[src[1]]; - dest[2] = lut2[src[2]]; - dest[3] = lut3[src[3]]; - src += 4; - dest += 4; - } - break; - default: - fprintf(stderr, "gimplut: Error: nchannels = %d\n", lut->nchannels); + width *= h; + h = 1; + } + + while (h--) + { + switch (lut->nchannels) + { + case 1: + while (width--) + { + *dest = lut0[*src]; + src++; + dest++; + } + break; + case 2: + while (width--) + { + dest[0] = lut0[src[0]]; + dest[1] = lut1[src[1]]; + src += 2; + dest += 2; + } + break; + case 3: + while (width--) + { + dest[0] = lut0[src[0]]; + dest[1] = lut1[src[1]]; + dest[2] = lut2[src[2]]; + src += 3; + dest += 3; + } + break; + case 4: + while (width--) + { + dest[0] = lut0[src[0]]; + dest[1] = lut1[src[1]]; + dest[2] = lut2[src[2]]; + dest[3] = lut3[src[3]]; + src += 4; + dest += 4; + } + break; + default: + g_warning ("gimplut: Error: nchannels = %d\n", lut->nchannels); + } + + width = srcPR->w; + src += src_r_i; + dest += dest_r_i; } - width = srcPR->w; - src += src_r_i; - dest += dest_r_i; - } } void gimp_lut_process_inline (GimpLut *lut, PixelRegion *srcPR) { - int h, width, src_r_i; - unsigned char *src; - unsigned char *lut0 = NULL, *lut1 = NULL, *lut2 = NULL, *lut3 = NULL; + gint h, width, src_r_i; + guchar *src; + guchar *lut0 = NULL, *lut1 = NULL, *lut2 = NULL, *lut3 = NULL; if (lut->nchannels > 0) lut0 = lut->luts[0]; @@ -194,54 +202,55 @@ gimp_lut_process_inline (GimpLut *lut, src_r_i = srcPR->rowstride - (srcPR->bytes * srcPR->w); if (src_r_i == 0) - { - width *= h; - h = 1; - } - while (h--) - { - switch (lut->nchannels) { - case 1: - while (width--) - { - *src = lut0[*src]; - src++; - } - break; - case 2: - while (width--) - { - src[0] = lut0[src[0]]; - src[1] = lut1[src[1]]; - src += 2; - } - break; - case 3: - while (width--) - { - src[0] = lut0[src[0]]; - src[1] = lut1[src[1]]; - src[2] = lut2[src[2]]; - src += 3; - } - break; - case 4: - while (width--) - { - src[0] = lut0[src[0]]; - src[1] = lut1[src[1]]; - src[2] = lut2[src[2]]; - src[3] = lut3[src[3]]; - src += 4; - } - break; - default: - fprintf(stderr, "gimplut: Error: nchannels = %d\n", lut->nchannels); + width *= h; + h = 1; + } + + while (h--) + { + switch (lut->nchannels) + { + case 1: + while (width--) + { + *src = lut0[*src]; + src++; + } + break; + case 2: + while (width--) + { + src[0] = lut0[src[0]]; + src[1] = lut1[src[1]]; + src += 2; + } + break; + case 3: + while (width--) + { + src[0] = lut0[src[0]]; + src[1] = lut1[src[1]]; + src[2] = lut2[src[2]]; + src += 3; + } + break; + case 4: + while (width--) + { + src[0] = lut0[src[0]]; + src[1] = lut1[src[1]]; + src[2] = lut2[src[2]]; + src[3] = lut3[src[3]]; + src += 4; + } + break; + default: + g_warning ("gimplut: Error: nchannels = %d\n", lut->nchannels); + } + width = srcPR->w; + src += src_r_i; } - width = srcPR->w; - src += src_r_i; - } } void @@ -249,5 +258,5 @@ gimp_lut_process_2 (PixelRegion *srcPR, PixelRegion *destPR, GimpLut *lut) { - gimp_lut_process(lut, srcPR, destPR); + gimp_lut_process (lut, srcPR, destPR); } diff --git a/app/gimplut.h b/app/gimplut.h index a8b206a5b4..24f31ccf2f 100644 --- a/app/gimplut.h +++ b/app/gimplut.h @@ -22,9 +22,6 @@ #define __GIMP_LUT_H__ -#include "pixel_region.h" - - struct _GimpLut { guchar **luts; diff --git a/app/gimpobject.h b/app/gimpobject.h index f5e2736195..d38d933648 100644 --- a/app/gimpobject.h +++ b/app/gimpobject.h @@ -20,24 +20,26 @@ #define __GIMP_OBJECT_H__ -#include +#include -#define GIMP_TYPE_OBJECT gimp_object_get_type () -#define GIMP_OBJECT(obj) GTK_CHECK_CAST (obj, GIMP_TYPE_OBJECT, GimpObject) -#define GIMP_IS_OBJECT(obj) GTK_CHECK_TYPE (obj, GIMP_TYPE_OBJECT) -#define GIMP_OBJECT_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, GIMP_TYPE_OBJECT, GimpObjectClass) +#define GIMP_TYPE_OBJECT (gimp_object_get_type ()) +#define GIMP_OBJECT(obj) (GTK_CHECK_CAST (obj, GIMP_TYPE_OBJECT, GimpObject)) +#define GIMP_IS_OBJECT(obj) (GTK_CHECK_TYPE (obj, GIMP_TYPE_OBJECT)) +#define GIMP_OBJECT_CLASS(klass) (GTK_CHECK_CLASS_CAST (klass, GIMP_TYPE_OBJECT, GimpObjectClass)) +typedef struct _GimpObjectClass GimpObjectClass; + struct _GimpObject { GtkObject object; }; -typedef struct +struct _GimpObjectClass { GtkObjectClass parent_class; -} GimpObjectClass; +}; #define GIMP_TYPE_INIT(typevar, obtype, classtype, obinit, classinit, parent) \ diff --git a/app/gimpparasite.h b/app/gimpparasite.h index 9cf21a7d8b..8b7be6d268 100644 --- a/app/gimpparasite.h +++ b/app/gimpparasite.h @@ -14,10 +14,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __APP_GIMP_PARASITE_H__ #define __APP_GIMP_PARASITE_H__ -#include "libgimp/gimpparasite.h" void gimp_init_parasites (void); @@ -30,4 +30,5 @@ gchar ** gimp_parasite_list (gint *count); void gimp_parasiterc_save (void); void gimp_parasiterc_load (void); + #endif /* __APP_GIMP_PARASITE_H__ */ diff --git a/app/gimppreviewcache.c b/app/gimppreviewcache.c index b7ffdf63fd..541d3c2c5e 100644 --- a/app/gimppreviewcache.c +++ b/app/gimppreviewcache.c @@ -18,7 +18,9 @@ #include "config.h" -#include +#include + +#include "apptypes.h" #include "gimppreviewcache.h" diff --git a/app/gimpprogress.c b/app/gimpprogress.c index 31af92ba22..9f93c22f04 100644 --- a/app/gimpprogress.c +++ b/app/gimpprogress.c @@ -30,7 +30,8 @@ #include "libgimp/gimpintl.h" -struct gimp_progress_pvt { +struct gimp_progress_pvt +{ GDisplay *gdisp; /* gdisp in use, or NULL*/ /* next four fields are only valid if gdisp is NULL */ diff --git a/app/gimpprogress.h b/app/gimpprogress.h index 970c5b9893..798a4ee55d 100644 --- a/app/gimpprogress.h +++ b/app/gimpprogress.h @@ -16,11 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __GIMPPROGRESS_H__ -#define __GIMPPROGRESS_H__ - -#include /* eeek */ - +#ifndef __GIMPP_ROGRESS_H__ +#define __GIMPP_ROGRESS_H__ /* Progress bars for use internally by the main GIMP application. */ @@ -28,27 +25,26 @@ /* structures */ struct gimp_progress_pvt; -/* typedefs */ -typedef struct gimp_progress_pvt gimp_progress; -typedef void (*progress_func_t) (gint ymin, gint ymax, gint curr_y, - gpointer progress_data); /* functions */ -gimp_progress * progress_start (GDisplay *, - const gchar *, - gboolean, - GtkSignalFunc, - gpointer); -gimp_progress * progress_restart (gimp_progress *, - const gchar *, - GtkSignalFunc, - gpointer); -void progress_update (gimp_progress *, - float); -void progress_step (gimp_progress *); -void progress_end (gimp_progress *); +gimp_progress * progress_start (GDisplay *, + const gchar *, + gboolean , + GtkSignalFunc , + gpointer ); +gimp_progress * progress_restart (gimp_progress *, + const gchar *, + GtkSignalFunc , + gpointer ); +void progress_update (gimp_progress *, + gfloat ); +void progress_step (gimp_progress *); +void progress_end (gimp_progress *); -void progress_update_and_flush (gint, gint, gint, gpointer); +void progress_update_and_flush (gint , + gint , + gint , + gpointer ); -#endif /* __GIMPPROGRESS_H__ */ +#endif /* __GIMP_PROGRESS_H__ */ diff --git a/app/gimprc.c b/app/gimprc.c index a9417301fb..3ceb1068ad 100644 --- a/app/gimprc.c +++ b/app/gimprc.c @@ -42,6 +42,7 @@ #include "errors.h" #include "fileops.h" #include "general.h" +#include "gimphelp.h" #include "gimpparasite.h" #include "gimprc.h" #include "menus.h" diff --git a/app/gimprc.h b/app/gimprc.h index aefcbf146d..648d4f62f5 100644 --- a/app/gimprc.h +++ b/app/gimprc.h @@ -19,10 +19,6 @@ #ifndef __GIMPRC_H__ #define __GIMPRC_H__ -#include "apptypes.h" - -#include "libgimp/gimpunit.h" - /* global gimprc variables */ extern gchar *plug_in_path; @@ -104,4 +100,5 @@ gchar * gimprc_value_to_str (gchar *name); void save_gimprc_strings (gchar *token, gchar *value); + #endif /* __GIMPRC_H__ */ diff --git a/app/gimprc_cmds.c b/app/gimprc_cmds.c index 3b4474fe4f..9262eb8c1f 100644 --- a/app/gimprc_cmds.c +++ b/app/gimprc_cmds.c @@ -18,6 +18,12 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ +#include "config.h" + + +#include + +#include "apptypes.h" #include "procedural_db.h" #include "gimprc.h" diff --git a/app/gimpset.h b/app/gimpset.h index 8997cb8b59..23e09c276a 100644 --- a/app/gimpset.h +++ b/app/gimpset.h @@ -57,42 +57,45 @@ struct _GimpSetClass { GimpObjectClass parent_class; - void (* add) (GimpSet *gimpset, gpointer object); - void (* remove) (GimpSet *gimpset, gpointer object); - void (* active_changed) (GimpSet *gimpset, gpointer object); + void (* add) (GimpSet *gimpset, + gpointer object); + void (* remove) (GimpSet *gimpset, + gpointer object); + void (* active_changed) (GimpSet *gimpset, + gpointer object); }; typedef guint GimpSetHandlerId; -GtkType gimp_set_get_type (void); -GimpSet * gimp_set_new (GtkType type, - gboolean weak); +GtkType gimp_set_get_type (void); +GimpSet * gimp_set_new (GtkType type, + gboolean weak); -GtkType gimp_set_type (GimpSet *set); +GtkType gimp_set_type (GimpSet *set); -gboolean gimp_set_add (GimpSet *gimpset, - gpointer object); -gboolean gimp_set_remove (GimpSet *gimpset, - gpointer object); +gboolean gimp_set_add (GimpSet *gimpset, + gpointer object); +gboolean gimp_set_remove (GimpSet *gimpset, + gpointer object); -gboolean gimp_set_have (GimpSet *gimpset, - gpointer object); -void gimp_set_foreach (GimpSet *gimpset, - GFunc func, - gpointer user_data); -gint gimp_set_size (GimpSet *gimpset); +gboolean gimp_set_have (GimpSet *gimpset, + gpointer object); +void gimp_set_foreach (GimpSet *gimpset, + GFunc func, + gpointer user_data); +gint gimp_set_size (GimpSet *gimpset); -void gimp_set_set_active (GimpSet *gimpset, - gpointer object); -gpointer gimp_set_get_active (GimpSet *gimpset); +void gimp_set_set_active (GimpSet *gimpset, + gpointer object); +gpointer gimp_set_get_active (GimpSet *gimpset); -GimpSetHandlerId gimp_set_add_handler (GimpSet *set, - const gchar *signame, - GtkSignalFunc handler, - gpointer user_data); -void gimp_set_remove_handler (GimpSet *set, - GimpSetHandlerId id); +GimpSetHandlerId gimp_set_add_handler (GimpSet *set, + const gchar *signame, + GtkSignalFunc handler, + gpointer user_data); +void gimp_set_remove_handler (GimpSet *set, + GimpSetHandlerId id); #endif /* __GIMP_SET_H__ */ diff --git a/app/gimpui.c b/app/gimpui.c index d0d20866c1..10428166a4 100644 --- a/app/gimpui.c +++ b/app/gimpui.c @@ -25,8 +25,12 @@ #include +#include "apptypes.h" + #include "gimpui.h" +#include "libgimp/gimphelpui.h" + #include "libgimp/gimpintl.h" diff --git a/app/gimpui.h b/app/gimpui.h index 6dbee9c5c9..dcad168d00 100644 --- a/app/gimpui.h +++ b/app/gimpui.h @@ -22,11 +22,11 @@ #ifndef __GIMP_UI_H__ #define __GIMP_UI_H__ -#include "gimphelp.h" #include "libgimp/gimpchainbutton.h" #include "libgimp/gimpdialog.h" #include "libgimp/gimpfileselection.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimppixmap.h" #include "libgimp/gimppatheditor.h" #include "libgimp/gimpquerybox.h" @@ -42,4 +42,5 @@ void gimp_message_box (gchar *message, void gimp_dialog_hide (GtkWidget *dialog); + #endif /* __GIMP_UI_H__ */ diff --git a/app/gimpunit.c b/app/gimpunit.c index b09350fe07..90f3b55641 100644 --- a/app/gimpunit.c +++ b/app/gimpunit.c @@ -26,10 +26,12 @@ #include -#include "unitrc.h" +#include "apptypes.h" #include "app_procs.h" #include "gimprc.h" +#include "unitrc.h" + /* NOTE: * diff --git a/app/global_edit.c b/app/global_edit.c index 730bb6390e..6ef4bf7fd1 100644 --- a/app/global_edit.c +++ b/app/global_edit.c @@ -20,7 +20,7 @@ #include -#include +#include #include "apptypes.h" @@ -31,17 +31,20 @@ #include "gdisplay.h" #include "gimage.h" #include "gimage_mask.h" +#include "gimpcontext.h" #include "gimpui.h" #include "global_edit.h" #include "layer.h" #include "paint_funcs.h" +#include "pixel_region.h" +#include "tile_manager.h" #include "tools.h" #include "undo.h" #include "libgimp/gimpintl.h" #include "tile_manager_pvt.h" -#include "drawable_pvt.h" + typedef enum { @@ -62,9 +65,9 @@ struct _PasteNamedDlg }; /* The named buffer structure... */ -typedef struct _named_buffer NamedBuffer; +typedef struct _NamedBuffer NamedBuffer; -struct _named_buffer +struct _NamedBuffer { TileManager *buf; gchar *name; diff --git a/app/global_edit.h b/app/global_edit.h index 267cc95c2e..aea017ff18 100644 --- a/app/global_edit.h +++ b/app/global_edit.h @@ -15,10 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __GLOBAL_EDIT_H__ #define __GLOBAL_EDIT_H__ -#include "gimage.h" TileManager * crop_buffer (TileManager *tiles, gint border); @@ -51,4 +51,5 @@ gboolean named_edit_copy (GDisplay *gdisp); gboolean named_edit_paste (GDisplay *gdisp); void named_buffers_free (void); + #endif /* __GLOBAL_EDIT_H__ */ diff --git a/app/gradient.h b/app/gradient.h index bac07d9804..b16122b89a 100644 --- a/app/gradient.h +++ b/app/gradient.h @@ -18,10 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __GRADIENT_H__ #define __GRADIENT_H__ -typedef struct _gradient_t gradient_t; /* global variables */ extern GSList * gradients_list; @@ -44,4 +44,5 @@ void gradient_get_color_at (gradient_t *gradient, gdouble *b, gdouble *a); + #endif /* __GRADIENT_H__ */ diff --git a/app/gradient_editor.h b/app/gradient_editor.h index bac07d9804..b16122b89a 100644 --- a/app/gradient_editor.h +++ b/app/gradient_editor.h @@ -18,10 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __GRADIENT_H__ #define __GRADIENT_H__ -typedef struct _gradient_t gradient_t; /* global variables */ extern GSList * gradients_list; @@ -44,4 +44,5 @@ void gradient_get_color_at (gradient_t *gradient, gdouble *b, gdouble *a); + #endif /* __GRADIENT_H__ */ diff --git a/app/gradient_select.c b/app/gradient_select.c index 5159678641..e2f8ff5f60 100644 --- a/app/gradient_select.c +++ b/app/gradient_select.c @@ -45,14 +45,16 @@ #include "gimpcontext.h" #include "gimpdnd.h" #include "gimpui.h" +#include "gradient.h" #include "gradient_header.h" #include "gradientP.h" #include "gradient_select.h" +#include "procedural_db.h" #include "session.h" -#include "config.h" #include "libgimp/gimpintl.h" + static void gradient_change_callbacks (GradientSelect *gsp, gboolean closing); static gradient_t* gradient_select_drag_gradient (GtkWidget *widget, diff --git a/app/gradient_select.h b/app/gradient_select.h index 8e38d98d6b..406f68e499 100644 --- a/app/gradient_select.h +++ b/app/gradient_select.h @@ -19,8 +19,6 @@ #ifndef __GRADIENT_SELECT_H__ #define __GRADIENT_SELECT_H__ -#include "gimpcontext.h" - #define GRADIENT_SAMPLE_SIZE 40 @@ -68,4 +66,5 @@ void gradients_check_dialogs (void); void gradient_dialog_create (void); void gradient_dialog_free (void); + #endif /* __GRADIENT_SELECT_H__ */ diff --git a/app/gradient_select_cmds.c b/app/gradient_select_cmds.c index 6cde1e968b..8d52766c52 100644 --- a/app/gradient_select_cmds.c +++ b/app/gradient_select_cmds.c @@ -18,11 +18,17 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ -#include "procedural_db.h" +#include "config.h" #include +#include + +#include "apptypes.h" +#include "procedural_db.h" + #include "gimpcontext.h" +#include "gradient.h" #include "gradient_header.h" #include "gradient_select.h" diff --git a/app/gradients_cmds.c b/app/gradients_cmds.c index 74944980f1..2ded96df00 100644 --- a/app/gradients_cmds.c +++ b/app/gradients_cmds.c @@ -18,9 +18,16 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ +#include "config.h" + + +#include + +#include "apptypes.h" #include "procedural_db.h" #include "gimpcontext.h" +#include "gradient.h" #include "gradient_header.h" static ProcRecord gradients_get_list_proc; diff --git a/app/gui/about-dialog.c b/app/gui/about-dialog.c index e6b2bcc3d4..6bcca1f4dc 100644 --- a/app/gui/about-dialog.c +++ b/app/gui/about-dialog.c @@ -37,9 +37,11 @@ #include "libgimp/gimpfeatures.h" #include "libgimp/gimpenv.h" -#include "libgimp/gimpintl.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpmath.h" +#include "libgimp/gimpintl.h" + #include "pixmaps/wilber2.xpm" diff --git a/app/gui/about-dialog.h b/app/gui/about-dialog.h index 602df14466..38cd925696 100644 --- a/app/gui/about-dialog.h +++ b/app/gui/about-dialog.h @@ -15,6 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __ABOUT_DIALOG_H__ #define __ABOUT_DIALOG_H__ diff --git a/app/gui/brush-editor.c b/app/gui/brush-editor.c index f9b22b5cad..2ea93642f2 100644 --- a/app/gui/brush-editor.c +++ b/app/gui/brush-editor.c @@ -30,7 +30,9 @@ #include "gimpbrushgenerated.h" #include "brush_edit.h" #include "gimpui.h" +#include "temp_buf.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" diff --git a/app/gui/brush-editor.h b/app/gui/brush-editor.h index e376b0b2f7..2c221792bd 100644 --- a/app/gui/brush-editor.h +++ b/app/gui/brush-editor.h @@ -21,7 +21,6 @@ #ifndef __BRUSH_EDIT_H__ #define __BRUSH_EDIT_H__ -#include "gimpbrushgenerated.h" typedef struct _BrushEditGeneratedWindow BrushEditGeneratedWindow; @@ -46,7 +45,7 @@ struct _BrushEditGeneratedWindow BrushEditGeneratedWindow * brush_edit_generated_new (void); -void brush_edit_generated_set_brush (BrushEditGeneratedWindow *begw, - GimpBrush *brush); +void brush_edit_generated_set_brush (BrushEditGeneratedWindow *begw, + GimpBrush *brush); #endif /* __BRUSH_EDIT_H__ */ diff --git a/app/gui/brush-select.c b/app/gui/brush-select.c index 5bf62f59d2..24bb569a16 100644 --- a/app/gui/brush-select.c +++ b/app/gui/brush-select.c @@ -38,11 +38,15 @@ #include "gimprc.h" #include "gimpui.h" #include "paint_options.h" +#include "procedural_db.h" #include "session.h" +#include "temp_buf.h" + +#include "libgimp/gimphelpui.h" -#include "config.h" #include "libgimp/gimpintl.h" + #define MIN_CELL_SIZE 25 #define MAX_CELL_SIZE 25 /* disable variable brush preview size */ diff --git a/app/gui/brush-select.h b/app/gui/brush-select.h index f3c00cb5b8..941cf7932e 100644 --- a/app/gui/brush-select.h +++ b/app/gui/brush-select.h @@ -20,29 +20,25 @@ #define __BRUSH_SELECT_H__ -#include "gimpbrush.h" -#include "gimpcontext.h" - - typedef struct _BrushSelect BrushSelect; struct _BrushSelect { - GtkWidget *shell; + GtkWidget *shell; /* Place holders which enable global<->per-tool paint options switching */ - GtkWidget *left_box; - GtkWidget *right_box; - GtkWidget *brush_selection_box; - GtkWidget *paint_options_box; + GtkWidget *left_box; + GtkWidget *right_box; + GtkWidget *brush_selection_box; + GtkWidget *paint_options_box; /* The preview and it's vscale data */ GtkWidget *preview; GtkAdjustment *sbar_data; - GtkWidget *options_box; - GtkWidget *brush_name; - GtkWidget *brush_size; + GtkWidget *options_box; + GtkWidget *brush_name; + GtkWidget *brush_size; GtkAdjustment *opacity_data; GtkAdjustment *spacing_data; @@ -51,32 +47,32 @@ struct _BrushSelect GtkWidget *option_menu; /* Brush popup */ - GtkWidget *brush_popup; - GtkWidget *brush_preview; - guint popup_timeout_tag; - guint popup_anim_timeout_tag; - guint popup_pipe_index; + GtkWidget *brush_popup; + GtkWidget *brush_preview; + guint popup_timeout_tag; + guint popup_anim_timeout_tag; + guint popup_pipe_index; /* Callback function name */ - gchar *callback_name; + gchar *callback_name; /* Context to store the current brush & paint options */ - GimpContext *context; - gint spacing_value; + GimpContext *context; + gint spacing_value; - GimpBrush *dnd_brush; + GimpBrush *dnd_brush; /* Some variables to keep the GUI consistent */ - gint cell_width; - gint cell_height; - gint scroll_offset; - gint old_row; - gint old_col; - gint NUM_BRUSH_COLUMNS; - gint NUM_BRUSH_ROWS; + gint cell_width; + gint cell_height; + gint scroll_offset; + gint old_row; + gint old_col; + gint NUM_BRUSH_COLUMNS; + gint NUM_BRUSH_ROWS; - gboolean redraw; - gboolean freeze; /* so we don't waste so much time during refresh */ + gboolean redraw; + gboolean freeze; /* so we don't waste so much time during refresh */ }; /* list of active dialogs */ diff --git a/app/gui/channels-dialog.c b/app/gui/channels-dialog.c index 6bd774d785..ede94c19df 100644 --- a/app/gui/channels-dialog.c +++ b/app/gui/channels-dialog.c @@ -24,6 +24,8 @@ #include "apptypes.h" #include "appenv.h" + +#include "channel.h" #include "channels_dialog.h" #include "color_panel.h" #include "drawable.h" @@ -41,10 +43,10 @@ #include "paint_funcs.h" #include "undo.h" -#include "channel_pvt.h" +#include "libgimp/gimphelpui.h" +#include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" -#include "libgimp/gimpmath.h" #include "pixmaps/eye.xbm" #include "pixmaps/channel.xbm" @@ -55,6 +57,7 @@ #include "pixmaps/delete.xpm" #include "pixmaps/toselection.xpm" + #define COMPONENT_BASE_ID 0x10000000 typedef struct _ChannelsDialog ChannelsDialog; @@ -1099,7 +1102,7 @@ channels_dialog_add_channel_to_sel_callback (GtkWidget *widget, new_channel = channel_copy (gimp_image_get_mask (gimage)); channel_combine_mask (new_channel, active_channel, - ADD, + CHANNEL_OP_ADD, 0, 0); /* off x/y */ gimage_mask_load (gimage, new_channel); channel_delete (new_channel); @@ -1123,7 +1126,7 @@ channels_dialog_sub_channel_from_sel_callback (GtkWidget *widget, new_channel = channel_copy (gimp_image_get_mask (gimage)); channel_combine_mask (new_channel, active_channel, - SUB, + CHANNEL_OP_SUB, 0, 0); /* off x/y */ gimage_mask_load (gimage, new_channel); channel_delete (new_channel); @@ -1147,7 +1150,7 @@ channels_dialog_intersect_channel_with_sel_callback (GtkWidget *widget, new_channel = channel_copy (gimp_image_get_mask (gimage)); channel_combine_mask (new_channel, active_channel, - INTERSECT, + CHANNEL_OP_INTERSECT, 0, 0); /* off x/y */ gimage_mask_load (gimage, new_channel); channel_delete (new_channel); diff --git a/app/gui/channels-dialog.h b/app/gui/channels-dialog.h index 4861605e1b..63a77b77eb 100644 --- a/app/gui/channels-dialog.h +++ b/app/gui/channels-dialog.h @@ -15,18 +15,31 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __CHANNELS_DIALOG_H__ #define __CHANNELS_DIALOG_H__ -void channels_dialog_new_channel_callback (GtkWidget *, gpointer); -void channels_dialog_raise_channel_callback (GtkWidget *, gpointer); -void channels_dialog_lower_channel_callback (GtkWidget *, gpointer); -void channels_dialog_duplicate_channel_callback (GtkWidget *, gpointer); -void channels_dialog_delete_channel_callback (GtkWidget *, gpointer); -void channels_dialog_channel_to_sel_callback (GtkWidget *, gpointer); -void channels_dialog_add_channel_to_sel_callback (GtkWidget *, gpointer); -void channels_dialog_sub_channel_from_sel_callback (GtkWidget *, gpointer); -void channels_dialog_intersect_channel_with_sel_callback(GtkWidget *, gpointer); -void channels_dialog_edit_channel_attributes_callback (GtkWidget *, gpointer); + +void channels_dialog_new_channel_callback (GtkWidget *widget, + gpointer data); +void channels_dialog_raise_channel_callback (GtkWidget *widget, + gpointer data); +void channels_dialog_lower_channel_callback (GtkWidget *widget, + gpointer data); +void channels_dialog_duplicate_channel_callback (GtkWidget *widget, + gpointer data); +void channels_dialog_delete_channel_callback (GtkWidget *widget, + gpointer data); +void channels_dialog_channel_to_sel_callback (GtkWidget *widget, + gpointer data); +void channels_dialog_add_channel_to_sel_callback (GtkWidget *widget, + gpointer data); +void channels_dialog_sub_channel_from_sel_callback (GtkWidget *widget, + gpointer data); +void channels_dialog_intersect_channel_with_sel_callback(GtkWidget *widget, + gpointer data); +void channels_dialog_edit_channel_attributes_callback (GtkWidget *widget, + gpointer data); + #endif /* __CHANNELS_DIALOG_H__ */ diff --git a/app/gui/color-area.h b/app/gui/color-area.h index 998d2a7eca..be57b96f14 100644 --- a/app/gui/color-area.h +++ b/app/gui/color-area.h @@ -15,13 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __COLOR_AREA_H__ #define __COLOR_AREA_H__ -#include "gdisplayF.h" - - #define FOREGROUND 0 #define BACKGROUND 1 @@ -55,4 +53,5 @@ void color_area_draw_rect (GdkDrawable *drawable, guchar g, guchar b); + #endif /* __COLOR_AREA_H__ */ diff --git a/app/gui/color-notebook.c b/app/gui/color-notebook.c index 817f5fa7a6..d3370c299d 100644 --- a/app/gui/color-notebook.c +++ b/app/gui/color-notebook.c @@ -21,16 +21,19 @@ #include "config.h" -#include -#include - #include #include #include +#include +#include + +#include "apptypes.h" + #include "color_notebook.h" #include "gimpui.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpcolorselector.h" #include "libgimp/gimpintl.h" diff --git a/app/gui/color-select.c b/app/gui/color-select.c index d82a7112e4..2235aaac8c 100644 --- a/app/gui/color-select.c +++ b/app/gui/color-select.c @@ -18,6 +18,7 @@ #include "config.h" +#include #include #include @@ -33,9 +34,10 @@ #include "gimprc.h" #include "gimpui.h" #include "session.h" -#include "color_area.h" /* for color_area_draw_rect */ +#include "color_area.h" #include "libgimp/gimpcolorselector.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpintl.h" diff --git a/app/gui/color-select.h b/app/gui/color-select.h index 6486277f7b..0cedaccb0c 100644 --- a/app/gui/color-select.h +++ b/app/gui/color-select.h @@ -15,9 +15,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __COLOR_SELECT_H__ #define __COLOR_SELECT_H__ -void color_select_init (void); + +void color_select_init (void); + #endif /* __COLOR_SELECT_H__ */ diff --git a/app/gui/commands.c b/app/gui/commands.c index 435754c8ac..01f3a86d85 100644 --- a/app/gui/commands.c +++ b/app/gui/commands.c @@ -18,7 +18,10 @@ #include "config.h" -#include +#include +#include + +#include #include "apptypes.h" @@ -41,13 +44,17 @@ #include "floating_sel.h" #include "gdisplay_ops.h" #include "gimage_mask.h" +#include "gimpcontext.h" #include "gimphelp.h" +#include "gimpimage.h" #include "gimprc.h" #include "gimpui.h" #include "global_edit.h" #include "gradient_select.h" #include "image_render.h" +#include "info_dialog.h" #include "info_window.h" +#include "layer.h" #include "nav_window.h" #include "invert.h" #include "lc_dialog.h" @@ -58,6 +65,7 @@ #include "plug_in.h" #include "resize.h" #include "scale.h" +#include "selection.h" #include "tips_dialog.h" #include "tools.h" #include "undo.h" @@ -66,9 +74,12 @@ #include "gdisplay_color_ui.h" #endif /* DISPLAY_FILTERS */ +#include "libgimp/gimphelpui.h" #include "libgimp/gimpmath.h" + #include "libgimp/gimpintl.h" + #define return_if_no_display(gdisp) \ gdisp = gdisplay_active (); \ if (!gdisp) return @@ -252,7 +263,7 @@ edit_clear_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - edit_clear (gdisp->gimage, gimage_active_drawable (gdisp->gimage)); + edit_clear (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage)); gdisplays_flush (); } @@ -266,7 +277,8 @@ edit_fill_cmd_callback (GtkWidget *widget, return_if_no_display (gdisp); fill_type = (GimpFillType) callback_action; - edit_fill (gdisp->gimage, gimage_active_drawable (gdisp->gimage), fill_type); + edit_fill (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage), + fill_type); gdisplays_flush (); } @@ -277,7 +289,7 @@ edit_stroke_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_mask_stroke (gdisp->gimage, gimage_active_drawable (gdisp->gimage)); + gimage_mask_stroke (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage)); gdisplays_flush (); } @@ -323,7 +335,7 @@ select_float_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_mask_float (gdisp->gimage, gimage_active_drawable (gdisp->gimage), + gimage_mask_float (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage), 0, 0); gdisplays_flush (); } @@ -892,13 +904,13 @@ layers_previous_cmd_callback (GtkWidget *widget, return_if_no_display (gdisp); current_layer = - gimage_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer); + gimp_image_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer); - new_layer = gimage_get_layer_by_index (gdisp->gimage, current_layer - 1); + new_layer = gimp_image_get_layer_by_index (gdisp->gimage, current_layer - 1); if (new_layer) { - gimage_set_active_layer (gdisp->gimage, new_layer); + gimp_image_set_active_layer (gdisp->gimage, new_layer); gdisplays_flush (); layer_select_init (gdisp->gimage, 0, GDK_CURRENT_TIME); } @@ -915,13 +927,13 @@ layers_next_cmd_callback (GtkWidget *widget, return_if_no_display (gdisp); current_layer = - gimage_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer); + gimp_image_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer); - new_layer = gimage_get_layer_by_index (gdisp->gimage, current_layer + 1); + new_layer = gimp_image_get_layer_by_index (gdisp->gimage, current_layer + 1); if (new_layer) { - gimage_set_active_layer (gdisp->gimage, new_layer); + gimp_image_set_active_layer (gdisp->gimage, new_layer); gdisplays_flush (); layer_select_init (gdisp->gimage, 0, GDK_CURRENT_TIME); } @@ -934,7 +946,7 @@ layers_raise_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_raise_layer (gdisp->gimage, gdisp->gimage->active_layer); + gimp_image_raise_layer (gdisp->gimage, gdisp->gimage->active_layer); gdisplays_flush (); } @@ -945,7 +957,7 @@ layers_lower_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_lower_layer (gdisp->gimage, gdisp->gimage->active_layer); + gimp_image_lower_layer (gdisp->gimage, gdisp->gimage->active_layer); gdisplays_flush (); } @@ -956,7 +968,7 @@ layers_raise_to_top_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_raise_layer_to_top (gdisp->gimage, gdisp->gimage->active_layer); + gimp_image_raise_layer_to_top (gdisp->gimage, gdisp->gimage->active_layer); gdisplays_flush (); } @@ -967,7 +979,7 @@ layers_lower_to_bottom_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_lower_layer_to_bottom (gdisp->gimage, gdisp->gimage->active_layer); + gimp_image_lower_layer_to_bottom (gdisp->gimage, gdisp->gimage->active_layer); gdisplays_flush (); } @@ -978,7 +990,7 @@ layers_anchor_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - floating_sel_anchor (gimage_get_active_layer (gdisp->gimage)); + floating_sel_anchor (gimp_image_get_active_layer (gdisp->gimage)); gdisplays_flush (); } @@ -999,7 +1011,7 @@ layers_flatten_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_flatten (gdisp->gimage); + gimp_image_flatten (gdisp->gimage); gdisplays_flush (); } @@ -1086,7 +1098,7 @@ tools_select_cmd_callback (GtkWidget *widget, { (* tool_info[tool_type].init_func) (gdisp); - active_tool->drawable = gimage_active_drawable (gdisp->gimage); + active_tool->drawable = gimp_image_active_drawable (gdisp->gimage); } /* setting the gdisp_ptr here is a HACK to allow the tools' @@ -1316,11 +1328,11 @@ image_resize_callback (GtkWidget *widget, if (image_resize->resize->width > 0 && image_resize->resize->height > 0) { - gimage_resize (gimage, - image_resize->resize->width, - image_resize->resize->height, - image_resize->resize->offset_x, - image_resize->resize->offset_y); + gimp_image_resize (gimage, + image_resize->resize->width, + image_resize->resize->height, + image_resize->resize->offset_x, + image_resize->resize->offset_y); gdisplays_flush (); lc_dialog_update_image_list (); } diff --git a/app/gui/device-status-dialog.c b/app/gui/device-status-dialog.c index 5af69ee420..15edcf6da5 100644 --- a/app/gui/device-status-dialog.c +++ b/app/gui/device-status-dialog.c @@ -18,15 +18,17 @@ #include "config.h" +#include #include -#include +#include #include "apptypes.h" #include "appenv.h" #include "devices.h" #include "dialog_handler.h" +#include "gimpbrush.h" #include "gimpcontextpreview.h" #include "gimpdnd.h" #include "gimpbrushlist.h" @@ -35,13 +37,16 @@ #include "gimpui.h" #include "gradient.h" #include "gradient_header.h" +#include "patterns.h" #include "session.h" #include "tools.h" #include "libgimp/gimpenv.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpintl.h" + #define CELL_SIZE 20 /* The size of the preview cells */ #define PREVIEW_EVENT_MASK GDK_BUTTON_PRESS_MASK | \ diff --git a/app/gui/file-new-dialog.c b/app/gui/file-new-dialog.c index 93f4089dba..0d94a16a8f 100644 --- a/app/gui/file-new-dialog.c +++ b/app/gui/file-new-dialog.c @@ -20,17 +20,23 @@ #include +#include "apptypes.h" + +#include "image_new.h" #include "file_new_dialog.h" #include "gimprc.h" #include "gimpui.h" #include "gdisplay.h" #include "libgimp/gimpchainbutton.h" -#include "libgimp/gimpmath.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimplimits.h" +#include "libgimp/gimpmath.h" #include "libgimp/gimpsizeentry.h" + #include "libgimp/gimpintl.h" + typedef struct { GtkWidget *dlg; diff --git a/app/gui/file-new-dialog.h b/app/gui/file-new-dialog.h index 403409ffbe..51629ba395 100644 --- a/app/gui/file-new-dialog.h +++ b/app/gui/file-new-dialog.h @@ -19,14 +19,12 @@ #ifndef __FILE_NEW_DIALOG_H__ #define __FILE_NEW_DIALOG_H__ -#include "image_new.h" +void file_new_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action); -void file_new_cmd_callback (GtkWidget *widget, - gpointer callback_data, - guint callback_action); - -void ui_new_image_window_create (const GimpImageNewValues *values); +void ui_new_image_window_create (const GimpImageNewValues *values); #endif /* __FILE_NEW_DIALOG_H_H__ */ diff --git a/app/gui/gradient-editor.h b/app/gui/gradient-editor.h index bac07d9804..b16122b89a 100644 --- a/app/gui/gradient-editor.h +++ b/app/gui/gradient-editor.h @@ -18,10 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __GRADIENT_H__ #define __GRADIENT_H__ -typedef struct _gradient_t gradient_t; /* global variables */ extern GSList * gradients_list; @@ -44,4 +44,5 @@ void gradient_get_color_at (gradient_t *gradient, gdouble *b, gdouble *a); + #endif /* __GRADIENT_H__ */ diff --git a/app/gui/gradient-select.c b/app/gui/gradient-select.c index 5159678641..e2f8ff5f60 100644 --- a/app/gui/gradient-select.c +++ b/app/gui/gradient-select.c @@ -45,14 +45,16 @@ #include "gimpcontext.h" #include "gimpdnd.h" #include "gimpui.h" +#include "gradient.h" #include "gradient_header.h" #include "gradientP.h" #include "gradient_select.h" +#include "procedural_db.h" #include "session.h" -#include "config.h" #include "libgimp/gimpintl.h" + static void gradient_change_callbacks (GradientSelect *gsp, gboolean closing); static gradient_t* gradient_select_drag_gradient (GtkWidget *widget, diff --git a/app/gui/gradient-select.h b/app/gui/gradient-select.h index 8e38d98d6b..406f68e499 100644 --- a/app/gui/gradient-select.h +++ b/app/gui/gradient-select.h @@ -19,8 +19,6 @@ #ifndef __GRADIENT_SELECT_H__ #define __GRADIENT_SELECT_H__ -#include "gimpcontext.h" - #define GRADIENT_SAMPLE_SIZE 40 @@ -68,4 +66,5 @@ void gradients_check_dialogs (void); void gradient_dialog_create (void); void gradient_dialog_free (void); + #endif /* __GRADIENT_SELECT_H__ */ diff --git a/app/gui/help-commands.c b/app/gui/help-commands.c index 435754c8ac..01f3a86d85 100644 --- a/app/gui/help-commands.c +++ b/app/gui/help-commands.c @@ -18,7 +18,10 @@ #include "config.h" -#include +#include +#include + +#include #include "apptypes.h" @@ -41,13 +44,17 @@ #include "floating_sel.h" #include "gdisplay_ops.h" #include "gimage_mask.h" +#include "gimpcontext.h" #include "gimphelp.h" +#include "gimpimage.h" #include "gimprc.h" #include "gimpui.h" #include "global_edit.h" #include "gradient_select.h" #include "image_render.h" +#include "info_dialog.h" #include "info_window.h" +#include "layer.h" #include "nav_window.h" #include "invert.h" #include "lc_dialog.h" @@ -58,6 +65,7 @@ #include "plug_in.h" #include "resize.h" #include "scale.h" +#include "selection.h" #include "tips_dialog.h" #include "tools.h" #include "undo.h" @@ -66,9 +74,12 @@ #include "gdisplay_color_ui.h" #endif /* DISPLAY_FILTERS */ +#include "libgimp/gimphelpui.h" #include "libgimp/gimpmath.h" + #include "libgimp/gimpintl.h" + #define return_if_no_display(gdisp) \ gdisp = gdisplay_active (); \ if (!gdisp) return @@ -252,7 +263,7 @@ edit_clear_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - edit_clear (gdisp->gimage, gimage_active_drawable (gdisp->gimage)); + edit_clear (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage)); gdisplays_flush (); } @@ -266,7 +277,8 @@ edit_fill_cmd_callback (GtkWidget *widget, return_if_no_display (gdisp); fill_type = (GimpFillType) callback_action; - edit_fill (gdisp->gimage, gimage_active_drawable (gdisp->gimage), fill_type); + edit_fill (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage), + fill_type); gdisplays_flush (); } @@ -277,7 +289,7 @@ edit_stroke_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_mask_stroke (gdisp->gimage, gimage_active_drawable (gdisp->gimage)); + gimage_mask_stroke (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage)); gdisplays_flush (); } @@ -323,7 +335,7 @@ select_float_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_mask_float (gdisp->gimage, gimage_active_drawable (gdisp->gimage), + gimage_mask_float (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage), 0, 0); gdisplays_flush (); } @@ -892,13 +904,13 @@ layers_previous_cmd_callback (GtkWidget *widget, return_if_no_display (gdisp); current_layer = - gimage_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer); + gimp_image_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer); - new_layer = gimage_get_layer_by_index (gdisp->gimage, current_layer - 1); + new_layer = gimp_image_get_layer_by_index (gdisp->gimage, current_layer - 1); if (new_layer) { - gimage_set_active_layer (gdisp->gimage, new_layer); + gimp_image_set_active_layer (gdisp->gimage, new_layer); gdisplays_flush (); layer_select_init (gdisp->gimage, 0, GDK_CURRENT_TIME); } @@ -915,13 +927,13 @@ layers_next_cmd_callback (GtkWidget *widget, return_if_no_display (gdisp); current_layer = - gimage_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer); + gimp_image_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer); - new_layer = gimage_get_layer_by_index (gdisp->gimage, current_layer + 1); + new_layer = gimp_image_get_layer_by_index (gdisp->gimage, current_layer + 1); if (new_layer) { - gimage_set_active_layer (gdisp->gimage, new_layer); + gimp_image_set_active_layer (gdisp->gimage, new_layer); gdisplays_flush (); layer_select_init (gdisp->gimage, 0, GDK_CURRENT_TIME); } @@ -934,7 +946,7 @@ layers_raise_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_raise_layer (gdisp->gimage, gdisp->gimage->active_layer); + gimp_image_raise_layer (gdisp->gimage, gdisp->gimage->active_layer); gdisplays_flush (); } @@ -945,7 +957,7 @@ layers_lower_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_lower_layer (gdisp->gimage, gdisp->gimage->active_layer); + gimp_image_lower_layer (gdisp->gimage, gdisp->gimage->active_layer); gdisplays_flush (); } @@ -956,7 +968,7 @@ layers_raise_to_top_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_raise_layer_to_top (gdisp->gimage, gdisp->gimage->active_layer); + gimp_image_raise_layer_to_top (gdisp->gimage, gdisp->gimage->active_layer); gdisplays_flush (); } @@ -967,7 +979,7 @@ layers_lower_to_bottom_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_lower_layer_to_bottom (gdisp->gimage, gdisp->gimage->active_layer); + gimp_image_lower_layer_to_bottom (gdisp->gimage, gdisp->gimage->active_layer); gdisplays_flush (); } @@ -978,7 +990,7 @@ layers_anchor_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - floating_sel_anchor (gimage_get_active_layer (gdisp->gimage)); + floating_sel_anchor (gimp_image_get_active_layer (gdisp->gimage)); gdisplays_flush (); } @@ -999,7 +1011,7 @@ layers_flatten_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - gimage_flatten (gdisp->gimage); + gimp_image_flatten (gdisp->gimage); gdisplays_flush (); } @@ -1086,7 +1098,7 @@ tools_select_cmd_callback (GtkWidget *widget, { (* tool_info[tool_type].init_func) (gdisp); - active_tool->drawable = gimage_active_drawable (gdisp->gimage); + active_tool->drawable = gimp_image_active_drawable (gdisp->gimage); } /* setting the gdisp_ptr here is a HACK to allow the tools' @@ -1316,11 +1328,11 @@ image_resize_callback (GtkWidget *widget, if (image_resize->resize->width > 0 && image_resize->resize->height > 0) { - gimage_resize (gimage, - image_resize->resize->width, - image_resize->resize->height, - image_resize->resize->offset_x, - image_resize->resize->offset_y); + gimp_image_resize (gimage, + image_resize->resize->width, + image_resize->resize->height, + image_resize->resize->offset_x, + image_resize->resize->offset_y); gdisplays_flush (); lc_dialog_update_image_list (); } diff --git a/app/gui/indicator-area.c b/app/gui/indicator-area.c index 4cf0190b03..d7ea146a42 100644 --- a/app/gui/indicator-area.c +++ b/app/gui/indicator-area.c @@ -15,25 +15,29 @@ * 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 -#include +#include #include "apptypes.h" #include "appenv.h" #include "brush_select.h" +#include "gimpcontext.h" #include "gimpcontextpreview.h" #include "gimpdnd.h" +#include "gimpui.h" #include "gradient_select.h" #include "indicator_area.h" #include "pattern_select.h" #include "libgimp/gimpintl.h" + #define CELL_SIZE 23 /* The size of the previews */ #define GRAD_CELL_WIDTH 48 /* The width of the gradient preview */ #define GRAD_CELL_HEIGHT 12 /* The height of the gradient preview */ diff --git a/app/gui/indicator-area.h b/app/gui/indicator-area.h index 76969ca3ed..089f7ee960 100644 --- a/app/gui/indicator-area.h +++ b/app/gui/indicator-area.h @@ -15,9 +15,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __INDICATOR_AREA_H__ #define __INDICATOR_AREA_H__ + GtkWidget * indicator_area_create (void); + #endif /* __INDICATOR_AREA_H__ */ diff --git a/app/gui/info-dialog.h b/app/gui/info-dialog.h index e033e33048..ce903888c7 100644 --- a/app/gui/info-dialog.h +++ b/app/gui/info-dialog.h @@ -19,11 +19,6 @@ #ifndef __INFO_DIALOG_H__ #define __INFO_DIALOG_H__ -#include "gimphelp.h" - -#include "libgimp/gimpsizeentry.h" -#include "libgimp/gimpunit.h" - typedef enum { @@ -35,7 +30,6 @@ typedef enum } InfoFieldType; typedef struct _InfoField InfoField; -typedef struct _InfoDialog InfoDialog; struct _InfoField { diff --git a/app/gui/info-window.c b/app/gui/info-window.c index cf29082be5..6c12d5df5a 100644 --- a/app/gui/info-window.c +++ b/app/gui/info-window.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include "apptypes.h" @@ -27,11 +27,13 @@ #include "colormaps.h" #include "gdisplay.h" #include "gimpcontext.h" +#include "gimpimage.h" #include "gimpset.h" #include "gimpui.h" #include "gximage.h" #include "info_dialog.h" #include "info_window.h" +#include "procedural_db.h" #include "scroll.h" #include "tools.h" @@ -39,6 +41,7 @@ #include "libgimp/gimpintl.h" + #define MAX_BUF 256 typedef struct _InfoWinData InfoWinData; @@ -245,8 +248,8 @@ info_window_create (GDisplay *gdisp) gchar *title, *title_buf; gint type; - title = g_basename (gimage_filename (gdisp->gimage)); - type = gimage_base_type (gdisp->gimage); + title = g_basename (gimp_image_filename (gdisp->gimage)); + type = gimp_image_base_type (gdisp->gimage); /* create the info dialog */ title_buf = info_window_title (gdisp); @@ -314,7 +317,7 @@ info_window_title (GDisplay *gdisp) gchar *title; gchar *title_buf; - title = g_basename (gimage_filename (gdisp->gimage)); + title = g_basename (gimp_image_filename (gdisp->gimage)); /* create the info dialog */ title_buf = g_strdup_printf (_("Info: %s-%d.%d"), @@ -421,7 +424,7 @@ info_window_update_RGB (GDisplay *gdisp, if (!iwd || iwd->showingPreview == FALSE) return; - /* gimage_active_drawable (gdisp->gimage) */ + /* gimp_image_active_drawable (gdisp->gimage) */ if (!(color = gimp_image_get_color_at (gdisp->gimage, tx, ty)) || (tx < 0.0 && ty < 0.0)) { @@ -531,7 +534,7 @@ info_window_update (GDisplay *gdisp) g_snprintf (iwd->scale_str, MAX_BUF, "%d:%d", SCALEDEST (gdisp), SCALESRC (gdisp)); - type = gimage_base_type (gdisp->gimage); + type = gimp_image_base_type (gdisp->gimage); /* color type */ if (type == RGB) diff --git a/app/gui/info-window.h b/app/gui/info-window.h index 51be465741..6c5c90e858 100644 --- a/app/gui/info-window.h +++ b/app/gui/info-window.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __INFO_WINDOW_H__ #define __INFO_WINDOW_H__ -#include "gdisplayF.h" -#include "info_dialog.h" InfoDialog * info_window_create (GDisplay *gdisp); void info_window_free (InfoDialog *info_win); @@ -29,4 +28,6 @@ void info_window_update_RGB (GDisplay *gdisp, gdouble tx, gdouble ty); void info_window_follow_auto (void); + + #endif /* __INFO_WINDOW_H__ */ diff --git a/app/gui/input-dialog.c b/app/gui/input-dialog.c index 5af69ee420..15edcf6da5 100644 --- a/app/gui/input-dialog.c +++ b/app/gui/input-dialog.c @@ -18,15 +18,17 @@ #include "config.h" +#include #include -#include +#include #include "apptypes.h" #include "appenv.h" #include "devices.h" #include "dialog_handler.h" +#include "gimpbrush.h" #include "gimpcontextpreview.h" #include "gimpdnd.h" #include "gimpbrushlist.h" @@ -35,13 +37,16 @@ #include "gimpui.h" #include "gradient.h" #include "gradient_header.h" +#include "patterns.h" #include "session.h" #include "tools.h" #include "libgimp/gimpenv.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpintl.h" + #define CELL_SIZE 20 /* The size of the preview cells */ #define PREVIEW_EVENT_MASK GDK_BUTTON_PRESS_MASK | \ diff --git a/app/gui/layer-select.c b/app/gui/layer-select.c index f03d9ada6d..b37e1a0315 100644 --- a/app/gui/layer-select.c +++ b/app/gui/layer-select.c @@ -24,10 +24,14 @@ #include "apptypes.h" #include "appenv.h" +#include "drawable.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimprc.h" +#include "layer.h" #include "layer_select.h" #include "layers_dialogP.h" +#include "temp_buf.h" #include "libgimp/gimpintl.h" @@ -210,7 +214,7 @@ layer_select_advance (LayerSelect *layer_select, return; /* If there is a floating selection, allow no advancement */ - if (gimage_floating_sel (layer_select->gimage)) + if (gimp_image_floating_sel (layer_select->gimage)) return; for (list = layer_select->gimage->layer_stack, count = 0; @@ -263,8 +267,8 @@ layer_select_end (LayerSelect *layer_select, /* only reset the active layer if a new layer was specified */ if (layer_select->current_layer != layer_select->gimage->active_layer) { - gimage_set_active_layer (layer_select->gimage, - layer_select->current_layer); + gimp_image_set_active_layer (layer_select->gimage, + layer_select->current_layer); gdisplays_flush (); } } diff --git a/app/gui/layer-select.h b/app/gui/layer-select.h index 656745a26c..6d6260760a 100644 --- a/app/gui/layer-select.h +++ b/app/gui/layer-select.h @@ -19,8 +19,6 @@ #ifndef __LAYER_SELECT_H__ #define __LAYER_SELECT_H__ -#include "gimage.h" - void layer_select_init (GImage *gimage, gint move, diff --git a/app/gui/layers-dialog.c b/app/gui/layers-dialog.c index d7afbbb894..92a95edcc9 100644 --- a/app/gui/layers-dialog.c +++ b/app/gui/layers-dialog.c @@ -34,12 +34,15 @@ #include "gimprc.h" #include "gimpui.h" #include "image_render.h" +#include "layer.h" #include "layers_dialog.h" #include "layers_dialogP.h" #include "lc_dialogP.h" #include "menus.h" #include "ops_buttons.h" +#include "paint_funcs.h" #include "resize.h" +#include "temp_buf.h" #include "undo.h" #include "libgimp/gimplimits.h" @@ -60,8 +63,6 @@ #include "pixmaps/delete.xpm" #include "pixmaps/anchor.xpm" -#include "layer_pvt.h" - #define LAYER_PREVIEW 0 #define MASK_PREVIEW 1 diff --git a/app/gui/layers-dialog.h b/app/gui/layers-dialog.h index 4140638cc4..c48a2f9a24 100644 --- a/app/gui/layers-dialog.h +++ b/app/gui/layers-dialog.h @@ -15,31 +15,57 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __LAYERS_DIALOG_H__ #define __LAYERS_DIALOG_H__ -void layers_dialog_previous_layer_callback (GtkWidget *, gpointer); -void layers_dialog_next_layer_callback (GtkWidget *, gpointer); -void layers_dialog_raise_layer_callback (GtkWidget *, gpointer); -void layers_dialog_lower_layer_callback (GtkWidget *, gpointer); -void layers_dialog_raise_layer_to_top_callback (GtkWidget *, gpointer); -void layers_dialog_lower_layer_to_bottom_callback (GtkWidget *, gpointer); -void layers_dialog_new_layer_callback (GtkWidget *, gpointer); -void layers_dialog_duplicate_layer_callback (GtkWidget *, gpointer); -void layers_dialog_delete_layer_callback (GtkWidget *, gpointer); -void layers_dialog_scale_layer_callback (GtkWidget *, gpointer); -void layers_dialog_resize_layer_callback (GtkWidget *, gpointer); -void layers_dialog_resize_to_image_callback (GtkWidget *, gpointer); -void layers_dialog_add_layer_mask_callback (GtkWidget *, gpointer); -void layers_dialog_apply_layer_mask_callback (GtkWidget *, gpointer); -void layers_dialog_delete_layer_mask_callback (GtkWidget *, gpointer); -void layers_dialog_anchor_layer_callback (GtkWidget *, gpointer); -void layers_dialog_merge_layers_callback (GtkWidget *, gpointer); -void layers_dialog_merge_down_callback (GtkWidget *, gpointer); -void layers_dialog_flatten_image_callback (GtkWidget *, gpointer); -void layers_dialog_alpha_select_callback (GtkWidget *, gpointer); -void layers_dialog_mask_select_callback (GtkWidget *, gpointer); -void layers_dialog_add_alpha_channel_callback (GtkWidget *, gpointer); -void layers_dialog_edit_layer_attributes_callback (GtkWidget *, gpointer); + +void layers_dialog_previous_layer_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_next_layer_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_raise_layer_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_lower_layer_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_raise_layer_to_top_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_lower_layer_to_bottom_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_new_layer_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_duplicate_layer_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_delete_layer_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_scale_layer_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_resize_layer_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_resize_to_image_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_add_layer_mask_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_apply_layer_mask_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_delete_layer_mask_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_anchor_layer_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_merge_layers_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_merge_down_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_flatten_image_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_alpha_select_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_mask_select_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_add_alpha_channel_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_edit_layer_attributes_callback (GtkWidget *widet, + gpointer data); + #endif /* __LAYERS_DIALOG_H__ */ diff --git a/app/gui/menus.c b/app/gui/menus.c index 5874ad7532..10947caf0f 100644 --- a/app/gui/menus.c +++ b/app/gui/menus.c @@ -31,6 +31,7 @@ #include "commands.h" #include "dialog_handler.h" #include "fileops.h" +#include "gimphelp.h" #include "gimprc.h" #include "gimpui.h" #include "interface.h" diff --git a/app/gui/menus.h b/app/gui/menus.h index 708522bf56..56b41e9915 100644 --- a/app/gui/menus.h +++ b/app/gui/menus.h @@ -63,4 +63,5 @@ void menus_set_state (gchar *path, void menus_last_opened_add (gchar *filename); + #endif /* __MENUS_H__ */ diff --git a/app/gui/module-browser.h b/app/gui/module-browser.h index f178502b8e..fa1ecc49e2 100644 --- a/app/gui/module-browser.h +++ b/app/gui/module-browser.h @@ -17,16 +17,17 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __MODULE_DB_H__ /* Load any modules we find on the module-path set in the gimprc */ -void module_db_init (void); +void module_db_init (void); /* Unload all modules, in case a module needs some cleanups */ -void module_db_free (void); +void module_db_free (void); -GtkWidget *module_db_browser_new (void); +GtkWidget * module_db_browser_new (void); #endif /* __MODULE_DB_H__ */ diff --git a/app/gui/palette-editor.c b/app/gui/palette-editor.c index 34f1ef3c83..148c755b7b 100644 --- a/app/gui/palette-editor.c +++ b/app/gui/palette-editor.c @@ -39,10 +39,13 @@ #include "color_area.h" #include "color_notebook.h" #include "datafiles.h" +#include "dialog_handler.h" +#include "gimage.h" #include "gimpcontext.h" #include "gimpdnd.h" #include "gimprc.h" #include "gimpui.h" +#include "gradient.h" #include "gradient_header.h" #include "gradient_select.h" #include "palette.h" @@ -50,7 +53,9 @@ #include "palette_entries.h" #include "session.h" #include "palette_select.h" -#include "dialog_handler.h" +#include "pixel_region.h" +#include "procedural_db.h" +#include "temp_buf.h" #include "libgimp/gimpenv.h" @@ -59,6 +64,7 @@ #include "pixmaps/zoom_in.xpm" #include "pixmaps/zoom_out.xpm" + #define ENTRY_WIDTH 12 #define ENTRY_HEIGHT 10 #define SPACING 1 @@ -2356,7 +2362,7 @@ palette_import_gimlist_indexed_cb (gpointer im, GimpImage *gimage = GIMP_IMAGE (im); GSList** l; - if (gimage_base_type (gimage) == INDEXED) + if (gimp_image_base_type (gimage) == INDEXED) { l = (GSList**) data; *l = g_slist_prepend (*l, im); @@ -2440,7 +2446,7 @@ palette_import_image_sel_callback (GtkWidget *widget, palette_import_update_image_preview (gimage); lab = g_strdup_printf ("%s-%d", - g_basename (gimage_filename (import_dialog->gimage)), + g_basename (gimp_image_filename (import_dialog->gimage)), pdb_image_to_id (import_dialog->gimage)); gtk_entry_set_text (GTK_ENTRY (import_dialog->entry), lab); @@ -2451,7 +2457,7 @@ palette_import_image_menu_add (GimpImage *gimage) { GtkWidget *menuitem; gchar *lab = g_strdup_printf ("%s-%d", - g_basename (gimage_filename (gimage)), + g_basename (gimp_image_filename (gimage)), pdb_image_to_id (gimage)); menuitem = gtk_menu_item_new_with_label (lab); gtk_widget_show (menuitem); @@ -2546,7 +2552,7 @@ palette_import_image_menu_activate (gint redo, if (redo && act_num >= 0) { gchar *lab = g_strdup_printf ("%s-%d", - g_basename (gimage_filename (import_dialog->gimage)), + g_basename (gimp_image_filename (import_dialog->gimage)), pdb_image_to_id (import_dialog->gimage)); gtk_option_menu_set_history (GTK_OPTION_MENU (optionmenu1), act_num); @@ -2556,7 +2562,7 @@ palette_import_image_menu_activate (gint redo, g_slist_free (list); lab = g_strdup_printf ("%s-%d", - g_basename (gimage_filename (import_dialog->gimage)), + g_basename (gimp_image_filename (import_dialog->gimage)), pdb_image_to_id (import_dialog->gimage)); gtk_entry_set_text (GTK_ENTRY (import_dialog->entry), lab); @@ -2647,7 +2653,7 @@ palette_import_image_new (GimpSet *set, } if (!GTK_WIDGET_IS_SENSITIVE (import_dialog->image_menu_item_indexed) && - gimage_base_type(gimage) == INDEXED) + gimp_image_base_type(gimage) == INDEXED) { gtk_widget_set_sensitive (import_dialog->image_menu_item_indexed, TRUE); return; @@ -2937,15 +2943,15 @@ palette_import_create_from_image (GImage *gimage, return; /* Get the image information */ - bytes = gimage_composite_bytes (gimage); - d_type = gimage_composite_type (gimage); + bytes = gimp_image_composite_bytes (gimage); + d_type = gimp_image_composite_type (gimage); has_alpha = (d_type == RGBA_GIMAGE || d_type == GRAYA_GIMAGE || d_type == INDEXEDA_GIMAGE); indexed = d_type == INDEXEDA_GIMAGE || d_type == INDEXED_GIMAGE; width = gimage->width; height = gimage->height; - pixel_region_init (&imagePR, gimage_composite (gimage), 0, 0, + pixel_region_init (&imagePR, gimp_image_composite (gimage), 0, 0, width, height, FALSE); alpha = bytes - 1; @@ -2969,7 +2975,7 @@ palette_import_create_from_image (GImage *gimage, for (j = 0; j < imagePR.w; j++) { /* Get the rgb values for the color */ - gimage_get_color (gimage, d_type, rgb, idata); + gimp_image_get_color (gimage, d_type, rgb, idata); memcpy (rgb_real, rgb, MAX_CHANNELS); /* Structure copy */ rgb[0] = (rgb[0] / threshold) * threshold; @@ -3005,7 +3011,7 @@ palette_import_create_from_indexed (GImage *gimage, if (gimage == NULL) return; - if (gimage_base_type (gimage) != INDEXED) + if (gimp_image_base_type (gimage) != INDEXED) return; entries = palette_entries_new (pname); diff --git a/app/gui/palette-editor.h b/app/gui/palette-editor.h index cfa50a6aa8..3059ca3ff2 100644 --- a/app/gui/palette-editor.h +++ b/app/gui/palette-editor.h @@ -36,4 +36,5 @@ void palette_set_active_color (gint r, gint b, gint state); + #endif /* __PALETTE_H__ */ diff --git a/app/gui/palette-select.c b/app/gui/palette-select.c index 8a67aa7563..4c3d5c1dde 100644 --- a/app/gui/palette-select.c +++ b/app/gui/palette-select.c @@ -19,9 +19,10 @@ #include "config.h" -#include +#include #include "apptypes.h" + #include "gimpui.h" #include "palette_entries.h" #include "palette_select.h" @@ -29,6 +30,7 @@ #include "libgimp/gimpintl.h" + /* List of active dialogs */ static GSList *active_dialogs = NULL; diff --git a/app/gui/palette-select.h b/app/gui/palette-select.h index 803c8adc7c..c682bf293b 100644 --- a/app/gui/palette-select.h +++ b/app/gui/palette-select.h @@ -15,9 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __PALETTE_SELECT_H__ #define __PALETTE_SELECT_H__ + #define SM_PREVIEW_WIDTH (96 + 2) #define SM_PREVIEW_HEIGHT (33 + 2) @@ -31,11 +33,12 @@ struct _PaletteSelect gchar *callback_name; }; -PaletteSelect * palette_select_new (gchar *title, - gchar *initial_palette); +PaletteSelect * palette_select_new (gchar *title, + gchar *initial_palette); + +void palette_select_clist_insert_all (PaletteEntries *p_entries); +void palette_select_set_text_all (PaletteEntries *entries); +void palette_select_refresh_all (void); -void palette_select_clist_insert_all (PaletteEntries *p_entries); -void palette_select_set_text_all (PaletteEntries *entries); -void palette_select_refresh_all (void); #endif /* __PALETTE_SELECT_H__ */ diff --git a/app/gui/paths-dialog.c b/app/gui/paths-dialog.c index 5fc00c8452..3b300f6c46 100644 --- a/app/gui/paths-dialog.c +++ b/app/gui/paths-dialog.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -33,6 +34,7 @@ #include "drawable.h" #include "floating_sel.h" #include "gimage.h" +#include "gimpcontext.h" #include "gimpimage.h" #include "gimpdrawable.h" #include "gimage_mask.h" @@ -51,10 +53,10 @@ #include "path_transform.h" #include "paths_dialog.h" #include "paths_dialogP.h" +#include "plug_in.h" +#include "procedural_db.h" #include "undo.h" -#include "drawable_pvt.h" - #include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" @@ -72,6 +74,7 @@ #include "pixmaps/path.xbm" #include "pixmaps/locked.xbm" + typedef struct _PathsDialog PathsDialog; struct _PathsDialog diff --git a/app/gui/paths-dialog.h b/app/gui/paths-dialog.h index 49ee8e147b..e00e050495 100644 --- a/app/gui/paths-dialog.h +++ b/app/gui/paths-dialog.h @@ -15,21 +15,34 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __PATHS_DIALOG_H__ #define __PATHS_DIALOG_H__ -void paths_dialog_new_path_callback (GtkWidget *, gpointer); -void paths_dialog_delete_path_callback (GtkWidget *, gpointer); -void paths_dialog_dup_path_callback (GtkWidget *, gpointer); -void paths_dialog_copy_path_callback (GtkWidget *, gpointer); -void paths_dialog_paste_path_callback (GtkWidget *, gpointer); -void paths_dialog_stroke_path_callback (GtkWidget *, gpointer); -void paths_dialog_path_to_sel_callback (GtkWidget *, gpointer); -void paths_dialog_sel_to_path_callback (GtkWidget *, gpointer); -void paths_dialog_import_path_callback (GtkWidget *, gpointer); -void paths_dialog_export_path_callback (GtkWidget *, gpointer); -void paths_dialog_edit_path_attributes_callback (GtkWidget *, gpointer); -void paths_dialog_destroy_cb (GtkObject *, gpointer); +void paths_dialog_new_path_callback (GtkWidget *widget, + gpointer data); +void paths_dialog_delete_path_callback (GtkWidget *widget, + gpointer data); +void paths_dialog_dup_path_callback (GtkWidget *widget, + gpointer data); +void paths_dialog_copy_path_callback (GtkWidget *widget, + gpointer data); +void paths_dialog_paste_path_callback (GtkWidget *widget, + gpointer data); +void paths_dialog_stroke_path_callback (GtkWidget *widget, + gpointer data); +void paths_dialog_path_to_sel_callback (GtkWidget *widget, + gpointer data); +void paths_dialog_sel_to_path_callback (GtkWidget *widget, + gpointer data); +void paths_dialog_import_path_callback (GtkWidget *widget, + gpointer data); +void paths_dialog_export_path_callback (GtkWidget *widget, + gpointer data); +void paths_dialog_edit_path_attributes_callback (GtkWidget *widget, + gpointer data); +void paths_dialog_destroy_cb (GtkObject *widget, + gpointer data); #endif /* __PATHS_DIALOG_H__ */ diff --git a/app/gui/pattern-select.c b/app/gui/pattern-select.c index 8e1176fd05..36b3b2544c 100644 --- a/app/gui/pattern-select.c +++ b/app/gui/pattern-select.c @@ -15,6 +15,7 @@ * 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 @@ -30,11 +31,13 @@ #include "gimpui.h" #include "patterns.h" #include "pattern_select.h" +#include "procedural_db.h" #include "session.h" +#include "temp_buf.h" -#include "config.h" #include "libgimp/gimpintl.h" + #define MIN_CELL_SIZE 32 #define MAX_CELL_SIZE 45 diff --git a/app/gui/pattern-select.h b/app/gui/pattern-select.h index 3cb585b8c7..466eef7796 100644 --- a/app/gui/pattern-select.h +++ b/app/gui/pattern-select.h @@ -19,8 +19,6 @@ #ifndef __PATTERN_SELECT_H__ #define __PATTERN_SELECT_H__ -#include "patterns.h" - typedef struct _PatternSelect PatternSelect; @@ -77,4 +75,5 @@ void patterns_check_dialogs (void); void pattern_dialog_create (void); void pattern_dialog_free (void); + #endif /* __PATTERN_SELECT_H__ */ diff --git a/app/gui/plug-in-commands.c b/app/gui/plug-in-commands.c index 55ca59c2c1..03e7a8c016 100644 --- a/app/gui/plug-in-commands.c +++ b/app/gui/plug-in-commands.c @@ -22,7 +22,7 @@ #include #endif -#include +#include #include #include @@ -88,13 +88,14 @@ #include "gdisplay.h" #include "general.h" #include "gimage.h" +#include "gimpprogress.h" #include "gimprc.h" #include "gradient_select.h" #include "menus.h" #include "pattern_select.h" /* Needed for closing pattern dialogs */ #include "plug_in.h" - -#include "tile.h" /* ick. */ +#include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpenv.h" #include "libgimp/gimpprotocol.h" diff --git a/app/gui/plug-in-menus.c b/app/gui/plug-in-menus.c index 55ca59c2c1..03e7a8c016 100644 --- a/app/gui/plug-in-menus.c +++ b/app/gui/plug-in-menus.c @@ -22,7 +22,7 @@ #include #endif -#include +#include #include #include @@ -88,13 +88,14 @@ #include "gdisplay.h" #include "general.h" #include "gimage.h" +#include "gimpprogress.h" #include "gimprc.h" #include "gradient_select.h" #include "menus.h" #include "pattern_select.h" /* Needed for closing pattern dialogs */ #include "plug_in.h" - -#include "tile.h" /* ick. */ +#include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpenv.h" #include "libgimp/gimpprotocol.h" diff --git a/app/gui/preferences-dialog.c b/app/gui/preferences-dialog.c index 044b51bad6..a85f2838c0 100644 --- a/app/gui/preferences-dialog.c +++ b/app/gui/preferences-dialog.c @@ -20,7 +20,7 @@ #include -#include +#include #include "apptypes.h" @@ -30,9 +30,12 @@ #include "cursorutil.h" #include "gdisplay_ops.h" #include "gdisplay.h" +#include "gimage.h" +#include "gimphelp.h" #include "gimprc.h" #include "gimpui.h" #include "image_render.h" +#include "layer.h" #include "lc_dialog.h" #include "layer_select.h" #include "resolution_calibrate.h" @@ -44,6 +47,7 @@ #include "libgimp/gimpintl.h" + /* gimprc will be parsed with a buffer size of 1024, so don't set this too large */ #define MAX_COMMENT_LENGTH 512 @@ -896,7 +900,7 @@ prefs_cancel_callback (GtkWidget *widget, transparency_size = old_transparency_size; render_setup (transparency_type, transparency_size); - gimage_foreach ((GFunc)layer_invalidate_previews, NULL); + gimage_foreach ((GFunc) layer_invalidate_previews, NULL); gimage_invalidate_previews (); gdisplays_expose_full (); gdisplays_flush (); diff --git a/app/gui/preferences-dialog.h b/app/gui/preferences-dialog.h index 6248568da9..9ee76ba152 100644 --- a/app/gui/preferences-dialog.h +++ b/app/gui/preferences-dialog.h @@ -20,7 +20,8 @@ #define __PREFERENCES_DIALOG_H__ -void prefs_cmd_callback (GtkWidget *widget, gpointer data); +void prefs_cmd_callback (GtkWidget *widget, + gpointer data); #endif /* __PREFERENCES_DIALOG_H__ */ diff --git a/app/gui/qmask-commands.c b/app/gui/qmask-commands.c index 34be73025d..1c4af4b114 100644 --- a/app/gui/qmask-commands.c +++ b/app/gui/qmask-commands.c @@ -29,11 +29,12 @@ #include "appenv.h" #include "channel.h" #include "color_panel.h" +#include "drawable.h" #include "floating_sel.h" -#include "gdisplayF.h" -#include "gimpcontext.h" +#include "gdisplay.h" #include "gimage_mask.h" #include "gimpimage.h" +#include "gimpcontext.h" #include "gimpui.h" #include "global_edit.h" #include "qmask.h" @@ -163,7 +164,7 @@ qmask_deactivate (GtkWidget *widget, the qmask_state to FALSE */ undo_push_qmask (gimg); gimage_mask_load (gimg, gmask); - gimage_remove_channel (gimg, gmask); + gimp_image_remove_channel (gimg, gmask); undo_push_group_end (gimg); } @@ -207,9 +208,9 @@ qmask_activate (GtkWidget *widget, undo_push_group_start (gimg, QMASK_UNDO); - if (gimage_mask_is_empty(gimg)) + if (gimage_mask_is_empty (gimg)) { - if ((layer = gimage_floating_sel (gimg))) + if ((layer = gimp_image_floating_sel (gimg))) { floating_sel_to_layer (layer); } @@ -217,7 +218,7 @@ qmask_activate (GtkWidget *widget, gmask = channel_new (gimg, gimg->width, gimg->height, - "Qmask", + "Qmask", (gint)(255*opacity)/100, color); gimp_image_add_channel (gimg, gmask, 0); @@ -225,7 +226,7 @@ qmask_activate (GtkWidget *widget, } else { /* if selection */ - gmask = channel_copy (gimage_get_mask (gimg)); + gmask = channel_copy (gimp_image_get_mask (gimg)); gimp_image_add_channel (gimg, gmask, 0); channel_set_color (gmask, color); drawable_set_name (GIMP_DRAWABLE (gmask), "Qmask"); @@ -331,12 +332,12 @@ edit_qmask_query_ok_callback (GtkWidget *widget, gpointer client_data) { EditQmaskOptions *options; - Channel *channel; - guchar *tmpcolp; - guchar tmpcol[3]; - gboolean update = FALSE; - gint opacity; - gint i; + Channel *channel; + const guchar *tmpcolp; + guchar tmpcol[3]; + gboolean update = FALSE; + gint opacity; + gint i; options = (EditQmaskOptions *) client_data; channel = gimp_image_get_channel_by_name (options->gimage, "Qmask"); @@ -348,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget, { update = TRUE; } - tmpcolp = channel_get_color(channel); + tmpcolp = channel_get_color (channel); for (i = 0; i < 3; i++) { /* don't update if color hasn't changed */ tmpcol[i] = tmpcolp[i]; /* initialize to same values */ diff --git a/app/gui/resize-dialog.c b/app/gui/resize-dialog.c index af13080eb3..cfec13b91f 100644 --- a/app/gui/resize-dialog.c +++ b/app/gui/resize-dialog.c @@ -23,7 +23,9 @@ #include "apptypes.h" #include "appenv.h" +#include "layer.h" #include "gdisplay.h" +#include "gimpimage.h" #include "resize.h" #include "undo.h" #include "gimprc.h" @@ -36,6 +38,7 @@ #include "libgimp/gimpintl.h" + #define EVENT_MASK GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK #define DRAWING_AREA_SIZE 200 #define TEXT_WIDTH 35 @@ -1253,12 +1256,12 @@ resize_events (GtkWidget *widget, void resize_scale_implement (ImageResize *image_scale) { - GImage *gimage = NULL; - gboolean rulers_flush = FALSE; - gboolean display_flush = FALSE; /* this is a bit ugly: - we hijack the flush variable - to check if an undo_group was - already started */ + GimpImage *gimage = NULL; + gboolean rulers_flush = FALSE; + gboolean display_flush = FALSE; /* this is a bit ugly: + we hijack the flush variable + to check if an undo_group was + already started */ g_assert (image_scale != NULL); gimage = image_scale->gimage; @@ -1269,9 +1272,9 @@ resize_scale_implement (ImageResize *image_scale) { undo_push_group_start (gimage, IMAGE_SCALE_UNDO); - gimage_set_resolution (gimage, - image_scale->resize->resolution_x, - image_scale->resize->resolution_y); + gimp_image_set_resolution (gimage, + image_scale->resize->resolution_x, + image_scale->resize->resolution_y); rulers_flush = TRUE; display_flush = TRUE; @@ -1282,7 +1285,7 @@ resize_scale_implement (ImageResize *image_scale) if (!display_flush) undo_push_group_start (gimage, IMAGE_SCALE_UNDO); - gimage_set_unit (gimage, image_scale->resize->unit); + gimp_image_set_unit (gimage, image_scale->resize->unit); gdisplays_setup_scale (gimage); gdisplays_resize_cursor_label (gimage); @@ -1299,9 +1302,9 @@ resize_scale_implement (ImageResize *image_scale) if (!display_flush) undo_push_group_start (gimage, IMAGE_SCALE_UNDO); - gimage_scale (gimage, - image_scale->resize->width, - image_scale->resize->height); + gimp_image_scale (gimage, + image_scale->resize->width, + image_scale->resize->height); display_flush = TRUE; } diff --git a/app/gui/resize-dialog.h b/app/gui/resize-dialog.h index 327bf4c103..a03fbfacf4 100644 --- a/app/gui/resize-dialog.h +++ b/app/gui/resize-dialog.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __RESIZE_H__ #define __RESIZE_H__ -#include "libgimp/gimpunit.h" -#include "gimage.h" typedef enum { @@ -73,23 +72,24 @@ typedef struct * If cancel_callback is NULL, then the dialog will be destroyed on "Cancel". */ -Resize * resize_widget_new (ResizeType type, - ResizeTarget target, - GtkObject *object, - gchar *signal, - gint width, - gint height, - gdouble resolution_x, - gdouble resolution_y, - GimpUnit unit, - gboolean dot_for_dot, - GtkSignalFunc ok_cb, - GtkSignalFunc cancel_cb, - gpointer user_data); +Resize * resize_widget_new (ResizeType type, + ResizeTarget target, + GtkObject *object, + gchar *signal, + gint width, + gint height, + gdouble resolution_x, + gdouble resolution_y, + GimpUnit unit, + gboolean dot_for_dot, + GtkSignalFunc ok_cb, + GtkSignalFunc cancel_cb, + gpointer user_data); /* Layer scaling sanity check and warning dialogs */ -gboolean resize_check_layer_scaling (ImageResize *image_resize); -void resize_scale_implement (ImageResize *image_resize); +gboolean resize_check_layer_scaling (ImageResize *image_resize); +void resize_scale_implement (ImageResize *image_resize); + #endif /* __RESIZE_H__ */ diff --git a/app/gui/tips-dialog.c b/app/gui/tips-dialog.c index 2096d21019..ed538bc748 100644 --- a/app/gui/tips-dialog.c +++ b/app/gui/tips-dialog.c @@ -25,6 +25,8 @@ #include +#include "apptypes.h" + #include "tips_dialog.h" #include "gimprc.h" #include "gimpui.h" diff --git a/app/gui/tips-dialog.h b/app/gui/tips-dialog.h index a50a0a0663..bde7ba8ee6 100644 --- a/app/gui/tips-dialog.h +++ b/app/gui/tips-dialog.h @@ -15,9 +15,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __TIPS_DIALOG_H__ #define __TIPS_DIALOG_H__ -void tips_dialog_create (void); + +void tips_dialog_create (void); + #endif /* __TIPS_DIALOG_H__ */ diff --git a/app/gui/user-install-dialog.c b/app/gui/user-install-dialog.c index baf1078ad0..817c212098 100644 --- a/app/gui/user-install-dialog.c +++ b/app/gui/user-install-dialog.c @@ -19,7 +19,7 @@ #include "config.h" -#include +#include #include #include @@ -49,6 +49,7 @@ #include "pixmaps/new.xpm" #include "pixmaps/wilber.xpm" + #ifndef G_OS_WIN32 # ifndef __EMX__ # define USER_INSTALL "user_install" diff --git a/app/guides_cmds.c b/app/guides_cmds.c index 296111b83e..7f24b23c0c 100644 --- a/app/guides_cmds.c +++ b/app/guides_cmds.c @@ -18,10 +18,15 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ +#include "config.h" + + +#include + +#include "apptypes.h" #include "procedural_db.h" #include "gimage.h" -#include "gimpimage.h" #include "undo.h" static ProcRecord image_add_hguide_proc; diff --git a/app/help_cmds.c b/app/help_cmds.c index aefe2ea1d1..d8ed0019dd 100644 --- a/app/help_cmds.c +++ b/app/help_cmds.c @@ -18,6 +18,13 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ +#include "config.h" + +#include + +#include + +#include "apptypes.h" #include "procedural_db.h" #include "gimphelp.h" diff --git a/app/histogram_tool.c b/app/histogram_tool.c index 5d31e2fa3f..5cb56d168f 100644 --- a/app/histogram_tool.c +++ b/app/histogram_tool.c @@ -15,20 +15,29 @@ * 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 #include "apptypes.h" #include "appenv.h" #include "drawable.h" #include "gdisplay.h" +#include "gimpimage.h" +#include "gimphistogram.h" #include "gimpui.h" #include "histogram_tool.h" +#include "histogramwidget.h" +#include "pixel_region.h" +#include "tool_options.h" +#include "tools.h" + +#include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" -#include "libgimp/gimpmath.h" + #define TEXT_WIDTH 45 #define GRADIENT_HEIGHT 15 @@ -204,7 +213,7 @@ histogram_tool_initialize (GDisplay *gdisp) { PixelRegion PR; - if (drawable_indexed (gimage_active_drawable (gdisp->gimage))) + if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Histogram does not operate on indexed drawables.")); return; @@ -216,7 +225,7 @@ histogram_tool_initialize (GDisplay *gdisp) else if (!GTK_WIDGET_VISIBLE (histogram_tool_dialog->shell)) gtk_widget_show (histogram_tool_dialog->shell); - histogram_tool_dialog->drawable = gimage_active_drawable (gdisp->gimage); + histogram_tool_dialog->drawable = gimp_image_active_drawable (gdisp->gimage); histogram_tool_dialog->color = drawable_color (histogram_tool_dialog->drawable); /* hide or show the channel menu based on image type */ diff --git a/app/histogram_tool.h b/app/histogram_tool.h index 2c8e0c8b40..825d44e25a 100644 --- a/app/histogram_tool.h +++ b/app/histogram_tool.h @@ -15,14 +15,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __HISTOGRAM_TOOL_H__ #define __HISTOGRAM_TOOL_H__ -#include "histogramwidget.h" -#include "image_map.h" -#include "tools.h" -#define HISTOGRAM_WIDTH 256 +#define HISTOGRAM_WIDTH 256 #define HISTOGRAM_HEIGHT 150 typedef struct _HistogramToolDialog HistogramToolDialog; @@ -61,4 +59,5 @@ void histogram_tool_histogram_range (HistogramWidget *hw, gint end, gpointer data); + #endif /* __HISTOGRAM_TOOL_H__ */ diff --git a/app/histogramwidget.c b/app/histogramwidget.c index db168227ad..f19014a114 100644 --- a/app/histogramwidget.c +++ b/app/histogramwidget.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include "apptypes.h" diff --git a/app/histogramwidget.h b/app/histogramwidget.h index afcb545b9f..249260c5f4 100644 --- a/app/histogramwidget.h +++ b/app/histogramwidget.h @@ -29,14 +29,8 @@ #define HISTOGRAM_WIDGET_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, histogram_widget_get_type (), HistogramWidget) #define IS_HISTOGRAM_WIDGET(obj) GTK_CHECK_TYPE (obj, histogram_widget_get_type ()) -typedef struct _HistogramWidget HistogramWidget; typedef struct _HistogramWidgetClass HistogramWidgetClass; - -/* HistogramWidget signals: - range_changed -*/ - struct _HistogramWidget { GtkDrawingArea drawingarea; diff --git a/app/hue_saturation.c b/app/hue_saturation.c index a02a97b84b..0caf2f0a6f 100644 --- a/app/hue_saturation.c +++ b/app/hue_saturation.c @@ -15,9 +15,10 @@ * 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 #include "apptypes.h" @@ -25,8 +26,13 @@ #include "drawable.h" #include "gimage_mask.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimpui.h" #include "hue_saturation.h" +#include "image_map.h" +#include "pixel_region.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpcolorspace.h" #include "libgimp/gimpmath.h" @@ -287,7 +293,7 @@ hue_saturation_initialize (GDisplay *gdisp) { gint i; - if (! drawable_color (gimage_active_drawable (gdisp->gimage))) + if (! drawable_color (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Hue-Saturation operates only on RGB color drawables.")); return; @@ -307,7 +313,7 @@ hue_saturation_initialize (GDisplay *gdisp) hue_saturation_dialog->saturation[i] = 0.0; } - hue_saturation_dialog->drawable = gimage_active_drawable (gdisp->gimage); + hue_saturation_dialog->drawable = gimp_image_active_drawable (gdisp->gimage); hue_saturation_dialog->image_map = image_map_create (gdisp, hue_saturation_dialog->drawable); diff --git a/app/hue_saturation.h b/app/hue_saturation.h index b796dba946..80ee176884 100644 --- a/app/hue_saturation.h +++ b/app/hue_saturation.h @@ -19,9 +19,6 @@ #ifndef __HUE_SATURATION_H__ #define __HUE_SATURATION_H__ -#include "image_map.h" -#include "tools.h" - typedef enum { @@ -57,16 +54,17 @@ struct _HueSaturationDialog gboolean preview; }; -Tool * tools_new_hue_saturation (void); -void tools_free_hue_saturation (Tool *tool); +Tool * tools_new_hue_saturation (void); +void tools_free_hue_saturation (Tool *tool); -void hue_saturation_initialize (GDisplay *gdisp); -void hue_saturation_free (void); -void hue_saturation_dialog_hide (void); -void hue_saturation (PixelRegion *srcPR, - PixelRegion *destPR, - void *data); +void hue_saturation_initialize (GDisplay *gdisp); +void hue_saturation_free (void); +void hue_saturation_dialog_hide (void); +void hue_saturation (PixelRegion *srcPR, + PixelRegion *destPR, + void *data); + +void hue_saturation_calculate_transfers (HueSaturationDialog *hsd); -void hue_saturation_calculate_transfers (HueSaturationDialog *hsd); #endif /* __HUE_SATURATION_H__ */ diff --git a/app/image_cmds.c b/app/image_cmds.c index 217f38d400..cd7e53bc1d 100644 --- a/app/image_cmds.c +++ b/app/image_cmds.c @@ -18,13 +18,15 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ -#include "procedural_db.h" - #include "config.h" #include +#include + #include "apptypes.h" +#include "procedural_db.h" + #include "channel.h" #include "cursorutil.h" #include "drawable.h" @@ -32,7 +34,7 @@ #include "gimage.h" #include "gimpimage.h" #include "layer.h" -#include "layer_pvt.h" +#include "temp_buf.h" #include "libgimp/gimpintl.h" #include "libgimp/gimplimits.h" diff --git a/app/image_map.c b/app/image_map.c index 7fcbd822fd..e4ba40e097 100644 --- a/app/image_map.c +++ b/app/image_map.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include "apptypes.h" @@ -28,8 +28,10 @@ #include "gimage.h" #include "gimage_mask.h" #include "image_map.h" +#include "paint_funcs.h" +#include "pixel_region.h" +#include "tile.h" #include "tile_manager.h" - #include "tile_manager_pvt.h" diff --git a/app/image_map.h b/app/image_map.h index 76f867dbc9..8af03f09a8 100644 --- a/app/image_map.h +++ b/app/image_map.h @@ -15,15 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __IMAGE_MAP_H__ #define __IMAGE_MAP_H__ -#include "apptypes.h" -#include "pixel_region.h" - -/* Image map apply function */ -typedef void * ImageMap; -typedef void (* ImageMapApplyFunc) (PixelRegion *, PixelRegion *, void *); /* Image Map functions */ @@ -31,11 +26,17 @@ typedef void (* ImageMapApplyFunc) (PixelRegion *, PixelRegion *, void *); * MUST be followed with an image_map_commit or an image_map_abort call * The image map is no longer valid after a call to commit or abort. */ -ImageMap image_map_create (void *, GimpDrawable *); -void image_map_apply (ImageMap, ImageMapApplyFunc, void *); -void image_map_commit (ImageMap); -void image_map_clear (ImageMap); -void image_map_abort (ImageMap); -unsigned char *image_map_get_color_at (ImageMap, int, int); +ImageMap image_map_create (void *, + GimpDrawable *); +void image_map_apply (ImageMap, + ImageMapApplyFunc, + void *); +void image_map_commit (ImageMap); +void image_map_clear (ImageMap); +void image_map_abort (ImageMap); +guchar * image_map_get_color_at (ImageMap, + gint, + gint); + #endif /* __IMAGE_MAP_H__ */ diff --git a/app/image_new.c b/app/image_new.c index 71697afd8d..cbff68cc04 100644 --- a/app/image_new.c +++ b/app/image_new.c @@ -20,16 +20,20 @@ #include -#include "image_new.h" +#include "apptypes.h" #include "appenv.h" #include "apptypes.h" +#include "drawable.h" #include "gimprc.h" #include "file_new_dialog.h" #include "tile_manager_pvt.h" #include "gdisplay.h" #include "gimpcontext.h" #include "gimage.h" +#include "image_new.h" +#include "layer.h" +#include "paint_funcs.h" #include "libgimp/gimpparasite.h" diff --git a/app/image_new.h b/app/image_new.h index c75263d6f2..18e5a33bbe 100644 --- a/app/image_new.h +++ b/app/image_new.h @@ -19,8 +19,6 @@ #ifndef __IMAGE_NEW_H__ #define __IMAGE_NEW_H__ -#include "gimpimage.h" -#include "gimpdrawable.h" #ifdef __cplusplus extern "C" { @@ -38,7 +36,7 @@ typedef struct gchar *name; } GimpFillTypeName; -typedef struct +struct _GimpImageNewValues { gint width; gint height; @@ -50,7 +48,7 @@ typedef struct GimpImageBaseType type; GimpFillType fill_type; -} GimpImageNewValues; +}; GList * image_new_get_fill_type_names (void); GList * image_new_get_image_base_type_names (void); diff --git a/app/image_render.c b/app/image_render.c index a81e0bb405..9b05ab8b33 100644 --- a/app/image_render.c +++ b/app/image_render.c @@ -26,13 +26,16 @@ #include "apptypes.h" #include "appenv.h" +#include "gdisplay.h" +#include "gimpimage.h" #include "gimprc.h" #include "gximage.h" #include "image_render.h" #include "pixel_region.h" #include "scale.h" +#include "tile.h" +#include "tile_manager.h" -#include "tile.h" /* ick. */ typedef struct _RenderInfo RenderInfo; typedef void (*RenderFunc) (RenderInfo *info); @@ -230,11 +233,11 @@ render_image (GDisplay *gdisp, render_image_init_info (&info, gdisp, x, y, w, h); - image_type = gimage_projection_type (gdisp->gimage); + image_type = gimp_image_projection_type (gdisp->gimage); if ((image_type < 0) || (image_type > 5)) { g_message ("unknown gimage projection type: %d", - gimage_projection_type (gdisp->gimage)); + gimp_image_projection_type (gdisp->gimage)); return; } @@ -272,7 +275,7 @@ render_image_indexed (RenderInfo *info) float error; float step; - cmap = gimage_cmap (info->gdisp->gimage); + cmap = gimp_image_cmap (info->gdisp->gimage); y = info->y; ye = info->y + info->h; @@ -344,7 +347,7 @@ render_image_indexed_a (RenderInfo *info) float error; float step; - cmap = gimage_cmap (info->gdisp->gimage); + cmap = gimp_image_cmap (info->gdisp->gimage); alpha = info->alpha; y = info->y; @@ -725,7 +728,7 @@ render_image_init_info (RenderInfo *info, int h) { info->gdisp = gdisp; - info->src_tiles = gimage_projection (gdisp->gimage); + info->src_tiles = gimp_image_projection (gdisp->gimage); info->x = x + gdisp->offset_x; info->y = y + gdisp->offset_y; info->w = w; @@ -734,7 +737,7 @@ render_image_init_info (RenderInfo *info, info->scaley = SCALEFACTOR_Y (gdisp); info->src_x = UNSCALEX (gdisp, info->x); info->src_y = UNSCALEY (gdisp, info->y); - info->src_bpp = gimage_projection_bytes (gdisp->gimage); + info->src_bpp = gimp_image_projection_bytes (gdisp->gimage); info->dest = gximage_get_data (); info->dest_bpp = gximage_get_bpp (); info->dest_bpl = gximage_get_bpl (); @@ -743,12 +746,12 @@ render_image_init_info (RenderInfo *info, info->scale = render_image_accelerate_scaling (w, info->x, info->scalex); info->alpha = NULL; - switch (gimage_projection_type (gdisp->gimage)) + switch (gimp_image_projection_type (gdisp->gimage)) { case RGBA_GIMAGE: case GRAYA_GIMAGE: case INDEXEDA_GIMAGE: - info->alpha = render_image_init_alpha (gimage_projection_opacity (gdisp->gimage)); + info->alpha = render_image_init_alpha (gimp_image_projection_opacity (gdisp->gimage)); break; default: /* nothing special needs doing */ diff --git a/app/image_render.h b/app/image_render.h index 5a5d0ba72c..e9b7ac4d2e 100644 --- a/app/image_render.h +++ b/app/image_render.h @@ -15,10 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __IMAGE_RENDER_H__ #define __IMAGE_RENDER_H__ -#include "gdisplay.h" /* Transparency representation */ @@ -34,14 +34,14 @@ #define LARGE_CHECKS 2 /* Functions */ -void render_setup (int check_type, - int check_size); +void render_setup (gint check_type, + gint check_size); void render_free (void); void render_image (GDisplay *gdisp, - int x, - int y, - int w, - int h); + gint x, + gint y, + gint w, + gint h); /* * Extern variables diff --git a/app/indicator_area.c b/app/indicator_area.c index 4cf0190b03..d7ea146a42 100644 --- a/app/indicator_area.c +++ b/app/indicator_area.c @@ -15,25 +15,29 @@ * 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 -#include +#include #include "apptypes.h" #include "appenv.h" #include "brush_select.h" +#include "gimpcontext.h" #include "gimpcontextpreview.h" #include "gimpdnd.h" +#include "gimpui.h" #include "gradient_select.h" #include "indicator_area.h" #include "pattern_select.h" #include "libgimp/gimpintl.h" + #define CELL_SIZE 23 /* The size of the previews */ #define GRAD_CELL_WIDTH 48 /* The width of the gradient preview */ #define GRAD_CELL_HEIGHT 12 /* The height of the gradient preview */ diff --git a/app/indicator_area.h b/app/indicator_area.h index 76969ca3ed..089f7ee960 100644 --- a/app/indicator_area.h +++ b/app/indicator_area.h @@ -15,9 +15,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __INDICATOR_AREA_H__ #define __INDICATOR_AREA_H__ + GtkWidget * indicator_area_create (void); + #endif /* __INDICATOR_AREA_H__ */ diff --git a/app/info_dialog.h b/app/info_dialog.h index e033e33048..ce903888c7 100644 --- a/app/info_dialog.h +++ b/app/info_dialog.h @@ -19,11 +19,6 @@ #ifndef __INFO_DIALOG_H__ #define __INFO_DIALOG_H__ -#include "gimphelp.h" - -#include "libgimp/gimpsizeentry.h" -#include "libgimp/gimpunit.h" - typedef enum { @@ -35,7 +30,6 @@ typedef enum } InfoFieldType; typedef struct _InfoField InfoField; -typedef struct _InfoDialog InfoDialog; struct _InfoField { diff --git a/app/info_window.c b/app/info_window.c index cf29082be5..6c12d5df5a 100644 --- a/app/info_window.c +++ b/app/info_window.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include "apptypes.h" @@ -27,11 +27,13 @@ #include "colormaps.h" #include "gdisplay.h" #include "gimpcontext.h" +#include "gimpimage.h" #include "gimpset.h" #include "gimpui.h" #include "gximage.h" #include "info_dialog.h" #include "info_window.h" +#include "procedural_db.h" #include "scroll.h" #include "tools.h" @@ -39,6 +41,7 @@ #include "libgimp/gimpintl.h" + #define MAX_BUF 256 typedef struct _InfoWinData InfoWinData; @@ -245,8 +248,8 @@ info_window_create (GDisplay *gdisp) gchar *title, *title_buf; gint type; - title = g_basename (gimage_filename (gdisp->gimage)); - type = gimage_base_type (gdisp->gimage); + title = g_basename (gimp_image_filename (gdisp->gimage)); + type = gimp_image_base_type (gdisp->gimage); /* create the info dialog */ title_buf = info_window_title (gdisp); @@ -314,7 +317,7 @@ info_window_title (GDisplay *gdisp) gchar *title; gchar *title_buf; - title = g_basename (gimage_filename (gdisp->gimage)); + title = g_basename (gimp_image_filename (gdisp->gimage)); /* create the info dialog */ title_buf = g_strdup_printf (_("Info: %s-%d.%d"), @@ -421,7 +424,7 @@ info_window_update_RGB (GDisplay *gdisp, if (!iwd || iwd->showingPreview == FALSE) return; - /* gimage_active_drawable (gdisp->gimage) */ + /* gimp_image_active_drawable (gdisp->gimage) */ if (!(color = gimp_image_get_color_at (gdisp->gimage, tx, ty)) || (tx < 0.0 && ty < 0.0)) { @@ -531,7 +534,7 @@ info_window_update (GDisplay *gdisp) g_snprintf (iwd->scale_str, MAX_BUF, "%d:%d", SCALEDEST (gdisp), SCALESRC (gdisp)); - type = gimage_base_type (gdisp->gimage); + type = gimp_image_base_type (gdisp->gimage); /* color type */ if (type == RGB) diff --git a/app/info_window.h b/app/info_window.h index 51be465741..6c5c90e858 100644 --- a/app/info_window.h +++ b/app/info_window.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __INFO_WINDOW_H__ #define __INFO_WINDOW_H__ -#include "gdisplayF.h" -#include "info_dialog.h" InfoDialog * info_window_create (GDisplay *gdisp); void info_window_free (InfoDialog *info_win); @@ -29,4 +28,6 @@ void info_window_update_RGB (GDisplay *gdisp, gdouble tx, gdouble ty); void info_window_follow_auto (void); + + #endif /* __INFO_WINDOW_H__ */ diff --git a/app/ink.c b/app/ink.c index ec28ff1b3c..3673948f53 100644 --- a/app/ink.c +++ b/app/ink.c @@ -21,7 +21,7 @@ #include #include -#include +#include #include "apptypes.h" @@ -29,6 +29,8 @@ #include "drawable.h" #include "draw_core.h" #include "gimage_mask.h" +#include "gimpcontext.h" +#include "gimpimage.h" #include "gimprc.h" #include "gimpui.h" #include "ink.h" @@ -37,11 +39,16 @@ #include "undo.h" #include "blob.h" #include "gdisplay.h" +#include "paint_funcs.h" +#include "pixel_region.h" +#include "temp_buf.h" +#include "tile.h" +#include "tile_manager.h" -#include "libgimp/gimpintl.h" #include "libgimp/gimpmath.h" -#include "tile.h" /* ick. */ +#include "libgimp/gimpintl.h" + #define SUBSAMPLE 8 @@ -805,7 +812,7 @@ ink_button_press (Tool *tool, /* Keep the coordinates of the target */ gdisplay_untransform_coords_f (gdisp, bevent->x, bevent->y, &x, &y, TRUE); - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); ink_init (ink_tool, drawable, x, y); @@ -872,7 +879,7 @@ ink_button_release (Tool *tool, g_free (ink_tool->last_blob); ink_tool->last_blob = NULL; - ink_finish (ink_tool, gimage_active_drawable (gdisp->gimage), tool->ID); + ink_finish (ink_tool, gimp_image_active_drawable (gdisp->gimage), tool->ID); gdisplays_flush (); } @@ -976,7 +983,7 @@ ink_motion (Tool *tool, ink_tool = (InkTool *) tool->private; gdisplay_untransform_coords_f (gdisp, mevent->x, mevent->y, &x, &y, TRUE); - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); lasttime = ink_tool->last_time; @@ -1038,7 +1045,7 @@ ink_cursor_update (Tool *tool, gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, FALSE, FALSE); - if ((layer = gimage_get_active_layer (gdisp->gimage))) + if ((layer = gimp_image_get_active_layer (gdisp->gimage))) { int off_x, off_y; @@ -1385,7 +1392,7 @@ ink_paste (InkTool *ink_tool, if (!canvas_buf) return; - gimage_get_foreground (gimage, drawable, col); + gimp_image_get_foreground (gimage, drawable, col); /* set the alpha channel */ col[canvas_buf->bytes - 1] = OPAQUE_OPACITY; @@ -1414,12 +1421,12 @@ ink_paste (InkTool *ink_tool, srcPR.data = temp_buf_data (canvas_buf); /* apply the paint area to the gimage */ - gimage_apply_image (gimage, drawable, &srcPR, - FALSE, - (int) (gimp_context_get_opacity (NULL) * 255), - gimp_context_get_paint_mode (NULL), - undo_tiles, /* specify an alternative src1 */ - canvas_buf->x, canvas_buf->y); + gimp_image_apply_image (gimage, drawable, &srcPR, + FALSE, + (int) (gimp_context_get_opacity (NULL) * 255), + gimp_context_get_paint_mode (NULL), + undo_tiles, /* specify an alternative src1 */ + canvas_buf->x, canvas_buf->y); /* Update the undo extents */ ink_tool->x1 = MIN (ink_tool->x1, canvas_buf->x); diff --git a/app/ink.h b/app/ink.h index 6be250088d..3dfb214846 100644 --- a/app/ink.h +++ b/app/ink.h @@ -15,16 +15,16 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __INK_H__ #define __INK_H__ -#include "tools.h" -#include "procedural_db.h" -Tool * tools_new_ink (void); -void tools_free_ink (Tool *); +Tool * tools_new_ink (void); +void tools_free_ink (Tool *tool); /* Procedure definition and marshalling function */ extern ProcRecord ink_proc; + #endif /* __INK_H__ */ diff --git a/app/interface.c b/app/interface.c index b1edbf3929..5e3df5b2a2 100644 --- a/app/interface.c +++ b/app/interface.c @@ -35,7 +35,9 @@ #include "gdisplay.h" #include "gdisplay_ops.h" #include "gimage.h" +#include "gimpcontext.h" #include "gimpdnd.h" +#include "gimpdrawable.h" #include "gimphelp.h" #include "gimprc.h" #include "gimpui.h" @@ -43,10 +45,15 @@ #include "gtkvwrapbox.h" #include "indicator_area.h" #include "interface.h" +#include "layer.h" #include "menus.h" #include "nav_window.h" +#include "paint_funcs.h" +#include "pixel_region.h" #include "qmask.h" #include "session.h" +#include "pixel_region.h" +#include "tile_manager.h" #include "tools.h" #include "pixmaps.h" @@ -1211,7 +1218,7 @@ toolbox_drag_drop (GtkWidget *widget, } new_gimage = gimage_new (width, height, type); - gimage_disable_undo (new_gimage); + gimp_image_undo_disable (new_gimage); if (type == INDEXED) /* copy the colormap */ { @@ -1219,8 +1226,9 @@ toolbox_drag_drop (GtkWidget *widget, memcpy (new_gimage->cmap, gimage->cmap, COLORMAP_SIZE); } - gimage_set_resolution (new_gimage, gimage->xresolution, gimage->yresolution); - gimage_set_unit (new_gimage, gimage->unit); + gimp_image_set_resolution (new_gimage, + gimage->xresolution, gimage->yresolution); + gimp_image_set_unit (new_gimage, gimage->unit); if (layer) { @@ -1274,12 +1282,12 @@ toolbox_drag_drop (GtkWidget *widget, gimp_drawable_offsets (GIMP_DRAWABLE (new_layer), &off_x, &off_y); layer_translate (new_layer, -off_x, -off_y); - gimage_add_layer (new_gimage, new_layer, 0); + gimp_image_add_layer (new_gimage, new_layer, 0); gimp_context_set_display (gimp_context_get_user (), gdisplay_new (new_gimage, 0x0101)); - gimage_enable_undo (new_gimage); + gimp_image_undo_enable (new_gimage); return_val = TRUE; } diff --git a/app/interface.h b/app/interface.h index 7fe1acd8d4..3590b7f649 100644 --- a/app/interface.h +++ b/app/interface.h @@ -15,13 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __INTERFACE_H__ #define __INTERFACE_H__ -#include "toolsF.h" -#include "gdisplayF.h" -/* function declarations */ GtkWidget * create_pixmap_widget (GdkWindow *parent, gchar **data, gint width, @@ -39,4 +37,5 @@ void create_display_shell (GDisplay *gdisp, gchar *title, gint type); + #endif /* __INTERFACE_H__ */ diff --git a/app/invert.c b/app/invert.c index 65d4e71085..005d0d4aaf 100644 --- a/app/invert.c +++ b/app/invert.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include "apptypes.h" @@ -28,6 +28,9 @@ #include "gimage.h" #include "gimplut.h" #include "lut_funcs.h" +#include "pixel_processor.h" +#include "pixel_region.h" +#include "procedural_db.h" #include "libgimp/gimpintl.h" diff --git a/app/invert.h b/app/invert.h index bc50e0fd8a..921189b4e2 100644 --- a/app/invert.h +++ b/app/invert.h @@ -19,9 +19,9 @@ #ifndef __INVERT_H__ #define __INVERT_H__ -/* invert functions */ -void image_invert (GimpImage *); -void invert (GimpDrawable *); + +void image_invert (GimpImage *gimage); +void invert (GimpDrawable *drawable); #endif /* __INVERT_H__ */ diff --git a/app/iscissors.c b/app/iscissors.c index d695c6e91d..cf075959c2 100644 --- a/app/iscissors.c +++ b/app/iscissors.c @@ -28,7 +28,8 @@ * until about 1.1.4) completely changed the algorithm used, until it * bore little resemblance to the one described in the paper above. * The 0.54 version of the algorithm was then forwards ported to 1.1.4 - * by Austin Donnelly. */ + * by Austin Donnelly. + */ #include "config.h" @@ -41,22 +42,27 @@ #include "appenv.h" #include "draw_core.h" -#include "channel_pvt.h" +#include "channel.h" #include "cursorutil.h" #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "iscissors.h" #include "edit_selection.h" #include "paint_funcs.h" +#include "pixel_region.h" #include "selection_options.h" #include "temp_buf.h" #include "tools.h" #include "bezier_selectP.h" #include "scan_convert.h" +#include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpmath.h" + #ifdef DEBUG #define TRC(x) g_print x #define D(x) x @@ -415,7 +421,7 @@ iscissors_button_press (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; iscissors = (Iscissors *) tool->private; - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); gdisplay_untransform_coords (gdisp, bevent->x, bevent->y, &iscissors->x, &iscissors->y, FALSE, FALSE); @@ -493,12 +499,12 @@ iscissors_button_press (Tool *tool, if (((SelectionOptions *) iscissors_options)->feather) channel_feather (iscissors->mask, - gimage_get_mask (gdisp->gimage), + gimp_image_get_mask (gdisp->gimage), ((SelectionOptions *) iscissors_options)->feather_radius, ((SelectionOptions *) iscissors_options)->feather_radius, iscissors->op, 0, 0); else - channel_combine_mask (gimage_get_mask (gdisp->gimage), + channel_combine_mask (gimp_image_get_mask (gdisp->gimage), iscissors->mask, iscissors->op, 0, 0); iscissors_reset (iscissors); diff --git a/app/iscissors.h b/app/iscissors.h index ab21c1de74..a89cb37451 100644 --- a/app/iscissors.h +++ b/app/iscissors.h @@ -15,10 +15,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __ISCISSORS_H__ #define __ISCISSORS_H__ -Tool * tools_new_iscissors (void); -void tools_free_iscissors (Tool *); + +Tool * tools_new_iscissors (void); +void tools_free_iscissors (Tool *tool); + #endif /* __ISCISSORS_H__ */ diff --git a/app/layer.c b/app/layer.c index 2efcb7e6ac..58e99a0651 100644 --- a/app/layer.c +++ b/app/layer.c @@ -23,24 +23,26 @@ #include #include -#include +#include +#include "apptypes.h" + +#include "boundary.h" #include "drawable.h" #include "floating_sel.h" #include "gdisplay.h" -#include "gimage.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "layer.h" #include "paint_funcs.h" +#include "pixel_region.h" #include "temp_buf.h" #include "parasitelist.h" #include "undo.h" #include "gimpsignal.h" #include "gimppreviewcache.h" - -#include "layer_pvt.h" -#include "tile_manager_pvt.h" -#include "tile.h" /* ick. */ +#include "tile_manager.h" +#include "tile.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpparasite.h" @@ -242,9 +244,9 @@ transform_color (GImage *gimage, { for (i = 0; i < layerPR->w; i++) { - gimage_transform_color (gimage, drawable, - s + (i * bufPR->bytes), - d + (i * layerPR->bytes), type); + gimp_image_transform_color (gimage, drawable, + s + (i * bufPR->bytes), + d + (i * layerPR->bytes), type); /* copy alpha channel */ d[(i + 1) * layerPR->bytes - 1] = s[(i + 1) * bufPR->bytes - 1]; } @@ -449,7 +451,9 @@ layer_new_from_tiles (GimpImage *gimage, g_return_val_if_fail (GIMP_IMAGE_TYPE_HAS_ALPHA (layer_type), NULL); /* Create the new layer */ - new_layer = layer_new (0, tiles->width, tiles->height, + new_layer = layer_new (0, + tile_manager_level_width (tiles), + tile_manager_level_height (tiles), layer_type, name, opacity, mode); if (!new_layer) @@ -467,17 +471,19 @@ layer_new_from_tiles (GimpImage *gimage, pixel_region_init (&bufPR, tiles, 0, 0, GIMP_DRAWABLE (new_layer)->width, - GIMP_DRAWABLE (new_layer)->height, + GIMP_DRAWABLE (new_layer)->height, FALSE); - if ((tiles->bpp == 4 && GIMP_DRAWABLE (new_layer)->type == RGBA_GIMAGE) || - (tiles->bpp == 2 && GIMP_DRAWABLE (new_layer)->type == GRAYA_GIMAGE)) + if ((tile_manager_level_bpp (tiles) == 4 && + GIMP_DRAWABLE (new_layer)->type == RGBA_GIMAGE) || + (tile_manager_level_bpp (tiles) == 2 && + GIMP_DRAWABLE (new_layer)->type == GRAYA_GIMAGE)) /* If we want a layer the same type as the buffer */ copy_region (&bufPR, &layerPR); else /* Transform the contents of the buf to the new_layer */ transform_color (gimage, &layerPR, &bufPR, GIMP_DRAWABLE (new_layer), - (tiles->bpp == 4) ? RGB : GRAY); + (tile_manager_level_bpp (tiles) == 4) ? RGB : GRAY); return new_layer; } @@ -1069,8 +1075,8 @@ layer_resize (Layer *layer, else { unsigned char bg[3]; - gimage_get_background (GIMP_DRAWABLE(layer)->gimage, - GIMP_DRAWABLE(layer), bg); + gimp_image_get_background (GIMP_DRAWABLE (layer)->gimage, + GIMP_DRAWABLE (layer), bg); color_region (&destPR, bg); } pixel_region_init (&destPR, new_tiles, @@ -1160,28 +1166,28 @@ layer_boundary (Layer *layer, layer = GIMP_LAYER (layer->fs.drawable); } - new_segs[0].x1 = GIMP_DRAWABLE(layer)->offset_x; - new_segs[0].y1 = GIMP_DRAWABLE(layer)->offset_y; - new_segs[0].x2 = GIMP_DRAWABLE(layer)->offset_x; - new_segs[0].y2 = GIMP_DRAWABLE(layer)->offset_y + GIMP_DRAWABLE(layer)->height; + new_segs[0].x1 = GIMP_DRAWABLE (layer)->offset_x; + new_segs[0].y1 = GIMP_DRAWABLE (layer)->offset_y; + new_segs[0].x2 = GIMP_DRAWABLE (layer)->offset_x; + new_segs[0].y2 = GIMP_DRAWABLE (layer)->offset_y + GIMP_DRAWABLE (layer)->height; new_segs[0].open = 1; - new_segs[1].x1 = GIMP_DRAWABLE(layer)->offset_x; - new_segs[1].y1 = GIMP_DRAWABLE(layer)->offset_y; - new_segs[1].x2 = GIMP_DRAWABLE(layer)->offset_x + GIMP_DRAWABLE(layer)->width; - new_segs[1].y2 = GIMP_DRAWABLE(layer)->offset_y; + new_segs[1].x1 = GIMP_DRAWABLE (layer)->offset_x; + new_segs[1].y1 = GIMP_DRAWABLE (layer)->offset_y; + new_segs[1].x2 = GIMP_DRAWABLE (layer)->offset_x + GIMP_DRAWABLE (layer)->width; + new_segs[1].y2 = GIMP_DRAWABLE (layer)->offset_y; new_segs[1].open = 1; - new_segs[2].x1 = GIMP_DRAWABLE(layer)->offset_x + GIMP_DRAWABLE(layer)->width; - new_segs[2].y1 = GIMP_DRAWABLE(layer)->offset_y; - new_segs[2].x2 = GIMP_DRAWABLE(layer)->offset_x + GIMP_DRAWABLE(layer)->width; - new_segs[2].y2 = GIMP_DRAWABLE(layer)->offset_y + GIMP_DRAWABLE(layer)->height; + new_segs[2].x1 = GIMP_DRAWABLE (layer)->offset_x + GIMP_DRAWABLE (layer)->width; + new_segs[2].y1 = GIMP_DRAWABLE (layer)->offset_y; + new_segs[2].x2 = GIMP_DRAWABLE (layer)->offset_x + GIMP_DRAWABLE (layer)->width; + new_segs[2].y2 = GIMP_DRAWABLE (layer)->offset_y + GIMP_DRAWABLE (layer)->height; new_segs[2].open = 0; - new_segs[3].x1 = GIMP_DRAWABLE(layer)->offset_x; - new_segs[3].y1 = GIMP_DRAWABLE(layer)->offset_y + GIMP_DRAWABLE(layer)->height; - new_segs[3].x2 = GIMP_DRAWABLE(layer)->offset_x + GIMP_DRAWABLE(layer)->width; - new_segs[3].y2 = GIMP_DRAWABLE(layer)->offset_y + GIMP_DRAWABLE(layer)->height; + new_segs[3].x1 = GIMP_DRAWABLE (layer)->offset_x; + new_segs[3].y1 = GIMP_DRAWABLE (layer)->offset_y + GIMP_DRAWABLE (layer)->height; + new_segs[3].x2 = GIMP_DRAWABLE (layer)->offset_x + GIMP_DRAWABLE (layer)->width; + new_segs[3].y2 = GIMP_DRAWABLE (layer)->offset_y + GIMP_DRAWABLE (layer)->height; new_segs[3].open = 0; return new_segs; @@ -1190,7 +1196,7 @@ layer_boundary (Layer *layer, void layer_invalidate_boundary (Layer *layer) { - GImage *gimage; + GImage *gimage; Channel *mask; /* first get the selection mask channel */ @@ -1203,7 +1209,7 @@ layer_invalidate_boundary (Layer *layer) /* clear the affected region surrounding the layer */ gdisplays_selection_visibility (gimage, SelectionLayerOff); - mask = gimage_get_mask (gimage); + mask = gimp_image_get_mask (gimage); /* Only bother with the bounds if there is a selection */ if (! channel_is_empty (mask)) diff --git a/app/layer.h b/app/layer.h index 0670f80fb2..80a5865fb5 100644 --- a/app/layer.h +++ b/app/layer.h @@ -19,16 +19,11 @@ #ifndef __LAYER_H__ #define __LAYER_H__ -#include "apptypes.h" -#include "drawable.h" -#include "boundary.h" + #include "channel.h" -#include "temp_buf.h" -#include "tile_manager.h" +#include "gimpdrawable.h" -/* structure declarations */ - #define GIMP_TYPE_LAYER (gimp_layer_get_type ()) #define GIMP_LAYER(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_LAYER, GimpLayer)) #define GIMP_LAYER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LAYER, GimpLayerClass)) @@ -41,8 +36,53 @@ #define GIMP_IS_LAYER_MASK(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_LAYER_MASK)) #define GIMP_IS_LAYER_MASK_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_LAYER_MASK)) -GtkType gimp_layer_get_type (void); -GtkType gimp_layer_mask_get_type (void); + +struct _GimpLayer +{ + GimpDrawable drawable; + + gboolean linked; /* control linkage */ + gboolean preserve_trans; /* preserve transparency */ + + LayerMask *mask; /* possible layer mask */ + gint apply_mask; /* controls mask application */ + gboolean edit_mask; /* edit mask or layer? */ + gboolean show_mask; /* show mask or layer? */ + + gint opacity; /* layer opacity */ + LayerModeEffects mode; /* layer combination mode */ + + /* Floating selections */ + struct + { + TileManager *backing_store; /* for obscured regions */ + GimpDrawable *drawable; /* floating sel is attached to */ + gboolean initial; /* is fs composited yet? */ + + gboolean boundary_known; /* is the current boundary valid */ + BoundSeg *segs; /* boundary of floating sel */ + gint num_segs; /* number of segs in boundary */ + } fs; +}; + +struct _GimpLayerClass +{ + GimpDrawableClass parent_class; + + void (* removed) (GimpLayer *layer); +}; + +struct _GimpLayerMask +{ + GimpChannel drawable; + + Layer *layer; +}; + +struct _GimpLayerMaskClass +{ + GimpChannelClass parent_class; +}; /* Special undo types */ @@ -71,6 +111,8 @@ struct _fs_to_layer_undo /* function declarations */ +GtkType gimp_layer_get_type (void); + Layer * layer_new (GimpImage *gimage, gint width, gint height, @@ -124,6 +166,9 @@ gint layer_pick_correlate (Layer *layer, gint x, gint y); + +GtkType gimp_layer_mask_get_type (void); + LayerMask * layer_mask_new (GimpImage *gimage, gint width, gint height, diff --git a/app/layer_cmds.c b/app/layer_cmds.c index 6c45c8ef4a..b6540613cd 100644 --- a/app/layer_cmds.c +++ b/app/layer_cmds.c @@ -18,14 +18,19 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ -#include "procedural_db.h" +#include "config.h" + + +#include #include "apptypes.h" +#include "procedural_db.h" + #include "channel.h" #include "drawable.h" #include "floating_sel.h" +#include "gimpimage.h" #include "layer.h" -#include "layer_pvt.h" #include "undo.h" static ProcRecord layer_new_proc; @@ -377,7 +382,7 @@ layer_scale_invoker (Argument *args) { if ((gimage = GIMP_DRAWABLE(layer)->gimage)) { - floating_layer = gimage_floating_sel (gimage); + floating_layer = gimp_image_floating_sel (gimage); undo_push_group_start (gimage, LAYER_SCALE_UNDO); @@ -470,7 +475,7 @@ layer_resize_invoker (Argument *args) { if ((gimage = GIMP_DRAWABLE(layer)->gimage)) { - floating_layer = gimage_floating_sel (gimage); + floating_layer = gimp_image_floating_sel (gimage); undo_push_group_start (gimage, LAYER_RESIZE_UNDO); @@ -601,7 +606,7 @@ layer_translate_invoker (Argument *args) { if ((gimage = GIMP_DRAWABLE(layer)->gimage)) { - floating_layer = gimage_floating_sel (gimage); + floating_layer = gimp_image_floating_sel (gimage); undo_push_group_start (gimage, LINKED_LAYER_UNDO); @@ -729,7 +734,7 @@ layer_set_offsets_invoker (Argument *args) { if ((gimage = GIMP_DRAWABLE(layer)->gimage)) { - floating_layer = gimage_floating_sel (gimage); + floating_layer = gimp_image_floating_sel (gimage); undo_push_group_start (gimage, LINKED_LAYER_UNDO); diff --git a/app/layer_pvt.h b/app/layer_pvt.h deleted file mode 100644 index b0ed44e9cb..0000000000 --- a/app/layer_pvt.h +++ /dev/null @@ -1,80 +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 __LAYER_PVT_H__ -#define __LAYER_PVT_H__ - -#include "layer.h" - -#include "boundary.h" -#include "drawable.h" -#include "channel.h" -#include "temp_buf.h" -#include "tile_manager.h" - -#include "drawable_pvt.h" -#include "channel_pvt.h" - -struct _GimpLayer -{ - GimpDrawable drawable; - - gboolean linked; /* control linkage */ - gboolean preserve_trans; /* preserve transparency */ - - LayerMask *mask; /* possible layer mask */ - gint apply_mask; /* controls mask application */ - gboolean edit_mask; /* edit mask or layer? */ - gboolean show_mask; /* show mask or layer? */ - - gint opacity; /* layer opacity */ - LayerModeEffects mode; /* layer combination mode */ - - /* Floating selections */ - struct - { - TileManager *backing_store; /* for obscured regions */ - GimpDrawable *drawable; /* floating sel is attached to */ - gboolean initial; /* is fs composited yet? */ - - gboolean boundary_known; /* is the current boundary valid */ - BoundSeg *segs; /* boundary of floating sel */ - gint num_segs; /* number of segs in boundary */ - } fs; -}; - -struct _GimpLayerClass -{ - GimpDrawableClass parent_class; - - void (* removed) (GimpLayer *layer); -}; - -struct _GimpLayerMask -{ - GimpChannel drawable; - - Layer *layer; -}; - -struct _GimpLayerMaskClass -{ - GimpChannelClass parent_class; -}; - -#endif /* __LAYER_PVT_H__ */ diff --git a/app/layer_select.c b/app/layer_select.c index f03d9ada6d..b37e1a0315 100644 --- a/app/layer_select.c +++ b/app/layer_select.c @@ -24,10 +24,14 @@ #include "apptypes.h" #include "appenv.h" +#include "drawable.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimprc.h" +#include "layer.h" #include "layer_select.h" #include "layers_dialogP.h" +#include "temp_buf.h" #include "libgimp/gimpintl.h" @@ -210,7 +214,7 @@ layer_select_advance (LayerSelect *layer_select, return; /* If there is a floating selection, allow no advancement */ - if (gimage_floating_sel (layer_select->gimage)) + if (gimp_image_floating_sel (layer_select->gimage)) return; for (list = layer_select->gimage->layer_stack, count = 0; @@ -263,8 +267,8 @@ layer_select_end (LayerSelect *layer_select, /* only reset the active layer if a new layer was specified */ if (layer_select->current_layer != layer_select->gimage->active_layer) { - gimage_set_active_layer (layer_select->gimage, - layer_select->current_layer); + gimp_image_set_active_layer (layer_select->gimage, + layer_select->current_layer); gdisplays_flush (); } } diff --git a/app/layer_select.h b/app/layer_select.h index 656745a26c..6d6260760a 100644 --- a/app/layer_select.h +++ b/app/layer_select.h @@ -19,8 +19,6 @@ #ifndef __LAYER_SELECT_H__ #define __LAYER_SELECT_H__ -#include "gimage.h" - void layer_select_init (GImage *gimage, gint move, diff --git a/app/layers_dialog.c b/app/layers_dialog.c index d7afbbb894..92a95edcc9 100644 --- a/app/layers_dialog.c +++ b/app/layers_dialog.c @@ -34,12 +34,15 @@ #include "gimprc.h" #include "gimpui.h" #include "image_render.h" +#include "layer.h" #include "layers_dialog.h" #include "layers_dialogP.h" #include "lc_dialogP.h" #include "menus.h" #include "ops_buttons.h" +#include "paint_funcs.h" #include "resize.h" +#include "temp_buf.h" #include "undo.h" #include "libgimp/gimplimits.h" @@ -60,8 +63,6 @@ #include "pixmaps/delete.xpm" #include "pixmaps/anchor.xpm" -#include "layer_pvt.h" - #define LAYER_PREVIEW 0 #define MASK_PREVIEW 1 diff --git a/app/layers_dialog.h b/app/layers_dialog.h index 4140638cc4..c48a2f9a24 100644 --- a/app/layers_dialog.h +++ b/app/layers_dialog.h @@ -15,31 +15,57 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __LAYERS_DIALOG_H__ #define __LAYERS_DIALOG_H__ -void layers_dialog_previous_layer_callback (GtkWidget *, gpointer); -void layers_dialog_next_layer_callback (GtkWidget *, gpointer); -void layers_dialog_raise_layer_callback (GtkWidget *, gpointer); -void layers_dialog_lower_layer_callback (GtkWidget *, gpointer); -void layers_dialog_raise_layer_to_top_callback (GtkWidget *, gpointer); -void layers_dialog_lower_layer_to_bottom_callback (GtkWidget *, gpointer); -void layers_dialog_new_layer_callback (GtkWidget *, gpointer); -void layers_dialog_duplicate_layer_callback (GtkWidget *, gpointer); -void layers_dialog_delete_layer_callback (GtkWidget *, gpointer); -void layers_dialog_scale_layer_callback (GtkWidget *, gpointer); -void layers_dialog_resize_layer_callback (GtkWidget *, gpointer); -void layers_dialog_resize_to_image_callback (GtkWidget *, gpointer); -void layers_dialog_add_layer_mask_callback (GtkWidget *, gpointer); -void layers_dialog_apply_layer_mask_callback (GtkWidget *, gpointer); -void layers_dialog_delete_layer_mask_callback (GtkWidget *, gpointer); -void layers_dialog_anchor_layer_callback (GtkWidget *, gpointer); -void layers_dialog_merge_layers_callback (GtkWidget *, gpointer); -void layers_dialog_merge_down_callback (GtkWidget *, gpointer); -void layers_dialog_flatten_image_callback (GtkWidget *, gpointer); -void layers_dialog_alpha_select_callback (GtkWidget *, gpointer); -void layers_dialog_mask_select_callback (GtkWidget *, gpointer); -void layers_dialog_add_alpha_channel_callback (GtkWidget *, gpointer); -void layers_dialog_edit_layer_attributes_callback (GtkWidget *, gpointer); + +void layers_dialog_previous_layer_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_next_layer_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_raise_layer_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_lower_layer_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_raise_layer_to_top_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_lower_layer_to_bottom_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_new_layer_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_duplicate_layer_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_delete_layer_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_scale_layer_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_resize_layer_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_resize_to_image_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_add_layer_mask_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_apply_layer_mask_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_delete_layer_mask_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_anchor_layer_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_merge_layers_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_merge_down_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_flatten_image_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_alpha_select_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_mask_select_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_add_alpha_channel_callback (GtkWidget *widet, + gpointer data); +void layers_dialog_edit_layer_attributes_callback (GtkWidget *widet, + gpointer data); + #endif /* __LAYERS_DIALOG_H__ */ diff --git a/app/lc_dialog.c b/app/lc_dialog.c index 4d7c4af977..aec4f4753a 100644 --- a/app/lc_dialog.c +++ b/app/lc_dialog.c @@ -24,6 +24,7 @@ #include "appenv.h" #include "dialog_handler.h" +#include "gdisplay.h" #include "gimage.h" #include "gimpcontext.h" #include "gimppreviewcache.h" @@ -34,6 +35,7 @@ #include "lc_dialog.h" #include "lc_dialogP.h" #include "layers_dialogP.h" +#include "procedural_db.h" #include "session.h" #include "libgimp/gimpintl.h" diff --git a/app/lc_dialog.h b/app/lc_dialog.h index a2b69bbf60..7a7bee5277 100644 --- a/app/lc_dialog.h +++ b/app/lc_dialog.h @@ -20,9 +20,6 @@ #define __LC_DIALOG_H__ -#include "apptypes.h" - - void lc_dialog_create (GimpImage *gimage); void lc_dialog_free (void); diff --git a/app/levels.c b/app/levels.c index 13395b4548..7814babaaa 100644 --- a/app/levels.c +++ b/app/levels.c @@ -23,20 +23,23 @@ #include #include -#include +#include #include "apptypes.h" #include "appenv.h" #include "drawable.h" #include "gdisplay.h" -#include "histogramwidget.h" #include "gimphistogram.h" +#include "gimpimage.h" #include "gimpui.h" +#include "histogramwidget.h" #include "image_map.h" #include "levels.h" #include "gimplut.h" #include "lut_funcs.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpenv.h" #include "libgimp/gimpmath.h" @@ -239,7 +242,7 @@ levels_initialize (GDisplay *gdisp) { gint i; - if (drawable_indexed (gimage_active_drawable (gdisp->gimage))) + if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Levels for indexed drawables cannot be adjusted.")); return; @@ -263,7 +266,7 @@ levels_initialize (GDisplay *gdisp) levels_dialog->high_output[i] = 255; } - levels_dialog->drawable = gimage_active_drawable (gdisp->gimage); + levels_dialog->drawable = gimp_image_active_drawable (gdisp->gimage); levels_dialog->color = drawable_color (levels_dialog->drawable); levels_dialog->image_map = image_map_create (gdisp, levels_dialog->drawable); diff --git a/app/levels.h b/app/levels.h index 462f317229..11be1c59ff 100644 --- a/app/levels.h +++ b/app/levels.h @@ -15,16 +15,17 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __LEVELS_H__ #define __LEVELS_H__ -#include "tools.h" -Tool * tools_new_levels (void); -void tools_free_levels (Tool *tool); +Tool * tools_new_levels (void); +void tools_free_levels (Tool *tool); void levels_dialog_hide (void); -void levels_initialize (GDisplay *gdisp); -void levels_free (void); +void levels_initialize (GDisplay *gdisp); +void levels_free (void); + #endif /* __LEVELS_H__ */ diff --git a/app/lut_funcs.c b/app/lut_funcs.c index dded28db1d..4251e64e1f 100644 --- a/app/lut_funcs.c +++ b/app/lut_funcs.c @@ -19,7 +19,6 @@ #include "config.h" #include -#include #include @@ -31,6 +30,7 @@ #include "libgimp/gimpmath.h" + /* ---------- Brightness/Contrast -----------*/ typedef struct B_C_struct diff --git a/app/magnify.c b/app/magnify.c index 9a38d49edf..25a9e8c90c 100644 --- a/app/magnify.c +++ b/app/magnify.c @@ -34,10 +34,12 @@ #include "info_window.h" #include "magnify.h" #include "scale.h" +#include "tools.h" +#include "tool_options.h" -#include "config.h" #include "libgimp/gimpintl.h" + /* the magnify structures */ typedef struct _Magnify Magnify; diff --git a/app/magnify.h b/app/magnify.h index 4d43694e00..4f70b77bb7 100644 --- a/app/magnify.h +++ b/app/magnify.h @@ -15,16 +15,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __MAGNIFY_H__ #define __MAGNIFY_H__ -#include "tools.h" -/* magnify functions */ +Tool * tools_new_magnify (void); +void tools_free_magnify (Tool *tool); -Tool * tools_new_magnify (void); -void tools_free_magnify (Tool *tool); +void magnify_draw (Tool *tool); -void magnify_draw (Tool *tool); #endif /* __MAGNIFY_H__ */ diff --git a/app/measure.c b/app/measure.c index 69d0d141b1..4e12bec9e5 100644 --- a/app/measure.c +++ b/app/measure.c @@ -21,19 +21,24 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" #include "draw_core.h" +#include "gdisplay.h" +#include "gimpimage.h" #include "gimpui.h" #include "info_dialog.h" #include "measure.h" #include "undo.h" +#include "tools.h" +#include "tool_options.h" + +#include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" -#include "libgimp/gimpmath.h" /* definitions */ diff --git a/app/measure.h b/app/measure.h index 79b21261ea..c9004833bc 100644 --- a/app/measure.h +++ b/app/measure.h @@ -15,15 +15,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __MEASURE_H__ #define __MEASURE_H__ -#include "tools.h" -/* measure functions */ - -Tool * tools_new_measure_tool (void); -void tools_free_measure_tool (Tool *); +Tool * tools_new_measure_tool (void); +void tools_free_measure_tool (Tool *tool); #endif /* __MEASURE_H__ */ diff --git a/app/menus.c b/app/menus.c index 5874ad7532..10947caf0f 100644 --- a/app/menus.c +++ b/app/menus.c @@ -31,6 +31,7 @@ #include "commands.h" #include "dialog_handler.h" #include "fileops.h" +#include "gimphelp.h" #include "gimprc.h" #include "gimpui.h" #include "interface.h" diff --git a/app/menus.h b/app/menus.h index 708522bf56..56b41e9915 100644 --- a/app/menus.h +++ b/app/menus.h @@ -63,4 +63,5 @@ void menus_set_state (gchar *path, void menus_last_opened_add (gchar *filename); + #endif /* __MENUS_H__ */ diff --git a/app/menus/menus.c b/app/menus/menus.c index 5874ad7532..10947caf0f 100644 --- a/app/menus/menus.c +++ b/app/menus/menus.c @@ -31,6 +31,7 @@ #include "commands.h" #include "dialog_handler.h" #include "fileops.h" +#include "gimphelp.h" #include "gimprc.h" #include "gimpui.h" #include "interface.h" diff --git a/app/menus/menus.h b/app/menus/menus.h index 708522bf56..56b41e9915 100644 --- a/app/menus/menus.h +++ b/app/menus/menus.h @@ -63,4 +63,5 @@ void menus_set_state (gchar *path, void menus_last_opened_add (gchar *filename); + #endif /* __MENUS_H__ */ diff --git a/app/menus/plug-in-menus.c b/app/menus/plug-in-menus.c index 55ca59c2c1..03e7a8c016 100644 --- a/app/menus/plug-in-menus.c +++ b/app/menus/plug-in-menus.c @@ -22,7 +22,7 @@ #include #endif -#include +#include #include #include @@ -88,13 +88,14 @@ #include "gdisplay.h" #include "general.h" #include "gimage.h" +#include "gimpprogress.h" #include "gimprc.h" #include "gradient_select.h" #include "menus.h" #include "pattern_select.h" /* Needed for closing pattern dialogs */ #include "plug_in.h" - -#include "tile.h" /* ick. */ +#include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpenv.h" #include "libgimp/gimpprotocol.h" diff --git a/app/message_cmds.c b/app/message_cmds.c index f563d91c75..86cbf0c74c 100644 --- a/app/message_cmds.c +++ b/app/message_cmds.c @@ -18,6 +18,12 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ +#include "config.h" + + +#include + +#include "apptypes.h" #include "procedural_db.h" #include "appenv.h" diff --git a/app/misc_cmds.c b/app/misc_cmds.c index 468cbfa38d..eacd4dbba2 100644 --- a/app/misc_cmds.c +++ b/app/misc_cmds.c @@ -18,6 +18,12 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ +#include "config.h" + + +#include + +#include "apptypes.h" #include "procedural_db.h" #include "app_procs.h" diff --git a/app/module_db.h b/app/module_db.h index f178502b8e..fa1ecc49e2 100644 --- a/app/module_db.h +++ b/app/module_db.h @@ -17,16 +17,17 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __MODULE_DB_H__ /* Load any modules we find on the module-path set in the gimprc */ -void module_db_init (void); +void module_db_init (void); /* Unload all modules, in case a module needs some cleanups */ -void module_db_free (void); +void module_db_free (void); -GtkWidget *module_db_browser_new (void); +GtkWidget * module_db_browser_new (void); #endif /* __MODULE_DB_H__ */ diff --git a/app/move.c b/app/move.c index 4793b51fcd..3b8e416564 100644 --- a/app/move.c +++ b/app/move.c @@ -29,9 +29,14 @@ #include "edit_selection.h" #include "floating_sel.h" #include "gimage_mask.h" -#include "gdisplay.h" +#include "gimpimage.h" #include "gdisplay_ops.h" +#include "gdisplay.h" +#include "layer.h" #include "move.h" +#include "selection.h" +#include "tools.h" +#include "tool_options.h" #include "undo.h" #include "config.h" @@ -107,9 +112,9 @@ move_tool_button_press (Tool *tool, undo_push_guide (gdisp->gimage, guide); gdisplays_expose_guide (gdisp->gimage, guide); - gimage_remove_guide (gdisp->gimage, guide); + gimp_image_remove_guide (gdisp->gimage, guide); gdisplay_flush (gdisp); - gimage_add_guide (gdisp->gimage, guide); + gimp_image_add_guide (gdisp->gimage, guide); move->guide = guide; move->disp = gdisp; @@ -119,20 +124,20 @@ move_tool_button_press (Tool *tool, move_tool_motion (tool, NULL, gdisp); } - else if ((layer = gimage_pick_correlate_layer (gdisp->gimage, x, y))) + else if ((layer = gimp_image_pick_correlate_layer (gdisp->gimage, x, y))) { /* If there is a floating selection, and this aint it, * use the move tool */ - if (gimage_floating_sel (gdisp->gimage) && + if (gimp_image_floating_sel (gdisp->gimage) && !layer_is_floating_sel (layer)) { - move->layer = gimage_floating_sel (gdisp->gimage); + move->layer = gimp_image_floating_sel (gdisp->gimage); } /* Otherwise, init the edit selection */ else { - gimage_set_active_layer (gdisp->gimage, layer); + gimp_image_set_active_layer (gdisp->gimage, layer); init_edit_selection (tool, gdisp_ptr, bevent, EDIT_LAYER_TRANSLATE); } tool->state = ACTIVE; @@ -373,10 +378,10 @@ move_tool_cursor_update (Tool *tool, move->disp = gdisp; } } - else if ((layer = gimage_pick_correlate_layer (gdisp->gimage, x, y))) + else if ((layer = gimp_image_pick_correlate_layer (gdisp->gimage, x, y))) { /* if there is a floating selection, and this aint it... */ - if (gimage_floating_sel (gdisp->gimage) && + if (gimp_image_floating_sel (gdisp->gimage) && !layer_is_floating_sel (layer)) gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR, RECT_SELECT, @@ -461,7 +466,7 @@ move_tool_start_hguide (Tool *tool, if (private->guide && private->disp && private->disp->gimage) gdisplay_draw_guide (private->disp, private->guide, FALSE); - private->guide = gimage_add_hguide (gdisp->gimage); + private->guide = gimp_image_add_hguide (gdisp->gimage); private->disp = gdisp; tool->state = ACTIVE; @@ -485,7 +490,7 @@ move_tool_start_vguide (Tool *tool, if (private->guide && private->disp && private->disp->gimage) gdisplay_draw_guide (private->disp, private->guide, FALSE); - private->guide = gimage_add_vguide (gdisp->gimage); + private->guide = gimp_image_add_vguide (gdisp->gimage); private->disp = gdisp; tool->state = ACTIVE; diff --git a/app/move.h b/app/move.h index 1c1e2cc007..f4f97c1c46 100644 --- a/app/move.h +++ b/app/move.h @@ -15,12 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __MOVE_H__ #define __MOVE_H__ -#include "tools.h" - -/* move functions */ void move_tool_start_hguide (Tool *tool, GDisplay *gdisp); diff --git a/app/nav_window.c b/app/nav_window.c index fef90262e3..6f434f3e1a 100644 --- a/app/nav_window.c +++ b/app/nav_window.c @@ -32,12 +32,14 @@ #include "info_window.h" #include "gdisplay.h" #include "gimpcontext.h" +#include "gimage.h" #include "gimppreviewcache.h" #include "gimpset.h" #include "gimprc.h" #include "gimpui.h" #include "gximage.h" #include "nav_window.h" +#include "procedural_db.h" #include "scroll.h" #include "scale.h" @@ -1302,7 +1304,7 @@ nav_window_title(GDisplay *gdisp) gchar *title; gchar *title_buf; - title = g_basename (gimage_filename (gdisp->gimage)); + title = g_basename (gimp_image_filename (gdisp->gimage)); /* create the info dialog */ title_buf = g_strdup_printf (_("Navigation: %s-%d.%d"), @@ -1409,7 +1411,7 @@ nav_window_create (void *gdisp_ptr) gdisp = (GDisplay *) gdisp_ptr; - type = gimage_base_type (gdisp->gimage); + type = gimp_image_base_type (gdisp->gimage); title_buf = nav_window_title(gdisp); diff --git a/app/nav_window.h b/app/nav_window.h index 9d274f176c..8669dc4a1e 100644 --- a/app/nav_window.h +++ b/app/nav_window.h @@ -16,21 +16,25 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __NAV_WINDOW_H__ #define __NAV_WINDOW_H__ -#include "info_dialog.h" -InfoDialog *nav_window_create (void *); -void nav_window_free (GDisplay *,InfoDialog *); -void nav_window_update_window_marker (InfoDialog *); -void nav_dialog_popup (InfoDialog *idialog); -void nav_window_preview_resized (InfoDialog *idialog); -void nav_window_popup_preview_resized (GtkWidget **widget); -void nav_window_follow_auto (void); +InfoDialog * nav_window_create (gpointer ); +void nav_window_free (GDisplay *gdisp, + InfoDialog *idialog); +void nav_window_update_window_marker (InfoDialog *idialog); +void nav_dialog_popup (InfoDialog *idialog); +void nav_window_preview_resized (InfoDialog *idialog); +void nav_window_popup_preview_resized (GtkWidget **widget); +void nav_window_follow_auto (void); /* popup functions */ -void nav_popup_click_handler (GtkWidget *widget, GdkEventButton *event, gpointer data); -void nav_popup_free (GtkWidget *widget); +void nav_popup_click_handler (GtkWidget *widget, + GdkEventButton *event, + gpointer data); +void nav_popup_free (GtkWidget *widget); + #endif /* __NAV_WINDOW_H__ */ diff --git a/app/ops_buttons.c b/app/ops_buttons.c index 392b316101..95e839c6c0 100644 --- a/app/ops_buttons.c +++ b/app/ops_buttons.c @@ -15,17 +15,20 @@ * 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 "apptypes.h" + #include "gimphelp.h" +#include "gimpui.h" #include "ops_buttons.h" -#include "libgimp/gimppixmap.h" - #include "libgimp/gimpintl.h" + static void ops_button_pressed_callback (GtkWidget *widget, GdkEventButton *bevent, gpointer data); diff --git a/app/ops_buttons.h b/app/ops_buttons.h index ab76d4108e..ccccdfe848 100644 --- a/app/ops_buttons.h +++ b/app/ops_buttons.h @@ -15,9 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __OPS_BUTTONS_H__ #define __OPS_BUTTONS_H__ + typedef enum { OPS_BUTTON_MODIFIER_NONE, @@ -53,4 +55,5 @@ struct _OpsButton GtkWidget * ops_button_box_new (OpsButton *ops_button, OpsButtonType ops_type); + #endif /* __OPS_BUTTONS_H__ */ diff --git a/app/paint-funcs/paint-funcs.c b/app/paint-funcs/paint-funcs.c index e49a2fd468..a5a1045c05 100644 --- a/app/paint-funcs/paint-funcs.c +++ b/app/paint-funcs/paint-funcs.c @@ -22,24 +22,27 @@ #include #include -#include +#include #include "apptypes.h" #include "appenv.h" +#include "boundary.h" #include "gimprc.h" #include "paint_funcs.h" -#include "boundary.h" +#include "pixel_processor.h" +#include "pixel_region.h" #include "tile_manager.h" +#include "tile_manager_pvt.h" +#include "tile_pvt.h" +#include "tile.h" -#include "tile_manager_pvt.h" /* For copy-on-write */ -#include "tile_pvt.h" /* For accessing the tiles directly */ -#include "tile.h" /* ick. */ - -#include "libgimp/gimpintl.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpcolorspace.h" +#include "libgimp/gimpintl.h" + + #define STD_BUF_SIZE 1021 #define MAXDIFF 195076 #define HASH_TABLE_SIZE 1021 diff --git a/app/paint-funcs/paint-funcs.h b/app/paint-funcs/paint-funcs.h index bd08e2a087..549e0e87ad 100644 --- a/app/paint-funcs/paint-funcs.h +++ b/app/paint-funcs/paint-funcs.h @@ -24,9 +24,6 @@ #ifndef __PAINT_FUNCS_H__ #define __PAINT_FUNCS_H__ -#include "apptypes.h" -#include "pixel_region.h" - /* Called initially to setup accelerated rendering features */ void paint_funcs_setup (void); diff --git a/app/paint/gimpairbrush.c b/app/paint/gimpairbrush.c index 3a518af92a..e12e0d2fd4 100644 --- a/app/paint/gimpairbrush.c +++ b/app/paint/gimpairbrush.c @@ -28,11 +28,14 @@ #include "gdisplay.h" #include "gradient.h" #include "gimage.h" +#include "gimpbrush.h" +#include "gimpcontext.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" #include "paint_options.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" #include "libgimp/gimpintl.h" @@ -295,10 +298,10 @@ airbrush_motion (PaintCore *paint_core, double pressure, PaintApplicationMode mode) { - GImage *gimage; - TempBuf * area; - unsigned char col[MAX_CHANNELS]; - gdouble scale; + GImage *gimage; + TempBuf *area; + guchar col[MAX_CHANNELS]; + gdouble scale; if (!drawable) return; diff --git a/app/paint/gimpairbrush.h b/app/paint/gimpairbrush.h index adae83e6c7..ea4e64954b 100644 --- a/app/paint/gimpairbrush.h +++ b/app/paint/gimpairbrush.h @@ -15,17 +15,23 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __AIRBRUSH_H__ #define __AIRBRUSH_H__ -#include "tools.h" -#include "paint_core.h" -void * airbrush_paint_func (PaintCore *, GimpDrawable *, int); -gboolean airbrush_non_gui (GimpDrawable *, double, int, double *); -gboolean airbrush_non_gui_default (GimpDrawable *, int, double *); -Tool * tools_new_airbrush (void); -void tools_free_airbrush (Tool *); +void * airbrush_paint_func (PaintCore *, + GimpDrawable *, + gint); +gboolean airbrush_non_gui (GimpDrawable *, + gdouble, + gint, + gdouble *); +gboolean airbrush_non_gui_default (GimpDrawable *, + gint, + gdouble *); +Tool * tools_new_airbrush (void); +void tools_free_airbrush (Tool *); #endif /* __AIRBRUSH_H__ */ diff --git a/app/paint/gimpclone.c b/app/paint/gimpclone.c index 0db3c5e312..7c16c6f684 100644 --- a/app/paint/gimpclone.c +++ b/app/paint/gimpclone.c @@ -26,20 +26,27 @@ #include "apptypes.h" #include "appenv.h" +#include "draw_core.h" #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpcontext.h" +#include "gimpimage.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" #include "paint_options.h" +#include "patterns.h" +#include "pixel_region.h" #include "clone.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" #include "cursorutil.h" #include "libgimp/gimpintl.h" + #define TARGET_HEIGHT 15 #define TARGET_WIDTH 15 @@ -325,7 +332,7 @@ clone_cursor_update (Tool *tool, gdisplay_untransform_coords (gdisp, (double) mevent->x, (double) mevent->y, &x, &y, TRUE, FALSE); - if ((layer = gimage_get_active_layer (gdisp->gimage))) + if ((layer = gimp_image_get_active_layer (gdisp->gimage))) { int off_x, off_y; drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y); @@ -602,8 +609,8 @@ clone_line_image (GImage *dest, while (width--) { - gimage_get_color (src, drawable_type (s_drawable), rgb, s); - gimage_transform_color (dest, d_drawable, rgb, d, RGB); + gimp_image_get_color (src, drawable_type (s_drawable), rgb, s); + gimp_image_transform_color (dest, d_drawable, rgb, d, RGB); if (has_alpha) d[dest_alpha] = s[src_alpha]; @@ -625,9 +632,9 @@ clone_line_pattern (GImage *dest, int bytes, int width) { - unsigned char *pat, *p; - int color, alpha; - int i; + guchar *pat, *p; + gint color, alpha; + gint i; /* Make sure x, y are positive */ while (x < 0) @@ -646,7 +653,7 @@ clone_line_pattern (GImage *dest, { p = pat + ((i + x) % pattern->mask->width) * pattern->mask->bytes; - gimage_transform_color (dest, drawable, p, d, color); + gimp_image_transform_color (dest, drawable, p, d, color); d[alpha] = OPAQUE_OPACITY; @@ -659,7 +666,8 @@ clone_non_gui_paint_func (PaintCore *paint_core, GimpDrawable *drawable, int state) { - clone_motion (paint_core, drawable, non_gui_src_drawable, &non_gui_pressure_options, + clone_motion (paint_core, drawable, non_gui_src_drawable, + &non_gui_pressure_options, non_gui_type, non_gui_offset_x, non_gui_offset_y); return NULL; diff --git a/app/paint/gimpclone.h b/app/paint/gimpclone.h index ca55cfb2cf..0433bc488e 100644 --- a/app/paint/gimpclone.h +++ b/app/paint/gimpclone.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __CLONE_H__ #define __CLONE_H__ -#include "paint_core.h" -#include "tools.h" typedef enum { @@ -27,11 +26,21 @@ typedef enum PATTERN_CLONE } CloneType; -void * clone_paint_func (PaintCore *, GimpDrawable *, int); -gboolean clone_non_gui (GimpDrawable *, GimpDrawable *, CloneType, - double, double, int, double *); -gboolean clone_non_gui_default (GimpDrawable *, int, double *); -Tool * tools_new_clone (void); -void tools_free_clone (Tool *); +void * clone_paint_func (PaintCore *, + GimpDrawable *, + gint); +gboolean clone_non_gui (GimpDrawable *, + GimpDrawable *, + CloneType, + gdouble, + gdouble, + gint, + gdouble *); +gboolean clone_non_gui_default (GimpDrawable *, + gint, + gdouble *); +Tool * tools_new_clone (void); +void tools_free_clone (Tool *); + #endif /* __CLONE_H__ */ diff --git a/app/paint/gimpconvolve.c b/app/paint/gimpconvolve.c index 558d2a526b..bcf8bd2580 100644 --- a/app/paint/gimpconvolve.c +++ b/app/paint/gimpconvolve.c @@ -27,11 +27,15 @@ #include "drawable.h" #include "convolve.h" #include "gdisplay.h" +#include "gimpbrush.h" +#include "gimpcontext.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" #include "paint_options.h" +#include "pixel_region.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" #include "gimage.h" @@ -344,7 +348,8 @@ convolve_motion (PaintCore *paint_core, /* If the brush is smaller than the convolution matrix, don't convolve */ - if((paint_core->brush->mask->width < matrix_size) || (paint_core->brush->mask->height < matrix_size)) + if ((paint_core->brush->mask->width < matrix_size) || + (paint_core->brush->mask->height < matrix_size)) return; if (pressure_options->size) diff --git a/app/paint/gimpconvolve.h b/app/paint/gimpconvolve.h index e93cdf46d6..3a6058ef5c 100644 --- a/app/paint/gimpconvolve.h +++ b/app/paint/gimpconvolve.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __CONVOLVE_H__ #define __CONVOLVE_H__ -#include "paint_core.h" -#include "tools.h" typedef enum { @@ -29,10 +28,19 @@ typedef enum } ConvolveType; -void * convolve_paint_func (PaintCore *, GimpDrawable *, int); -gboolean convolve_non_gui (GimpDrawable *, double, ConvolveType, int, double *); -gboolean convolve_non_gui_default (GimpDrawable *, int, double *); -Tool * tools_new_convolve (void); -void tools_free_convolve (Tool *); +void * convolve_paint_func (PaintCore *, + GimpDrawable *, + gint ); +gboolean convolve_non_gui (GimpDrawable *, + gdouble , + ConvolveType , + gint , + gdouble *); +gboolean convolve_non_gui_default (GimpDrawable *, + gint , + gdouble *); +Tool * tools_new_convolve (void ); +void tools_free_convolve (Tool *); + #endif /* __CONVOLVE_H__ */ diff --git a/app/paint/gimpdodgeburn.c b/app/paint/gimpdodgeburn.c index c873c16347..8ffe8968ce 100644 --- a/app/paint/gimpdodgeburn.c +++ b/app/paint/gimpdodgeburn.c @@ -15,6 +15,7 @@ * 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 @@ -27,11 +28,14 @@ #include "dodgeburn.h" #include "gdisplay.h" #include "gimplut.h" +#include "gimpcontext.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" #include "paint_options.h" +#include "pixel_region.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" #include "gimage.h" diff --git a/app/paint/gimpdodgeburn.h b/app/paint/gimpdodgeburn.h index 569ee8e675..341fe445ea 100644 --- a/app/paint/gimpdodgeburn.h +++ b/app/paint/gimpdodgeburn.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __DODGEBURN_H__ #define __DODGEBURN_H__ -#include "paint_core.h" -#include "tools.h" typedef enum { @@ -34,10 +33,22 @@ typedef enum DODGEBURN_SHADOWS } DodgeBurnMode; -void * dodgeburn_paint_func (PaintCore *, GimpDrawable *, int); -gboolean dodgeburn_non_gui (GimpDrawable *, double, DodgeBurnType, DodgeBurnMode, int, double *); -gboolean dodgeburn_non_gui_default (GimpDrawable *, int, double *); -Tool * tools_new_dodgeburn (void); -void tools_free_dodgeburn (Tool *); + +void * dodgeburn_paint_func (PaintCore *, + GimpDrawable *, + gint); +gboolean dodgeburn_non_gui (GimpDrawable *, + gdouble, + DodgeBurnType, + DodgeBurnMode, + gint, + gdouble *); +gboolean dodgeburn_non_gui_default (GimpDrawable *, + gint, + gdouble *); + +Tool * tools_new_dodgeburn (void); +void tools_free_dodgeburn (Tool *); + #endif /* __DODGEBURN_H__ */ diff --git a/app/paint/gimperaser.c b/app/paint/gimperaser.c index a368d13146..1ffa616c08 100644 --- a/app/paint/gimperaser.c +++ b/app/paint/gimperaser.c @@ -28,12 +28,15 @@ #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpcontext.h" +#include "gimpimage.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" #include "paint_options.h" #include "eraser.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" #include "libgimp/gimpintl.h" @@ -229,16 +232,16 @@ eraser_motion (PaintCore *paint_core, gboolean incremental, gboolean anti_erase) { - GImage *gimage; - gint opacity; - TempBuf * area; - unsigned char col[MAX_CHANNELS]; - gdouble scale; + GImage *gimage; + gint opacity; + TempBuf *area; + guchar col[MAX_CHANNELS]; + gdouble scale; if (! (gimage = drawable_gimage (drawable))) return; - gimage_get_background (gimage, drawable, col); + gimp_image_get_background (gimage, drawable, col); if (pressure_options->size) scale = paint_core->curpressure; diff --git a/app/paint/gimperaser.h b/app/paint/gimperaser.h index cdf728f85d..5a94a4c044 100644 --- a/app/paint/gimperaser.h +++ b/app/paint/gimperaser.h @@ -15,17 +15,26 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __ERASER_H__ #define __ERASER_H__ -#include "paint_core.h" -#include "tools.h" -void * eraser_paint_func (PaintCore *, GimpDrawable *, int); -gboolean eraser_non_gui (GimpDrawable *, int, double *, int, int, int); -gboolean eraser_non_gui_default (GimpDrawable *, int, double *); +void * eraser_paint_func (PaintCore *, + GimpDrawable *, + gint ); +gboolean eraser_non_gui (GimpDrawable *, + gint , + gdouble *, + gint , + gint , + gint ); +gboolean eraser_non_gui_default (GimpDrawable *, + gint , + gdouble *); + +Tool * tools_new_eraser (void ); +void tools_free_eraser (Tool *); -Tool * tools_new_eraser (void); -void tools_free_eraser (Tool *); #endif /* __ERASER_H__ */ diff --git a/app/paint/gimpink-blob.h b/app/paint/gimpink-blob.h index 6151f607c9..3f7fd96646 100644 --- a/app/paint/gimpink-blob.h +++ b/app/paint/gimpink-blob.h @@ -25,32 +25,58 @@ #ifndef __BLOB_H__ #define __BLOB_H__ + typedef struct _BlobPoint BlobPoint; -typedef struct _BlobSpan BlobSpan; -typedef struct _Blob Blob; +typedef struct _BlobSpan BlobSpan; +typedef struct _Blob Blob; -struct _BlobPoint { - int x; - int y; +struct _BlobPoint +{ + gint x; + gint y; }; -struct _BlobSpan { - int left; - int right; +struct _BlobSpan +{ + gint left; + gint right; }; -struct _Blob { - int y; - int height; +struct _Blob +{ + gint y; + gint height; BlobSpan data[1]; }; -Blob *blob_convex_union (Blob *b1, Blob *b2); -Blob *blob_polygon (BlobPoint *points, int npoints); -Blob *blob_square (double xc, double yc, double xp, double yp, double xq, double yq); -Blob *blob_diamond (double xc, double yc, double xp, double yp, double xq, double yq); -Blob *blob_ellipse (double xc, double yc, double xp, double yp, double xq, double yq); -void blob_bounds(Blob *b, int *x, int *y, int *width, int *height); +Blob * blob_convex_union (Blob *b1, + Blob *b2); +Blob * blob_polygon (BlobPoint *points, + gint npoints); +Blob * blob_square (gdouble xc, + gdouble yc, + gdouble xp, + gdouble yp, + gdouble xq, + gdouble yq); +Blob * blob_diamond (gdouble xc, + gdouble yc, + gdouble xp, + gdouble yp, + gdouble xq, + gdouble yq); +Blob * blob_ellipse (gdouble xc, + gdouble yc, + gdouble xp, + gdouble yp, + gdouble xq, + gdouble yq); +void blob_bounds (Blob *b, + gint *x, + gint *y, + gint *width, + gint *height); + #endif /* __BLOB_H__ */ diff --git a/app/paint/gimpink.c b/app/paint/gimpink.c index ec28ff1b3c..3673948f53 100644 --- a/app/paint/gimpink.c +++ b/app/paint/gimpink.c @@ -21,7 +21,7 @@ #include #include -#include +#include #include "apptypes.h" @@ -29,6 +29,8 @@ #include "drawable.h" #include "draw_core.h" #include "gimage_mask.h" +#include "gimpcontext.h" +#include "gimpimage.h" #include "gimprc.h" #include "gimpui.h" #include "ink.h" @@ -37,11 +39,16 @@ #include "undo.h" #include "blob.h" #include "gdisplay.h" +#include "paint_funcs.h" +#include "pixel_region.h" +#include "temp_buf.h" +#include "tile.h" +#include "tile_manager.h" -#include "libgimp/gimpintl.h" #include "libgimp/gimpmath.h" -#include "tile.h" /* ick. */ +#include "libgimp/gimpintl.h" + #define SUBSAMPLE 8 @@ -805,7 +812,7 @@ ink_button_press (Tool *tool, /* Keep the coordinates of the target */ gdisplay_untransform_coords_f (gdisp, bevent->x, bevent->y, &x, &y, TRUE); - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); ink_init (ink_tool, drawable, x, y); @@ -872,7 +879,7 @@ ink_button_release (Tool *tool, g_free (ink_tool->last_blob); ink_tool->last_blob = NULL; - ink_finish (ink_tool, gimage_active_drawable (gdisp->gimage), tool->ID); + ink_finish (ink_tool, gimp_image_active_drawable (gdisp->gimage), tool->ID); gdisplays_flush (); } @@ -976,7 +983,7 @@ ink_motion (Tool *tool, ink_tool = (InkTool *) tool->private; gdisplay_untransform_coords_f (gdisp, mevent->x, mevent->y, &x, &y, TRUE); - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); lasttime = ink_tool->last_time; @@ -1038,7 +1045,7 @@ ink_cursor_update (Tool *tool, gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, FALSE, FALSE); - if ((layer = gimage_get_active_layer (gdisp->gimage))) + if ((layer = gimp_image_get_active_layer (gdisp->gimage))) { int off_x, off_y; @@ -1385,7 +1392,7 @@ ink_paste (InkTool *ink_tool, if (!canvas_buf) return; - gimage_get_foreground (gimage, drawable, col); + gimp_image_get_foreground (gimage, drawable, col); /* set the alpha channel */ col[canvas_buf->bytes - 1] = OPAQUE_OPACITY; @@ -1414,12 +1421,12 @@ ink_paste (InkTool *ink_tool, srcPR.data = temp_buf_data (canvas_buf); /* apply the paint area to the gimage */ - gimage_apply_image (gimage, drawable, &srcPR, - FALSE, - (int) (gimp_context_get_opacity (NULL) * 255), - gimp_context_get_paint_mode (NULL), - undo_tiles, /* specify an alternative src1 */ - canvas_buf->x, canvas_buf->y); + gimp_image_apply_image (gimage, drawable, &srcPR, + FALSE, + (int) (gimp_context_get_opacity (NULL) * 255), + gimp_context_get_paint_mode (NULL), + undo_tiles, /* specify an alternative src1 */ + canvas_buf->x, canvas_buf->y); /* Update the undo extents */ ink_tool->x1 = MIN (ink_tool->x1, canvas_buf->x); diff --git a/app/paint/gimpink.h b/app/paint/gimpink.h index 6be250088d..3dfb214846 100644 --- a/app/paint/gimpink.h +++ b/app/paint/gimpink.h @@ -15,16 +15,16 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __INK_H__ #define __INK_H__ -#include "tools.h" -#include "procedural_db.h" -Tool * tools_new_ink (void); -void tools_free_ink (Tool *); +Tool * tools_new_ink (void); +void tools_free_ink (Tool *tool); /* Procedure definition and marshalling function */ extern ProcRecord ink_proc; + #endif /* __INK_H__ */ diff --git a/app/paint/gimppencil.c b/app/paint/gimppencil.c index 69fc36f889..860d3da779 100644 --- a/app/paint/gimppencil.c +++ b/app/paint/gimppencil.c @@ -18,13 +18,16 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" #include "drawable.h" #include "gdisplay.h" +#include "gimpbrush.h" +#include "gimpcontext.h" +#include "gimpimage.h" #include "gradient.h" #include "paint_funcs.h" #include "paint_core.h" @@ -32,7 +35,9 @@ #include "paintbrush.h" #include "pencil.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" +#include "tool_options.h" /* the pencil tool options */ @@ -180,7 +185,7 @@ pencil_motion (PaintCore *paint_core, } else { - gimage_get_foreground (gimage, drawable, col); + gimp_image_get_foreground (gimage, drawable, col); col[area->bytes - 1] = OPAQUE_OPACITY; color_pixels (temp_buf_data (area), col, area->width * area->height, area->bytes); diff --git a/app/paint/gimppencil.h b/app/paint/gimppencil.h index b65ea78a19..5bdadd451c 100644 --- a/app/paint/gimppencil.h +++ b/app/paint/gimppencil.h @@ -15,16 +15,20 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __PENCIL_H__ #define __PENCIL_H__ -#include "tools.h" -#include "paint_core.h" -void * pencil_paint_func (PaintCore *, GimpDrawable *, int); -gboolean pencil_non_gui (GimpDrawable *, int, double *); +void * pencil_paint_func (PaintCore *, + GimpDrawable *, + gint ); +gboolean pencil_non_gui (GimpDrawable *, + gint , + gdouble *); + +Tool * tools_new_pencil (void); +void tools_free_pencil (Tool *tool); -Tool * tools_new_pencil (void); -void tools_free_pencil (Tool *); #endif /* __PENCIL_H__ */ diff --git a/app/paint/gimpsmudge.c b/app/paint/gimpsmudge.c index 69b5234dc2..26bdff458e 100644 --- a/app/paint/gimpsmudge.c +++ b/app/paint/gimpsmudge.c @@ -27,13 +27,18 @@ #include "drawable.h" #include "smudge.h" #include "gdisplay.h" +#include "gimpcontext.h" +#include "gimpbrush.h" #include "gimplut.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" +#include "pixel_region.h" #include "paint_options.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" +#include "tool_options.h" #include "gimage.h" #include "libgimp/gimpmath.h" diff --git a/app/paint/gimpsmudge.h b/app/paint/gimpsmudge.h index f56524bf2b..a87d0ffe60 100644 --- a/app/paint/gimpsmudge.h +++ b/app/paint/gimpsmudge.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __SMUDGE_H__ #define __SMUDGE_H__ -#include "paint_core.h" -#include "tools.h" typedef enum { @@ -34,10 +33,19 @@ typedef enum SMUDGE_MODE_SHADOWS } SmudgeMode; -void * smudge_paint_func (PaintCore *, GimpDrawable *, int); -gboolean smudge_non_gui (GimpDrawable *, double, int, double *); -gboolean smudge_non_gui_default (GimpDrawable *, int, double *); -Tool * tools_new_smudge (void); -void tools_free_smudge (Tool *); +void * smudge_paint_func (PaintCore *, + GimpDrawable *, + gint ); +gboolean smudge_non_gui (GimpDrawable *, + gdouble , + gint , + gdouble *); +gboolean smudge_non_gui_default (GimpDrawable *, + gint , + gdouble *); + +Tool * tools_new_smudge (void); +void tools_free_smudge (Tool *tool); + #endif /* __SMUDGE_H__ */ diff --git a/app/paint/gimpsourcecore.c b/app/paint/gimpsourcecore.c index 0db3c5e312..7c16c6f684 100644 --- a/app/paint/gimpsourcecore.c +++ b/app/paint/gimpsourcecore.c @@ -26,20 +26,27 @@ #include "apptypes.h" #include "appenv.h" +#include "draw_core.h" #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpcontext.h" +#include "gimpimage.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" #include "paint_options.h" +#include "patterns.h" +#include "pixel_region.h" #include "clone.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" #include "cursorutil.h" #include "libgimp/gimpintl.h" + #define TARGET_HEIGHT 15 #define TARGET_WIDTH 15 @@ -325,7 +332,7 @@ clone_cursor_update (Tool *tool, gdisplay_untransform_coords (gdisp, (double) mevent->x, (double) mevent->y, &x, &y, TRUE, FALSE); - if ((layer = gimage_get_active_layer (gdisp->gimage))) + if ((layer = gimp_image_get_active_layer (gdisp->gimage))) { int off_x, off_y; drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y); @@ -602,8 +609,8 @@ clone_line_image (GImage *dest, while (width--) { - gimage_get_color (src, drawable_type (s_drawable), rgb, s); - gimage_transform_color (dest, d_drawable, rgb, d, RGB); + gimp_image_get_color (src, drawable_type (s_drawable), rgb, s); + gimp_image_transform_color (dest, d_drawable, rgb, d, RGB); if (has_alpha) d[dest_alpha] = s[src_alpha]; @@ -625,9 +632,9 @@ clone_line_pattern (GImage *dest, int bytes, int width) { - unsigned char *pat, *p; - int color, alpha; - int i; + guchar *pat, *p; + gint color, alpha; + gint i; /* Make sure x, y are positive */ while (x < 0) @@ -646,7 +653,7 @@ clone_line_pattern (GImage *dest, { p = pat + ((i + x) % pattern->mask->width) * pattern->mask->bytes; - gimage_transform_color (dest, drawable, p, d, color); + gimp_image_transform_color (dest, drawable, p, d, color); d[alpha] = OPAQUE_OPACITY; @@ -659,7 +666,8 @@ clone_non_gui_paint_func (PaintCore *paint_core, GimpDrawable *drawable, int state) { - clone_motion (paint_core, drawable, non_gui_src_drawable, &non_gui_pressure_options, + clone_motion (paint_core, drawable, non_gui_src_drawable, + &non_gui_pressure_options, non_gui_type, non_gui_offset_x, non_gui_offset_y); return NULL; diff --git a/app/paint/gimpsourcecore.h b/app/paint/gimpsourcecore.h index ca55cfb2cf..0433bc488e 100644 --- a/app/paint/gimpsourcecore.h +++ b/app/paint/gimpsourcecore.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __CLONE_H__ #define __CLONE_H__ -#include "paint_core.h" -#include "tools.h" typedef enum { @@ -27,11 +26,21 @@ typedef enum PATTERN_CLONE } CloneType; -void * clone_paint_func (PaintCore *, GimpDrawable *, int); -gboolean clone_non_gui (GimpDrawable *, GimpDrawable *, CloneType, - double, double, int, double *); -gboolean clone_non_gui_default (GimpDrawable *, int, double *); -Tool * tools_new_clone (void); -void tools_free_clone (Tool *); +void * clone_paint_func (PaintCore *, + GimpDrawable *, + gint); +gboolean clone_non_gui (GimpDrawable *, + GimpDrawable *, + CloneType, + gdouble, + gdouble, + gint, + gdouble *); +gboolean clone_non_gui_default (GimpDrawable *, + gint, + gdouble *); +Tool * tools_new_clone (void); +void tools_free_clone (Tool *); + #endif /* __CLONE_H__ */ diff --git a/app/paint_core.c b/app/paint_core.c index 7a1642e99d..b6ca82f003 100644 --- a/app/paint_core.c +++ b/app/paint_core.c @@ -21,29 +21,35 @@ #include #include -#include +#include #include "apptypes.h" #include "appenv.h" #include "brush_scale.h" +#include "cursorutil.h" #include "devices.h" +#include "draw_core.h" #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" #include "gimpbrushpipe.h" +#include "gimpcontext.h" +#include "gimpimage.h" #include "gimprc.h" -#include "gradient.h" /* for grad_get_color_at() */ +#include "gradient.h" #include "paint_funcs.h" #include "paint_core.h" +#include "pixel_region.h" #include "selection.h" +#include "temp_buf.h" +#include "tile.h" +#include "tile_manager.h" #include "tools.h" #include "undo.h" -#include "cursorutil.h" - -#include "tile.h" /* ick. */ #include "libgimp/gimpmath.h" + #include "libgimp/gimpintl.h" #include "paint_core_kernels.h" @@ -209,7 +215,7 @@ paint_core_button_press (Tool *tool, gdisplay_untransform_coords_f (gdisp, (double) bevent->x, (double) bevent->y, &x, &y, TRUE); - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); if (! paint_core_init (paint_core, drawable, x, y)) return; @@ -394,7 +400,7 @@ paint_core_button_release (Tool *tool, /* Let the specific painting function finish up */ (* paint_core->paint_func) (paint_core, - gimage_active_drawable (gdisp->gimage), + gimp_image_active_drawable (gdisp->gimage), FINISH_PAINT); /* Set tool state to inactive -- no longer painting */ @@ -403,7 +409,8 @@ paint_core_button_release (Tool *tool, paint_core->pick_state = FALSE; - paint_core_finish (paint_core, gimage_active_drawable (gdisp->gimage), tool->ID); + paint_core_finish (paint_core, gimp_image_active_drawable (gdisp->gimage), + tool->ID); gdisplays_flush (); } @@ -423,7 +430,7 @@ paint_core_motion (Tool *tool, if (paint_core->pick_state) { - paint_core_sample_color (gimage_active_drawable (gdisp->gimage), + paint_core_sample_color (gimp_image_active_drawable (gdisp->gimage), paint_core->curx, paint_core->cury, mevent->state); return; @@ -437,18 +444,19 @@ paint_core_motion (Tool *tool, #endif /* GTK_HAVE_SIX_VALUATORS */ paint_core->state = mevent->state; - paint_core_interpolate (paint_core, gimage_active_drawable (gdisp->gimage)); + paint_core_interpolate (paint_core, + gimp_image_active_drawable (gdisp->gimage)); if (paint_core->flags & TOOL_TRACES_ON_WINDOW) (* paint_core->paint_func) (paint_core, - gimage_active_drawable (gdisp->gimage), + gimp_image_active_drawable (gdisp->gimage), PRETRACE_PAINT); gdisplay_flush_now (gdisp); if (paint_core->flags & TOOL_TRACES_ON_WINDOW) (* paint_core->paint_func) (paint_core, - gimage_active_drawable (gdisp->gimage), + gimp_image_active_drawable (gdisp->gimage), POSTTRACE_PAINT); paint_core->lastx = paint_core->curx; @@ -493,7 +501,7 @@ paint_core_cursor_update (Tool *tool, if (paint_core->context_id) gtk_statusbar_pop (GTK_STATUSBAR (gdisp->statusbar), paint_core->context_id); - if ((layer = gimage_get_active_layer (gdisp->gimage))) + if ((layer = gimp_image_get_active_layer (gdisp->gimage))) { /* If shift is down and this is not the first paint stroke, draw a line */ if (gdisp_ptr == tool->gdisp_ptr && (mevent->state & GDK_SHIFT_MASK)) @@ -642,7 +650,7 @@ paint_core_control (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; paint_core = (PaintCore *) tool->private; - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); switch (action) { @@ -1627,10 +1635,10 @@ paint_core_paste (PaintCore *paint_core, srcPR.data = temp_buf_data (canvas_buf); /* apply the paint area to the gimage */ - gimage_apply_image (gimage, drawable, &srcPR, - FALSE, image_opacity, paint_mode, - alt, /* specify an alternative src1 */ - canvas_buf->x, canvas_buf->y); + gimp_image_apply_image (gimage, drawable, &srcPR, + FALSE, image_opacity, paint_mode, + alt, /* specify an alternative src1 */ + canvas_buf->x, canvas_buf->y); /* Update the undo extents */ paint_core->x1 = MIN (paint_core->x1, canvas_buf->x); @@ -1725,10 +1733,10 @@ paint_core_replace (PaintCore *paint_core, srcPR.data = temp_buf_data (canvas_buf); /* apply the paint area to the gimage */ - gimage_replace_image (gimage, drawable, &srcPR, - FALSE, image_opacity, - &maskPR, - canvas_buf->x, canvas_buf->y); + gimp_image_replace_image (gimage, drawable, &srcPR, + FALSE, image_opacity, + &maskPR, + canvas_buf->x, canvas_buf->y); /* Update the undo extents */ paint_core->x1 = MIN (paint_core->x1, canvas_buf->x); @@ -2126,7 +2134,7 @@ paint_line_pixmap_mask (GimpImage *dest, d[byte_loop] *= alpha; /* printf("i: %i d->r: %i d->g: %i d->b: %i d->a: %i\n",i,(int)d[0], (int)d[1], (int)d[2], (int)d[3]); */ - gimage_transform_color (dest, drawable, p, d, RGB); + gimp_image_transform_color (dest, drawable, p, d, RGB); d += bytes; } } @@ -2142,7 +2150,7 @@ paint_line_pixmap_mask (GimpImage *dest, /* multiply alpha into the pixmap data */ /* maybe we could do this at tool creation or brush switch time? */ /* and compute it for the whole brush at once and cache it? */ - gimage_transform_color (dest, drawable, p, d, RGB); + gimp_image_transform_color (dest, drawable, p, d, RGB); d += bytes; } } diff --git a/app/paint_core.h b/app/paint_core.h index b570d220b1..bc6ade3edd 100644 --- a/app/paint_core.h +++ b/app/paint_core.h @@ -15,13 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __PAINT_CORE_H__ #define __PAINT_CORE_H__ -#include "apptypes.h" -#include "draw_core.h" -#include "temp_buf.h" -#include "gimpbrush.h" /* the different states that the painting function can be called with */ @@ -48,7 +45,8 @@ typedef enum /*< skip >*/ } ToolFlags; typedef void * (* PaintFunc) (PaintCore *, GimpDrawable *, int); -struct _paint_core + +struct _PaintCore { DrawCore * core; /* Core select object */ diff --git a/app/paint_funcs.c b/app/paint_funcs.c index e49a2fd468..a5a1045c05 100644 --- a/app/paint_funcs.c +++ b/app/paint_funcs.c @@ -22,24 +22,27 @@ #include #include -#include +#include #include "apptypes.h" #include "appenv.h" +#include "boundary.h" #include "gimprc.h" #include "paint_funcs.h" -#include "boundary.h" +#include "pixel_processor.h" +#include "pixel_region.h" #include "tile_manager.h" +#include "tile_manager_pvt.h" +#include "tile_pvt.h" +#include "tile.h" -#include "tile_manager_pvt.h" /* For copy-on-write */ -#include "tile_pvt.h" /* For accessing the tiles directly */ -#include "tile.h" /* ick. */ - -#include "libgimp/gimpintl.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpcolorspace.h" +#include "libgimp/gimpintl.h" + + #define STD_BUF_SIZE 1021 #define MAXDIFF 195076 #define HASH_TABLE_SIZE 1021 diff --git a/app/paint_funcs.h b/app/paint_funcs.h index bd08e2a087..549e0e87ad 100644 --- a/app/paint_funcs.h +++ b/app/paint_funcs.h @@ -24,9 +24,6 @@ #ifndef __PAINT_FUNCS_H__ #define __PAINT_FUNCS_H__ -#include "apptypes.h" -#include "pixel_region.h" - /* Called initially to setup accelerated rendering features */ void paint_funcs_setup (void); diff --git a/app/paintbrush.c b/app/paintbrush.c index 458754d050..25d9ff065e 100644 --- a/app/paintbrush.c +++ b/app/paintbrush.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include "apptypes.h" @@ -26,6 +26,9 @@ #include "drawable.h" #include "gdisplay.h" #include "gimpbrushlist.h" +#include "gimpbrush.h" +#include "gimpcontext.h" +#include "gimpimage.h" #include "gimpui.h" #include "gradient.h" #include "paint_funcs.h" @@ -33,7 +36,9 @@ #include "paint_options.h" #include "paintbrush.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" +#include "tool_options.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpunitmenu.h" @@ -103,11 +108,15 @@ static GimpUnit non_gui_gradient_unit; /* forward function declarations */ -static void paintbrush_motion (PaintCore *, GimpDrawable *, +static void paintbrush_motion (PaintCore *, + GimpDrawable *, PaintPressureOptions *, - double, double, PaintApplicationMode, + gdouble, + gdouble, + PaintApplicationMode, GradientPaintMode); + /* functions */ static void @@ -366,14 +375,14 @@ paintbrush_paint_func (PaintCore *paint_core, #endif switch (state) { - case INIT_PAINT : + case INIT_PAINT: #if TIMED_BRUSH timer = g_timer_new(); g_timer_start(timer); #endif /* TIMED_BRUSH */ break; - case MOTION_PAINT : + case MOTION_PAINT: switch (paintbrush_options->fade_unit) { case GIMP_UNIT_PIXEL: @@ -555,7 +564,7 @@ paintbrush_motion (PaintCore *paint_core, } else { - gimage_get_foreground (gimage, drawable, col); + gimp_image_get_foreground (gimage, drawable, col); col[area->bytes - 1] = OPAQUE_OPACITY; color_pixels (temp_buf_data (area), col, area->width * area->height, area->bytes); diff --git a/app/paintbrush.h b/app/paintbrush.h index 950e510c38..ee55408ed8 100644 --- a/app/paintbrush.h +++ b/app/paintbrush.h @@ -15,19 +15,26 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __PAINTBRUSH_H__ #define __PAINTBRUSH_H__ -#include "tools.h" -#include "paint_core.h" -void * paintbrush_paint_func (PaintCore *, GimpDrawable *, int); -gboolean paintbrush_non_gui (GimpDrawable *, int, double *, double, - int, double); -gboolean paintbrush_non_gui_default (GimpDrawable *, int, - double *); +void * paintbrush_paint_func (PaintCore *, + GimpDrawable *, + gint ); +gboolean paintbrush_non_gui (GimpDrawable *, + gint , + gdouble *, + gdouble , + gint , + gdouble ); +gboolean paintbrush_non_gui_default (GimpDrawable *, + gint , + gdouble *); + +Tool * tools_new_paintbrush (void); +void tools_free_paintbrush (Tool *tool); -Tool * tools_new_paintbrush (void); -void tools_free_paintbrush (Tool *); #endif /* __PAINTBRUSH_H__ */ diff --git a/app/palette.c b/app/palette.c index 34f1ef3c83..148c755b7b 100644 --- a/app/palette.c +++ b/app/palette.c @@ -39,10 +39,13 @@ #include "color_area.h" #include "color_notebook.h" #include "datafiles.h" +#include "dialog_handler.h" +#include "gimage.h" #include "gimpcontext.h" #include "gimpdnd.h" #include "gimprc.h" #include "gimpui.h" +#include "gradient.h" #include "gradient_header.h" #include "gradient_select.h" #include "palette.h" @@ -50,7 +53,9 @@ #include "palette_entries.h" #include "session.h" #include "palette_select.h" -#include "dialog_handler.h" +#include "pixel_region.h" +#include "procedural_db.h" +#include "temp_buf.h" #include "libgimp/gimpenv.h" @@ -59,6 +64,7 @@ #include "pixmaps/zoom_in.xpm" #include "pixmaps/zoom_out.xpm" + #define ENTRY_WIDTH 12 #define ENTRY_HEIGHT 10 #define SPACING 1 @@ -2356,7 +2362,7 @@ palette_import_gimlist_indexed_cb (gpointer im, GimpImage *gimage = GIMP_IMAGE (im); GSList** l; - if (gimage_base_type (gimage) == INDEXED) + if (gimp_image_base_type (gimage) == INDEXED) { l = (GSList**) data; *l = g_slist_prepend (*l, im); @@ -2440,7 +2446,7 @@ palette_import_image_sel_callback (GtkWidget *widget, palette_import_update_image_preview (gimage); lab = g_strdup_printf ("%s-%d", - g_basename (gimage_filename (import_dialog->gimage)), + g_basename (gimp_image_filename (import_dialog->gimage)), pdb_image_to_id (import_dialog->gimage)); gtk_entry_set_text (GTK_ENTRY (import_dialog->entry), lab); @@ -2451,7 +2457,7 @@ palette_import_image_menu_add (GimpImage *gimage) { GtkWidget *menuitem; gchar *lab = g_strdup_printf ("%s-%d", - g_basename (gimage_filename (gimage)), + g_basename (gimp_image_filename (gimage)), pdb_image_to_id (gimage)); menuitem = gtk_menu_item_new_with_label (lab); gtk_widget_show (menuitem); @@ -2546,7 +2552,7 @@ palette_import_image_menu_activate (gint redo, if (redo && act_num >= 0) { gchar *lab = g_strdup_printf ("%s-%d", - g_basename (gimage_filename (import_dialog->gimage)), + g_basename (gimp_image_filename (import_dialog->gimage)), pdb_image_to_id (import_dialog->gimage)); gtk_option_menu_set_history (GTK_OPTION_MENU (optionmenu1), act_num); @@ -2556,7 +2562,7 @@ palette_import_image_menu_activate (gint redo, g_slist_free (list); lab = g_strdup_printf ("%s-%d", - g_basename (gimage_filename (import_dialog->gimage)), + g_basename (gimp_image_filename (import_dialog->gimage)), pdb_image_to_id (import_dialog->gimage)); gtk_entry_set_text (GTK_ENTRY (import_dialog->entry), lab); @@ -2647,7 +2653,7 @@ palette_import_image_new (GimpSet *set, } if (!GTK_WIDGET_IS_SENSITIVE (import_dialog->image_menu_item_indexed) && - gimage_base_type(gimage) == INDEXED) + gimp_image_base_type(gimage) == INDEXED) { gtk_widget_set_sensitive (import_dialog->image_menu_item_indexed, TRUE); return; @@ -2937,15 +2943,15 @@ palette_import_create_from_image (GImage *gimage, return; /* Get the image information */ - bytes = gimage_composite_bytes (gimage); - d_type = gimage_composite_type (gimage); + bytes = gimp_image_composite_bytes (gimage); + d_type = gimp_image_composite_type (gimage); has_alpha = (d_type == RGBA_GIMAGE || d_type == GRAYA_GIMAGE || d_type == INDEXEDA_GIMAGE); indexed = d_type == INDEXEDA_GIMAGE || d_type == INDEXED_GIMAGE; width = gimage->width; height = gimage->height; - pixel_region_init (&imagePR, gimage_composite (gimage), 0, 0, + pixel_region_init (&imagePR, gimp_image_composite (gimage), 0, 0, width, height, FALSE); alpha = bytes - 1; @@ -2969,7 +2975,7 @@ palette_import_create_from_image (GImage *gimage, for (j = 0; j < imagePR.w; j++) { /* Get the rgb values for the color */ - gimage_get_color (gimage, d_type, rgb, idata); + gimp_image_get_color (gimage, d_type, rgb, idata); memcpy (rgb_real, rgb, MAX_CHANNELS); /* Structure copy */ rgb[0] = (rgb[0] / threshold) * threshold; @@ -3005,7 +3011,7 @@ palette_import_create_from_indexed (GImage *gimage, if (gimage == NULL) return; - if (gimage_base_type (gimage) != INDEXED) + if (gimp_image_base_type (gimage) != INDEXED) return; entries = palette_entries_new (pname); diff --git a/app/palette.h b/app/palette.h index cfa50a6aa8..3059ca3ff2 100644 --- a/app/palette.h +++ b/app/palette.h @@ -36,4 +36,5 @@ void palette_set_active_color (gint r, gint b, gint state); + #endif /* __PALETTE_H__ */ diff --git a/app/palette_cmds.c b/app/palette_cmds.c index 209563b141..8a835f6fd0 100644 --- a/app/palette_cmds.c +++ b/app/palette_cmds.c @@ -18,6 +18,12 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ +#include "config.h" + + +#include + +#include "apptypes.h" #include "procedural_db.h" #include "gimpcontext.h" diff --git a/app/palette_entries.h b/app/palette_entries.h index 62f8269760..e7def41fec 100644 --- a/app/palette_entries.h +++ b/app/palette_entries.h @@ -19,10 +19,6 @@ #ifndef __PALETTE_ENTRIES_H__ #define __PALETTE_ENTRIES_H__ -#include "gtk/gtk.h" /* eeek */ - - -typedef struct _PaletteEntries PaletteEntries; struct _PaletteEntries { @@ -34,8 +30,6 @@ struct _PaletteEntries GdkPixmap *pixmap; }; -typedef struct _PaletteEntry PaletteEntry; - struct _PaletteEntry { guchar color[3]; @@ -45,4 +39,5 @@ struct _PaletteEntry extern GSList * palette_entries_list; + #endif /* __PALETTE_ENTRIES_H__ */ diff --git a/app/palette_select.c b/app/palette_select.c index 8a67aa7563..4c3d5c1dde 100644 --- a/app/palette_select.c +++ b/app/palette_select.c @@ -19,9 +19,10 @@ #include "config.h" -#include +#include #include "apptypes.h" + #include "gimpui.h" #include "palette_entries.h" #include "palette_select.h" @@ -29,6 +30,7 @@ #include "libgimp/gimpintl.h" + /* List of active dialogs */ static GSList *active_dialogs = NULL; diff --git a/app/palette_select.h b/app/palette_select.h index 803c8adc7c..c682bf293b 100644 --- a/app/palette_select.h +++ b/app/palette_select.h @@ -15,9 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __PALETTE_SELECT_H__ #define __PALETTE_SELECT_H__ + #define SM_PREVIEW_WIDTH (96 + 2) #define SM_PREVIEW_HEIGHT (33 + 2) @@ -31,11 +33,12 @@ struct _PaletteSelect gchar *callback_name; }; -PaletteSelect * palette_select_new (gchar *title, - gchar *initial_palette); +PaletteSelect * palette_select_new (gchar *title, + gchar *initial_palette); + +void palette_select_clist_insert_all (PaletteEntries *p_entries); +void palette_select_set_text_all (PaletteEntries *entries); +void palette_select_refresh_all (void); -void palette_select_clist_insert_all (PaletteEntries *p_entries); -void palette_select_set_text_all (PaletteEntries *entries); -void palette_select_refresh_all (void); #endif /* __PALETTE_SELECT_H__ */ diff --git a/app/parasite_cmds.c b/app/parasite_cmds.c index e33e25c0b3..3e2b50f3bc 100644 --- a/app/parasite_cmds.c +++ b/app/parasite_cmds.c @@ -18,6 +18,12 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ +#include "config.h" + + +#include + +#include "apptypes.h" #include "procedural_db.h" #include "drawable.h" diff --git a/app/parasitelist.h b/app/parasitelist.h index b888e6a15f..2c62105dd9 100644 --- a/app/parasitelist.h +++ b/app/parasitelist.h @@ -19,7 +19,6 @@ #define __PARASITE_LIST_H__ -#include "libgimp/gimpparasite.h" #include "gimpobject.h" @@ -31,6 +30,7 @@ struct _ParasiteList { GimpObject object; + GHashTable *table; }; diff --git a/app/path.c b/app/path.c index 5ce039d511..f62e0550ef 100644 --- a/app/path.c +++ b/app/path.c @@ -22,10 +22,11 @@ #include #include -#include +#include #include "apptypes.h" #include "bezier_selectP.h" +#include "gdisplay.h" #include "gimpimage.h" #include "path.h" #include "pathP.h" diff --git a/app/path.h b/app/path.h index 61128e91ec..846a9b9852 100644 --- a/app/path.h +++ b/app/path.h @@ -15,17 +15,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __PATH_H__ #define __PATH_H__ -#include "bezier_select.h" -typedef struct _Path Path; -typedef struct _PathPoint PathPoint; - -typedef GSList PathUndo; - -typedef struct +struct _PathList { GimpImage *gimage; GDisplay *gdisp; /* This is a hack.. Needed so we can get back to @@ -40,7 +35,7 @@ typedef struct GSList *bz_paths; /* list of BZPATHP */ guint sig_id; gint32 last_selected_row; -} PathList; +}; typedef enum { diff --git a/app/path_transform.h b/app/path_transform.h index ba90e9067f..1b7dd03644 100644 --- a/app/path_transform.h +++ b/app/path_transform.h @@ -15,16 +15,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __PATH_TRANSFORM_H__ #define __PATH_TRANSFORM_H__ -#include "draw_core.h" -#include "gdisplayF.h" -#include "path.h" -#include "libgimp/gimpmatrix.h" - -PathUndo* path_transform_start_undo (GimpImage *gimage); +PathUndo * path_transform_start_undo (GimpImage *gimage); void path_transform_free_undo (PathUndo *pundo); void path_transform_do_undo (GimpImage *gimage, PathUndo *pundo); @@ -38,10 +34,9 @@ void path_transform_draw_current (GDisplay *gimage, void path_transform_flip_horz (GimpImage *gimage); void path_transform_flip_vert (GimpImage *gimage); -void path_transform_xy (GimpImage *gimage, gint x, gint y); +void path_transform_xy (GimpImage *gimage, + gint x, + gint y); + #endif /* __PATH_TRANSFORM_H__ */ - - - - diff --git a/app/paths_cmds.c b/app/paths_cmds.c index 30171be254..bb7b5f88e2 100644 --- a/app/paths_cmds.c +++ b/app/paths_cmds.c @@ -18,10 +18,15 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ -#include "procedural_db.h" +#include "config.h" #include +#include + +#include "apptypes.h" +#include "procedural_db.h" + #include "gimage.h" #include "path.h" #include "pathP.h" diff --git a/app/paths_dialog.c b/app/paths_dialog.c index 5fc00c8452..3b300f6c46 100644 --- a/app/paths_dialog.c +++ b/app/paths_dialog.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -33,6 +34,7 @@ #include "drawable.h" #include "floating_sel.h" #include "gimage.h" +#include "gimpcontext.h" #include "gimpimage.h" #include "gimpdrawable.h" #include "gimage_mask.h" @@ -51,10 +53,10 @@ #include "path_transform.h" #include "paths_dialog.h" #include "paths_dialogP.h" +#include "plug_in.h" +#include "procedural_db.h" #include "undo.h" -#include "drawable_pvt.h" - #include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" @@ -72,6 +74,7 @@ #include "pixmaps/path.xbm" #include "pixmaps/locked.xbm" + typedef struct _PathsDialog PathsDialog; struct _PathsDialog diff --git a/app/paths_dialog.h b/app/paths_dialog.h index 49ee8e147b..e00e050495 100644 --- a/app/paths_dialog.h +++ b/app/paths_dialog.h @@ -15,21 +15,34 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __PATHS_DIALOG_H__ #define __PATHS_DIALOG_H__ -void paths_dialog_new_path_callback (GtkWidget *, gpointer); -void paths_dialog_delete_path_callback (GtkWidget *, gpointer); -void paths_dialog_dup_path_callback (GtkWidget *, gpointer); -void paths_dialog_copy_path_callback (GtkWidget *, gpointer); -void paths_dialog_paste_path_callback (GtkWidget *, gpointer); -void paths_dialog_stroke_path_callback (GtkWidget *, gpointer); -void paths_dialog_path_to_sel_callback (GtkWidget *, gpointer); -void paths_dialog_sel_to_path_callback (GtkWidget *, gpointer); -void paths_dialog_import_path_callback (GtkWidget *, gpointer); -void paths_dialog_export_path_callback (GtkWidget *, gpointer); -void paths_dialog_edit_path_attributes_callback (GtkWidget *, gpointer); -void paths_dialog_destroy_cb (GtkObject *, gpointer); +void paths_dialog_new_path_callback (GtkWidget *widget, + gpointer data); +void paths_dialog_delete_path_callback (GtkWidget *widget, + gpointer data); +void paths_dialog_dup_path_callback (GtkWidget *widget, + gpointer data); +void paths_dialog_copy_path_callback (GtkWidget *widget, + gpointer data); +void paths_dialog_paste_path_callback (GtkWidget *widget, + gpointer data); +void paths_dialog_stroke_path_callback (GtkWidget *widget, + gpointer data); +void paths_dialog_path_to_sel_callback (GtkWidget *widget, + gpointer data); +void paths_dialog_sel_to_path_callback (GtkWidget *widget, + gpointer data); +void paths_dialog_import_path_callback (GtkWidget *widget, + gpointer data); +void paths_dialog_export_path_callback (GtkWidget *widget, + gpointer data); +void paths_dialog_edit_path_attributes_callback (GtkWidget *widget, + gpointer data); +void paths_dialog_destroy_cb (GtkObject *widget, + gpointer data); #endif /* __PATHS_DIALOG_H__ */ diff --git a/app/pattern_select.c b/app/pattern_select.c index 8e1176fd05..36b3b2544c 100644 --- a/app/pattern_select.c +++ b/app/pattern_select.c @@ -15,6 +15,7 @@ * 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 @@ -30,11 +31,13 @@ #include "gimpui.h" #include "patterns.h" #include "pattern_select.h" +#include "procedural_db.h" #include "session.h" +#include "temp_buf.h" -#include "config.h" #include "libgimp/gimpintl.h" + #define MIN_CELL_SIZE 32 #define MAX_CELL_SIZE 45 diff --git a/app/pattern_select.h b/app/pattern_select.h index 3cb585b8c7..466eef7796 100644 --- a/app/pattern_select.h +++ b/app/pattern_select.h @@ -19,8 +19,6 @@ #ifndef __PATTERN_SELECT_H__ #define __PATTERN_SELECT_H__ -#include "patterns.h" - typedef struct _PatternSelect PatternSelect; @@ -77,4 +75,5 @@ void patterns_check_dialogs (void); void pattern_dialog_create (void); void pattern_dialog_free (void); + #endif /* __PATTERN_SELECT_H__ */ diff --git a/app/pattern_select_cmds.c b/app/pattern_select_cmds.c index 0fc927522f..e29ea170df 100644 --- a/app/pattern_select_cmds.c +++ b/app/pattern_select_cmds.c @@ -18,12 +18,18 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ -#include "procedural_db.h" +#include "config.h" #include +#include + +#include "apptypes.h" +#include "procedural_db.h" + #include "gimpcontext.h" #include "pattern_select.h" +#include "patterns.h" static ProcRecord patterns_popup_proc; static ProcRecord patterns_close_popup_proc; diff --git a/app/patterns.c b/app/patterns.c index c3e25ad01e..28506100ee 100644 --- a/app/patterns.c +++ b/app/patterns.c @@ -41,13 +41,16 @@ #include #endif -#include +#include + +#include "apptypes.h" #include "datafiles.h" -#include "patterns.h" -#include "pattern_header.h" #include "gimpcontext.h" #include "gimprc.h" +#include "patterns.h" +#include "pattern_header.h" +#include "temp_buf.h" #include "libgimp/gimpintl.h" diff --git a/app/patterns.h b/app/patterns.h index 320206d40e..269b84ddf7 100644 --- a/app/patterns.h +++ b/app/patterns.h @@ -15,14 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __PATTERNS_H__ #define __PATTERNS_H__ -#include - -#include "temp_buf.h" - -typedef struct _GPattern GPattern; struct _GPattern { diff --git a/app/patterns_cmds.c b/app/patterns_cmds.c index 8c031d0255..8f0ab4473b 100644 --- a/app/patterns_cmds.c +++ b/app/patterns_cmds.c @@ -18,12 +18,18 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ -#include "procedural_db.h" +#include "config.h" #include +#include + +#include "apptypes.h" +#include "procedural_db.h" + #include "gimpcontext.h" #include "patterns.h" +#include "temp_buf.h" static ProcRecord patterns_get_pattern_proc; static ProcRecord patterns_set_pattern_proc; diff --git a/app/pencil.c b/app/pencil.c index 69fc36f889..860d3da779 100644 --- a/app/pencil.c +++ b/app/pencil.c @@ -18,13 +18,16 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" #include "drawable.h" #include "gdisplay.h" +#include "gimpbrush.h" +#include "gimpcontext.h" +#include "gimpimage.h" #include "gradient.h" #include "paint_funcs.h" #include "paint_core.h" @@ -32,7 +35,9 @@ #include "paintbrush.h" #include "pencil.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" +#include "tool_options.h" /* the pencil tool options */ @@ -180,7 +185,7 @@ pencil_motion (PaintCore *paint_core, } else { - gimage_get_foreground (gimage, drawable, col); + gimp_image_get_foreground (gimage, drawable, col); col[area->bytes - 1] = OPAQUE_OPACITY; color_pixels (temp_buf_data (area), col, area->width * area->height, area->bytes); diff --git a/app/pencil.h b/app/pencil.h index b65ea78a19..5bdadd451c 100644 --- a/app/pencil.h +++ b/app/pencil.h @@ -15,16 +15,20 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __PENCIL_H__ #define __PENCIL_H__ -#include "tools.h" -#include "paint_core.h" -void * pencil_paint_func (PaintCore *, GimpDrawable *, int); -gboolean pencil_non_gui (GimpDrawable *, int, double *); +void * pencil_paint_func (PaintCore *, + GimpDrawable *, + gint ); +gboolean pencil_non_gui (GimpDrawable *, + gint , + gdouble *); + +Tool * tools_new_pencil (void); +void tools_free_pencil (Tool *tool); -Tool * tools_new_pencil (void); -void tools_free_pencil (Tool *); #endif /* __PENCIL_H__ */ diff --git a/app/perspective_tool.c b/app/perspective_tool.c index 5f320fbb9e..166e4fb6fa 100644 --- a/app/perspective_tool.c +++ b/app/perspective_tool.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include "apptypes.h" @@ -26,16 +26,20 @@ #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" +#include "gimpprogress.h" +#include "gimpui.h" #include "info_dialog.h" #include "perspective_tool.h" #include "selection.h" +#include "tile_manager_pvt.h" +#include "tools.h" +#include "transform_core.h" #include "transform_tool.h" #include "undo.h" #include "libgimp/gimpintl.h" -#include "tile_manager_pvt.h" - /* storage for information dialog fields */ static gchar matrix_row_buf [3][MAX_INFO_BUF]; @@ -58,7 +62,7 @@ perspective_tool_transform (Tool *tool, switch (state) { - case INIT: + case TRANSFORM_INIT: if (!transform_info) { transform_info = @@ -84,21 +88,21 @@ perspective_tool_transform (Tool *tool, return NULL; break; - case MOTION: + case TRANSFORM_MOTION: perspective_tool_motion (tool, gdisp_ptr); perspective_tool_recalc (tool, gdisp_ptr); break; - case RECALC: + case TRANSFORM_RECALC: perspective_tool_recalc (tool, gdisp_ptr); break; - case FINISH: + case TRANSFORM_FINISH: /* Let the transform core handle the inverse mapping */ gtk_widget_set_sensitive (GTK_WIDGET (transform_info->shell), FALSE); return perspective_tool_perspective (gdisp->gimage, - gimage_active_drawable (gdisp->gimage), + gimp_image_active_drawable (gdisp->gimage), gdisp, transform_core->original, transform_tool_smoothing (), @@ -184,19 +188,19 @@ perspective_tool_motion (Tool *tool, switch (transform_core->function) { - case HANDLE_1: + case TRANSFORM_HANDLE_1: transform_core->trans_info [X0] += diff_x; transform_core->trans_info [Y0] += diff_y; break; - case HANDLE_2: + case TRANSFORM_HANDLE_2: transform_core->trans_info [X1] += diff_x; transform_core->trans_info [Y1] += diff_y; break; - case HANDLE_3: + case TRANSFORM_HANDLE_3: transform_core->trans_info [X2] += diff_x; transform_core->trans_info [Y2] += diff_y; break; - case HANDLE_4: + case TRANSFORM_HANDLE_4: transform_core->trans_info [X3] += diff_x; transform_core->trans_info [Y3] += diff_y; break; diff --git a/app/perspective_tool.h b/app/perspective_tool.h index e79c88b0f0..611a85ecc1 100644 --- a/app/perspective_tool.h +++ b/app/perspective_tool.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __PERSPECTIVE_TOOL_H__ #define __PERSPECTIVE_TOOL_H__ -#include "tools.h" -#include "transform_core.h" TileManager * perspective_tool_transform (Tool *tool, gpointer gdisp_ptr, @@ -33,7 +32,8 @@ TileManager * perspective_tool_perspective (GimpImage *gimage, void perspective_find_transform (gdouble *coords, GimpMatrix3 matrix); -Tool * tools_new_perspective_tool (void); -void tools_free_perspective_tool (Tool *tool); +Tool * tools_new_perspective_tool (void); +void tools_free_perspective_tool (Tool *tool); + #endif /* __PERSPECTIVE_TOOL_H__ */ diff --git a/app/pixel_processor.c b/app/pixel_processor.c index 9fe4693466..4600d478e2 100644 --- a/app/pixel_processor.c +++ b/app/pixel_processor.c @@ -20,45 +20,53 @@ #include "config.h" -#include "pixel_processor.h" -#include "pixel_region.h" -#include "gimprc.h" #include #include #include #ifdef ENABLE_MP - #include - #define IF_THREAD(statement) statement - #else /* !ENABLE_MP */ - #define IF_THREAD(statement) - #endif /* ENABLE_MP */ +#include + +#include + +#include "pixel_processor.h" +#include "pixel_region.h" +#include "gimprc.h" -typedef void (*p1_func)(void *, PixelRegion *); -typedef void (*p2_func)(void *, PixelRegion * ,PixelRegion *); -typedef void (*p3_func)(void *, PixelRegion * ,PixelRegion *, PixelRegion *); -typedef void (*p4_func)(void *, PixelRegion * ,PixelRegion *, PixelRegion *, - PixelRegion *); +typedef void (* p1_func) (gpointer , + PixelRegion *); +typedef void (* p2_func) (gpointer , + PixelRegion * , + PixelRegion *); +typedef void (* p3_func) (gpointer , + PixelRegion *, + PixelRegion *, + PixelRegion *); +typedef void (* p4_func) (gpointer , + PixelRegion *, + PixelRegion *, + PixelRegion *, + PixelRegion *); struct _PixelProcessor { - void *data; - p_func f; + gpointer data; + p_func f; PixelRegionIterator *PRI; IF_THREAD(pthread_mutex_t mutex;) - int nthreads; - int n_regions; - PixelRegion *r[4]; + gint nthreads; + gint n_regions; + PixelRegion *r[4]; - void *progress_report_data; - ProgressReportFunc progress_report_func; + void *progress_report_data; + ProgressReportFunc progress_report_func; }; IF_THREAD( diff --git a/app/pixel_processor.h b/app/pixel_processor.h index 96ff634d33..b1888c36b8 100644 --- a/app/pixel_processor.h +++ b/app/pixel_processor.h @@ -21,20 +21,31 @@ #ifndef __PIXEL_PROCESSOR_H__ #define __PIXEL_PROCESSOR_H__ + typedef struct _PixelProcessor PixelProcessor; -typedef void (*p_func)(void); -typedef int (*ProgressReportFunc)(void *, int, int, int, int); +typedef void (* p_func) (void); +typedef gint (* ProgressReportFunc) (void *, + gint, + gint, + gint, + gint); -void pixel_regions_process_parallel (p_func f, void *data, int num_regions, - ...); -PixelProcessor *pixel_process_progress (p_func f, void *data, - ProgressReportFunc progress_func, - void *progress_data, - int num_regions, ...); -void pixel_processor_free (PixelProcessor *); -void pixel_processor_stop (PixelProcessor *); -PixelProcessor *pixel_processor_cont (PixelProcessor *); +void pixel_regions_process_parallel (p_func f, + gpointer data, + gint num_regions, + ...); +PixelProcessor * pixel_process_progress (p_func f, + gpointer data, + ProgressReportFunc progress_func, + gpointer progress_data, + gint num_regions, + ...); + +void pixel_processor_free (PixelProcessor *); +void pixel_processor_stop (PixelProcessor *); +PixelProcessor * pixel_processor_cont (PixelProcessor *); + #endif /* __PIXEL_PROCESSOR_H__ */ diff --git a/app/pixel_region.c b/app/pixel_region.c index 32f9f34f0a..65d38e8a24 100644 --- a/app/pixel_region.c +++ b/app/pixel_region.c @@ -21,15 +21,17 @@ #include #include -#include +#include #include "apptypes.h" #include "appenv.h" +#include "gimpprogress.h" #include "gimprc.h" #include "pixel_region.h" +#include "tile_manager.h" #include "tile_manager_pvt.h" -#include "tile.h" /* ick. */ +#include "tile.h" /*********************/ diff --git a/app/pixel_region.h b/app/pixel_region.h index e35943d525..b34b197ec9 100644 --- a/app/pixel_region.h +++ b/app/pixel_region.h @@ -15,15 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __PIXEL_REGION_H__ #define __PIXEL_REGION_H__ -#include "tile_manager.h" -#include "pixel_processor.h" /* this is temporary, */ - - -typedef struct _PixelRegion PixelRegion; - struct _PixelRegion { guchar *data; /* pointer to region data */ @@ -41,9 +36,6 @@ struct _PixelRegion gint process_count; /* used internally */ }; - -typedef struct _PixelRegionHolder PixelRegionHolder; - struct _PixelRegionHolder { PixelRegion *PR; @@ -53,9 +45,6 @@ struct _PixelRegionHolder gint count; }; - -typedef struct _PixelRegionIterator PixelRegionIterator; - struct _PixelRegionIterator { GSList *pixel_regions; diff --git a/app/plug-in/gimpplugin-message.c b/app/plug-in/gimpplugin-message.c index 55ca59c2c1..03e7a8c016 100644 --- a/app/plug-in/gimpplugin-message.c +++ b/app/plug-in/gimpplugin-message.c @@ -22,7 +22,7 @@ #include #endif -#include +#include #include #include @@ -88,13 +88,14 @@ #include "gdisplay.h" #include "general.h" #include "gimage.h" +#include "gimpprogress.h" #include "gimprc.h" #include "gradient_select.h" #include "menus.h" #include "pattern_select.h" /* Needed for closing pattern dialogs */ #include "plug_in.h" - -#include "tile.h" /* ick. */ +#include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpenv.h" #include "libgimp/gimpprotocol.h" diff --git a/app/plug-in/gimpplugin-progress.c b/app/plug-in/gimpplugin-progress.c index 55ca59c2c1..03e7a8c016 100644 --- a/app/plug-in/gimpplugin-progress.c +++ b/app/plug-in/gimpplugin-progress.c @@ -22,7 +22,7 @@ #include #endif -#include +#include #include #include @@ -88,13 +88,14 @@ #include "gdisplay.h" #include "general.h" #include "gimage.h" +#include "gimpprogress.h" #include "gimprc.h" #include "gradient_select.h" #include "menus.h" #include "pattern_select.h" /* Needed for closing pattern dialogs */ #include "plug_in.h" - -#include "tile.h" /* ick. */ +#include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpenv.h" #include "libgimp/gimpprotocol.h" diff --git a/app/plug-in/gimpplugin-progress.h b/app/plug-in/gimpplugin-progress.h index 20cf93c79b..e6822e9970 100644 --- a/app/plug-in/gimpplugin-progress.h +++ b/app/plug-in/gimpplugin-progress.h @@ -21,8 +21,6 @@ #include "procedural_db.h" -#include "gimpprogress.h" -#include "drawable.h" #define WRITE_BUFFER_SIZE 512 @@ -188,7 +186,9 @@ void plug_in_progress_init (PlugIn *plug_in, void plug_in_progress_update (PlugIn *plug_in, gdouble percentage); + extern PlugIn *current_plug_in; extern GSList *proc_defs; + #endif /* __PLUG_IN_H__ */ diff --git a/app/plug-in/gimpplugin.c b/app/plug-in/gimpplugin.c index 55ca59c2c1..03e7a8c016 100644 --- a/app/plug-in/gimpplugin.c +++ b/app/plug-in/gimpplugin.c @@ -22,7 +22,7 @@ #include #endif -#include +#include #include #include @@ -88,13 +88,14 @@ #include "gdisplay.h" #include "general.h" #include "gimage.h" +#include "gimpprogress.h" #include "gimprc.h" #include "gradient_select.h" #include "menus.h" #include "pattern_select.h" /* Needed for closing pattern dialogs */ #include "plug_in.h" - -#include "tile.h" /* ick. */ +#include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpenv.h" #include "libgimp/gimpprotocol.h" diff --git a/app/plug-in/gimpplugin.h b/app/plug-in/gimpplugin.h index 20cf93c79b..e6822e9970 100644 --- a/app/plug-in/gimpplugin.h +++ b/app/plug-in/gimpplugin.h @@ -21,8 +21,6 @@ #include "procedural_db.h" -#include "gimpprogress.h" -#include "drawable.h" #define WRITE_BUFFER_SIZE 512 @@ -188,7 +186,9 @@ void plug_in_progress_init (PlugIn *plug_in, void plug_in_progress_update (PlugIn *plug_in, gdouble percentage); + extern PlugIn *current_plug_in; extern GSList *proc_defs; + #endif /* __PLUG_IN_H__ */ diff --git a/app/plug-in/gimppluginmanager-call.c b/app/plug-in/gimppluginmanager-call.c index 55ca59c2c1..03e7a8c016 100644 --- a/app/plug-in/gimppluginmanager-call.c +++ b/app/plug-in/gimppluginmanager-call.c @@ -22,7 +22,7 @@ #include #endif -#include +#include #include #include @@ -88,13 +88,14 @@ #include "gdisplay.h" #include "general.h" #include "gimage.h" +#include "gimpprogress.h" #include "gimprc.h" #include "gradient_select.h" #include "menus.h" #include "pattern_select.h" /* Needed for closing pattern dialogs */ #include "plug_in.h" - -#include "tile.h" /* ick. */ +#include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpenv.h" #include "libgimp/gimpprotocol.h" diff --git a/app/plug-in/gimppluginmanager-run.c b/app/plug-in/gimppluginmanager-run.c index 55ca59c2c1..03e7a8c016 100644 --- a/app/plug-in/gimppluginmanager-run.c +++ b/app/plug-in/gimppluginmanager-run.c @@ -22,7 +22,7 @@ #include #endif -#include +#include #include #include @@ -88,13 +88,14 @@ #include "gdisplay.h" #include "general.h" #include "gimage.h" +#include "gimpprogress.h" #include "gimprc.h" #include "gradient_select.h" #include "menus.h" #include "pattern_select.h" /* Needed for closing pattern dialogs */ #include "plug_in.h" - -#include "tile.h" /* ick. */ +#include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpenv.h" #include "libgimp/gimpprotocol.h" diff --git a/app/plug-in/gimppluginmanager.c b/app/plug-in/gimppluginmanager.c index 55ca59c2c1..03e7a8c016 100644 --- a/app/plug-in/gimppluginmanager.c +++ b/app/plug-in/gimppluginmanager.c @@ -22,7 +22,7 @@ #include #endif -#include +#include #include #include @@ -88,13 +88,14 @@ #include "gdisplay.h" #include "general.h" #include "gimage.h" +#include "gimpprogress.h" #include "gimprc.h" #include "gradient_select.h" #include "menus.h" #include "pattern_select.h" /* Needed for closing pattern dialogs */ #include "plug_in.h" - -#include "tile.h" /* ick. */ +#include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpenv.h" #include "libgimp/gimpprotocol.h" diff --git a/app/plug-in/gimppluginmanager.h b/app/plug-in/gimppluginmanager.h index 20cf93c79b..e6822e9970 100644 --- a/app/plug-in/gimppluginmanager.h +++ b/app/plug-in/gimppluginmanager.h @@ -21,8 +21,6 @@ #include "procedural_db.h" -#include "gimpprogress.h" -#include "drawable.h" #define WRITE_BUFFER_SIZE 512 @@ -188,7 +186,9 @@ void plug_in_progress_init (PlugIn *plug_in, void plug_in_progress_update (PlugIn *plug_in, gdouble percentage); + extern PlugIn *current_plug_in; extern GSList *proc_defs; + #endif /* __PLUG_IN_H__ */ diff --git a/app/plug-in/gimppluginshm.c b/app/plug-in/gimppluginshm.c index 55ca59c2c1..03e7a8c016 100644 --- a/app/plug-in/gimppluginshm.c +++ b/app/plug-in/gimppluginshm.c @@ -22,7 +22,7 @@ #include #endif -#include +#include #include #include @@ -88,13 +88,14 @@ #include "gdisplay.h" #include "general.h" #include "gimage.h" +#include "gimpprogress.h" #include "gimprc.h" #include "gradient_select.h" #include "menus.h" #include "pattern_select.h" /* Needed for closing pattern dialogs */ #include "plug_in.h" - -#include "tile.h" /* ick. */ +#include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpenv.h" #include "libgimp/gimpprotocol.h" diff --git a/app/plug-in/plug-in-def.c b/app/plug-in/plug-in-def.c index 55ca59c2c1..03e7a8c016 100644 --- a/app/plug-in/plug-in-def.c +++ b/app/plug-in/plug-in-def.c @@ -22,7 +22,7 @@ #include #endif -#include +#include #include #include @@ -88,13 +88,14 @@ #include "gdisplay.h" #include "general.h" #include "gimage.h" +#include "gimpprogress.h" #include "gimprc.h" #include "gradient_select.h" #include "menus.h" #include "pattern_select.h" /* Needed for closing pattern dialogs */ #include "plug_in.h" - -#include "tile.h" /* ick. */ +#include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpenv.h" #include "libgimp/gimpprotocol.h" diff --git a/app/plug-in/plug-in-def.h b/app/plug-in/plug-in-def.h index 20cf93c79b..e6822e9970 100644 --- a/app/plug-in/plug-in-def.h +++ b/app/plug-in/plug-in-def.h @@ -21,8 +21,6 @@ #include "procedural_db.h" -#include "gimpprogress.h" -#include "drawable.h" #define WRITE_BUFFER_SIZE 512 @@ -188,7 +186,9 @@ void plug_in_progress_init (PlugIn *plug_in, void plug_in_progress_update (PlugIn *plug_in, gdouble percentage); + extern PlugIn *current_plug_in; extern GSList *proc_defs; + #endif /* __PLUG_IN_H__ */ diff --git a/app/plug-in/plug-in-message.c b/app/plug-in/plug-in-message.c index 55ca59c2c1..03e7a8c016 100644 --- a/app/plug-in/plug-in-message.c +++ b/app/plug-in/plug-in-message.c @@ -22,7 +22,7 @@ #include #endif -#include +#include #include #include @@ -88,13 +88,14 @@ #include "gdisplay.h" #include "general.h" #include "gimage.h" +#include "gimpprogress.h" #include "gimprc.h" #include "gradient_select.h" #include "menus.h" #include "pattern_select.h" /* Needed for closing pattern dialogs */ #include "plug_in.h" - -#include "tile.h" /* ick. */ +#include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpenv.h" #include "libgimp/gimpprotocol.h" diff --git a/app/plug-in/plug-in-params.c b/app/plug-in/plug-in-params.c index 55ca59c2c1..03e7a8c016 100644 --- a/app/plug-in/plug-in-params.c +++ b/app/plug-in/plug-in-params.c @@ -22,7 +22,7 @@ #include #endif -#include +#include #include #include @@ -88,13 +88,14 @@ #include "gdisplay.h" #include "general.h" #include "gimage.h" +#include "gimpprogress.h" #include "gimprc.h" #include "gradient_select.h" #include "menus.h" #include "pattern_select.h" /* Needed for closing pattern dialogs */ #include "plug_in.h" - -#include "tile.h" /* ick. */ +#include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpenv.h" #include "libgimp/gimpprotocol.h" diff --git a/app/plug-in/plug-in-params.h b/app/plug-in/plug-in-params.h index 20cf93c79b..e6822e9970 100644 --- a/app/plug-in/plug-in-params.h +++ b/app/plug-in/plug-in-params.h @@ -21,8 +21,6 @@ #include "procedural_db.h" -#include "gimpprogress.h" -#include "drawable.h" #define WRITE_BUFFER_SIZE 512 @@ -188,7 +186,9 @@ void plug_in_progress_init (PlugIn *plug_in, void plug_in_progress_update (PlugIn *plug_in, gdouble percentage); + extern PlugIn *current_plug_in; extern GSList *proc_defs; + #endif /* __PLUG_IN_H__ */ diff --git a/app/plug-in/plug-in-progress.c b/app/plug-in/plug-in-progress.c index 55ca59c2c1..03e7a8c016 100644 --- a/app/plug-in/plug-in-progress.c +++ b/app/plug-in/plug-in-progress.c @@ -22,7 +22,7 @@ #include #endif -#include +#include #include #include @@ -88,13 +88,14 @@ #include "gdisplay.h" #include "general.h" #include "gimage.h" +#include "gimpprogress.h" #include "gimprc.h" #include "gradient_select.h" #include "menus.h" #include "pattern_select.h" /* Needed for closing pattern dialogs */ #include "plug_in.h" - -#include "tile.h" /* ick. */ +#include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpenv.h" #include "libgimp/gimpprotocol.h" diff --git a/app/plug-in/plug-in-progress.h b/app/plug-in/plug-in-progress.h index 20cf93c79b..e6822e9970 100644 --- a/app/plug-in/plug-in-progress.h +++ b/app/plug-in/plug-in-progress.h @@ -21,8 +21,6 @@ #include "procedural_db.h" -#include "gimpprogress.h" -#include "drawable.h" #define WRITE_BUFFER_SIZE 512 @@ -188,7 +186,9 @@ void plug_in_progress_init (PlugIn *plug_in, void plug_in_progress_update (PlugIn *plug_in, gdouble percentage); + extern PlugIn *current_plug_in; extern GSList *proc_defs; + #endif /* __PLUG_IN_H__ */ diff --git a/app/plug-in/plug-in-run.c b/app/plug-in/plug-in-run.c index 55ca59c2c1..03e7a8c016 100644 --- a/app/plug-in/plug-in-run.c +++ b/app/plug-in/plug-in-run.c @@ -22,7 +22,7 @@ #include #endif -#include +#include #include #include @@ -88,13 +88,14 @@ #include "gdisplay.h" #include "general.h" #include "gimage.h" +#include "gimpprogress.h" #include "gimprc.h" #include "gradient_select.h" #include "menus.h" #include "pattern_select.h" /* Needed for closing pattern dialogs */ #include "plug_in.h" - -#include "tile.h" /* ick. */ +#include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpenv.h" #include "libgimp/gimpprotocol.h" diff --git a/app/plug-in/plug-in-shm.c b/app/plug-in/plug-in-shm.c index 55ca59c2c1..03e7a8c016 100644 --- a/app/plug-in/plug-in-shm.c +++ b/app/plug-in/plug-in-shm.c @@ -22,7 +22,7 @@ #include #endif -#include +#include #include #include @@ -88,13 +88,14 @@ #include "gdisplay.h" #include "general.h" #include "gimage.h" +#include "gimpprogress.h" #include "gimprc.h" #include "gradient_select.h" #include "menus.h" #include "pattern_select.h" /* Needed for closing pattern dialogs */ #include "plug_in.h" - -#include "tile.h" /* ick. */ +#include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpenv.h" #include "libgimp/gimpprotocol.h" diff --git a/app/plug-in/plug-in.c b/app/plug-in/plug-in.c index 55ca59c2c1..03e7a8c016 100644 --- a/app/plug-in/plug-in.c +++ b/app/plug-in/plug-in.c @@ -22,7 +22,7 @@ #include #endif -#include +#include #include #include @@ -88,13 +88,14 @@ #include "gdisplay.h" #include "general.h" #include "gimage.h" +#include "gimpprogress.h" #include "gimprc.h" #include "gradient_select.h" #include "menus.h" #include "pattern_select.h" /* Needed for closing pattern dialogs */ #include "plug_in.h" - -#include "tile.h" /* ick. */ +#include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpenv.h" #include "libgimp/gimpprotocol.h" diff --git a/app/plug-in/plug-in.h b/app/plug-in/plug-in.h index 20cf93c79b..e6822e9970 100644 --- a/app/plug-in/plug-in.h +++ b/app/plug-in/plug-in.h @@ -21,8 +21,6 @@ #include "procedural_db.h" -#include "gimpprogress.h" -#include "drawable.h" #define WRITE_BUFFER_SIZE 512 @@ -188,7 +186,9 @@ void plug_in_progress_init (PlugIn *plug_in, void plug_in_progress_update (PlugIn *plug_in, gdouble percentage); + extern PlugIn *current_plug_in; extern GSList *proc_defs; + #endif /* __PLUG_IN_H__ */ diff --git a/app/plug-in/plug-ins.c b/app/plug-in/plug-ins.c index 55ca59c2c1..03e7a8c016 100644 --- a/app/plug-in/plug-ins.c +++ b/app/plug-in/plug-ins.c @@ -22,7 +22,7 @@ #include #endif -#include +#include #include #include @@ -88,13 +88,14 @@ #include "gdisplay.h" #include "general.h" #include "gimage.h" +#include "gimpprogress.h" #include "gimprc.h" #include "gradient_select.h" #include "menus.h" #include "pattern_select.h" /* Needed for closing pattern dialogs */ #include "plug_in.h" - -#include "tile.h" /* ick. */ +#include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpenv.h" #include "libgimp/gimpprotocol.h" diff --git a/app/plug-in/plug-ins.h b/app/plug-in/plug-ins.h index 20cf93c79b..e6822e9970 100644 --- a/app/plug-in/plug-ins.h +++ b/app/plug-in/plug-ins.h @@ -21,8 +21,6 @@ #include "procedural_db.h" -#include "gimpprogress.h" -#include "drawable.h" #define WRITE_BUFFER_SIZE 512 @@ -188,7 +186,9 @@ void plug_in_progress_init (PlugIn *plug_in, void plug_in_progress_update (PlugIn *plug_in, gdouble percentage); + extern PlugIn *current_plug_in; extern GSList *proc_defs; + #endif /* __PLUG_IN_H__ */ diff --git a/app/plug_in.c b/app/plug_in.c index 55ca59c2c1..03e7a8c016 100644 --- a/app/plug_in.c +++ b/app/plug_in.c @@ -22,7 +22,7 @@ #include #endif -#include +#include #include #include @@ -88,13 +88,14 @@ #include "gdisplay.h" #include "general.h" #include "gimage.h" +#include "gimpprogress.h" #include "gimprc.h" #include "gradient_select.h" #include "menus.h" #include "pattern_select.h" /* Needed for closing pattern dialogs */ #include "plug_in.h" - -#include "tile.h" /* ick. */ +#include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpenv.h" #include "libgimp/gimpprotocol.h" diff --git a/app/plug_in.h b/app/plug_in.h index 20cf93c79b..e6822e9970 100644 --- a/app/plug_in.h +++ b/app/plug_in.h @@ -21,8 +21,6 @@ #include "procedural_db.h" -#include "gimpprogress.h" -#include "drawable.h" #define WRITE_BUFFER_SIZE 512 @@ -188,7 +186,9 @@ void plug_in_progress_init (PlugIn *plug_in, void plug_in_progress_update (PlugIn *plug_in, gdouble percentage); + extern PlugIn *current_plug_in; extern GSList *proc_defs; + #endif /* __PLUG_IN_H__ */ diff --git a/app/plug_in_cmds.c b/app/plug_in_cmds.c index abc70ac81d..4cdb7b7b54 100644 --- a/app/plug_in_cmds.c +++ b/app/plug_in_cmds.c @@ -18,11 +18,16 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ -#include "procedural_db.h" +#include "config.h" #include #include +#include + +#include "apptypes.h" +#include "procedural_db.h" + #include "appenv.h" #include "plug_in.h" #include "regex.h" diff --git a/app/posterize.c b/app/posterize.c index 0f64de091f..c8c7cc728b 100644 --- a/app/posterize.c +++ b/app/posterize.c @@ -18,18 +18,21 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" #include "drawable.h" #include "gdisplay.h" -#include "image_map.h" -#include "posterize.h" +#include "gimpimage.h" #include "gimplut.h" #include "gimpui.h" +#include "image_map.h" #include "lut_funcs.h" +#include "posterize.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpintl.h" @@ -153,7 +156,7 @@ tools_free_posterize (Tool *tool) void posterize_initialize (GDisplay *gdisp) { - if (drawable_indexed (gimage_active_drawable (gdisp->gimage))) + if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Posterize does not operate on indexed drawables.")); return; @@ -168,7 +171,7 @@ posterize_initialize (GDisplay *gdisp) posterize_dialog->levels = 3; - posterize_dialog->drawable = gimage_active_drawable (gdisp->gimage); + posterize_dialog->drawable = gimp_image_active_drawable (gdisp->gimage); posterize_dialog->image_map = image_map_create (gdisp, posterize_dialog->drawable); diff --git a/app/posterize.h b/app/posterize.h index 5e1ebdfa4d..3b16c85bb4 100644 --- a/app/posterize.h +++ b/app/posterize.h @@ -15,10 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __POSTERIZE_H__ #define __POSTERIZE_H__ -#include "tools.h" Tool * tools_new_posterize (void); void tools_free_posterize (Tool *tool); @@ -26,4 +26,5 @@ void tools_free_posterize (Tool *tool); void posterize_dialog_hide (void); void posterize_initialize (GDisplay *gdisp); + #endif /* __POSTERIZE_H__ */ diff --git a/app/preferences_dialog.c b/app/preferences_dialog.c index 044b51bad6..a85f2838c0 100644 --- a/app/preferences_dialog.c +++ b/app/preferences_dialog.c @@ -20,7 +20,7 @@ #include -#include +#include #include "apptypes.h" @@ -30,9 +30,12 @@ #include "cursorutil.h" #include "gdisplay_ops.h" #include "gdisplay.h" +#include "gimage.h" +#include "gimphelp.h" #include "gimprc.h" #include "gimpui.h" #include "image_render.h" +#include "layer.h" #include "lc_dialog.h" #include "layer_select.h" #include "resolution_calibrate.h" @@ -44,6 +47,7 @@ #include "libgimp/gimpintl.h" + /* gimprc will be parsed with a buffer size of 1024, so don't set this too large */ #define MAX_COMMENT_LENGTH 512 @@ -896,7 +900,7 @@ prefs_cancel_callback (GtkWidget *widget, transparency_size = old_transparency_size; render_setup (transparency_type, transparency_size); - gimage_foreach ((GFunc)layer_invalidate_previews, NULL); + gimage_foreach ((GFunc) layer_invalidate_previews, NULL); gimage_invalidate_previews (); gdisplays_expose_full (); gdisplays_flush (); diff --git a/app/preferences_dialog.h b/app/preferences_dialog.h index 6248568da9..9ee76ba152 100644 --- a/app/preferences_dialog.h +++ b/app/preferences_dialog.h @@ -20,7 +20,8 @@ #define __PREFERENCES_DIALOG_H__ -void prefs_cmd_callback (GtkWidget *widget, gpointer data); +void prefs_cmd_callback (GtkWidget *widget, + gpointer data); #endif /* __PREFERENCES_DIALOG_H__ */ diff --git a/app/procedural_db.c b/app/procedural_db.c index a01caa1635..c4bcb631cd 100644 --- a/app/procedural_db.c +++ b/app/procedural_db.c @@ -20,8 +20,9 @@ #include #include +#include -#include +#include #include "apptypes.h" diff --git a/app/procedural_db.h b/app/procedural_db.h index 7c2ff01645..ac6e3ddcf9 100644 --- a/app/procedural_db.h +++ b/app/procedural_db.h @@ -15,64 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __PROCEDURAL_DB_H__ #define __PROCEDURAL_DB_H__ -#include - -#include "apptypes.h" - -/* Procedural database types */ -typedef enum -{ - PDB_INT32, - PDB_INT16, - PDB_INT8, - PDB_FLOAT, - PDB_STRING, - PDB_INT32ARRAY, - PDB_INT16ARRAY, - PDB_INT8ARRAY, - PDB_FLOATARRAY, - PDB_STRINGARRAY, - PDB_COLOR, - PDB_REGION, - PDB_DISPLAY, - PDB_IMAGE, - PDB_LAYER, - PDB_CHANNEL, - PDB_DRAWABLE, - PDB_SELECTION, - PDB_BOUNDARY, - PDB_PATH, - PDB_PARASITE, - PDB_STATUS, - PDB_END -} PDBArgType; - -/* Error types */ -typedef enum -{ - PDB_EXECUTION_ERROR, - PDB_CALLING_ERROR, - PDB_PASS_THROUGH, - PDB_SUCCESS, - PDB_CANCEL -} PDBStatusType; - - -/* Procedure types */ -typedef enum /*< chop=PDB_ >*/ -{ - PDB_INTERNAL, - PDB_PLUGIN, - PDB_EXTENSION, - PDB_TEMPORARY -} PDBProcType; - - -/* Argument type */ -typedef struct _Argument Argument; struct _Argument { @@ -126,7 +72,6 @@ struct _NetExec /* Structure for a procedure argument */ -typedef struct _ProcArg ProcArg; struct _ProcArg { @@ -138,8 +83,6 @@ struct _ProcArg /* Structure for a procedure */ -typedef struct _ProcRecord ProcRecord; - struct _ProcRecord { /* Procedure information */ diff --git a/app/procedural_db_cmds.c b/app/procedural_db_cmds.c index d20c20205d..60c8e51e98 100644 --- a/app/procedural_db_cmds.c +++ b/app/procedural_db_cmds.c @@ -18,14 +18,17 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ -#include "procedural_db.h" - #include "config.h" #include #include #include +#include + +#include "apptypes.h" +#include "procedural_db.h" + #include "regex.h" #include "libgimp/gimpintl.h" diff --git a/app/qmask.c b/app/qmask.c index 34be73025d..1c4af4b114 100644 --- a/app/qmask.c +++ b/app/qmask.c @@ -29,11 +29,12 @@ #include "appenv.h" #include "channel.h" #include "color_panel.h" +#include "drawable.h" #include "floating_sel.h" -#include "gdisplayF.h" -#include "gimpcontext.h" +#include "gdisplay.h" #include "gimage_mask.h" #include "gimpimage.h" +#include "gimpcontext.h" #include "gimpui.h" #include "global_edit.h" #include "qmask.h" @@ -163,7 +164,7 @@ qmask_deactivate (GtkWidget *widget, the qmask_state to FALSE */ undo_push_qmask (gimg); gimage_mask_load (gimg, gmask); - gimage_remove_channel (gimg, gmask); + gimp_image_remove_channel (gimg, gmask); undo_push_group_end (gimg); } @@ -207,9 +208,9 @@ qmask_activate (GtkWidget *widget, undo_push_group_start (gimg, QMASK_UNDO); - if (gimage_mask_is_empty(gimg)) + if (gimage_mask_is_empty (gimg)) { - if ((layer = gimage_floating_sel (gimg))) + if ((layer = gimp_image_floating_sel (gimg))) { floating_sel_to_layer (layer); } @@ -217,7 +218,7 @@ qmask_activate (GtkWidget *widget, gmask = channel_new (gimg, gimg->width, gimg->height, - "Qmask", + "Qmask", (gint)(255*opacity)/100, color); gimp_image_add_channel (gimg, gmask, 0); @@ -225,7 +226,7 @@ qmask_activate (GtkWidget *widget, } else { /* if selection */ - gmask = channel_copy (gimage_get_mask (gimg)); + gmask = channel_copy (gimp_image_get_mask (gimg)); gimp_image_add_channel (gimg, gmask, 0); channel_set_color (gmask, color); drawable_set_name (GIMP_DRAWABLE (gmask), "Qmask"); @@ -331,12 +332,12 @@ edit_qmask_query_ok_callback (GtkWidget *widget, gpointer client_data) { EditQmaskOptions *options; - Channel *channel; - guchar *tmpcolp; - guchar tmpcol[3]; - gboolean update = FALSE; - gint opacity; - gint i; + Channel *channel; + const guchar *tmpcolp; + guchar tmpcol[3]; + gboolean update = FALSE; + gint opacity; + gint i; options = (EditQmaskOptions *) client_data; channel = gimp_image_get_channel_by_name (options->gimage, "Qmask"); @@ -348,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget, { update = TRUE; } - tmpcolp = channel_get_color(channel); + tmpcolp = channel_get_color (channel); for (i = 0; i < 3; i++) { /* don't update if color hasn't changed */ tmpcol[i] = tmpcolp[i]; /* initialize to same values */ diff --git a/app/qmask.h b/app/qmask.h index e47b40f493..66664516f4 100644 --- a/app/qmask.h +++ b/app/qmask.h @@ -15,13 +15,20 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __QMASK_H__ #define __QMASK_H__ -void qmask_click_handler(GtkWidget *widget, GdkEventButton *event, gpointer data); -void qmask_activate(GtkWidget *w, GDisplay *gdisp); -void qmask_deactivate(GtkWidget *w, GDisplay *gdisp); -void qmask_buttons_update (GDisplay *gdisp); + +void qmask_click_handler (GtkWidget *widget, + GdkEventButton *event, + gpointer data); +void qmask_activate (GtkWidget *widget, + GDisplay *gdisp); +void qmask_deactivate (GtkWidget *widget, + GDisplay *gdisp); +void qmask_buttons_update (GDisplay *gdisp); + #endif /* __QMASK_H__ */ diff --git a/app/rect_select.c b/app/rect_select.c index dc42bcf149..3dbca9e287 100644 --- a/app/rect_select.c +++ b/app/rect_select.c @@ -26,14 +26,19 @@ #include "apptypes.h" #include "appenv.h" +#include "channel.h" +#include "cursorutil.h" +#include "draw_core.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "edit_selection.h" #include "floating_sel.h" #include "rect_select.h" #include "rect_selectP.h" #include "selection_options.h" -#include "cursorutil.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpunitmenu.h" @@ -91,8 +96,8 @@ rect_select (GimpImage *gimage, if (feather) { new_mask = channel_new_mask (gimage, gimage->width, gimage->height); - channel_combine_rect (new_mask, ADD, x, y, w, h); - channel_feather (new_mask, gimage_get_mask (gimage), + channel_combine_rect (new_mask, CHANNEL_OP_ADD, x, y, w, h); + channel_feather (new_mask, gimp_image_get_mask (gimage), feather_radius, feather_radius, op, 0, 0); @@ -101,12 +106,12 @@ rect_select (GimpImage *gimage, else if (op == SELECTION_INTERSECT) { new_mask = channel_new_mask (gimage, gimage->width, gimage->height); - channel_combine_rect (new_mask, ADD, x, y, w, h); - channel_combine_mask (gimage_get_mask (gimage), new_mask, op, 0, 0); + channel_combine_rect (new_mask, CHANNEL_OP_ADD, x, y, w, h); + channel_combine_mask (gimp_image_get_mask (gimage), new_mask, op, 0, 0); channel_delete (new_mask); } else - channel_combine_rect (gimage_get_mask (gimage), op, x, y, w, h); + channel_combine_rect (gimp_image_get_mask (gimage), op, x, y, w, h); } void @@ -253,8 +258,8 @@ rect_select_button_release (Tool *tool, if ((!w || !h) && !rect_sel->fixed_size) { /* If there is a floating selection, anchor it */ - if (gimage_floating_sel (gdisp->gimage)) - floating_sel_anchor (gimage_floating_sel (gdisp->gimage)); + if (gimp_image_floating_sel (gdisp->gimage)) + floating_sel_anchor (gimp_image_floating_sel (gdisp->gimage)); /* Otherwise, clear the selection mask */ else gimage_mask_clear (gdisp->gimage); @@ -504,8 +509,8 @@ selection_tool_update_op_state (RectSelect *rect_sel, gdisplay_untransform_coords (gdisp, x, y, &tx, &ty, FALSE, FALSE); - layer = gimage_pick_correlate_layer (gdisp->gimage, tx, ty); - floating_sel = gimage_floating_sel (gdisp->gimage); + layer = gimp_image_pick_correlate_layer (gdisp->gimage, tx, ty); + floating_sel = gimp_image_floating_sel (gdisp->gimage); if (state & GDK_MOD1_MASK && !gimage_mask_is_empty (gdisp->gimage)) diff --git a/app/rect_select.h b/app/rect_select.h index e070713026..ffc764b9db 100644 --- a/app/rect_select.h +++ b/app/rect_select.h @@ -15,33 +15,47 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __RECT_SELECT_H__ #define __RECT_SELECT_H__ -#include "apptypes.h" -#include "tools.h" /* rect select action functions */ -void rect_select_button_press (Tool *, GdkEventButton *, gpointer); -void rect_select_button_release (Tool *, GdkEventButton *, gpointer); -void rect_select_motion (Tool *, GdkEventMotion *, gpointer); -void rect_select_modifier_update (Tool *, GdkEventKey * , gpointer); -void rect_select_cursor_update (Tool *, GdkEventMotion *, gpointer); -void rect_select_oper_update (Tool *, GdkEventMotion *, gpointer); -void rect_select_control (Tool *, ToolAction, gpointer); +void rect_select_button_press (Tool *tool, + GdkEventButton *bevent, + gpointer gdisp_ptr); +void rect_select_button_release (Tool *tool, + GdkEventButton *bevent, + gpointer gdisp_ptr); +void rect_select_motion (Tool *tool, + GdkEventMotion *mevent, + gpointer gdisp_ptr); +void rect_select_modifier_update (Tool *tool, + GdkEventKey *kevent, + gpointer gdisp_ptr); +void rect_select_cursor_update (Tool *tool, + GdkEventMotion *mevent, + gpointer gdisp_ptr); +void rect_select_oper_update (Tool *tool, + GdkEventMotion *mevent, + gpointer gdisp_ptr); +void rect_select_control (Tool *tool, + ToolAction tool_action, + gpointer gdisp_ptr); /* rect select functions */ -void rect_select_draw (Tool *tool); -void rect_select (GimpImage *gimage, - gint x, - gint y, - gint w, - gint g, - SelectOps op, - gboolean feather, - gdouble feather_radius); +void rect_select_draw (Tool *tool); +void rect_select (GimpImage *gimage, + gint x, + gint y, + gint w, + gint g, + SelectOps op, + gboolean feather, + gdouble feather_radius); Tool * tools_new_rect_select (void); -void tools_free_rect_select (Tool *tool); +void tools_free_rect_select (Tool *tool); + #endif /* __RECT_SELECT_H__ */ diff --git a/app/rect_selectP.h b/app/rect_selectP.h index 31b3a84bb8..cce1e57051 100644 --- a/app/rect_selectP.h +++ b/app/rect_selectP.h @@ -15,10 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __RECT_SELECTP_H__ #define __RECT_SELECTP_H__ -#include "draw_core.h" typedef struct _RectSelect RectSelect, EllipseSelect; @@ -43,4 +43,5 @@ struct _RectSelect guint context_id; /* for the statusbar */ }; + #endif /* __RECT_SELECTP_H__ */ diff --git a/app/resize.c b/app/resize.c index af13080eb3..cfec13b91f 100644 --- a/app/resize.c +++ b/app/resize.c @@ -23,7 +23,9 @@ #include "apptypes.h" #include "appenv.h" +#include "layer.h" #include "gdisplay.h" +#include "gimpimage.h" #include "resize.h" #include "undo.h" #include "gimprc.h" @@ -36,6 +38,7 @@ #include "libgimp/gimpintl.h" + #define EVENT_MASK GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK #define DRAWING_AREA_SIZE 200 #define TEXT_WIDTH 35 @@ -1253,12 +1256,12 @@ resize_events (GtkWidget *widget, void resize_scale_implement (ImageResize *image_scale) { - GImage *gimage = NULL; - gboolean rulers_flush = FALSE; - gboolean display_flush = FALSE; /* this is a bit ugly: - we hijack the flush variable - to check if an undo_group was - already started */ + GimpImage *gimage = NULL; + gboolean rulers_flush = FALSE; + gboolean display_flush = FALSE; /* this is a bit ugly: + we hijack the flush variable + to check if an undo_group was + already started */ g_assert (image_scale != NULL); gimage = image_scale->gimage; @@ -1269,9 +1272,9 @@ resize_scale_implement (ImageResize *image_scale) { undo_push_group_start (gimage, IMAGE_SCALE_UNDO); - gimage_set_resolution (gimage, - image_scale->resize->resolution_x, - image_scale->resize->resolution_y); + gimp_image_set_resolution (gimage, + image_scale->resize->resolution_x, + image_scale->resize->resolution_y); rulers_flush = TRUE; display_flush = TRUE; @@ -1282,7 +1285,7 @@ resize_scale_implement (ImageResize *image_scale) if (!display_flush) undo_push_group_start (gimage, IMAGE_SCALE_UNDO); - gimage_set_unit (gimage, image_scale->resize->unit); + gimp_image_set_unit (gimage, image_scale->resize->unit); gdisplays_setup_scale (gimage); gdisplays_resize_cursor_label (gimage); @@ -1299,9 +1302,9 @@ resize_scale_implement (ImageResize *image_scale) if (!display_flush) undo_push_group_start (gimage, IMAGE_SCALE_UNDO); - gimage_scale (gimage, - image_scale->resize->width, - image_scale->resize->height); + gimp_image_scale (gimage, + image_scale->resize->width, + image_scale->resize->height); display_flush = TRUE; } diff --git a/app/resize.h b/app/resize.h index 327bf4c103..a03fbfacf4 100644 --- a/app/resize.h +++ b/app/resize.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __RESIZE_H__ #define __RESIZE_H__ -#include "libgimp/gimpunit.h" -#include "gimage.h" typedef enum { @@ -73,23 +72,24 @@ typedef struct * If cancel_callback is NULL, then the dialog will be destroyed on "Cancel". */ -Resize * resize_widget_new (ResizeType type, - ResizeTarget target, - GtkObject *object, - gchar *signal, - gint width, - gint height, - gdouble resolution_x, - gdouble resolution_y, - GimpUnit unit, - gboolean dot_for_dot, - GtkSignalFunc ok_cb, - GtkSignalFunc cancel_cb, - gpointer user_data); +Resize * resize_widget_new (ResizeType type, + ResizeTarget target, + GtkObject *object, + gchar *signal, + gint width, + gint height, + gdouble resolution_x, + gdouble resolution_y, + GimpUnit unit, + gboolean dot_for_dot, + GtkSignalFunc ok_cb, + GtkSignalFunc cancel_cb, + gpointer user_data); /* Layer scaling sanity check and warning dialogs */ -gboolean resize_check_layer_scaling (ImageResize *image_resize); -void resize_scale_implement (ImageResize *image_resize); +gboolean resize_check_layer_scaling (ImageResize *image_resize); +void resize_scale_implement (ImageResize *image_resize); + #endif /* __RESIZE_H__ */ diff --git a/app/rotate_tool.c b/app/rotate_tool.c index 133795c827..75b33552d7 100644 --- a/app/rotate_tool.c +++ b/app/rotate_tool.c @@ -18,26 +18,34 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" +#include "draw_core.h" #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" +#include "gimpprogress.h" +#include "gimpui.h" #include "info_dialog.h" #include "rotate_tool.h" #include "selection.h" +#include "tile_manager_pvt.h" +#include "tools.h" +#include "tool_options.h" +#include "transform_core.h" #include "transform_tool.h" #include "undo.h" -#include "tile_manager_pvt.h" - #include "libgimp/gimpsizeentry.h" -#include "libgimp/gimpintl.h" #include "libgimp/gimpmath.h" +#include "libgimp/gimpintl.h" + + /* index into trans_info array */ #define ANGLE 0 #define REAL_ANGLE 1 @@ -78,7 +86,7 @@ rotate_tool_transform (Tool *tool, switch (state) { - case INIT: + case TRANSFORM_INIT: angle_val = 0.0; center_vals[0] = transform_core->cx; center_vals[1] = transform_core->cy; @@ -165,19 +173,19 @@ rotate_tool_transform (Tool *tool, return NULL; break; - case MOTION: + case TRANSFORM_MOTION: rotate_tool_motion (tool, gdisp_ptr); rotate_tool_recalc (tool, gdisp_ptr); break; - case RECALC: + case TRANSFORM_RECALC: rotate_tool_recalc (tool, gdisp_ptr); break; - case FINISH: + case TRANSFORM_FINISH: gtk_widget_set_sensitive (GTK_WIDGET (transform_info->shell), FALSE); return rotate_tool_rotate (gdisp->gimage, - gimage_active_drawable (gdisp->gimage), + gimp_image_active_drawable (gdisp->gimage), gdisp, transform_core->trans_info[ANGLE], transform_core->original, @@ -304,7 +312,7 @@ rotate_tool_motion (Tool *tool, transform_core = (TransformCore *) tool->private; - if (transform_core->function == HANDLE_CENTER) + if (transform_core->function == TRANSFORM_HANDLE_CENTER) { transform_core->cx = transform_core->curx; transform_core->cy = transform_core->cury; diff --git a/app/rotate_tool.h b/app/rotate_tool.h index 2bd327eabd..a466d1411d 100644 --- a/app/rotate_tool.h +++ b/app/rotate_tool.h @@ -15,24 +15,24 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __ROTATE_TOOL_H__ #define __ROTATE_TOOL_H__ -#include "tools.h" -#include "transform_core.h" -TileManager * rotate_tool_transform (Tool *tool, - gpointer gdisp_ptr, - TransformState state); -TileManager * rotate_tool_rotate (GimpImage *gimage, - GimpDrawable *drawable, - GDisplay *gdisp, - gdouble angle, - TileManager *float_tiles, - gboolean interpolation, - GimpMatrix3 matrix); +TileManager * rotate_tool_transform (Tool *tool, + gpointer gdisp_ptr, + TransformState state); +TileManager * rotate_tool_rotate (GimpImage *gimage, + GimpDrawable *drawable, + GDisplay *gdisp, + gdouble angle, + TileManager *float_tiles, + gboolean interpolation, + GimpMatrix3 matrix); + +Tool * tools_new_rotate_tool (void); +void tools_free_rotate_tool (Tool *tool); -Tool * tools_new_rotate_tool (void); -void tools_free_rotate_tool (Tool *tool); #endif /* __ROTATE_TOOL_H__ */ diff --git a/app/scale.c b/app/scale.c index cb3cf20bb2..f1d8c5763c 100644 --- a/app/scale.c +++ b/app/scale.c @@ -20,18 +20,20 @@ #include -#include +#include #include "apptypes.h" #include "appenv.h" #include "gdisplay.h" #include "gdisplay_ops.h" +#include "gimpimage.h" #include "gimprc.h" #include "nav_window.h" #include "scale.h" #include "tools.h" + void bounds_checking (GDisplay *gdisp) { diff --git a/app/scale.h b/app/scale.h index 54707452d2..9664600ea1 100644 --- a/app/scale.h +++ b/app/scale.h @@ -15,10 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __SCALE_H__ #define __SCALE_H__ -#include "gdisplay.h" typedef enum { @@ -26,7 +26,6 @@ typedef enum ZOOMOUT } ZoomType; -/* Functions */ void change_scale (GDisplay *gdisp, ZoomType zoom_type); @@ -37,4 +36,5 @@ void shrink_wrap_display (GDisplay *gdisp); void setup_scale (GDisplay *gdisp); void bounds_checking (GDisplay *gdisp); + #endif /* __SCALE_H__ */ diff --git a/app/scale_tool.c b/app/scale_tool.c index 939b9e7830..edce4cd856 100644 --- a/app/scale_tool.c +++ b/app/scale_tool.c @@ -18,17 +18,24 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" +#include "draw_core.h" #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" +#include "gimpprogress.h" +#include "gimpui.h" #include "info_dialog.h" #include "scale_tool.h" #include "selection.h" +#include "tools.h" +#include "tool_options.h" +#include "transform_core.h" #include "transform_tool.h" #include "undo.h" @@ -72,7 +79,7 @@ scale_tool_transform (Tool *tool, switch (state) { - case INIT: + case TRANSFORM_INIT: size_vals[0] = transform_core->x2 - transform_core->x1; size_vals[1] = transform_core->y2 - transform_core->y1; @@ -155,19 +162,19 @@ scale_tool_transform (Tool *tool, return NULL; break; - case MOTION: + case TRANSFORM_MOTION: scale_tool_motion (tool, gdisp_ptr); scale_tool_recalc (tool, gdisp_ptr); break; - case RECALC: + case TRANSFORM_RECALC: scale_tool_recalc (tool, gdisp_ptr); break; - case FINISH: + case TRANSFORM_FINISH: gtk_widget_set_sensitive (GTK_WIDGET (transform_info->shell), FALSE); return scale_tool_scale (gdisp->gimage, - gimage_active_drawable (gdisp->gimage), + gimp_image_active_drawable (gdisp->gimage), gdisp, transform_core->trans_info, transform_core->original, @@ -341,14 +348,14 @@ scale_tool_motion (Tool *tool, switch (transform_core->function) { - case HANDLE_1: + case TRANSFORM_HANDLE_1: x1 = &transform_core->trans_info [X0]; y1 = &transform_core->trans_info [Y0]; x2 = &transform_core->trans_info [X1]; y2 = &transform_core->trans_info [Y1]; dir_x = dir_y = 1; break; - case HANDLE_2: + case TRANSFORM_HANDLE_2: x1 = &transform_core->trans_info [X1]; y1 = &transform_core->trans_info [Y0]; x2 = &transform_core->trans_info [X0]; @@ -356,7 +363,7 @@ scale_tool_motion (Tool *tool, dir_x = -1; dir_y = 1; break; - case HANDLE_3: + case TRANSFORM_HANDLE_3: x1 = &transform_core->trans_info [X0]; y1 = &transform_core->trans_info [Y1]; x2 = &transform_core->trans_info [X1]; @@ -364,7 +371,7 @@ scale_tool_motion (Tool *tool, dir_x = 1; dir_y = -1; break; - case HANDLE_4: + case TRANSFORM_HANDLE_4: x1 = &transform_core->trans_info [X1]; y1 = &transform_core->trans_info [Y1]; x2 = &transform_core->trans_info [X0]; @@ -454,22 +461,22 @@ scale_tool_recalc (Tool *tool, switch (transform_core->function) { - case HANDLE_1: + case TRANSFORM_HANDLE_1: cx = x2; cy = y2; diffx = x2 - transform_core->x2; diffy = y2 - transform_core->y2; break; - case HANDLE_2: + case TRANSFORM_HANDLE_2: cx = x1; cy = y2; diffx = x1 - transform_core->x1; diffy = y2 - transform_core->y2; break; - case HANDLE_3: + case TRANSFORM_HANDLE_3: cx = x2; cy = y1; diffx = x2 - transform_core->x2; diffy = y1 - transform_core->y1; break; - case HANDLE_4: + case TRANSFORM_HANDLE_4: cx = x1; cy = y1; diffx = x1 - transform_core->x1; diffy = y1 - transform_core->y1; diff --git a/app/scale_tool.h b/app/scale_tool.h index 1445a8364b..93aeac2cd6 100644 --- a/app/scale_tool.h +++ b/app/scale_tool.h @@ -15,24 +15,24 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __SCALE_TOOL_H__ #define __SCALE_TOOL_H__ -#include "tools.h" -#include "transform_core.h" -TileManager * scale_tool_transform (Tool *tool, - gpointer gdisp_ptr, - TransformState state); -TileManager * scale_tool_scale (GimpImage *gimage, - GimpDrawable *drawable, - GDisplay *gdisp, - gdouble *trans_info, - TileManager *float_tiles, - gboolean interpolation, - GimpMatrix3 matrix); +TileManager * scale_tool_transform (Tool *tool, + gpointer gdisp_ptr, + TransformState state); +TileManager * scale_tool_scale (GimpImage *gimage, + GimpDrawable *drawable, + GDisplay *gdisp, + gdouble *trans_info, + TileManager *float_tiles, + gboolean interpolation, + GimpMatrix3 matrix); + +Tool * tools_new_scale_tool (void); +void tools_free_scale_tool (Tool *tool); -Tool * tools_new_scale_tool (void); -void tools_free_scale_tool (Tool *tool); #endif /* __SCALE_TOOL_H__ */ diff --git a/app/scan_convert.c b/app/scan_convert.c index 5c12886cbb..b331a5d535 100644 --- a/app/scan_convert.c +++ b/app/scan_convert.c @@ -18,13 +18,20 @@ #include "config.h" -#include +#include +#include + +#include "apptypes.h" + +#include "channel.h" +#include "drawable.h" #include "gimpimage.h" +#include "pixel_region.h" #include "scan_convert.h" + #include "libgimp/gimpmath.h" -#include #ifdef DEBUG #define TRC(x) printf x @@ -36,17 +43,17 @@ /* Reveal our private structure */ struct ScanConverterPrivate { - guint width; - guint height; - GSList **scanlines; /* array of height*antialias scanlines */ + guint width; + guint height; + GSList **scanlines; /* array of height*antialias scanlines */ - guint antialias; /* how much to oversample by */ + guint antialias; /* how much to oversample by */ - /* record the first and last points so we can close the curve */ - gboolean got_first; - ScanConvertPoint first; - gboolean got_last; - ScanConvertPoint last; + /* record the first and last points so we can close the curve */ + gboolean got_first; + ScanConvertPoint first; + gboolean got_last; + ScanConvertPoint last; }; @@ -55,7 +62,7 @@ struct ScanConverterPrivate static GSList * insert_into_sorted_list (GSList *list, - int x) + gint x) { GSList *orig = list; GSList *rest; @@ -87,265 +94,262 @@ insert_into_sorted_list (GSList *list, static void convert_segment (ScanConverter *sc, - int x1, - int y1, - int x2, - int y2) + gint x1, + gint y1, + gint x2, + gint y2) { - int ydiff, y, tmp; - gint width; - gint height; - GSList **scanlines; - float xinc, xstart; + gint ydiff, y, tmp; + gint width; + gint height; + GSList **scanlines; + gfloat xinc, xstart; - /* pre-calculate invariant commonly used values */ - width = sc->width * sc->antialias; - height = sc->height * sc->antialias; - scanlines = sc->scanlines; + /* pre-calculate invariant commonly used values */ + width = sc->width * sc->antialias; + height = sc->height * sc->antialias; + scanlines = sc->scanlines; - x1 = CLAMP (x1, 0, width - 1); - y1 = CLAMP (y1, 0, height - 1); - x2 = CLAMP (x2, 0, width - 1); - y2 = CLAMP (y2, 0, height - 1); + x1 = CLAMP (x1, 0, width - 1); + y1 = CLAMP (y1, 0, height - 1); + x2 = CLAMP (x2, 0, width - 1); + y2 = CLAMP (y2, 0, height - 1); - if (y1 > y2) + if (y1 > y2) { - tmp = y2; y2 = y1; y1 = tmp; - tmp = x2; x2 = x1; x1 = tmp; + tmp = y2; y2 = y1; y1 = tmp; + tmp = x2; x2 = x1; x1 = tmp; } - ydiff = (y2 - y1); + ydiff = (y2 - y1); - if (ydiff) + if (ydiff) { - xinc = (float) (x2 - x1) / (float) ydiff; - xstart = x1 + 0.5 * xinc; - for (y = y1 ; y < y2; y++) + xinc = (float) (x2 - x1) / (float) ydiff; + xstart = x1 + 0.5 * xinc; + for (y = y1 ; y < y2; y++) { scanlines[y] = insert_into_sorted_list (scanlines[y], ROUND (xstart)); xstart += xinc; } } - else + else { - /* horizontal line */ - scanlines[y1] = insert_into_sorted_list (scanlines[y1], ROUND (x1)); - scanlines[y1] = insert_into_sorted_list (scanlines[y1], ROUND (x2)); + /* horizontal line */ + scanlines[y1] = insert_into_sorted_list (scanlines[y1], ROUND (x1)); + scanlines[y1] = insert_into_sorted_list (scanlines[y1], ROUND (x2)); } } - /**************************************************************/ /* Exported functions */ - /* Create a new scan conversion context */ ScanConverter * -scan_converter_new (guint width, guint height, guint antialias) +scan_converter_new (guint width, + guint height, + guint antialias) { - ScanConverter *sc; + ScanConverter *sc; - g_return_val_if_fail (width > 0, NULL); - g_return_val_if_fail (height > 0, NULL); - g_return_val_if_fail (antialias > 0, NULL); + g_return_val_if_fail (width > 0, NULL); + g_return_val_if_fail (height > 0, NULL); + g_return_val_if_fail (antialias > 0, NULL); - sc = g_new0 (ScanConverter, 1); + sc = g_new0 (ScanConverter, 1); - sc->antialias = antialias; - sc->width = width; - sc->height = height; - sc->scanlines = g_new0 (GSList *, height*antialias); + sc->antialias = antialias; + sc->width = width; + sc->height = height; + sc->scanlines = g_new0 (GSList *, height * antialias); - return sc; + return sc; } +void +scan_converter_free (ScanConverter *sc) +{ + g_free (sc->scanlines); + g_free (sc); +} /* Add "npoints" from "pointlist" to the polygon currently being * described by "scan_converter". */ void -scan_converter_add_points (ScanConverter *sc, - guint npoints, +scan_converter_add_points (ScanConverter *sc, + guint npoints, ScanConvertPoint *pointlist) { - int i; - guint antialias; + gint i; + guint antialias; - g_return_if_fail (sc != NULL); - g_return_if_fail (pointlist != NULL); + g_return_if_fail (sc != NULL); + g_return_if_fail (pointlist != NULL); - antialias = sc->antialias; + antialias = sc->antialias; - if (!sc->got_first && npoints > 0) + if (!sc->got_first && npoints > 0) { - sc->got_first = TRUE; - sc->first = pointlist[0]; + sc->got_first = TRUE; + sc->first = pointlist[0]; } - /* link from previous point */ - if (sc->got_last && npoints > 0) + /* link from previous point */ + if (sc->got_last && npoints > 0) { - TRC (("|| %g,%g -> %g,%g\n", - sc->last.x, sc->last.y, - pointlist[0].x, pointlist[0].y)); - convert_segment (sc, - (int)sc->last.x * antialias, - (int)sc->last.y * antialias, - (int)pointlist[0].x * antialias, - (int)pointlist[0].y * antialias); + TRC (("|| %g,%g -> %g,%g\n", + sc->last.x, sc->last.y, + pointlist[0].x, pointlist[0].y)); + convert_segment (sc, + (int)sc->last.x * antialias, + (int)sc->last.y * antialias, + (int)pointlist[0].x * antialias, + (int)pointlist[0].y * antialias); } - for (i = 0; i < (npoints - 1); i++) + for (i = 0; i < (npoints - 1); i++) { - convert_segment (sc, - (int) pointlist[i].x * antialias, - (int) pointlist[i].y * antialias, - (int) pointlist[i + 1].x * antialias, - (int) pointlist[i + 1].y * antialias); + convert_segment (sc, + (int) pointlist[i].x * antialias, + (int) pointlist[i].y * antialias, + (int) pointlist[i + 1].x * antialias, + (int) pointlist[i + 1].y * antialias); } - TRC (("[] %g,%g -> %g,%g\n", - pointlist[0].x, pointlist[0].y, - pointlist[npoints-1].x, pointlist[npoints-1].y)); + TRC (("[] %g,%g -> %g,%g\n", + pointlist[0].x, pointlist[0].y, + pointlist[npoints-1].x, pointlist[npoints-1].y)); - if (npoints > 0) + if (npoints > 0) { - sc->got_last = TRUE; - sc->last = pointlist[npoints - 1]; + sc->got_last = TRUE; + sc->last = pointlist[npoints - 1]; } } - /* Scan convert the polygon described by the list of points passed to * scan_convert_add_points, and return a channel with a bits set if * they fall within the polygon defined. The polygon is filled * according to the even-odd rule. The polygon is closed by - * joining the final point to the initial point. */ + * joining the final point to the initial point. + */ Channel * scan_converter_to_channel (ScanConverter *sc, - GimpImage *gimage) + GimpImage *gimage) { - Channel *mask; - GSList *list; - PixelRegion maskPR; - guint widtha; - guint heighta; - guint antialias; - guint antialias2; - unsigned char *buf, *b; - int * vals, val; - int x, x2, w; - int i, j; + Channel *mask; + GSList *list; + PixelRegion maskPR; + guint widtha; + guint heighta; + guint antialias; + guint antialias2; + guchar *buf; + guchar *b; + gint *vals; + gint val; + gint x, x2, w; + gint i, j; - antialias = sc->antialias; - antialias2 = antialias * antialias; + antialias = sc->antialias; + antialias2 = antialias * antialias; - /* do we need to close the polygon? */ - if (sc->got_first && sc->got_last && - (sc->first.x != sc->last.x || sc->first.y != sc->last.y)) + /* do we need to close the polygon? */ + if (sc->got_first && sc->got_last && + (sc->first.x != sc->last.x || sc->first.y != sc->last.y)) { - convert_segment (sc, - (int) sc->last.x * antialias, - (int) sc->last.y * antialias, - (int) sc->first.x * antialias, - (int) sc->first.y * antialias); + convert_segment (sc, + (int) sc->last.x * antialias, + (int) sc->last.y * antialias, + (int) sc->first.x * antialias, + (int) sc->first.y * antialias); } - mask = channel_new_mask (gimage, sc->width, sc->height); + mask = channel_new_mask (gimage, sc->width, sc->height); - buf = g_new0 (unsigned char, sc->width); - widtha = sc->width * antialias; - heighta = sc->height * antialias; - /* allocate value array */ - vals = g_new (int, widtha); + buf = g_new0 (guchar, sc->width); + widtha = sc->width * antialias; + heighta = sc->height * antialias; + /* allocate value array */ + vals = g_new (gint, widtha); - /* dump scanlines */ - for(i=0; iscanlines[i]; - TRC (("%03d: ", i)); - while (list) + list = sc->scanlines[i]; + TRC (("%03d: ", i)); + while (list) { - TRC (("%3d ", GPOINTER_TO_INT (list->data))); - list = g_slist_next (list); + TRC (("%3d ", GPOINTER_TO_INT (list->data))); + list = g_slist_next (list); } - TRC (("\n")); + TRC (("\n")); } - pixel_region_init (&maskPR, drawable_data (GIMP_DRAWABLE(mask)), 0, 0, - drawable_width (GIMP_DRAWABLE(mask)), - drawable_height (GIMP_DRAWABLE(mask)), TRUE); + pixel_region_init (&maskPR, drawable_data (GIMP_DRAWABLE(mask)), 0, 0, + drawable_width (GIMP_DRAWABLE(mask)), + drawable_height (GIMP_DRAWABLE(mask)), TRUE); - for (i = 0; i < heighta; i++) + for (i = 0; i < heighta; i++) { - list = sc->scanlines[i]; + list = sc->scanlines[i]; - /* zero the vals array */ - if (!(i % antialias)) - memset (vals, 0, widtha * sizeof (int)); + /* zero the vals array */ + if (!(i % antialias)) + memset (vals, 0, widtha * sizeof (int)); - while (list) + while (list) { - x = GPOINTER_TO_INT (list->data); - list = g_slist_next (list); - if (!list) + x = GPOINTER_TO_INT (list->data); + list = g_slist_next (list); + if (!list) { - g_message ("Cannot properly scanline convert polygon!\n"); + g_message ("Cannot properly scanline convert polygon!\n"); } - else + else { - /* bounds checking */ - x = CLAMP (x, 0, widtha); - x2 = CLAMP (GPOINTER_TO_INT (list->data), 0, widtha); + /* bounds checking */ + x = CLAMP (x, 0, widtha); + x2 = CLAMP (GPOINTER_TO_INT (list->data), 0, widtha); - w = x2 - x; + w = x2 - x; - if (w > 0) + if (w > 0) { - if (antialias == 1) + if (antialias == 1) { - channel_add_segment (mask, x, i, w, 255); + channel_add_segment (mask, x, i, w, 255); } - else + else { - for (j = 0; j < w; j++) - vals[j + x] += 255; + for (j = 0; j < w; j++) + vals[j + x] += 255; } } - list = g_slist_next (list); + list = g_slist_next (list); } } - if (antialias != 1 && !((i+1) % antialias)) + if (antialias != 1 && !((i+1) % antialias)) { - b = buf; - for (j = 0; j < widtha; j += antialias) + b = buf; + for (j = 0; j < widtha; j += antialias) { - val = 0; - for (x = 0; x < antialias; x++) - val += vals[j + x]; + val = 0; + for (x = 0; x < antialias; x++) + val += vals[j + x]; - *b++ = (unsigned char) (val / antialias2); + *b++ = (guchar) (val / antialias2); } pixel_region_set_row (&maskPR, 0, (i / antialias), sc->width, buf); } } - g_free (vals); - g_free (buf); + g_free (vals); + g_free (buf); - return mask; + return mask; } - - -void -scan_converter_free (ScanConverter *sc) -{ - g_free (sc->scanlines); - g_free (sc); -} - - -/* End of scan_convert.c */ diff --git a/app/scan_convert.h b/app/scan_convert.h index de3d510f79..df691179cd 100644 --- a/app/scan_convert.h +++ b/app/scan_convert.h @@ -20,39 +20,41 @@ #define SCAN_CONVERT_H -typedef struct +struct _ScanConvertPoint { gdouble x; gdouble y; -} ScanConvertPoint; +}; typedef struct ScanConverterPrivate ScanConverter; /* Create a new scan conversion context. Set "antialias" to 1 for no - * supersampling, or the amount to supersample by otherwise. */ -ScanConverter * scan_converter_new (guint width, guint height, - guint antialias); + * supersampling, or the amount to supersample by otherwise. + */ +ScanConverter * scan_converter_new (guint width, + guint height, + guint antialias); +void scan_converter_free (ScanConverter *scan_converter); /* Add "npoints" from "pointlist" to the polygon currently being - * described by "scan_converter". */ -void scan_converter_add_points (ScanConverter *scan_converter, - guint npoints, - ScanConvertPoint *pointlist); + * described by "scan_converter". + */ +void scan_converter_add_points (ScanConverter *scan_converter, + guint npoints, + ScanConvertPoint *pointlist); /* Scan convert the polygon described by the list of points passed to * scan_convert_add_points, and return a channel with a bits set if * they fall within the polygon defined. The polygon is filled * according to the even-odd rule. The polygon is closed by - * joining the final point to the initial point. */ -Channel * scan_converter_to_channel (ScanConverter *scan_converter, - GimpImage *gimage); - - -void scan_converter_free (ScanConverter *scan_converter); + * joining the final point to the initial point. + */ +Channel * scan_converter_to_channel (ScanConverter *scan_converter, + GimpImage *gimage); #endif /* SCAN_CONVERT_H */ diff --git a/app/scroll.c b/app/scroll.c index d1fe448746..9f9526beb9 100644 --- a/app/scroll.c +++ b/app/scroll.c @@ -20,17 +20,17 @@ #include -#include +#include #include "apptypes.h" #include "appenv.h" -#include "apptypes.h" +#include "cursorutil.h" +#include "gdisplay.h" #include "scale.h" #include "scroll.h" -#include "cursorutil.h" -#include "tools.h" #include "nav_window.h" +#include "tools.h" /* This is the delay before dithering begins diff --git a/app/scroll.h b/app/scroll.h index 24b1525162..17d27b490a 100644 --- a/app/scroll.h +++ b/app/scroll.h @@ -15,28 +15,37 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __SCROLL_H__ #define __SCROLL_H__ -#include "gdisplay.h" /* app init and exit routines */ -void init_scrolling (void); -void free_scrolling (void); +void init_scrolling (void); +void free_scrolling (void); /* routines for scrolling the image via the scrollbars */ -void scrollbar_disconnect (GtkAdjustment *, gpointer); -gint scrollbar_vert_update (GtkAdjustment *, gpointer); -gint scrollbar_horz_update (GtkAdjustment *, gpointer); +void scrollbar_disconnect (GtkAdjustment *adjuatment, + gpointer data); +gint scrollbar_vert_update (GtkAdjustment *adjuatment, + gpointer data); +gint scrollbar_horz_update (GtkAdjustment *adjuatment, + gpointer data); /* routines for grabbing the image and scrolling via the pointer */ -void start_grab_and_scroll (GDisplay *, GdkEventButton *); -void end_grab_and_scroll (GDisplay *, GdkEventButton *); -void grab_and_scroll (GDisplay *, GdkEventMotion *); -void scroll_to_pointer_position (GDisplay *, GdkEventMotion *); +void start_grab_and_scroll (GDisplay *gdisp, + GdkEventButton *bevent); +void end_grab_and_scroll (GDisplay *gdisp, + GdkEventButton *bevent); +void grab_and_scroll (GDisplay *gdisp, + GdkEventMotion *mevent); +void scroll_to_pointer_position (GDisplay *gdisp, + GdkEventMotion *mevent); /* generic scroll-by-offset function */ -gint scroll_display (GDisplay *, gint, gint); +gint scroll_display (GDisplay *, + gint , + gint ); #endif /* __SCROLL_H__ */ diff --git a/app/selection.c b/app/selection.c index 27ee7579e4..2810e66f0c 100644 --- a/app/selection.c +++ b/app/selection.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include "apptypes.h" @@ -28,10 +28,12 @@ #include "gdisplay.h" #include "gdisplay_ops.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "gimprc.h" #include "selection.h" #include "marching_ants.h" + #define USE_XDRAWPOINTS #undef VERBOSE @@ -342,33 +344,44 @@ selection_generate_segs (Selection *select) &select->num_segs_in, &select->num_segs_out); if (select->num_segs_in) { - select->segs_in = (GdkSegment *) g_malloc (sizeof (GdkSegment) * select->num_segs_in); - selection_transform_segs (select, segs_in, select->segs_in, select->num_segs_in); + select->segs_in = g_new (GdkSegment, select->num_segs_in); + selection_transform_segs (select, segs_in, select->segs_in, + select->num_segs_in); #ifdef USE_XDRAWPOINTS selection_render_points (select); #endif } else - select->segs_in = NULL; + { + select->segs_in = NULL; + } /* Possible secondary boundary representation */ if (select->num_segs_out) { - select->segs_out = (GdkSegment *) g_malloc (sizeof (GdkSegment) * select->num_segs_out); - selection_transform_segs (select, segs_out, select->segs_out, select->num_segs_out); + select->segs_out = g_new (GdkSegment, select->num_segs_out); + selection_transform_segs (select, segs_out, select->segs_out, + select->num_segs_out); } else - select->segs_out = NULL; + { + select->segs_out = NULL; + } /* The active layer's boundary */ - gimage_layer_boundary (gdisp->gimage, &segs_layer, &select->num_segs_layer); + gimp_image_layer_boundary (gdisp->gimage, &segs_layer, + &select->num_segs_layer); + if (select->num_segs_layer) { - select->segs_layer = (GdkSegment *) g_malloc (sizeof (GdkSegment) * select->num_segs_layer); - selection_transform_segs (select, segs_layer, select->segs_layer, select->num_segs_layer); + select->segs_layer = g_new (GdkSegment, select->num_segs_layer); + selection_transform_segs (select, segs_layer, select->segs_layer, + select->num_segs_layer); } else - select->segs_layer = NULL; + { + select->segs_layer = NULL; + } g_free (segs_layer); } @@ -500,7 +513,7 @@ selection_create (GdkWindow *win, gdisp = (GDisplay *) gdisp_ptr; new = (Selection *) g_malloc (sizeof (Selection)); - base_type = gimage_base_type (gdisp->gimage); + base_type = gimp_image_base_type (gdisp->gimage); if (cycled_marching_ants) { diff --git a/app/selection.h b/app/selection.h index f5736b7d41..08a5d7698c 100644 --- a/app/selection.h +++ b/app/selection.h @@ -15,12 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __SELECTION_H__ #define __SELECTION_H__ -typedef struct _selection Selection; - -struct _selection +struct _Selection { /* This information is for maintaining the selection's appearance */ GdkWindow * win; /* Window to draw to */ @@ -33,37 +32,44 @@ struct _selection GdkSegment * segs_in; /* gdk segments of area boundary */ GdkSegment * segs_out; /* gdk segments of area boundary */ GdkSegment * segs_layer; /* gdk segments of area boundary */ - int num_segs_in; /* number of segments in segs1 */ - int num_segs_out; /* number of segments in segs2 */ - int num_segs_layer; /* number of segments in segs3 */ - int index_in; /* index of current stipple pattern */ - int index_out; /* index of current stipple pattern */ - int index_layer; /* index of current stipple pattern */ - int state; /* internal drawing state */ - int paused; /* count of pause requests */ - int recalc; /* flag to recalculate the selection */ - int speed; /* speed of marching ants */ - int hidden; /* is the selection hidden? */ + gint num_segs_in; /* number of segments in segs1 */ + gint num_segs_out; /* number of segments in segs2 */ + gint num_segs_layer; /* number of segments in segs3 */ + gint index_in; /* index of current stipple pattern */ + gint index_out; /* index of current stipple pattern */ + gint index_layer; /* index of current stipple pattern */ + gint state; /* internal drawing state */ + gint paused; /* count of pause requests */ + gint recalc; /* flag to recalculate the selection */ + gint speed; /* speed of marching ants */ + gint hidden; /* is the selection hidden? */ gint timer; /* timer for successive draws */ - int cycle; /* color cycling turned on */ + gint cycle; /* color cycling turned on */ GdkPixmap * cycle_pix; /* cycling pixmap */ /* These are used only if USE_XDRAWPOINTS is defined. */ GdkPoint * points_in[8]; /* points of segs_in for fast ants */ - int num_points_in[8]; /* number of points in points_in */ + gint num_points_in[8]; /* number of points in points_in */ GdkGC * gc_white; /* gc for drawing white points */ GdkGC * gc_black; /* gc for drawing black points */ }; /* Function declarations */ -Selection * selection_create (GdkWindow *, gpointer, int, int, int); +Selection * selection_create (GdkWindow *, + gpointer , + gint , + gint , + gint ); void selection_pause (Selection *); void selection_resume (Selection *); -void selection_start (Selection *, int); +void selection_start (Selection *, + gint ); void selection_invis (Selection *); void selection_layer_invis (Selection *); -void selection_hide (Selection *, void *); +void selection_hide (Selection *, + gpointer ); void selection_free (Selection *); + #endif /* __SELECTION_H__ */ diff --git a/app/selection_cmds.c b/app/selection_cmds.c index 420fbae616..00a168a49b 100644 --- a/app/selection_cmds.c +++ b/app/selection_cmds.c @@ -18,11 +18,18 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ +#include "config.h" + + +#include + +#include "apptypes.h" #include "procedural_db.h" #include "channel.h" #include "drawable.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "layer.h" static ProcRecord selection_bounds_proc; diff --git a/app/selection_options.h b/app/selection_options.h index 718fb58a66..4d221f1651 100644 --- a/app/selection_options.h +++ b/app/selection_options.h @@ -15,17 +15,16 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __SELECTION_OPTIONS_H__ #define __SELECTION_OPTIONS_H__ -#include "tools.h" + #include "tool_options.h" -#include "libgimp/gimpunit.h" /* the selection options structures */ -typedef struct _SelectionOptions SelectionOptions; struct _SelectionOptions { ToolOptions tool_options; @@ -87,4 +86,5 @@ void selection_options_init (SelectionOptions *options, ToolType tool_type, ToolOptionsResetFunc reset_func); + #endif /* __SELCTION_OPTIONS_H__ */ diff --git a/app/shear_tool.c b/app/shear_tool.c index 2fe246dff6..279332b28d 100644 --- a/app/shear_tool.c +++ b/app/shear_tool.c @@ -18,25 +18,34 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" +#include "draw_core.h" #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" +#include "gimpui.h" +#include "gimpprogress.h" #include "info_dialog.h" #include "shear_tool.h" #include "selection.h" +#include "tools.h" +#include "tool_options.h" +#include "transform_core.h" #include "transform_tool.h" #include "undo.h" #include "tile_manager_pvt.h" -#include "libgimp/gimpintl.h" #include "libgimp/gimpmath.h" +#include "libgimp/gimpintl.h" + + /* index into trans_info array */ #define HORZ_OR_VERT 0 #define XSHEAR 1 @@ -71,7 +80,7 @@ shear_tool_transform (Tool *tool, switch (state) { - case INIT: + case TRANSFORM_INIT: if (!transform_info) { transform_info = info_dialog_new (_("Shear Information"), @@ -98,19 +107,19 @@ shear_tool_transform (Tool *tool, return NULL; break; - case MOTION: + case TRANSFORM_MOTION: shear_tool_motion (tool, gdisp_ptr); shear_tool_recalc (tool, gdisp_ptr); break; - case RECALC: + case TRANSFORM_RECALC: shear_tool_recalc (tool, gdisp_ptr); break; - case FINISH: + case TRANSFORM_FINISH: gtk_widget_set_sensitive (GTK_WIDGET (transform_info->shell), FALSE); return shear_tool_shear (gdisp->gimage, - gimage_active_drawable (gdisp->gimage), + gimp_image_active_drawable (gdisp->gimage), gdisp, transform_core->original, transform_tool_smoothing (), @@ -262,25 +271,25 @@ shear_tool_motion (Tool *tool, dir = transform_core->trans_info[HORZ_OR_VERT]; switch (transform_core->function) { - case HANDLE_1: + case TRANSFORM_HANDLE_1: if (dir == ORIENTATION_HORIZONTAL) transform_core->trans_info[XSHEAR] -= diffx; else transform_core->trans_info[YSHEAR] -= diffy; break; - case HANDLE_2: + case TRANSFORM_HANDLE_2: if (dir == ORIENTATION_HORIZONTAL) transform_core->trans_info[XSHEAR] -= diffx; else transform_core->trans_info[YSHEAR] += diffy; break; - case HANDLE_3: + case TRANSFORM_HANDLE_3: if (dir == ORIENTATION_HORIZONTAL) transform_core->trans_info[XSHEAR] += diffx; else transform_core->trans_info[YSHEAR] -= diffy; break; - case HANDLE_4: + case TRANSFORM_HANDLE_4: if (dir == ORIENTATION_HORIZONTAL) transform_core->trans_info[XSHEAR] += diffx; else diff --git a/app/shear_tool.h b/app/shear_tool.h index 026d052a1d..1dd07ad975 100644 --- a/app/shear_tool.h +++ b/app/shear_tool.h @@ -15,23 +15,23 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __SHEAR_TOOL_H__ #define __SHEAR_TOOL_H__ -#include "tools.h" -#include "transform_core.h" -TileManager * shear_tool_transform (Tool *tool, - gpointer gdisp_ptr, - TransformState state); -TileManager * shear_tool_shear (GimpImage *gimage, - GimpDrawable *drawable, - GDisplay *gdisp, - TileManager *float_tiles, - gboolean interpolation, - GimpMatrix3 matrix); +TileManager * shear_tool_transform (Tool *tool, + gpointer gdisp_ptr, + TransformState state); +TileManager * shear_tool_shear (GimpImage *gimage, + GimpDrawable *drawable, + GDisplay *gdisp, + TileManager *float_tiles, + gboolean interpolation, + GimpMatrix3 matrix); + +Tool * tools_new_shear_tool (void); +void tools_free_shear_tool (Tool *matrix); -Tool * tools_new_shear_tool (void); -void tools_free_shear_tool (Tool *matrix); #endif /* __SHEAR_TOOL_H__ */ diff --git a/app/smudge.c b/app/smudge.c index 69b5234dc2..26bdff458e 100644 --- a/app/smudge.c +++ b/app/smudge.c @@ -27,13 +27,18 @@ #include "drawable.h" #include "smudge.h" #include "gdisplay.h" +#include "gimpcontext.h" +#include "gimpbrush.h" #include "gimplut.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" +#include "pixel_region.h" #include "paint_options.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" +#include "tool_options.h" #include "gimage.h" #include "libgimp/gimpmath.h" diff --git a/app/smudge.h b/app/smudge.h index f56524bf2b..a87d0ffe60 100644 --- a/app/smudge.h +++ b/app/smudge.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __SMUDGE_H__ #define __SMUDGE_H__ -#include "paint_core.h" -#include "tools.h" typedef enum { @@ -34,10 +33,19 @@ typedef enum SMUDGE_MODE_SHADOWS } SmudgeMode; -void * smudge_paint_func (PaintCore *, GimpDrawable *, int); -gboolean smudge_non_gui (GimpDrawable *, double, int, double *); -gboolean smudge_non_gui_default (GimpDrawable *, int, double *); -Tool * tools_new_smudge (void); -void tools_free_smudge (Tool *); +void * smudge_paint_func (PaintCore *, + GimpDrawable *, + gint ); +gboolean smudge_non_gui (GimpDrawable *, + gdouble , + gint , + gdouble *); +gboolean smudge_non_gui_default (GimpDrawable *, + gint , + gdouble *); + +Tool * tools_new_smudge (void); +void tools_free_smudge (Tool *tool); + #endif /* __SMUDGE_H__ */ diff --git a/app/temp_buf.c b/app/temp_buf.c index aad23f369f..09ebdba2bb 100644 --- a/app/temp_buf.c +++ b/app/temp_buf.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include #include @@ -39,16 +39,20 @@ #include "appenv.h" #include "drawable.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimprc.h" #include "paint_funcs.h" +#include "pixel_region.h" #include "temp_buf.h" #include "libgimp/gimpcolorspace.h" static guchar * temp_buf_allocate (guint); -static void temp_buf_to_color (TempBuf *, TempBuf *); -static void temp_buf_to_gray (TempBuf *, TempBuf *); +static void temp_buf_to_color (TempBuf *, + TempBuf *); +static void temp_buf_to_gray (TempBuf *, + TempBuf *); /* Memory management */ diff --git a/app/temp_buf.h b/app/temp_buf.h index 2da2a83872..3e07e3480f 100644 --- a/app/temp_buf.h +++ b/app/temp_buf.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __TEMP_BUF_H__ #define __TEMP_BUF_H__ -typedef struct _TempBuf TempBuf; -typedef struct _TempBuf MaskBuf; struct _TempBuf { @@ -37,17 +36,34 @@ struct _TempBuf /* The temp buffer functions */ -TempBuf * temp_buf_new (gint, gint, gint, gint, gint, guchar *); -TempBuf * temp_buf_copy (TempBuf *, TempBuf *); -TempBuf * temp_buf_resize (TempBuf *, gint, gint, gint, gint, gint); -TempBuf * temp_buf_copy_area (TempBuf *, TempBuf *, - gint, gint, gint, gint, gint); +TempBuf * temp_buf_new (gint , + gint , + gint , + gint , + gint , + guchar *); +TempBuf * temp_buf_copy (TempBuf *, + TempBuf *); +TempBuf * temp_buf_resize (TempBuf *, + gint , + gint , + gint , + gint , + gint ); +TempBuf * temp_buf_copy_area (TempBuf *, + TempBuf *, + gint , + gint , + gint , + gint , + gint ); void temp_buf_free (TempBuf *); guchar * temp_buf_data (TempBuf *); /* The mask buffer functions */ -MaskBuf * mask_buf_new (gint, gint); +MaskBuf * mask_buf_new (gint , + gint ); void mask_buf_free (MaskBuf *); guchar * mask_buf_data (MaskBuf *); @@ -62,4 +78,5 @@ void temp_buf_swap_free (TempBuf *); void swapping_free (void); + #endif /* __TEMP_BUF_H__ */ diff --git a/app/text_tool.c b/app/text_tool.c index f32049406b..33fd430364 100644 --- a/app/text_tool.c +++ b/app/text_tool.c @@ -20,9 +20,10 @@ #include #include +#include +#include #include -#include #ifndef GDK_WINDOWING_WIN32 #include @@ -37,22 +38,30 @@ #include "edit_selection.h" #include "errors.h" #include "floating_sel.h" +#include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "gimpui.h" #include "global_edit.h" +#include "layer.h" +#include "paint_funcs.h" +#include "pixel_region.h" +#include "plug_in.h" #include "procedural_db.h" #include "selection.h" #include "text_tool.h" +#include "tile.h" #include "tools.h" +#include "tool_options.h" +#include "tile_manager.h" +#include "tile_manager_pvt.h" #include "undo.h" -#include "tile_manager_pvt.h" -#include "drawable_pvt.h" - -#include "config.h" #include "libgimp/gimplimits.h" + #include "libgimp/gimpintl.h" + #define FOUNDRY 0 #define FAMILY 1 #define WEIGHT 2 @@ -285,7 +294,7 @@ text_call_gdyntext (GDisplay *gdisp) args[1].arg_type = PDB_IMAGE; args[1].value.pdb_int = (gint32) pdb_image_to_id (gdisp->gimage); args[2].arg_type = PDB_DRAWABLE; - args[2].value.pdb_int = (gint32) gimage_active_drawable (gdisp->gimage)->ID; + args[2].value.pdb_int = (gint32) gimp_image_active_drawable (gdisp->gimage)->ID; plug_in_run (proc_rec, args, 3, FALSE, TRUE, gdisp->ID); @@ -313,9 +322,9 @@ text_button_press (Tool *tool, &text_tool->click_x, &text_tool->click_y, TRUE, 0); - if ((layer = gimage_pick_correlate_layer (gdisp->gimage, - text_tool->click_x, - text_tool->click_y))) + if ((layer = gimp_image_pick_correlate_layer (gdisp->gimage, + text_tool->click_x, + text_tool->click_y))) /* If there is a floating selection, and this aint it, use the move tool */ if (layer_is_floating_sel (layer)) { @@ -358,7 +367,7 @@ text_cursor_update (Tool *tool, gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, FALSE, FALSE); - if ((layer = gimage_pick_correlate_layer (gdisp->gimage, x, y))) + if ((layer = gimp_image_pick_correlate_layer (gdisp->gimage, x, y))) /* if there is a floating selection, and this aint it... */ if (layer_is_floating_sel (layer)) { @@ -470,7 +479,7 @@ text_init_render (TextTool *text_tool) gdisp = (GDisplay *) text_tool->gdisp_ptr; /* override the user's antialias setting if this is an indexed image */ - if (gimage_base_type (gdisp->gimage) == INDEXED) + if (gimp_image_base_type (gdisp->gimage) == INDEXED) antialias = FALSE; /* If we're anti-aliasing, request a larger font than user specified. @@ -496,7 +505,7 @@ text_init_render (TextTool *text_tool) /* strdup it since the render function strtok()s the text */ text = g_strdup (text); - text_render (gdisp->gimage, gimage_active_drawable (gdisp->gimage), + text_render (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage), text_tool->click_x, text_tool->click_y, fontname, text, text_options->border, antialias); @@ -590,7 +599,7 @@ text_render (GimpImage *gimage, if (drawable) layer_type = drawable_type_with_alpha (drawable); else - layer_type = gimage_base_type_with_alpha (gimage); + layer_type = gimp_image_base_type_with_alpha (gimage); /* scale the text based on the antialiasing amount */ if (antialias) @@ -751,7 +760,7 @@ text_render (GimpImage *gimage, _("Text Layer"), OPAQUE_OPACITY, NORMAL_MODE))) { /* color the layer buffer */ - gimage_get_foreground (gimage, drawable, color); + gimp_image_get_foreground (gimage, drawable, color); color[GIMP_DRAWABLE (layer)->bytes - 1] = OPAQUE_OPACITY; pixel_region_init (&textPR, GIMP_DRAWABLE (layer)->tiles, 0, 0, @@ -782,11 +791,11 @@ text_render (GimpImage *gimage, * it seems like the correct behavior. */ if (! gimage_mask_is_empty (gimage)) - channel_clear (gimage_get_mask (gimage)); + channel_clear (gimp_image_get_mask (gimage)); /* If the drawable id is invalid, create a new layer */ if (drawable == NULL) - gimage_add_layer (gimage, layer, -1); + gimp_image_add_layer (gimage, layer, -1); /* Otherwise, instantiate the text as the new floating selection */ else floating_sel_attach (layer, drawable); diff --git a/app/text_tool.h b/app/text_tool.h index fb3ea0702e..32deef8d3c 100644 --- a/app/text_tool.h +++ b/app/text_tool.h @@ -19,8 +19,6 @@ #ifndef __TEXT_TOOL_H__ #define __TEXT_TOOL_H__ -#include "tools.h" - typedef enum { @@ -30,9 +28,9 @@ typedef enum #define SUPERSAMPLE 3 -/* text functions */ + Tool * tools_new_text (void); -void tools_free_text (Tool *); +void tools_free_text (Tool *tool); gboolean text_get_extents (gchar *fontname, gchar *text, diff --git a/app/text_tool_cmds.c b/app/text_tool_cmds.c index 66965e241f..487f01dbeb 100644 --- a/app/text_tool_cmds.c +++ b/app/text_tool_cmds.c @@ -18,11 +18,16 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ -#include "procedural_db.h" +#include "config.h" #include #include +#include + +#include "apptypes.h" +#include "procedural_db.h" + #include "appenv.h" #include "drawable.h" #include "layer.h" diff --git a/app/threshold.c b/app/threshold.c index dbe84f3c7a..90d6cea647 100644 --- a/app/threshold.c +++ b/app/threshold.c @@ -18,15 +18,23 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" #include "drawable.h" #include "gdisplay.h" +#include "gimphistogram.h" +#include "gimpimage.h" #include "gimpui.h" +#include "histogramwidget.h" +#include "image_map.h" +#include "paint_funcs.h" +#include "pixel_region.h" #include "threshold.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpintl.h" @@ -212,7 +220,7 @@ tools_free_threshold (Tool *tool) void threshold_initialize (GDisplay *gdisp) { - if (drawable_indexed (gimage_active_drawable (gdisp->gimage))) + if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Threshold does not operate on indexed drawables.")); return; @@ -228,7 +236,7 @@ threshold_initialize (GDisplay *gdisp) threshold_dialog->low_threshold = 127; threshold_dialog->high_threshold = 255; - threshold_dialog->drawable = gimage_active_drawable (gdisp->gimage); + threshold_dialog->drawable = gimp_image_active_drawable (gdisp->gimage); threshold_dialog->color = drawable_color (threshold_dialog->drawable); threshold_dialog->image_map = image_map_create (gdisp, threshold_dialog->drawable); diff --git a/app/threshold.h b/app/threshold.h index 608c4f67a8..92f8934157 100644 --- a/app/threshold.h +++ b/app/threshold.h @@ -19,10 +19,6 @@ #ifndef __THRESHOLD_H__ #define __THRESHOLD_H__ -#include "image_map.h" -#include "histogramwidget.h" -#include "tools.h" - typedef struct _ThresholdDialog ThresholdDialog; @@ -46,14 +42,15 @@ struct _ThresholdDialog gboolean preview; }; -Tool * tools_new_threshold (void); -void tools_free_threshold (Tool *tool); + +Tool * tools_new_threshold (void); +void tools_free_threshold (Tool *tool); void threshold_dialog_hide (void); -void threshold_initialize (GDisplay *gdisp); -void threshold_2 (void *data, - PixelRegion *srcPR, - PixelRegion *destPR); +void threshold_initialize (GDisplay *gdisp); +void threshold_2 (gpointer data, + PixelRegion *srcPR, + PixelRegion *destPR); #endif /* __THRESHOLD_H__ */ diff --git a/app/tile.c b/app/tile.c index 3e63aecff9..64fd8bf5b7 100644 --- a/app/tile.c +++ b/app/tile.c @@ -1,5 +1,29 @@ +/* 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 + +#include + #include "tile.h" #include "tile_pvt.h" #include "tile_cache.h" @@ -14,7 +38,7 @@ int tile_count = 0; void tile_sanitize_rowhints (Tile *tile) { - int height, y; + gint height, y; /* If tile has rowhints array already, do nothing. */ if (tile->rowhint) @@ -31,7 +55,8 @@ tile_sanitize_rowhints (Tile *tile) } TileRowHint -tile_get_rowhint (Tile *tile, int yoff) +tile_get_rowhint (Tile *tile, + gint yoff) { #ifdef HINTS_SANITY if (yoff < tile_eheight(tile) && yoff>=0) @@ -47,7 +72,9 @@ tile_get_rowhint (Tile *tile, int yoff) } void -tile_set_rowhint (Tile *tile, int yoff, TileRowHint rowhint) +tile_set_rowhint (Tile *tile, + gint yoff, + TileRowHint rowhint) { #ifdef HINTS_SANITY if (yoff < tile_eheight(tile) && yoff>=0) @@ -63,23 +90,24 @@ tile_set_rowhint (Tile *tile, int yoff, TileRowHint rowhint) void tile_init (Tile *tile, - int bpp) + gint bpp) { - tile->ref_count = 0; + tile->ref_count = 0; tile->write_count = 0; tile->share_count = 0; - tile->dirty = FALSE; - tile->valid = FALSE; - tile->data = NULL; - tile->ewidth = TILE_WIDTH; - tile->eheight = TILE_HEIGHT; - tile->bpp = bpp; - tile->swap_num = 1; + tile->dirty = FALSE; + tile->valid = FALSE; + tile->data = NULL; + tile->ewidth = TILE_WIDTH; + tile->eheight = TILE_HEIGHT; + tile->bpp = bpp; + tile->swap_num = 1; tile->swap_offset = -1; - tile->tlink = NULL; - tile->next = tile->prev = NULL; - tile->listhead = NULL; - tile->rowhint = NULL; + tile->tlink = NULL; + tile->next = NULL; + tile->prev = NULL; + tile->listhead = NULL; + tile->rowhint = NULL; #ifdef USE_PTHREADS { diff --git a/app/tile.h b/app/tile.h index 651782a487..9a1bab5dea 100644 --- a/app/tile.h +++ b/app/tile.h @@ -1,3 +1,21 @@ +/* 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 __TILE_H__ #define __TILE_H__ @@ -12,18 +30,12 @@ /* sanity checking on new tile hinting code */ /* #define HINTS_SANITY */ -#include -#include - -#include "config.h" - -typedef struct _Tile Tile; - /* explicit guchar type rather than enum since gcc chooses an int * representation but arrays of TileRowHints are quite space-critical * in GIMP. */ typedef guchar TileRowHint; + #define TILEROWHINT_BROKEN 0 #define TILEROWHINT_OPAQUE 1 #define TILEROWHINT_TRANSPARENT 2 @@ -35,8 +47,8 @@ typedef guchar TileRowHint; /* Initializes the fields of a tile to "good" values. */ -void tile_init (Tile *tile, - int bpp); +void tile_init (Tile *tile, + gint bpp); /* @@ -48,31 +60,37 @@ void tile_init (Tile *tile, * write access. (This is a hack, and should be handled better.) */ -void tile_lock (Tile *); -void tile_release (Tile *, int); +void tile_lock (Tile *tile); +void tile_release (Tile *tile, + gint); /* Allocate the data for the tile. */ -void tile_alloc (Tile *tile); +void tile_alloc (Tile *tile); /* Return the size in bytes of the tiles data. */ -int tile_size (Tile *tile); +gint tile_size (Tile *tile); -int tile_ewidth (Tile *tile); -int tile_eheight (Tile *tile); -int tile_bpp (Tile *tile); +gint tile_ewidth (Tile *tile); +gint tile_eheight (Tile *tile); +gint tile_bpp (Tile *tile); -int tile_is_valid (Tile *tile); +gint tile_is_valid (Tile *tile); -void tile_mark_valid (Tile *tile); +void tile_mark_valid (Tile *tile); /* DOCUMENT ME -- adm */ -TileRowHint tile_get_rowhint (Tile *tile, int yoff); -void tile_set_rowhint (Tile *tile, int yoff, TileRowHint rowhint); -void tile_sanitize_rowhints (Tile *tile); +TileRowHint tile_get_rowhint (Tile *tile, + gint yoff); +void tile_set_rowhint (Tile *tile, + gint yoff, + TileRowHint rowhint); +void tile_sanitize_rowhints (Tile *tile); -void *tile_data_pointer (Tile *tile, int xoff, int yoff); +void * tile_data_pointer (Tile *tile, + gint xoff, + gint yoff); /* tile_attach attaches a tile to a tile manager: this function * increments the tile's share count and inserts a tilelink into the @@ -81,8 +99,12 @@ void *tile_data_pointer (Tile *tile, int xoff, int yoff); * discarded. */ -void tile_attach (Tile *tile, void *tm, int tile_num); -void tile_detach (Tile *tile, void *tm, int tile_num); +void tile_attach (Tile *tile, + void *tm, + gint tile_num); +void tile_detach (Tile *tile, + void *tm, + gint tile_num); #endif /* __TILE_H__ */ diff --git a/app/tile_cache.c b/app/tile_cache.c index d2d0ef9168..42f6219807 100644 --- a/app/tile_cache.c +++ b/app/tile_cache.c @@ -1,16 +1,38 @@ -#include -#include -#include "gimprc.h" -#include "tile.h" -#include "tile_cache.h" -#include "tile_swap.h" +/* 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 #ifdef USE_PTHREADS #include #endif -#include "tile_pvt.h" /* ick. */ +#include + +#include "apptypes.h" + +#include "gimprc.h" +#include "tile.h" +#include "tile_cache.h" +#include "tile_swap.h" +#include "tile_pvt.h" -#include "stdio.h" /* This is the percentage of the maximum cache size that should be cleared * from the cache when an eviction is necessary diff --git a/app/tile_cache.h b/app/tile_cache.h index 12e86ec389..2f6b873207 100644 --- a/app/tile_cache.h +++ b/app/tile_cache.h @@ -1,13 +1,28 @@ +/* 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 __TILE_CACHE_H__ #define __TILE_CACHE_H__ -#include "tile.h" - - -void tile_cache_insert (Tile *tile); -void tile_cache_flush (Tile *tile); -void tile_cache_set_size (unsigned long cache_size); +void tile_cache_insert (Tile *tile); +void tile_cache_flush (Tile *tile); +void tile_cache_set_size (gulong cache_size); #endif /* __TILE_CACHE_H__ */ diff --git a/app/tile_manager.c b/app/tile_manager.c index 0a8f1f7672..c7a8352d55 100644 --- a/app/tile_manager.c +++ b/app/tile_manager.c @@ -16,8 +16,14 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "config.h" + #include +#include + +#include "apptypes.h" + #include "tile_cache.h" #include "tile_manager.h" #include "tile_swap.h" @@ -26,33 +32,34 @@ #include "tile_pvt.h" /* ick. */ -static int tile_manager_get_tile_num (TileManager *tm, - int xpixel, - int ypixel); +static gint tile_manager_get_tile_num (TileManager *tm, + gint xpixel, + gint ypixel); -TileManager* -tile_manager_new (int toplevel_width, - int toplevel_height, - int bpp) +TileManager * +tile_manager_new (gint toplevel_width, + gint toplevel_height, + gint bpp) { TileManager *tm; - int width, height; + gint width; + gint height; tm = g_new (TileManager, 1); - tm->user_data = NULL; + tm->user_data = NULL; tm->validate_proc = NULL; - width = toplevel_width; + width = toplevel_width; height = toplevel_height; - tm->width = width; - tm->height = height; - tm->bpp = bpp; + tm->width = width; + tm->height = height; + tm->bpp = bpp; tm->ntile_rows = (height + TILE_HEIGHT - 1) / TILE_HEIGHT; - tm->ntile_cols = (width + TILE_WIDTH - 1) / TILE_WIDTH; - tm->tiles = NULL; + tm->ntile_cols = (width + TILE_WIDTH - 1) / TILE_WIDTH; + tm->tiles = NULL; return tm; } @@ -60,8 +67,8 @@ tile_manager_new (int toplevel_width, void tile_manager_destroy (TileManager *tm) { - int ntiles; - int i; + gint ntiles; + gint i; if (tm->tiles) { @@ -88,14 +95,14 @@ tile_manager_set_validate_proc (TileManager *tm, } -Tile* +Tile * tile_manager_get_tile (TileManager *tm, - int xpixel, - int ypixel, - int wantread, - int wantwrite) + gint xpixel, + gint ypixel, + gint wantread, + gint wantwrite) { - int tile_num; + gint tile_num; tile_num = tile_manager_get_tile_num (tm, xpixel, ypixel); if (tile_num < 0) @@ -104,19 +111,19 @@ tile_manager_get_tile (TileManager *tm, return tile_manager_get (tm, tile_num, wantread, wantwrite); } -Tile* +Tile * tile_manager_get (TileManager *tm, - int tile_num, - int wantread, - int wantwrite) + gint tile_num, + gint wantread, + gint wantwrite) { Tile **tiles; Tile **tile_ptr; - int ntiles; - int nrows, ncols; - int right_tile; - int bottom_tile; - int i, j, k; + gint ntiles; + gint nrows, ncols; + gint right_tile; + gint bottom_tile; + gint i, j, k; ntiles = tm->ntile_rows * tm->ntile_cols; @@ -125,13 +132,13 @@ tile_manager_get (TileManager *tm, if (!tm->tiles) { - tm->tiles = g_new (Tile*, ntiles); + tm->tiles = g_new (Tile *, ntiles); tiles = tm->tiles; nrows = tm->ntile_rows; ncols = tm->ntile_cols; - right_tile = tm->width - ((ncols - 1) * TILE_WIDTH); + right_tile = tm->width - ((ncols - 1) * TILE_WIDTH); bottom_tile = tm->height - ((nrows - 1) * TILE_HEIGHT); for (i = 0, k = 0; i < nrows; i++) @@ -229,11 +236,11 @@ tile_manager_get (TileManager *tm, void tile_manager_get_async (TileManager *tm, - int xpixel, - int ypixel) + gint xpixel, + gint ypixel) { Tile *tile_ptr; - int tile_num; + gint tile_num; tile_num = tile_manager_get_tile_num (tm, xpixel, ypixel); if (tile_num < 0) @@ -269,9 +276,9 @@ void tile_manager_invalidate_tiles (TileManager *tm, Tile *toplevel_tile) { - double x, y; - int row, col; - int num; + gdouble x, y; + gint row, col; + gint num; col = toplevel_tile->tlink->tile_num % tm->ntile_cols; row = toplevel_tile->tlink->tile_num / tm->ntile_cols; @@ -290,26 +297,31 @@ tile_manager_invalidate_tiles (TileManager *tm, void -tile_invalidate_tile (Tile **tile_ptr, TileManager *tm, - int xpixel, int ypixel) +tile_invalidate_tile (Tile **tile_ptr, + TileManager *tm, + gint xpixel, + gint ypixel) { - int tile_num; + gint tile_num; tile_num = tile_manager_get_tile_num (tm, xpixel, ypixel); - if (tile_num < 0) return; + if (tile_num < 0) + return; tile_invalidate (tile_ptr, tm, tile_num); } void -tile_invalidate (Tile **tile_ptr, TileManager *tm, int tile_num) +tile_invalidate (Tile **tile_ptr, + TileManager *tm, + gint tile_num) { Tile *tile = *tile_ptr; TILE_MUTEX_LOCK (tile); - if (!tile->valid) + if (!tile->valid) goto leave; if (tile->share_count > 1) @@ -350,13 +362,13 @@ leave: void tile_manager_map_tile (TileManager *tm, - int xpixel, - int ypixel, + gint xpixel, + gint ypixel, Tile *srctile) { - int tile_row; - int tile_col; - int tile_num; + gint tile_row; + gint tile_col; + gint tile_num; if ((xpixel < 0) || (xpixel >= tm->width) || (ypixel < 0) || (ypixel >= tm->height)) @@ -374,16 +386,16 @@ tile_manager_map_tile (TileManager *tm, void tile_manager_map (TileManager *tm, - int tile_num, + gint tile_num, Tile *srctile) { Tile **tiles; Tile **tile_ptr; - int ntiles; - int nrows, ncols; - int right_tile; - int bottom_tile; - int i, j, k; + gint ntiles; + gint nrows, ncols; + gint right_tile; + gint bottom_tile; + gint i, j, k; ntiles = tm->ntile_rows * tm->ntile_cols; @@ -397,13 +409,13 @@ tile_manager_map (TileManager *tm, { g_warning ("tile_manager_map: empty tile level - init'ing."); - tm->tiles = g_new (Tile*, ntiles); + tm->tiles = g_new (Tile *, ntiles); tiles = tm->tiles; nrows = tm->ntile_rows; ncols = tm->ntile_cols; - right_tile = tm->width - ((ncols - 1) * TILE_WIDTH); + right_tile = tm->width - ((ncols - 1) * TILE_WIDTH); bottom_tile = tm->height - ((nrows - 1) * TILE_HEIGHT); for (i = 0, k = 0; i < nrows; i++) @@ -437,10 +449,11 @@ tile_manager_map (TileManager *tm, TILE_MUTEX_LOCK (*tile_ptr); if ((*tile_ptr)->ewidth != srctile->ewidth || (*tile_ptr)->eheight != srctile->eheight || - (*tile_ptr)->bpp != srctile->bpp) { - g_warning ("tile_manager_map: nonconformant map (%p -> %p)", - srctile, *tile_ptr); - } + (*tile_ptr)->bpp != srctile->bpp) + { + g_warning ("tile_manager_map: nonconformant map (%p -> %p)", + srctile, *tile_ptr); + } tile_detach (*tile_ptr, tm, tile_num); @@ -460,12 +473,12 @@ tile_manager_map (TileManager *tm, static int tile_manager_get_tile_num (TileManager *tm, - int xpixel, - int ypixel) + gint xpixel, + gint ypixel) { - int tile_row; - int tile_col; - int tile_num; + gint tile_row; + gint tile_col; + gint tile_num; if ((xpixel < 0) || (xpixel >= tm->width) || (ypixel < 0) || (ypixel >= tm->height)) @@ -480,37 +493,40 @@ tile_manager_get_tile_num (TileManager *tm, void tile_manager_set_user_data (TileManager *tm, - void *user_data) + gpointer user_data) { tm->user_data = user_data; } -void * -tile_manager_get_user_data (TileManager *tm) +gpointer +tile_manager_get_user_data (const TileManager *tm) { return tm->user_data; } int -tile_manager_level_width (TileManager *tm) +tile_manager_level_width (const TileManager *tm) { return tm->width; } int -tile_manager_level_height (TileManager *tm) +tile_manager_level_height (const TileManager *tm) { return tm->height; } int -tile_manager_level_bpp (TileManager *tm) +tile_manager_level_bpp (const TileManager *tm) { return tm->bpp; } void -tile_manager_get_tile_coordinates (TileManager *tm, Tile *tile, int *x, int *y) +tile_manager_get_tile_coordinates (TileManager *tm, + Tile *tile, + gint *x, + gint *y) { TileLink *tl; @@ -531,7 +547,9 @@ tile_manager_get_tile_coordinates (TileManager *tm, Tile *tile, int *x, int *y) void -tile_manager_map_over_tile (TileManager *tm, Tile *tile, Tile *srctile) +tile_manager_map_over_tile (TileManager *tm, + Tile *tile, + Tile *srctile) { TileLink *tl; @@ -548,7 +566,3 @@ tile_manager_map_over_tile (TileManager *tm, Tile *tile, Tile *srctile) tile_manager_map (tm, tl->tile_num, srctile); } - - - - diff --git a/app/tile_manager.h b/app/tile_manager.h index 379f6a18d4..ab550a217d 100644 --- a/app/tile_manager.h +++ b/app/tile_manager.h @@ -15,19 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __TILE_MANAGER_H__ #define __TILE_MANAGER_H__ -#include "tile.h" - - -typedef struct _TileManager TileManager; - -typedef void (*TileValidateProc) (TileManager *tm, - Tile *tile); - - /* Creates a new tile manager with the specified * width for the toplevel. The toplevel sizes is * used to compute the number of levels and there @@ -37,13 +29,13 @@ typedef void (*TileValidateProc) (TileManager *tm, * hierarchy is "nlevels - 1". That level will be smaller * than TILE_WIDTH x TILE_HEIGHT */ -TileManager* tile_manager_new (int toplevel_width, - int toplevel_height, - int bpp); +TileManager * tile_manager_new (gint toplevel_width, + gint toplevel_height, + gint bpp); /* Destroy a tile manager and all the tiles it contains. */ -void tile_manager_destroy (TileManager *tm); +void tile_manager_destroy (TileManager *tm); /* Set the validate procedure for the tile manager. * The validate procedure is called when an invalid tile @@ -51,70 +43,76 @@ void tile_manager_destroy (TileManager *tm); * is set to valid and its memory is allocated, but * not initialized. */ -void tile_manager_set_validate_proc (TileManager *tm, - TileValidateProc proc); +void tile_manager_set_validate_proc (TileManager *tm, + TileValidateProc proc); /* Get a specified tile from a tile manager. */ -Tile* tile_manager_get_tile (TileManager *tm, - int xpixel, - int ypixel, - int wantread, - int wantwrite); +Tile * tile_manager_get_tile (TileManager *tm, + gint xpixel, + gint ypixel, + gint wantread, + gint wantwrite); /* Get a specified tile from a tile manager. */ -Tile* tile_manager_get (TileManager *tm, - int tile_num, - int wantread, - int wantwrite); +Tile * tile_manager_get (TileManager *tm, + gint tile_num, + gint wantread, + gint wantwrite); /* Request that (if possible) the tile at x,y be swapped * in. This is only a hint to improve performance; no guarantees. * The tile may be swapped in or otherwise made more accessible * if it is convenient... */ -void tile_manager_get_async (TileManager *tm, - int xpixel, - int ypixel); +void tile_manager_get_async (TileManager *tm, + gint xpixel, + gint ypixel); -void tile_manager_map_tile (TileManager *tm, - int xpixel, - int ypixel, - Tile *srctile); +void tile_manager_map_tile (TileManager *tm, + gint xpixel, + gint ypixel, + Tile *srctile); -void tile_manager_map (TileManager *tm, - int time_num, - Tile *srctile); +void tile_manager_map (TileManager *tm, + gint time_num, + Tile *srctile); /* Validate a tiles memory. */ -void tile_manager_validate (TileManager *tm, - Tile *tile); +void tile_manager_validate (TileManager *tm, + Tile *tile); -void tile_invalidate (Tile **tile_ptr, TileManager *tm, int tile_num); -void tile_invalidate_tile (Tile **tile_ptr, TileManager *tm, - int xpixel, int ypixel); +void tile_invalidate (Tile **tile_ptr, + TileManager *tm, + gint tile_num); +void tile_invalidate_tile (Tile **tile_ptr, + TileManager *tm, + gint xpixel, + gint ypixel); /* Given a toplevel tile, this procedure will invalidate * (set the dirty bit) for this toplevel tile. */ -void tile_manager_invalidate_tiles (TileManager *tm, - Tile *toplevel_tile); +void tile_manager_invalidate_tiles (TileManager *tm, + Tile *toplevel_tile); -void tile_manager_set_user_data (TileManager *tm, - void *user_data); +void tile_manager_set_user_data (TileManager *tm, + gpointer user_data); +gpointer tile_manager_get_user_data (const TileManager *tm); -void *tile_manager_get_user_data (TileManager *tm); +gint tile_manager_level_width (const TileManager *tm); +gint tile_manager_level_height (const TileManager *tm); +gint tile_manager_level_bpp (const TileManager *tm); -int tile_manager_level_width (TileManager *tm); -int tile_manager_level_height (TileManager *tm); -int tile_manager_level_bpp (TileManager *tm); - -void tile_manager_get_tile_coordinates (TileManager *tm, Tile *tile, - int *x, int *y); - -void tile_manager_map_over_tile (TileManager *tm, Tile *tile, Tile *srctile); +void tile_manager_get_tile_coordinates (TileManager *tm, + Tile *tile, + gint *x, + gint *y); +void tile_manager_map_over_tile (TileManager *tm, + Tile *tile, + Tile *srctile); #endif /* __TILE_MANAGER_H__ */ diff --git a/app/tile_manager_pvt.h b/app/tile_manager_pvt.h index 806e72a704..ba3e5c641c 100644 --- a/app/tile_manager_pvt.h +++ b/app/tile_manager_pvt.h @@ -15,27 +15,28 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __TILE_MANAGER_PVT_H__ #define __TILE_MANAGER_PVT_H__ -#include "tile.h" struct _TileManager { - int x, y; /* tile manager offsets */ + gint x, y; /* tile manager offsets */ - int width; /* the width of the tiled area */ - int height; /* the height of the tiled area */ - int bpp; /* the bpp of each tile */ + gint width; /* the width of the tiled area */ + gint height; /* the height of the tiled area */ + gint bpp; /* the bpp of each tile */ - int ntile_rows; /* the number of tiles in each row */ - int ntile_cols; /* the number of tiles in each columns */ + gint ntile_rows; /* the number of tiles in each row */ + gint ntile_cols; /* the number of tiles in each columns */ - Tile **tiles; /* the tiles for this level */ - TileValidateProc validate_proc; /* this proc is called when an attempt to get an - * invalid tile is made. - */ - void *user_data; /* hook for hanging data off of */ + Tile **tiles; /* the tiles for this level */ + TileValidateProc validate_proc; /* this proc is called when an attempt + * to get an invalid tile is made. + */ + + gpointer user_data; /* hook for hanging data off of */ }; diff --git a/app/tile_pvt.h b/app/tile_pvt.h index 16fdc0aca8..0445806462 100644 --- a/app/tile_pvt.h +++ b/app/tile_pvt.h @@ -1,11 +1,11 @@ #ifndef __TILE_PVT_H__ #define __TILE_PVT_H__ + #ifdef USE_PTHREADS #include #endif - #include #include @@ -27,26 +27,26 @@ struct _TileLink struct _Tile { - short ref_count; /* reference count. when the reference count is + gshort ref_count; /* reference count. when the reference count is * non-zero then the "data" for this tile must * be valid. when the reference count for a tile * is 0 then the "data" for this tile must be * NULL. */ - short write_count; /* write count: number of references that are + gshort write_count; /* write count: number of references that are for write access */ - short share_count; /* share count: number of tile managers that + gshort share_count; /* share count: number of tile managers that hold this tile */ guint dirty : 1; /* is the tile dirty? has it been modified? */ guint valid : 1; /* is the tile valid? */ - unsigned char bpp; /* the bytes per pixel (1, 2, 3 or 4) */ - unsigned short ewidth; /* the effective width of the tile */ - unsigned short eheight; /* the effective height of the tile */ - /* a tile's effective width and height may be smaller - * (but not larger) than TILE_WIDTH and TILE_HEIGHT. - * this is to handle edge tiles of a drawable. - */ + guchar bpp; /* the bytes per pixel (1, 2, 3 or 4) */ + gushort ewidth; /* the effective width of the tile */ + gushort eheight; /* the effective height of the tile + * a tile's effective width and height may be smaller + * (but not larger) than TILE_WIDTH and TILE_HEIGHT. + * this is to handle edge tiles of a drawable. + */ TileRowHint *rowhint; /* An array of hints for rendering purposes */ @@ -54,24 +54,26 @@ struct _Tile * case the tile data is on disk. */ - int swap_num; /* the index into the file table of the file to be used - * for swapping. swap_num 1 is always the global swap file. - */ + gint swap_num; /* the index into the file table of the file to be used + * for swapping. swap_num 1 is always the global + * swap file. + */ off_t swap_offset; /* the offset within the swap file of the tile data. - * if the tile data is in memory this will be set to -1. + * if the tile data is in memory this will be set to -1. */ TileLink *tlink; - Tile *next; - Tile *prev; /* List pointers for the tile cache lists */ - void *listhead; /* Pointer to the head of the list this tile is on */ + Tile *next; + Tile *prev; /* List pointers for the tile cache lists */ + gpointer listhead; /* Pointer to the head of the list this tile is on */ + #ifdef USE_PTHREADS pthread_mutex_t mutex; #endif }; #ifdef USE_PTHREADS -#define TILE_MUTEX_LOCK(tile) pthread_mutex_lock(&((tile)->mutex)) +#define TILE_MUTEX_LOCK(tile) pthread_mutex_lock(&((tile)->mutex)) #define TILE_MUTEX_UNLOCK(tile) pthread_mutex_unlock(&((tile)->mutex)) #else #define TILE_MUTEX_LOCK(tile) /* nothing */ diff --git a/app/tile_swap.c b/app/tile_swap.c index d6ca029dbe..af86ef910d 100644 --- a/app/tile_swap.c +++ b/app/tile_swap.c @@ -1,6 +1,24 @@ +/* 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 #include #include @@ -26,12 +44,14 @@ #define _O_TEMPORARY 0 #endif -#define MAX_OPEN_SWAP_FILES 16 +#include "apptypes.h" #include "tile.h" #include "tile_swap.h" #include "tile_pvt.h" /* ick. */ +#define MAX_OPEN_SWAP_FILES 16 + typedef struct _SwapFile SwapFile; typedef struct _DefSwapFile DefSwapFile; typedef struct _Gap Gap; diff --git a/app/tile_swap.h b/app/tile_swap.h index 5b30e6ec11..68ef479e0d 100644 --- a/app/tile_swap.h +++ b/app/tile_swap.h @@ -1,11 +1,27 @@ +/* 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 __TILE_SWAP_H__ #define __TILE_SWAP_H__ -#include "tile.h" - - -typedef enum { +typedef enum +{ SWAP_IN = 1, SWAP_IN_ASYNC, SWAP_OUT, @@ -13,22 +29,22 @@ typedef enum { SWAP_COMPRESS } SwapCommand; -typedef int (*SwapFunc) (int fd, - Tile *tile, - int cmd, - gpointer user_data); +typedef gint (*SwapFunc) (gint fd, + Tile *tile, + gint cmd, + gpointer user_data); -void tile_swap_exit (void); -int tile_swap_add (char *filename, - SwapFunc swap_func, - gpointer user_data); -void tile_swap_remove (int swap_num); -void tile_swap_in (Tile *tile); -void tile_swap_in_async (Tile *tile); -void tile_swap_out (Tile *tile); -void tile_swap_delete (Tile *tile); -void tile_swap_compress (int swap_num); +void tile_swap_exit (void); +gint tile_swap_add (gchar *filename, + SwapFunc swap_func, + gpointer user_data); +void tile_swap_remove (gint swap_num); +void tile_swap_in (Tile *tile); +void tile_swap_in_async (Tile *tile); +void tile_swap_out (Tile *tile); +void tile_swap_delete (Tile *tile); +void tile_swap_compress (gint swap_num); #endif /* __TILE_SWAP_H__ */ diff --git a/app/tips_dialog.c b/app/tips_dialog.c index 2096d21019..ed538bc748 100644 --- a/app/tips_dialog.c +++ b/app/tips_dialog.c @@ -25,6 +25,8 @@ #include +#include "apptypes.h" + #include "tips_dialog.h" #include "gimprc.h" #include "gimpui.h" diff --git a/app/tips_dialog.h b/app/tips_dialog.h index a50a0a0663..bde7ba8ee6 100644 --- a/app/tips_dialog.h +++ b/app/tips_dialog.h @@ -15,9 +15,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __TIPS_DIALOG_H__ #define __TIPS_DIALOG_H__ -void tips_dialog_create (void); + +void tips_dialog_create (void); + #endif /* __TIPS_DIALOG_H__ */ diff --git a/app/tool_options.c b/app/tool_options.c index babd80151c..b89dab896d 100644 --- a/app/tool_options.c +++ b/app/tool_options.c @@ -18,11 +18,12 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "brush_select.h" +#include "gimpcontext.h" #include "gimprc.h" #include "gimpui.h" #include "paint_funcs.h" diff --git a/app/tool_options.h b/app/tool_options.h index 378f534494..fe00fa2fe9 100644 --- a/app/tool_options.h +++ b/app/tool_options.h @@ -20,14 +20,8 @@ #define __TOOL_OPTIONS_H__ -/* tool options function declarations */ - -typedef void (* ToolOptionsResetFunc) (void); - - /* the tool options structures */ -typedef struct _ToolOptions ToolOptions; struct _ToolOptions { GtkWidget *main_vbox; @@ -49,4 +43,5 @@ void tool_options_init (ToolOptions *options, gchar *title, ToolOptionsResetFunc reset_func); + #endif /* __TOOL_OPTIONS_H__ */ diff --git a/app/tools.c b/app/tools.c index a90224a731..19fce25e8b 100644 --- a/app/tools.c +++ b/app/tools.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include "apptypes.h" @@ -39,7 +39,9 @@ #include "dodgeburn.h" #include "eraser.h" #include "gdisplay.h" +#include "gimpcontext.h" #include "gimpdnd.h" +#include "gimpimage.h" #include "gimpui.h" #include "hue_saturation.h" #include "ellipse_select.h" @@ -64,6 +66,7 @@ #include "text_tool.h" #include "threshold.h" #include "tools.h" +#include "tool_options.h" #include "transform_tool.h" #include "dialog_handler.h" @@ -1318,7 +1321,7 @@ tools_initialize (ToolType tool_type, { (* tool_info[(gint) tool_type].init_func) (gdisp); - active_tool->drawable = gimage_active_drawable (gdisp->gimage); + active_tool->drawable = gimp_image_active_drawable (gdisp->gimage); } /* don't set gdisp_ptr here! (see commands.c) */ @@ -1392,7 +1395,7 @@ standard_button_press_func (Tool *tool, gdisp = gdisp_ptr; tool->gdisp_ptr = gdisp; - tool->drawable = gimage_active_drawable (gdisp->gimage); + tool->drawable = gimp_image_active_drawable (gdisp->gimage); } static void diff --git a/app/tools.h b/app/tools.h index 8a1cbef011..a76ce57814 100644 --- a/app/tools.h +++ b/app/tools.h @@ -19,42 +19,30 @@ #ifndef __TOOLS_H__ #define __TOOLS_H__ -#include "gimpcontext.h" -#include "tool_options.h" -#include "channel.h" + #include "cursorutil.h" -#include "toolsF.h" - - -/* The possible states for tools */ -typedef enum -{ - INACTIVE, - ACTIVE, - PAUSED -} ToolState; - -/* Selection Boolean operations that rect, */ -/* ellipse, freehand, and fuzzy tools may */ -/* perform. */ - -typedef enum -{ - SELECTION_ADD = ADD, - SELECTION_SUB = SUB, - SELECTION_REPLACE = REPLACE, - SELECTION_INTERSECT = INTERSECT, - SELECTION_MOVE_MASK, - SELECTION_MOVE, - SELECTION_ANCHOR -} SelectOps; /* The possibilities for where the cursor lies */ #define ACTIVE_LAYER (1 << 0) #define SELECTION (1 << 1) #define NON_ACTIVE_LAYER (1 << 2) +/* Tool action function declarations */ +typedef void (* ButtonPressFunc) (Tool *, GdkEventButton *, gpointer); +typedef void (* ButtonReleaseFunc) (Tool *, GdkEventButton *, gpointer); +typedef void (* MotionFunc) (Tool *, GdkEventMotion *, gpointer); +typedef void (* ArrowKeysFunc) (Tool *, GdkEventKey *, gpointer); +typedef void (* ModifierKeyFunc) (Tool *, GdkEventKey *, gpointer); +typedef void (* CursorUpdateFunc) (Tool *, GdkEventMotion *, gpointer); +typedef void (* OperUpdateFunc) (Tool *, GdkEventMotion *, gpointer); +typedef void (* ToolCtlFunc) (Tool *, ToolAction, gpointer); + +/* ToolInfo function declarations */ +typedef Tool * (* ToolInfoNewFunc) (void); +typedef void (* ToolInfoFreeFunc) (Tool *); +typedef void (* ToolInfoInitFunc) (GDisplay *); + /* The types of tools... */ struct _Tool { diff --git a/app/tools/airbrush.c b/app/tools/airbrush.c index 3a518af92a..e12e0d2fd4 100644 --- a/app/tools/airbrush.c +++ b/app/tools/airbrush.c @@ -28,11 +28,14 @@ #include "gdisplay.h" #include "gradient.h" #include "gimage.h" +#include "gimpbrush.h" +#include "gimpcontext.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" #include "paint_options.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" #include "libgimp/gimpintl.h" @@ -295,10 +298,10 @@ airbrush_motion (PaintCore *paint_core, double pressure, PaintApplicationMode mode) { - GImage *gimage; - TempBuf * area; - unsigned char col[MAX_CHANNELS]; - gdouble scale; + GImage *gimage; + TempBuf *area; + guchar col[MAX_CHANNELS]; + gdouble scale; if (!drawable) return; diff --git a/app/tools/airbrush.h b/app/tools/airbrush.h index adae83e6c7..ea4e64954b 100644 --- a/app/tools/airbrush.h +++ b/app/tools/airbrush.h @@ -15,17 +15,23 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __AIRBRUSH_H__ #define __AIRBRUSH_H__ -#include "tools.h" -#include "paint_core.h" -void * airbrush_paint_func (PaintCore *, GimpDrawable *, int); -gboolean airbrush_non_gui (GimpDrawable *, double, int, double *); -gboolean airbrush_non_gui_default (GimpDrawable *, int, double *); -Tool * tools_new_airbrush (void); -void tools_free_airbrush (Tool *); +void * airbrush_paint_func (PaintCore *, + GimpDrawable *, + gint); +gboolean airbrush_non_gui (GimpDrawable *, + gdouble, + gint, + gdouble *); +gboolean airbrush_non_gui_default (GimpDrawable *, + gint, + gdouble *); +Tool * tools_new_airbrush (void); +void tools_free_airbrush (Tool *); #endif /* __AIRBRUSH_H__ */ diff --git a/app/tools/bezier_select.c b/app/tools/bezier_select.c index 2440f19004..b29fb669c3 100644 --- a/app/tools/bezier_select.c +++ b/app/tools/bezier_select.c @@ -24,17 +24,25 @@ #include "apptypes.h" +#include "channel.h" #include "cursorutil.h" #include "draw_core.h" +#include "drawable.h" #include "edit_selection.h" #include "errors.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimage_mask.h" +#include "gimpcontext.h" #include "rect_select.h" #include "bezier_select.h" #include "bezier_selectP.h" #include "paths_dialogP.h" +#include "pixel_region.h" +#include "procedural_db.h" #include "selection_options.h" +#include "tools.h" +#include "tool_options.h" #include "undo.h" #include "libgimp/gimpmath.h" @@ -972,7 +980,7 @@ bezier_select_button_press (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; - tool->drawable = gimage_active_drawable (gdisp->gimage); + tool->drawable = gimp_image_active_drawable (gdisp->gimage); bezier_sel = tool->private; grab_pointer = FALSE; @@ -1020,7 +1028,7 @@ bezier_select_button_press (Tool *tool, /* break; */ /* } */ /* else if (!(bevent->state & GDK_SHIFT_MASK) && !(bevent->state & GDK_CONTROL_MASK)) */ -/* if (! (layer_is_floating_sel (gimage_get_active_layer (gdisp->gimage))) && */ +/* if (! (layer_is_floating_sel (gimp_image_get_active_layer (gdisp->gimage))) && */ /* gdisplay_mask_value (gdisp, bevent->x, bevent->y) > HALF_WAY) */ /* { */ /* init_edit_selection (tool, gdisp_ptr, bevent, EDIT_MASK_TO_LAYER_TRANSLATE); */ @@ -1249,16 +1257,16 @@ bezier_select_button_press (Tool *tool, if ((bevent->state & GDK_SHIFT_MASK) && !(bevent->state & GDK_CONTROL_MASK)) - op = ADD; + op = CHANNEL_OP_ADD; else if ((bevent->state & GDK_CONTROL_MASK) && !(bevent->state & GDK_SHIFT_MASK)) - op = SUB; + op = CHANNEL_OP_SUB; else if ((bevent->state & GDK_CONTROL_MASK) && (bevent->state & GDK_SHIFT_MASK)) - op = INTERSECT; + op = CHANNEL_OP_INTERSECT; else { - op = ADD; + op = CHANNEL_OP_ADD; replace = TRUE; } @@ -2514,10 +2522,13 @@ bezier_convert (BezierSelect *bezier_sel, points = next_curve; } while (next_curve); - pixel_region_init (&maskPR, drawable_data (GIMP_DRAWABLE(bezier_sel->mask)), + pixel_region_init (&maskPR, + gimp_drawable_data (GIMP_DRAWABLE (bezier_sel->mask)), 0, 0, - drawable_width (GIMP_DRAWABLE(bezier_sel->mask)), - drawable_height (GIMP_DRAWABLE(bezier_sel->mask)), TRUE); + gimp_drawable_width (GIMP_DRAWABLE (bezier_sel->mask)), + gimp_drawable_height (GIMP_DRAWABLE (bezier_sel->mask)), + TRUE); + for (i = 0; i < height; i++) { list = bezier_sel->scanlines[i]; @@ -2567,7 +2578,7 @@ bezier_convert (BezierSelect *bezier_sel, } pixel_region_set_row (&maskPR, 0, (i / SUPERSAMPLE), - drawable_width (GIMP_DRAWABLE(bezier_sel->mask)), buf); + gimp_drawable_width (GIMP_DRAWABLE (bezier_sel->mask)), buf); } g_slist_free (bezier_sel->scanlines[i]); @@ -2794,7 +2805,7 @@ bezier_paste_bezierselect_to_current(GDisplay *gdisp,BezierSelect *bsel) gimp_context_set_tool (gimp_context_get_user (), BEZIER_SELECT); active_tool->paused_count = 0; active_tool->gdisp_ptr = gdisp; - active_tool->drawable = gimage_active_drawable (gdisp->gimage); + active_tool->drawable = gimp_image_active_drawable (gdisp->gimage); tool = active_tool; @@ -2894,12 +2905,12 @@ bezier_to_sel_internal(BezierSelect *bezier_sel, if (bezier_options->feather) channel_feather (bezier_sel->mask, - gimage_get_mask (gdisp->gimage), + gimp_image_get_mask (gdisp->gimage), bezier_options->feather_radius, bezier_options->feather_radius, op, 0, 0); else - channel_combine_mask (gimage_get_mask (gdisp->gimage), + channel_combine_mask (gimp_image_get_mask (gdisp->gimage), bezier_sel->mask, op, 0, 0); /* show selection on all views */ @@ -3167,7 +3178,7 @@ bezier_to_selection (BezierSelect *bezier_sel, * This loads it into curSel for this image */ bezier_paste_bezierselect_to_current (gdisp, bezier_sel); - bezier_to_sel_internal (curSel, curTool, gdisp, ADD, TRUE); + bezier_to_sel_internal (curSel, curTool, gdisp, CHANNEL_OP_ADD, TRUE); } /* unused @@ -3456,7 +3467,7 @@ bezier_stroke (BezierSelect *bezier_sel, gint offset_x, offset_y; gdouble *ptr; - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); gimp_drawable_offsets (drawable, &offset_x, &offset_y); ptr = rpnts->stroke_points; diff --git a/app/tools/bezier_select.h b/app/tools/bezier_select.h index e34cdecb5e..6ec0e61cc8 100644 --- a/app/tools/bezier_select.h +++ b/app/tools/bezier_select.h @@ -19,16 +19,11 @@ #ifndef __BEZIER_SELECT_H__ #define __BEZIER_SELECT_H__ -#include "toolsF.h" - -typedef struct _BezierPoint BezierPoint; -typedef struct _BezierSelect BezierSelect; - -/* bezier select functions */ Tool * tools_new_bezier_select (void); void tools_free_bezier_select (Tool *tool); gboolean bezier_tool_selected (void); + #endif /* __BEZIER_SELECT_H__ */ diff --git a/app/tools/blend.c b/app/tools/blend.c index 1f47c174e6..ebb5915c43 100644 --- a/app/tools/blend.c +++ b/app/tools/blend.c @@ -33,16 +33,22 @@ #include "errors.h" #include "fuzzy_select.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimage_mask.h" +#include "gimpcontext.h" #include "gimpdnd.h" +#include "gimpprogress.h" #include "gimpui.h" #include "gradient.h" +#include "paint_funcs.h" #include "paint_options.h" +#include "pixel_region.h" #include "selection.h" #include "tools.h" #include "undo.h" #include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpcolorspace.h" #include "libgimp/gimpmath.h" @@ -434,7 +440,7 @@ blend_button_press (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; blend_tool = (BlendTool *) tool->private; - switch (drawable_type (gimage_active_drawable (gdisp->gimage))) + switch (drawable_type (gimp_image_active_drawable (gdisp->gimage))) { case INDEXED_GIMAGE: case INDEXEDA_GIMAGE: g_message (_("Blend: Invalid for indexed images.")); @@ -506,7 +512,7 @@ blend_button_release (Tool *tool, return_vals = procedural_db_run_proc ("gimp_blend", &nreturn_vals, - PDB_DRAWABLE, drawable_ID (gimage_active_drawable (gimage)), + PDB_DRAWABLE, drawable_ID (gimp_image_active_drawable (gimage)), PDB_INT32, (gint32) blend_options->blend_mode, PDB_INT32, (gint32) PAINT_OPTIONS_GET_PAINT_MODE (blend_options), PDB_INT32, (gint32) blend_options->gradient_type, @@ -534,7 +540,7 @@ blend_button_release (Tool *tool, progress = progress_start (gdisp, _("Blending..."), FALSE, NULL, NULL); blend (gimage, - gimage_active_drawable (gimage), + gimp_image_active_drawable (gimage), blend_options->blend_mode, gimp_context_get_paint_mode (NULL), blend_options->gradient_type, @@ -642,7 +648,7 @@ blend_cursor_update (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; - switch (drawable_type (gimage_active_drawable (gdisp->gimage))) + switch (drawable_type (gimp_image_active_drawable (gdisp->gimage))) { case INDEXED_GIMAGE: case INDEXEDA_GIMAGE: @@ -800,8 +806,8 @@ blend (GImage *gimage, progress_callback, progress_data); pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE); - gimage_apply_image (gimage, drawable, &bufPR, TRUE, - (opacity * 255) / 100, paint_mode, NULL, x1, y1); + gimp_image_apply_image (gimage, drawable, &bufPR, TRUE, + (opacity * 255) / 100, paint_mode, NULL, x1, y1); /* update the image */ drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1)); @@ -1186,14 +1192,14 @@ gradient_precalc_shapeburst (GImage *gimage, if (! gimage_mask_is_empty (gimage)) { PixelRegion maskR; - int x1, y1, x2, y2; - int offx, offy; + gint x1, y1, x2, y2; + gint offx, offy; drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2); drawable_offsets (drawable, &offx, &offy); /* the selection mask */ - mask = gimage_get_mask (gimage); + mask = gimp_image_get_mask (gimage); pixel_region_init (&maskR, drawable_data (GIMP_DRAWABLE(mask)), x1 + offx, y1 + offy, (x2 - x1), (y2 - y1), FALSE); diff --git a/app/tools/blend.h b/app/tools/blend.h index 66b7b1bf7e..3c25e17344 100644 --- a/app/tools/blend.h +++ b/app/tools/blend.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __BLEND_H__ #define __BLEND_H__ -#include "gimpprogress.h" -#include "tools.h" typedef enum { @@ -54,11 +53,26 @@ typedef enum REPEAT_LAST /*< skip >*/ } RepeatMode; -void blend (GimpImage *, GimpDrawable *, BlendMode, int, GradientType, - double, double, RepeatMode, int, int, double, double, - double, double, double, progress_func_t, void *); +void blend (GimpImage *, + GimpDrawable *, + BlendMode, + gint, + GradientType, + gdouble, + gdouble, + RepeatMode, + gint, + gint, + gdouble, + gdouble, + gdouble, + gdouble, + gdouble, + progress_func_t, + gpointer); + +Tool * tools_new_blend (void); +void tools_free_blend (Tool *tool); -Tool * tools_new_blend (void); -void tools_free_blend (Tool *); #endif /* __BLEND_H__ */ diff --git a/app/tools/blob.h b/app/tools/blob.h index 6151f607c9..3f7fd96646 100644 --- a/app/tools/blob.h +++ b/app/tools/blob.h @@ -25,32 +25,58 @@ #ifndef __BLOB_H__ #define __BLOB_H__ + typedef struct _BlobPoint BlobPoint; -typedef struct _BlobSpan BlobSpan; -typedef struct _Blob Blob; +typedef struct _BlobSpan BlobSpan; +typedef struct _Blob Blob; -struct _BlobPoint { - int x; - int y; +struct _BlobPoint +{ + gint x; + gint y; }; -struct _BlobSpan { - int left; - int right; +struct _BlobSpan +{ + gint left; + gint right; }; -struct _Blob { - int y; - int height; +struct _Blob +{ + gint y; + gint height; BlobSpan data[1]; }; -Blob *blob_convex_union (Blob *b1, Blob *b2); -Blob *blob_polygon (BlobPoint *points, int npoints); -Blob *blob_square (double xc, double yc, double xp, double yp, double xq, double yq); -Blob *blob_diamond (double xc, double yc, double xp, double yp, double xq, double yq); -Blob *blob_ellipse (double xc, double yc, double xp, double yp, double xq, double yq); -void blob_bounds(Blob *b, int *x, int *y, int *width, int *height); +Blob * blob_convex_union (Blob *b1, + Blob *b2); +Blob * blob_polygon (BlobPoint *points, + gint npoints); +Blob * blob_square (gdouble xc, + gdouble yc, + gdouble xp, + gdouble yp, + gdouble xq, + gdouble yq); +Blob * blob_diamond (gdouble xc, + gdouble yc, + gdouble xp, + gdouble yp, + gdouble xq, + gdouble yq); +Blob * blob_ellipse (gdouble xc, + gdouble yc, + gdouble xp, + gdouble yp, + gdouble xq, + gdouble yq); +void blob_bounds (Blob *b, + gint *x, + gint *y, + gint *width, + gint *height); + #endif /* __BLOB_H__ */ diff --git a/app/tools/brightness_contrast.c b/app/tools/brightness_contrast.c index 71da9a888e..20a16dcbc3 100644 --- a/app/tools/brightness_contrast.c +++ b/app/tools/brightness_contrast.c @@ -25,11 +25,15 @@ #include "appenv.h" #include "brightness_contrast.h" #include "drawable.h" +#include "gimpcontext.h" #include "gimplut.h" #include "gimpui.h" #include "gdisplay.h" +#include "gimpimage.h" #include "image_map.h" #include "lut_funcs.h" +#include "tool_options.h" +#include "tools.h" #include "libgimp/gimpintl.h" @@ -170,7 +174,7 @@ tools_free_brightness_contrast (Tool *tool) void brightness_contrast_initialize (GDisplay *gdisp) { - if (drawable_indexed (gimage_active_drawable (gdisp->gimage))) + if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Brightness-Contrast does not operate on indexed drawables.")); return; @@ -186,7 +190,8 @@ brightness_contrast_initialize (GDisplay *gdisp) brightness_contrast_dialog->brightness = 0.0; brightness_contrast_dialog->contrast = 0.0; - brightness_contrast_dialog->drawable = gimage_active_drawable (gdisp->gimage); + brightness_contrast_dialog->drawable = + gimp_image_active_drawable (gdisp->gimage); brightness_contrast_dialog->image_map = image_map_create (gdisp, brightness_contrast_dialog->drawable); diff --git a/app/tools/brightness_contrast.h b/app/tools/brightness_contrast.h index 82ff8ce7d7..41e909dc68 100644 --- a/app/tools/brightness_contrast.h +++ b/app/tools/brightness_contrast.h @@ -15,10 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __BRIGHTNESS_CONTRAST_H__ #define __BRIGHTNESS_CONTRAST_H__ -#include "tools.h" Tool * tools_new_brightness_contrast (void); void tools_free_brightness_contrast (Tool *tool); @@ -27,4 +27,5 @@ void brightness_contrast_dialog_hide (void); void brightness_contrast_initialize (GDisplay *gdisp); + #endif /* __BRIGHTNESS_CONTRAST_H__ */ diff --git a/app/tools/bucket_fill.c b/app/tools/bucket_fill.c index b2313e810c..d227994b71 100644 --- a/app/tools/bucket_fill.c +++ b/app/tools/bucket_fill.c @@ -25,24 +25,34 @@ #include "appenv.h" #include "bucket_fill.h" +#include "channel.h" #include "cursorutil.h" #include "drawable.h" #include "fuzzy_select.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimage_mask.h" +#include "gimpcontext.h" #include "gimprc.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_options.h" +#include "patterns.h" +#include "pixel_region.h" +#include "procedural_db.h" #include "selection.h" +#include "temp_buf.h" +#include "tile_manager.h" #include "tools.h" #include "undo.h" #include "libgimp/gimpintl.h" + /* the bucket fill structures */ typedef struct _BucketTool BucketTool; + struct _BucketTool { gint target_x; /* starting x coord */ @@ -50,6 +60,7 @@ struct _BucketTool }; typedef struct _BucketOptions BucketOptions; + struct _BucketOptions { PaintOptions paint_options; @@ -232,7 +243,7 @@ bucket_fill_button_release (Tool *tool, return_vals = procedural_db_run_proc ("gimp_bucket_fill", &nreturn_vals, - PDB_DRAWABLE, drawable_ID (gimage_active_drawable (gdisp->gimage)), + PDB_DRAWABLE, drawable_ID (gimp_image_active_drawable (gdisp->gimage)), PDB_INT32, (gint32) bucket_options->fill_mode, PDB_INT32, (gint32) gimp_context_get_paint_mode (NULL), PDB_FLOAT, (gdouble) gimp_context_get_opacity (NULL) * 100, @@ -269,7 +280,7 @@ bucket_fill_cursor_update (Tool *tool, gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, FALSE, FALSE); - if ((layer = gimage_get_active_layer (gdisp->gimage))) + if ((layer = gimp_image_get_active_layer (gdisp->gimage))) { drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y); @@ -360,9 +371,9 @@ bucket_fill (GimpImage *gimage, pat_buf = NULL; if (fill_mode == FG_BUCKET_FILL) - gimage_get_foreground (gimage, drawable, col); + gimp_image_get_foreground (gimage, drawable, col); else if (fill_mode == BG_BUCKET_FILL) - gimage_get_background (gimage, drawable, col); + gimp_image_get_background (gimage, drawable, col); else if (fill_mode == PATTERN_BUCKET_FILL) { pattern = gimp_context_get_pattern (NULL); @@ -392,8 +403,8 @@ bucket_fill (GimpImage *gimage, size = pattern->mask->width * pattern->mask->height; while (size--) { - gimage_transform_color (gimage, drawable, d1, d2, - (pattern->mask->bytes == 3) ? RGB : GRAY); + gimp_image_transform_color (gimage, drawable, d1, d2, + (pattern->mask->bytes == 3) ? RGB : GRAY); d1 += pattern->mask->bytes; d2 += pat_buf->bytes; } @@ -464,8 +475,8 @@ bucket_fill (GimpImage *gimage, bucket_fill_region (fill_mode, &bufPR, NULL, col, pat_buf, x1, y1, has_alpha); pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE); - gimage_apply_image (gimage, drawable, &bufPR, TRUE, - (opacity * 255) / 100, paint_mode, NULL, x1, y1); + gimp_image_apply_image (gimage, drawable, &bufPR, TRUE, + (opacity * 255) / 100, paint_mode, NULL, x1, y1); /* update the image */ drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1)); diff --git a/app/tools/bucket_fill.h b/app/tools/bucket_fill.h index e4ad5e485a..195b5098fd 100644 --- a/app/tools/bucket_fill.h +++ b/app/tools/bucket_fill.h @@ -19,8 +19,6 @@ #ifndef __BUCKET_FILL_H__ #define __BUCKET_FILL_H__ -#include "tools.h" - typedef enum { @@ -29,27 +27,28 @@ typedef enum PATTERN_BUCKET_FILL } BucketFillMode; -void bucket_fill (GimpImage *gimage, - GimpDrawable *drawable, - BucketFillMode fill_mode, - gint paint_mode, - gdouble opacity, - gdouble threshold, - gboolean sample_merged, - gdouble x, - gdouble y); -void bucket_fill_region (BucketFillMode fill_mode, - PixelRegion *bufPR, - PixelRegion *maskPR, - guchar *col, - TempBuf *pattern, - gint off_x, - gint off_y, - gboolean has_alpha); +void bucket_fill (GimpImage *gimage, + GimpDrawable *drawable, + BucketFillMode fill_mode, + gint paint_mode, + gdouble opacity, + gdouble threshold, + gboolean sample_merged, + gdouble x, + gdouble y); -Tool * tools_new_bucket_fill (void); -void tools_free_bucket_fill (Tool *tool); +void bucket_fill_region (BucketFillMode fill_mode, + PixelRegion *bufPR, + PixelRegion *maskPR, + guchar *col, + TempBuf *pattern, + gint off_x, + gint off_y, + gboolean has_alpha); + +Tool * tools_new_bucket_fill (void); +void tools_free_bucket_fill (Tool *tool); #endif /* __BUCKET_FILL_H__ */ diff --git a/app/tools/by_color_select.c b/app/tools/by_color_select.c index f8195ac06f..45210650c9 100644 --- a/app/tools/by_color_select.c +++ b/app/tools/by_color_select.c @@ -26,21 +26,29 @@ #include "appenv.h" #include "boundary.h" #include "by_color_select.h" +#include "channel.h" #include "cursorutil.h" #include "drawable.h" #include "draw_core.h" #include "gimage_mask.h" #include "gimpdnd.h" +#include "gimpimage.h" #include "gimprc.h" #include "gimpset.h" #include "gimpui.h" #include "gdisplay.h" +#include "paint_funcs.h" +#include "pixel_region.h" #include "selection_options.h" - -#include "tile.h" /* ick. */ +#include "temp_buf.h" +#include "tile.h" +#include "tile_manager.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpintl.h" + #define PREVIEW_WIDTH 256 #define PREVIEW_HEIGHT 256 #define PREVIEW_EVENT_MASK GDK_EXPOSURE_MASK | \ @@ -204,15 +212,15 @@ by_color_select_color (GImage *gimage, /* Get the image information */ if (sample_merged) { - bytes = gimage_composite_bytes (gimage); - d_type = gimage_composite_type (gimage); + bytes = gimp_image_composite_bytes (gimage); + d_type = gimp_image_composite_type (gimage); has_alpha = (d_type == RGBA_GIMAGE || d_type == GRAYA_GIMAGE || d_type == INDEXEDA_GIMAGE); indexed = d_type == INDEXEDA_GIMAGE || d_type == INDEXED_GIMAGE; width = gimage->width; height = gimage->height; - pixel_region_init (&imagePR, gimage_composite (gimage), + pixel_region_init (&imagePR, gimp_image_composite (gimage), 0, 0, width, height, FALSE); } else @@ -259,7 +267,7 @@ by_color_select_color (GImage *gimage, for (j = 0; j < imagePR.w; j++) { /* Get the rgb values for the color */ - gimage_get_color (gimage, d_type, rgb, idata); + gimp_image_get_color (gimage, d_type, rgb, idata); /* Plug the alpha channel in there */ if (has_alpha) @@ -318,12 +326,12 @@ by_color_select (GImage *gimage, drawable_offsets (drawable, &off_x, &off_y); if (feather) - channel_feather (new_mask, gimage_get_mask (gimage), + channel_feather (new_mask, gimp_image_get_mask (gimage), feather_radius, feather_radius, op, off_x, off_y); else - channel_combine_mask (gimage_get_mask (gimage), + channel_combine_mask (gimp_image_get_mask (gimage), new_mask, op, off_x, off_y); channel_delete (new_mask); @@ -342,7 +350,7 @@ by_color_select_button_press (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; by_color_sel = (ByColorSelect *) tool->private; - tool->drawable = gimage_active_drawable (gdisp->gimage); + tool->drawable = gimp_image_active_drawable (gdisp->gimage); if (!by_color_dialog) return; @@ -396,7 +404,7 @@ by_color_select_button_release (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; by_color_sel = (ByColorSelect *) tool->private; - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); gdk_pointer_ungrab (bevent->time); @@ -462,7 +470,7 @@ by_color_select_cursor_update (Tool *tool, &x, &y, FALSE, FALSE); if (by_color_options->sample_merged || - ((layer = gimage_pick_correlate_layer (gdisp->gimage, x, y)) && + ((layer = gimp_image_pick_correlate_layer (gdisp->gimage, x, y)) && layer == gdisp->gimage->active_layer)) { switch (by_col_sel->operation) @@ -878,7 +886,7 @@ by_color_select_render (ByColorDialog *bcd, gint i; gint scale; - mask = gimage_get_mask (gimage); + mask = gimp_image_get_mask (gimage); if ((drawable_width (GIMP_DRAWABLE(mask)) > PREVIEW_WIDTH) || (drawable_height (GIMP_DRAWABLE(mask)) > PREVIEW_HEIGHT)) { @@ -986,7 +994,7 @@ by_color_select_draw (ByColorDialog *bcd, /* Update the gimage label to reflect the displayed gimage name */ gtk_label_set_text (GTK_LABEL (bcd->gimage_name), - g_basename (gimage_filename (gimage))); + g_basename (gimp_image_filename (gimage))); } static gint @@ -1032,7 +1040,7 @@ by_color_select_invert_callback (GtkWidget *widget, return; /* check if the image associated to the mask still exists */ - if (!drawable_gimage (GIMP_DRAWABLE (gimage_get_mask (bcd->gimage)))) + if (!drawable_gimage (GIMP_DRAWABLE (gimp_image_get_mask (bcd->gimage)))) return; /* invert the mask */ @@ -1058,7 +1066,7 @@ by_color_select_select_all_callback (GtkWidget *widget, return; /* check if the image associated to the mask still exists */ - if (!drawable_gimage (GIMP_DRAWABLE (gimage_get_mask (bcd->gimage)))) + if (!drawable_gimage (GIMP_DRAWABLE (gimp_image_get_mask (bcd->gimage)))) return; /* fill the mask */ @@ -1084,7 +1092,7 @@ by_color_select_select_none_callback (GtkWidget *widget, return; /* check if the image associated to the mask still exists */ - if (!drawable_gimage (GIMP_DRAWABLE (gimage_get_mask (bcd->gimage)))) + if (!drawable_gimage (GIMP_DRAWABLE (gimp_image_get_mask (bcd->gimage)))) return; /* reset the mask */ @@ -1129,7 +1137,7 @@ by_color_select_preview_button_press (ByColorDialog *bcd, if (!bcd->gimage) return; - drawable = gimage_active_drawable (bcd->gimage); + drawable = gimp_image_active_drawable (bcd->gimage); /* check if the gimage associated to the drawable still exists */ if (!drawable_gimage (drawable)) @@ -1161,7 +1169,7 @@ by_color_select_preview_button_press (ByColorDialog *bcd, y = bcd->gimage->height * bevent->y / bcd->preview->requisition.height; if (x < 0 || y < 0 || x >= bcd->gimage->width || y >= bcd->gimage->height) return; - tile = tile_manager_get_tile (gimage_composite (bcd->gimage), + tile = tile_manager_get_tile (gimp_image_composite (bcd->gimage), x, y, TRUE, FALSE); col = tile_data_pointer (tile, x % TILE_WIDTH, y % TILE_HEIGHT); } @@ -1205,12 +1213,12 @@ by_color_select_color_drop (GtkWidget *widget, gpointer data) { - GimpDrawable *drawable; + GimpDrawable *drawable; ByColorDialog *bcd; - guchar col[3]; + guchar col[3]; bcd = (ByColorDialog*) data; - drawable = gimage_active_drawable (bcd->gimage); + drawable = gimp_image_active_drawable (bcd->gimage); col[0] = r; col[1] = g; diff --git a/app/tools/by_color_select.h b/app/tools/by_color_select.h index c1ed753ac2..b75f1145ed 100644 --- a/app/tools/by_color_select.h +++ b/app/tools/by_color_select.h @@ -15,12 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __BY_COLOR_SELECT_H__ #define __BY_COLOR_SELECT_H__ -#include "tools.h" -#include "gdisplayF.h" -#include "gimage.h" Tool * tools_new_by_color_select (void); void tools_free_by_color_select (Tool *tool); @@ -38,4 +36,5 @@ void by_color_select (GimpImage *gimage, gdouble feather_radius, gboolean sample_merged); + #endif /* __BY_COLOR_SELECT_H__ */ diff --git a/app/tools/clone.c b/app/tools/clone.c index 0db3c5e312..7c16c6f684 100644 --- a/app/tools/clone.c +++ b/app/tools/clone.c @@ -26,20 +26,27 @@ #include "apptypes.h" #include "appenv.h" +#include "draw_core.h" #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpcontext.h" +#include "gimpimage.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" #include "paint_options.h" +#include "patterns.h" +#include "pixel_region.h" #include "clone.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" #include "cursorutil.h" #include "libgimp/gimpintl.h" + #define TARGET_HEIGHT 15 #define TARGET_WIDTH 15 @@ -325,7 +332,7 @@ clone_cursor_update (Tool *tool, gdisplay_untransform_coords (gdisp, (double) mevent->x, (double) mevent->y, &x, &y, TRUE, FALSE); - if ((layer = gimage_get_active_layer (gdisp->gimage))) + if ((layer = gimp_image_get_active_layer (gdisp->gimage))) { int off_x, off_y; drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y); @@ -602,8 +609,8 @@ clone_line_image (GImage *dest, while (width--) { - gimage_get_color (src, drawable_type (s_drawable), rgb, s); - gimage_transform_color (dest, d_drawable, rgb, d, RGB); + gimp_image_get_color (src, drawable_type (s_drawable), rgb, s); + gimp_image_transform_color (dest, d_drawable, rgb, d, RGB); if (has_alpha) d[dest_alpha] = s[src_alpha]; @@ -625,9 +632,9 @@ clone_line_pattern (GImage *dest, int bytes, int width) { - unsigned char *pat, *p; - int color, alpha; - int i; + guchar *pat, *p; + gint color, alpha; + gint i; /* Make sure x, y are positive */ while (x < 0) @@ -646,7 +653,7 @@ clone_line_pattern (GImage *dest, { p = pat + ((i + x) % pattern->mask->width) * pattern->mask->bytes; - gimage_transform_color (dest, drawable, p, d, color); + gimp_image_transform_color (dest, drawable, p, d, color); d[alpha] = OPAQUE_OPACITY; @@ -659,7 +666,8 @@ clone_non_gui_paint_func (PaintCore *paint_core, GimpDrawable *drawable, int state) { - clone_motion (paint_core, drawable, non_gui_src_drawable, &non_gui_pressure_options, + clone_motion (paint_core, drawable, non_gui_src_drawable, + &non_gui_pressure_options, non_gui_type, non_gui_offset_x, non_gui_offset_y); return NULL; diff --git a/app/tools/clone.h b/app/tools/clone.h index ca55cfb2cf..0433bc488e 100644 --- a/app/tools/clone.h +++ b/app/tools/clone.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __CLONE_H__ #define __CLONE_H__ -#include "paint_core.h" -#include "tools.h" typedef enum { @@ -27,11 +26,21 @@ typedef enum PATTERN_CLONE } CloneType; -void * clone_paint_func (PaintCore *, GimpDrawable *, int); -gboolean clone_non_gui (GimpDrawable *, GimpDrawable *, CloneType, - double, double, int, double *); -gboolean clone_non_gui_default (GimpDrawable *, int, double *); -Tool * tools_new_clone (void); -void tools_free_clone (Tool *); +void * clone_paint_func (PaintCore *, + GimpDrawable *, + gint); +gboolean clone_non_gui (GimpDrawable *, + GimpDrawable *, + CloneType, + gdouble, + gdouble, + gint, + gdouble *); +gboolean clone_non_gui_default (GimpDrawable *, + gint, + gdouble *); +Tool * tools_new_clone (void); +void tools_free_clone (Tool *); + #endif /* __CLONE_H__ */ diff --git a/app/tools/color_balance.c b/app/tools/color_balance.c index 6eec211d82..b74246cfdc 100644 --- a/app/tools/color_balance.c +++ b/app/tools/color_balance.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include "apptypes.h" @@ -27,13 +27,18 @@ #include "color_transfer.h" #include "drawable.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimpui.h" #include "image_map.h" +#include "pixel_region.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpintl.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpcolorspace.h" + #define CYAN_RED 0x1 #define MAGENTA_GREEN 0x2 #define YELLOW_BLUE 0x4 @@ -212,7 +217,7 @@ color_balance_initialize (GDisplay *gdisp) { gint i; - if (! drawable_color (gimage_active_drawable (gdisp->gimage))) + if (! drawable_color (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Color balance operates only on RGB color drawables.")); return; @@ -232,7 +237,7 @@ color_balance_initialize (GDisplay *gdisp) color_balance_dialog->yellow_blue[i] = 0.0; } - color_balance_dialog->drawable = gimage_active_drawable (gdisp->gimage); + color_balance_dialog->drawable = gimp_image_active_drawable (gdisp->gimage); color_balance_dialog->image_map = image_map_create (gdisp, color_balance_dialog->drawable); diff --git a/app/tools/color_balance.h b/app/tools/color_balance.h index 72221fdae8..0f14e5fac4 100644 --- a/app/tools/color_balance.h +++ b/app/tools/color_balance.h @@ -20,9 +20,6 @@ #define __COLOR_BALANCE_H__ -#include "image_map.h" -#include "tools.h" - typedef enum { SHADOWS, diff --git a/app/tools/color_picker.c b/app/tools/color_picker.c index f8d2b1a2a2..17fda5b902 100644 --- a/app/tools/color_picker.c +++ b/app/tools/color_picker.c @@ -28,15 +28,18 @@ #include "draw_core.h" #include "drawable.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimpui.h" +#include "gimprc.h" #include "cursorutil.h" #include "info_dialog.h" #include "palette.h" #include "tools.h" -#include "gimprc.h" +#include "tool_options.h" #include "libgimp/gimpintl.h" + /* maximum information buffer size */ #define MAX_INFO_BUF 8 @@ -243,7 +246,7 @@ color_picker_button_press (Tool *tool, /* Make the tool active and set it's gdisplay & drawable */ tool->gdisp_ptr = gdisp; - tool->drawable = gimage_active_drawable (gdisp->gimage); + tool->drawable = gimp_image_active_drawable (gdisp->gimage); tool->state = ACTIVE; /* create the info dialog if it doesn't exist */ @@ -428,7 +431,7 @@ color_picker_cursor_update (Tool *tool, gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, FALSE, FALSE); - if (gimage_pick_correlate_layer (gdisp->gimage, x, y)) + if (gimp_image_pick_correlate_layer (gdisp->gimage, x, y)) gdisplay_install_tool_cursor (gdisp, GIMP_COLOR_PICKER_CURSOR, COLOR_PICKER, CURSOR_MODIFIER_NONE, diff --git a/app/tools/color_picker.h b/app/tools/color_picker.h index 6ee830b792..66ba4ded50 100644 --- a/app/tools/color_picker.h +++ b/app/tools/color_picker.h @@ -19,7 +19,8 @@ #ifndef __COLOR_PICKER_H__ #define __COLOR_PICKER_H__ -#include "tools.h" + +extern gint col_value[5]; gboolean pick_color (GimpImage *gimage, @@ -34,7 +35,5 @@ gboolean pick_color (GimpImage *gimage, Tool * tools_new_color_picker (void); void tools_free_color_picker (Tool *tool); -extern gint col_value[5]; - #endif /* __COLOR_PICKER_H__ */ diff --git a/app/tools/convolve.c b/app/tools/convolve.c index 558d2a526b..bcf8bd2580 100644 --- a/app/tools/convolve.c +++ b/app/tools/convolve.c @@ -27,11 +27,15 @@ #include "drawable.h" #include "convolve.h" #include "gdisplay.h" +#include "gimpbrush.h" +#include "gimpcontext.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" #include "paint_options.h" +#include "pixel_region.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" #include "gimage.h" @@ -344,7 +348,8 @@ convolve_motion (PaintCore *paint_core, /* If the brush is smaller than the convolution matrix, don't convolve */ - if((paint_core->brush->mask->width < matrix_size) || (paint_core->brush->mask->height < matrix_size)) + if ((paint_core->brush->mask->width < matrix_size) || + (paint_core->brush->mask->height < matrix_size)) return; if (pressure_options->size) diff --git a/app/tools/convolve.h b/app/tools/convolve.h index e93cdf46d6..3a6058ef5c 100644 --- a/app/tools/convolve.h +++ b/app/tools/convolve.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __CONVOLVE_H__ #define __CONVOLVE_H__ -#include "paint_core.h" -#include "tools.h" typedef enum { @@ -29,10 +28,19 @@ typedef enum } ConvolveType; -void * convolve_paint_func (PaintCore *, GimpDrawable *, int); -gboolean convolve_non_gui (GimpDrawable *, double, ConvolveType, int, double *); -gboolean convolve_non_gui_default (GimpDrawable *, int, double *); -Tool * tools_new_convolve (void); -void tools_free_convolve (Tool *); +void * convolve_paint_func (PaintCore *, + GimpDrawable *, + gint ); +gboolean convolve_non_gui (GimpDrawable *, + gdouble , + ConvolveType , + gint , + gdouble *); +gboolean convolve_non_gui_default (GimpDrawable *, + gint , + gdouble *); +Tool * tools_new_convolve (void ); +void tools_free_convolve (Tool *); + #endif /* __CONVOLVE_H__ */ diff --git a/app/tools/crop.c b/app/tools/crop.c index ff5de63cf3..a792147af9 100644 --- a/app/tools/crop.c +++ b/app/tools/crop.c @@ -26,22 +26,29 @@ #include "apptypes.h" #include "appenv.h" +#include "channel.h" #include "crop.h" #include "cursorutil.h" #include "draw_core.h" #include "drawable.h" #include "floating_sel.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimage_mask.h" #include "gimphelp.h" #include "gimpui.h" #include "info_dialog.h" +#include "layer.h" +#include "pixel_region.h" +#include "tools.h" +#include "tool_options.h" #include "undo.h" #include "libgimp/gimpsizeentry.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" + #define STATUSBAR_SIZE 128 /* possible crop functions */ @@ -285,7 +292,7 @@ crop_button_press (Tool *tool, draw_core_stop (crop->core, tool); tool->gdisp_ptr = gdisp_ptr; - tool->drawable = gimage_active_drawable (gdisp->gimage); + tool->drawable = gimp_image_active_drawable (gdisp->gimage); gdisplay_untransform_coords (gdisp, bevent->x, bevent->y, &crop->tx1, &crop->ty1, TRUE, FALSE); @@ -402,14 +409,15 @@ crop_motion (Tool *tool, GdkEventMotion *mevent, gpointer gdisp_ptr) { - Crop * crop; - GDisplay * gdisp; - Layer * layer; - int x1, y1, x2, y2; - int curx, cury; - int inc_x, inc_y; - gchar size[STATUSBAR_SIZE]; - int min_x, min_y, max_x, max_y; + Crop *crop; + GDisplay *gdisp; + Layer *layer; + gint x1, y1, x2, y2; + gint curx, cury; + gint inc_x, inc_y; + gchar size[STATUSBAR_SIZE]; + gint min_x, min_y, max_x, max_y; + crop = (Crop *) tool->private; gdisp = (GDisplay *) gdisp_ptr; @@ -871,7 +879,7 @@ crop_image (GImage *gimage, } else { - floating_layer = gimage_floating_sel (gimage); + floating_layer = gimp_image_floating_sel (gimage); undo_push_group_start (gimage, CROP_UNDO); @@ -930,14 +938,14 @@ crop_image (GImage *gimage, -(lx1 - off_x), -(ly1 - off_y)); else - gimage_remove_layer (gimage, layer); + gimp_image_remove_layer (gimage, layer); } list = next; } /* Make sure the projection matches the gimage size */ - gimage_projection_realloc (gimage); + gimp_image_projection_realloc (gimage); /* rigor the floating layer */ if (floating_layer) @@ -957,7 +965,7 @@ crop_image (GImage *gimage, /* shrink wrap and update all views */ channel_invalidate_previews (gimage); layer_invalidate_previews (gimage); - gimage_invalidate_preview (gimage); + gimp_image_invalidate_preview (gimage); gdisplays_update_full (gimage); gdisplays_shrink_wrap (gimage); } @@ -1287,7 +1295,7 @@ crop_automatic_callback (GtkWidget *widget, if (crop_options->layer_only) { - if (!(active_drawable = gimage_active_drawable (gdisp->gimage))) + if (!(active_drawable = gimp_image_active_drawable (gdisp->gimage))) return; width = drawable_width (GIMP_DRAWABLE (active_drawable)); height = drawable_height (GIMP_DRAWABLE (active_drawable)); diff --git a/app/tools/crop.h b/app/tools/crop.h index 33be8451bf..b698b95634 100644 --- a/app/tools/crop.h +++ b/app/tools/crop.h @@ -19,8 +19,6 @@ #ifndef __CROP_H__ #define __CROP_H__ -#include "tools.h" - typedef enum { @@ -29,12 +27,17 @@ typedef enum } CropType; -/* select functions */ -void crop_draw (Tool *); -void crop_image (GimpImage *gimage, int, int, int, int, int, int); +void crop_draw (Tool *tool); +void crop_image (GimpImage *gimage, + gint, + gint, + gint, + gint, + gint, + gint); Tool * tools_new_crop (void); -void tools_free_crop (Tool *); +void tools_free_crop (Tool *tool); #endif /* __CROP_H__ */ diff --git a/app/tools/curves.c b/app/tools/curves.c index 692a2a8a71..7ba6f1ab76 100644 --- a/app/tools/curves.c +++ b/app/tools/curves.c @@ -26,18 +26,24 @@ #include "appenv.h" #include "cursorutil.h" +#include "curves.h" #include "drawable.h" #include "gdisplay.h" #include "gimphistogram.h" +#include "gimpimage.h" #include "gimpui.h" -#include "curves.h" #include "gimplut.h" +#include "image_map.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpenv.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" + #define GRAPH 0x1 #define XRANGE_TOP 0x2 #define XRANGE_BOTTOM 0x4 @@ -284,7 +290,7 @@ curves_button_press (Tool *tool, GimpDrawable *drawable; gdisp = gdisp_ptr; - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); tool->gdisp_ptr = gdisp; @@ -322,7 +328,7 @@ curves_button_release (Tool *tool, if(!curves_dialog || !gdisp || - !(drawable = gimage_active_drawable (gdisp->gimage))) + !(drawable = gimp_image_active_drawable (gdisp->gimage))) return; gdisplay_untransform_coords (gdisp, bevent->x, bevent->y, &x, &y, FALSE, FALSE); @@ -357,9 +363,9 @@ curves_motion (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; - if(!curves_dialog || - !gdisp || - !(drawable = gimage_active_drawable (gdisp->gimage))) + if (! curves_dialog || + ! gdisp || + ! (drawable = gimp_image_active_drawable (gdisp->gimage))) return; gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, FALSE, FALSE); @@ -443,7 +449,7 @@ curves_initialize (GDisplay *gdisp) { gint i, j; - if (drawable_indexed (gimage_active_drawable (gdisp->gimage))) + if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Curves for indexed drawables cannot be adjusted.")); return; @@ -466,7 +472,7 @@ curves_initialize (GDisplay *gdisp) curves_channel_reset (i); } - curves_dialog->drawable = gimage_active_drawable (gdisp->gimage); + curves_dialog->drawable = gimp_image_active_drawable (gdisp->gimage); curves_dialog->color = drawable_color (curves_dialog->drawable); curves_dialog->image_map = image_map_create (gdisp, curves_dialog->drawable); diff --git a/app/tools/curves.h b/app/tools/curves.h index 86daeefd40..d209de2d82 100644 --- a/app/tools/curves.h +++ b/app/tools/curves.h @@ -19,9 +19,6 @@ #ifndef __CURVES_H__ #define __CURVES_H__ -#include "image_map.h" -#include "lut_funcs.h" -#include "tools.h" #define SMOOTH 0 #define GFREE 1 @@ -63,16 +60,17 @@ struct _CurvesDialog GimpLut *lut; }; -Tool * tools_new_curves (void); -void tools_free_curves (Tool *tool); +Tool * tools_new_curves (void); +void tools_free_curves (Tool *tool); + +void curves_dialog_hide (void); +void curves_initialize (GDisplay *gdisp); +void curves_free (void); +gfloat curves_lut_func (CurvesDialog *cd, + gint nchannels, + gint channel, + gfloat value); +void curves_calculate_curve (CurvesDialog *cd); -void curves_dialog_hide (void); -void curves_initialize (GDisplay *gdisp); -void curves_free (void); -float curves_lut_func (CurvesDialog *cd, - gint nchannels, - gint channel, - gfloat value); -void curves_calculate_curve (CurvesDialog *cd); #endif /* __CURVES_H__ */ diff --git a/app/tools/dodgeburn.c b/app/tools/dodgeburn.c index c873c16347..8ffe8968ce 100644 --- a/app/tools/dodgeburn.c +++ b/app/tools/dodgeburn.c @@ -15,6 +15,7 @@ * 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 @@ -27,11 +28,14 @@ #include "dodgeburn.h" #include "gdisplay.h" #include "gimplut.h" +#include "gimpcontext.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" #include "paint_options.h" +#include "pixel_region.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" #include "gimage.h" diff --git a/app/tools/dodgeburn.h b/app/tools/dodgeburn.h index 569ee8e675..341fe445ea 100644 --- a/app/tools/dodgeburn.h +++ b/app/tools/dodgeburn.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __DODGEBURN_H__ #define __DODGEBURN_H__ -#include "paint_core.h" -#include "tools.h" typedef enum { @@ -34,10 +33,22 @@ typedef enum DODGEBURN_SHADOWS } DodgeBurnMode; -void * dodgeburn_paint_func (PaintCore *, GimpDrawable *, int); -gboolean dodgeburn_non_gui (GimpDrawable *, double, DodgeBurnType, DodgeBurnMode, int, double *); -gboolean dodgeburn_non_gui_default (GimpDrawable *, int, double *); -Tool * tools_new_dodgeburn (void); -void tools_free_dodgeburn (Tool *); + +void * dodgeburn_paint_func (PaintCore *, + GimpDrawable *, + gint); +gboolean dodgeburn_non_gui (GimpDrawable *, + gdouble, + DodgeBurnType, + DodgeBurnMode, + gint, + gdouble *); +gboolean dodgeburn_non_gui_default (GimpDrawable *, + gint, + gdouble *); + +Tool * tools_new_dodgeburn (void); +void tools_free_dodgeburn (Tool *); + #endif /* __DODGEBURN_H__ */ diff --git a/app/tools/edit_selection.c b/app/tools/edit_selection.c index 128b96268d..ab759aa00c 100644 --- a/app/tools/edit_selection.c +++ b/app/tools/edit_selection.c @@ -27,20 +27,25 @@ #include "apptypes.h" #include "appenv.h" +#include "boundary.h" #include "cursorutil.h" #include "draw_core.h" #include "drawable.h" #include "tools.h" #include "edit_selection.h" #include "floating_sel.h" +#include "gimpimage.h" #include "gimage_mask.h" -#include "gdisplay.h" -#include "undo.h" #include "gimprc.h" +#include "gdisplay.h" +#include "layer.h" #include "path_transform.h" +#include "selection.h" +#include "undo.h" + +#include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" -#include "libgimp/gimpmath.h" #define EDIT_SELECT_SCROLL_LOCK FALSE @@ -49,6 +54,7 @@ typedef struct _EditSelection EditSelection; + struct _EditSelection { gint origx, origy; /* last x and y coords */ @@ -149,12 +155,13 @@ init_edit_selection (Tool *tool, &edit_select.num_segs_out); /* Make a check to see if it should be a floating selection translation */ - if (edit_type == EDIT_MASK_TO_LAYER_TRANSLATE && gimage_floating_sel (gdisp->gimage)) + if (edit_type == EDIT_MASK_TO_LAYER_TRANSLATE && + gimp_image_floating_sel (gdisp->gimage)) edit_type = EDIT_FLOATING_SEL_TRANSLATE; if (edit_type == EDIT_LAYER_TRANSLATE) { - layer = gimage_get_active_layer (gdisp->gimage); + layer = gimp_image_get_active_layer (gdisp->gimage); if (layer_is_floating_sel (layer)) edit_type = EDIT_FLOATING_SEL_TRANSLATE; } @@ -175,7 +182,7 @@ init_edit_selection (Tool *tool, * where the translation will result in floating the selection * mask and translating the resulting layer */ - drawable_mask_bounds (gimage_active_drawable (gdisp->gimage), + drawable_mask_bounds (gimp_image_active_drawable (gdisp->gimage), &edit_select.x1, &edit_select.y1, &edit_select.x2, &edit_select.y2); @@ -277,7 +284,7 @@ edit_selection_button_release (Tool *tool, check if the layer is a floating selection. If so, anchor. */ if (edit_select.edit_type == EDIT_FLOATING_SEL_TRANSLATE) { - layer = gimage_get_active_layer (gdisp->gimage); + layer = gimp_image_get_active_layer (gdisp->gimage); if (layer_is_floating_sel (layer)) floating_sel_anchor (layer); } @@ -286,7 +293,7 @@ edit_selection_button_release (Tool *tool, { path_transform_xy (gdisp->gimage, edit_select.cumlx, edit_select.cumly); - layer = gimage_get_active_layer (gdisp->gimage); + layer = gimp_image_get_active_layer (gdisp->gimage); gimp_drawable_invalidate_preview (GIMP_DRAWABLE (layer), TRUE); } @@ -307,9 +314,9 @@ edit_selection_motion (Tool *tool, GdkEventMotion *mevent, gpointer gdisp_ptr) { - GDisplay * gdisp; - gchar offset[STATUSBAR_SIZE]; - gdouble lastmotion_x, lastmotion_y; + GDisplay *gdisp; + gchar offset[STATUSBAR_SIZE]; + gdouble lastmotion_x, lastmotion_y; if (tool->state != ACTIVE) { @@ -368,7 +375,7 @@ edit_selection_motion (Tool *tool, break; case EDIT_LAYER_TRANSLATE: - if ((floating_layer = gimage_floating_sel (gdisp->gimage))) + if ((floating_layer = gimp_image_floating_sel (gdisp->gimage))) floating_sel_relax (floating_layer, TRUE); /* translate the layer--and any "linked" layers as well */ @@ -396,7 +403,7 @@ edit_selection_motion (Tool *tool, case EDIT_MASK_TO_LAYER_TRANSLATE: if (!gimage_mask_float (gdisp->gimage, - gimage_active_drawable (gdisp->gimage), + gimp_image_active_drawable (gdisp->gimage), 0, 0)) { /* no region to float, abort safely */ @@ -420,7 +427,7 @@ edit_selection_motion (Tool *tool, break; case EDIT_FLOATING_SEL_TRANSLATE: - layer = gimage_get_active_layer (gdisp->gimage); + layer = gimp_image_get_active_layer (gdisp->gimage); floating_sel_relax (layer, TRUE); layer_translate (layer, xoffset, yoffset); @@ -504,14 +511,14 @@ selection_transform_segs (GDisplay *gdisp, void edit_selection_draw (Tool *tool) { - GDisplay * gdisp; - Selection * select; - Layer *layer; - GSList *layer_list; - gint floating_sel; - gint x1, y1, x2, y2; - gint x3, y3, x4, y4; - gint off_x, off_y; + GDisplay *gdisp; + Selection *select; + Layer *layer; + GSList *layer_list; + gint floating_sel; + gint x1, y1, x2, y2; + gint x3, y3, x4, y4; + gint off_x, off_y; GdkSegment *segs_copy; gdisp = (GDisplay *) tool->gdisp_ptr; @@ -520,7 +527,7 @@ edit_selection_draw (Tool *tool) switch (edit_select.edit_type) { case EDIT_MASK_TRANSLATE: - layer = gimage_get_active_layer (gdisp->gimage); + layer = gimp_image_get_active_layer (gdisp->gimage); floating_sel = layer_is_floating_sel (layer); if (!floating_sel) @@ -675,17 +682,17 @@ process_event_queue_keys (GdkEventKey *kevent, * by other tools? */ { #define FILTER_MAX_KEYS 50 - va_list argp; - GdkEvent *event; - GList *event_list = NULL; - GList *list; - guint keys[FILTER_MAX_KEYS]; - GdkModifierType modifiers[FILTER_MAX_KEYS]; - gint values[FILTER_MAX_KEYS]; - gint i = 0, nkeys = 0, value = 0; - gboolean done = FALSE; - gboolean discard_event; - GtkWidget *orig_widget; + va_list argp; + GdkEvent *event; + GList *event_list = NULL; + GList *list; + guint keys[FILTER_MAX_KEYS]; + GdkModifierType modifiers[FILTER_MAX_KEYS]; + gint values[FILTER_MAX_KEYS]; + gint i = 0, nkeys = 0, value = 0; + gboolean done = FALSE; + gboolean discard_event; + GtkWidget *orig_widget; va_start (argp, kevent); while (nkeys gimage); + layer = gimp_image_get_active_layer (gdisp->gimage); if (layer_is_floating_sel (layer)) edit_type = EDIT_FLOATING_SEL_TRANSLATE; @@ -832,7 +839,7 @@ edit_sel_arrow_keys_func (Tool *tool, case EDIT_LAYER_TRANSLATE: - if ((floating_layer = gimage_floating_sel (gdisp->gimage))) + if ((floating_layer = gimp_image_floating_sel (gdisp->gimage))) floating_sel_relax (floating_layer, TRUE); /* translate the layer -- and any "linked" layers as well */ diff --git a/app/tools/edit_selection.h b/app/tools/edit_selection.h index dcd0e851bb..c1e8914d71 100644 --- a/app/tools/edit_selection.h +++ b/app/tools/edit_selection.h @@ -20,9 +20,6 @@ #define __EDIT_SELECTION_H__ -#include "tools.h" - - typedef enum { EDIT_MASK_TRANSLATE, diff --git a/app/tools/ellipse_select.c b/app/tools/ellipse_select.c index fb0f9bb576..b65dd27a06 100644 --- a/app/tools/ellipse_select.c +++ b/app/tools/ellipse_select.c @@ -20,19 +20,23 @@ #include -#include +#include #include "apptypes.h" #include "appenv.h" +#include "channel.h" +#include "draw_core.h" #include "edit_selection.h" #include "ellipse_select.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "rect_select.h" -/* private header file for rect_select data structure */ #include "rect_selectP.h" #include "selection_options.h" +#include "tools.h" +#include "tool_options.h" /* the ellipse selection tool options */ @@ -67,8 +71,8 @@ ellipse_select (GimpImage *gimage, if (feather) { new_mask = channel_new_mask (gimage, gimage->width, gimage->height); - channel_combine_ellipse (new_mask, ADD, x, y, w, h, antialias); - channel_feather (new_mask, gimage_get_mask (gimage), + channel_combine_ellipse (new_mask, CHANNEL_OP_ADD, x, y, w, h, antialias); + channel_feather (new_mask, gimp_image_get_mask (gimage), feather_radius, feather_radius, op, 0, 0); @@ -77,12 +81,12 @@ ellipse_select (GimpImage *gimage, else if (op == SELECTION_INTERSECT) { new_mask = channel_new_mask (gimage, gimage->width, gimage->height); - channel_combine_ellipse (new_mask, ADD, x, y, w, h, antialias); - channel_combine_mask (gimage_get_mask (gimage), new_mask, op, 0, 0); + channel_combine_ellipse (new_mask, CHANNEL_OP_ADD, x, y, w, h, antialias); + channel_combine_mask (gimp_image_get_mask (gimage), new_mask, op, 0, 0); channel_delete (new_mask); } else - channel_combine_ellipse (gimage_get_mask (gimage), op, + channel_combine_ellipse (gimp_image_get_mask (gimage), op, x, y, w, h, antialias); } @@ -91,8 +95,8 @@ ellipse_select_draw (Tool *tool) { GDisplay *gdisp; EllipseSelect *ellipse_sel; - gint x1, y1; - gint x2, y2; + gint x1, y1; + gint x2, y2; gdisp = (GDisplay *) tool->gdisp_ptr; ellipse_sel = (EllipseSelect *) tool->private; diff --git a/app/tools/ellipse_select.h b/app/tools/ellipse_select.h index 9bde4e105d..cce7e01273 100644 --- a/app/tools/ellipse_select.h +++ b/app/tools/ellipse_select.h @@ -19,9 +19,6 @@ #ifndef __ELLIPSE_SELECT_H__ #define __ELLIPSE_SELECT_H__ -#include "tools.h" - -/* ellipse select functions */ void ellipse_select (GimpImage *gimage, gint x, @@ -37,4 +34,5 @@ void ellipse_select_draw (Tool *tool); Tool * tools_new_ellipse_select (void); void tools_free_ellipse_select (Tool *tool); + #endif /* __ELLIPSE_SELECT_H__ */ diff --git a/app/tools/eraser.c b/app/tools/eraser.c index a368d13146..1ffa616c08 100644 --- a/app/tools/eraser.c +++ b/app/tools/eraser.c @@ -28,12 +28,15 @@ #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpcontext.h" +#include "gimpimage.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" #include "paint_options.h" #include "eraser.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" #include "libgimp/gimpintl.h" @@ -229,16 +232,16 @@ eraser_motion (PaintCore *paint_core, gboolean incremental, gboolean anti_erase) { - GImage *gimage; - gint opacity; - TempBuf * area; - unsigned char col[MAX_CHANNELS]; - gdouble scale; + GImage *gimage; + gint opacity; + TempBuf *area; + guchar col[MAX_CHANNELS]; + gdouble scale; if (! (gimage = drawable_gimage (drawable))) return; - gimage_get_background (gimage, drawable, col); + gimp_image_get_background (gimage, drawable, col); if (pressure_options->size) scale = paint_core->curpressure; diff --git a/app/tools/eraser.h b/app/tools/eraser.h index cdf728f85d..5a94a4c044 100644 --- a/app/tools/eraser.h +++ b/app/tools/eraser.h @@ -15,17 +15,26 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __ERASER_H__ #define __ERASER_H__ -#include "paint_core.h" -#include "tools.h" -void * eraser_paint_func (PaintCore *, GimpDrawable *, int); -gboolean eraser_non_gui (GimpDrawable *, int, double *, int, int, int); -gboolean eraser_non_gui_default (GimpDrawable *, int, double *); +void * eraser_paint_func (PaintCore *, + GimpDrawable *, + gint ); +gboolean eraser_non_gui (GimpDrawable *, + gint , + gdouble *, + gint , + gint , + gint ); +gboolean eraser_non_gui_default (GimpDrawable *, + gint , + gdouble *); + +Tool * tools_new_eraser (void ); +void tools_free_eraser (Tool *); -Tool * tools_new_eraser (void); -void tools_free_eraser (Tool *); #endif /* __ERASER_H__ */ diff --git a/app/tools/flip_tool.c b/app/tools/flip_tool.c index 22c97be367..c6db3abda3 100644 --- a/app/tools/flip_tool.c +++ b/app/tools/flip_tool.c @@ -31,13 +31,21 @@ #include "flip_tool.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "gimpui.h" +#include "paint_funcs.h" #include "path_transform.h" - -#include "tile_manager_pvt.h" /* ick. */ +#include "pixel_region.h" +#include "temp_buf.h" +#include "tile_manager.h" +#include "tile_manager_pvt.h" +#include "tools.h" +#include "tool_options.h" +#include "transform_core.h" #include "libgimp/gimpintl.h" + #define FLIP_INFO 0 /* the flip structures */ @@ -145,20 +153,20 @@ flip_tool_transform (Tool *tool, switch (state) { - case INIT: + case TRANSFORM_INIT: transform_info = NULL; break; - case MOTION: + case TRANSFORM_MOTION: break; - case RECALC: + case TRANSFORM_RECALC: break; - case FINISH: + case TRANSFORM_FINISH: /* transform_core->trans_info[FLIP] *= -1.0;*/ return flip_tool_flip (gdisp->gimage, - gimage_active_drawable (gdisp->gimage), + gimp_image_active_drawable (gdisp->gimage), transform_core->original, (int) transform_core->trans_info[FLIP_INFO], flip_options->type); @@ -179,7 +187,7 @@ flip_cursor_update (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; - if ((drawable = gimage_active_drawable (gdisp->gimage))) + if ((drawable = gimp_image_active_drawable (gdisp->gimage))) { gint x, y; gint off_x, off_y; @@ -250,16 +258,25 @@ flip_tool_flip (GimpImage *gimage, { TileManager *new; PixelRegion srcPR, destPR; - gint i; + gint orig_width; + gint orig_height; + gint orig_bpp; + gint i; - if (!orig) + if (! orig) return NULL; + orig_width = tile_manager_level_width (orig); + orig_height = tile_manager_level_height (orig); + orig_bpp = tile_manager_level_bpp (orig); + if (flip > 0) { - new = tile_manager_new (orig->width, orig->height, orig->bpp); - pixel_region_init (&srcPR, orig, 0, 0, orig->width, orig->height, FALSE); - pixel_region_init (&destPR, new, 0, 0, orig->width, orig->height, TRUE); + new = tile_manager_new (orig_width, orig_height, orig_bpp); + pixel_region_init (&srcPR, orig, + 0, 0, orig_width, orig_height, FALSE); + pixel_region_init (&destPR, new, + 0, 0, orig_width, orig_height, TRUE); copy_region (&srcPR, &destPR); new->x = orig->x; @@ -267,24 +284,24 @@ flip_tool_flip (GimpImage *gimage, } else { - new = tile_manager_new (orig->width, orig->height, orig->bpp); + new = tile_manager_new (orig_width, orig_height, orig_bpp); new->x = orig->x; new->y = orig->y; if (type == ORIENTATION_HORIZONTAL) for (i = 0; i < orig->width; i++) { - pixel_region_init (&srcPR, orig, i, 0, 1, orig->height, FALSE); + pixel_region_init (&srcPR, orig, i, 0, 1, orig_height, FALSE); pixel_region_init (&destPR, new, - (orig->width - i - 1), 0, 1, orig->height, TRUE); + (orig_width - i - 1), 0, 1, orig_height, TRUE); copy_region (&srcPR, &destPR); } else for (i = 0; i < orig->height; i++) { - pixel_region_init (&srcPR, orig, 0, i, orig->width, 1, FALSE); + pixel_region_init (&srcPR, orig, 0, i, orig_width, 1, FALSE); pixel_region_init (&destPR, new, - 0, (orig->height - i - 1), orig->width, 1, TRUE); + 0, (orig_height - i - 1), orig_width, 1, TRUE); copy_region (&srcPR, &destPR); } diff --git a/app/tools/flip_tool.h b/app/tools/flip_tool.h index 6ead0b5ac9..0f74a6bb3b 100644 --- a/app/tools/flip_tool.h +++ b/app/tools/flip_tool.h @@ -15,13 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __FLIP_TOOL_H__ #define __FLIP_TOOL_H__ -#include "tools.h" -#include "transform_core.h" - -/* Flip tool functions */ TileManager * flip_tool_transform (Tool *tool, gpointer gdisp_ptr, @@ -36,4 +33,5 @@ TileManager * flip_tool_flip (GimpImage *gimage, Tool * tools_new_flip (void); void tools_free_flip_tool (Tool *tool); + #endif /* __FLIP_TOOL_H__ */ diff --git a/app/tools/free_select.c b/app/tools/free_select.c index 5f0313cc31..fb7de4eb17 100644 --- a/app/tools/free_select.c +++ b/app/tools/free_select.c @@ -21,21 +21,25 @@ #include #include -#include +#include #include "apptypes.h" #include "appenv.h" +#include "channel.h" #include "draw_core.h" #include "edit_selection.h" #include "errors.h" #include "floating_sel.h" #include "free_select.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "gdisplay.h" #include "rect_select.h" #include "selection_options.h" #include "scan_convert.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpmath.h" @@ -142,12 +146,12 @@ free_select (GImage *gimage, if (mask) { if (feather) - channel_feather (mask, gimage_get_mask (gimage), + channel_feather (mask, gimp_image_get_mask (gimage), feather_radius, feather_radius, op, 0, 0); else - channel_combine_mask (gimage_get_mask (gimage), + channel_combine_mask (gimp_image_get_mask (gimage), mask, op, 0, 0); channel_delete (mask); } @@ -219,8 +223,8 @@ free_select_button_release (Tool *tool, if (free_sel->op == SELECTION_ANCHOR) { /* If there is a floating selection, anchor it */ - if (gimage_floating_sel (gdisp->gimage)) - floating_sel_anchor (gimage_floating_sel (gdisp->gimage)); + if (gimp_image_floating_sel (gdisp->gimage)) + floating_sel_anchor (gimp_image_floating_sel (gdisp->gimage)); /* Otherwise, clear the selection mask */ else gimage_mask_clear (gdisp->gimage); diff --git a/app/tools/free_select.h b/app/tools/free_select.h index a1dc6b8a27..98fd07dfd1 100644 --- a/app/tools/free_select.h +++ b/app/tools/free_select.h @@ -19,14 +19,18 @@ #ifndef __FREE_SELECT_H__ #define __FREE_SELECT_H__ -#include "scan_convert.h" - /* free select action functions */ -void free_select_button_press (Tool *, GdkEventButton *, gpointer); -void free_select_button_release (Tool *, GdkEventButton *, gpointer); -void free_select_motion (Tool *, GdkEventMotion *, gpointer); +void free_select_button_press (Tool *tool, + GdkEventButton *bevent, + gpointer gdisp_ptr); +void free_select_button_release (Tool *tool, + GdkEventButton *bevent, + gpointer gdisp_ptr); +void free_select_motion (Tool *tool, + GdkEventMotion *mevent, + gpointer gdisp_ptr); /* free select functions */ diff --git a/app/tools/fuzzy_select.c b/app/tools/fuzzy_select.c index cf66542ce2..906acff785 100644 --- a/app/tools/fuzzy_select.c +++ b/app/tools/fuzzy_select.c @@ -26,26 +26,34 @@ #include "appenv.h" #include "boundary.h" +#include "channel.h" #include "cursorutil.h" #include "draw_core.h" #include "drawable.h" #include "edit_selection.h" #include "fuzzy_select.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "gimprc.h" #include "gimpui.h" #include "gdisplay.h" +#include "pixel_region.h" #include "rect_select.h" #include "selection_options.h" - -#include "tile.h" /* ick. */ +#include "tile_manager.h" +#include "tile.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpmath.h" + #include "libgimp/gimpintl.h" + /* the fuzzy selection structures */ typedef struct _FuzzySelect FuzzySelect; + struct _FuzzySelect { DrawCore *core; /* Core select object */ @@ -302,9 +310,9 @@ find_contiguous_region (GImage *gimage, if (sample_merged) { - pixel_region_init (&srcPR, gimage_composite (gimage), 0, 0, + pixel_region_init (&srcPR, gimp_image_composite (gimage), 0, 0, gimage->width, gimage->height, FALSE); - type = gimage_composite_type (gimage); + type = gimp_image_composite_type (gimage); has_alpha = (type == RGBA_GIMAGE || type == GRAYA_GIMAGE || type == INDEXEDA_GIMAGE); @@ -353,7 +361,7 @@ fuzzy_select (GImage *gimage, gint off_x, off_y; /* if applicable, replace the current selection */ - if (op == REPLACE) + if (op == CHANNEL_OP_REPLACE) gimage_mask_clear (gimage); else gimage_mask_undo (gimage); @@ -364,12 +372,12 @@ fuzzy_select (GImage *gimage, off_x = off_y = 0; if (feather) - channel_feather (fuzzy_mask, gimage_get_mask (gimage), + channel_feather (fuzzy_mask, gimp_image_get_mask (gimage), feather_radius, feather_radius, op, off_x, off_y); else - channel_combine_mask (gimage_get_mask (gimage), + channel_combine_mask (gimp_image_get_mask (gimage), fuzzy_mask, op, off_x, off_y); /* free the fuzzy region struct */ @@ -446,7 +454,7 @@ fuzzy_select_button_release (Tool *tool, if (! (bevent->state & GDK_BUTTON3_MASK)) { drawable = (fuzzy_options->sample_merged ? - NULL : gimage_active_drawable (gdisp->gimage)); + NULL : gimp_image_active_drawable (gdisp->gimage)); fuzzy_select (gdisp->gimage, drawable, fuzzy_sel->op, fuzzy_options->feather, @@ -531,7 +539,7 @@ fuzzy_select_calculate (Tool *tool, fuzzy_sel = (FuzzySelect *) tool->private; gdisp = (GDisplay *) gdisp_ptr; - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); gimp_add_busy_cursors (); diff --git a/app/tools/fuzzy_select.h b/app/tools/fuzzy_select.h index 5e3240d533..0211a4b81f 100644 --- a/app/tools/fuzzy_select.h +++ b/app/tools/fuzzy_select.h @@ -15,17 +15,17 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __FUZZY_SELECT_H__ #define __FUZZY_SELECT_H__ -#include "gimage.h" -#include "tools.h" extern Channel *fuzzy_mask; + /* fuzzy select functions */ Tool * tools_new_fuzzy_select (void); -void tools_free_fuzzy_select (Tool *tool); +void tools_free_fuzzy_select (Tool *tool); /* functions */ Channel * find_contiguous_region (GimpImage *gimage, @@ -41,4 +41,5 @@ void fuzzy_select (GimpImage *gimage, gboolean feather, gdouble feather_radius); + #endif /* __FUZZY_SELECT_H__ */ diff --git a/app/tools/gimpairbrushtool.c b/app/tools/gimpairbrushtool.c index 3a518af92a..e12e0d2fd4 100644 --- a/app/tools/gimpairbrushtool.c +++ b/app/tools/gimpairbrushtool.c @@ -28,11 +28,14 @@ #include "gdisplay.h" #include "gradient.h" #include "gimage.h" +#include "gimpbrush.h" +#include "gimpcontext.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" #include "paint_options.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" #include "libgimp/gimpintl.h" @@ -295,10 +298,10 @@ airbrush_motion (PaintCore *paint_core, double pressure, PaintApplicationMode mode) { - GImage *gimage; - TempBuf * area; - unsigned char col[MAX_CHANNELS]; - gdouble scale; + GImage *gimage; + TempBuf *area; + guchar col[MAX_CHANNELS]; + gdouble scale; if (!drawable) return; diff --git a/app/tools/gimpairbrushtool.h b/app/tools/gimpairbrushtool.h index adae83e6c7..ea4e64954b 100644 --- a/app/tools/gimpairbrushtool.h +++ b/app/tools/gimpairbrushtool.h @@ -15,17 +15,23 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __AIRBRUSH_H__ #define __AIRBRUSH_H__ -#include "tools.h" -#include "paint_core.h" -void * airbrush_paint_func (PaintCore *, GimpDrawable *, int); -gboolean airbrush_non_gui (GimpDrawable *, double, int, double *); -gboolean airbrush_non_gui_default (GimpDrawable *, int, double *); -Tool * tools_new_airbrush (void); -void tools_free_airbrush (Tool *); +void * airbrush_paint_func (PaintCore *, + GimpDrawable *, + gint); +gboolean airbrush_non_gui (GimpDrawable *, + gdouble, + gint, + gdouble *); +gboolean airbrush_non_gui_default (GimpDrawable *, + gint, + gdouble *); +Tool * tools_new_airbrush (void); +void tools_free_airbrush (Tool *); #endif /* __AIRBRUSH_H__ */ diff --git a/app/tools/gimpblendtool.c b/app/tools/gimpblendtool.c index 1f47c174e6..ebb5915c43 100644 --- a/app/tools/gimpblendtool.c +++ b/app/tools/gimpblendtool.c @@ -33,16 +33,22 @@ #include "errors.h" #include "fuzzy_select.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimage_mask.h" +#include "gimpcontext.h" #include "gimpdnd.h" +#include "gimpprogress.h" #include "gimpui.h" #include "gradient.h" +#include "paint_funcs.h" #include "paint_options.h" +#include "pixel_region.h" #include "selection.h" #include "tools.h" #include "undo.h" #include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpcolorspace.h" #include "libgimp/gimpmath.h" @@ -434,7 +440,7 @@ blend_button_press (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; blend_tool = (BlendTool *) tool->private; - switch (drawable_type (gimage_active_drawable (gdisp->gimage))) + switch (drawable_type (gimp_image_active_drawable (gdisp->gimage))) { case INDEXED_GIMAGE: case INDEXEDA_GIMAGE: g_message (_("Blend: Invalid for indexed images.")); @@ -506,7 +512,7 @@ blend_button_release (Tool *tool, return_vals = procedural_db_run_proc ("gimp_blend", &nreturn_vals, - PDB_DRAWABLE, drawable_ID (gimage_active_drawable (gimage)), + PDB_DRAWABLE, drawable_ID (gimp_image_active_drawable (gimage)), PDB_INT32, (gint32) blend_options->blend_mode, PDB_INT32, (gint32) PAINT_OPTIONS_GET_PAINT_MODE (blend_options), PDB_INT32, (gint32) blend_options->gradient_type, @@ -534,7 +540,7 @@ blend_button_release (Tool *tool, progress = progress_start (gdisp, _("Blending..."), FALSE, NULL, NULL); blend (gimage, - gimage_active_drawable (gimage), + gimp_image_active_drawable (gimage), blend_options->blend_mode, gimp_context_get_paint_mode (NULL), blend_options->gradient_type, @@ -642,7 +648,7 @@ blend_cursor_update (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; - switch (drawable_type (gimage_active_drawable (gdisp->gimage))) + switch (drawable_type (gimp_image_active_drawable (gdisp->gimage))) { case INDEXED_GIMAGE: case INDEXEDA_GIMAGE: @@ -800,8 +806,8 @@ blend (GImage *gimage, progress_callback, progress_data); pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE); - gimage_apply_image (gimage, drawable, &bufPR, TRUE, - (opacity * 255) / 100, paint_mode, NULL, x1, y1); + gimp_image_apply_image (gimage, drawable, &bufPR, TRUE, + (opacity * 255) / 100, paint_mode, NULL, x1, y1); /* update the image */ drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1)); @@ -1186,14 +1192,14 @@ gradient_precalc_shapeburst (GImage *gimage, if (! gimage_mask_is_empty (gimage)) { PixelRegion maskR; - int x1, y1, x2, y2; - int offx, offy; + gint x1, y1, x2, y2; + gint offx, offy; drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2); drawable_offsets (drawable, &offx, &offy); /* the selection mask */ - mask = gimage_get_mask (gimage); + mask = gimp_image_get_mask (gimage); pixel_region_init (&maskR, drawable_data (GIMP_DRAWABLE(mask)), x1 + offx, y1 + offy, (x2 - x1), (y2 - y1), FALSE); diff --git a/app/tools/gimpblendtool.h b/app/tools/gimpblendtool.h index 66b7b1bf7e..3c25e17344 100644 --- a/app/tools/gimpblendtool.h +++ b/app/tools/gimpblendtool.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __BLEND_H__ #define __BLEND_H__ -#include "gimpprogress.h" -#include "tools.h" typedef enum { @@ -54,11 +53,26 @@ typedef enum REPEAT_LAST /*< skip >*/ } RepeatMode; -void blend (GimpImage *, GimpDrawable *, BlendMode, int, GradientType, - double, double, RepeatMode, int, int, double, double, - double, double, double, progress_func_t, void *); +void blend (GimpImage *, + GimpDrawable *, + BlendMode, + gint, + GradientType, + gdouble, + gdouble, + RepeatMode, + gint, + gint, + gdouble, + gdouble, + gdouble, + gdouble, + gdouble, + progress_func_t, + gpointer); + +Tool * tools_new_blend (void); +void tools_free_blend (Tool *tool); -Tool * tools_new_blend (void); -void tools_free_blend (Tool *); #endif /* __BLEND_H__ */ diff --git a/app/tools/gimpbrightnesscontrasttool.c b/app/tools/gimpbrightnesscontrasttool.c index 71da9a888e..20a16dcbc3 100644 --- a/app/tools/gimpbrightnesscontrasttool.c +++ b/app/tools/gimpbrightnesscontrasttool.c @@ -25,11 +25,15 @@ #include "appenv.h" #include "brightness_contrast.h" #include "drawable.h" +#include "gimpcontext.h" #include "gimplut.h" #include "gimpui.h" #include "gdisplay.h" +#include "gimpimage.h" #include "image_map.h" #include "lut_funcs.h" +#include "tool_options.h" +#include "tools.h" #include "libgimp/gimpintl.h" @@ -170,7 +174,7 @@ tools_free_brightness_contrast (Tool *tool) void brightness_contrast_initialize (GDisplay *gdisp) { - if (drawable_indexed (gimage_active_drawable (gdisp->gimage))) + if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Brightness-Contrast does not operate on indexed drawables.")); return; @@ -186,7 +190,8 @@ brightness_contrast_initialize (GDisplay *gdisp) brightness_contrast_dialog->brightness = 0.0; brightness_contrast_dialog->contrast = 0.0; - brightness_contrast_dialog->drawable = gimage_active_drawable (gdisp->gimage); + brightness_contrast_dialog->drawable = + gimp_image_active_drawable (gdisp->gimage); brightness_contrast_dialog->image_map = image_map_create (gdisp, brightness_contrast_dialog->drawable); diff --git a/app/tools/gimpbrightnesscontrasttool.h b/app/tools/gimpbrightnesscontrasttool.h index 82ff8ce7d7..41e909dc68 100644 --- a/app/tools/gimpbrightnesscontrasttool.h +++ b/app/tools/gimpbrightnesscontrasttool.h @@ -15,10 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __BRIGHTNESS_CONTRAST_H__ #define __BRIGHTNESS_CONTRAST_H__ -#include "tools.h" Tool * tools_new_brightness_contrast (void); void tools_free_brightness_contrast (Tool *tool); @@ -27,4 +27,5 @@ void brightness_contrast_dialog_hide (void); void brightness_contrast_initialize (GDisplay *gdisp); + #endif /* __BRIGHTNESS_CONTRAST_H__ */ diff --git a/app/tools/gimpbucketfilltool.c b/app/tools/gimpbucketfilltool.c index b2313e810c..d227994b71 100644 --- a/app/tools/gimpbucketfilltool.c +++ b/app/tools/gimpbucketfilltool.c @@ -25,24 +25,34 @@ #include "appenv.h" #include "bucket_fill.h" +#include "channel.h" #include "cursorutil.h" #include "drawable.h" #include "fuzzy_select.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimage_mask.h" +#include "gimpcontext.h" #include "gimprc.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_options.h" +#include "patterns.h" +#include "pixel_region.h" +#include "procedural_db.h" #include "selection.h" +#include "temp_buf.h" +#include "tile_manager.h" #include "tools.h" #include "undo.h" #include "libgimp/gimpintl.h" + /* the bucket fill structures */ typedef struct _BucketTool BucketTool; + struct _BucketTool { gint target_x; /* starting x coord */ @@ -50,6 +60,7 @@ struct _BucketTool }; typedef struct _BucketOptions BucketOptions; + struct _BucketOptions { PaintOptions paint_options; @@ -232,7 +243,7 @@ bucket_fill_button_release (Tool *tool, return_vals = procedural_db_run_proc ("gimp_bucket_fill", &nreturn_vals, - PDB_DRAWABLE, drawable_ID (gimage_active_drawable (gdisp->gimage)), + PDB_DRAWABLE, drawable_ID (gimp_image_active_drawable (gdisp->gimage)), PDB_INT32, (gint32) bucket_options->fill_mode, PDB_INT32, (gint32) gimp_context_get_paint_mode (NULL), PDB_FLOAT, (gdouble) gimp_context_get_opacity (NULL) * 100, @@ -269,7 +280,7 @@ bucket_fill_cursor_update (Tool *tool, gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, FALSE, FALSE); - if ((layer = gimage_get_active_layer (gdisp->gimage))) + if ((layer = gimp_image_get_active_layer (gdisp->gimage))) { drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y); @@ -360,9 +371,9 @@ bucket_fill (GimpImage *gimage, pat_buf = NULL; if (fill_mode == FG_BUCKET_FILL) - gimage_get_foreground (gimage, drawable, col); + gimp_image_get_foreground (gimage, drawable, col); else if (fill_mode == BG_BUCKET_FILL) - gimage_get_background (gimage, drawable, col); + gimp_image_get_background (gimage, drawable, col); else if (fill_mode == PATTERN_BUCKET_FILL) { pattern = gimp_context_get_pattern (NULL); @@ -392,8 +403,8 @@ bucket_fill (GimpImage *gimage, size = pattern->mask->width * pattern->mask->height; while (size--) { - gimage_transform_color (gimage, drawable, d1, d2, - (pattern->mask->bytes == 3) ? RGB : GRAY); + gimp_image_transform_color (gimage, drawable, d1, d2, + (pattern->mask->bytes == 3) ? RGB : GRAY); d1 += pattern->mask->bytes; d2 += pat_buf->bytes; } @@ -464,8 +475,8 @@ bucket_fill (GimpImage *gimage, bucket_fill_region (fill_mode, &bufPR, NULL, col, pat_buf, x1, y1, has_alpha); pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE); - gimage_apply_image (gimage, drawable, &bufPR, TRUE, - (opacity * 255) / 100, paint_mode, NULL, x1, y1); + gimp_image_apply_image (gimage, drawable, &bufPR, TRUE, + (opacity * 255) / 100, paint_mode, NULL, x1, y1); /* update the image */ drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1)); diff --git a/app/tools/gimpbucketfilltool.h b/app/tools/gimpbucketfilltool.h index e4ad5e485a..195b5098fd 100644 --- a/app/tools/gimpbucketfilltool.h +++ b/app/tools/gimpbucketfilltool.h @@ -19,8 +19,6 @@ #ifndef __BUCKET_FILL_H__ #define __BUCKET_FILL_H__ -#include "tools.h" - typedef enum { @@ -29,27 +27,28 @@ typedef enum PATTERN_BUCKET_FILL } BucketFillMode; -void bucket_fill (GimpImage *gimage, - GimpDrawable *drawable, - BucketFillMode fill_mode, - gint paint_mode, - gdouble opacity, - gdouble threshold, - gboolean sample_merged, - gdouble x, - gdouble y); -void bucket_fill_region (BucketFillMode fill_mode, - PixelRegion *bufPR, - PixelRegion *maskPR, - guchar *col, - TempBuf *pattern, - gint off_x, - gint off_y, - gboolean has_alpha); +void bucket_fill (GimpImage *gimage, + GimpDrawable *drawable, + BucketFillMode fill_mode, + gint paint_mode, + gdouble opacity, + gdouble threshold, + gboolean sample_merged, + gdouble x, + gdouble y); -Tool * tools_new_bucket_fill (void); -void tools_free_bucket_fill (Tool *tool); +void bucket_fill_region (BucketFillMode fill_mode, + PixelRegion *bufPR, + PixelRegion *maskPR, + guchar *col, + TempBuf *pattern, + gint off_x, + gint off_y, + gboolean has_alpha); + +Tool * tools_new_bucket_fill (void); +void tools_free_bucket_fill (Tool *tool); #endif /* __BUCKET_FILL_H__ */ diff --git a/app/tools/gimpbycolorselecttool.c b/app/tools/gimpbycolorselecttool.c index f8195ac06f..45210650c9 100644 --- a/app/tools/gimpbycolorselecttool.c +++ b/app/tools/gimpbycolorselecttool.c @@ -26,21 +26,29 @@ #include "appenv.h" #include "boundary.h" #include "by_color_select.h" +#include "channel.h" #include "cursorutil.h" #include "drawable.h" #include "draw_core.h" #include "gimage_mask.h" #include "gimpdnd.h" +#include "gimpimage.h" #include "gimprc.h" #include "gimpset.h" #include "gimpui.h" #include "gdisplay.h" +#include "paint_funcs.h" +#include "pixel_region.h" #include "selection_options.h" - -#include "tile.h" /* ick. */ +#include "temp_buf.h" +#include "tile.h" +#include "tile_manager.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpintl.h" + #define PREVIEW_WIDTH 256 #define PREVIEW_HEIGHT 256 #define PREVIEW_EVENT_MASK GDK_EXPOSURE_MASK | \ @@ -204,15 +212,15 @@ by_color_select_color (GImage *gimage, /* Get the image information */ if (sample_merged) { - bytes = gimage_composite_bytes (gimage); - d_type = gimage_composite_type (gimage); + bytes = gimp_image_composite_bytes (gimage); + d_type = gimp_image_composite_type (gimage); has_alpha = (d_type == RGBA_GIMAGE || d_type == GRAYA_GIMAGE || d_type == INDEXEDA_GIMAGE); indexed = d_type == INDEXEDA_GIMAGE || d_type == INDEXED_GIMAGE; width = gimage->width; height = gimage->height; - pixel_region_init (&imagePR, gimage_composite (gimage), + pixel_region_init (&imagePR, gimp_image_composite (gimage), 0, 0, width, height, FALSE); } else @@ -259,7 +267,7 @@ by_color_select_color (GImage *gimage, for (j = 0; j < imagePR.w; j++) { /* Get the rgb values for the color */ - gimage_get_color (gimage, d_type, rgb, idata); + gimp_image_get_color (gimage, d_type, rgb, idata); /* Plug the alpha channel in there */ if (has_alpha) @@ -318,12 +326,12 @@ by_color_select (GImage *gimage, drawable_offsets (drawable, &off_x, &off_y); if (feather) - channel_feather (new_mask, gimage_get_mask (gimage), + channel_feather (new_mask, gimp_image_get_mask (gimage), feather_radius, feather_radius, op, off_x, off_y); else - channel_combine_mask (gimage_get_mask (gimage), + channel_combine_mask (gimp_image_get_mask (gimage), new_mask, op, off_x, off_y); channel_delete (new_mask); @@ -342,7 +350,7 @@ by_color_select_button_press (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; by_color_sel = (ByColorSelect *) tool->private; - tool->drawable = gimage_active_drawable (gdisp->gimage); + tool->drawable = gimp_image_active_drawable (gdisp->gimage); if (!by_color_dialog) return; @@ -396,7 +404,7 @@ by_color_select_button_release (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; by_color_sel = (ByColorSelect *) tool->private; - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); gdk_pointer_ungrab (bevent->time); @@ -462,7 +470,7 @@ by_color_select_cursor_update (Tool *tool, &x, &y, FALSE, FALSE); if (by_color_options->sample_merged || - ((layer = gimage_pick_correlate_layer (gdisp->gimage, x, y)) && + ((layer = gimp_image_pick_correlate_layer (gdisp->gimage, x, y)) && layer == gdisp->gimage->active_layer)) { switch (by_col_sel->operation) @@ -878,7 +886,7 @@ by_color_select_render (ByColorDialog *bcd, gint i; gint scale; - mask = gimage_get_mask (gimage); + mask = gimp_image_get_mask (gimage); if ((drawable_width (GIMP_DRAWABLE(mask)) > PREVIEW_WIDTH) || (drawable_height (GIMP_DRAWABLE(mask)) > PREVIEW_HEIGHT)) { @@ -986,7 +994,7 @@ by_color_select_draw (ByColorDialog *bcd, /* Update the gimage label to reflect the displayed gimage name */ gtk_label_set_text (GTK_LABEL (bcd->gimage_name), - g_basename (gimage_filename (gimage))); + g_basename (gimp_image_filename (gimage))); } static gint @@ -1032,7 +1040,7 @@ by_color_select_invert_callback (GtkWidget *widget, return; /* check if the image associated to the mask still exists */ - if (!drawable_gimage (GIMP_DRAWABLE (gimage_get_mask (bcd->gimage)))) + if (!drawable_gimage (GIMP_DRAWABLE (gimp_image_get_mask (bcd->gimage)))) return; /* invert the mask */ @@ -1058,7 +1066,7 @@ by_color_select_select_all_callback (GtkWidget *widget, return; /* check if the image associated to the mask still exists */ - if (!drawable_gimage (GIMP_DRAWABLE (gimage_get_mask (bcd->gimage)))) + if (!drawable_gimage (GIMP_DRAWABLE (gimp_image_get_mask (bcd->gimage)))) return; /* fill the mask */ @@ -1084,7 +1092,7 @@ by_color_select_select_none_callback (GtkWidget *widget, return; /* check if the image associated to the mask still exists */ - if (!drawable_gimage (GIMP_DRAWABLE (gimage_get_mask (bcd->gimage)))) + if (!drawable_gimage (GIMP_DRAWABLE (gimp_image_get_mask (bcd->gimage)))) return; /* reset the mask */ @@ -1129,7 +1137,7 @@ by_color_select_preview_button_press (ByColorDialog *bcd, if (!bcd->gimage) return; - drawable = gimage_active_drawable (bcd->gimage); + drawable = gimp_image_active_drawable (bcd->gimage); /* check if the gimage associated to the drawable still exists */ if (!drawable_gimage (drawable)) @@ -1161,7 +1169,7 @@ by_color_select_preview_button_press (ByColorDialog *bcd, y = bcd->gimage->height * bevent->y / bcd->preview->requisition.height; if (x < 0 || y < 0 || x >= bcd->gimage->width || y >= bcd->gimage->height) return; - tile = tile_manager_get_tile (gimage_composite (bcd->gimage), + tile = tile_manager_get_tile (gimp_image_composite (bcd->gimage), x, y, TRUE, FALSE); col = tile_data_pointer (tile, x % TILE_WIDTH, y % TILE_HEIGHT); } @@ -1205,12 +1213,12 @@ by_color_select_color_drop (GtkWidget *widget, gpointer data) { - GimpDrawable *drawable; + GimpDrawable *drawable; ByColorDialog *bcd; - guchar col[3]; + guchar col[3]; bcd = (ByColorDialog*) data; - drawable = gimage_active_drawable (bcd->gimage); + drawable = gimp_image_active_drawable (bcd->gimage); col[0] = r; col[1] = g; diff --git a/app/tools/gimpbycolorselecttool.h b/app/tools/gimpbycolorselecttool.h index c1ed753ac2..b75f1145ed 100644 --- a/app/tools/gimpbycolorselecttool.h +++ b/app/tools/gimpbycolorselecttool.h @@ -15,12 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __BY_COLOR_SELECT_H__ #define __BY_COLOR_SELECT_H__ -#include "tools.h" -#include "gdisplayF.h" -#include "gimage.h" Tool * tools_new_by_color_select (void); void tools_free_by_color_select (Tool *tool); @@ -38,4 +36,5 @@ void by_color_select (GimpImage *gimage, gdouble feather_radius, gboolean sample_merged); + #endif /* __BY_COLOR_SELECT_H__ */ diff --git a/app/tools/gimpclonetool.c b/app/tools/gimpclonetool.c index 0db3c5e312..7c16c6f684 100644 --- a/app/tools/gimpclonetool.c +++ b/app/tools/gimpclonetool.c @@ -26,20 +26,27 @@ #include "apptypes.h" #include "appenv.h" +#include "draw_core.h" #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpcontext.h" +#include "gimpimage.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" #include "paint_options.h" +#include "patterns.h" +#include "pixel_region.h" #include "clone.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" #include "cursorutil.h" #include "libgimp/gimpintl.h" + #define TARGET_HEIGHT 15 #define TARGET_WIDTH 15 @@ -325,7 +332,7 @@ clone_cursor_update (Tool *tool, gdisplay_untransform_coords (gdisp, (double) mevent->x, (double) mevent->y, &x, &y, TRUE, FALSE); - if ((layer = gimage_get_active_layer (gdisp->gimage))) + if ((layer = gimp_image_get_active_layer (gdisp->gimage))) { int off_x, off_y; drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y); @@ -602,8 +609,8 @@ clone_line_image (GImage *dest, while (width--) { - gimage_get_color (src, drawable_type (s_drawable), rgb, s); - gimage_transform_color (dest, d_drawable, rgb, d, RGB); + gimp_image_get_color (src, drawable_type (s_drawable), rgb, s); + gimp_image_transform_color (dest, d_drawable, rgb, d, RGB); if (has_alpha) d[dest_alpha] = s[src_alpha]; @@ -625,9 +632,9 @@ clone_line_pattern (GImage *dest, int bytes, int width) { - unsigned char *pat, *p; - int color, alpha; - int i; + guchar *pat, *p; + gint color, alpha; + gint i; /* Make sure x, y are positive */ while (x < 0) @@ -646,7 +653,7 @@ clone_line_pattern (GImage *dest, { p = pat + ((i + x) % pattern->mask->width) * pattern->mask->bytes; - gimage_transform_color (dest, drawable, p, d, color); + gimp_image_transform_color (dest, drawable, p, d, color); d[alpha] = OPAQUE_OPACITY; @@ -659,7 +666,8 @@ clone_non_gui_paint_func (PaintCore *paint_core, GimpDrawable *drawable, int state) { - clone_motion (paint_core, drawable, non_gui_src_drawable, &non_gui_pressure_options, + clone_motion (paint_core, drawable, non_gui_src_drawable, + &non_gui_pressure_options, non_gui_type, non_gui_offset_x, non_gui_offset_y); return NULL; diff --git a/app/tools/gimpclonetool.h b/app/tools/gimpclonetool.h index ca55cfb2cf..0433bc488e 100644 --- a/app/tools/gimpclonetool.h +++ b/app/tools/gimpclonetool.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __CLONE_H__ #define __CLONE_H__ -#include "paint_core.h" -#include "tools.h" typedef enum { @@ -27,11 +26,21 @@ typedef enum PATTERN_CLONE } CloneType; -void * clone_paint_func (PaintCore *, GimpDrawable *, int); -gboolean clone_non_gui (GimpDrawable *, GimpDrawable *, CloneType, - double, double, int, double *); -gboolean clone_non_gui_default (GimpDrawable *, int, double *); -Tool * tools_new_clone (void); -void tools_free_clone (Tool *); +void * clone_paint_func (PaintCore *, + GimpDrawable *, + gint); +gboolean clone_non_gui (GimpDrawable *, + GimpDrawable *, + CloneType, + gdouble, + gdouble, + gint, + gdouble *); +gboolean clone_non_gui_default (GimpDrawable *, + gint, + gdouble *); +Tool * tools_new_clone (void); +void tools_free_clone (Tool *); + #endif /* __CLONE_H__ */ diff --git a/app/tools/gimpcolorbalancetool.c b/app/tools/gimpcolorbalancetool.c index 6eec211d82..b74246cfdc 100644 --- a/app/tools/gimpcolorbalancetool.c +++ b/app/tools/gimpcolorbalancetool.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include "apptypes.h" @@ -27,13 +27,18 @@ #include "color_transfer.h" #include "drawable.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimpui.h" #include "image_map.h" +#include "pixel_region.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpintl.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpcolorspace.h" + #define CYAN_RED 0x1 #define MAGENTA_GREEN 0x2 #define YELLOW_BLUE 0x4 @@ -212,7 +217,7 @@ color_balance_initialize (GDisplay *gdisp) { gint i; - if (! drawable_color (gimage_active_drawable (gdisp->gimage))) + if (! drawable_color (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Color balance operates only on RGB color drawables.")); return; @@ -232,7 +237,7 @@ color_balance_initialize (GDisplay *gdisp) color_balance_dialog->yellow_blue[i] = 0.0; } - color_balance_dialog->drawable = gimage_active_drawable (gdisp->gimage); + color_balance_dialog->drawable = gimp_image_active_drawable (gdisp->gimage); color_balance_dialog->image_map = image_map_create (gdisp, color_balance_dialog->drawable); diff --git a/app/tools/gimpcolorbalancetool.h b/app/tools/gimpcolorbalancetool.h index 72221fdae8..0f14e5fac4 100644 --- a/app/tools/gimpcolorbalancetool.h +++ b/app/tools/gimpcolorbalancetool.h @@ -20,9 +20,6 @@ #define __COLOR_BALANCE_H__ -#include "image_map.h" -#include "tools.h" - typedef enum { SHADOWS, diff --git a/app/tools/gimpconvolvetool.c b/app/tools/gimpconvolvetool.c index 558d2a526b..bcf8bd2580 100644 --- a/app/tools/gimpconvolvetool.c +++ b/app/tools/gimpconvolvetool.c @@ -27,11 +27,15 @@ #include "drawable.h" #include "convolve.h" #include "gdisplay.h" +#include "gimpbrush.h" +#include "gimpcontext.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" #include "paint_options.h" +#include "pixel_region.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" #include "gimage.h" @@ -344,7 +348,8 @@ convolve_motion (PaintCore *paint_core, /* If the brush is smaller than the convolution matrix, don't convolve */ - if((paint_core->brush->mask->width < matrix_size) || (paint_core->brush->mask->height < matrix_size)) + if ((paint_core->brush->mask->width < matrix_size) || + (paint_core->brush->mask->height < matrix_size)) return; if (pressure_options->size) diff --git a/app/tools/gimpconvolvetool.h b/app/tools/gimpconvolvetool.h index e93cdf46d6..3a6058ef5c 100644 --- a/app/tools/gimpconvolvetool.h +++ b/app/tools/gimpconvolvetool.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __CONVOLVE_H__ #define __CONVOLVE_H__ -#include "paint_core.h" -#include "tools.h" typedef enum { @@ -29,10 +28,19 @@ typedef enum } ConvolveType; -void * convolve_paint_func (PaintCore *, GimpDrawable *, int); -gboolean convolve_non_gui (GimpDrawable *, double, ConvolveType, int, double *); -gboolean convolve_non_gui_default (GimpDrawable *, int, double *); -Tool * tools_new_convolve (void); -void tools_free_convolve (Tool *); +void * convolve_paint_func (PaintCore *, + GimpDrawable *, + gint ); +gboolean convolve_non_gui (GimpDrawable *, + gdouble , + ConvolveType , + gint , + gdouble *); +gboolean convolve_non_gui_default (GimpDrawable *, + gint , + gdouble *); +Tool * tools_new_convolve (void ); +void tools_free_convolve (Tool *); + #endif /* __CONVOLVE_H__ */ diff --git a/app/tools/gimpcroptool.c b/app/tools/gimpcroptool.c index ff5de63cf3..a792147af9 100644 --- a/app/tools/gimpcroptool.c +++ b/app/tools/gimpcroptool.c @@ -26,22 +26,29 @@ #include "apptypes.h" #include "appenv.h" +#include "channel.h" #include "crop.h" #include "cursorutil.h" #include "draw_core.h" #include "drawable.h" #include "floating_sel.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimage_mask.h" #include "gimphelp.h" #include "gimpui.h" #include "info_dialog.h" +#include "layer.h" +#include "pixel_region.h" +#include "tools.h" +#include "tool_options.h" #include "undo.h" #include "libgimp/gimpsizeentry.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" + #define STATUSBAR_SIZE 128 /* possible crop functions */ @@ -285,7 +292,7 @@ crop_button_press (Tool *tool, draw_core_stop (crop->core, tool); tool->gdisp_ptr = gdisp_ptr; - tool->drawable = gimage_active_drawable (gdisp->gimage); + tool->drawable = gimp_image_active_drawable (gdisp->gimage); gdisplay_untransform_coords (gdisp, bevent->x, bevent->y, &crop->tx1, &crop->ty1, TRUE, FALSE); @@ -402,14 +409,15 @@ crop_motion (Tool *tool, GdkEventMotion *mevent, gpointer gdisp_ptr) { - Crop * crop; - GDisplay * gdisp; - Layer * layer; - int x1, y1, x2, y2; - int curx, cury; - int inc_x, inc_y; - gchar size[STATUSBAR_SIZE]; - int min_x, min_y, max_x, max_y; + Crop *crop; + GDisplay *gdisp; + Layer *layer; + gint x1, y1, x2, y2; + gint curx, cury; + gint inc_x, inc_y; + gchar size[STATUSBAR_SIZE]; + gint min_x, min_y, max_x, max_y; + crop = (Crop *) tool->private; gdisp = (GDisplay *) gdisp_ptr; @@ -871,7 +879,7 @@ crop_image (GImage *gimage, } else { - floating_layer = gimage_floating_sel (gimage); + floating_layer = gimp_image_floating_sel (gimage); undo_push_group_start (gimage, CROP_UNDO); @@ -930,14 +938,14 @@ crop_image (GImage *gimage, -(lx1 - off_x), -(ly1 - off_y)); else - gimage_remove_layer (gimage, layer); + gimp_image_remove_layer (gimage, layer); } list = next; } /* Make sure the projection matches the gimage size */ - gimage_projection_realloc (gimage); + gimp_image_projection_realloc (gimage); /* rigor the floating layer */ if (floating_layer) @@ -957,7 +965,7 @@ crop_image (GImage *gimage, /* shrink wrap and update all views */ channel_invalidate_previews (gimage); layer_invalidate_previews (gimage); - gimage_invalidate_preview (gimage); + gimp_image_invalidate_preview (gimage); gdisplays_update_full (gimage); gdisplays_shrink_wrap (gimage); } @@ -1287,7 +1295,7 @@ crop_automatic_callback (GtkWidget *widget, if (crop_options->layer_only) { - if (!(active_drawable = gimage_active_drawable (gdisp->gimage))) + if (!(active_drawable = gimp_image_active_drawable (gdisp->gimage))) return; width = drawable_width (GIMP_DRAWABLE (active_drawable)); height = drawable_height (GIMP_DRAWABLE (active_drawable)); diff --git a/app/tools/gimpcroptool.h b/app/tools/gimpcroptool.h index 33be8451bf..b698b95634 100644 --- a/app/tools/gimpcroptool.h +++ b/app/tools/gimpcroptool.h @@ -19,8 +19,6 @@ #ifndef __CROP_H__ #define __CROP_H__ -#include "tools.h" - typedef enum { @@ -29,12 +27,17 @@ typedef enum } CropType; -/* select functions */ -void crop_draw (Tool *); -void crop_image (GimpImage *gimage, int, int, int, int, int, int); +void crop_draw (Tool *tool); +void crop_image (GimpImage *gimage, + gint, + gint, + gint, + gint, + gint, + gint); Tool * tools_new_crop (void); -void tools_free_crop (Tool *); +void tools_free_crop (Tool *tool); #endif /* __CROP_H__ */ diff --git a/app/tools/gimpcurvestool.c b/app/tools/gimpcurvestool.c index 692a2a8a71..7ba6f1ab76 100644 --- a/app/tools/gimpcurvestool.c +++ b/app/tools/gimpcurvestool.c @@ -26,18 +26,24 @@ #include "appenv.h" #include "cursorutil.h" +#include "curves.h" #include "drawable.h" #include "gdisplay.h" #include "gimphistogram.h" +#include "gimpimage.h" #include "gimpui.h" -#include "curves.h" #include "gimplut.h" +#include "image_map.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpenv.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" + #define GRAPH 0x1 #define XRANGE_TOP 0x2 #define XRANGE_BOTTOM 0x4 @@ -284,7 +290,7 @@ curves_button_press (Tool *tool, GimpDrawable *drawable; gdisp = gdisp_ptr; - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); tool->gdisp_ptr = gdisp; @@ -322,7 +328,7 @@ curves_button_release (Tool *tool, if(!curves_dialog || !gdisp || - !(drawable = gimage_active_drawable (gdisp->gimage))) + !(drawable = gimp_image_active_drawable (gdisp->gimage))) return; gdisplay_untransform_coords (gdisp, bevent->x, bevent->y, &x, &y, FALSE, FALSE); @@ -357,9 +363,9 @@ curves_motion (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; - if(!curves_dialog || - !gdisp || - !(drawable = gimage_active_drawable (gdisp->gimage))) + if (! curves_dialog || + ! gdisp || + ! (drawable = gimp_image_active_drawable (gdisp->gimage))) return; gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, FALSE, FALSE); @@ -443,7 +449,7 @@ curves_initialize (GDisplay *gdisp) { gint i, j; - if (drawable_indexed (gimage_active_drawable (gdisp->gimage))) + if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Curves for indexed drawables cannot be adjusted.")); return; @@ -466,7 +472,7 @@ curves_initialize (GDisplay *gdisp) curves_channel_reset (i); } - curves_dialog->drawable = gimage_active_drawable (gdisp->gimage); + curves_dialog->drawable = gimp_image_active_drawable (gdisp->gimage); curves_dialog->color = drawable_color (curves_dialog->drawable); curves_dialog->image_map = image_map_create (gdisp, curves_dialog->drawable); diff --git a/app/tools/gimpcurvestool.h b/app/tools/gimpcurvestool.h index 86daeefd40..d209de2d82 100644 --- a/app/tools/gimpcurvestool.h +++ b/app/tools/gimpcurvestool.h @@ -19,9 +19,6 @@ #ifndef __CURVES_H__ #define __CURVES_H__ -#include "image_map.h" -#include "lut_funcs.h" -#include "tools.h" #define SMOOTH 0 #define GFREE 1 @@ -63,16 +60,17 @@ struct _CurvesDialog GimpLut *lut; }; -Tool * tools_new_curves (void); -void tools_free_curves (Tool *tool); +Tool * tools_new_curves (void); +void tools_free_curves (Tool *tool); + +void curves_dialog_hide (void); +void curves_initialize (GDisplay *gdisp); +void curves_free (void); +gfloat curves_lut_func (CurvesDialog *cd, + gint nchannels, + gint channel, + gfloat value); +void curves_calculate_curve (CurvesDialog *cd); -void curves_dialog_hide (void); -void curves_initialize (GDisplay *gdisp); -void curves_free (void); -float curves_lut_func (CurvesDialog *cd, - gint nchannels, - gint channel, - gfloat value); -void curves_calculate_curve (CurvesDialog *cd); #endif /* __CURVES_H__ */ diff --git a/app/tools/gimpdodgeburntool.c b/app/tools/gimpdodgeburntool.c index c873c16347..8ffe8968ce 100644 --- a/app/tools/gimpdodgeburntool.c +++ b/app/tools/gimpdodgeburntool.c @@ -15,6 +15,7 @@ * 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 @@ -27,11 +28,14 @@ #include "dodgeburn.h" #include "gdisplay.h" #include "gimplut.h" +#include "gimpcontext.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" #include "paint_options.h" +#include "pixel_region.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" #include "gimage.h" diff --git a/app/tools/gimpdodgeburntool.h b/app/tools/gimpdodgeburntool.h index 569ee8e675..341fe445ea 100644 --- a/app/tools/gimpdodgeburntool.h +++ b/app/tools/gimpdodgeburntool.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __DODGEBURN_H__ #define __DODGEBURN_H__ -#include "paint_core.h" -#include "tools.h" typedef enum { @@ -34,10 +33,22 @@ typedef enum DODGEBURN_SHADOWS } DodgeBurnMode; -void * dodgeburn_paint_func (PaintCore *, GimpDrawable *, int); -gboolean dodgeburn_non_gui (GimpDrawable *, double, DodgeBurnType, DodgeBurnMode, int, double *); -gboolean dodgeburn_non_gui_default (GimpDrawable *, int, double *); -Tool * tools_new_dodgeburn (void); -void tools_free_dodgeburn (Tool *); + +void * dodgeburn_paint_func (PaintCore *, + GimpDrawable *, + gint); +gboolean dodgeburn_non_gui (GimpDrawable *, + gdouble, + DodgeBurnType, + DodgeBurnMode, + gint, + gdouble *); +gboolean dodgeburn_non_gui_default (GimpDrawable *, + gint, + gdouble *); + +Tool * tools_new_dodgeburn (void); +void tools_free_dodgeburn (Tool *); + #endif /* __DODGEBURN_H__ */ diff --git a/app/tools/gimpeditselectiontool.c b/app/tools/gimpeditselectiontool.c index 128b96268d..ab759aa00c 100644 --- a/app/tools/gimpeditselectiontool.c +++ b/app/tools/gimpeditselectiontool.c @@ -27,20 +27,25 @@ #include "apptypes.h" #include "appenv.h" +#include "boundary.h" #include "cursorutil.h" #include "draw_core.h" #include "drawable.h" #include "tools.h" #include "edit_selection.h" #include "floating_sel.h" +#include "gimpimage.h" #include "gimage_mask.h" -#include "gdisplay.h" -#include "undo.h" #include "gimprc.h" +#include "gdisplay.h" +#include "layer.h" #include "path_transform.h" +#include "selection.h" +#include "undo.h" + +#include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" -#include "libgimp/gimpmath.h" #define EDIT_SELECT_SCROLL_LOCK FALSE @@ -49,6 +54,7 @@ typedef struct _EditSelection EditSelection; + struct _EditSelection { gint origx, origy; /* last x and y coords */ @@ -149,12 +155,13 @@ init_edit_selection (Tool *tool, &edit_select.num_segs_out); /* Make a check to see if it should be a floating selection translation */ - if (edit_type == EDIT_MASK_TO_LAYER_TRANSLATE && gimage_floating_sel (gdisp->gimage)) + if (edit_type == EDIT_MASK_TO_LAYER_TRANSLATE && + gimp_image_floating_sel (gdisp->gimage)) edit_type = EDIT_FLOATING_SEL_TRANSLATE; if (edit_type == EDIT_LAYER_TRANSLATE) { - layer = gimage_get_active_layer (gdisp->gimage); + layer = gimp_image_get_active_layer (gdisp->gimage); if (layer_is_floating_sel (layer)) edit_type = EDIT_FLOATING_SEL_TRANSLATE; } @@ -175,7 +182,7 @@ init_edit_selection (Tool *tool, * where the translation will result in floating the selection * mask and translating the resulting layer */ - drawable_mask_bounds (gimage_active_drawable (gdisp->gimage), + drawable_mask_bounds (gimp_image_active_drawable (gdisp->gimage), &edit_select.x1, &edit_select.y1, &edit_select.x2, &edit_select.y2); @@ -277,7 +284,7 @@ edit_selection_button_release (Tool *tool, check if the layer is a floating selection. If so, anchor. */ if (edit_select.edit_type == EDIT_FLOATING_SEL_TRANSLATE) { - layer = gimage_get_active_layer (gdisp->gimage); + layer = gimp_image_get_active_layer (gdisp->gimage); if (layer_is_floating_sel (layer)) floating_sel_anchor (layer); } @@ -286,7 +293,7 @@ edit_selection_button_release (Tool *tool, { path_transform_xy (gdisp->gimage, edit_select.cumlx, edit_select.cumly); - layer = gimage_get_active_layer (gdisp->gimage); + layer = gimp_image_get_active_layer (gdisp->gimage); gimp_drawable_invalidate_preview (GIMP_DRAWABLE (layer), TRUE); } @@ -307,9 +314,9 @@ edit_selection_motion (Tool *tool, GdkEventMotion *mevent, gpointer gdisp_ptr) { - GDisplay * gdisp; - gchar offset[STATUSBAR_SIZE]; - gdouble lastmotion_x, lastmotion_y; + GDisplay *gdisp; + gchar offset[STATUSBAR_SIZE]; + gdouble lastmotion_x, lastmotion_y; if (tool->state != ACTIVE) { @@ -368,7 +375,7 @@ edit_selection_motion (Tool *tool, break; case EDIT_LAYER_TRANSLATE: - if ((floating_layer = gimage_floating_sel (gdisp->gimage))) + if ((floating_layer = gimp_image_floating_sel (gdisp->gimage))) floating_sel_relax (floating_layer, TRUE); /* translate the layer--and any "linked" layers as well */ @@ -396,7 +403,7 @@ edit_selection_motion (Tool *tool, case EDIT_MASK_TO_LAYER_TRANSLATE: if (!gimage_mask_float (gdisp->gimage, - gimage_active_drawable (gdisp->gimage), + gimp_image_active_drawable (gdisp->gimage), 0, 0)) { /* no region to float, abort safely */ @@ -420,7 +427,7 @@ edit_selection_motion (Tool *tool, break; case EDIT_FLOATING_SEL_TRANSLATE: - layer = gimage_get_active_layer (gdisp->gimage); + layer = gimp_image_get_active_layer (gdisp->gimage); floating_sel_relax (layer, TRUE); layer_translate (layer, xoffset, yoffset); @@ -504,14 +511,14 @@ selection_transform_segs (GDisplay *gdisp, void edit_selection_draw (Tool *tool) { - GDisplay * gdisp; - Selection * select; - Layer *layer; - GSList *layer_list; - gint floating_sel; - gint x1, y1, x2, y2; - gint x3, y3, x4, y4; - gint off_x, off_y; + GDisplay *gdisp; + Selection *select; + Layer *layer; + GSList *layer_list; + gint floating_sel; + gint x1, y1, x2, y2; + gint x3, y3, x4, y4; + gint off_x, off_y; GdkSegment *segs_copy; gdisp = (GDisplay *) tool->gdisp_ptr; @@ -520,7 +527,7 @@ edit_selection_draw (Tool *tool) switch (edit_select.edit_type) { case EDIT_MASK_TRANSLATE: - layer = gimage_get_active_layer (gdisp->gimage); + layer = gimp_image_get_active_layer (gdisp->gimage); floating_sel = layer_is_floating_sel (layer); if (!floating_sel) @@ -675,17 +682,17 @@ process_event_queue_keys (GdkEventKey *kevent, * by other tools? */ { #define FILTER_MAX_KEYS 50 - va_list argp; - GdkEvent *event; - GList *event_list = NULL; - GList *list; - guint keys[FILTER_MAX_KEYS]; - GdkModifierType modifiers[FILTER_MAX_KEYS]; - gint values[FILTER_MAX_KEYS]; - gint i = 0, nkeys = 0, value = 0; - gboolean done = FALSE; - gboolean discard_event; - GtkWidget *orig_widget; + va_list argp; + GdkEvent *event; + GList *event_list = NULL; + GList *list; + guint keys[FILTER_MAX_KEYS]; + GdkModifierType modifiers[FILTER_MAX_KEYS]; + gint values[FILTER_MAX_KEYS]; + gint i = 0, nkeys = 0, value = 0; + gboolean done = FALSE; + gboolean discard_event; + GtkWidget *orig_widget; va_start (argp, kevent); while (nkeys gimage); + layer = gimp_image_get_active_layer (gdisp->gimage); if (layer_is_floating_sel (layer)) edit_type = EDIT_FLOATING_SEL_TRANSLATE; @@ -832,7 +839,7 @@ edit_sel_arrow_keys_func (Tool *tool, case EDIT_LAYER_TRANSLATE: - if ((floating_layer = gimage_floating_sel (gdisp->gimage))) + if ((floating_layer = gimp_image_floating_sel (gdisp->gimage))) floating_sel_relax (floating_layer, TRUE); /* translate the layer -- and any "linked" layers as well */ diff --git a/app/tools/gimpeditselectiontool.h b/app/tools/gimpeditselectiontool.h index dcd0e851bb..c1e8914d71 100644 --- a/app/tools/gimpeditselectiontool.h +++ b/app/tools/gimpeditselectiontool.h @@ -20,9 +20,6 @@ #define __EDIT_SELECTION_H__ -#include "tools.h" - - typedef enum { EDIT_MASK_TRANSLATE, diff --git a/app/tools/gimpellipseselecttool.c b/app/tools/gimpellipseselecttool.c index fb0f9bb576..b65dd27a06 100644 --- a/app/tools/gimpellipseselecttool.c +++ b/app/tools/gimpellipseselecttool.c @@ -20,19 +20,23 @@ #include -#include +#include #include "apptypes.h" #include "appenv.h" +#include "channel.h" +#include "draw_core.h" #include "edit_selection.h" #include "ellipse_select.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "rect_select.h" -/* private header file for rect_select data structure */ #include "rect_selectP.h" #include "selection_options.h" +#include "tools.h" +#include "tool_options.h" /* the ellipse selection tool options */ @@ -67,8 +71,8 @@ ellipse_select (GimpImage *gimage, if (feather) { new_mask = channel_new_mask (gimage, gimage->width, gimage->height); - channel_combine_ellipse (new_mask, ADD, x, y, w, h, antialias); - channel_feather (new_mask, gimage_get_mask (gimage), + channel_combine_ellipse (new_mask, CHANNEL_OP_ADD, x, y, w, h, antialias); + channel_feather (new_mask, gimp_image_get_mask (gimage), feather_radius, feather_radius, op, 0, 0); @@ -77,12 +81,12 @@ ellipse_select (GimpImage *gimage, else if (op == SELECTION_INTERSECT) { new_mask = channel_new_mask (gimage, gimage->width, gimage->height); - channel_combine_ellipse (new_mask, ADD, x, y, w, h, antialias); - channel_combine_mask (gimage_get_mask (gimage), new_mask, op, 0, 0); + channel_combine_ellipse (new_mask, CHANNEL_OP_ADD, x, y, w, h, antialias); + channel_combine_mask (gimp_image_get_mask (gimage), new_mask, op, 0, 0); channel_delete (new_mask); } else - channel_combine_ellipse (gimage_get_mask (gimage), op, + channel_combine_ellipse (gimp_image_get_mask (gimage), op, x, y, w, h, antialias); } @@ -91,8 +95,8 @@ ellipse_select_draw (Tool *tool) { GDisplay *gdisp; EllipseSelect *ellipse_sel; - gint x1, y1; - gint x2, y2; + gint x1, y1; + gint x2, y2; gdisp = (GDisplay *) tool->gdisp_ptr; ellipse_sel = (EllipseSelect *) tool->private; diff --git a/app/tools/gimpellipseselecttool.h b/app/tools/gimpellipseselecttool.h index 9bde4e105d..cce7e01273 100644 --- a/app/tools/gimpellipseselecttool.h +++ b/app/tools/gimpellipseselecttool.h @@ -19,9 +19,6 @@ #ifndef __ELLIPSE_SELECT_H__ #define __ELLIPSE_SELECT_H__ -#include "tools.h" - -/* ellipse select functions */ void ellipse_select (GimpImage *gimage, gint x, @@ -37,4 +34,5 @@ void ellipse_select_draw (Tool *tool); Tool * tools_new_ellipse_select (void); void tools_free_ellipse_select (Tool *tool); + #endif /* __ELLIPSE_SELECT_H__ */ diff --git a/app/tools/gimperasertool.c b/app/tools/gimperasertool.c index a368d13146..1ffa616c08 100644 --- a/app/tools/gimperasertool.c +++ b/app/tools/gimperasertool.c @@ -28,12 +28,15 @@ #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpcontext.h" +#include "gimpimage.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" #include "paint_options.h" #include "eraser.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" #include "libgimp/gimpintl.h" @@ -229,16 +232,16 @@ eraser_motion (PaintCore *paint_core, gboolean incremental, gboolean anti_erase) { - GImage *gimage; - gint opacity; - TempBuf * area; - unsigned char col[MAX_CHANNELS]; - gdouble scale; + GImage *gimage; + gint opacity; + TempBuf *area; + guchar col[MAX_CHANNELS]; + gdouble scale; if (! (gimage = drawable_gimage (drawable))) return; - gimage_get_background (gimage, drawable, col); + gimp_image_get_background (gimage, drawable, col); if (pressure_options->size) scale = paint_core->curpressure; diff --git a/app/tools/gimperasertool.h b/app/tools/gimperasertool.h index cdf728f85d..5a94a4c044 100644 --- a/app/tools/gimperasertool.h +++ b/app/tools/gimperasertool.h @@ -15,17 +15,26 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __ERASER_H__ #define __ERASER_H__ -#include "paint_core.h" -#include "tools.h" -void * eraser_paint_func (PaintCore *, GimpDrawable *, int); -gboolean eraser_non_gui (GimpDrawable *, int, double *, int, int, int); -gboolean eraser_non_gui_default (GimpDrawable *, int, double *); +void * eraser_paint_func (PaintCore *, + GimpDrawable *, + gint ); +gboolean eraser_non_gui (GimpDrawable *, + gint , + gdouble *, + gint , + gint , + gint ); +gboolean eraser_non_gui_default (GimpDrawable *, + gint , + gdouble *); + +Tool * tools_new_eraser (void ); +void tools_free_eraser (Tool *); -Tool * tools_new_eraser (void); -void tools_free_eraser (Tool *); #endif /* __ERASER_H__ */ diff --git a/app/tools/gimpfliptool.c b/app/tools/gimpfliptool.c index 22c97be367..c6db3abda3 100644 --- a/app/tools/gimpfliptool.c +++ b/app/tools/gimpfliptool.c @@ -31,13 +31,21 @@ #include "flip_tool.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "gimpui.h" +#include "paint_funcs.h" #include "path_transform.h" - -#include "tile_manager_pvt.h" /* ick. */ +#include "pixel_region.h" +#include "temp_buf.h" +#include "tile_manager.h" +#include "tile_manager_pvt.h" +#include "tools.h" +#include "tool_options.h" +#include "transform_core.h" #include "libgimp/gimpintl.h" + #define FLIP_INFO 0 /* the flip structures */ @@ -145,20 +153,20 @@ flip_tool_transform (Tool *tool, switch (state) { - case INIT: + case TRANSFORM_INIT: transform_info = NULL; break; - case MOTION: + case TRANSFORM_MOTION: break; - case RECALC: + case TRANSFORM_RECALC: break; - case FINISH: + case TRANSFORM_FINISH: /* transform_core->trans_info[FLIP] *= -1.0;*/ return flip_tool_flip (gdisp->gimage, - gimage_active_drawable (gdisp->gimage), + gimp_image_active_drawable (gdisp->gimage), transform_core->original, (int) transform_core->trans_info[FLIP_INFO], flip_options->type); @@ -179,7 +187,7 @@ flip_cursor_update (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; - if ((drawable = gimage_active_drawable (gdisp->gimage))) + if ((drawable = gimp_image_active_drawable (gdisp->gimage))) { gint x, y; gint off_x, off_y; @@ -250,16 +258,25 @@ flip_tool_flip (GimpImage *gimage, { TileManager *new; PixelRegion srcPR, destPR; - gint i; + gint orig_width; + gint orig_height; + gint orig_bpp; + gint i; - if (!orig) + if (! orig) return NULL; + orig_width = tile_manager_level_width (orig); + orig_height = tile_manager_level_height (orig); + orig_bpp = tile_manager_level_bpp (orig); + if (flip > 0) { - new = tile_manager_new (orig->width, orig->height, orig->bpp); - pixel_region_init (&srcPR, orig, 0, 0, orig->width, orig->height, FALSE); - pixel_region_init (&destPR, new, 0, 0, orig->width, orig->height, TRUE); + new = tile_manager_new (orig_width, orig_height, orig_bpp); + pixel_region_init (&srcPR, orig, + 0, 0, orig_width, orig_height, FALSE); + pixel_region_init (&destPR, new, + 0, 0, orig_width, orig_height, TRUE); copy_region (&srcPR, &destPR); new->x = orig->x; @@ -267,24 +284,24 @@ flip_tool_flip (GimpImage *gimage, } else { - new = tile_manager_new (orig->width, orig->height, orig->bpp); + new = tile_manager_new (orig_width, orig_height, orig_bpp); new->x = orig->x; new->y = orig->y; if (type == ORIENTATION_HORIZONTAL) for (i = 0; i < orig->width; i++) { - pixel_region_init (&srcPR, orig, i, 0, 1, orig->height, FALSE); + pixel_region_init (&srcPR, orig, i, 0, 1, orig_height, FALSE); pixel_region_init (&destPR, new, - (orig->width - i - 1), 0, 1, orig->height, TRUE); + (orig_width - i - 1), 0, 1, orig_height, TRUE); copy_region (&srcPR, &destPR); } else for (i = 0; i < orig->height; i++) { - pixel_region_init (&srcPR, orig, 0, i, orig->width, 1, FALSE); + pixel_region_init (&srcPR, orig, 0, i, orig_width, 1, FALSE); pixel_region_init (&destPR, new, - 0, (orig->height - i - 1), orig->width, 1, TRUE); + 0, (orig_height - i - 1), orig_width, 1, TRUE); copy_region (&srcPR, &destPR); } diff --git a/app/tools/gimpfliptool.h b/app/tools/gimpfliptool.h index 6ead0b5ac9..0f74a6bb3b 100644 --- a/app/tools/gimpfliptool.h +++ b/app/tools/gimpfliptool.h @@ -15,13 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __FLIP_TOOL_H__ #define __FLIP_TOOL_H__ -#include "tools.h" -#include "transform_core.h" - -/* Flip tool functions */ TileManager * flip_tool_transform (Tool *tool, gpointer gdisp_ptr, @@ -36,4 +33,5 @@ TileManager * flip_tool_flip (GimpImage *gimage, Tool * tools_new_flip (void); void tools_free_flip_tool (Tool *tool); + #endif /* __FLIP_TOOL_H__ */ diff --git a/app/tools/gimpfreeselecttool.c b/app/tools/gimpfreeselecttool.c index 5f0313cc31..fb7de4eb17 100644 --- a/app/tools/gimpfreeselecttool.c +++ b/app/tools/gimpfreeselecttool.c @@ -21,21 +21,25 @@ #include #include -#include +#include #include "apptypes.h" #include "appenv.h" +#include "channel.h" #include "draw_core.h" #include "edit_selection.h" #include "errors.h" #include "floating_sel.h" #include "free_select.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "gdisplay.h" #include "rect_select.h" #include "selection_options.h" #include "scan_convert.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpmath.h" @@ -142,12 +146,12 @@ free_select (GImage *gimage, if (mask) { if (feather) - channel_feather (mask, gimage_get_mask (gimage), + channel_feather (mask, gimp_image_get_mask (gimage), feather_radius, feather_radius, op, 0, 0); else - channel_combine_mask (gimage_get_mask (gimage), + channel_combine_mask (gimp_image_get_mask (gimage), mask, op, 0, 0); channel_delete (mask); } @@ -219,8 +223,8 @@ free_select_button_release (Tool *tool, if (free_sel->op == SELECTION_ANCHOR) { /* If there is a floating selection, anchor it */ - if (gimage_floating_sel (gdisp->gimage)) - floating_sel_anchor (gimage_floating_sel (gdisp->gimage)); + if (gimp_image_floating_sel (gdisp->gimage)) + floating_sel_anchor (gimp_image_floating_sel (gdisp->gimage)); /* Otherwise, clear the selection mask */ else gimage_mask_clear (gdisp->gimage); diff --git a/app/tools/gimpfreeselecttool.h b/app/tools/gimpfreeselecttool.h index a1dc6b8a27..98fd07dfd1 100644 --- a/app/tools/gimpfreeselecttool.h +++ b/app/tools/gimpfreeselecttool.h @@ -19,14 +19,18 @@ #ifndef __FREE_SELECT_H__ #define __FREE_SELECT_H__ -#include "scan_convert.h" - /* free select action functions */ -void free_select_button_press (Tool *, GdkEventButton *, gpointer); -void free_select_button_release (Tool *, GdkEventButton *, gpointer); -void free_select_motion (Tool *, GdkEventMotion *, gpointer); +void free_select_button_press (Tool *tool, + GdkEventButton *bevent, + gpointer gdisp_ptr); +void free_select_button_release (Tool *tool, + GdkEventButton *bevent, + gpointer gdisp_ptr); +void free_select_motion (Tool *tool, + GdkEventMotion *mevent, + gpointer gdisp_ptr); /* free select functions */ diff --git a/app/tools/gimpfuzzyselecttool.c b/app/tools/gimpfuzzyselecttool.c index cf66542ce2..906acff785 100644 --- a/app/tools/gimpfuzzyselecttool.c +++ b/app/tools/gimpfuzzyselecttool.c @@ -26,26 +26,34 @@ #include "appenv.h" #include "boundary.h" +#include "channel.h" #include "cursorutil.h" #include "draw_core.h" #include "drawable.h" #include "edit_selection.h" #include "fuzzy_select.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "gimprc.h" #include "gimpui.h" #include "gdisplay.h" +#include "pixel_region.h" #include "rect_select.h" #include "selection_options.h" - -#include "tile.h" /* ick. */ +#include "tile_manager.h" +#include "tile.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpmath.h" + #include "libgimp/gimpintl.h" + /* the fuzzy selection structures */ typedef struct _FuzzySelect FuzzySelect; + struct _FuzzySelect { DrawCore *core; /* Core select object */ @@ -302,9 +310,9 @@ find_contiguous_region (GImage *gimage, if (sample_merged) { - pixel_region_init (&srcPR, gimage_composite (gimage), 0, 0, + pixel_region_init (&srcPR, gimp_image_composite (gimage), 0, 0, gimage->width, gimage->height, FALSE); - type = gimage_composite_type (gimage); + type = gimp_image_composite_type (gimage); has_alpha = (type == RGBA_GIMAGE || type == GRAYA_GIMAGE || type == INDEXEDA_GIMAGE); @@ -353,7 +361,7 @@ fuzzy_select (GImage *gimage, gint off_x, off_y; /* if applicable, replace the current selection */ - if (op == REPLACE) + if (op == CHANNEL_OP_REPLACE) gimage_mask_clear (gimage); else gimage_mask_undo (gimage); @@ -364,12 +372,12 @@ fuzzy_select (GImage *gimage, off_x = off_y = 0; if (feather) - channel_feather (fuzzy_mask, gimage_get_mask (gimage), + channel_feather (fuzzy_mask, gimp_image_get_mask (gimage), feather_radius, feather_radius, op, off_x, off_y); else - channel_combine_mask (gimage_get_mask (gimage), + channel_combine_mask (gimp_image_get_mask (gimage), fuzzy_mask, op, off_x, off_y); /* free the fuzzy region struct */ @@ -446,7 +454,7 @@ fuzzy_select_button_release (Tool *tool, if (! (bevent->state & GDK_BUTTON3_MASK)) { drawable = (fuzzy_options->sample_merged ? - NULL : gimage_active_drawable (gdisp->gimage)); + NULL : gimp_image_active_drawable (gdisp->gimage)); fuzzy_select (gdisp->gimage, drawable, fuzzy_sel->op, fuzzy_options->feather, @@ -531,7 +539,7 @@ fuzzy_select_calculate (Tool *tool, fuzzy_sel = (FuzzySelect *) tool->private; gdisp = (GDisplay *) gdisp_ptr; - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); gimp_add_busy_cursors (); diff --git a/app/tools/gimpfuzzyselecttool.h b/app/tools/gimpfuzzyselecttool.h index 5e3240d533..0211a4b81f 100644 --- a/app/tools/gimpfuzzyselecttool.h +++ b/app/tools/gimpfuzzyselecttool.h @@ -15,17 +15,17 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __FUZZY_SELECT_H__ #define __FUZZY_SELECT_H__ -#include "gimage.h" -#include "tools.h" extern Channel *fuzzy_mask; + /* fuzzy select functions */ Tool * tools_new_fuzzy_select (void); -void tools_free_fuzzy_select (Tool *tool); +void tools_free_fuzzy_select (Tool *tool); /* functions */ Channel * find_contiguous_region (GimpImage *gimage, @@ -41,4 +41,5 @@ void fuzzy_select (GimpImage *gimage, gboolean feather, gdouble feather_radius); + #endif /* __FUZZY_SELECT_H__ */ diff --git a/app/tools/gimphistogramtool.c b/app/tools/gimphistogramtool.c index 5d31e2fa3f..5cb56d168f 100644 --- a/app/tools/gimphistogramtool.c +++ b/app/tools/gimphistogramtool.c @@ -15,20 +15,29 @@ * 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 #include "apptypes.h" #include "appenv.h" #include "drawable.h" #include "gdisplay.h" +#include "gimpimage.h" +#include "gimphistogram.h" #include "gimpui.h" #include "histogram_tool.h" +#include "histogramwidget.h" +#include "pixel_region.h" +#include "tool_options.h" +#include "tools.h" + +#include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" -#include "libgimp/gimpmath.h" + #define TEXT_WIDTH 45 #define GRADIENT_HEIGHT 15 @@ -204,7 +213,7 @@ histogram_tool_initialize (GDisplay *gdisp) { PixelRegion PR; - if (drawable_indexed (gimage_active_drawable (gdisp->gimage))) + if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Histogram does not operate on indexed drawables.")); return; @@ -216,7 +225,7 @@ histogram_tool_initialize (GDisplay *gdisp) else if (!GTK_WIDGET_VISIBLE (histogram_tool_dialog->shell)) gtk_widget_show (histogram_tool_dialog->shell); - histogram_tool_dialog->drawable = gimage_active_drawable (gdisp->gimage); + histogram_tool_dialog->drawable = gimp_image_active_drawable (gdisp->gimage); histogram_tool_dialog->color = drawable_color (histogram_tool_dialog->drawable); /* hide or show the channel menu based on image type */ diff --git a/app/tools/gimphistogramtool.h b/app/tools/gimphistogramtool.h index 2c8e0c8b40..825d44e25a 100644 --- a/app/tools/gimphistogramtool.h +++ b/app/tools/gimphistogramtool.h @@ -15,14 +15,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __HISTOGRAM_TOOL_H__ #define __HISTOGRAM_TOOL_H__ -#include "histogramwidget.h" -#include "image_map.h" -#include "tools.h" -#define HISTOGRAM_WIDTH 256 +#define HISTOGRAM_WIDTH 256 #define HISTOGRAM_HEIGHT 150 typedef struct _HistogramToolDialog HistogramToolDialog; @@ -61,4 +59,5 @@ void histogram_tool_histogram_range (HistogramWidget *hw, gint end, gpointer data); + #endif /* __HISTOGRAM_TOOL_H__ */ diff --git a/app/tools/gimphuesaturationtool.c b/app/tools/gimphuesaturationtool.c index a02a97b84b..0caf2f0a6f 100644 --- a/app/tools/gimphuesaturationtool.c +++ b/app/tools/gimphuesaturationtool.c @@ -15,9 +15,10 @@ * 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 #include "apptypes.h" @@ -25,8 +26,13 @@ #include "drawable.h" #include "gimage_mask.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimpui.h" #include "hue_saturation.h" +#include "image_map.h" +#include "pixel_region.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpcolorspace.h" #include "libgimp/gimpmath.h" @@ -287,7 +293,7 @@ hue_saturation_initialize (GDisplay *gdisp) { gint i; - if (! drawable_color (gimage_active_drawable (gdisp->gimage))) + if (! drawable_color (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Hue-Saturation operates only on RGB color drawables.")); return; @@ -307,7 +313,7 @@ hue_saturation_initialize (GDisplay *gdisp) hue_saturation_dialog->saturation[i] = 0.0; } - hue_saturation_dialog->drawable = gimage_active_drawable (gdisp->gimage); + hue_saturation_dialog->drawable = gimp_image_active_drawable (gdisp->gimage); hue_saturation_dialog->image_map = image_map_create (gdisp, hue_saturation_dialog->drawable); diff --git a/app/tools/gimphuesaturationtool.h b/app/tools/gimphuesaturationtool.h index b796dba946..80ee176884 100644 --- a/app/tools/gimphuesaturationtool.h +++ b/app/tools/gimphuesaturationtool.h @@ -19,9 +19,6 @@ #ifndef __HUE_SATURATION_H__ #define __HUE_SATURATION_H__ -#include "image_map.h" -#include "tools.h" - typedef enum { @@ -57,16 +54,17 @@ struct _HueSaturationDialog gboolean preview; }; -Tool * tools_new_hue_saturation (void); -void tools_free_hue_saturation (Tool *tool); +Tool * tools_new_hue_saturation (void); +void tools_free_hue_saturation (Tool *tool); -void hue_saturation_initialize (GDisplay *gdisp); -void hue_saturation_free (void); -void hue_saturation_dialog_hide (void); -void hue_saturation (PixelRegion *srcPR, - PixelRegion *destPR, - void *data); +void hue_saturation_initialize (GDisplay *gdisp); +void hue_saturation_free (void); +void hue_saturation_dialog_hide (void); +void hue_saturation (PixelRegion *srcPR, + PixelRegion *destPR, + void *data); + +void hue_saturation_calculate_transfers (HueSaturationDialog *hsd); -void hue_saturation_calculate_transfers (HueSaturationDialog *hsd); #endif /* __HUE_SATURATION_H__ */ diff --git a/app/tools/gimpinktool-blob.h b/app/tools/gimpinktool-blob.h index 6151f607c9..3f7fd96646 100644 --- a/app/tools/gimpinktool-blob.h +++ b/app/tools/gimpinktool-blob.h @@ -25,32 +25,58 @@ #ifndef __BLOB_H__ #define __BLOB_H__ + typedef struct _BlobPoint BlobPoint; -typedef struct _BlobSpan BlobSpan; -typedef struct _Blob Blob; +typedef struct _BlobSpan BlobSpan; +typedef struct _Blob Blob; -struct _BlobPoint { - int x; - int y; +struct _BlobPoint +{ + gint x; + gint y; }; -struct _BlobSpan { - int left; - int right; +struct _BlobSpan +{ + gint left; + gint right; }; -struct _Blob { - int y; - int height; +struct _Blob +{ + gint y; + gint height; BlobSpan data[1]; }; -Blob *blob_convex_union (Blob *b1, Blob *b2); -Blob *blob_polygon (BlobPoint *points, int npoints); -Blob *blob_square (double xc, double yc, double xp, double yp, double xq, double yq); -Blob *blob_diamond (double xc, double yc, double xp, double yp, double xq, double yq); -Blob *blob_ellipse (double xc, double yc, double xp, double yp, double xq, double yq); -void blob_bounds(Blob *b, int *x, int *y, int *width, int *height); +Blob * blob_convex_union (Blob *b1, + Blob *b2); +Blob * blob_polygon (BlobPoint *points, + gint npoints); +Blob * blob_square (gdouble xc, + gdouble yc, + gdouble xp, + gdouble yp, + gdouble xq, + gdouble yq); +Blob * blob_diamond (gdouble xc, + gdouble yc, + gdouble xp, + gdouble yp, + gdouble xq, + gdouble yq); +Blob * blob_ellipse (gdouble xc, + gdouble yc, + gdouble xp, + gdouble yp, + gdouble xq, + gdouble yq); +void blob_bounds (Blob *b, + gint *x, + gint *y, + gint *width, + gint *height); + #endif /* __BLOB_H__ */ diff --git a/app/tools/gimpinktool.c b/app/tools/gimpinktool.c index ec28ff1b3c..3673948f53 100644 --- a/app/tools/gimpinktool.c +++ b/app/tools/gimpinktool.c @@ -21,7 +21,7 @@ #include #include -#include +#include #include "apptypes.h" @@ -29,6 +29,8 @@ #include "drawable.h" #include "draw_core.h" #include "gimage_mask.h" +#include "gimpcontext.h" +#include "gimpimage.h" #include "gimprc.h" #include "gimpui.h" #include "ink.h" @@ -37,11 +39,16 @@ #include "undo.h" #include "blob.h" #include "gdisplay.h" +#include "paint_funcs.h" +#include "pixel_region.h" +#include "temp_buf.h" +#include "tile.h" +#include "tile_manager.h" -#include "libgimp/gimpintl.h" #include "libgimp/gimpmath.h" -#include "tile.h" /* ick. */ +#include "libgimp/gimpintl.h" + #define SUBSAMPLE 8 @@ -805,7 +812,7 @@ ink_button_press (Tool *tool, /* Keep the coordinates of the target */ gdisplay_untransform_coords_f (gdisp, bevent->x, bevent->y, &x, &y, TRUE); - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); ink_init (ink_tool, drawable, x, y); @@ -872,7 +879,7 @@ ink_button_release (Tool *tool, g_free (ink_tool->last_blob); ink_tool->last_blob = NULL; - ink_finish (ink_tool, gimage_active_drawable (gdisp->gimage), tool->ID); + ink_finish (ink_tool, gimp_image_active_drawable (gdisp->gimage), tool->ID); gdisplays_flush (); } @@ -976,7 +983,7 @@ ink_motion (Tool *tool, ink_tool = (InkTool *) tool->private; gdisplay_untransform_coords_f (gdisp, mevent->x, mevent->y, &x, &y, TRUE); - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); lasttime = ink_tool->last_time; @@ -1038,7 +1045,7 @@ ink_cursor_update (Tool *tool, gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, FALSE, FALSE); - if ((layer = gimage_get_active_layer (gdisp->gimage))) + if ((layer = gimp_image_get_active_layer (gdisp->gimage))) { int off_x, off_y; @@ -1385,7 +1392,7 @@ ink_paste (InkTool *ink_tool, if (!canvas_buf) return; - gimage_get_foreground (gimage, drawable, col); + gimp_image_get_foreground (gimage, drawable, col); /* set the alpha channel */ col[canvas_buf->bytes - 1] = OPAQUE_OPACITY; @@ -1414,12 +1421,12 @@ ink_paste (InkTool *ink_tool, srcPR.data = temp_buf_data (canvas_buf); /* apply the paint area to the gimage */ - gimage_apply_image (gimage, drawable, &srcPR, - FALSE, - (int) (gimp_context_get_opacity (NULL) * 255), - gimp_context_get_paint_mode (NULL), - undo_tiles, /* specify an alternative src1 */ - canvas_buf->x, canvas_buf->y); + gimp_image_apply_image (gimage, drawable, &srcPR, + FALSE, + (int) (gimp_context_get_opacity (NULL) * 255), + gimp_context_get_paint_mode (NULL), + undo_tiles, /* specify an alternative src1 */ + canvas_buf->x, canvas_buf->y); /* Update the undo extents */ ink_tool->x1 = MIN (ink_tool->x1, canvas_buf->x); diff --git a/app/tools/gimpinktool.h b/app/tools/gimpinktool.h index 6be250088d..3dfb214846 100644 --- a/app/tools/gimpinktool.h +++ b/app/tools/gimpinktool.h @@ -15,16 +15,16 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __INK_H__ #define __INK_H__ -#include "tools.h" -#include "procedural_db.h" -Tool * tools_new_ink (void); -void tools_free_ink (Tool *); +Tool * tools_new_ink (void); +void tools_free_ink (Tool *tool); /* Procedure definition and marshalling function */ extern ProcRecord ink_proc; + #endif /* __INK_H__ */ diff --git a/app/tools/gimpiscissorstool.c b/app/tools/gimpiscissorstool.c index d695c6e91d..cf075959c2 100644 --- a/app/tools/gimpiscissorstool.c +++ b/app/tools/gimpiscissorstool.c @@ -28,7 +28,8 @@ * until about 1.1.4) completely changed the algorithm used, until it * bore little resemblance to the one described in the paper above. * The 0.54 version of the algorithm was then forwards ported to 1.1.4 - * by Austin Donnelly. */ + * by Austin Donnelly. + */ #include "config.h" @@ -41,22 +42,27 @@ #include "appenv.h" #include "draw_core.h" -#include "channel_pvt.h" +#include "channel.h" #include "cursorutil.h" #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "iscissors.h" #include "edit_selection.h" #include "paint_funcs.h" +#include "pixel_region.h" #include "selection_options.h" #include "temp_buf.h" #include "tools.h" #include "bezier_selectP.h" #include "scan_convert.h" +#include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpmath.h" + #ifdef DEBUG #define TRC(x) g_print x #define D(x) x @@ -415,7 +421,7 @@ iscissors_button_press (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; iscissors = (Iscissors *) tool->private; - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); gdisplay_untransform_coords (gdisp, bevent->x, bevent->y, &iscissors->x, &iscissors->y, FALSE, FALSE); @@ -493,12 +499,12 @@ iscissors_button_press (Tool *tool, if (((SelectionOptions *) iscissors_options)->feather) channel_feather (iscissors->mask, - gimage_get_mask (gdisp->gimage), + gimp_image_get_mask (gdisp->gimage), ((SelectionOptions *) iscissors_options)->feather_radius, ((SelectionOptions *) iscissors_options)->feather_radius, iscissors->op, 0, 0); else - channel_combine_mask (gimage_get_mask (gdisp->gimage), + channel_combine_mask (gimp_image_get_mask (gdisp->gimage), iscissors->mask, iscissors->op, 0, 0); iscissors_reset (iscissors); diff --git a/app/tools/gimpiscissorstool.h b/app/tools/gimpiscissorstool.h index ab21c1de74..a89cb37451 100644 --- a/app/tools/gimpiscissorstool.h +++ b/app/tools/gimpiscissorstool.h @@ -15,10 +15,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __ISCISSORS_H__ #define __ISCISSORS_H__ -Tool * tools_new_iscissors (void); -void tools_free_iscissors (Tool *); + +Tool * tools_new_iscissors (void); +void tools_free_iscissors (Tool *tool); + #endif /* __ISCISSORS_H__ */ diff --git a/app/tools/gimplevelstool.c b/app/tools/gimplevelstool.c index 13395b4548..7814babaaa 100644 --- a/app/tools/gimplevelstool.c +++ b/app/tools/gimplevelstool.c @@ -23,20 +23,23 @@ #include #include -#include +#include #include "apptypes.h" #include "appenv.h" #include "drawable.h" #include "gdisplay.h" -#include "histogramwidget.h" #include "gimphistogram.h" +#include "gimpimage.h" #include "gimpui.h" +#include "histogramwidget.h" #include "image_map.h" #include "levels.h" #include "gimplut.h" #include "lut_funcs.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpenv.h" #include "libgimp/gimpmath.h" @@ -239,7 +242,7 @@ levels_initialize (GDisplay *gdisp) { gint i; - if (drawable_indexed (gimage_active_drawable (gdisp->gimage))) + if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Levels for indexed drawables cannot be adjusted.")); return; @@ -263,7 +266,7 @@ levels_initialize (GDisplay *gdisp) levels_dialog->high_output[i] = 255; } - levels_dialog->drawable = gimage_active_drawable (gdisp->gimage); + levels_dialog->drawable = gimp_image_active_drawable (gdisp->gimage); levels_dialog->color = drawable_color (levels_dialog->drawable); levels_dialog->image_map = image_map_create (gdisp, levels_dialog->drawable); diff --git a/app/tools/gimplevelstool.h b/app/tools/gimplevelstool.h index 462f317229..11be1c59ff 100644 --- a/app/tools/gimplevelstool.h +++ b/app/tools/gimplevelstool.h @@ -15,16 +15,17 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __LEVELS_H__ #define __LEVELS_H__ -#include "tools.h" -Tool * tools_new_levels (void); -void tools_free_levels (Tool *tool); +Tool * tools_new_levels (void); +void tools_free_levels (Tool *tool); void levels_dialog_hide (void); -void levels_initialize (GDisplay *gdisp); -void levels_free (void); +void levels_initialize (GDisplay *gdisp); +void levels_free (void); + #endif /* __LEVELS_H__ */ diff --git a/app/tools/gimpmagnifytool.c b/app/tools/gimpmagnifytool.c index 9a38d49edf..25a9e8c90c 100644 --- a/app/tools/gimpmagnifytool.c +++ b/app/tools/gimpmagnifytool.c @@ -34,10 +34,12 @@ #include "info_window.h" #include "magnify.h" #include "scale.h" +#include "tools.h" +#include "tool_options.h" -#include "config.h" #include "libgimp/gimpintl.h" + /* the magnify structures */ typedef struct _Magnify Magnify; diff --git a/app/tools/gimpmagnifytool.h b/app/tools/gimpmagnifytool.h index 4d43694e00..4f70b77bb7 100644 --- a/app/tools/gimpmagnifytool.h +++ b/app/tools/gimpmagnifytool.h @@ -15,16 +15,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __MAGNIFY_H__ #define __MAGNIFY_H__ -#include "tools.h" -/* magnify functions */ +Tool * tools_new_magnify (void); +void tools_free_magnify (Tool *tool); -Tool * tools_new_magnify (void); -void tools_free_magnify (Tool *tool); +void magnify_draw (Tool *tool); -void magnify_draw (Tool *tool); #endif /* __MAGNIFY_H__ */ diff --git a/app/tools/gimpmeasuretool.c b/app/tools/gimpmeasuretool.c index 69d0d141b1..4e12bec9e5 100644 --- a/app/tools/gimpmeasuretool.c +++ b/app/tools/gimpmeasuretool.c @@ -21,19 +21,24 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" #include "draw_core.h" +#include "gdisplay.h" +#include "gimpimage.h" #include "gimpui.h" #include "info_dialog.h" #include "measure.h" #include "undo.h" +#include "tools.h" +#include "tool_options.h" + +#include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" -#include "libgimp/gimpmath.h" /* definitions */ diff --git a/app/tools/gimpmeasuretool.h b/app/tools/gimpmeasuretool.h index 79b21261ea..c9004833bc 100644 --- a/app/tools/gimpmeasuretool.h +++ b/app/tools/gimpmeasuretool.h @@ -15,15 +15,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __MEASURE_H__ #define __MEASURE_H__ -#include "tools.h" -/* measure functions */ - -Tool * tools_new_measure_tool (void); -void tools_free_measure_tool (Tool *); +Tool * tools_new_measure_tool (void); +void tools_free_measure_tool (Tool *tool); #endif /* __MEASURE_H__ */ diff --git a/app/tools/gimpmovetool.c b/app/tools/gimpmovetool.c index 4793b51fcd..3b8e416564 100644 --- a/app/tools/gimpmovetool.c +++ b/app/tools/gimpmovetool.c @@ -29,9 +29,14 @@ #include "edit_selection.h" #include "floating_sel.h" #include "gimage_mask.h" -#include "gdisplay.h" +#include "gimpimage.h" #include "gdisplay_ops.h" +#include "gdisplay.h" +#include "layer.h" #include "move.h" +#include "selection.h" +#include "tools.h" +#include "tool_options.h" #include "undo.h" #include "config.h" @@ -107,9 +112,9 @@ move_tool_button_press (Tool *tool, undo_push_guide (gdisp->gimage, guide); gdisplays_expose_guide (gdisp->gimage, guide); - gimage_remove_guide (gdisp->gimage, guide); + gimp_image_remove_guide (gdisp->gimage, guide); gdisplay_flush (gdisp); - gimage_add_guide (gdisp->gimage, guide); + gimp_image_add_guide (gdisp->gimage, guide); move->guide = guide; move->disp = gdisp; @@ -119,20 +124,20 @@ move_tool_button_press (Tool *tool, move_tool_motion (tool, NULL, gdisp); } - else if ((layer = gimage_pick_correlate_layer (gdisp->gimage, x, y))) + else if ((layer = gimp_image_pick_correlate_layer (gdisp->gimage, x, y))) { /* If there is a floating selection, and this aint it, * use the move tool */ - if (gimage_floating_sel (gdisp->gimage) && + if (gimp_image_floating_sel (gdisp->gimage) && !layer_is_floating_sel (layer)) { - move->layer = gimage_floating_sel (gdisp->gimage); + move->layer = gimp_image_floating_sel (gdisp->gimage); } /* Otherwise, init the edit selection */ else { - gimage_set_active_layer (gdisp->gimage, layer); + gimp_image_set_active_layer (gdisp->gimage, layer); init_edit_selection (tool, gdisp_ptr, bevent, EDIT_LAYER_TRANSLATE); } tool->state = ACTIVE; @@ -373,10 +378,10 @@ move_tool_cursor_update (Tool *tool, move->disp = gdisp; } } - else if ((layer = gimage_pick_correlate_layer (gdisp->gimage, x, y))) + else if ((layer = gimp_image_pick_correlate_layer (gdisp->gimage, x, y))) { /* if there is a floating selection, and this aint it... */ - if (gimage_floating_sel (gdisp->gimage) && + if (gimp_image_floating_sel (gdisp->gimage) && !layer_is_floating_sel (layer)) gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR, RECT_SELECT, @@ -461,7 +466,7 @@ move_tool_start_hguide (Tool *tool, if (private->guide && private->disp && private->disp->gimage) gdisplay_draw_guide (private->disp, private->guide, FALSE); - private->guide = gimage_add_hguide (gdisp->gimage); + private->guide = gimp_image_add_hguide (gdisp->gimage); private->disp = gdisp; tool->state = ACTIVE; @@ -485,7 +490,7 @@ move_tool_start_vguide (Tool *tool, if (private->guide && private->disp && private->disp->gimage) gdisplay_draw_guide (private->disp, private->guide, FALSE); - private->guide = gimage_add_vguide (gdisp->gimage); + private->guide = gimp_image_add_vguide (gdisp->gimage); private->disp = gdisp; tool->state = ACTIVE; diff --git a/app/tools/gimpmovetool.h b/app/tools/gimpmovetool.h index 1c1e2cc007..f4f97c1c46 100644 --- a/app/tools/gimpmovetool.h +++ b/app/tools/gimpmovetool.h @@ -15,12 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __MOVE_H__ #define __MOVE_H__ -#include "tools.h" - -/* move functions */ void move_tool_start_hguide (Tool *tool, GDisplay *gdisp); diff --git a/app/tools/gimppenciltool.c b/app/tools/gimppenciltool.c index 69fc36f889..860d3da779 100644 --- a/app/tools/gimppenciltool.c +++ b/app/tools/gimppenciltool.c @@ -18,13 +18,16 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" #include "drawable.h" #include "gdisplay.h" +#include "gimpbrush.h" +#include "gimpcontext.h" +#include "gimpimage.h" #include "gradient.h" #include "paint_funcs.h" #include "paint_core.h" @@ -32,7 +35,9 @@ #include "paintbrush.h" #include "pencil.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" +#include "tool_options.h" /* the pencil tool options */ @@ -180,7 +185,7 @@ pencil_motion (PaintCore *paint_core, } else { - gimage_get_foreground (gimage, drawable, col); + gimp_image_get_foreground (gimage, drawable, col); col[area->bytes - 1] = OPAQUE_OPACITY; color_pixels (temp_buf_data (area), col, area->width * area->height, area->bytes); diff --git a/app/tools/gimppenciltool.h b/app/tools/gimppenciltool.h index b65ea78a19..5bdadd451c 100644 --- a/app/tools/gimppenciltool.h +++ b/app/tools/gimppenciltool.h @@ -15,16 +15,20 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __PENCIL_H__ #define __PENCIL_H__ -#include "tools.h" -#include "paint_core.h" -void * pencil_paint_func (PaintCore *, GimpDrawable *, int); -gboolean pencil_non_gui (GimpDrawable *, int, double *); +void * pencil_paint_func (PaintCore *, + GimpDrawable *, + gint ); +gboolean pencil_non_gui (GimpDrawable *, + gint , + gdouble *); + +Tool * tools_new_pencil (void); +void tools_free_pencil (Tool *tool); -Tool * tools_new_pencil (void); -void tools_free_pencil (Tool *); #endif /* __PENCIL_H__ */ diff --git a/app/tools/gimpperspectivetool.c b/app/tools/gimpperspectivetool.c index 5f320fbb9e..166e4fb6fa 100644 --- a/app/tools/gimpperspectivetool.c +++ b/app/tools/gimpperspectivetool.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include "apptypes.h" @@ -26,16 +26,20 @@ #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" +#include "gimpprogress.h" +#include "gimpui.h" #include "info_dialog.h" #include "perspective_tool.h" #include "selection.h" +#include "tile_manager_pvt.h" +#include "tools.h" +#include "transform_core.h" #include "transform_tool.h" #include "undo.h" #include "libgimp/gimpintl.h" -#include "tile_manager_pvt.h" - /* storage for information dialog fields */ static gchar matrix_row_buf [3][MAX_INFO_BUF]; @@ -58,7 +62,7 @@ perspective_tool_transform (Tool *tool, switch (state) { - case INIT: + case TRANSFORM_INIT: if (!transform_info) { transform_info = @@ -84,21 +88,21 @@ perspective_tool_transform (Tool *tool, return NULL; break; - case MOTION: + case TRANSFORM_MOTION: perspective_tool_motion (tool, gdisp_ptr); perspective_tool_recalc (tool, gdisp_ptr); break; - case RECALC: + case TRANSFORM_RECALC: perspective_tool_recalc (tool, gdisp_ptr); break; - case FINISH: + case TRANSFORM_FINISH: /* Let the transform core handle the inverse mapping */ gtk_widget_set_sensitive (GTK_WIDGET (transform_info->shell), FALSE); return perspective_tool_perspective (gdisp->gimage, - gimage_active_drawable (gdisp->gimage), + gimp_image_active_drawable (gdisp->gimage), gdisp, transform_core->original, transform_tool_smoothing (), @@ -184,19 +188,19 @@ perspective_tool_motion (Tool *tool, switch (transform_core->function) { - case HANDLE_1: + case TRANSFORM_HANDLE_1: transform_core->trans_info [X0] += diff_x; transform_core->trans_info [Y0] += diff_y; break; - case HANDLE_2: + case TRANSFORM_HANDLE_2: transform_core->trans_info [X1] += diff_x; transform_core->trans_info [Y1] += diff_y; break; - case HANDLE_3: + case TRANSFORM_HANDLE_3: transform_core->trans_info [X2] += diff_x; transform_core->trans_info [Y2] += diff_y; break; - case HANDLE_4: + case TRANSFORM_HANDLE_4: transform_core->trans_info [X3] += diff_x; transform_core->trans_info [Y3] += diff_y; break; diff --git a/app/tools/gimpperspectivetool.h b/app/tools/gimpperspectivetool.h index e79c88b0f0..611a85ecc1 100644 --- a/app/tools/gimpperspectivetool.h +++ b/app/tools/gimpperspectivetool.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __PERSPECTIVE_TOOL_H__ #define __PERSPECTIVE_TOOL_H__ -#include "tools.h" -#include "transform_core.h" TileManager * perspective_tool_transform (Tool *tool, gpointer gdisp_ptr, @@ -33,7 +32,8 @@ TileManager * perspective_tool_perspective (GimpImage *gimage, void perspective_find_transform (gdouble *coords, GimpMatrix3 matrix); -Tool * tools_new_perspective_tool (void); -void tools_free_perspective_tool (Tool *tool); +Tool * tools_new_perspective_tool (void); +void tools_free_perspective_tool (Tool *tool); + #endif /* __PERSPECTIVE_TOOL_H__ */ diff --git a/app/tools/gimpposterizetool.c b/app/tools/gimpposterizetool.c index 0f64de091f..c8c7cc728b 100644 --- a/app/tools/gimpposterizetool.c +++ b/app/tools/gimpposterizetool.c @@ -18,18 +18,21 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" #include "drawable.h" #include "gdisplay.h" -#include "image_map.h" -#include "posterize.h" +#include "gimpimage.h" #include "gimplut.h" #include "gimpui.h" +#include "image_map.h" #include "lut_funcs.h" +#include "posterize.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpintl.h" @@ -153,7 +156,7 @@ tools_free_posterize (Tool *tool) void posterize_initialize (GDisplay *gdisp) { - if (drawable_indexed (gimage_active_drawable (gdisp->gimage))) + if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Posterize does not operate on indexed drawables.")); return; @@ -168,7 +171,7 @@ posterize_initialize (GDisplay *gdisp) posterize_dialog->levels = 3; - posterize_dialog->drawable = gimage_active_drawable (gdisp->gimage); + posterize_dialog->drawable = gimp_image_active_drawable (gdisp->gimage); posterize_dialog->image_map = image_map_create (gdisp, posterize_dialog->drawable); diff --git a/app/tools/gimpposterizetool.h b/app/tools/gimpposterizetool.h index 5e1ebdfa4d..3b16c85bb4 100644 --- a/app/tools/gimpposterizetool.h +++ b/app/tools/gimpposterizetool.h @@ -15,10 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __POSTERIZE_H__ #define __POSTERIZE_H__ -#include "tools.h" Tool * tools_new_posterize (void); void tools_free_posterize (Tool *tool); @@ -26,4 +26,5 @@ void tools_free_posterize (Tool *tool); void posterize_dialog_hide (void); void posterize_initialize (GDisplay *gdisp); + #endif /* __POSTERIZE_H__ */ diff --git a/app/tools/gimprectselecttool.c b/app/tools/gimprectselecttool.c index dc42bcf149..3dbca9e287 100644 --- a/app/tools/gimprectselecttool.c +++ b/app/tools/gimprectselecttool.c @@ -26,14 +26,19 @@ #include "apptypes.h" #include "appenv.h" +#include "channel.h" +#include "cursorutil.h" +#include "draw_core.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "edit_selection.h" #include "floating_sel.h" #include "rect_select.h" #include "rect_selectP.h" #include "selection_options.h" -#include "cursorutil.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpunitmenu.h" @@ -91,8 +96,8 @@ rect_select (GimpImage *gimage, if (feather) { new_mask = channel_new_mask (gimage, gimage->width, gimage->height); - channel_combine_rect (new_mask, ADD, x, y, w, h); - channel_feather (new_mask, gimage_get_mask (gimage), + channel_combine_rect (new_mask, CHANNEL_OP_ADD, x, y, w, h); + channel_feather (new_mask, gimp_image_get_mask (gimage), feather_radius, feather_radius, op, 0, 0); @@ -101,12 +106,12 @@ rect_select (GimpImage *gimage, else if (op == SELECTION_INTERSECT) { new_mask = channel_new_mask (gimage, gimage->width, gimage->height); - channel_combine_rect (new_mask, ADD, x, y, w, h); - channel_combine_mask (gimage_get_mask (gimage), new_mask, op, 0, 0); + channel_combine_rect (new_mask, CHANNEL_OP_ADD, x, y, w, h); + channel_combine_mask (gimp_image_get_mask (gimage), new_mask, op, 0, 0); channel_delete (new_mask); } else - channel_combine_rect (gimage_get_mask (gimage), op, x, y, w, h); + channel_combine_rect (gimp_image_get_mask (gimage), op, x, y, w, h); } void @@ -253,8 +258,8 @@ rect_select_button_release (Tool *tool, if ((!w || !h) && !rect_sel->fixed_size) { /* If there is a floating selection, anchor it */ - if (gimage_floating_sel (gdisp->gimage)) - floating_sel_anchor (gimage_floating_sel (gdisp->gimage)); + if (gimp_image_floating_sel (gdisp->gimage)) + floating_sel_anchor (gimp_image_floating_sel (gdisp->gimage)); /* Otherwise, clear the selection mask */ else gimage_mask_clear (gdisp->gimage); @@ -504,8 +509,8 @@ selection_tool_update_op_state (RectSelect *rect_sel, gdisplay_untransform_coords (gdisp, x, y, &tx, &ty, FALSE, FALSE); - layer = gimage_pick_correlate_layer (gdisp->gimage, tx, ty); - floating_sel = gimage_floating_sel (gdisp->gimage); + layer = gimp_image_pick_correlate_layer (gdisp->gimage, tx, ty); + floating_sel = gimp_image_floating_sel (gdisp->gimage); if (state & GDK_MOD1_MASK && !gimage_mask_is_empty (gdisp->gimage)) diff --git a/app/tools/gimprectselecttool.h b/app/tools/gimprectselecttool.h index e070713026..ffc764b9db 100644 --- a/app/tools/gimprectselecttool.h +++ b/app/tools/gimprectselecttool.h @@ -15,33 +15,47 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __RECT_SELECT_H__ #define __RECT_SELECT_H__ -#include "apptypes.h" -#include "tools.h" /* rect select action functions */ -void rect_select_button_press (Tool *, GdkEventButton *, gpointer); -void rect_select_button_release (Tool *, GdkEventButton *, gpointer); -void rect_select_motion (Tool *, GdkEventMotion *, gpointer); -void rect_select_modifier_update (Tool *, GdkEventKey * , gpointer); -void rect_select_cursor_update (Tool *, GdkEventMotion *, gpointer); -void rect_select_oper_update (Tool *, GdkEventMotion *, gpointer); -void rect_select_control (Tool *, ToolAction, gpointer); +void rect_select_button_press (Tool *tool, + GdkEventButton *bevent, + gpointer gdisp_ptr); +void rect_select_button_release (Tool *tool, + GdkEventButton *bevent, + gpointer gdisp_ptr); +void rect_select_motion (Tool *tool, + GdkEventMotion *mevent, + gpointer gdisp_ptr); +void rect_select_modifier_update (Tool *tool, + GdkEventKey *kevent, + gpointer gdisp_ptr); +void rect_select_cursor_update (Tool *tool, + GdkEventMotion *mevent, + gpointer gdisp_ptr); +void rect_select_oper_update (Tool *tool, + GdkEventMotion *mevent, + gpointer gdisp_ptr); +void rect_select_control (Tool *tool, + ToolAction tool_action, + gpointer gdisp_ptr); /* rect select functions */ -void rect_select_draw (Tool *tool); -void rect_select (GimpImage *gimage, - gint x, - gint y, - gint w, - gint g, - SelectOps op, - gboolean feather, - gdouble feather_radius); +void rect_select_draw (Tool *tool); +void rect_select (GimpImage *gimage, + gint x, + gint y, + gint w, + gint g, + SelectOps op, + gboolean feather, + gdouble feather_radius); Tool * tools_new_rect_select (void); -void tools_free_rect_select (Tool *tool); +void tools_free_rect_select (Tool *tool); + #endif /* __RECT_SELECT_H__ */ diff --git a/app/tools/gimpregionselecttool.c b/app/tools/gimpregionselecttool.c index cf66542ce2..906acff785 100644 --- a/app/tools/gimpregionselecttool.c +++ b/app/tools/gimpregionselecttool.c @@ -26,26 +26,34 @@ #include "appenv.h" #include "boundary.h" +#include "channel.h" #include "cursorutil.h" #include "draw_core.h" #include "drawable.h" #include "edit_selection.h" #include "fuzzy_select.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "gimprc.h" #include "gimpui.h" #include "gdisplay.h" +#include "pixel_region.h" #include "rect_select.h" #include "selection_options.h" - -#include "tile.h" /* ick. */ +#include "tile_manager.h" +#include "tile.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpmath.h" + #include "libgimp/gimpintl.h" + /* the fuzzy selection structures */ typedef struct _FuzzySelect FuzzySelect; + struct _FuzzySelect { DrawCore *core; /* Core select object */ @@ -302,9 +310,9 @@ find_contiguous_region (GImage *gimage, if (sample_merged) { - pixel_region_init (&srcPR, gimage_composite (gimage), 0, 0, + pixel_region_init (&srcPR, gimp_image_composite (gimage), 0, 0, gimage->width, gimage->height, FALSE); - type = gimage_composite_type (gimage); + type = gimp_image_composite_type (gimage); has_alpha = (type == RGBA_GIMAGE || type == GRAYA_GIMAGE || type == INDEXEDA_GIMAGE); @@ -353,7 +361,7 @@ fuzzy_select (GImage *gimage, gint off_x, off_y; /* if applicable, replace the current selection */ - if (op == REPLACE) + if (op == CHANNEL_OP_REPLACE) gimage_mask_clear (gimage); else gimage_mask_undo (gimage); @@ -364,12 +372,12 @@ fuzzy_select (GImage *gimage, off_x = off_y = 0; if (feather) - channel_feather (fuzzy_mask, gimage_get_mask (gimage), + channel_feather (fuzzy_mask, gimp_image_get_mask (gimage), feather_radius, feather_radius, op, off_x, off_y); else - channel_combine_mask (gimage_get_mask (gimage), + channel_combine_mask (gimp_image_get_mask (gimage), fuzzy_mask, op, off_x, off_y); /* free the fuzzy region struct */ @@ -446,7 +454,7 @@ fuzzy_select_button_release (Tool *tool, if (! (bevent->state & GDK_BUTTON3_MASK)) { drawable = (fuzzy_options->sample_merged ? - NULL : gimage_active_drawable (gdisp->gimage)); + NULL : gimp_image_active_drawable (gdisp->gimage)); fuzzy_select (gdisp->gimage, drawable, fuzzy_sel->op, fuzzy_options->feather, @@ -531,7 +539,7 @@ fuzzy_select_calculate (Tool *tool, fuzzy_sel = (FuzzySelect *) tool->private; gdisp = (GDisplay *) gdisp_ptr; - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); gimp_add_busy_cursors (); diff --git a/app/tools/gimpregionselecttool.h b/app/tools/gimpregionselecttool.h index 5e3240d533..0211a4b81f 100644 --- a/app/tools/gimpregionselecttool.h +++ b/app/tools/gimpregionselecttool.h @@ -15,17 +15,17 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __FUZZY_SELECT_H__ #define __FUZZY_SELECT_H__ -#include "gimage.h" -#include "tools.h" extern Channel *fuzzy_mask; + /* fuzzy select functions */ Tool * tools_new_fuzzy_select (void); -void tools_free_fuzzy_select (Tool *tool); +void tools_free_fuzzy_select (Tool *tool); /* functions */ Channel * find_contiguous_region (GimpImage *gimage, @@ -41,4 +41,5 @@ void fuzzy_select (GimpImage *gimage, gboolean feather, gdouble feather_radius); + #endif /* __FUZZY_SELECT_H__ */ diff --git a/app/tools/gimprotatetool.c b/app/tools/gimprotatetool.c index 133795c827..75b33552d7 100644 --- a/app/tools/gimprotatetool.c +++ b/app/tools/gimprotatetool.c @@ -18,26 +18,34 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" +#include "draw_core.h" #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" +#include "gimpprogress.h" +#include "gimpui.h" #include "info_dialog.h" #include "rotate_tool.h" #include "selection.h" +#include "tile_manager_pvt.h" +#include "tools.h" +#include "tool_options.h" +#include "transform_core.h" #include "transform_tool.h" #include "undo.h" -#include "tile_manager_pvt.h" - #include "libgimp/gimpsizeentry.h" -#include "libgimp/gimpintl.h" #include "libgimp/gimpmath.h" +#include "libgimp/gimpintl.h" + + /* index into trans_info array */ #define ANGLE 0 #define REAL_ANGLE 1 @@ -78,7 +86,7 @@ rotate_tool_transform (Tool *tool, switch (state) { - case INIT: + case TRANSFORM_INIT: angle_val = 0.0; center_vals[0] = transform_core->cx; center_vals[1] = transform_core->cy; @@ -165,19 +173,19 @@ rotate_tool_transform (Tool *tool, return NULL; break; - case MOTION: + case TRANSFORM_MOTION: rotate_tool_motion (tool, gdisp_ptr); rotate_tool_recalc (tool, gdisp_ptr); break; - case RECALC: + case TRANSFORM_RECALC: rotate_tool_recalc (tool, gdisp_ptr); break; - case FINISH: + case TRANSFORM_FINISH: gtk_widget_set_sensitive (GTK_WIDGET (transform_info->shell), FALSE); return rotate_tool_rotate (gdisp->gimage, - gimage_active_drawable (gdisp->gimage), + gimp_image_active_drawable (gdisp->gimage), gdisp, transform_core->trans_info[ANGLE], transform_core->original, @@ -304,7 +312,7 @@ rotate_tool_motion (Tool *tool, transform_core = (TransformCore *) tool->private; - if (transform_core->function == HANDLE_CENTER) + if (transform_core->function == TRANSFORM_HANDLE_CENTER) { transform_core->cx = transform_core->curx; transform_core->cy = transform_core->cury; diff --git a/app/tools/gimprotatetool.h b/app/tools/gimprotatetool.h index 2bd327eabd..a466d1411d 100644 --- a/app/tools/gimprotatetool.h +++ b/app/tools/gimprotatetool.h @@ -15,24 +15,24 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __ROTATE_TOOL_H__ #define __ROTATE_TOOL_H__ -#include "tools.h" -#include "transform_core.h" -TileManager * rotate_tool_transform (Tool *tool, - gpointer gdisp_ptr, - TransformState state); -TileManager * rotate_tool_rotate (GimpImage *gimage, - GimpDrawable *drawable, - GDisplay *gdisp, - gdouble angle, - TileManager *float_tiles, - gboolean interpolation, - GimpMatrix3 matrix); +TileManager * rotate_tool_transform (Tool *tool, + gpointer gdisp_ptr, + TransformState state); +TileManager * rotate_tool_rotate (GimpImage *gimage, + GimpDrawable *drawable, + GDisplay *gdisp, + gdouble angle, + TileManager *float_tiles, + gboolean interpolation, + GimpMatrix3 matrix); + +Tool * tools_new_rotate_tool (void); +void tools_free_rotate_tool (Tool *tool); -Tool * tools_new_rotate_tool (void); -void tools_free_rotate_tool (Tool *tool); #endif /* __ROTATE_TOOL_H__ */ diff --git a/app/tools/gimpscaletool.c b/app/tools/gimpscaletool.c index 939b9e7830..edce4cd856 100644 --- a/app/tools/gimpscaletool.c +++ b/app/tools/gimpscaletool.c @@ -18,17 +18,24 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" +#include "draw_core.h" #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" +#include "gimpprogress.h" +#include "gimpui.h" #include "info_dialog.h" #include "scale_tool.h" #include "selection.h" +#include "tools.h" +#include "tool_options.h" +#include "transform_core.h" #include "transform_tool.h" #include "undo.h" @@ -72,7 +79,7 @@ scale_tool_transform (Tool *tool, switch (state) { - case INIT: + case TRANSFORM_INIT: size_vals[0] = transform_core->x2 - transform_core->x1; size_vals[1] = transform_core->y2 - transform_core->y1; @@ -155,19 +162,19 @@ scale_tool_transform (Tool *tool, return NULL; break; - case MOTION: + case TRANSFORM_MOTION: scale_tool_motion (tool, gdisp_ptr); scale_tool_recalc (tool, gdisp_ptr); break; - case RECALC: + case TRANSFORM_RECALC: scale_tool_recalc (tool, gdisp_ptr); break; - case FINISH: + case TRANSFORM_FINISH: gtk_widget_set_sensitive (GTK_WIDGET (transform_info->shell), FALSE); return scale_tool_scale (gdisp->gimage, - gimage_active_drawable (gdisp->gimage), + gimp_image_active_drawable (gdisp->gimage), gdisp, transform_core->trans_info, transform_core->original, @@ -341,14 +348,14 @@ scale_tool_motion (Tool *tool, switch (transform_core->function) { - case HANDLE_1: + case TRANSFORM_HANDLE_1: x1 = &transform_core->trans_info [X0]; y1 = &transform_core->trans_info [Y0]; x2 = &transform_core->trans_info [X1]; y2 = &transform_core->trans_info [Y1]; dir_x = dir_y = 1; break; - case HANDLE_2: + case TRANSFORM_HANDLE_2: x1 = &transform_core->trans_info [X1]; y1 = &transform_core->trans_info [Y0]; x2 = &transform_core->trans_info [X0]; @@ -356,7 +363,7 @@ scale_tool_motion (Tool *tool, dir_x = -1; dir_y = 1; break; - case HANDLE_3: + case TRANSFORM_HANDLE_3: x1 = &transform_core->trans_info [X0]; y1 = &transform_core->trans_info [Y1]; x2 = &transform_core->trans_info [X1]; @@ -364,7 +371,7 @@ scale_tool_motion (Tool *tool, dir_x = 1; dir_y = -1; break; - case HANDLE_4: + case TRANSFORM_HANDLE_4: x1 = &transform_core->trans_info [X1]; y1 = &transform_core->trans_info [Y1]; x2 = &transform_core->trans_info [X0]; @@ -454,22 +461,22 @@ scale_tool_recalc (Tool *tool, switch (transform_core->function) { - case HANDLE_1: + case TRANSFORM_HANDLE_1: cx = x2; cy = y2; diffx = x2 - transform_core->x2; diffy = y2 - transform_core->y2; break; - case HANDLE_2: + case TRANSFORM_HANDLE_2: cx = x1; cy = y2; diffx = x1 - transform_core->x1; diffy = y2 - transform_core->y2; break; - case HANDLE_3: + case TRANSFORM_HANDLE_3: cx = x2; cy = y1; diffx = x2 - transform_core->x2; diffy = y1 - transform_core->y1; break; - case HANDLE_4: + case TRANSFORM_HANDLE_4: cx = x1; cy = y1; diffx = x1 - transform_core->x1; diffy = y1 - transform_core->y1; diff --git a/app/tools/gimpscaletool.h b/app/tools/gimpscaletool.h index 1445a8364b..93aeac2cd6 100644 --- a/app/tools/gimpscaletool.h +++ b/app/tools/gimpscaletool.h @@ -15,24 +15,24 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __SCALE_TOOL_H__ #define __SCALE_TOOL_H__ -#include "tools.h" -#include "transform_core.h" -TileManager * scale_tool_transform (Tool *tool, - gpointer gdisp_ptr, - TransformState state); -TileManager * scale_tool_scale (GimpImage *gimage, - GimpDrawable *drawable, - GDisplay *gdisp, - gdouble *trans_info, - TileManager *float_tiles, - gboolean interpolation, - GimpMatrix3 matrix); +TileManager * scale_tool_transform (Tool *tool, + gpointer gdisp_ptr, + TransformState state); +TileManager * scale_tool_scale (GimpImage *gimage, + GimpDrawable *drawable, + GDisplay *gdisp, + gdouble *trans_info, + TileManager *float_tiles, + gboolean interpolation, + GimpMatrix3 matrix); + +Tool * tools_new_scale_tool (void); +void tools_free_scale_tool (Tool *tool); -Tool * tools_new_scale_tool (void); -void tools_free_scale_tool (Tool *tool); #endif /* __SCALE_TOOL_H__ */ diff --git a/app/tools/gimpselectionoptions.h b/app/tools/gimpselectionoptions.h index 718fb58a66..4d221f1651 100644 --- a/app/tools/gimpselectionoptions.h +++ b/app/tools/gimpselectionoptions.h @@ -15,17 +15,16 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __SELECTION_OPTIONS_H__ #define __SELECTION_OPTIONS_H__ -#include "tools.h" + #include "tool_options.h" -#include "libgimp/gimpunit.h" /* the selection options structures */ -typedef struct _SelectionOptions SelectionOptions; struct _SelectionOptions { ToolOptions tool_options; @@ -87,4 +86,5 @@ void selection_options_init (SelectionOptions *options, ToolType tool_type, ToolOptionsResetFunc reset_func); + #endif /* __SELCTION_OPTIONS_H__ */ diff --git a/app/tools/gimpsheartool.c b/app/tools/gimpsheartool.c index 2fe246dff6..279332b28d 100644 --- a/app/tools/gimpsheartool.c +++ b/app/tools/gimpsheartool.c @@ -18,25 +18,34 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" +#include "draw_core.h" #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" +#include "gimpui.h" +#include "gimpprogress.h" #include "info_dialog.h" #include "shear_tool.h" #include "selection.h" +#include "tools.h" +#include "tool_options.h" +#include "transform_core.h" #include "transform_tool.h" #include "undo.h" #include "tile_manager_pvt.h" -#include "libgimp/gimpintl.h" #include "libgimp/gimpmath.h" +#include "libgimp/gimpintl.h" + + /* index into trans_info array */ #define HORZ_OR_VERT 0 #define XSHEAR 1 @@ -71,7 +80,7 @@ shear_tool_transform (Tool *tool, switch (state) { - case INIT: + case TRANSFORM_INIT: if (!transform_info) { transform_info = info_dialog_new (_("Shear Information"), @@ -98,19 +107,19 @@ shear_tool_transform (Tool *tool, return NULL; break; - case MOTION: + case TRANSFORM_MOTION: shear_tool_motion (tool, gdisp_ptr); shear_tool_recalc (tool, gdisp_ptr); break; - case RECALC: + case TRANSFORM_RECALC: shear_tool_recalc (tool, gdisp_ptr); break; - case FINISH: + case TRANSFORM_FINISH: gtk_widget_set_sensitive (GTK_WIDGET (transform_info->shell), FALSE); return shear_tool_shear (gdisp->gimage, - gimage_active_drawable (gdisp->gimage), + gimp_image_active_drawable (gdisp->gimage), gdisp, transform_core->original, transform_tool_smoothing (), @@ -262,25 +271,25 @@ shear_tool_motion (Tool *tool, dir = transform_core->trans_info[HORZ_OR_VERT]; switch (transform_core->function) { - case HANDLE_1: + case TRANSFORM_HANDLE_1: if (dir == ORIENTATION_HORIZONTAL) transform_core->trans_info[XSHEAR] -= diffx; else transform_core->trans_info[YSHEAR] -= diffy; break; - case HANDLE_2: + case TRANSFORM_HANDLE_2: if (dir == ORIENTATION_HORIZONTAL) transform_core->trans_info[XSHEAR] -= diffx; else transform_core->trans_info[YSHEAR] += diffy; break; - case HANDLE_3: + case TRANSFORM_HANDLE_3: if (dir == ORIENTATION_HORIZONTAL) transform_core->trans_info[XSHEAR] += diffx; else transform_core->trans_info[YSHEAR] -= diffy; break; - case HANDLE_4: + case TRANSFORM_HANDLE_4: if (dir == ORIENTATION_HORIZONTAL) transform_core->trans_info[XSHEAR] += diffx; else diff --git a/app/tools/gimpsheartool.h b/app/tools/gimpsheartool.h index 026d052a1d..1dd07ad975 100644 --- a/app/tools/gimpsheartool.h +++ b/app/tools/gimpsheartool.h @@ -15,23 +15,23 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __SHEAR_TOOL_H__ #define __SHEAR_TOOL_H__ -#include "tools.h" -#include "transform_core.h" -TileManager * shear_tool_transform (Tool *tool, - gpointer gdisp_ptr, - TransformState state); -TileManager * shear_tool_shear (GimpImage *gimage, - GimpDrawable *drawable, - GDisplay *gdisp, - TileManager *float_tiles, - gboolean interpolation, - GimpMatrix3 matrix); +TileManager * shear_tool_transform (Tool *tool, + gpointer gdisp_ptr, + TransformState state); +TileManager * shear_tool_shear (GimpImage *gimage, + GimpDrawable *drawable, + GDisplay *gdisp, + TileManager *float_tiles, + gboolean interpolation, + GimpMatrix3 matrix); + +Tool * tools_new_shear_tool (void); +void tools_free_shear_tool (Tool *matrix); -Tool * tools_new_shear_tool (void); -void tools_free_shear_tool (Tool *matrix); #endif /* __SHEAR_TOOL_H__ */ diff --git a/app/tools/gimpsmudgetool.c b/app/tools/gimpsmudgetool.c index 69b5234dc2..26bdff458e 100644 --- a/app/tools/gimpsmudgetool.c +++ b/app/tools/gimpsmudgetool.c @@ -27,13 +27,18 @@ #include "drawable.h" #include "smudge.h" #include "gdisplay.h" +#include "gimpcontext.h" +#include "gimpbrush.h" #include "gimplut.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" +#include "pixel_region.h" #include "paint_options.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" +#include "tool_options.h" #include "gimage.h" #include "libgimp/gimpmath.h" diff --git a/app/tools/gimpsmudgetool.h b/app/tools/gimpsmudgetool.h index f56524bf2b..a87d0ffe60 100644 --- a/app/tools/gimpsmudgetool.h +++ b/app/tools/gimpsmudgetool.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __SMUDGE_H__ #define __SMUDGE_H__ -#include "paint_core.h" -#include "tools.h" typedef enum { @@ -34,10 +33,19 @@ typedef enum SMUDGE_MODE_SHADOWS } SmudgeMode; -void * smudge_paint_func (PaintCore *, GimpDrawable *, int); -gboolean smudge_non_gui (GimpDrawable *, double, int, double *); -gboolean smudge_non_gui_default (GimpDrawable *, int, double *); -Tool * tools_new_smudge (void); -void tools_free_smudge (Tool *); +void * smudge_paint_func (PaintCore *, + GimpDrawable *, + gint ); +gboolean smudge_non_gui (GimpDrawable *, + gdouble , + gint , + gdouble *); +gboolean smudge_non_gui_default (GimpDrawable *, + gint , + gdouble *); + +Tool * tools_new_smudge (void); +void tools_free_smudge (Tool *tool); + #endif /* __SMUDGE_H__ */ diff --git a/app/tools/gimpsourcetool.c b/app/tools/gimpsourcetool.c index 0db3c5e312..7c16c6f684 100644 --- a/app/tools/gimpsourcetool.c +++ b/app/tools/gimpsourcetool.c @@ -26,20 +26,27 @@ #include "apptypes.h" #include "appenv.h" +#include "draw_core.h" #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpcontext.h" +#include "gimpimage.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" #include "paint_options.h" +#include "patterns.h" +#include "pixel_region.h" #include "clone.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" #include "cursorutil.h" #include "libgimp/gimpintl.h" + #define TARGET_HEIGHT 15 #define TARGET_WIDTH 15 @@ -325,7 +332,7 @@ clone_cursor_update (Tool *tool, gdisplay_untransform_coords (gdisp, (double) mevent->x, (double) mevent->y, &x, &y, TRUE, FALSE); - if ((layer = gimage_get_active_layer (gdisp->gimage))) + if ((layer = gimp_image_get_active_layer (gdisp->gimage))) { int off_x, off_y; drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y); @@ -602,8 +609,8 @@ clone_line_image (GImage *dest, while (width--) { - gimage_get_color (src, drawable_type (s_drawable), rgb, s); - gimage_transform_color (dest, d_drawable, rgb, d, RGB); + gimp_image_get_color (src, drawable_type (s_drawable), rgb, s); + gimp_image_transform_color (dest, d_drawable, rgb, d, RGB); if (has_alpha) d[dest_alpha] = s[src_alpha]; @@ -625,9 +632,9 @@ clone_line_pattern (GImage *dest, int bytes, int width) { - unsigned char *pat, *p; - int color, alpha; - int i; + guchar *pat, *p; + gint color, alpha; + gint i; /* Make sure x, y are positive */ while (x < 0) @@ -646,7 +653,7 @@ clone_line_pattern (GImage *dest, { p = pat + ((i + x) % pattern->mask->width) * pattern->mask->bytes; - gimage_transform_color (dest, drawable, p, d, color); + gimp_image_transform_color (dest, drawable, p, d, color); d[alpha] = OPAQUE_OPACITY; @@ -659,7 +666,8 @@ clone_non_gui_paint_func (PaintCore *paint_core, GimpDrawable *drawable, int state) { - clone_motion (paint_core, drawable, non_gui_src_drawable, &non_gui_pressure_options, + clone_motion (paint_core, drawable, non_gui_src_drawable, + &non_gui_pressure_options, non_gui_type, non_gui_offset_x, non_gui_offset_y); return NULL; diff --git a/app/tools/gimpsourcetool.h b/app/tools/gimpsourcetool.h index ca55cfb2cf..0433bc488e 100644 --- a/app/tools/gimpsourcetool.h +++ b/app/tools/gimpsourcetool.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __CLONE_H__ #define __CLONE_H__ -#include "paint_core.h" -#include "tools.h" typedef enum { @@ -27,11 +26,21 @@ typedef enum PATTERN_CLONE } CloneType; -void * clone_paint_func (PaintCore *, GimpDrawable *, int); -gboolean clone_non_gui (GimpDrawable *, GimpDrawable *, CloneType, - double, double, int, double *); -gboolean clone_non_gui_default (GimpDrawable *, int, double *); -Tool * tools_new_clone (void); -void tools_free_clone (Tool *); +void * clone_paint_func (PaintCore *, + GimpDrawable *, + gint); +gboolean clone_non_gui (GimpDrawable *, + GimpDrawable *, + CloneType, + gdouble, + gdouble, + gint, + gdouble *); +gboolean clone_non_gui_default (GimpDrawable *, + gint, + gdouble *); +Tool * tools_new_clone (void); +void tools_free_clone (Tool *); + #endif /* __CLONE_H__ */ diff --git a/app/tools/gimptexttool.c b/app/tools/gimptexttool.c index f32049406b..33fd430364 100644 --- a/app/tools/gimptexttool.c +++ b/app/tools/gimptexttool.c @@ -20,9 +20,10 @@ #include #include +#include +#include #include -#include #ifndef GDK_WINDOWING_WIN32 #include @@ -37,22 +38,30 @@ #include "edit_selection.h" #include "errors.h" #include "floating_sel.h" +#include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "gimpui.h" #include "global_edit.h" +#include "layer.h" +#include "paint_funcs.h" +#include "pixel_region.h" +#include "plug_in.h" #include "procedural_db.h" #include "selection.h" #include "text_tool.h" +#include "tile.h" #include "tools.h" +#include "tool_options.h" +#include "tile_manager.h" +#include "tile_manager_pvt.h" #include "undo.h" -#include "tile_manager_pvt.h" -#include "drawable_pvt.h" - -#include "config.h" #include "libgimp/gimplimits.h" + #include "libgimp/gimpintl.h" + #define FOUNDRY 0 #define FAMILY 1 #define WEIGHT 2 @@ -285,7 +294,7 @@ text_call_gdyntext (GDisplay *gdisp) args[1].arg_type = PDB_IMAGE; args[1].value.pdb_int = (gint32) pdb_image_to_id (gdisp->gimage); args[2].arg_type = PDB_DRAWABLE; - args[2].value.pdb_int = (gint32) gimage_active_drawable (gdisp->gimage)->ID; + args[2].value.pdb_int = (gint32) gimp_image_active_drawable (gdisp->gimage)->ID; plug_in_run (proc_rec, args, 3, FALSE, TRUE, gdisp->ID); @@ -313,9 +322,9 @@ text_button_press (Tool *tool, &text_tool->click_x, &text_tool->click_y, TRUE, 0); - if ((layer = gimage_pick_correlate_layer (gdisp->gimage, - text_tool->click_x, - text_tool->click_y))) + if ((layer = gimp_image_pick_correlate_layer (gdisp->gimage, + text_tool->click_x, + text_tool->click_y))) /* If there is a floating selection, and this aint it, use the move tool */ if (layer_is_floating_sel (layer)) { @@ -358,7 +367,7 @@ text_cursor_update (Tool *tool, gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, FALSE, FALSE); - if ((layer = gimage_pick_correlate_layer (gdisp->gimage, x, y))) + if ((layer = gimp_image_pick_correlate_layer (gdisp->gimage, x, y))) /* if there is a floating selection, and this aint it... */ if (layer_is_floating_sel (layer)) { @@ -470,7 +479,7 @@ text_init_render (TextTool *text_tool) gdisp = (GDisplay *) text_tool->gdisp_ptr; /* override the user's antialias setting if this is an indexed image */ - if (gimage_base_type (gdisp->gimage) == INDEXED) + if (gimp_image_base_type (gdisp->gimage) == INDEXED) antialias = FALSE; /* If we're anti-aliasing, request a larger font than user specified. @@ -496,7 +505,7 @@ text_init_render (TextTool *text_tool) /* strdup it since the render function strtok()s the text */ text = g_strdup (text); - text_render (gdisp->gimage, gimage_active_drawable (gdisp->gimage), + text_render (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage), text_tool->click_x, text_tool->click_y, fontname, text, text_options->border, antialias); @@ -590,7 +599,7 @@ text_render (GimpImage *gimage, if (drawable) layer_type = drawable_type_with_alpha (drawable); else - layer_type = gimage_base_type_with_alpha (gimage); + layer_type = gimp_image_base_type_with_alpha (gimage); /* scale the text based on the antialiasing amount */ if (antialias) @@ -751,7 +760,7 @@ text_render (GimpImage *gimage, _("Text Layer"), OPAQUE_OPACITY, NORMAL_MODE))) { /* color the layer buffer */ - gimage_get_foreground (gimage, drawable, color); + gimp_image_get_foreground (gimage, drawable, color); color[GIMP_DRAWABLE (layer)->bytes - 1] = OPAQUE_OPACITY; pixel_region_init (&textPR, GIMP_DRAWABLE (layer)->tiles, 0, 0, @@ -782,11 +791,11 @@ text_render (GimpImage *gimage, * it seems like the correct behavior. */ if (! gimage_mask_is_empty (gimage)) - channel_clear (gimage_get_mask (gimage)); + channel_clear (gimp_image_get_mask (gimage)); /* If the drawable id is invalid, create a new layer */ if (drawable == NULL) - gimage_add_layer (gimage, layer, -1); + gimp_image_add_layer (gimage, layer, -1); /* Otherwise, instantiate the text as the new floating selection */ else floating_sel_attach (layer, drawable); diff --git a/app/tools/gimptexttool.h b/app/tools/gimptexttool.h index fb3ea0702e..32deef8d3c 100644 --- a/app/tools/gimptexttool.h +++ b/app/tools/gimptexttool.h @@ -19,8 +19,6 @@ #ifndef __TEXT_TOOL_H__ #define __TEXT_TOOL_H__ -#include "tools.h" - typedef enum { @@ -30,9 +28,9 @@ typedef enum #define SUPERSAMPLE 3 -/* text functions */ + Tool * tools_new_text (void); -void tools_free_text (Tool *); +void tools_free_text (Tool *tool); gboolean text_get_extents (gchar *fontname, gchar *text, diff --git a/app/tools/gimpthresholdtool.c b/app/tools/gimpthresholdtool.c index dbe84f3c7a..90d6cea647 100644 --- a/app/tools/gimpthresholdtool.c +++ b/app/tools/gimpthresholdtool.c @@ -18,15 +18,23 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" #include "drawable.h" #include "gdisplay.h" +#include "gimphistogram.h" +#include "gimpimage.h" #include "gimpui.h" +#include "histogramwidget.h" +#include "image_map.h" +#include "paint_funcs.h" +#include "pixel_region.h" #include "threshold.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpintl.h" @@ -212,7 +220,7 @@ tools_free_threshold (Tool *tool) void threshold_initialize (GDisplay *gdisp) { - if (drawable_indexed (gimage_active_drawable (gdisp->gimage))) + if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Threshold does not operate on indexed drawables.")); return; @@ -228,7 +236,7 @@ threshold_initialize (GDisplay *gdisp) threshold_dialog->low_threshold = 127; threshold_dialog->high_threshold = 255; - threshold_dialog->drawable = gimage_active_drawable (gdisp->gimage); + threshold_dialog->drawable = gimp_image_active_drawable (gdisp->gimage); threshold_dialog->color = drawable_color (threshold_dialog->drawable); threshold_dialog->image_map = image_map_create (gdisp, threshold_dialog->drawable); diff --git a/app/tools/gimpthresholdtool.h b/app/tools/gimpthresholdtool.h index 608c4f67a8..92f8934157 100644 --- a/app/tools/gimpthresholdtool.h +++ b/app/tools/gimpthresholdtool.h @@ -19,10 +19,6 @@ #ifndef __THRESHOLD_H__ #define __THRESHOLD_H__ -#include "image_map.h" -#include "histogramwidget.h" -#include "tools.h" - typedef struct _ThresholdDialog ThresholdDialog; @@ -46,14 +42,15 @@ struct _ThresholdDialog gboolean preview; }; -Tool * tools_new_threshold (void); -void tools_free_threshold (Tool *tool); + +Tool * tools_new_threshold (void); +void tools_free_threshold (Tool *tool); void threshold_dialog_hide (void); -void threshold_initialize (GDisplay *gdisp); -void threshold_2 (void *data, - PixelRegion *srcPR, - PixelRegion *destPR); +void threshold_initialize (GDisplay *gdisp); +void threshold_2 (gpointer data, + PixelRegion *srcPR, + PixelRegion *destPR); #endif /* __THRESHOLD_H__ */ diff --git a/app/tools/histogram_tool.c b/app/tools/histogram_tool.c index 5d31e2fa3f..5cb56d168f 100644 --- a/app/tools/histogram_tool.c +++ b/app/tools/histogram_tool.c @@ -15,20 +15,29 @@ * 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 #include "apptypes.h" #include "appenv.h" #include "drawable.h" #include "gdisplay.h" +#include "gimpimage.h" +#include "gimphistogram.h" #include "gimpui.h" #include "histogram_tool.h" +#include "histogramwidget.h" +#include "pixel_region.h" +#include "tool_options.h" +#include "tools.h" + +#include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" -#include "libgimp/gimpmath.h" + #define TEXT_WIDTH 45 #define GRADIENT_HEIGHT 15 @@ -204,7 +213,7 @@ histogram_tool_initialize (GDisplay *gdisp) { PixelRegion PR; - if (drawable_indexed (gimage_active_drawable (gdisp->gimage))) + if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Histogram does not operate on indexed drawables.")); return; @@ -216,7 +225,7 @@ histogram_tool_initialize (GDisplay *gdisp) else if (!GTK_WIDGET_VISIBLE (histogram_tool_dialog->shell)) gtk_widget_show (histogram_tool_dialog->shell); - histogram_tool_dialog->drawable = gimage_active_drawable (gdisp->gimage); + histogram_tool_dialog->drawable = gimp_image_active_drawable (gdisp->gimage); histogram_tool_dialog->color = drawable_color (histogram_tool_dialog->drawable); /* hide or show the channel menu based on image type */ diff --git a/app/tools/histogram_tool.h b/app/tools/histogram_tool.h index 2c8e0c8b40..825d44e25a 100644 --- a/app/tools/histogram_tool.h +++ b/app/tools/histogram_tool.h @@ -15,14 +15,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __HISTOGRAM_TOOL_H__ #define __HISTOGRAM_TOOL_H__ -#include "histogramwidget.h" -#include "image_map.h" -#include "tools.h" -#define HISTOGRAM_WIDTH 256 +#define HISTOGRAM_WIDTH 256 #define HISTOGRAM_HEIGHT 150 typedef struct _HistogramToolDialog HistogramToolDialog; @@ -61,4 +59,5 @@ void histogram_tool_histogram_range (HistogramWidget *hw, gint end, gpointer data); + #endif /* __HISTOGRAM_TOOL_H__ */ diff --git a/app/tools/hue_saturation.c b/app/tools/hue_saturation.c index a02a97b84b..0caf2f0a6f 100644 --- a/app/tools/hue_saturation.c +++ b/app/tools/hue_saturation.c @@ -15,9 +15,10 @@ * 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 #include "apptypes.h" @@ -25,8 +26,13 @@ #include "drawable.h" #include "gimage_mask.h" #include "gdisplay.h" +#include "gimpimage.h" #include "gimpui.h" #include "hue_saturation.h" +#include "image_map.h" +#include "pixel_region.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpcolorspace.h" #include "libgimp/gimpmath.h" @@ -287,7 +293,7 @@ hue_saturation_initialize (GDisplay *gdisp) { gint i; - if (! drawable_color (gimage_active_drawable (gdisp->gimage))) + if (! drawable_color (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Hue-Saturation operates only on RGB color drawables.")); return; @@ -307,7 +313,7 @@ hue_saturation_initialize (GDisplay *gdisp) hue_saturation_dialog->saturation[i] = 0.0; } - hue_saturation_dialog->drawable = gimage_active_drawable (gdisp->gimage); + hue_saturation_dialog->drawable = gimp_image_active_drawable (gdisp->gimage); hue_saturation_dialog->image_map = image_map_create (gdisp, hue_saturation_dialog->drawable); diff --git a/app/tools/hue_saturation.h b/app/tools/hue_saturation.h index b796dba946..80ee176884 100644 --- a/app/tools/hue_saturation.h +++ b/app/tools/hue_saturation.h @@ -19,9 +19,6 @@ #ifndef __HUE_SATURATION_H__ #define __HUE_SATURATION_H__ -#include "image_map.h" -#include "tools.h" - typedef enum { @@ -57,16 +54,17 @@ struct _HueSaturationDialog gboolean preview; }; -Tool * tools_new_hue_saturation (void); -void tools_free_hue_saturation (Tool *tool); +Tool * tools_new_hue_saturation (void); +void tools_free_hue_saturation (Tool *tool); -void hue_saturation_initialize (GDisplay *gdisp); -void hue_saturation_free (void); -void hue_saturation_dialog_hide (void); -void hue_saturation (PixelRegion *srcPR, - PixelRegion *destPR, - void *data); +void hue_saturation_initialize (GDisplay *gdisp); +void hue_saturation_free (void); +void hue_saturation_dialog_hide (void); +void hue_saturation (PixelRegion *srcPR, + PixelRegion *destPR, + void *data); + +void hue_saturation_calculate_transfers (HueSaturationDialog *hsd); -void hue_saturation_calculate_transfers (HueSaturationDialog *hsd); #endif /* __HUE_SATURATION_H__ */ diff --git a/app/tools/ink.c b/app/tools/ink.c index ec28ff1b3c..3673948f53 100644 --- a/app/tools/ink.c +++ b/app/tools/ink.c @@ -21,7 +21,7 @@ #include #include -#include +#include #include "apptypes.h" @@ -29,6 +29,8 @@ #include "drawable.h" #include "draw_core.h" #include "gimage_mask.h" +#include "gimpcontext.h" +#include "gimpimage.h" #include "gimprc.h" #include "gimpui.h" #include "ink.h" @@ -37,11 +39,16 @@ #include "undo.h" #include "blob.h" #include "gdisplay.h" +#include "paint_funcs.h" +#include "pixel_region.h" +#include "temp_buf.h" +#include "tile.h" +#include "tile_manager.h" -#include "libgimp/gimpintl.h" #include "libgimp/gimpmath.h" -#include "tile.h" /* ick. */ +#include "libgimp/gimpintl.h" + #define SUBSAMPLE 8 @@ -805,7 +812,7 @@ ink_button_press (Tool *tool, /* Keep the coordinates of the target */ gdisplay_untransform_coords_f (gdisp, bevent->x, bevent->y, &x, &y, TRUE); - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); ink_init (ink_tool, drawable, x, y); @@ -872,7 +879,7 @@ ink_button_release (Tool *tool, g_free (ink_tool->last_blob); ink_tool->last_blob = NULL; - ink_finish (ink_tool, gimage_active_drawable (gdisp->gimage), tool->ID); + ink_finish (ink_tool, gimp_image_active_drawable (gdisp->gimage), tool->ID); gdisplays_flush (); } @@ -976,7 +983,7 @@ ink_motion (Tool *tool, ink_tool = (InkTool *) tool->private; gdisplay_untransform_coords_f (gdisp, mevent->x, mevent->y, &x, &y, TRUE); - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); lasttime = ink_tool->last_time; @@ -1038,7 +1045,7 @@ ink_cursor_update (Tool *tool, gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, FALSE, FALSE); - if ((layer = gimage_get_active_layer (gdisp->gimage))) + if ((layer = gimp_image_get_active_layer (gdisp->gimage))) { int off_x, off_y; @@ -1385,7 +1392,7 @@ ink_paste (InkTool *ink_tool, if (!canvas_buf) return; - gimage_get_foreground (gimage, drawable, col); + gimp_image_get_foreground (gimage, drawable, col); /* set the alpha channel */ col[canvas_buf->bytes - 1] = OPAQUE_OPACITY; @@ -1414,12 +1421,12 @@ ink_paste (InkTool *ink_tool, srcPR.data = temp_buf_data (canvas_buf); /* apply the paint area to the gimage */ - gimage_apply_image (gimage, drawable, &srcPR, - FALSE, - (int) (gimp_context_get_opacity (NULL) * 255), - gimp_context_get_paint_mode (NULL), - undo_tiles, /* specify an alternative src1 */ - canvas_buf->x, canvas_buf->y); + gimp_image_apply_image (gimage, drawable, &srcPR, + FALSE, + (int) (gimp_context_get_opacity (NULL) * 255), + gimp_context_get_paint_mode (NULL), + undo_tiles, /* specify an alternative src1 */ + canvas_buf->x, canvas_buf->y); /* Update the undo extents */ ink_tool->x1 = MIN (ink_tool->x1, canvas_buf->x); diff --git a/app/tools/ink.h b/app/tools/ink.h index 6be250088d..3dfb214846 100644 --- a/app/tools/ink.h +++ b/app/tools/ink.h @@ -15,16 +15,16 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __INK_H__ #define __INK_H__ -#include "tools.h" -#include "procedural_db.h" -Tool * tools_new_ink (void); -void tools_free_ink (Tool *); +Tool * tools_new_ink (void); +void tools_free_ink (Tool *tool); /* Procedure definition and marshalling function */ extern ProcRecord ink_proc; + #endif /* __INK_H__ */ diff --git a/app/tools/iscissors.c b/app/tools/iscissors.c index d695c6e91d..cf075959c2 100644 --- a/app/tools/iscissors.c +++ b/app/tools/iscissors.c @@ -28,7 +28,8 @@ * until about 1.1.4) completely changed the algorithm used, until it * bore little resemblance to the one described in the paper above. * The 0.54 version of the algorithm was then forwards ported to 1.1.4 - * by Austin Donnelly. */ + * by Austin Donnelly. + */ #include "config.h" @@ -41,22 +42,27 @@ #include "appenv.h" #include "draw_core.h" -#include "channel_pvt.h" +#include "channel.h" #include "cursorutil.h" #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "iscissors.h" #include "edit_selection.h" #include "paint_funcs.h" +#include "pixel_region.h" #include "selection_options.h" #include "temp_buf.h" #include "tools.h" #include "bezier_selectP.h" #include "scan_convert.h" +#include "tile.h" +#include "tile_manager.h" #include "libgimp/gimpmath.h" + #ifdef DEBUG #define TRC(x) g_print x #define D(x) x @@ -415,7 +421,7 @@ iscissors_button_press (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; iscissors = (Iscissors *) tool->private; - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); gdisplay_untransform_coords (gdisp, bevent->x, bevent->y, &iscissors->x, &iscissors->y, FALSE, FALSE); @@ -493,12 +499,12 @@ iscissors_button_press (Tool *tool, if (((SelectionOptions *) iscissors_options)->feather) channel_feather (iscissors->mask, - gimage_get_mask (gdisp->gimage), + gimp_image_get_mask (gdisp->gimage), ((SelectionOptions *) iscissors_options)->feather_radius, ((SelectionOptions *) iscissors_options)->feather_radius, iscissors->op, 0, 0); else - channel_combine_mask (gimage_get_mask (gdisp->gimage), + channel_combine_mask (gimp_image_get_mask (gdisp->gimage), iscissors->mask, iscissors->op, 0, 0); iscissors_reset (iscissors); diff --git a/app/tools/iscissors.h b/app/tools/iscissors.h index ab21c1de74..a89cb37451 100644 --- a/app/tools/iscissors.h +++ b/app/tools/iscissors.h @@ -15,10 +15,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __ISCISSORS_H__ #define __ISCISSORS_H__ -Tool * tools_new_iscissors (void); -void tools_free_iscissors (Tool *); + +Tool * tools_new_iscissors (void); +void tools_free_iscissors (Tool *tool); + #endif /* __ISCISSORS_H__ */ diff --git a/app/tools/levels.c b/app/tools/levels.c index 13395b4548..7814babaaa 100644 --- a/app/tools/levels.c +++ b/app/tools/levels.c @@ -23,20 +23,23 @@ #include #include -#include +#include #include "apptypes.h" #include "appenv.h" #include "drawable.h" #include "gdisplay.h" -#include "histogramwidget.h" #include "gimphistogram.h" +#include "gimpimage.h" #include "gimpui.h" +#include "histogramwidget.h" #include "image_map.h" #include "levels.h" #include "gimplut.h" #include "lut_funcs.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpenv.h" #include "libgimp/gimpmath.h" @@ -239,7 +242,7 @@ levels_initialize (GDisplay *gdisp) { gint i; - if (drawable_indexed (gimage_active_drawable (gdisp->gimage))) + if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Levels for indexed drawables cannot be adjusted.")); return; @@ -263,7 +266,7 @@ levels_initialize (GDisplay *gdisp) levels_dialog->high_output[i] = 255; } - levels_dialog->drawable = gimage_active_drawable (gdisp->gimage); + levels_dialog->drawable = gimp_image_active_drawable (gdisp->gimage); levels_dialog->color = drawable_color (levels_dialog->drawable); levels_dialog->image_map = image_map_create (gdisp, levels_dialog->drawable); diff --git a/app/tools/levels.h b/app/tools/levels.h index 462f317229..11be1c59ff 100644 --- a/app/tools/levels.h +++ b/app/tools/levels.h @@ -15,16 +15,17 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __LEVELS_H__ #define __LEVELS_H__ -#include "tools.h" -Tool * tools_new_levels (void); -void tools_free_levels (Tool *tool); +Tool * tools_new_levels (void); +void tools_free_levels (Tool *tool); void levels_dialog_hide (void); -void levels_initialize (GDisplay *gdisp); -void levels_free (void); +void levels_initialize (GDisplay *gdisp); +void levels_free (void); + #endif /* __LEVELS_H__ */ diff --git a/app/tools/magnify.c b/app/tools/magnify.c index 9a38d49edf..25a9e8c90c 100644 --- a/app/tools/magnify.c +++ b/app/tools/magnify.c @@ -34,10 +34,12 @@ #include "info_window.h" #include "magnify.h" #include "scale.h" +#include "tools.h" +#include "tool_options.h" -#include "config.h" #include "libgimp/gimpintl.h" + /* the magnify structures */ typedef struct _Magnify Magnify; diff --git a/app/tools/magnify.h b/app/tools/magnify.h index 4d43694e00..4f70b77bb7 100644 --- a/app/tools/magnify.h +++ b/app/tools/magnify.h @@ -15,16 +15,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __MAGNIFY_H__ #define __MAGNIFY_H__ -#include "tools.h" -/* magnify functions */ +Tool * tools_new_magnify (void); +void tools_free_magnify (Tool *tool); -Tool * tools_new_magnify (void); -void tools_free_magnify (Tool *tool); +void magnify_draw (Tool *tool); -void magnify_draw (Tool *tool); #endif /* __MAGNIFY_H__ */ diff --git a/app/tools/measure.c b/app/tools/measure.c index 69d0d141b1..4e12bec9e5 100644 --- a/app/tools/measure.c +++ b/app/tools/measure.c @@ -21,19 +21,24 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" #include "draw_core.h" +#include "gdisplay.h" +#include "gimpimage.h" #include "gimpui.h" #include "info_dialog.h" #include "measure.h" #include "undo.h" +#include "tools.h" +#include "tool_options.h" + +#include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" -#include "libgimp/gimpmath.h" /* definitions */ diff --git a/app/tools/measure.h b/app/tools/measure.h index 79b21261ea..c9004833bc 100644 --- a/app/tools/measure.h +++ b/app/tools/measure.h @@ -15,15 +15,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __MEASURE_H__ #define __MEASURE_H__ -#include "tools.h" -/* measure functions */ - -Tool * tools_new_measure_tool (void); -void tools_free_measure_tool (Tool *); +Tool * tools_new_measure_tool (void); +void tools_free_measure_tool (Tool *tool); #endif /* __MEASURE_H__ */ diff --git a/app/tools/move.c b/app/tools/move.c index 4793b51fcd..3b8e416564 100644 --- a/app/tools/move.c +++ b/app/tools/move.c @@ -29,9 +29,14 @@ #include "edit_selection.h" #include "floating_sel.h" #include "gimage_mask.h" -#include "gdisplay.h" +#include "gimpimage.h" #include "gdisplay_ops.h" +#include "gdisplay.h" +#include "layer.h" #include "move.h" +#include "selection.h" +#include "tools.h" +#include "tool_options.h" #include "undo.h" #include "config.h" @@ -107,9 +112,9 @@ move_tool_button_press (Tool *tool, undo_push_guide (gdisp->gimage, guide); gdisplays_expose_guide (gdisp->gimage, guide); - gimage_remove_guide (gdisp->gimage, guide); + gimp_image_remove_guide (gdisp->gimage, guide); gdisplay_flush (gdisp); - gimage_add_guide (gdisp->gimage, guide); + gimp_image_add_guide (gdisp->gimage, guide); move->guide = guide; move->disp = gdisp; @@ -119,20 +124,20 @@ move_tool_button_press (Tool *tool, move_tool_motion (tool, NULL, gdisp); } - else if ((layer = gimage_pick_correlate_layer (gdisp->gimage, x, y))) + else if ((layer = gimp_image_pick_correlate_layer (gdisp->gimage, x, y))) { /* If there is a floating selection, and this aint it, * use the move tool */ - if (gimage_floating_sel (gdisp->gimage) && + if (gimp_image_floating_sel (gdisp->gimage) && !layer_is_floating_sel (layer)) { - move->layer = gimage_floating_sel (gdisp->gimage); + move->layer = gimp_image_floating_sel (gdisp->gimage); } /* Otherwise, init the edit selection */ else { - gimage_set_active_layer (gdisp->gimage, layer); + gimp_image_set_active_layer (gdisp->gimage, layer); init_edit_selection (tool, gdisp_ptr, bevent, EDIT_LAYER_TRANSLATE); } tool->state = ACTIVE; @@ -373,10 +378,10 @@ move_tool_cursor_update (Tool *tool, move->disp = gdisp; } } - else if ((layer = gimage_pick_correlate_layer (gdisp->gimage, x, y))) + else if ((layer = gimp_image_pick_correlate_layer (gdisp->gimage, x, y))) { /* if there is a floating selection, and this aint it... */ - if (gimage_floating_sel (gdisp->gimage) && + if (gimp_image_floating_sel (gdisp->gimage) && !layer_is_floating_sel (layer)) gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR, RECT_SELECT, @@ -461,7 +466,7 @@ move_tool_start_hguide (Tool *tool, if (private->guide && private->disp && private->disp->gimage) gdisplay_draw_guide (private->disp, private->guide, FALSE); - private->guide = gimage_add_hguide (gdisp->gimage); + private->guide = gimp_image_add_hguide (gdisp->gimage); private->disp = gdisp; tool->state = ACTIVE; @@ -485,7 +490,7 @@ move_tool_start_vguide (Tool *tool, if (private->guide && private->disp && private->disp->gimage) gdisplay_draw_guide (private->disp, private->guide, FALSE); - private->guide = gimage_add_vguide (gdisp->gimage); + private->guide = gimp_image_add_vguide (gdisp->gimage); private->disp = gdisp; tool->state = ACTIVE; diff --git a/app/tools/move.h b/app/tools/move.h index 1c1e2cc007..f4f97c1c46 100644 --- a/app/tools/move.h +++ b/app/tools/move.h @@ -15,12 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __MOVE_H__ #define __MOVE_H__ -#include "tools.h" - -/* move functions */ void move_tool_start_hguide (Tool *tool, GDisplay *gdisp); diff --git a/app/tools/paint_core.c b/app/tools/paint_core.c index 7a1642e99d..b6ca82f003 100644 --- a/app/tools/paint_core.c +++ b/app/tools/paint_core.c @@ -21,29 +21,35 @@ #include #include -#include +#include #include "apptypes.h" #include "appenv.h" #include "brush_scale.h" +#include "cursorutil.h" #include "devices.h" +#include "draw_core.h" #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" #include "gimpbrushpipe.h" +#include "gimpcontext.h" +#include "gimpimage.h" #include "gimprc.h" -#include "gradient.h" /* for grad_get_color_at() */ +#include "gradient.h" #include "paint_funcs.h" #include "paint_core.h" +#include "pixel_region.h" #include "selection.h" +#include "temp_buf.h" +#include "tile.h" +#include "tile_manager.h" #include "tools.h" #include "undo.h" -#include "cursorutil.h" - -#include "tile.h" /* ick. */ #include "libgimp/gimpmath.h" + #include "libgimp/gimpintl.h" #include "paint_core_kernels.h" @@ -209,7 +215,7 @@ paint_core_button_press (Tool *tool, gdisplay_untransform_coords_f (gdisp, (double) bevent->x, (double) bevent->y, &x, &y, TRUE); - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); if (! paint_core_init (paint_core, drawable, x, y)) return; @@ -394,7 +400,7 @@ paint_core_button_release (Tool *tool, /* Let the specific painting function finish up */ (* paint_core->paint_func) (paint_core, - gimage_active_drawable (gdisp->gimage), + gimp_image_active_drawable (gdisp->gimage), FINISH_PAINT); /* Set tool state to inactive -- no longer painting */ @@ -403,7 +409,8 @@ paint_core_button_release (Tool *tool, paint_core->pick_state = FALSE; - paint_core_finish (paint_core, gimage_active_drawable (gdisp->gimage), tool->ID); + paint_core_finish (paint_core, gimp_image_active_drawable (gdisp->gimage), + tool->ID); gdisplays_flush (); } @@ -423,7 +430,7 @@ paint_core_motion (Tool *tool, if (paint_core->pick_state) { - paint_core_sample_color (gimage_active_drawable (gdisp->gimage), + paint_core_sample_color (gimp_image_active_drawable (gdisp->gimage), paint_core->curx, paint_core->cury, mevent->state); return; @@ -437,18 +444,19 @@ paint_core_motion (Tool *tool, #endif /* GTK_HAVE_SIX_VALUATORS */ paint_core->state = mevent->state; - paint_core_interpolate (paint_core, gimage_active_drawable (gdisp->gimage)); + paint_core_interpolate (paint_core, + gimp_image_active_drawable (gdisp->gimage)); if (paint_core->flags & TOOL_TRACES_ON_WINDOW) (* paint_core->paint_func) (paint_core, - gimage_active_drawable (gdisp->gimage), + gimp_image_active_drawable (gdisp->gimage), PRETRACE_PAINT); gdisplay_flush_now (gdisp); if (paint_core->flags & TOOL_TRACES_ON_WINDOW) (* paint_core->paint_func) (paint_core, - gimage_active_drawable (gdisp->gimage), + gimp_image_active_drawable (gdisp->gimage), POSTTRACE_PAINT); paint_core->lastx = paint_core->curx; @@ -493,7 +501,7 @@ paint_core_cursor_update (Tool *tool, if (paint_core->context_id) gtk_statusbar_pop (GTK_STATUSBAR (gdisp->statusbar), paint_core->context_id); - if ((layer = gimage_get_active_layer (gdisp->gimage))) + if ((layer = gimp_image_get_active_layer (gdisp->gimage))) { /* If shift is down and this is not the first paint stroke, draw a line */ if (gdisp_ptr == tool->gdisp_ptr && (mevent->state & GDK_SHIFT_MASK)) @@ -642,7 +650,7 @@ paint_core_control (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; paint_core = (PaintCore *) tool->private; - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); switch (action) { @@ -1627,10 +1635,10 @@ paint_core_paste (PaintCore *paint_core, srcPR.data = temp_buf_data (canvas_buf); /* apply the paint area to the gimage */ - gimage_apply_image (gimage, drawable, &srcPR, - FALSE, image_opacity, paint_mode, - alt, /* specify an alternative src1 */ - canvas_buf->x, canvas_buf->y); + gimp_image_apply_image (gimage, drawable, &srcPR, + FALSE, image_opacity, paint_mode, + alt, /* specify an alternative src1 */ + canvas_buf->x, canvas_buf->y); /* Update the undo extents */ paint_core->x1 = MIN (paint_core->x1, canvas_buf->x); @@ -1725,10 +1733,10 @@ paint_core_replace (PaintCore *paint_core, srcPR.data = temp_buf_data (canvas_buf); /* apply the paint area to the gimage */ - gimage_replace_image (gimage, drawable, &srcPR, - FALSE, image_opacity, - &maskPR, - canvas_buf->x, canvas_buf->y); + gimp_image_replace_image (gimage, drawable, &srcPR, + FALSE, image_opacity, + &maskPR, + canvas_buf->x, canvas_buf->y); /* Update the undo extents */ paint_core->x1 = MIN (paint_core->x1, canvas_buf->x); @@ -2126,7 +2134,7 @@ paint_line_pixmap_mask (GimpImage *dest, d[byte_loop] *= alpha; /* printf("i: %i d->r: %i d->g: %i d->b: %i d->a: %i\n",i,(int)d[0], (int)d[1], (int)d[2], (int)d[3]); */ - gimage_transform_color (dest, drawable, p, d, RGB); + gimp_image_transform_color (dest, drawable, p, d, RGB); d += bytes; } } @@ -2142,7 +2150,7 @@ paint_line_pixmap_mask (GimpImage *dest, /* multiply alpha into the pixmap data */ /* maybe we could do this at tool creation or brush switch time? */ /* and compute it for the whole brush at once and cache it? */ - gimage_transform_color (dest, drawable, p, d, RGB); + gimp_image_transform_color (dest, drawable, p, d, RGB); d += bytes; } } diff --git a/app/tools/paint_core.h b/app/tools/paint_core.h index b570d220b1..bc6ade3edd 100644 --- a/app/tools/paint_core.h +++ b/app/tools/paint_core.h @@ -15,13 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __PAINT_CORE_H__ #define __PAINT_CORE_H__ -#include "apptypes.h" -#include "draw_core.h" -#include "temp_buf.h" -#include "gimpbrush.h" /* the different states that the painting function can be called with */ @@ -48,7 +45,8 @@ typedef enum /*< skip >*/ } ToolFlags; typedef void * (* PaintFunc) (PaintCore *, GimpDrawable *, int); -struct _paint_core + +struct _PaintCore { DrawCore * core; /* Core select object */ diff --git a/app/tools/paintbrush.c b/app/tools/paintbrush.c index 458754d050..25d9ff065e 100644 --- a/app/tools/paintbrush.c +++ b/app/tools/paintbrush.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include "apptypes.h" @@ -26,6 +26,9 @@ #include "drawable.h" #include "gdisplay.h" #include "gimpbrushlist.h" +#include "gimpbrush.h" +#include "gimpcontext.h" +#include "gimpimage.h" #include "gimpui.h" #include "gradient.h" #include "paint_funcs.h" @@ -33,7 +36,9 @@ #include "paint_options.h" #include "paintbrush.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" +#include "tool_options.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpunitmenu.h" @@ -103,11 +108,15 @@ static GimpUnit non_gui_gradient_unit; /* forward function declarations */ -static void paintbrush_motion (PaintCore *, GimpDrawable *, +static void paintbrush_motion (PaintCore *, + GimpDrawable *, PaintPressureOptions *, - double, double, PaintApplicationMode, + gdouble, + gdouble, + PaintApplicationMode, GradientPaintMode); + /* functions */ static void @@ -366,14 +375,14 @@ paintbrush_paint_func (PaintCore *paint_core, #endif switch (state) { - case INIT_PAINT : + case INIT_PAINT: #if TIMED_BRUSH timer = g_timer_new(); g_timer_start(timer); #endif /* TIMED_BRUSH */ break; - case MOTION_PAINT : + case MOTION_PAINT: switch (paintbrush_options->fade_unit) { case GIMP_UNIT_PIXEL: @@ -555,7 +564,7 @@ paintbrush_motion (PaintCore *paint_core, } else { - gimage_get_foreground (gimage, drawable, col); + gimp_image_get_foreground (gimage, drawable, col); col[area->bytes - 1] = OPAQUE_OPACITY; color_pixels (temp_buf_data (area), col, area->width * area->height, area->bytes); diff --git a/app/tools/paintbrush.h b/app/tools/paintbrush.h index 950e510c38..ee55408ed8 100644 --- a/app/tools/paintbrush.h +++ b/app/tools/paintbrush.h @@ -15,19 +15,26 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __PAINTBRUSH_H__ #define __PAINTBRUSH_H__ -#include "tools.h" -#include "paint_core.h" -void * paintbrush_paint_func (PaintCore *, GimpDrawable *, int); -gboolean paintbrush_non_gui (GimpDrawable *, int, double *, double, - int, double); -gboolean paintbrush_non_gui_default (GimpDrawable *, int, - double *); +void * paintbrush_paint_func (PaintCore *, + GimpDrawable *, + gint ); +gboolean paintbrush_non_gui (GimpDrawable *, + gint , + gdouble *, + gdouble , + gint , + gdouble ); +gboolean paintbrush_non_gui_default (GimpDrawable *, + gint , + gdouble *); + +Tool * tools_new_paintbrush (void); +void tools_free_paintbrush (Tool *tool); -Tool * tools_new_paintbrush (void); -void tools_free_paintbrush (Tool *); #endif /* __PAINTBRUSH_H__ */ diff --git a/app/tools/pencil.c b/app/tools/pencil.c index 69fc36f889..860d3da779 100644 --- a/app/tools/pencil.c +++ b/app/tools/pencil.c @@ -18,13 +18,16 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" #include "drawable.h" #include "gdisplay.h" +#include "gimpbrush.h" +#include "gimpcontext.h" +#include "gimpimage.h" #include "gradient.h" #include "paint_funcs.h" #include "paint_core.h" @@ -32,7 +35,9 @@ #include "paintbrush.h" #include "pencil.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" +#include "tool_options.h" /* the pencil tool options */ @@ -180,7 +185,7 @@ pencil_motion (PaintCore *paint_core, } else { - gimage_get_foreground (gimage, drawable, col); + gimp_image_get_foreground (gimage, drawable, col); col[area->bytes - 1] = OPAQUE_OPACITY; color_pixels (temp_buf_data (area), col, area->width * area->height, area->bytes); diff --git a/app/tools/pencil.h b/app/tools/pencil.h index b65ea78a19..5bdadd451c 100644 --- a/app/tools/pencil.h +++ b/app/tools/pencil.h @@ -15,16 +15,20 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __PENCIL_H__ #define __PENCIL_H__ -#include "tools.h" -#include "paint_core.h" -void * pencil_paint_func (PaintCore *, GimpDrawable *, int); -gboolean pencil_non_gui (GimpDrawable *, int, double *); +void * pencil_paint_func (PaintCore *, + GimpDrawable *, + gint ); +gboolean pencil_non_gui (GimpDrawable *, + gint , + gdouble *); + +Tool * tools_new_pencil (void); +void tools_free_pencil (Tool *tool); -Tool * tools_new_pencil (void); -void tools_free_pencil (Tool *); #endif /* __PENCIL_H__ */ diff --git a/app/tools/perspective_tool.c b/app/tools/perspective_tool.c index 5f320fbb9e..166e4fb6fa 100644 --- a/app/tools/perspective_tool.c +++ b/app/tools/perspective_tool.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include "apptypes.h" @@ -26,16 +26,20 @@ #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" +#include "gimpprogress.h" +#include "gimpui.h" #include "info_dialog.h" #include "perspective_tool.h" #include "selection.h" +#include "tile_manager_pvt.h" +#include "tools.h" +#include "transform_core.h" #include "transform_tool.h" #include "undo.h" #include "libgimp/gimpintl.h" -#include "tile_manager_pvt.h" - /* storage for information dialog fields */ static gchar matrix_row_buf [3][MAX_INFO_BUF]; @@ -58,7 +62,7 @@ perspective_tool_transform (Tool *tool, switch (state) { - case INIT: + case TRANSFORM_INIT: if (!transform_info) { transform_info = @@ -84,21 +88,21 @@ perspective_tool_transform (Tool *tool, return NULL; break; - case MOTION: + case TRANSFORM_MOTION: perspective_tool_motion (tool, gdisp_ptr); perspective_tool_recalc (tool, gdisp_ptr); break; - case RECALC: + case TRANSFORM_RECALC: perspective_tool_recalc (tool, gdisp_ptr); break; - case FINISH: + case TRANSFORM_FINISH: /* Let the transform core handle the inverse mapping */ gtk_widget_set_sensitive (GTK_WIDGET (transform_info->shell), FALSE); return perspective_tool_perspective (gdisp->gimage, - gimage_active_drawable (gdisp->gimage), + gimp_image_active_drawable (gdisp->gimage), gdisp, transform_core->original, transform_tool_smoothing (), @@ -184,19 +188,19 @@ perspective_tool_motion (Tool *tool, switch (transform_core->function) { - case HANDLE_1: + case TRANSFORM_HANDLE_1: transform_core->trans_info [X0] += diff_x; transform_core->trans_info [Y0] += diff_y; break; - case HANDLE_2: + case TRANSFORM_HANDLE_2: transform_core->trans_info [X1] += diff_x; transform_core->trans_info [Y1] += diff_y; break; - case HANDLE_3: + case TRANSFORM_HANDLE_3: transform_core->trans_info [X2] += diff_x; transform_core->trans_info [Y2] += diff_y; break; - case HANDLE_4: + case TRANSFORM_HANDLE_4: transform_core->trans_info [X3] += diff_x; transform_core->trans_info [Y3] += diff_y; break; diff --git a/app/tools/perspective_tool.h b/app/tools/perspective_tool.h index e79c88b0f0..611a85ecc1 100644 --- a/app/tools/perspective_tool.h +++ b/app/tools/perspective_tool.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __PERSPECTIVE_TOOL_H__ #define __PERSPECTIVE_TOOL_H__ -#include "tools.h" -#include "transform_core.h" TileManager * perspective_tool_transform (Tool *tool, gpointer gdisp_ptr, @@ -33,7 +32,8 @@ TileManager * perspective_tool_perspective (GimpImage *gimage, void perspective_find_transform (gdouble *coords, GimpMatrix3 matrix); -Tool * tools_new_perspective_tool (void); -void tools_free_perspective_tool (Tool *tool); +Tool * tools_new_perspective_tool (void); +void tools_free_perspective_tool (Tool *tool); + #endif /* __PERSPECTIVE_TOOL_H__ */ diff --git a/app/tools/posterize.c b/app/tools/posterize.c index 0f64de091f..c8c7cc728b 100644 --- a/app/tools/posterize.c +++ b/app/tools/posterize.c @@ -18,18 +18,21 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" #include "drawable.h" #include "gdisplay.h" -#include "image_map.h" -#include "posterize.h" +#include "gimpimage.h" #include "gimplut.h" #include "gimpui.h" +#include "image_map.h" #include "lut_funcs.h" +#include "posterize.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpintl.h" @@ -153,7 +156,7 @@ tools_free_posterize (Tool *tool) void posterize_initialize (GDisplay *gdisp) { - if (drawable_indexed (gimage_active_drawable (gdisp->gimage))) + if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Posterize does not operate on indexed drawables.")); return; @@ -168,7 +171,7 @@ posterize_initialize (GDisplay *gdisp) posterize_dialog->levels = 3; - posterize_dialog->drawable = gimage_active_drawable (gdisp->gimage); + posterize_dialog->drawable = gimp_image_active_drawable (gdisp->gimage); posterize_dialog->image_map = image_map_create (gdisp, posterize_dialog->drawable); diff --git a/app/tools/posterize.h b/app/tools/posterize.h index 5e1ebdfa4d..3b16c85bb4 100644 --- a/app/tools/posterize.h +++ b/app/tools/posterize.h @@ -15,10 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __POSTERIZE_H__ #define __POSTERIZE_H__ -#include "tools.h" Tool * tools_new_posterize (void); void tools_free_posterize (Tool *tool); @@ -26,4 +26,5 @@ void tools_free_posterize (Tool *tool); void posterize_dialog_hide (void); void posterize_initialize (GDisplay *gdisp); + #endif /* __POSTERIZE_H__ */ diff --git a/app/tools/rect_select.c b/app/tools/rect_select.c index dc42bcf149..3dbca9e287 100644 --- a/app/tools/rect_select.c +++ b/app/tools/rect_select.c @@ -26,14 +26,19 @@ #include "apptypes.h" #include "appenv.h" +#include "channel.h" +#include "cursorutil.h" +#include "draw_core.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "edit_selection.h" #include "floating_sel.h" #include "rect_select.h" #include "rect_selectP.h" #include "selection_options.h" -#include "cursorutil.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpunitmenu.h" @@ -91,8 +96,8 @@ rect_select (GimpImage *gimage, if (feather) { new_mask = channel_new_mask (gimage, gimage->width, gimage->height); - channel_combine_rect (new_mask, ADD, x, y, w, h); - channel_feather (new_mask, gimage_get_mask (gimage), + channel_combine_rect (new_mask, CHANNEL_OP_ADD, x, y, w, h); + channel_feather (new_mask, gimp_image_get_mask (gimage), feather_radius, feather_radius, op, 0, 0); @@ -101,12 +106,12 @@ rect_select (GimpImage *gimage, else if (op == SELECTION_INTERSECT) { new_mask = channel_new_mask (gimage, gimage->width, gimage->height); - channel_combine_rect (new_mask, ADD, x, y, w, h); - channel_combine_mask (gimage_get_mask (gimage), new_mask, op, 0, 0); + channel_combine_rect (new_mask, CHANNEL_OP_ADD, x, y, w, h); + channel_combine_mask (gimp_image_get_mask (gimage), new_mask, op, 0, 0); channel_delete (new_mask); } else - channel_combine_rect (gimage_get_mask (gimage), op, x, y, w, h); + channel_combine_rect (gimp_image_get_mask (gimage), op, x, y, w, h); } void @@ -253,8 +258,8 @@ rect_select_button_release (Tool *tool, if ((!w || !h) && !rect_sel->fixed_size) { /* If there is a floating selection, anchor it */ - if (gimage_floating_sel (gdisp->gimage)) - floating_sel_anchor (gimage_floating_sel (gdisp->gimage)); + if (gimp_image_floating_sel (gdisp->gimage)) + floating_sel_anchor (gimp_image_floating_sel (gdisp->gimage)); /* Otherwise, clear the selection mask */ else gimage_mask_clear (gdisp->gimage); @@ -504,8 +509,8 @@ selection_tool_update_op_state (RectSelect *rect_sel, gdisplay_untransform_coords (gdisp, x, y, &tx, &ty, FALSE, FALSE); - layer = gimage_pick_correlate_layer (gdisp->gimage, tx, ty); - floating_sel = gimage_floating_sel (gdisp->gimage); + layer = gimp_image_pick_correlate_layer (gdisp->gimage, tx, ty); + floating_sel = gimp_image_floating_sel (gdisp->gimage); if (state & GDK_MOD1_MASK && !gimage_mask_is_empty (gdisp->gimage)) diff --git a/app/tools/rect_select.h b/app/tools/rect_select.h index e070713026..ffc764b9db 100644 --- a/app/tools/rect_select.h +++ b/app/tools/rect_select.h @@ -15,33 +15,47 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __RECT_SELECT_H__ #define __RECT_SELECT_H__ -#include "apptypes.h" -#include "tools.h" /* rect select action functions */ -void rect_select_button_press (Tool *, GdkEventButton *, gpointer); -void rect_select_button_release (Tool *, GdkEventButton *, gpointer); -void rect_select_motion (Tool *, GdkEventMotion *, gpointer); -void rect_select_modifier_update (Tool *, GdkEventKey * , gpointer); -void rect_select_cursor_update (Tool *, GdkEventMotion *, gpointer); -void rect_select_oper_update (Tool *, GdkEventMotion *, gpointer); -void rect_select_control (Tool *, ToolAction, gpointer); +void rect_select_button_press (Tool *tool, + GdkEventButton *bevent, + gpointer gdisp_ptr); +void rect_select_button_release (Tool *tool, + GdkEventButton *bevent, + gpointer gdisp_ptr); +void rect_select_motion (Tool *tool, + GdkEventMotion *mevent, + gpointer gdisp_ptr); +void rect_select_modifier_update (Tool *tool, + GdkEventKey *kevent, + gpointer gdisp_ptr); +void rect_select_cursor_update (Tool *tool, + GdkEventMotion *mevent, + gpointer gdisp_ptr); +void rect_select_oper_update (Tool *tool, + GdkEventMotion *mevent, + gpointer gdisp_ptr); +void rect_select_control (Tool *tool, + ToolAction tool_action, + gpointer gdisp_ptr); /* rect select functions */ -void rect_select_draw (Tool *tool); -void rect_select (GimpImage *gimage, - gint x, - gint y, - gint w, - gint g, - SelectOps op, - gboolean feather, - gdouble feather_radius); +void rect_select_draw (Tool *tool); +void rect_select (GimpImage *gimage, + gint x, + gint y, + gint w, + gint g, + SelectOps op, + gboolean feather, + gdouble feather_radius); Tool * tools_new_rect_select (void); -void tools_free_rect_select (Tool *tool); +void tools_free_rect_select (Tool *tool); + #endif /* __RECT_SELECT_H__ */ diff --git a/app/tools/rect_selectP.h b/app/tools/rect_selectP.h index 31b3a84bb8..cce1e57051 100644 --- a/app/tools/rect_selectP.h +++ b/app/tools/rect_selectP.h @@ -15,10 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __RECT_SELECTP_H__ #define __RECT_SELECTP_H__ -#include "draw_core.h" typedef struct _RectSelect RectSelect, EllipseSelect; @@ -43,4 +43,5 @@ struct _RectSelect guint context_id; /* for the statusbar */ }; + #endif /* __RECT_SELECTP_H__ */ diff --git a/app/tools/rotate_tool.c b/app/tools/rotate_tool.c index 133795c827..75b33552d7 100644 --- a/app/tools/rotate_tool.c +++ b/app/tools/rotate_tool.c @@ -18,26 +18,34 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" +#include "draw_core.h" #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" +#include "gimpprogress.h" +#include "gimpui.h" #include "info_dialog.h" #include "rotate_tool.h" #include "selection.h" +#include "tile_manager_pvt.h" +#include "tools.h" +#include "tool_options.h" +#include "transform_core.h" #include "transform_tool.h" #include "undo.h" -#include "tile_manager_pvt.h" - #include "libgimp/gimpsizeentry.h" -#include "libgimp/gimpintl.h" #include "libgimp/gimpmath.h" +#include "libgimp/gimpintl.h" + + /* index into trans_info array */ #define ANGLE 0 #define REAL_ANGLE 1 @@ -78,7 +86,7 @@ rotate_tool_transform (Tool *tool, switch (state) { - case INIT: + case TRANSFORM_INIT: angle_val = 0.0; center_vals[0] = transform_core->cx; center_vals[1] = transform_core->cy; @@ -165,19 +173,19 @@ rotate_tool_transform (Tool *tool, return NULL; break; - case MOTION: + case TRANSFORM_MOTION: rotate_tool_motion (tool, gdisp_ptr); rotate_tool_recalc (tool, gdisp_ptr); break; - case RECALC: + case TRANSFORM_RECALC: rotate_tool_recalc (tool, gdisp_ptr); break; - case FINISH: + case TRANSFORM_FINISH: gtk_widget_set_sensitive (GTK_WIDGET (transform_info->shell), FALSE); return rotate_tool_rotate (gdisp->gimage, - gimage_active_drawable (gdisp->gimage), + gimp_image_active_drawable (gdisp->gimage), gdisp, transform_core->trans_info[ANGLE], transform_core->original, @@ -304,7 +312,7 @@ rotate_tool_motion (Tool *tool, transform_core = (TransformCore *) tool->private; - if (transform_core->function == HANDLE_CENTER) + if (transform_core->function == TRANSFORM_HANDLE_CENTER) { transform_core->cx = transform_core->curx; transform_core->cy = transform_core->cury; diff --git a/app/tools/rotate_tool.h b/app/tools/rotate_tool.h index 2bd327eabd..a466d1411d 100644 --- a/app/tools/rotate_tool.h +++ b/app/tools/rotate_tool.h @@ -15,24 +15,24 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __ROTATE_TOOL_H__ #define __ROTATE_TOOL_H__ -#include "tools.h" -#include "transform_core.h" -TileManager * rotate_tool_transform (Tool *tool, - gpointer gdisp_ptr, - TransformState state); -TileManager * rotate_tool_rotate (GimpImage *gimage, - GimpDrawable *drawable, - GDisplay *gdisp, - gdouble angle, - TileManager *float_tiles, - gboolean interpolation, - GimpMatrix3 matrix); +TileManager * rotate_tool_transform (Tool *tool, + gpointer gdisp_ptr, + TransformState state); +TileManager * rotate_tool_rotate (GimpImage *gimage, + GimpDrawable *drawable, + GDisplay *gdisp, + gdouble angle, + TileManager *float_tiles, + gboolean interpolation, + GimpMatrix3 matrix); + +Tool * tools_new_rotate_tool (void); +void tools_free_rotate_tool (Tool *tool); -Tool * tools_new_rotate_tool (void); -void tools_free_rotate_tool (Tool *tool); #endif /* __ROTATE_TOOL_H__ */ diff --git a/app/tools/scale_tool.c b/app/tools/scale_tool.c index 939b9e7830..edce4cd856 100644 --- a/app/tools/scale_tool.c +++ b/app/tools/scale_tool.c @@ -18,17 +18,24 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" +#include "draw_core.h" #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" +#include "gimpprogress.h" +#include "gimpui.h" #include "info_dialog.h" #include "scale_tool.h" #include "selection.h" +#include "tools.h" +#include "tool_options.h" +#include "transform_core.h" #include "transform_tool.h" #include "undo.h" @@ -72,7 +79,7 @@ scale_tool_transform (Tool *tool, switch (state) { - case INIT: + case TRANSFORM_INIT: size_vals[0] = transform_core->x2 - transform_core->x1; size_vals[1] = transform_core->y2 - transform_core->y1; @@ -155,19 +162,19 @@ scale_tool_transform (Tool *tool, return NULL; break; - case MOTION: + case TRANSFORM_MOTION: scale_tool_motion (tool, gdisp_ptr); scale_tool_recalc (tool, gdisp_ptr); break; - case RECALC: + case TRANSFORM_RECALC: scale_tool_recalc (tool, gdisp_ptr); break; - case FINISH: + case TRANSFORM_FINISH: gtk_widget_set_sensitive (GTK_WIDGET (transform_info->shell), FALSE); return scale_tool_scale (gdisp->gimage, - gimage_active_drawable (gdisp->gimage), + gimp_image_active_drawable (gdisp->gimage), gdisp, transform_core->trans_info, transform_core->original, @@ -341,14 +348,14 @@ scale_tool_motion (Tool *tool, switch (transform_core->function) { - case HANDLE_1: + case TRANSFORM_HANDLE_1: x1 = &transform_core->trans_info [X0]; y1 = &transform_core->trans_info [Y0]; x2 = &transform_core->trans_info [X1]; y2 = &transform_core->trans_info [Y1]; dir_x = dir_y = 1; break; - case HANDLE_2: + case TRANSFORM_HANDLE_2: x1 = &transform_core->trans_info [X1]; y1 = &transform_core->trans_info [Y0]; x2 = &transform_core->trans_info [X0]; @@ -356,7 +363,7 @@ scale_tool_motion (Tool *tool, dir_x = -1; dir_y = 1; break; - case HANDLE_3: + case TRANSFORM_HANDLE_3: x1 = &transform_core->trans_info [X0]; y1 = &transform_core->trans_info [Y1]; x2 = &transform_core->trans_info [X1]; @@ -364,7 +371,7 @@ scale_tool_motion (Tool *tool, dir_x = 1; dir_y = -1; break; - case HANDLE_4: + case TRANSFORM_HANDLE_4: x1 = &transform_core->trans_info [X1]; y1 = &transform_core->trans_info [Y1]; x2 = &transform_core->trans_info [X0]; @@ -454,22 +461,22 @@ scale_tool_recalc (Tool *tool, switch (transform_core->function) { - case HANDLE_1: + case TRANSFORM_HANDLE_1: cx = x2; cy = y2; diffx = x2 - transform_core->x2; diffy = y2 - transform_core->y2; break; - case HANDLE_2: + case TRANSFORM_HANDLE_2: cx = x1; cy = y2; diffx = x1 - transform_core->x1; diffy = y2 - transform_core->y2; break; - case HANDLE_3: + case TRANSFORM_HANDLE_3: cx = x2; cy = y1; diffx = x2 - transform_core->x2; diffy = y1 - transform_core->y1; break; - case HANDLE_4: + case TRANSFORM_HANDLE_4: cx = x1; cy = y1; diffx = x1 - transform_core->x1; diffy = y1 - transform_core->y1; diff --git a/app/tools/scale_tool.h b/app/tools/scale_tool.h index 1445a8364b..93aeac2cd6 100644 --- a/app/tools/scale_tool.h +++ b/app/tools/scale_tool.h @@ -15,24 +15,24 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __SCALE_TOOL_H__ #define __SCALE_TOOL_H__ -#include "tools.h" -#include "transform_core.h" -TileManager * scale_tool_transform (Tool *tool, - gpointer gdisp_ptr, - TransformState state); -TileManager * scale_tool_scale (GimpImage *gimage, - GimpDrawable *drawable, - GDisplay *gdisp, - gdouble *trans_info, - TileManager *float_tiles, - gboolean interpolation, - GimpMatrix3 matrix); +TileManager * scale_tool_transform (Tool *tool, + gpointer gdisp_ptr, + TransformState state); +TileManager * scale_tool_scale (GimpImage *gimage, + GimpDrawable *drawable, + GDisplay *gdisp, + gdouble *trans_info, + TileManager *float_tiles, + gboolean interpolation, + GimpMatrix3 matrix); + +Tool * tools_new_scale_tool (void); +void tools_free_scale_tool (Tool *tool); -Tool * tools_new_scale_tool (void); -void tools_free_scale_tool (Tool *tool); #endif /* __SCALE_TOOL_H__ */ diff --git a/app/tools/selection_options.h b/app/tools/selection_options.h index 718fb58a66..4d221f1651 100644 --- a/app/tools/selection_options.h +++ b/app/tools/selection_options.h @@ -15,17 +15,16 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __SELECTION_OPTIONS_H__ #define __SELECTION_OPTIONS_H__ -#include "tools.h" + #include "tool_options.h" -#include "libgimp/gimpunit.h" /* the selection options structures */ -typedef struct _SelectionOptions SelectionOptions; struct _SelectionOptions { ToolOptions tool_options; @@ -87,4 +86,5 @@ void selection_options_init (SelectionOptions *options, ToolType tool_type, ToolOptionsResetFunc reset_func); + #endif /* __SELCTION_OPTIONS_H__ */ diff --git a/app/tools/shear_tool.c b/app/tools/shear_tool.c index 2fe246dff6..279332b28d 100644 --- a/app/tools/shear_tool.c +++ b/app/tools/shear_tool.c @@ -18,25 +18,34 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" +#include "draw_core.h" #include "drawable.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" +#include "gimpui.h" +#include "gimpprogress.h" #include "info_dialog.h" #include "shear_tool.h" #include "selection.h" +#include "tools.h" +#include "tool_options.h" +#include "transform_core.h" #include "transform_tool.h" #include "undo.h" #include "tile_manager_pvt.h" -#include "libgimp/gimpintl.h" #include "libgimp/gimpmath.h" +#include "libgimp/gimpintl.h" + + /* index into trans_info array */ #define HORZ_OR_VERT 0 #define XSHEAR 1 @@ -71,7 +80,7 @@ shear_tool_transform (Tool *tool, switch (state) { - case INIT: + case TRANSFORM_INIT: if (!transform_info) { transform_info = info_dialog_new (_("Shear Information"), @@ -98,19 +107,19 @@ shear_tool_transform (Tool *tool, return NULL; break; - case MOTION: + case TRANSFORM_MOTION: shear_tool_motion (tool, gdisp_ptr); shear_tool_recalc (tool, gdisp_ptr); break; - case RECALC: + case TRANSFORM_RECALC: shear_tool_recalc (tool, gdisp_ptr); break; - case FINISH: + case TRANSFORM_FINISH: gtk_widget_set_sensitive (GTK_WIDGET (transform_info->shell), FALSE); return shear_tool_shear (gdisp->gimage, - gimage_active_drawable (gdisp->gimage), + gimp_image_active_drawable (gdisp->gimage), gdisp, transform_core->original, transform_tool_smoothing (), @@ -262,25 +271,25 @@ shear_tool_motion (Tool *tool, dir = transform_core->trans_info[HORZ_OR_VERT]; switch (transform_core->function) { - case HANDLE_1: + case TRANSFORM_HANDLE_1: if (dir == ORIENTATION_HORIZONTAL) transform_core->trans_info[XSHEAR] -= diffx; else transform_core->trans_info[YSHEAR] -= diffy; break; - case HANDLE_2: + case TRANSFORM_HANDLE_2: if (dir == ORIENTATION_HORIZONTAL) transform_core->trans_info[XSHEAR] -= diffx; else transform_core->trans_info[YSHEAR] += diffy; break; - case HANDLE_3: + case TRANSFORM_HANDLE_3: if (dir == ORIENTATION_HORIZONTAL) transform_core->trans_info[XSHEAR] += diffx; else transform_core->trans_info[YSHEAR] -= diffy; break; - case HANDLE_4: + case TRANSFORM_HANDLE_4: if (dir == ORIENTATION_HORIZONTAL) transform_core->trans_info[XSHEAR] += diffx; else diff --git a/app/tools/shear_tool.h b/app/tools/shear_tool.h index 026d052a1d..1dd07ad975 100644 --- a/app/tools/shear_tool.h +++ b/app/tools/shear_tool.h @@ -15,23 +15,23 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __SHEAR_TOOL_H__ #define __SHEAR_TOOL_H__ -#include "tools.h" -#include "transform_core.h" -TileManager * shear_tool_transform (Tool *tool, - gpointer gdisp_ptr, - TransformState state); -TileManager * shear_tool_shear (GimpImage *gimage, - GimpDrawable *drawable, - GDisplay *gdisp, - TileManager *float_tiles, - gboolean interpolation, - GimpMatrix3 matrix); +TileManager * shear_tool_transform (Tool *tool, + gpointer gdisp_ptr, + TransformState state); +TileManager * shear_tool_shear (GimpImage *gimage, + GimpDrawable *drawable, + GDisplay *gdisp, + TileManager *float_tiles, + gboolean interpolation, + GimpMatrix3 matrix); + +Tool * tools_new_shear_tool (void); +void tools_free_shear_tool (Tool *matrix); -Tool * tools_new_shear_tool (void); -void tools_free_shear_tool (Tool *matrix); #endif /* __SHEAR_TOOL_H__ */ diff --git a/app/tools/smudge.c b/app/tools/smudge.c index 69b5234dc2..26bdff458e 100644 --- a/app/tools/smudge.c +++ b/app/tools/smudge.c @@ -27,13 +27,18 @@ #include "drawable.h" #include "smudge.h" #include "gdisplay.h" +#include "gimpcontext.h" +#include "gimpbrush.h" #include "gimplut.h" #include "gimpui.h" #include "paint_funcs.h" #include "paint_core.h" +#include "pixel_region.h" #include "paint_options.h" #include "selection.h" +#include "temp_buf.h" #include "tools.h" +#include "tool_options.h" #include "gimage.h" #include "libgimp/gimpmath.h" diff --git a/app/tools/smudge.h b/app/tools/smudge.h index f56524bf2b..a87d0ffe60 100644 --- a/app/tools/smudge.h +++ b/app/tools/smudge.h @@ -15,11 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __SMUDGE_H__ #define __SMUDGE_H__ -#include "paint_core.h" -#include "tools.h" typedef enum { @@ -34,10 +33,19 @@ typedef enum SMUDGE_MODE_SHADOWS } SmudgeMode; -void * smudge_paint_func (PaintCore *, GimpDrawable *, int); -gboolean smudge_non_gui (GimpDrawable *, double, int, double *); -gboolean smudge_non_gui_default (GimpDrawable *, int, double *); -Tool * tools_new_smudge (void); -void tools_free_smudge (Tool *); +void * smudge_paint_func (PaintCore *, + GimpDrawable *, + gint ); +gboolean smudge_non_gui (GimpDrawable *, + gdouble , + gint , + gdouble *); +gboolean smudge_non_gui_default (GimpDrawable *, + gint , + gdouble *); + +Tool * tools_new_smudge (void); +void tools_free_smudge (Tool *tool); + #endif /* __SMUDGE_H__ */ diff --git a/app/tools/text_tool.c b/app/tools/text_tool.c index f32049406b..33fd430364 100644 --- a/app/tools/text_tool.c +++ b/app/tools/text_tool.c @@ -20,9 +20,10 @@ #include #include +#include +#include #include -#include #ifndef GDK_WINDOWING_WIN32 #include @@ -37,22 +38,30 @@ #include "edit_selection.h" #include "errors.h" #include "floating_sel.h" +#include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "gimpui.h" #include "global_edit.h" +#include "layer.h" +#include "paint_funcs.h" +#include "pixel_region.h" +#include "plug_in.h" #include "procedural_db.h" #include "selection.h" #include "text_tool.h" +#include "tile.h" #include "tools.h" +#include "tool_options.h" +#include "tile_manager.h" +#include "tile_manager_pvt.h" #include "undo.h" -#include "tile_manager_pvt.h" -#include "drawable_pvt.h" - -#include "config.h" #include "libgimp/gimplimits.h" + #include "libgimp/gimpintl.h" + #define FOUNDRY 0 #define FAMILY 1 #define WEIGHT 2 @@ -285,7 +294,7 @@ text_call_gdyntext (GDisplay *gdisp) args[1].arg_type = PDB_IMAGE; args[1].value.pdb_int = (gint32) pdb_image_to_id (gdisp->gimage); args[2].arg_type = PDB_DRAWABLE; - args[2].value.pdb_int = (gint32) gimage_active_drawable (gdisp->gimage)->ID; + args[2].value.pdb_int = (gint32) gimp_image_active_drawable (gdisp->gimage)->ID; plug_in_run (proc_rec, args, 3, FALSE, TRUE, gdisp->ID); @@ -313,9 +322,9 @@ text_button_press (Tool *tool, &text_tool->click_x, &text_tool->click_y, TRUE, 0); - if ((layer = gimage_pick_correlate_layer (gdisp->gimage, - text_tool->click_x, - text_tool->click_y))) + if ((layer = gimp_image_pick_correlate_layer (gdisp->gimage, + text_tool->click_x, + text_tool->click_y))) /* If there is a floating selection, and this aint it, use the move tool */ if (layer_is_floating_sel (layer)) { @@ -358,7 +367,7 @@ text_cursor_update (Tool *tool, gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, FALSE, FALSE); - if ((layer = gimage_pick_correlate_layer (gdisp->gimage, x, y))) + if ((layer = gimp_image_pick_correlate_layer (gdisp->gimage, x, y))) /* if there is a floating selection, and this aint it... */ if (layer_is_floating_sel (layer)) { @@ -470,7 +479,7 @@ text_init_render (TextTool *text_tool) gdisp = (GDisplay *) text_tool->gdisp_ptr; /* override the user's antialias setting if this is an indexed image */ - if (gimage_base_type (gdisp->gimage) == INDEXED) + if (gimp_image_base_type (gdisp->gimage) == INDEXED) antialias = FALSE; /* If we're anti-aliasing, request a larger font than user specified. @@ -496,7 +505,7 @@ text_init_render (TextTool *text_tool) /* strdup it since the render function strtok()s the text */ text = g_strdup (text); - text_render (gdisp->gimage, gimage_active_drawable (gdisp->gimage), + text_render (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage), text_tool->click_x, text_tool->click_y, fontname, text, text_options->border, antialias); @@ -590,7 +599,7 @@ text_render (GimpImage *gimage, if (drawable) layer_type = drawable_type_with_alpha (drawable); else - layer_type = gimage_base_type_with_alpha (gimage); + layer_type = gimp_image_base_type_with_alpha (gimage); /* scale the text based on the antialiasing amount */ if (antialias) @@ -751,7 +760,7 @@ text_render (GimpImage *gimage, _("Text Layer"), OPAQUE_OPACITY, NORMAL_MODE))) { /* color the layer buffer */ - gimage_get_foreground (gimage, drawable, color); + gimp_image_get_foreground (gimage, drawable, color); color[GIMP_DRAWABLE (layer)->bytes - 1] = OPAQUE_OPACITY; pixel_region_init (&textPR, GIMP_DRAWABLE (layer)->tiles, 0, 0, @@ -782,11 +791,11 @@ text_render (GimpImage *gimage, * it seems like the correct behavior. */ if (! gimage_mask_is_empty (gimage)) - channel_clear (gimage_get_mask (gimage)); + channel_clear (gimp_image_get_mask (gimage)); /* If the drawable id is invalid, create a new layer */ if (drawable == NULL) - gimage_add_layer (gimage, layer, -1); + gimp_image_add_layer (gimage, layer, -1); /* Otherwise, instantiate the text as the new floating selection */ else floating_sel_attach (layer, drawable); diff --git a/app/tools/text_tool.h b/app/tools/text_tool.h index fb3ea0702e..32deef8d3c 100644 --- a/app/tools/text_tool.h +++ b/app/tools/text_tool.h @@ -19,8 +19,6 @@ #ifndef __TEXT_TOOL_H__ #define __TEXT_TOOL_H__ -#include "tools.h" - typedef enum { @@ -30,9 +28,9 @@ typedef enum #define SUPERSAMPLE 3 -/* text functions */ + Tool * tools_new_text (void); -void tools_free_text (Tool *); +void tools_free_text (Tool *tool); gboolean text_get_extents (gchar *fontname, gchar *text, diff --git a/app/tools/threshold.c b/app/tools/threshold.c index dbe84f3c7a..90d6cea647 100644 --- a/app/tools/threshold.c +++ b/app/tools/threshold.c @@ -18,15 +18,23 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" #include "drawable.h" #include "gdisplay.h" +#include "gimphistogram.h" +#include "gimpimage.h" #include "gimpui.h" +#include "histogramwidget.h" +#include "image_map.h" +#include "paint_funcs.h" +#include "pixel_region.h" #include "threshold.h" +#include "tools.h" +#include "tool_options.h" #include "libgimp/gimpintl.h" @@ -212,7 +220,7 @@ tools_free_threshold (Tool *tool) void threshold_initialize (GDisplay *gdisp) { - if (drawable_indexed (gimage_active_drawable (gdisp->gimage))) + if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage))) { g_message (_("Threshold does not operate on indexed drawables.")); return; @@ -228,7 +236,7 @@ threshold_initialize (GDisplay *gdisp) threshold_dialog->low_threshold = 127; threshold_dialog->high_threshold = 255; - threshold_dialog->drawable = gimage_active_drawable (gdisp->gimage); + threshold_dialog->drawable = gimp_image_active_drawable (gdisp->gimage); threshold_dialog->color = drawable_color (threshold_dialog->drawable); threshold_dialog->image_map = image_map_create (gdisp, threshold_dialog->drawable); diff --git a/app/tools/threshold.h b/app/tools/threshold.h index 608c4f67a8..92f8934157 100644 --- a/app/tools/threshold.h +++ b/app/tools/threshold.h @@ -19,10 +19,6 @@ #ifndef __THRESHOLD_H__ #define __THRESHOLD_H__ -#include "image_map.h" -#include "histogramwidget.h" -#include "tools.h" - typedef struct _ThresholdDialog ThresholdDialog; @@ -46,14 +42,15 @@ struct _ThresholdDialog gboolean preview; }; -Tool * tools_new_threshold (void); -void tools_free_threshold (Tool *tool); + +Tool * tools_new_threshold (void); +void tools_free_threshold (Tool *tool); void threshold_dialog_hide (void); -void threshold_initialize (GDisplay *gdisp); -void threshold_2 (void *data, - PixelRegion *srcPR, - PixelRegion *destPR); +void threshold_initialize (GDisplay *gdisp); +void threshold_2 (gpointer data, + PixelRegion *srcPR, + PixelRegion *destPR); #endif /* __THRESHOLD_H__ */ diff --git a/app/tools/tool_options.c b/app/tools/tool_options.c index babd80151c..b89dab896d 100644 --- a/app/tools/tool_options.c +++ b/app/tools/tool_options.c @@ -18,11 +18,12 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "brush_select.h" +#include "gimpcontext.h" #include "gimprc.h" #include "gimpui.h" #include "paint_funcs.h" diff --git a/app/tools/tool_options.h b/app/tools/tool_options.h index 378f534494..fe00fa2fe9 100644 --- a/app/tools/tool_options.h +++ b/app/tools/tool_options.h @@ -20,14 +20,8 @@ #define __TOOL_OPTIONS_H__ -/* tool options function declarations */ - -typedef void (* ToolOptionsResetFunc) (void); - - /* the tool options structures */ -typedef struct _ToolOptions ToolOptions; struct _ToolOptions { GtkWidget *main_vbox; @@ -49,4 +43,5 @@ void tool_options_init (ToolOptions *options, gchar *title, ToolOptionsResetFunc reset_func); + #endif /* __TOOL_OPTIONS_H__ */ diff --git a/app/tools/tools.c b/app/tools/tools.c index a90224a731..19fce25e8b 100644 --- a/app/tools/tools.c +++ b/app/tools/tools.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include "apptypes.h" @@ -39,7 +39,9 @@ #include "dodgeburn.h" #include "eraser.h" #include "gdisplay.h" +#include "gimpcontext.h" #include "gimpdnd.h" +#include "gimpimage.h" #include "gimpui.h" #include "hue_saturation.h" #include "ellipse_select.h" @@ -64,6 +66,7 @@ #include "text_tool.h" #include "threshold.h" #include "tools.h" +#include "tool_options.h" #include "transform_tool.h" #include "dialog_handler.h" @@ -1318,7 +1321,7 @@ tools_initialize (ToolType tool_type, { (* tool_info[(gint) tool_type].init_func) (gdisp); - active_tool->drawable = gimage_active_drawable (gdisp->gimage); + active_tool->drawable = gimp_image_active_drawable (gdisp->gimage); } /* don't set gdisp_ptr here! (see commands.c) */ @@ -1392,7 +1395,7 @@ standard_button_press_func (Tool *tool, gdisp = gdisp_ptr; tool->gdisp_ptr = gdisp; - tool->drawable = gimage_active_drawable (gdisp->gimage); + tool->drawable = gimp_image_active_drawable (gdisp->gimage); } static void diff --git a/app/tools/tools.h b/app/tools/tools.h index 8a1cbef011..a76ce57814 100644 --- a/app/tools/tools.h +++ b/app/tools/tools.h @@ -19,42 +19,30 @@ #ifndef __TOOLS_H__ #define __TOOLS_H__ -#include "gimpcontext.h" -#include "tool_options.h" -#include "channel.h" + #include "cursorutil.h" -#include "toolsF.h" - - -/* The possible states for tools */ -typedef enum -{ - INACTIVE, - ACTIVE, - PAUSED -} ToolState; - -/* Selection Boolean operations that rect, */ -/* ellipse, freehand, and fuzzy tools may */ -/* perform. */ - -typedef enum -{ - SELECTION_ADD = ADD, - SELECTION_SUB = SUB, - SELECTION_REPLACE = REPLACE, - SELECTION_INTERSECT = INTERSECT, - SELECTION_MOVE_MASK, - SELECTION_MOVE, - SELECTION_ANCHOR -} SelectOps; /* The possibilities for where the cursor lies */ #define ACTIVE_LAYER (1 << 0) #define SELECTION (1 << 1) #define NON_ACTIVE_LAYER (1 << 2) +/* Tool action function declarations */ +typedef void (* ButtonPressFunc) (Tool *, GdkEventButton *, gpointer); +typedef void (* ButtonReleaseFunc) (Tool *, GdkEventButton *, gpointer); +typedef void (* MotionFunc) (Tool *, GdkEventMotion *, gpointer); +typedef void (* ArrowKeysFunc) (Tool *, GdkEventKey *, gpointer); +typedef void (* ModifierKeyFunc) (Tool *, GdkEventKey *, gpointer); +typedef void (* CursorUpdateFunc) (Tool *, GdkEventMotion *, gpointer); +typedef void (* OperUpdateFunc) (Tool *, GdkEventMotion *, gpointer); +typedef void (* ToolCtlFunc) (Tool *, ToolAction, gpointer); + +/* ToolInfo function declarations */ +typedef Tool * (* ToolInfoNewFunc) (void); +typedef void (* ToolInfoFreeFunc) (Tool *); +typedef void (* ToolInfoInitFunc) (GDisplay *); + /* The types of tools... */ struct _Tool { diff --git a/app/tools/transform_core.c b/app/tools/transform_core.c index 031b7ff4bd..f5a2c82b4d 100644 --- a/app/tools/transform_core.c +++ b/app/tools/transform_core.c @@ -26,21 +26,26 @@ #include "appenv.h" #include "cursorutil.h" +#include "draw_core.h" #include "drawable.h" #include "floating_sel.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "gimprc.h" #include "gimpui.h" #include "info_dialog.h" +#include "layer.h" #include "path_transform.h" +#include "paint_funcs.h" +#include "pixel_region.h" #include "transform_core.h" #include "transform_tool.h" #include "tools.h" #include "undo.h" -#include "drawable_pvt.h" +#include "tile_manager.h" #include "tile_manager_pvt.h" -#include "tile.h" /* ick. */ +#include "tile.h" #include "libgimp/gimpintl.h" #include "libgimp/gimpmath.h" @@ -276,9 +281,9 @@ transform_core_button_press (Tool *tool, transform_core->bpressed = TRUE; /* ALT */ - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); - if (transform_core->function == CREATING && tool->state == ACTIVE) + if (transform_core->function == TRANSFORM_CREATING && tool->state == ACTIVE) { /* Save the current transformation info */ for (i = 0; i < TRAN_INFO_SIZE; i++) @@ -298,34 +303,34 @@ transform_core_button_press (Tool *tool, y = bevent->y; closest_dist = SQR (x - transform_core->sx1) + SQR (y - transform_core->sy1); - transform_core->function = HANDLE_1; + transform_core->function = TRANSFORM_HANDLE_1; dist = SQR (x - transform_core->sx2) + SQR (y - transform_core->sy2); if (dist < closest_dist) { closest_dist = dist; - transform_core->function = HANDLE_2; + transform_core->function = TRANSFORM_HANDLE_2; } dist = SQR (x - transform_core->sx3) + SQR (y - transform_core->sy3); if (dist < closest_dist) { closest_dist = dist; - transform_core->function = HANDLE_3; + transform_core->function = TRANSFORM_HANDLE_3; } dist = SQR (x - transform_core->sx4) + SQR (y - transform_core->sy4); if (dist < closest_dist) { closest_dist = dist; - transform_core->function = HANDLE_4; + transform_core->function = TRANSFORM_HANDLE_4; } if (tool->type == ROTATE && (SQR (x - transform_core->scx) + SQR (y - transform_core->scy)) <= 100) { - transform_core->function = HANDLE_CENTER; + transform_core->function = TRANSFORM_HANDLE_CENTER; } /* Save the current pointer position */ @@ -398,7 +403,7 @@ transform_core_button_press (Tool *tool, transform_core_setup_grid (tool); /* Initialize the transform tool */ - (* transform_core->trans_func) (tool, gdisp_ptr, INIT); + (* transform_core->trans_func) (tool, gdisp_ptr, TRANSFORM_INIT); if (transform_info && !transform_info_inited) { @@ -440,7 +445,8 @@ transform_core_button_release (Tool *tool, transform_core->bpressed = FALSE; /* ALT */ /* if we are creating, there is nothing to be done...exit */ - if (transform_core->function == CREATING && transform_core->interactive) + if (transform_core->function == TRANSFORM_CREATING && + transform_core->interactive) return; /* release of the pointer grab */ @@ -523,7 +529,7 @@ transform_core_doit (Tool *tool, * selection to the transform tool's private selection pointer, so * that the original source can be repeatedly modified. */ - tool->drawable = gimage_active_drawable (gdisp->gimage); + tool->drawable = gimp_image_active_drawable (gdisp->gimage); transform_core->original = transform_core_cut (gdisp->gimage, tool->drawable, @@ -533,9 +539,10 @@ transform_core_doit (Tool *tool, /* Send the request for the transformation to the tool... */ - new_tiles = (* transform_core->trans_func) (tool, gdisp_ptr, FINISH); + new_tiles = (* transform_core->trans_func) (tool, gdisp_ptr, + TRANSFORM_FINISH); - (* transform_core->trans_func) (tool, gdisp_ptr, INIT); + (* transform_core->trans_func) (tool, gdisp_ptr, TRANSFORM_INIT); transform_core_recalc (tool, gdisp_ptr); @@ -560,7 +567,7 @@ transform_core_doit (Tool *tool, /* Make a note of the new current drawable (since we may have * a floating selection, etc now. */ - tool->drawable = gimage_active_drawable (gdisp->gimage); + tool->drawable = gimp_image_active_drawable (gdisp->gimage); undo_push_transform (gdisp->gimage, (void *) tu); } @@ -626,7 +633,8 @@ transform_core_motion (Tool *tool, /* if we are creating or this tool is non-interactive, there is * nothing to be done so exit. */ - if (transform_core->function == CREATING || !transform_core->interactive) + if (transform_core->function == TRANSFORM_CREATING || + !transform_core->interactive) return; /* stop the current tool drawing process */ @@ -638,7 +646,7 @@ transform_core_motion (Tool *tool, transform_core->state = mevent->state; /* recalculate the tool's transformation matrix */ - (* transform_core->trans_func) (tool, gdisp_ptr, MOTION); + (* transform_core->trans_func) (tool, gdisp_ptr, TRANSFORM_MOTION); transform_core->lastx = transform_core->curx; transform_core->lasty = transform_core->cury; @@ -664,7 +672,7 @@ transform_core_cursor_update (Tool *tool, gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, FALSE, FALSE); - if ((drawable = gimage_active_drawable (gdisp->gimage))) + if ((drawable = gimp_image_active_drawable (gdisp->gimage))) { if (GIMP_IS_LAYER (drawable) && layer_get_mask (GIMP_LAYER (drawable))) @@ -849,7 +857,7 @@ transform_core_new (ToolType type, else private->core = draw_core_new (transform_core_no_draw); - private->function = CREATING; + private->function = TRANSFORM_CREATING; private->original = NULL; private->bpressed = FALSE; @@ -968,7 +976,7 @@ transform_core_reset (Tool *tool, transform_core->original = NULL; /* inactivate the tool */ - transform_core->function = CREATING; + transform_core->function = TRANSFORM_CREATING; draw_core_stop (transform_core->core, tool); info_dialog_popdown (transform_info); @@ -990,7 +998,7 @@ transform_core_bounds (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; transform_core = (TransformCore *) tool->private; tiles = transform_core->original; - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); /* find the boundaries */ if (tiles) @@ -1025,7 +1033,7 @@ transform_core_grid_density_changed (void) transform_core = (TransformCore *) active_tool->private; - if (transform_core->function == CREATING) + if (transform_core->function == TRANSFORM_CREATING) return; draw_core_pause (transform_core->core, active_tool); @@ -1041,7 +1049,7 @@ transform_core_showpath_changed (gint type) transform_core = (TransformCore *) active_tool->private; - if (transform_core->function == CREATING) + if (transform_core->function == TRANSFORM_CREATING) return; if (type) @@ -1129,7 +1137,7 @@ transform_core_recalc (Tool *tool, transform_core_bounds (tool, gdisp_ptr); - (* transform_core->trans_func) (tool, gdisp_ptr, RECALC); + (* transform_core->trans_func) (tool, gdisp_ptr, TRANSFORM_RECALC); } /* Actually carry out a transformation */ @@ -1176,7 +1184,7 @@ transform_core_do (GImage *gimage, interpolation = FALSE; /* Get the background color */ - gimage_get_background (gimage, drawable, bg_col); + gimp_image_get_background (gimage, drawable, bg_col); switch (drawable_type (drawable)) { @@ -1640,7 +1648,7 @@ transform_core_paste (GImage *gimage, if (layer) layer_add_alpha (layer); - floating_layer = gimage_floating_sel (gimage); + floating_layer = gimp_image_floating_sel (gimage); if (floating_layer) floating_sel_relax (floating_layer, TRUE); diff --git a/app/tools/transform_core.h b/app/tools/transform_core.h index 90bb1af055..22270dfe64 100644 --- a/app/tools/transform_core.h +++ b/app/tools/transform_core.h @@ -15,34 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __TRANSFORM_CORE_H__ #define __TRANSFORM_CORE_H__ -#include "draw_core.h" -#include "gimpprogress.h" -#include "info_dialog.h" - -#include "libgimp/gimpmatrix.h" - -/* possible transform functions */ -typedef enum -{ - CREATING, - HANDLE_1, - HANDLE_2, - HANDLE_3, - HANDLE_4, - HANDLE_CENTER -} TransformAction; - -/* the different states that the transformation function can be called with */ -typedef enum -{ - INIT, - MOTION, - RECALC, - FINISH -} TransformState; /* buffer sizes for scaling information strings (for the info dialog) */ #define MAX_INFO_BUF 40 @@ -58,8 +34,6 @@ typedef gdouble TranInfo[TRAN_INFO_SIZE]; typedef TileManager * (* TransformFunc) (Tool *, void *, TransformState); -typedef struct _TransformCore TransformCore; - struct _TransformCore { DrawCore *core; /* Core select object */ @@ -167,4 +141,5 @@ gboolean transform_core_paste (GImage *gimage, TileManager *tiles, gboolean new_layer); + #endif /* __TRANSFORM_CORE_H__ */ diff --git a/app/tools/transform_tool.c b/app/tools/transform_tool.c index 59a0ad5f2b..b2b1193dfd 100644 --- a/app/tools/transform_tool.c +++ b/app/tools/transform_tool.c @@ -18,18 +18,20 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" #include "gdisplay.h" +#include "gimpcontext.h" #include "gimpui.h" -#include "tools.h" #include "perspective_tool.h" #include "rotate_tool.h" #include "scale_tool.h" #include "shear_tool.h" +#include "tools.h" +#include "tool_options.h" #include "transform_core.h" #include "transform_tool.h" diff --git a/app/tools/transform_tool.h b/app/tools/transform_tool.h index 5a43ea2b1d..f2f6d467c0 100644 --- a/app/tools/transform_tool.h +++ b/app/tools/transform_tool.h @@ -15,9 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __TRANSFORM_TOOL_H__ #define __TRANSFORM_TOOL_H__ + /* transform directions */ #define TRANSFORM_TRADITIONAL 0 #define TRANSFORM_CORRECTIVE 1 @@ -33,4 +35,5 @@ gint transform_tool_direction (void); gint transform_tool_grid_size (void); gboolean transform_tool_show_grid (void); + #endif /* __TRANSFORM_TOOL_H__ */ diff --git a/app/toolsF.h b/app/toolsF.h deleted file mode 100644 index 7664fe40e2..0000000000 --- a/app/toolsF.h +++ /dev/null @@ -1,102 +0,0 @@ -/* The GIMP -- an image manipulation program - * Copyright (C) 1995-1999 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 __TOOLS_F_H__ -#define __TOOLS_F_H__ - -#include /* eeek */ - - -/* Tool control actions */ -typedef enum -{ - PAUSE, - RESUME, - HALT, - CURSOR_UPDATE, - DESTROY, - RECREATE -} ToolAction; - -/* Tool types */ -typedef enum -{ - TOOL_TYPE_NONE = -1, - FIRST_TOOLBOX_TOOL = 0, - RECT_SELECT = FIRST_TOOLBOX_TOOL, - ELLIPSE_SELECT, - FREE_SELECT, - FUZZY_SELECT, - BEZIER_SELECT, - ISCISSORS, - MOVE, - MAGNIFY, - CROP, - ROTATE, - SCALE, - SHEAR, - PERSPECTIVE, - FLIP, - TEXT, - COLOR_PICKER, - BUCKET_FILL, - BLEND, - PENCIL, - PAINTBRUSH, - ERASER, - AIRBRUSH, - CLONE, - CONVOLVE, - INK, - DODGEBURN, - SMUDGE, - MEASURE, - LAST_TOOLBOX_TOOL = MEASURE, - - /* Non-toolbox tools */ - BY_COLOR_SELECT, - COLOR_BALANCE, - BRIGHTNESS_CONTRAST, - HUE_SATURATION, - POSTERIZE, - THRESHOLD, - CURVES, - LEVELS, - HISTOGRAM -} ToolType; - -/* Structure definitions */ -typedef struct _Tool Tool; -typedef struct _ToolInfo ToolInfo; - -/* Tool action function declarations */ -typedef void (* ButtonPressFunc) (Tool *, GdkEventButton *, gpointer); -typedef void (* ButtonReleaseFunc) (Tool *, GdkEventButton *, gpointer); -typedef void (* MotionFunc) (Tool *, GdkEventMotion *, gpointer); -typedef void (* ArrowKeysFunc) (Tool *, GdkEventKey *, gpointer); -typedef void (* ModifierKeyFunc) (Tool *, GdkEventKey *, gpointer); -typedef void (* CursorUpdateFunc) (Tool *, GdkEventMotion *, gpointer); -typedef void (* OperUpdateFunc) (Tool *, GdkEventMotion *, gpointer); -typedef void (* ToolCtlFunc) (Tool *, ToolAction, gpointer); - -/* ToolInfo function declarations */ -typedef Tool * (* ToolInfoNewFunc) (void); -typedef void (* ToolInfoFreeFunc) (Tool *); -typedef void (* ToolInfoInitFunc) (GDisplay *); - -#endif /* __TOOLS_F_H__ */ diff --git a/app/tools_cmds.c b/app/tools_cmds.c index f74caad442..d971fea977 100644 --- a/app/tools_cmds.c +++ b/app/tools_cmds.c @@ -18,14 +18,18 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ +#include "config.h" + + +#include + +#include "apptypes.h" #include "procedural_db.h" #include "airbrush.h" -#include "apptypes.h" #include "blend.h" #include "bucket_fill.h" #include "by_color_select.h" -#include "channel.h" #include "clone.h" #include "color_picker.h" #include "convolve.h" @@ -46,6 +50,7 @@ #include "scale_tool.h" #include "shear_tool.h" #include "smudge.h" +#include "tile_manager.h" #include "tile_manager_pvt.h" #include "transform_core.h" #include "undo.h" @@ -550,7 +555,7 @@ by_color_select_invoker (Argument *args) success = FALSE; operation = args[3].value.pdb_int; - if (operation < ADD || operation > INTERSECT) + if (operation < CHANNEL_OP_ADD || operation > CHANNEL_OP_INTERSECT) success = FALSE; antialias = args[4].value.pdb_int ? TRUE : FALSE; @@ -1335,7 +1340,7 @@ ellipse_select_invoker (Argument *args) success = FALSE; operation = args[5].value.pdb_int; - if (operation < ADD || operation > INTERSECT) + if (operation < CHANNEL_OP_ADD || operation > CHANNEL_OP_INTERSECT) success = FALSE; antialias = args[6].value.pdb_int ? TRUE : FALSE; @@ -1687,7 +1692,7 @@ free_select_invoker (Argument *args) segs = (gdouble *) args[2].value.pdb_pointer; operation = args[3].value.pdb_int; - if (operation < ADD || operation > INTERSECT) + if (operation < CHANNEL_OP_ADD || operation > CHANNEL_OP_INTERSECT) success = FALSE; antialias = args[4].value.pdb_int ? TRUE : FALSE; @@ -1787,7 +1792,7 @@ fuzzy_select_invoker (Argument *args) success = FALSE; operation = args[4].value.pdb_int; - if (operation < ADD || operation > INTERSECT) + if (operation < CHANNEL_OP_ADD || operation > CHANNEL_OP_INTERSECT) success = FALSE; antialias = args[5].value.pdb_int ? TRUE : FALSE; @@ -2298,7 +2303,7 @@ rect_select_invoker (Argument *args) success = FALSE; operation = args[5].value.pdb_int; - if (operation < ADD || operation > INTERSECT) + if (operation < CHANNEL_OP_ADD || operation > CHANNEL_OP_INTERSECT) success = FALSE; feather = args[6].value.pdb_int ? TRUE : FALSE; diff --git a/app/transform_core.c b/app/transform_core.c index 031b7ff4bd..f5a2c82b4d 100644 --- a/app/transform_core.c +++ b/app/transform_core.c @@ -26,21 +26,26 @@ #include "appenv.h" #include "cursorutil.h" +#include "draw_core.h" #include "drawable.h" #include "floating_sel.h" #include "gdisplay.h" #include "gimage_mask.h" +#include "gimpimage.h" #include "gimprc.h" #include "gimpui.h" #include "info_dialog.h" +#include "layer.h" #include "path_transform.h" +#include "paint_funcs.h" +#include "pixel_region.h" #include "transform_core.h" #include "transform_tool.h" #include "tools.h" #include "undo.h" -#include "drawable_pvt.h" +#include "tile_manager.h" #include "tile_manager_pvt.h" -#include "tile.h" /* ick. */ +#include "tile.h" #include "libgimp/gimpintl.h" #include "libgimp/gimpmath.h" @@ -276,9 +281,9 @@ transform_core_button_press (Tool *tool, transform_core->bpressed = TRUE; /* ALT */ - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); - if (transform_core->function == CREATING && tool->state == ACTIVE) + if (transform_core->function == TRANSFORM_CREATING && tool->state == ACTIVE) { /* Save the current transformation info */ for (i = 0; i < TRAN_INFO_SIZE; i++) @@ -298,34 +303,34 @@ transform_core_button_press (Tool *tool, y = bevent->y; closest_dist = SQR (x - transform_core->sx1) + SQR (y - transform_core->sy1); - transform_core->function = HANDLE_1; + transform_core->function = TRANSFORM_HANDLE_1; dist = SQR (x - transform_core->sx2) + SQR (y - transform_core->sy2); if (dist < closest_dist) { closest_dist = dist; - transform_core->function = HANDLE_2; + transform_core->function = TRANSFORM_HANDLE_2; } dist = SQR (x - transform_core->sx3) + SQR (y - transform_core->sy3); if (dist < closest_dist) { closest_dist = dist; - transform_core->function = HANDLE_3; + transform_core->function = TRANSFORM_HANDLE_3; } dist = SQR (x - transform_core->sx4) + SQR (y - transform_core->sy4); if (dist < closest_dist) { closest_dist = dist; - transform_core->function = HANDLE_4; + transform_core->function = TRANSFORM_HANDLE_4; } if (tool->type == ROTATE && (SQR (x - transform_core->scx) + SQR (y - transform_core->scy)) <= 100) { - transform_core->function = HANDLE_CENTER; + transform_core->function = TRANSFORM_HANDLE_CENTER; } /* Save the current pointer position */ @@ -398,7 +403,7 @@ transform_core_button_press (Tool *tool, transform_core_setup_grid (tool); /* Initialize the transform tool */ - (* transform_core->trans_func) (tool, gdisp_ptr, INIT); + (* transform_core->trans_func) (tool, gdisp_ptr, TRANSFORM_INIT); if (transform_info && !transform_info_inited) { @@ -440,7 +445,8 @@ transform_core_button_release (Tool *tool, transform_core->bpressed = FALSE; /* ALT */ /* if we are creating, there is nothing to be done...exit */ - if (transform_core->function == CREATING && transform_core->interactive) + if (transform_core->function == TRANSFORM_CREATING && + transform_core->interactive) return; /* release of the pointer grab */ @@ -523,7 +529,7 @@ transform_core_doit (Tool *tool, * selection to the transform tool's private selection pointer, so * that the original source can be repeatedly modified. */ - tool->drawable = gimage_active_drawable (gdisp->gimage); + tool->drawable = gimp_image_active_drawable (gdisp->gimage); transform_core->original = transform_core_cut (gdisp->gimage, tool->drawable, @@ -533,9 +539,10 @@ transform_core_doit (Tool *tool, /* Send the request for the transformation to the tool... */ - new_tiles = (* transform_core->trans_func) (tool, gdisp_ptr, FINISH); + new_tiles = (* transform_core->trans_func) (tool, gdisp_ptr, + TRANSFORM_FINISH); - (* transform_core->trans_func) (tool, gdisp_ptr, INIT); + (* transform_core->trans_func) (tool, gdisp_ptr, TRANSFORM_INIT); transform_core_recalc (tool, gdisp_ptr); @@ -560,7 +567,7 @@ transform_core_doit (Tool *tool, /* Make a note of the new current drawable (since we may have * a floating selection, etc now. */ - tool->drawable = gimage_active_drawable (gdisp->gimage); + tool->drawable = gimp_image_active_drawable (gdisp->gimage); undo_push_transform (gdisp->gimage, (void *) tu); } @@ -626,7 +633,8 @@ transform_core_motion (Tool *tool, /* if we are creating or this tool is non-interactive, there is * nothing to be done so exit. */ - if (transform_core->function == CREATING || !transform_core->interactive) + if (transform_core->function == TRANSFORM_CREATING || + !transform_core->interactive) return; /* stop the current tool drawing process */ @@ -638,7 +646,7 @@ transform_core_motion (Tool *tool, transform_core->state = mevent->state; /* recalculate the tool's transformation matrix */ - (* transform_core->trans_func) (tool, gdisp_ptr, MOTION); + (* transform_core->trans_func) (tool, gdisp_ptr, TRANSFORM_MOTION); transform_core->lastx = transform_core->curx; transform_core->lasty = transform_core->cury; @@ -664,7 +672,7 @@ transform_core_cursor_update (Tool *tool, gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, FALSE, FALSE); - if ((drawable = gimage_active_drawable (gdisp->gimage))) + if ((drawable = gimp_image_active_drawable (gdisp->gimage))) { if (GIMP_IS_LAYER (drawable) && layer_get_mask (GIMP_LAYER (drawable))) @@ -849,7 +857,7 @@ transform_core_new (ToolType type, else private->core = draw_core_new (transform_core_no_draw); - private->function = CREATING; + private->function = TRANSFORM_CREATING; private->original = NULL; private->bpressed = FALSE; @@ -968,7 +976,7 @@ transform_core_reset (Tool *tool, transform_core->original = NULL; /* inactivate the tool */ - transform_core->function = CREATING; + transform_core->function = TRANSFORM_CREATING; draw_core_stop (transform_core->core, tool); info_dialog_popdown (transform_info); @@ -990,7 +998,7 @@ transform_core_bounds (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; transform_core = (TransformCore *) tool->private; tiles = transform_core->original; - drawable = gimage_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->gimage); /* find the boundaries */ if (tiles) @@ -1025,7 +1033,7 @@ transform_core_grid_density_changed (void) transform_core = (TransformCore *) active_tool->private; - if (transform_core->function == CREATING) + if (transform_core->function == TRANSFORM_CREATING) return; draw_core_pause (transform_core->core, active_tool); @@ -1041,7 +1049,7 @@ transform_core_showpath_changed (gint type) transform_core = (TransformCore *) active_tool->private; - if (transform_core->function == CREATING) + if (transform_core->function == TRANSFORM_CREATING) return; if (type) @@ -1129,7 +1137,7 @@ transform_core_recalc (Tool *tool, transform_core_bounds (tool, gdisp_ptr); - (* transform_core->trans_func) (tool, gdisp_ptr, RECALC); + (* transform_core->trans_func) (tool, gdisp_ptr, TRANSFORM_RECALC); } /* Actually carry out a transformation */ @@ -1176,7 +1184,7 @@ transform_core_do (GImage *gimage, interpolation = FALSE; /* Get the background color */ - gimage_get_background (gimage, drawable, bg_col); + gimp_image_get_background (gimage, drawable, bg_col); switch (drawable_type (drawable)) { @@ -1640,7 +1648,7 @@ transform_core_paste (GImage *gimage, if (layer) layer_add_alpha (layer); - floating_layer = gimage_floating_sel (gimage); + floating_layer = gimp_image_floating_sel (gimage); if (floating_layer) floating_sel_relax (floating_layer, TRUE); diff --git a/app/transform_core.h b/app/transform_core.h index 90bb1af055..22270dfe64 100644 --- a/app/transform_core.h +++ b/app/transform_core.h @@ -15,34 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __TRANSFORM_CORE_H__ #define __TRANSFORM_CORE_H__ -#include "draw_core.h" -#include "gimpprogress.h" -#include "info_dialog.h" - -#include "libgimp/gimpmatrix.h" - -/* possible transform functions */ -typedef enum -{ - CREATING, - HANDLE_1, - HANDLE_2, - HANDLE_3, - HANDLE_4, - HANDLE_CENTER -} TransformAction; - -/* the different states that the transformation function can be called with */ -typedef enum -{ - INIT, - MOTION, - RECALC, - FINISH -} TransformState; /* buffer sizes for scaling information strings (for the info dialog) */ #define MAX_INFO_BUF 40 @@ -58,8 +34,6 @@ typedef gdouble TranInfo[TRAN_INFO_SIZE]; typedef TileManager * (* TransformFunc) (Tool *, void *, TransformState); -typedef struct _TransformCore TransformCore; - struct _TransformCore { DrawCore *core; /* Core select object */ @@ -167,4 +141,5 @@ gboolean transform_core_paste (GImage *gimage, TileManager *tiles, gboolean new_layer); + #endif /* __TRANSFORM_CORE_H__ */ diff --git a/app/transform_tool.c b/app/transform_tool.c index 59a0ad5f2b..b2b1193dfd 100644 --- a/app/transform_tool.c +++ b/app/transform_tool.c @@ -18,18 +18,20 @@ #include "config.h" -#include +#include #include "apptypes.h" #include "appenv.h" #include "gdisplay.h" +#include "gimpcontext.h" #include "gimpui.h" -#include "tools.h" #include "perspective_tool.h" #include "rotate_tool.h" #include "scale_tool.h" #include "shear_tool.h" +#include "tools.h" +#include "tool_options.h" #include "transform_core.h" #include "transform_tool.h" diff --git a/app/transform_tool.h b/app/transform_tool.h index 5a43ea2b1d..f2f6d467c0 100644 --- a/app/transform_tool.h +++ b/app/transform_tool.h @@ -15,9 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __TRANSFORM_TOOL_H__ #define __TRANSFORM_TOOL_H__ + /* transform directions */ #define TRANSFORM_TRADITIONAL 0 #define TRANSFORM_CORRECTIVE 1 @@ -33,4 +35,5 @@ gint transform_tool_direction (void); gint transform_tool_grid_size (void); gboolean transform_tool_show_grid (void); + #endif /* __TRANSFORM_TOOL_H__ */ diff --git a/app/undo.c b/app/undo.c index 4e11220d55..ecb99dbd50 100644 --- a/app/undo.c +++ b/app/undo.c @@ -21,17 +21,19 @@ #include #include -#include +#include #include "apptypes.h" #include "appenv.h" #include "by_color_select.h" #include "channel.h" +#include "draw_core.h" #include "drawable.h" #include "floating_sel.h" #include "gdisplay.h" #include "gdisplay_ops.h" +#include "gimage.h" #include "gimage_mask.h" #include "gimpparasite.h" #include "gimprc.h" @@ -40,21 +42,20 @@ #include "paint_funcs.h" #include "parasitelist.h" #include "path_transform.h" +#include "pixel_region.h" +#include "tile_manager.h" +#include "tile_manager_pvt.h" +#include "tile.h" #include "tools.h" #include "transform_core.h" #include "undo.h" -#include "drawable_pvt.h" -#include "layer_pvt.h" -#include "channel_pvt.h" -#include "tile_manager_pvt.h" -#include "tile.h" /* ick. */ - #include "libgimp/gimpparasite.h" #include "libgimp/gimpintl.h" + /*#define DEBUG*/ #ifdef DEBUG @@ -1031,7 +1032,7 @@ undo_pop_mask (GImage *gimage, mask_undo = (MaskUndo *) mask_ptr; /* save current selection mask */ - sel_mask = gimage_get_mask (gimage); + sel_mask = gimp_image_get_mask (gimage); selection = channel_bounds (sel_mask, &x1, &y1, &x2, &y2); pixel_region_init (&srcPR, GIMP_DRAWABLE (sel_mask)->tiles, x1, y1, (x2 - x1), (y2 - y1), FALSE); @@ -1452,9 +1453,9 @@ undo_pop_layer (GImage *gimage, (state == REDO && type == LAYER_REMOVE_UNDO)) { /* record the current position */ - lu->prev_position = gimage_get_layer_index (gimage, lu->layer); + lu->prev_position = gimp_image_get_layer_index (gimage, lu->layer); /* set the previous layer */ - gimage_set_active_layer (gimage, lu->prev_layer); + gimp_image_set_active_layer (gimage, lu->prev_layer); /* remove the layer */ gimage->layers = g_slist_remove (gimage->layers, lu->layer); @@ -1805,13 +1806,13 @@ undo_pop_channel (GImage *gimage, (state == REDO && type == CHANNEL_REMOVE_UNDO)) { /* record the current position */ - cu->prev_position = gimage_get_channel_index (gimage, cu->channel); + cu->prev_position = gimp_image_get_channel_index (gimage, cu->channel); /* remove the channel */ gimage->channels = g_slist_remove (gimage->channels, cu->channel); /* set the previous channel */ - gimage_set_active_channel (gimage, cu->prev_channel); + gimp_image_set_active_channel (gimage, cu->prev_channel); /* update the area */ drawable_update (GIMP_DRAWABLE (cu->channel), 0, 0, @@ -1829,7 +1830,7 @@ undo_pop_channel (GImage *gimage, cu->prev_position); /* set the new channel */ - gimage_set_active_channel (gimage, cu->channel); + gimp_image_set_active_channel (gimage, cu->channel); /* update the area */ drawable_update (GIMP_DRAWABLE (cu->channel), 0, 0, @@ -2268,12 +2269,12 @@ undo_pop_gimage_mod (GImage *gimage, data[2] = gimage->base_type; gimage->base_type = tmp; - gimage_projection_realloc (gimage); + gimp_image_projection_realloc (gimage); gimage_mask_invalidate (gimage); channel_invalidate_previews (gimage); layer_invalidate_previews (gimage); - gimage_invalidate_preview (gimage); + gimp_image_invalidate_preview (gimage); gdisplays_update_full (gimage); gdisplays_update_title (gimage); diff --git a/app/undo.h b/app/undo.h index b0fb003366..b92893c8c0 100644 --- a/app/undo.h +++ b/app/undo.h @@ -15,14 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __UNDO_H__ #define __UNDO_H__ -#include "gimage.h" -#include "undo_types.h" - - -/* Undo interface functions */ gboolean undo_push_group_start (GImage *gimage, UndoType type); @@ -131,4 +127,5 @@ typedef enum UNDO_FREE /* all undo and redo info has been cleared */ } undo_event_t; + #endif /* __UNDO_H__ */ diff --git a/app/undo_cmds.c b/app/undo_cmds.c index 858604a8b5..097efda9f1 100644 --- a/app/undo_cmds.c +++ b/app/undo_cmds.c @@ -18,6 +18,12 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ +#include "config.h" + + +#include + +#include "apptypes.h" #include "procedural_db.h" #include "undo.h" diff --git a/app/undo_history.c b/app/undo_history.c index 39da6f7b1b..dabbedb953 100644 --- a/app/undo_history.c +++ b/app/undo_history.c @@ -41,18 +41,27 @@ * */ +#include "config.h" + #include + +#include "apptypes.h" + +#include "dialog_handler.h" +#include "drawable.h" #include "gimprc.h" #include "gimpui.h" +#include "gimage_mask.h" +#include "gimpimage.h" +#include "paint_funcs.h" +#include "pixel_region.h" #include "temp_buf.h" #include "undo.h" -#include "gimage_mask.h" -#include "dialog_handler.h" -#include "config.h" -#include "libgimp/gimpintl.h" #include "libgimp/gimplimits.h" +#include "libgimp/gimpintl.h" + #include "pixmaps/raise.xpm" #include "pixmaps/lower.xpm" #include "pixmaps/yes.xpm" @@ -152,7 +161,7 @@ mask_render_preview (GImage *gimage, gint width, height; gint scale; - mask = gimage_get_mask (gimage); + mask = gimp_image_get_mask (gimage); if ((drawable_width (GIMP_DRAWABLE(mask)) > *pwidth) || (drawable_height (GIMP_DRAWABLE(mask)) > *pheight)) { @@ -425,7 +434,7 @@ undo_history_gimage_rename_callback (GimpImage *gimage, gchar *title; title = g_strdup_printf (_("Undo History: %s"), - g_basename (gimage_filename (gimage))); + g_basename (gimp_image_filename (gimage))); gtk_window_set_title (GTK_WINDOW (st->shell), title); g_free (title); } @@ -749,7 +758,7 @@ undo_history_new (GImage *gimage) /* The shell and main vbox */ { gchar *title = g_strdup_printf (_("Undo History: %s"), - g_basename (gimage_filename (gimage))); + g_basename (gimp_image_filename (gimage))); st->shell = gimp_dialog_new (title, "undo_history", gimp_standard_help_func, "dialogs/undo_history.html", diff --git a/app/unit_cmds.c b/app/unit_cmds.c index f3c8b53edb..019bd87dce 100644 --- a/app/unit_cmds.c +++ b/app/unit_cmds.c @@ -18,8 +18,15 @@ /* NOTE: This file is autogenerated by pdbgen.pl. */ +#include "config.h" + + +#include + +#include "apptypes.h" #include "procedural_db.h" + #include "libgimp/gimpunit.h" static ProcRecord unit_get_number_of_units_proc; diff --git a/app/unitrc.h b/app/unitrc.h index 1afe409b0e..3c194797a6 100644 --- a/app/unitrc.h +++ b/app/unitrc.h @@ -19,7 +19,9 @@ #ifndef __UNITRC_H__ #define __UNITRC_H__ -void parse_unitrc (void); -void save_unitrc (void); + +void parse_unitrc (void); +void save_unitrc (void); + #endif /* __UNITRC_H__ */ diff --git a/app/user_install.c b/app/user_install.c index baf1078ad0..817c212098 100644 --- a/app/user_install.c +++ b/app/user_install.c @@ -19,7 +19,7 @@ #include "config.h" -#include +#include #include #include @@ -49,6 +49,7 @@ #include "pixmaps/new.xpm" #include "pixmaps/wilber.xpm" + #ifndef G_OS_WIN32 # ifndef __EMX__ # define USER_INSTALL "user_install" diff --git a/app/widgets/gimpbrusheditor.c b/app/widgets/gimpbrusheditor.c index f9b22b5cad..2ea93642f2 100644 --- a/app/widgets/gimpbrusheditor.c +++ b/app/widgets/gimpbrusheditor.c @@ -30,7 +30,9 @@ #include "gimpbrushgenerated.h" #include "brush_edit.h" #include "gimpui.h" +#include "temp_buf.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpmath.h" #include "libgimp/gimpintl.h" diff --git a/app/widgets/gimpbrusheditor.h b/app/widgets/gimpbrusheditor.h index e376b0b2f7..2c221792bd 100644 --- a/app/widgets/gimpbrusheditor.h +++ b/app/widgets/gimpbrusheditor.h @@ -21,7 +21,6 @@ #ifndef __BRUSH_EDIT_H__ #define __BRUSH_EDIT_H__ -#include "gimpbrushgenerated.h" typedef struct _BrushEditGeneratedWindow BrushEditGeneratedWindow; @@ -46,7 +45,7 @@ struct _BrushEditGeneratedWindow BrushEditGeneratedWindow * brush_edit_generated_new (void); -void brush_edit_generated_set_brush (BrushEditGeneratedWindow *begw, - GimpBrush *brush); +void brush_edit_generated_set_brush (BrushEditGeneratedWindow *begw, + GimpBrush *brush); #endif /* __BRUSH_EDIT_H__ */ diff --git a/app/widgets/gimpcolordialog.c b/app/widgets/gimpcolordialog.c index 817f5fa7a6..d3370c299d 100644 --- a/app/widgets/gimpcolordialog.c +++ b/app/widgets/gimpcolordialog.c @@ -21,16 +21,19 @@ #include "config.h" -#include -#include - #include #include #include +#include +#include + +#include "apptypes.h" + #include "color_notebook.h" #include "gimpui.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpcolorselector.h" #include "libgimp/gimpintl.h" diff --git a/app/widgets/gimpcolorpanel.h b/app/widgets/gimpcolorpanel.h index 1b09e00edb..d288aaaf57 100644 --- a/app/widgets/gimpcolorpanel.h +++ b/app/widgets/gimpcolorpanel.h @@ -15,6 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __COLOR_PANEL_H__ #define __COLOR_PANEL_H__ @@ -39,4 +40,5 @@ ColorPanel * color_panel_new (guchar *initial, void color_panel_set_color (ColorPanel *color_panel, guchar *col); + #endif /* __COLOR_PANEL_H__ */ diff --git a/app/widgets/gimpcursor.h b/app/widgets/gimpcursor.h index b73024f282..02f9703a82 100644 --- a/app/widgets/gimpcursor.h +++ b/app/widgets/gimpcursor.h @@ -15,21 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __CURSORUTIL_H__ #define __CURSORUTIL_H__ -#include - -#include -#if defined (GDK_WINDOWING_WIN32) || defined (GDK_WINDOWING_X11) -/* Stopgap measure to detect build with current CVS GTk+ */ -#include -#endif - -#include "toolsF.h" - - typedef struct { guchar *bits; @@ -41,29 +31,6 @@ typedef struct GdkCursor *cursor; } BitmapCursor; -typedef enum -{ - CURSOR_MODE_TOOL_ICON, - CURSOR_MODE_TOOL_CROSSHAIR, - CURSOR_MODE_CROSSHAIR -} CursorMode; - -typedef enum -{ - CURSOR_MODIFIER_NONE, - CURSOR_MODIFIER_PLUS, - CURSOR_MODIFIER_MINUS, - CURSOR_MODIFIER_INTERSECT, - CURSOR_MODIFIER_MOVE, - CURSOR_MODIFIER_RESIZE, - CURSOR_MODIFIER_CONTROL, - CURSOR_MODIFIER_ANCHOR, - CURSOR_MODIFIER_FOREGROUND, - CURSOR_MODIFIER_BACKGROUND, - CURSOR_MODIFIER_PATTERN, - CURSOR_MODIFIER_HAND -} CursorModifier; - typedef enum { GIMP_MOUSE_CURSOR = (GDK_LAST_CURSOR + 2), diff --git a/app/widgets/gimpdeviceinfo.c b/app/widgets/gimpdeviceinfo.c index 5af69ee420..15edcf6da5 100644 --- a/app/widgets/gimpdeviceinfo.c +++ b/app/widgets/gimpdeviceinfo.c @@ -18,15 +18,17 @@ #include "config.h" +#include #include -#include +#include #include "apptypes.h" #include "appenv.h" #include "devices.h" #include "dialog_handler.h" +#include "gimpbrush.h" #include "gimpcontextpreview.h" #include "gimpdnd.h" #include "gimpbrushlist.h" @@ -35,13 +37,16 @@ #include "gimpui.h" #include "gradient.h" #include "gradient_header.h" +#include "patterns.h" #include "session.h" #include "tools.h" #include "libgimp/gimpenv.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpintl.h" + #define CELL_SIZE 20 /* The size of the preview cells */ #define PREVIEW_EVENT_MASK GDK_BUTTON_PRESS_MASK | \ diff --git a/app/widgets/gimpdevices.c b/app/widgets/gimpdevices.c index 5af69ee420..15edcf6da5 100644 --- a/app/widgets/gimpdevices.c +++ b/app/widgets/gimpdevices.c @@ -18,15 +18,17 @@ #include "config.h" +#include #include -#include +#include #include "apptypes.h" #include "appenv.h" #include "devices.h" #include "dialog_handler.h" +#include "gimpbrush.h" #include "gimpcontextpreview.h" #include "gimpdnd.h" #include "gimpbrushlist.h" @@ -35,13 +37,16 @@ #include "gimpui.h" #include "gradient.h" #include "gradient_header.h" +#include "patterns.h" #include "session.h" #include "tools.h" #include "libgimp/gimpenv.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpintl.h" + #define CELL_SIZE 20 /* The size of the preview cells */ #define PREVIEW_EVENT_MASK GDK_BUTTON_PRESS_MASK | \ diff --git a/app/widgets/gimpdevices.h b/app/widgets/gimpdevices.h index ca6a110c1d..817bfcb678 100644 --- a/app/widgets/gimpdevices.h +++ b/app/widgets/gimpdevices.h @@ -15,10 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + #ifndef __DEVICES_H__ #define __DEVICES_H__ -#include "tools.h" typedef enum { @@ -71,7 +71,9 @@ void devices_rc_update (gchar *name, /* Free device status (only for session-managment) */ void device_status_free (void); + /* Current device id */ extern gint current_device; + #endif /* __DEVICES_H__ */ diff --git a/app/widgets/gimpdnd.c b/app/widgets/gimpdnd.c index 4875f10f3b..463634ce0e 100644 --- a/app/widgets/gimpdnd.c +++ b/app/widgets/gimpdnd.c @@ -15,15 +15,29 @@ * 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 + +#include "apptypes.h" + +#include "channel.h" +#include "drawable.h" #include "fileops.h" -#include "gimage.h" +#include "gimpimage.h" +#include "gimpbrush.h" #include "gimpcontextpreview.h" #include "gimpdnd.h" #include "gimpbrushlist.h" #include "gimprc.h" +#include "gradient.h" #include "gradient_header.h" +#include "layer.h" +#include "patterns.h" +#include "temp_buf.h" #include "tools.h" #include "libgimp/gimplimits.h" diff --git a/app/widgets/gimpdnd.h b/app/widgets/gimpdnd.h index e322d03279..89cd58436a 100644 --- a/app/widgets/gimpdnd.h +++ b/app/widgets/gimpdnd.h @@ -20,13 +20,6 @@ #define __GIMP_DND_H__ -#include "gimpbrush.h" -#include "gimpdrawable.h" -#include "palette_entries.h" -#include "patterns.h" -#include "gradient.h" -#include "toolsF.h" - enum { GIMP_DND_TYPE_URI_LIST, diff --git a/app/widgets/gimpgradienteditor.h b/app/widgets/gimpgradienteditor.h index bac07d9804..b16122b89a 100644 --- a/app/widgets/gimpgradienteditor.h +++ b/app/widgets/gimpgradienteditor.h @@ -18,10 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __GRADIENT_H__ #define __GRADIENT_H__ -typedef struct _gradient_t gradient_t; /* global variables */ extern GSList * gradients_list; @@ -44,4 +44,5 @@ void gradient_get_color_at (gradient_t *gradient, gdouble *b, gdouble *a); + #endif /* __GRADIENT_H__ */ diff --git a/app/widgets/gimphelp.c b/app/widgets/gimphelp.c index 02f6b51b9c..1463957add 100644 --- a/app/widgets/gimphelp.c +++ b/app/widgets/gimphelp.c @@ -18,6 +18,7 @@ * 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" #ifdef HAVE_UNISTD_H @@ -26,9 +27,12 @@ #ifdef HAVE_STRING_H #include #endif +#include "sys/types.h" #include +#include "apptypes.h" + #include "gimphelp.h" #include "gimprc.h" #include "gimpui.h" @@ -36,6 +40,7 @@ #include "procedural_db.h" #include "libgimp/gimpenv.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpintl.h" diff --git a/app/widgets/gimphelp.h b/app/widgets/gimphelp.h index 9f749f526d..7a57b8c0d5 100644 --- a/app/widgets/gimphelp.h +++ b/app/widgets/gimphelp.h @@ -22,10 +22,6 @@ #ifndef __GIMP_HELP_H__ #define __GIMP_HELP_H__ -#include "gtk/gtk.h" - -#include "libgimp/gimphelpui.h" - enum { diff --git a/app/widgets/gimphistogramview.c b/app/widgets/gimphistogramview.c index db168227ad..f19014a114 100644 --- a/app/widgets/gimphistogramview.c +++ b/app/widgets/gimphistogramview.c @@ -18,7 +18,7 @@ #include "config.h" -#include +#include #include "apptypes.h" diff --git a/app/widgets/gimphistogramview.h b/app/widgets/gimphistogramview.h index afcb545b9f..249260c5f4 100644 --- a/app/widgets/gimphistogramview.h +++ b/app/widgets/gimphistogramview.h @@ -29,14 +29,8 @@ #define HISTOGRAM_WIDGET_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, histogram_widget_get_type (), HistogramWidget) #define IS_HISTOGRAM_WIDGET(obj) GTK_CHECK_TYPE (obj, histogram_widget_get_type ()) -typedef struct _HistogramWidget HistogramWidget; typedef struct _HistogramWidgetClass HistogramWidgetClass; - -/* HistogramWidget signals: - range_changed -*/ - struct _HistogramWidget { GtkDrawingArea drawingarea; diff --git a/app/widgets/gimpitemfactory.c b/app/widgets/gimpitemfactory.c index 5874ad7532..10947caf0f 100644 --- a/app/widgets/gimpitemfactory.c +++ b/app/widgets/gimpitemfactory.c @@ -31,6 +31,7 @@ #include "commands.h" #include "dialog_handler.h" #include "fileops.h" +#include "gimphelp.h" #include "gimprc.h" #include "gimpui.h" #include "interface.h" diff --git a/app/widgets/gimpitemfactory.h b/app/widgets/gimpitemfactory.h index 708522bf56..56b41e9915 100644 --- a/app/widgets/gimpitemfactory.h +++ b/app/widgets/gimpitemfactory.h @@ -63,4 +63,5 @@ void menus_set_state (gchar *path, void menus_last_opened_add (gchar *filename); + #endif /* __MENUS_H__ */ diff --git a/app/widgets/gimppaletteeditor.c b/app/widgets/gimppaletteeditor.c index 34f1ef3c83..148c755b7b 100644 --- a/app/widgets/gimppaletteeditor.c +++ b/app/widgets/gimppaletteeditor.c @@ -39,10 +39,13 @@ #include "color_area.h" #include "color_notebook.h" #include "datafiles.h" +#include "dialog_handler.h" +#include "gimage.h" #include "gimpcontext.h" #include "gimpdnd.h" #include "gimprc.h" #include "gimpui.h" +#include "gradient.h" #include "gradient_header.h" #include "gradient_select.h" #include "palette.h" @@ -50,7 +53,9 @@ #include "palette_entries.h" #include "session.h" #include "palette_select.h" -#include "dialog_handler.h" +#include "pixel_region.h" +#include "procedural_db.h" +#include "temp_buf.h" #include "libgimp/gimpenv.h" @@ -59,6 +64,7 @@ #include "pixmaps/zoom_in.xpm" #include "pixmaps/zoom_out.xpm" + #define ENTRY_WIDTH 12 #define ENTRY_HEIGHT 10 #define SPACING 1 @@ -2356,7 +2362,7 @@ palette_import_gimlist_indexed_cb (gpointer im, GimpImage *gimage = GIMP_IMAGE (im); GSList** l; - if (gimage_base_type (gimage) == INDEXED) + if (gimp_image_base_type (gimage) == INDEXED) { l = (GSList**) data; *l = g_slist_prepend (*l, im); @@ -2440,7 +2446,7 @@ palette_import_image_sel_callback (GtkWidget *widget, palette_import_update_image_preview (gimage); lab = g_strdup_printf ("%s-%d", - g_basename (gimage_filename (import_dialog->gimage)), + g_basename (gimp_image_filename (import_dialog->gimage)), pdb_image_to_id (import_dialog->gimage)); gtk_entry_set_text (GTK_ENTRY (import_dialog->entry), lab); @@ -2451,7 +2457,7 @@ palette_import_image_menu_add (GimpImage *gimage) { GtkWidget *menuitem; gchar *lab = g_strdup_printf ("%s-%d", - g_basename (gimage_filename (gimage)), + g_basename (gimp_image_filename (gimage)), pdb_image_to_id (gimage)); menuitem = gtk_menu_item_new_with_label (lab); gtk_widget_show (menuitem); @@ -2546,7 +2552,7 @@ palette_import_image_menu_activate (gint redo, if (redo && act_num >= 0) { gchar *lab = g_strdup_printf ("%s-%d", - g_basename (gimage_filename (import_dialog->gimage)), + g_basename (gimp_image_filename (import_dialog->gimage)), pdb_image_to_id (import_dialog->gimage)); gtk_option_menu_set_history (GTK_OPTION_MENU (optionmenu1), act_num); @@ -2556,7 +2562,7 @@ palette_import_image_menu_activate (gint redo, g_slist_free (list); lab = g_strdup_printf ("%s-%d", - g_basename (gimage_filename (import_dialog->gimage)), + g_basename (gimp_image_filename (import_dialog->gimage)), pdb_image_to_id (import_dialog->gimage)); gtk_entry_set_text (GTK_ENTRY (import_dialog->entry), lab); @@ -2647,7 +2653,7 @@ palette_import_image_new (GimpSet *set, } if (!GTK_WIDGET_IS_SENSITIVE (import_dialog->image_menu_item_indexed) && - gimage_base_type(gimage) == INDEXED) + gimp_image_base_type(gimage) == INDEXED) { gtk_widget_set_sensitive (import_dialog->image_menu_item_indexed, TRUE); return; @@ -2937,15 +2943,15 @@ palette_import_create_from_image (GImage *gimage, return; /* Get the image information */ - bytes = gimage_composite_bytes (gimage); - d_type = gimage_composite_type (gimage); + bytes = gimp_image_composite_bytes (gimage); + d_type = gimp_image_composite_type (gimage); has_alpha = (d_type == RGBA_GIMAGE || d_type == GRAYA_GIMAGE || d_type == INDEXEDA_GIMAGE); indexed = d_type == INDEXEDA_GIMAGE || d_type == INDEXED_GIMAGE; width = gimage->width; height = gimage->height; - pixel_region_init (&imagePR, gimage_composite (gimage), 0, 0, + pixel_region_init (&imagePR, gimp_image_composite (gimage), 0, 0, width, height, FALSE); alpha = bytes - 1; @@ -2969,7 +2975,7 @@ palette_import_create_from_image (GImage *gimage, for (j = 0; j < imagePR.w; j++) { /* Get the rgb values for the color */ - gimage_get_color (gimage, d_type, rgb, idata); + gimp_image_get_color (gimage, d_type, rgb, idata); memcpy (rgb_real, rgb, MAX_CHANNELS); /* Structure copy */ rgb[0] = (rgb[0] / threshold) * threshold; @@ -3005,7 +3011,7 @@ palette_import_create_from_indexed (GImage *gimage, if (gimage == NULL) return; - if (gimage_base_type (gimage) != INDEXED) + if (gimp_image_base_type (gimage) != INDEXED) return; entries = palette_entries_new (pname); diff --git a/app/widgets/gimppaletteeditor.h b/app/widgets/gimppaletteeditor.h index cfa50a6aa8..3059ca3ff2 100644 --- a/app/widgets/gimppaletteeditor.h +++ b/app/widgets/gimppaletteeditor.h @@ -36,4 +36,5 @@ void palette_set_active_color (gint r, gint b, gint state); + #endif /* __PALETTE_H__ */ diff --git a/app/widgets/gimptoolbox-color-area.h b/app/widgets/gimptoolbox-color-area.h index 998d2a7eca..be57b96f14 100644 --- a/app/widgets/gimptoolbox-color-area.h +++ b/app/widgets/gimptoolbox-color-area.h @@ -15,13 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __COLOR_AREA_H__ #define __COLOR_AREA_H__ -#include "gdisplayF.h" - - #define FOREGROUND 0 #define BACKGROUND 1 @@ -55,4 +53,5 @@ void color_area_draw_rect (GdkDrawable *drawable, guchar g, guchar b); + #endif /* __COLOR_AREA_H__ */ diff --git a/app/widgets/gimptoolbox-indicator-area.c b/app/widgets/gimptoolbox-indicator-area.c index 4cf0190b03..d7ea146a42 100644 --- a/app/widgets/gimptoolbox-indicator-area.c +++ b/app/widgets/gimptoolbox-indicator-area.c @@ -15,25 +15,29 @@ * 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 -#include +#include #include "apptypes.h" #include "appenv.h" #include "brush_select.h" +#include "gimpcontext.h" #include "gimpcontextpreview.h" #include "gimpdnd.h" +#include "gimpui.h" #include "gradient_select.h" #include "indicator_area.h" #include "pattern_select.h" #include "libgimp/gimpintl.h" + #define CELL_SIZE 23 /* The size of the previews */ #define GRAD_CELL_WIDTH 48 /* The width of the gradient preview */ #define GRAD_CELL_HEIGHT 12 /* The height of the gradient preview */ diff --git a/app/widgets/gimptoolbox-indicator-area.h b/app/widgets/gimptoolbox-indicator-area.h index 76969ca3ed..089f7ee960 100644 --- a/app/widgets/gimptoolbox-indicator-area.h +++ b/app/widgets/gimptoolbox-indicator-area.h @@ -15,9 +15,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __INDICATOR_AREA_H__ #define __INDICATOR_AREA_H__ + GtkWidget * indicator_area_create (void); + #endif /* __INDICATOR_AREA_H__ */ diff --git a/app/widgets/gimpwidgets-utils.c b/app/widgets/gimpwidgets-utils.c index d0d20866c1..10428166a4 100644 --- a/app/widgets/gimpwidgets-utils.c +++ b/app/widgets/gimpwidgets-utils.c @@ -25,8 +25,12 @@ #include +#include "apptypes.h" + #include "gimpui.h" +#include "libgimp/gimphelpui.h" + #include "libgimp/gimpintl.h" diff --git a/app/widgets/gimpwidgets-utils.h b/app/widgets/gimpwidgets-utils.h index 6dbee9c5c9..dcad168d00 100644 --- a/app/widgets/gimpwidgets-utils.h +++ b/app/widgets/gimpwidgets-utils.h @@ -22,11 +22,11 @@ #ifndef __GIMP_UI_H__ #define __GIMP_UI_H__ -#include "gimphelp.h" #include "libgimp/gimpchainbutton.h" #include "libgimp/gimpdialog.h" #include "libgimp/gimpfileselection.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimppixmap.h" #include "libgimp/gimppatheditor.h" #include "libgimp/gimpquerybox.h" @@ -42,4 +42,5 @@ void gimp_message_box (gchar *message, void gimp_dialog_hide (GtkWidget *dialog); + #endif /* __GIMP_UI_H__ */ diff --git a/app/xcf.c b/app/xcf.c index 3e3ffdccf9..80a32207a8 100644 --- a/app/xcf.c +++ b/app/xcf.c @@ -30,33 +30,31 @@ #ifdef HAVE_UNISTD_H #include #endif -#include #include #include "apptypes.h" + +#include "channel.h" #include "cursorutil.h" +#include "drawable.h" #include "floating_sel.h" #include "gimage.h" #include "gimage_mask.h" #include "gimprc.h" +#include "layer.h" #include "plug_in.h" #include "parasitelist.h" #include "path.h" +#include "pathP.h" #include "procedural_db.h" -/* #include "tile_swap.h"*/ +#include "tile.h" +#include "tile_manager.h" +#include "tile_manager_pvt.h" #include "xcf.h" -#include "drawable_pvt.h" -#include "layer_pvt.h" -#include "channel_pvt.h" -#include "tile_manager_pvt.h" -#include "pathP.h" -#include "tile.h" /* ick. */ - -#include -#include -#include +#include "libgimp/gimplimits.h" +#include "libgimp/gimpparasite.h" #include "libgimp/gimpintl.h" @@ -473,7 +471,7 @@ xcf_save_image (XcfInfo *info, gint t1, t2, t3, t4; gchar version_tag[14]; - floating_layer = gimage_floating_sel (gimage); + floating_layer = gimp_image_floating_sel (gimage); if (floating_layer) floating_sel_relax (floating_layer, FALSE); @@ -649,7 +647,7 @@ xcf_save_layer_props (XcfInfo *info, if (layer == gimage->active_layer) xcf_save_prop (info, PROP_ACTIVE_LAYER); - if (layer == gimage_floating_sel (gimage)) + if (layer == gimp_image_floating_sel (gimage)) { info->floating_sel_drawable = layer->fs.drawable; xcf_save_prop (info, PROP_FLOATING_SELECTION); @@ -1724,7 +1722,7 @@ xcf_load_image (XcfInfo *info) /* add the layer to the image if its not the floating selection */ if (layer != info->floating_sel) - gimage_add_layer (gimage, layer, g_slist_length (gimage->layers)); + gimp_image_add_layer (gimage, layer, g_slist_length (gimage->layers)); /* restore the saved position so we'll be ready to * read the next offset. @@ -1760,7 +1758,7 @@ xcf_load_image (XcfInfo *info) /* add the channel to the image if its not the selection */ if (channel != gimage->selection_mask) - gimage_add_channel (gimage, channel, -1); + gimp_image_add_channel (gimage, channel, -1); /* restore the saved position so we'll be ready to * read the next offset. @@ -1769,12 +1767,12 @@ xcf_load_image (XcfInfo *info) } if (info->active_layer) - gimage_set_active_layer (gimage, info->active_layer); + gimp_image_set_active_layer (gimage, info->active_layer); if (info->active_channel) - gimage_set_active_channel (gimage, info->active_channel); + gimp_image_set_active_channel (gimage, info->active_channel); - gimage_set_filename (gimage, info->filename); + gimp_image_set_filename (gimage, info->filename); return gimage; diff --git a/app/xcf.h b/app/xcf.h index 5ae8e89bb4..6fdd27e5d0 100644 --- a/app/xcf.h +++ b/app/xcf.h @@ -15,13 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __XCF_H__ #define __XCF_H__ -#include - - typedef struct _XcfInfo XcfInfo; struct _XcfInfo diff --git a/app/xcf/xcf.c b/app/xcf/xcf.c index 3e3ffdccf9..80a32207a8 100644 --- a/app/xcf/xcf.c +++ b/app/xcf/xcf.c @@ -30,33 +30,31 @@ #ifdef HAVE_UNISTD_H #include #endif -#include #include #include "apptypes.h" + +#include "channel.h" #include "cursorutil.h" +#include "drawable.h" #include "floating_sel.h" #include "gimage.h" #include "gimage_mask.h" #include "gimprc.h" +#include "layer.h" #include "plug_in.h" #include "parasitelist.h" #include "path.h" +#include "pathP.h" #include "procedural_db.h" -/* #include "tile_swap.h"*/ +#include "tile.h" +#include "tile_manager.h" +#include "tile_manager_pvt.h" #include "xcf.h" -#include "drawable_pvt.h" -#include "layer_pvt.h" -#include "channel_pvt.h" -#include "tile_manager_pvt.h" -#include "pathP.h" -#include "tile.h" /* ick. */ - -#include -#include -#include +#include "libgimp/gimplimits.h" +#include "libgimp/gimpparasite.h" #include "libgimp/gimpintl.h" @@ -473,7 +471,7 @@ xcf_save_image (XcfInfo *info, gint t1, t2, t3, t4; gchar version_tag[14]; - floating_layer = gimage_floating_sel (gimage); + floating_layer = gimp_image_floating_sel (gimage); if (floating_layer) floating_sel_relax (floating_layer, FALSE); @@ -649,7 +647,7 @@ xcf_save_layer_props (XcfInfo *info, if (layer == gimage->active_layer) xcf_save_prop (info, PROP_ACTIVE_LAYER); - if (layer == gimage_floating_sel (gimage)) + if (layer == gimp_image_floating_sel (gimage)) { info->floating_sel_drawable = layer->fs.drawable; xcf_save_prop (info, PROP_FLOATING_SELECTION); @@ -1724,7 +1722,7 @@ xcf_load_image (XcfInfo *info) /* add the layer to the image if its not the floating selection */ if (layer != info->floating_sel) - gimage_add_layer (gimage, layer, g_slist_length (gimage->layers)); + gimp_image_add_layer (gimage, layer, g_slist_length (gimage->layers)); /* restore the saved position so we'll be ready to * read the next offset. @@ -1760,7 +1758,7 @@ xcf_load_image (XcfInfo *info) /* add the channel to the image if its not the selection */ if (channel != gimage->selection_mask) - gimage_add_channel (gimage, channel, -1); + gimp_image_add_channel (gimage, channel, -1); /* restore the saved position so we'll be ready to * read the next offset. @@ -1769,12 +1767,12 @@ xcf_load_image (XcfInfo *info) } if (info->active_layer) - gimage_set_active_layer (gimage, info->active_layer); + gimp_image_set_active_layer (gimage, info->active_layer); if (info->active_channel) - gimage_set_active_channel (gimage, info->active_channel); + gimp_image_set_active_channel (gimage, info->active_channel); - gimage_set_filename (gimage, info->filename); + gimp_image_set_filename (gimage, info->filename); return gimage; diff --git a/app/xcf/xcf.h b/app/xcf/xcf.h index 5ae8e89bb4..6fdd27e5d0 100644 --- a/app/xcf/xcf.h +++ b/app/xcf/xcf.h @@ -15,13 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __XCF_H__ #define __XCF_H__ -#include - - typedef struct _XcfInfo XcfInfo; struct _XcfInfo diff --git a/libgimp/Makefile.am b/libgimp/Makefile.am index 23e6a8acc9..f9db7947f1 100644 --- a/libgimp/Makefile.am +++ b/libgimp/Makefile.am @@ -216,6 +216,7 @@ libgimpui_la_SOURCES = \ gimpquerybox.c \ gimpsizeentry.c \ gimpui.c \ + gimpuitypes.h \ gimpunitmenu.c \ gimpwidgets.c @@ -258,6 +259,7 @@ gimpinclude_HEADERS = \ gimptile.h \ gimptypes.h \ gimpui.h \ + gimpuitypes.h \ gimpunit.h \ gimpunitmenu.h \ gimputils.h \ diff --git a/libgimp/gimpcolorbutton.c b/libgimp/gimpcolorbutton.c index 02363f07a6..65dfd63bc2 100644 --- a/libgimp/gimpcolorbutton.c +++ b/libgimp/gimpcolorbutton.c @@ -33,6 +33,9 @@ #include #include "gimp.h" + +#include "gimpuitypes.h" + #include "gimpcolorbutton.h" #include "gimplimits.h" diff --git a/libgimp/gimpcolorbutton.h b/libgimp/gimpcolorbutton.h index 2289a87e57..2d0e808208 100644 --- a/libgimp/gimpcolorbutton.h +++ b/libgimp/gimpcolorbutton.h @@ -40,7 +40,6 @@ extern "C" { #define GIMP_IS_COLOR_BUTTON(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_COLOR_BUTTON)) #define GIMP_IS_COLOR_BUTTON_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_COLOR_BUTTON)) -typedef struct _GimpColorButton GimpColorButton; typedef struct _GimpColorButtonClass GimpColorButtonClass; struct _GimpColorButtonClass diff --git a/libgimp/gimpdialog.c b/libgimp/gimpdialog.c index baf8676309..04f8788c7f 100644 --- a/libgimp/gimpdialog.c +++ b/libgimp/gimpdialog.c @@ -20,9 +20,14 @@ * Boston, MA 02111-1307, USA. */ +#include "config.h" + #include +#include "gimpuitypes.h" + #include "gimpdialog.h" +#include "gimphelpui.h" #include "pixmaps/wilber.xpm" diff --git a/libgimp/gimpdialog.h b/libgimp/gimpdialog.h index cb291aad7e..fc4626454a 100644 --- a/libgimp/gimpdialog.h +++ b/libgimp/gimpdialog.h @@ -23,8 +23,6 @@ #ifndef __GIMP_DIALOG_H__ #define __GIMP_DIALOG_H__ -#include - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ diff --git a/libgimp/gimphelpui.c b/libgimp/gimphelpui.c index 5864cfa832..4814f5f67f 100644 --- a/libgimp/gimphelpui.c +++ b/libgimp/gimphelpui.c @@ -20,9 +20,13 @@ * Boston, MA 02111-1307, USA. */ +#include "config.h" + #include #include +#include "gimpuitypes.h" + #include "gimpdialog.h" #include "gimphelpui.h" diff --git a/libgimp/gimphelpui.h b/libgimp/gimphelpui.h index 678b84eec8..7d5def98d2 100644 --- a/libgimp/gimphelpui.h +++ b/libgimp/gimphelpui.h @@ -27,13 +27,9 @@ extern "C" { #endif /* __cplusplus */ - /* For information look into the C source or the html documentation */ -typedef void (* GimpHelpFunc) (const gchar *help_data); - - void gimp_help_init (void); void gimp_help_free (void); diff --git a/libgimp/gimpparasite.c b/libgimp/gimpparasite.c index bf96c45b15..2007cfe26a 100644 --- a/libgimp/gimpparasite.c +++ b/libgimp/gimpparasite.c @@ -19,6 +19,7 @@ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ + #include "config.h" #include @@ -32,6 +33,8 @@ #include /* For _getpid() */ #endif +#include "gimptypes.h" + #include "gimpparasite.h" #include "gimpparasite_pdb.h" diff --git a/libgimp/gimpparasite.h b/libgimp/gimpparasite.h index d7303ef49e..7330d8a23e 100644 --- a/libgimp/gimpparasite.h +++ b/libgimp/gimpparasite.h @@ -42,8 +42,6 @@ extern "C" { #define GIMP_PARASITE_GRANDPARENT_UNDOABLE (GIMP_PARASITE_UNDOABLE << 16) -typedef struct _GimpParasite GimpParasite; - struct _GimpParasite { gchar *name; /* The name of the parasite. USE A UNIQUE PREFIX! */ diff --git a/libgimp/gimppatheditor.c b/libgimp/gimppatheditor.c index b0fec3ce8f..28f72b342a 100644 --- a/libgimp/gimppatheditor.c +++ b/libgimp/gimppatheditor.c @@ -20,14 +20,19 @@ * Boston, MA 02111-1307, USA. */ +#include "config.h" + #include #include -#include "gimppatheditor.h" +#include "gimptypes.h" +#include "gimpuitypes.h" -#include "libgimp/gimpfileselection.h" -#include "libgimp/gimpwidgets.h" +#include "gimppatheditor.h" +#include "gimpfileselection.h" +#include "gimpsizeentry.h" +#include "gimpwidgets.h" #include "pixmaps/new.xpm" #include "pixmaps/delete.xpm" diff --git a/libgimp/gimppatheditor.h b/libgimp/gimppatheditor.h index a1c50030e2..7187667bc7 100644 --- a/libgimp/gimppatheditor.h +++ b/libgimp/gimppatheditor.h @@ -36,7 +36,6 @@ extern "C" { #define GIMP_IS_PATH_EDITOR(obj) (GTK_CHECK_TYPE (obj, GIMP_TYPE_PATH_EDITOR)) #define GIMP_IS_PATH_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PATH_EDITOR)) -typedef struct _GimpPathEditor GimpPathEditor; typedef struct _GimpPathEditorClass GimpPathEditorClass; struct _GimpPathEditor diff --git a/libgimp/gimpprotocol.c b/libgimp/gimpprotocol.c index 8427a5a82e..bcd99c83aa 100644 --- a/libgimp/gimpprotocol.c +++ b/libgimp/gimpprotocol.c @@ -21,6 +21,8 @@ #include #include "gimpenums.h" +#include "gimptypes.h" + #include "gimpparasite.h" #include "gimpprotocol.h" #include "gimpwire.h" diff --git a/libgimp/gimpquerybox.c b/libgimp/gimpquerybox.c index 2e5c26d433..9393d6d44b 100644 --- a/libgimp/gimpquerybox.c +++ b/libgimp/gimpquerybox.c @@ -24,6 +24,9 @@ #include +#include "gimptypes.h" +#include "gimpuitypes.h" + #include "gimpdialog.h" #include "gimppixmap.h" #include "gimpquerybox.h" diff --git a/libgimp/gimpquerybox.h b/libgimp/gimpquerybox.h index 78d2efb79c..d94d3e7f42 100644 --- a/libgimp/gimpquerybox.h +++ b/libgimp/gimpquerybox.h @@ -23,7 +23,6 @@ #ifndef __GIMP_QUERY_BOX_H__ #define __GIMP_QUERY_BOX_H__ -#include #ifdef __cplusplus extern "C" { diff --git a/libgimp/gimpsizeentry.c b/libgimp/gimpsizeentry.c index ccc548ac4d..26d47cfda2 100644 --- a/libgimp/gimpsizeentry.c +++ b/libgimp/gimpsizeentry.c @@ -21,8 +21,13 @@ * Boston, MA 02111-1307, USA. */ +#include "config.h" + #include +#include "gimptypes.h" +#include "gimpuitypes.h" + #include "gimplimits.h" #include "gimpsizeentry.h" #include "gimpunitmenu.h" diff --git a/libgimp/gimpsizeentry.h b/libgimp/gimpsizeentry.h index 29d7aab1d3..23f34cc11e 100644 --- a/libgimp/gimpsizeentry.h +++ b/libgimp/gimpsizeentry.h @@ -24,8 +24,6 @@ #ifndef __GIMP_SIZE_ENTRY_H__ #define __GIMP_SIZE_ENTRY_H__ -#include - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -39,16 +37,8 @@ extern "C" { #define GIMP_IS_SIZE_ENTRY(obj) (GTK_CHECK_TYPE (obj, GIMP_TYPE_SIZE_ENTRY)) #define GIMP_IS_SIZE_ENTRY_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_SIZE_ENTRY)) -typedef struct _GimpSizeEntry GimpSizeEntry; typedef struct _GimpSizeEntryClass GimpSizeEntryClass; -typedef enum -{ - GIMP_SIZE_ENTRY_UPDATE_NONE = 0, - GIMP_SIZE_ENTRY_UPDATE_SIZE = 1, - GIMP_SIZE_ENTRY_UPDATE_RESOLUTION = 2 -} GimpSizeEntryUpdatePolicy; - typedef struct _GimpSizeEntryField GimpSizeEntryField; struct _GimpSizeEntry diff --git a/libgimp/gimptypes.h b/libgimp/gimptypes.h index af8ca3e62b..8cfac92f95 100644 --- a/libgimp/gimptypes.h +++ b/libgimp/gimptypes.h @@ -22,6 +22,10 @@ #ifndef __GIMP_TYPES_H__ #define __GIMP_TYPES_H__ + +#include "gimpunit.h" + + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -38,6 +42,7 @@ typedef struct _GimpParamColor GimpParamColor; typedef struct _GimpParamRegion GimpParamRegion; typedef union _GimpParamData GimpParamData; typedef struct _GimpParam GimpParam; +typedef struct _GimpParasite GimpParasite; #ifdef __cplusplus diff --git a/libgimp/gimpui.h b/libgimp/gimpui.h index 297473a26a..9a0334ceb3 100644 --- a/libgimp/gimpui.h +++ b/libgimp/gimpui.h @@ -22,6 +22,8 @@ #include +#include + #include #include #include diff --git a/libgimp/gimpuitypes.h b/libgimp/gimpuitypes.h new file mode 100644 index 0000000000..5e7ddb169f --- /dev/null +++ b/libgimp/gimpuitypes.h @@ -0,0 +1,51 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball + * + * gimpuitypes.h + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GIMP_UI_TYPES_H__ +#define __GIMP_UI_TYPES_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* For information look into the html documentation */ + + +typedef enum +{ + GIMP_SIZE_ENTRY_UPDATE_NONE = 0, + GIMP_SIZE_ENTRY_UPDATE_SIZE = 1, + GIMP_SIZE_ENTRY_UPDATE_RESOLUTION = 2 +} GimpSizeEntryUpdatePolicy; + +typedef struct _GimpColorButton GimpColorButton; +typedef struct _GimpPathEditor GimpPathEditor; +typedef struct _GimpSizeEntry GimpSizeEntry; +typedef struct _GimpUnitMenu GimpUnitMenu; + +typedef void (* GimpHelpFunc) (const gchar *help_data); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __GIMP_TYPES_H__ */ diff --git a/libgimp/gimpunit.h b/libgimp/gimpunit.h index 85efd5f2a7..6c537ae8ef 100644 --- a/libgimp/gimpunit.h +++ b/libgimp/gimpunit.h @@ -37,7 +37,9 @@ extern "C" { /* For information look into the C source or the html documentation */ -typedef enum +typedef enum _GimpUnit GimpUnit; + +enum _GimpUnit { GIMP_UNIT_PIXEL = 0, @@ -49,7 +51,7 @@ typedef enum GIMP_UNIT_END = 5, GIMP_UNIT_PERCENT = 65536 -} GimpUnit; +}; gint gimp_unit_get_number_of_units (void); diff --git a/libgimp/gimpunitmenu.c b/libgimp/gimpunitmenu.c index 06bae97383..18b1c30e7f 100644 --- a/libgimp/gimpunitmenu.c +++ b/libgimp/gimpunitmenu.c @@ -24,7 +24,11 @@ #include +#include "gimptypes.h" +#include "gimpuitypes.h" + #include "gimpdialog.h" +#include "gimphelpui.h" #include "gimpunitmenu.h" #include "libgimp-intl.h" diff --git a/libgimp/gimpunitmenu.h b/libgimp/gimpunitmenu.h index 50aed98fad..5a3b236c58 100644 --- a/libgimp/gimpunitmenu.h +++ b/libgimp/gimpunitmenu.h @@ -23,8 +23,6 @@ #ifndef __GIMP_UNIT_MENU_H__ #define __GIMP_UNIT_MENU_H__ -#include - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -38,7 +36,6 @@ extern "C" { #define GIMP_IS_UNIT_MENU(obj) (GTK_CHECK_TYPE (obj, GIMP_TYPE_UNIT_MENU)) #define GIMP_IS_UNIT_MENU_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_UNIT_MENU)) -typedef struct _GimpUnitMenu GimpUnitMenu; typedef struct _GimpUnitMenuClass GimpUnitMenuClass; struct _GimpUnitMenu diff --git a/libgimp/gimpwidgets.c b/libgimp/gimpwidgets.c index 966f987c10..19c4bd9b46 100644 --- a/libgimp/gimpwidgets.c +++ b/libgimp/gimpwidgets.c @@ -24,9 +24,13 @@ #include +#include "gimptypes.h" +#include "gimpuitypes.h" + #include "gimpchainbutton.h" #include "gimphelpui.h" #include "gimppixmap.h" +#include "gimpsizeentry.h" #include "gimpunitmenu.h" #include "gimpwidgets.h" #include "gimpmath.h" diff --git a/libgimp/gimpwidgets.h b/libgimp/gimpwidgets.h index d629581591..f7724c9608 100644 --- a/libgimp/gimpwidgets.h +++ b/libgimp/gimpwidgets.h @@ -23,8 +23,6 @@ #ifndef __GIMP_WIDGETS_H__ #define __GIMP_WIDGETS_H__ -#include - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ diff --git a/libgimpbase/gimpdatafiles.c b/libgimpbase/gimpdatafiles.c index 2984131418..5523f08de5 100644 --- a/libgimpbase/gimpdatafiles.c +++ b/libgimpbase/gimpdatafiles.c @@ -18,6 +18,7 @@ * 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 @@ -44,11 +45,14 @@ #endif #endif /* G_OS_WIN32 */ +#include "apptypes.h" + #include "datafiles.h" #include "gimprc.h" #include "libgimp/gimpenv.h" + /***** Functions *****/ static gboolean filestat_valid = FALSE; diff --git a/libgimpbase/gimpdatafiles.h b/libgimpbase/gimpdatafiles.h index d94b463398..d5c721e02b 100644 --- a/libgimpbase/gimpdatafiles.h +++ b/libgimpbase/gimpdatafiles.h @@ -23,11 +23,6 @@ #define __DATAFILES_H__ -#include - - -/***** Types *****/ - typedef enum { INCLUDE_TEMP_DIR = 1 << 0, diff --git a/libgimpbase/gimpparasite.c b/libgimpbase/gimpparasite.c index bf96c45b15..2007cfe26a 100644 --- a/libgimpbase/gimpparasite.c +++ b/libgimpbase/gimpparasite.c @@ -19,6 +19,7 @@ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ + #include "config.h" #include @@ -32,6 +33,8 @@ #include /* For _getpid() */ #endif +#include "gimptypes.h" + #include "gimpparasite.h" #include "gimpparasite_pdb.h" diff --git a/libgimpbase/gimpparasite.h b/libgimpbase/gimpparasite.h index d7303ef49e..7330d8a23e 100644 --- a/libgimpbase/gimpparasite.h +++ b/libgimpbase/gimpparasite.h @@ -42,8 +42,6 @@ extern "C" { #define GIMP_PARASITE_GRANDPARENT_UNDOABLE (GIMP_PARASITE_UNDOABLE << 16) -typedef struct _GimpParasite GimpParasite; - struct _GimpParasite { gchar *name; /* The name of the parasite. USE A UNIQUE PREFIX! */ diff --git a/libgimpbase/gimpprotocol.c b/libgimpbase/gimpprotocol.c index 8427a5a82e..bcd99c83aa 100644 --- a/libgimpbase/gimpprotocol.c +++ b/libgimpbase/gimpprotocol.c @@ -21,6 +21,8 @@ #include #include "gimpenums.h" +#include "gimptypes.h" + #include "gimpparasite.h" #include "gimpprotocol.h" #include "gimpwire.h" diff --git a/libgimpbase/gimpunit.h b/libgimpbase/gimpunit.h index 85efd5f2a7..6c537ae8ef 100644 --- a/libgimpbase/gimpunit.h +++ b/libgimpbase/gimpunit.h @@ -37,7 +37,9 @@ extern "C" { /* For information look into the C source or the html documentation */ -typedef enum +typedef enum _GimpUnit GimpUnit; + +enum _GimpUnit { GIMP_UNIT_PIXEL = 0, @@ -49,7 +51,7 @@ typedef enum GIMP_UNIT_END = 5, GIMP_UNIT_PERCENT = 65536 -} GimpUnit; +}; gint gimp_unit_get_number_of_units (void); diff --git a/libgimpwidgets/gimpcolorbutton.c b/libgimpwidgets/gimpcolorbutton.c index 02363f07a6..65dfd63bc2 100644 --- a/libgimpwidgets/gimpcolorbutton.c +++ b/libgimpwidgets/gimpcolorbutton.c @@ -33,6 +33,9 @@ #include #include "gimp.h" + +#include "gimpuitypes.h" + #include "gimpcolorbutton.h" #include "gimplimits.h" diff --git a/libgimpwidgets/gimpcolorbutton.h b/libgimpwidgets/gimpcolorbutton.h index 2289a87e57..2d0e808208 100644 --- a/libgimpwidgets/gimpcolorbutton.h +++ b/libgimpwidgets/gimpcolorbutton.h @@ -40,7 +40,6 @@ extern "C" { #define GIMP_IS_COLOR_BUTTON(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_COLOR_BUTTON)) #define GIMP_IS_COLOR_BUTTON_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_COLOR_BUTTON)) -typedef struct _GimpColorButton GimpColorButton; typedef struct _GimpColorButtonClass GimpColorButtonClass; struct _GimpColorButtonClass diff --git a/libgimpwidgets/gimpcolorselect.c b/libgimpwidgets/gimpcolorselect.c index d82a7112e4..2235aaac8c 100644 --- a/libgimpwidgets/gimpcolorselect.c +++ b/libgimpwidgets/gimpcolorselect.c @@ -18,6 +18,7 @@ #include "config.h" +#include #include #include @@ -33,9 +34,10 @@ #include "gimprc.h" #include "gimpui.h" #include "session.h" -#include "color_area.h" /* for color_area_draw_rect */ +#include "color_area.h" #include "libgimp/gimpcolorselector.h" +#include "libgimp/gimphelpui.h" #include "libgimp/gimpintl.h" diff --git a/libgimpwidgets/gimpdialog.c b/libgimpwidgets/gimpdialog.c index baf8676309..04f8788c7f 100644 --- a/libgimpwidgets/gimpdialog.c +++ b/libgimpwidgets/gimpdialog.c @@ -20,9 +20,14 @@ * Boston, MA 02111-1307, USA. */ +#include "config.h" + #include +#include "gimpuitypes.h" + #include "gimpdialog.h" +#include "gimphelpui.h" #include "pixmaps/wilber.xpm" diff --git a/libgimpwidgets/gimpdialog.h b/libgimpwidgets/gimpdialog.h index cb291aad7e..fc4626454a 100644 --- a/libgimpwidgets/gimpdialog.h +++ b/libgimpwidgets/gimpdialog.h @@ -23,8 +23,6 @@ #ifndef __GIMP_DIALOG_H__ #define __GIMP_DIALOG_H__ -#include - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ diff --git a/libgimpwidgets/gimphelpui.c b/libgimpwidgets/gimphelpui.c index 5864cfa832..4814f5f67f 100644 --- a/libgimpwidgets/gimphelpui.c +++ b/libgimpwidgets/gimphelpui.c @@ -20,9 +20,13 @@ * Boston, MA 02111-1307, USA. */ +#include "config.h" + #include #include +#include "gimpuitypes.h" + #include "gimpdialog.h" #include "gimphelpui.h" diff --git a/libgimpwidgets/gimphelpui.h b/libgimpwidgets/gimphelpui.h index 678b84eec8..7d5def98d2 100644 --- a/libgimpwidgets/gimphelpui.h +++ b/libgimpwidgets/gimphelpui.h @@ -27,13 +27,9 @@ extern "C" { #endif /* __cplusplus */ - /* For information look into the C source or the html documentation */ -typedef void (* GimpHelpFunc) (const gchar *help_data); - - void gimp_help_init (void); void gimp_help_free (void); diff --git a/libgimpwidgets/gimppatheditor.c b/libgimpwidgets/gimppatheditor.c index b0fec3ce8f..28f72b342a 100644 --- a/libgimpwidgets/gimppatheditor.c +++ b/libgimpwidgets/gimppatheditor.c @@ -20,14 +20,19 @@ * Boston, MA 02111-1307, USA. */ +#include "config.h" + #include #include -#include "gimppatheditor.h" +#include "gimptypes.h" +#include "gimpuitypes.h" -#include "libgimp/gimpfileselection.h" -#include "libgimp/gimpwidgets.h" +#include "gimppatheditor.h" +#include "gimpfileselection.h" +#include "gimpsizeentry.h" +#include "gimpwidgets.h" #include "pixmaps/new.xpm" #include "pixmaps/delete.xpm" diff --git a/libgimpwidgets/gimppatheditor.h b/libgimpwidgets/gimppatheditor.h index a1c50030e2..7187667bc7 100644 --- a/libgimpwidgets/gimppatheditor.h +++ b/libgimpwidgets/gimppatheditor.h @@ -36,7 +36,6 @@ extern "C" { #define GIMP_IS_PATH_EDITOR(obj) (GTK_CHECK_TYPE (obj, GIMP_TYPE_PATH_EDITOR)) #define GIMP_IS_PATH_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PATH_EDITOR)) -typedef struct _GimpPathEditor GimpPathEditor; typedef struct _GimpPathEditorClass GimpPathEditorClass; struct _GimpPathEditor diff --git a/libgimpwidgets/gimpquerybox.c b/libgimpwidgets/gimpquerybox.c index 2e5c26d433..9393d6d44b 100644 --- a/libgimpwidgets/gimpquerybox.c +++ b/libgimpwidgets/gimpquerybox.c @@ -24,6 +24,9 @@ #include +#include "gimptypes.h" +#include "gimpuitypes.h" + #include "gimpdialog.h" #include "gimppixmap.h" #include "gimpquerybox.h" diff --git a/libgimpwidgets/gimpquerybox.h b/libgimpwidgets/gimpquerybox.h index 78d2efb79c..d94d3e7f42 100644 --- a/libgimpwidgets/gimpquerybox.h +++ b/libgimpwidgets/gimpquerybox.h @@ -23,7 +23,6 @@ #ifndef __GIMP_QUERY_BOX_H__ #define __GIMP_QUERY_BOX_H__ -#include #ifdef __cplusplus extern "C" { diff --git a/libgimpwidgets/gimpsizeentry.c b/libgimpwidgets/gimpsizeentry.c index ccc548ac4d..26d47cfda2 100644 --- a/libgimpwidgets/gimpsizeentry.c +++ b/libgimpwidgets/gimpsizeentry.c @@ -21,8 +21,13 @@ * Boston, MA 02111-1307, USA. */ +#include "config.h" + #include +#include "gimptypes.h" +#include "gimpuitypes.h" + #include "gimplimits.h" #include "gimpsizeentry.h" #include "gimpunitmenu.h" diff --git a/libgimpwidgets/gimpsizeentry.h b/libgimpwidgets/gimpsizeentry.h index 29d7aab1d3..23f34cc11e 100644 --- a/libgimpwidgets/gimpsizeentry.h +++ b/libgimpwidgets/gimpsizeentry.h @@ -24,8 +24,6 @@ #ifndef __GIMP_SIZE_ENTRY_H__ #define __GIMP_SIZE_ENTRY_H__ -#include - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -39,16 +37,8 @@ extern "C" { #define GIMP_IS_SIZE_ENTRY(obj) (GTK_CHECK_TYPE (obj, GIMP_TYPE_SIZE_ENTRY)) #define GIMP_IS_SIZE_ENTRY_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_SIZE_ENTRY)) -typedef struct _GimpSizeEntry GimpSizeEntry; typedef struct _GimpSizeEntryClass GimpSizeEntryClass; -typedef enum -{ - GIMP_SIZE_ENTRY_UPDATE_NONE = 0, - GIMP_SIZE_ENTRY_UPDATE_SIZE = 1, - GIMP_SIZE_ENTRY_UPDATE_RESOLUTION = 2 -} GimpSizeEntryUpdatePolicy; - typedef struct _GimpSizeEntryField GimpSizeEntryField; struct _GimpSizeEntry diff --git a/libgimpwidgets/gimpunitmenu.c b/libgimpwidgets/gimpunitmenu.c index 06bae97383..18b1c30e7f 100644 --- a/libgimpwidgets/gimpunitmenu.c +++ b/libgimpwidgets/gimpunitmenu.c @@ -24,7 +24,11 @@ #include +#include "gimptypes.h" +#include "gimpuitypes.h" + #include "gimpdialog.h" +#include "gimphelpui.h" #include "gimpunitmenu.h" #include "libgimp-intl.h" diff --git a/libgimpwidgets/gimpunitmenu.h b/libgimpwidgets/gimpunitmenu.h index 50aed98fad..5a3b236c58 100644 --- a/libgimpwidgets/gimpunitmenu.h +++ b/libgimpwidgets/gimpunitmenu.h @@ -23,8 +23,6 @@ #ifndef __GIMP_UNIT_MENU_H__ #define __GIMP_UNIT_MENU_H__ -#include - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -38,7 +36,6 @@ extern "C" { #define GIMP_IS_UNIT_MENU(obj) (GTK_CHECK_TYPE (obj, GIMP_TYPE_UNIT_MENU)) #define GIMP_IS_UNIT_MENU_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_UNIT_MENU)) -typedef struct _GimpUnitMenu GimpUnitMenu; typedef struct _GimpUnitMenuClass GimpUnitMenuClass; struct _GimpUnitMenu diff --git a/libgimpwidgets/gimpwidgets.c b/libgimpwidgets/gimpwidgets.c index 966f987c10..19c4bd9b46 100644 --- a/libgimpwidgets/gimpwidgets.c +++ b/libgimpwidgets/gimpwidgets.c @@ -24,9 +24,13 @@ #include +#include "gimptypes.h" +#include "gimpuitypes.h" + #include "gimpchainbutton.h" #include "gimphelpui.h" #include "gimppixmap.h" +#include "gimpsizeentry.h" #include "gimpunitmenu.h" #include "gimpwidgets.h" #include "gimpmath.h" diff --git a/libgimpwidgets/gimpwidgets.h b/libgimpwidgets/gimpwidgets.h index d629581591..f7724c9608 100644 --- a/libgimpwidgets/gimpwidgets.h +++ b/libgimpwidgets/gimpwidgets.h @@ -23,8 +23,6 @@ #ifndef __GIMP_WIDGETS_H__ #define __GIMP_WIDGETS_H__ -#include - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ diff --git a/plug-ins/FractalExplorer/Dialogs.c b/plug-ins/FractalExplorer/Dialogs.c index b9a93aa2ee..0a803af320 100644 --- a/plug-ins/FractalExplorer/Dialogs.c +++ b/plug-ins/FractalExplorer/Dialogs.c @@ -6,6 +6,7 @@ #include #include +#include #include #include "FractalExplorer.h" @@ -61,8 +62,8 @@ dialog_reset_callback (GtkWidget *widget, wvals.ymin = standardvals.ymin; wvals.ymax = standardvals.ymax; wvals.iter = standardvals.iter; - wvals.cx = standardvals.cx; - wvals.cy = standardvals.cy; + wvals.cx = standardvals.cx; + wvals.cy = standardvals.cy; dialog_change_scale (); set_cmap_preview (); @@ -76,8 +77,8 @@ dialog_redraw_callback (GtkWidget *widget, gint alwaysprev = wvals.alwayspreview; wvals.alwayspreview = TRUE; - set_cmap_preview(); - dialog_update_preview(); + set_cmap_preview (); + dialog_update_preview (); wvals.alwayspreview = alwaysprev; } @@ -123,25 +124,25 @@ dialog_step_in_callback (GtkWidget *widget, zoomindex++; } - xdifferenz = wvals.xmax-wvals.xmin; - ydifferenz = wvals.ymax-wvals.ymin; - wvals.xmin += 1.0/6.0*xdifferenz; - wvals.ymin += 1.0/6.0*ydifferenz; - wvals.xmax -= 1.0/6.0*xdifferenz; - wvals.ymax -= 1.0/6.0*ydifferenz; + xdifferenz = wvals.xmax - wvals.xmin; + ydifferenz = wvals.ymax - wvals.ymin; + wvals.xmin += 1.0 / 6.0 * xdifferenz; + wvals.ymin += 1.0 / 6.0 * ydifferenz; + wvals.xmax -= 1.0 / 6.0 * xdifferenz; + wvals.ymax -= 1.0 / 6.0 * ydifferenz; zooms[zoomindex] = wvals; dialog_change_scale (); set_cmap_preview (); dialog_update_preview (); -} /* dialog_step_in_callback */ +} static void dialog_step_out_callback (GtkWidget *widget, gpointer data) { - double xdifferenz; - double ydifferenz; + gdouble xdifferenz; + gdouble ydifferenz; if (zoomindex < zoommax) { @@ -149,12 +150,12 @@ dialog_step_out_callback (GtkWidget *widget, zoomindex++; } - xdifferenz = wvals.xmax-wvals.xmin; - ydifferenz = wvals.ymax-wvals.ymin; - wvals.xmin -= 1.0/4.0*xdifferenz; - wvals.ymin -= 1.0/4.0*ydifferenz; - wvals.xmax += 1.0/4.0*xdifferenz; - wvals.ymax += 1.0/4.0*ydifferenz; + xdifferenz = wvals.xmax - wvals.xmin; + ydifferenz = wvals.ymax - wvals.ymin; + wvals.xmin -= 1.0 / 4.0 * xdifferenz; + wvals.ymin -= 1.0 / 4.0 * ydifferenz; + wvals.xmax += 1.0 / 4.0 * xdifferenz; + wvals.ymax += 1.0 / 4.0 * ydifferenz; zooms[zoomindex] = wvals; dialog_change_scale (); @@ -227,12 +228,12 @@ explorer_gradient_select_callback (gchar *name, gradient_name = g_strdup (name); gimp_gradients_get_gradient_data (gradient_name, &dummy, wvals.ncolors, - &gradient_samples); + &gradient_samples); if (wvals.colormode == 1) { - set_cmap_preview(); - dialog_update_preview(); + set_cmap_preview (); + dialog_update_preview (); } } @@ -1356,11 +1357,11 @@ explorer_logo_dialog (void) GtkWidget *xvbox; GtkWidget *xhbox; GtkWidget *vpaned; - guchar *temp; - guchar *temp2; - guchar *datapointer; - gint y; - gint x; + guchar *temp; + guchar *temp2; + guchar *datapointer; + gint y; + gint x; if (logodlg) { @@ -1416,9 +1417,10 @@ explorer_logo_dialog (void) HEADER_PIXEL(datapointer, temp2); temp2 += 3; } - gtk_preview_draw_row(GTK_PREVIEW(xpreview), - temp, - 0, y, logo_width); + + gtk_preview_draw_row (GTK_PREVIEW (xpreview), + temp, + 0, y, logo_width); } g_free (temp); @@ -1434,7 +1436,7 @@ explorer_logo_dialog (void) vpaned = gtk_vpaned_new (); gtk_box_pack_start (GTK_BOX (xhbox), vpaned, TRUE, TRUE, 0); gtk_widget_show (vpaned); - + xframe3 = gtk_frame_new (NULL); gtk_paned_add1 (GTK_PANED (vpaned), xframe3); gtk_widget_show (xframe3); @@ -1673,13 +1675,15 @@ create_load_file_selection (void) "clicked", GTK_SIGNAL_FUNC (load_file_selection_ok), (gpointer) window); - gimp_help_set_help_data (GTK_FILE_SELECTION(window)->ok_button, _("Click here to load your file"), NULL); + gimp_help_set_help_data (GTK_FILE_SELECTION(window)->ok_button, + _("Click here to load your file"), NULL); gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION (window)->cancel_button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window)); - gimp_help_set_help_data (GTK_FILE_SELECTION(window)->cancel_button, _("Click here to cancel load procedure"), NULL); + gimp_help_set_help_data (GTK_FILE_SELECTION(window)->cancel_button, + _("Click here to cancel load procedure"), NULL); } if (!GTK_WIDGET_VISIBLE (window)) @@ -1718,6 +1722,7 @@ create_file_selection (void) gimp_help_set_help_data (GTK_FILE_SELECTION (window)->cancel_button, _("Click here to cancel save procedure"), NULL); } + if (tpath) { gtk_file_selection_set_filename (GTK_FILE_SELECTION (window), tpath); @@ -1736,7 +1741,9 @@ create_file_selection (void) g_free (dir); } else - gtk_file_selection_set_filename (GTK_FILE_SELECTION (window),"/tmp"); + { + gtk_file_selection_set_filename (GTK_FILE_SELECTION (window), "/tmp"); + } if (!GTK_WIDGET_VISIBLE (window)) gtk_widget_show (window); diff --git a/plug-ins/gdyntext/message_window.c b/plug-ins/gdyntext/message_window.c index 11502ff87d..c7d542cde0 100644 --- a/plug-ins/gdyntext/message_window.c +++ b/plug-ins/gdyntext/message_window.c @@ -20,11 +20,17 @@ * $Id$ */ +#include "config.h" + #include -#include "libgimp/gimpui.h" -#include "libgimp/stdplugins-intl.h" + +#include +#include + #include "message_window.h" +#include "libgimp/stdplugins-intl.h" + static void message_window_class_init (MessageWindowClass *class); static void message_window_init (MessageWindow *mw); diff --git a/plug-ins/imagemap/imap_default_dialog.c b/plug-ins/imagemap/imap_default_dialog.c index 1424746438..e9d12816ef 100644 --- a/plug-ins/imagemap/imap_default_dialog.c +++ b/plug-ins/imagemap/imap_default_dialog.c @@ -23,11 +23,14 @@ #include "config.h" -#include "libgimp/gimpui.h" -#include "libgimp/stdplugins-intl.h" +#include +#include #include "imap_default_dialog.h" +#include "libgimp/stdplugins-intl.h" + + static void dialog_cancel(GtkWidget *widget, gpointer data) { diff --git a/plug-ins/imagemap/imap_file.c b/plug-ins/imagemap/imap_file.c index c8a48dec46..403c4e2447 100644 --- a/plug-ins/imagemap/imap_file.c +++ b/plug-ins/imagemap/imap_file.c @@ -26,14 +26,17 @@ #include #include -#include "libgimp/stdplugins-intl.h" -#include "libgimp/gimpui.h" +#include +#include #include "imap_default_dialog.h" #include "imap_file.h" #include "imap_main.h" #include "imap_table.h" +#include "libgimp/stdplugins-intl.h" + + static void open_cb(GtkWidget *widget, gpointer data) { diff --git a/tools/pdbgen/app.pl b/tools/pdbgen/app.pl index b5d75715c2..5d5d2bfe15 100644 --- a/tools/pdbgen/app.pl +++ b/tools/pdbgen/app.pl @@ -674,17 +674,18 @@ GPL foreach (@{$main::grp{$group}->{headers}}) { $out->{headers}->{$_}++ } delete $out->{headers}->{q/"procedural_db.h"/}; + delete $out->{headers}->{q/"config.h"/}; + delete $out->{headers}->{q/"apptypes.h"/}; my @headers = sort { my ($x, $y) = ($a, $b); foreach ($x, $y) { - $_ = "!$_" if $_ eq '"config.h"'; $_ = "~$_" if /libgimp/; s/^{headers}}; - my $headers = ""; my $lib = 0; my $seen = 0; + my $headers = ""; my $lib = 0; my $seen = 0; my $eek = 0; foreach (@headers) { if ($_ eq '') { $headers .= "\n" if $seen; @@ -692,7 +693,19 @@ GPL } $seen++ if /^'; + $headers .= "\n\n"; + $headers .= '#include "apptypes.h"'; + $headers .= "\n"; + $headers .= '#include "procedural_db.h"'; + $headers .= "\n"; + $headers .= "\n"; + } + $seen = 0 if !/^ $cfile" or die "Can't open $cfile: $!\n"; print CFILE $gpl; - print CFILE qq/#include "procedural_db.h"\n\n/; + print CFILE qq/#include "config.h"\n\n/; print CFILE $headers, "\n"; print CFILE $extra->{decls}, "\n" if exists $extra->{decls}; print CFILE $out->{procs}; diff --git a/tools/pdbgen/enums.pl b/tools/pdbgen/enums.pl index 25742b8d15..1280112726 100644 --- a/tools/pdbgen/enums.pl +++ b/tools/pdbgen/enums.pl @@ -157,6 +157,87 @@ package Gimp::CodeGen::enums; CUBIC_INTERPOLATION => '1', NEAREST_NEIGHBOR_INTERPOLATION => '2' } }, + OrientationType => + { contig => 1, + header => 'apptypes.h', + symbols => [ qw(HORIZONTAL VERTICAL UNKNOWN) ], + mapping => { HORIZONTAL => '0', + VERTICAL => '1', + UNKNOWN => '2' } + }, + PDBArgType => + { contig => 1, + header => 'apptypes.h', + symbols => [ qw(PDB_INT32 PDB_INT16 PDB_INT8 PDB_FLOAT PDB_STRING + PDB_INT32ARRAY PDB_INT16ARRAY PDB_INT8ARRAY + PDB_FLOATARRAY PDB_STRINGARRAY PDB_COLOR + PDB_REGION PDB_DISPLAY PDB_IMAGE PDB_LAYER + PDB_CHANNEL PDB_DRAWABLE PDB_SELECTION + PDB_BOUNDARY PDB_PATH PDB_PARASITE PDB_STATUS + PDB_END) ], + mapping => { PDB_INT32 => '0', + PDB_INT16 => '1', + PDB_INT8 => '2', + PDB_FLOAT => '3', + PDB_STRING => '4', + PDB_INT32ARRAY => '5', + PDB_INT16ARRAY => '6', + PDB_INT8ARRAY => '7', + PDB_FLOATARRAY => '8', + PDB_STRINGARRAY => '9', + PDB_COLOR => '10', + PDB_REGION => '11', + PDB_DISPLAY => '12', + PDB_IMAGE => '13', + PDB_LAYER => '14', + PDB_CHANNEL => '15', + PDB_DRAWABLE => '16', + PDB_SELECTION => '17', + PDB_BOUNDARY => '18', + PDB_PATH => '19', + PDB_PARASITE => '20', + PDB_STATUS => '21', + PDB_END => '22' } + }, + PDBStatusType => + { contig => 1, + header => 'apptypes.h', + symbols => [ qw(PDB_EXECUTION_ERROR PDB_CALLING_ERROR + PDB_PASS_THROUGH PDB_SUCCESS PDB_CANCEL) ], + mapping => { PDB_EXECUTION_ERROR => '0', + PDB_CALLING_ERROR => '1', + PDB_PASS_THROUGH => '2', + PDB_SUCCESS => '3', + PDB_CANCEL => '4' } + }, + PDBProcType => + { contig => 1, + header => 'apptypes.h', + symbols => [ qw(PDB_INTERNAL PDB_PLUGIN PDB_EXTENSION + PDB_TEMPORARY) ], + mapping => { PDB_INTERNAL => '0', + PDB_PLUGIN => '1', + PDB_EXTENSION => '2', + PDB_TEMPORARY => '3' }, + nicks => { PDB_INTERNAL => 'INTERNAL', + PDB_PLUGIN => 'PLUGIN', + PDB_EXTENSION => 'EXTENSION', + PDB_TEMPORARY => 'TEMPORARY' } + }, + ChannelOps => + { contig => 1, + header => 'apptypes.h', + symbols => [ qw(CHANNEL_OP_ADD CHANNEL_OP_SUB CHANNEL_OP_REPLACE + CHANNEL_OP_INTERSECT) ], + mapping => { CHANNEL_OP_ADD => '0', + CHANNEL_OP_SUB => '1', + CHANNEL_OP_REPLACE => '2', + CHANNEL_OP_INTERSECT => '3' }, + nicks => { CHANNEL_OP_ADD => 'ADD', + CHANNEL_OP_SUB => 'SUB', + CHANNEL_OP_REPLACE => 'REPLACE', + CHANNEL_OP_INTERSECT => 'INTERSECT' } + }, GradientType => { contig => 1, header => 'blend.h', @@ -206,15 +287,6 @@ package Gimp::CodeGen::enums; BG_BUCKET_FILL => '1', PATTERN_BUCKET_FILL => '2' } }, - ChannelOps => - { contig => 1, - header => 'channel.h', - symbols => [ qw(ADD SUB REPLACE INTERSECT) ], - mapping => { ADD => '0', - SUB => '1', - REPLACE => '2', - INTERSECT => '3' } - }, ChannelOffsetType => { contig => 1, header => 'channel_ops.h', @@ -292,14 +364,6 @@ package Gimp::CodeGen::enums; STACK_TRACE_QUERY => '1', STACK_TRACE_ALWAYS => '2' } }, - OrientationType => - { contig => 1, - header => 'gimpimage.h', - symbols => [ qw(HORIZONTAL VERTICAL UNKNOWN) ], - mapping => { HORIZONTAL => '0', - VERTICAL => '1', - UNKNOWN => '2' } - }, ChannelType => { contig => 1, header => 'gimpimage.h', @@ -354,65 +418,6 @@ package Gimp::CodeGen::enums; RUN_NONINTERACTIVE => '1', RUN_WITH_LAST_VALS => '2' } }, - PDBArgType => - { contig => 1, - header => 'procedural_db.h', - symbols => [ qw(PDB_INT32 PDB_INT16 PDB_INT8 PDB_FLOAT PDB_STRING - PDB_INT32ARRAY PDB_INT16ARRAY PDB_INT8ARRAY - PDB_FLOATARRAY PDB_STRINGARRAY PDB_COLOR - PDB_REGION PDB_DISPLAY PDB_IMAGE PDB_LAYER - PDB_CHANNEL PDB_DRAWABLE PDB_SELECTION - PDB_BOUNDARY PDB_PATH PDB_PARASITE PDB_STATUS - PDB_END) ], - mapping => { PDB_INT32 => '0', - PDB_INT16 => '1', - PDB_INT8 => '2', - PDB_FLOAT => '3', - PDB_STRING => '4', - PDB_INT32ARRAY => '5', - PDB_INT16ARRAY => '6', - PDB_INT8ARRAY => '7', - PDB_FLOATARRAY => '8', - PDB_STRINGARRAY => '9', - PDB_COLOR => '10', - PDB_REGION => '11', - PDB_DISPLAY => '12', - PDB_IMAGE => '13', - PDB_LAYER => '14', - PDB_CHANNEL => '15', - PDB_DRAWABLE => '16', - PDB_SELECTION => '17', - PDB_BOUNDARY => '18', - PDB_PATH => '19', - PDB_PARASITE => '20', - PDB_STATUS => '21', - PDB_END => '22' } - }, - PDBStatusType => - { contig => 1, - header => 'procedural_db.h', - symbols => [ qw(PDB_EXECUTION_ERROR PDB_CALLING_ERROR - PDB_PASS_THROUGH PDB_SUCCESS PDB_CANCEL) ], - mapping => { PDB_EXECUTION_ERROR => '0', - PDB_CALLING_ERROR => '1', - PDB_PASS_THROUGH => '2', - PDB_SUCCESS => '3', - PDB_CANCEL => '4' } - }, - PDBProcType => - { contig => 1, - header => 'procedural_db.h', - symbols => [ qw(PDB_INTERNAL PDB_PLUGIN PDB_EXTENSION - PDB_TEMPORARY) ], - mapping => { PDB_INTERNAL => '0', - PDB_PLUGIN => '1', - PDB_EXTENSION => '2', - PDB_TEMPORARY => '3' }, - nicks => { PDB_INTERNAL => 'INTERNAL', - PDB_PLUGIN => 'PLUGIN', - PDB_EXTENSION => 'EXTENSION', - PDB_TEMPORARY => 'TEMPORARY' } - }, SizeType => { contig => 1, header => 'text_tool.h', diff --git a/tools/pdbgen/pdb/brush_select.pdb b/tools/pdbgen/pdb/brush_select.pdb index 88bfcc59e2..f8b344105c 100644 --- a/tools/pdbgen/pdb/brush_select.pdb +++ b/tools/pdbgen/pdb/brush_select.pdb @@ -154,7 +154,7 @@ CODE ); } -@headers = qw( "brush_select.h"); +@headers = qw( "gimpcontext.h" "brush_select.h"); $extra{app}->{code} = <<'CODE'; static BrushSelect * diff --git a/tools/pdbgen/pdb/brushes.pdb b/tools/pdbgen/pdb/brushes.pdb index a91a363b34..4541428ca7 100644 --- a/tools/pdbgen/pdb/brushes.pdb +++ b/tools/pdbgen/pdb/brushes.pdb @@ -353,7 +353,7 @@ CODE ); } -@headers = qw("gimplist.h" "gimpbrush.h" "gimpbrushlist.h" "gimpcontext.h"); +@headers = qw("gimplist.h" "gimpbrush.h" "gimpbrushlist.h" "gimpcontext.h" "temp_buf.h"); @procs = qw(brushes_refresh brushes_get_brush brushes_set_brush brushes_get_opacity brushes_set_opacity brushes_get_spacing diff --git a/tools/pdbgen/pdb/channel.pdb b/tools/pdbgen/pdb/channel.pdb index bd44590a12..40f3914ed8 100644 --- a/tools/pdbgen/pdb/channel.pdb +++ b/tools/pdbgen/pdb/channel.pdb @@ -225,7 +225,7 @@ HELP $date = '1998'; CODE -@headers = qw("channel.h" "channel_pvt.h"); +@headers = qw("channel.h"); unshift @procs, qw(channel_new channel_copy channel_delete); %exports = (app => [@procs], lib => [@procs]); diff --git a/tools/pdbgen/pdb/color.pdb b/tools/pdbgen/pdb/color.pdb index 45db18cd39..703de4cf50 100644 --- a/tools/pdbgen/pdb/color.pdb +++ b/tools/pdbgen/pdb/color.pdb @@ -761,7 +761,8 @@ CODE ); } -@headers = qw("gimpimage.h" "gimpdrawable.h" "gimplut.h" "lut_funcs.h"); +@headers = qw("histogramwidget.h" "gimpimage.h" "gimpdrawable.h" "gimphistogram.h" "gimplut.h" + "lut_funcs.h" "pixel_region.h" "pixel_processor.h"); @procs = qw(brightness_contrast levels posterize desaturate equalize invert curves_spline curves_explicit color_balance histogram diff --git a/tools/pdbgen/pdb/convert.pdb b/tools/pdbgen/pdb/convert.pdb index de78b92c42..393738dafd 100644 --- a/tools/pdbgen/pdb/convert.pdb +++ b/tools/pdbgen/pdb/convert.pdb @@ -164,7 +164,7 @@ CODE ); } -@headers = qw("gimage.h" "convert.h"); +@headers = qw("gimage.h" "palette_entries.h" "convert.h"); @procs = qw(convert_rgb convert_grayscale convert_indexed); %exports = (app => [@procs], lib => [@procs]); diff --git a/tools/pdbgen/pdb/display.pdb b/tools/pdbgen/pdb/display.pdb index 783a24d988..02a34a8409 100644 --- a/tools/pdbgen/pdb/display.pdb +++ b/tools/pdbgen/pdb/display.pdb @@ -84,7 +84,7 @@ HELP %invoke = ( code => 'gdisplays_flush ();' ); } -@headers = qw("gdisplay.h"); +@headers = qw("gdisplay.h" "gimpimage.h"); @procs = qw(display_new display_delete displays_flush); %exports = (app => [@procs], lib => [@procs]); diff --git a/tools/pdbgen/pdb/drawable.pdb b/tools/pdbgen/pdb/drawable.pdb index 314c004ba0..7309960ea2 100644 --- a/tools/pdbgen/pdb/drawable.pdb +++ b/tools/pdbgen/pdb/drawable.pdb @@ -498,7 +498,7 @@ CODE ); } -@headers = qw("drawable.h"); +@headers = qw("drawable.h" "tile.h" "tile_manager.h" "temp_buf.h"); @procs = qw(drawable_merge_shadow drawable_fill drawable_update drawable_mask_bounds drawable_image drawable_type diff --git a/tools/pdbgen/pdb/fileops.pdb b/tools/pdbgen/pdb/fileops.pdb index 9f620c9025..4fbe7acf9a 100644 --- a/tools/pdbgen/pdb/fileops.pdb +++ b/tools/pdbgen/pdb/fileops.pdb @@ -412,7 +412,7 @@ CODE ); } -@headers = qw("fileops.h" "plug_in.h" "config.h" ); +@headers = qw("fileops.h" "plug_in.h" ); @procs = qw(file_load file_save file_load_thumbnail file_save_thumbnail temp_name register_magic_load_handler register_load_handler diff --git a/tools/pdbgen/pdb/gradient_select.pdb b/tools/pdbgen/pdb/gradient_select.pdb index 071c559643..ce7b9b00b7 100644 --- a/tools/pdbgen/pdb/gradient_select.pdb +++ b/tools/pdbgen/pdb/gradient_select.pdb @@ -236,7 +236,7 @@ CODE ); } -@headers = qw( "gimpcontext.h" "gradient_header.h" "gradient_select.h"); +@headers = qw( "gimpcontext.h" "gradient.h" "gradient_header.h" "gradient_select.h"); $extra{app}->{code} = <<'CODE'; static GradientSelect * diff --git a/tools/pdbgen/pdb/gradients.pdb b/tools/pdbgen/pdb/gradients.pdb index 27dbfa99e2..62eb2a86ab 100644 --- a/tools/pdbgen/pdb/gradients.pdb +++ b/tools/pdbgen/pdb/gradients.pdb @@ -229,7 +229,7 @@ CODE ); } -@headers = qw("gimpcontext.h" "gradient_header.h"); +@headers = qw("gimpcontext.h" "gradient.h" "gradient_header.h"); @procs = qw(gradients_get_list gradients_get_active gradients_set_active gradients_sample_uniform gradients_sample_custom); diff --git a/tools/pdbgen/pdb/help.pdb b/tools/pdbgen/pdb/help.pdb index dcf43a27e8..94452aedd1 100644 --- a/tools/pdbgen/pdb/help.pdb +++ b/tools/pdbgen/pdb/help.pdb @@ -50,7 +50,7 @@ HELP ); } -@headers = qw("gimphelp.h" "plug_in.h"); +@headers = qw( "gimphelp.h" "plug_in.h"); @procs = qw(help); %exports = (app => [@procs], lib => [@procs]); diff --git a/tools/pdbgen/pdb/image.pdb b/tools/pdbgen/pdb/image.pdb index cfe8d09d12..e0abbaba18 100644 --- a/tools/pdbgen/pdb/image.pdb +++ b/tools/pdbgen/pdb/image.pdb @@ -1014,7 +1014,6 @@ HELP ); %invoke = ( - headers => [ qw("layer_pvt.h") ], vars => [ 'Layer *floating_sel' ], code => <<'CODE' { @@ -1433,7 +1432,7 @@ CODE } -@headers = qw("config.h" "gimage.h" +@headers = qw("config.h" "gimage.h" "temp_buf.h" "libgimp/gimpmath.h" "libgimp/gimpintl.h" "libgimp/gimplimits.h"); $extra{app}->{code} = <<'CODE'; diff --git a/tools/pdbgen/pdb/layer.pdb b/tools/pdbgen/pdb/layer.pdb index 7e5145c9b5..5e8f82545d 100644 --- a/tools/pdbgen/pdb/layer.pdb +++ b/tools/pdbgen/pdb/layer.pdb @@ -47,7 +47,7 @@ sub layer_change_invoke { { if ((gimage = GIMP_DRAWABLE(layer)->gimage)) { - floating_layer = gimage_floating_sel (gimage); + floating_layer = gimp_image_floating_sel (gimage); undo_push_group_start (gimage, ${undo}_UNDO); @@ -541,7 +541,7 @@ HELP $date = '1998'; CODE -@headers = qw("layer.h" "layer_pvt.h"); +@headers = qw("layer.h" "gimpimage.h"); unshift @procs, qw(layer_new layer_copy layer_create_mask layer_scale layer_resize layer_delete layer_translate layer_add_alpha diff --git a/tools/pdbgen/pdb/misc_tools.pdb b/tools/pdbgen/pdb/misc_tools.pdb index c7483a91ad..fde62d68e4 100644 --- a/tools/pdbgen/pdb/misc_tools.pdb +++ b/tools/pdbgen/pdb/misc_tools.pdb @@ -1529,6 +1529,8 @@ sub ink { ); } +@headers = qw("gimpimage.h" "tile_manager.h"); + @procs = qw(airbrush airbrush_default blend bucket_fill by_color_select clone clone_default color_picker convolve convolve_default crop dodgeburn dodgeburn_default diff --git a/tools/pdbgen/pdb/paint_tools.pdb b/tools/pdbgen/pdb/paint_tools.pdb index c7483a91ad..fde62d68e4 100644 --- a/tools/pdbgen/pdb/paint_tools.pdb +++ b/tools/pdbgen/pdb/paint_tools.pdb @@ -1529,6 +1529,8 @@ sub ink { ); } +@headers = qw("gimpimage.h" "tile_manager.h"); + @procs = qw(airbrush airbrush_default blend bucket_fill by_color_select clone clone_default color_picker convolve convolve_default crop dodgeburn dodgeburn_default diff --git a/tools/pdbgen/pdb/pattern_select.pdb b/tools/pdbgen/pdb/pattern_select.pdb index 470d1ec33e..196e7d36bf 100644 --- a/tools/pdbgen/pdb/pattern_select.pdb +++ b/tools/pdbgen/pdb/pattern_select.pdb @@ -135,7 +135,7 @@ CODE ); } -@headers = qw( "pattern_select.h" "gimpcontext.h"); +@headers = qw( "patterns.h" "pattern_select.h" "gimpcontext.h"); $extra{app}->{code} = <<'CODE'; static PatternSelect * diff --git a/tools/pdbgen/pdb/patterns.pdb b/tools/pdbgen/pdb/patterns.pdb index 35c402f2ab..6397f556a7 100644 --- a/tools/pdbgen/pdb/patterns.pdb +++ b/tools/pdbgen/pdb/patterns.pdb @@ -211,7 +211,7 @@ CODE ); } -@headers = qw("gimpcontext.h" "patterns.h"); +@headers = qw("gimpcontext.h" "patterns.h" "temp_buf.h"); @procs = qw(patterns_get_pattern patterns_set_pattern patterns_list patterns_get_pattern_data); diff --git a/tools/pdbgen/pdb/selection.pdb b/tools/pdbgen/pdb/selection.pdb index 3b4667a44a..f74a7a8d86 100644 --- a/tools/pdbgen/pdb/selection.pdb +++ b/tools/pdbgen/pdb/selection.pdb @@ -357,7 +357,7 @@ HELP ); } -@headers = qw("gimage_mask.h"); +@headers = qw("gimage_mask.h" "gimpimage.h"); @procs = qw(selection_bounds selection_value selection_is_empty selection_translate selection_float selection_clear diff --git a/tools/pdbgen/pdb/tools.pdb b/tools/pdbgen/pdb/tools.pdb index c7483a91ad..fde62d68e4 100644 --- a/tools/pdbgen/pdb/tools.pdb +++ b/tools/pdbgen/pdb/tools.pdb @@ -1529,6 +1529,8 @@ sub ink { ); } +@headers = qw("gimpimage.h" "tile_manager.h"); + @procs = qw(airbrush airbrush_default blend bucket_fill by_color_select clone clone_default color_picker convolve convolve_default crop dodgeburn dodgeburn_default diff --git a/tools/pdbgen/pdb/transform_tools.pdb b/tools/pdbgen/pdb/transform_tools.pdb index c7483a91ad..fde62d68e4 100644 --- a/tools/pdbgen/pdb/transform_tools.pdb +++ b/tools/pdbgen/pdb/transform_tools.pdb @@ -1529,6 +1529,8 @@ sub ink { ); } +@headers = qw("gimpimage.h" "tile_manager.h"); + @procs = qw(airbrush airbrush_default blend bucket_fill by_color_select clone clone_default color_picker convolve convolve_default crop dodgeburn dodgeburn_default