From 049872b36138b247c97ff830a0fcfa310f874c60 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Wed, 12 Apr 2006 12:49:29 +0000 Subject: [PATCH] app/*.[ch] converted tabs to spaces. 2006-04-12 Sven Neumann * app/*.[ch] * app/*/*.[ch]: converted tabs to spaces. --- ChangeLog | 12 +- app/actions/buffers-commands.c | 10 +- app/actions/channels-commands.c | 14 +- app/actions/data-commands.c | 34 +- app/actions/debug-commands.c | 26 +- app/actions/dialogs-commands.c | 4 +- app/actions/dockable-actions.c | 2 +- app/actions/edit-commands.c | 4 +- app/actions/error-console-commands.c | 10 +- app/actions/gradient-editor-commands.c | 20 +- app/actions/gradients-commands.c | 6 +- app/actions/gradients-commands.h | 2 +- app/actions/help-commands.c | 4 +- app/actions/help-commands.h | 4 +- app/actions/image-commands.c | 8 +- app/actions/layers-commands.c | 26 +- app/actions/palette-editor-commands.c | 10 +- app/actions/palettes-commands.c | 20 +- app/actions/plug-in-actions.c | 2 +- app/actions/plug-in-commands.c | 2 +- app/actions/quick-mask-commands.c | 2 +- app/actions/tools-commands.c | 2 +- app/app_procs.c | 12 +- app/base/base-types.h | 2 +- app/base/base.c | 12 +- app/base/boundary.c | 242 +++---- app/base/boundary.h | 16 +- app/base/brush-scale.h | 8 +- app/base/color-balance.c | 50 +- app/base/color-balance.h | 2 +- app/base/colorize.c | 12 +- app/base/cpercep.c | 64 +- app/base/cpercep.h | 2 +- app/base/curves.c | 50 +- app/base/curves.h | 6 +- app/base/gimphistogram.c | 218 +++--- app/base/gimplut.c | 190 +++--- app/base/gimplut.h | 24 +- app/base/hue-saturation.c | 76 +-- app/base/hue-saturation.h | 2 +- app/base/levels.c | 108 +-- app/base/pixel-processor.c | 62 +- app/base/pixel-region.c | 302 ++++----- app/base/pixel-region.h | 64 +- app/base/pixel-surround.c | 42 +- app/base/siox.c | 24 +- app/base/temp-buf.c | 98 +-- app/base/temp-buf.h | 2 +- app/base/threshold.c | 32 +- app/base/tile-cache.c | 124 ++-- app/base/tile-manager-crop.c | 88 +-- app/base/tile-manager-crop.h | 2 +- app/base/tile-manager-private.h | 8 +- app/base/tile-manager.c | 312 ++++----- app/base/tile-manager.h | 98 +-- app/base/tile-private.h | 28 +- app/base/tile-swap.c | 318 ++++----- app/base/tile.c | 64 +- app/base/tile.h | 22 +- app/batch.c | 2 +- app/composite/gimp-composite-3dnow.c | 2 - app/composite/gimp-composite-3dnow.h | 4 +- app/composite/gimp-composite-altivec.c | 2 - app/composite/gimp-composite-altivec.h | 4 +- app/composite/gimp-composite-generic.c | 3 +- app/composite/gimp-composite-mmx.c | 5 +- app/composite/gimp-composite-mmx.h | 6 +- app/composite/gimp-composite-regression.c | 130 ++-- app/composite/gimp-composite-regression.h | 72 +- app/composite/gimp-composite-sse.c | 5 +- app/composite/gimp-composite-sse.h | 6 +- app/composite/gimp-composite-sse2.c | 8 +- app/composite/gimp-composite-sse2.h | 4 +- app/composite/gimp-composite-vis.c | 2 - app/composite/gimp-composite-vis.h | 4 +- app/composite/gimp-composite-x86.h | 7 +- app/composite/gimp-composite.c | 4 +- app/composite/gimp-composite.h | 3 +- app/config/gimpbaseconfig.c | 4 +- app/config/gimpconfig-dump.c | 246 +++---- app/config/gimpconfig-file.c | 12 +- app/config/gimpcoreconfig.c | 32 +- app/config/gimpdisplayconfig.c | 12 +- app/config/gimpguiconfig.c | 2 +- app/config/gimppluginconfig.c | 10 +- app/config/gimprc-deserialize.c | 6 +- app/config/gimprc.c | 38 +- app/config/test-config.c | 6 +- app/core/core-types.h | 2 +- app/core/gimp-documents.c | 12 +- app/core/gimp-edit.c | 36 +- app/core/gimp-gui.c | 4 +- app/core/gimp-modules.c | 2 +- app/core/gimp-parasites.c | 20 +- app/core/gimp-templates.c | 8 +- app/core/gimp-transform-region.c | 4 +- app/core/gimp-units.c | 18 +- app/core/gimp-utils.c | 16 +- app/core/gimp.h | 12 +- app/core/gimparea.c | 14 +- app/core/gimpbrushpipe-load.c | 76 +-- app/core/gimpbrushpipe.c | 76 +-- app/core/gimpbrushpipe.h | 12 +- app/core/gimpchannel-combine.c | 138 ++-- app/core/gimpchannel.c | 16 +- app/core/gimpcontainer.c | 194 +++--- app/core/gimpcontainer.h | 52 +- app/core/gimpdata.c | 16 +- app/core/gimpdata.h | 2 +- app/core/gimpdatafactory.c | 14 +- app/core/gimpdatafactory.h | 16 +- app/core/gimpdrawable-blend.c | 238 +++---- app/core/gimpdrawable-bucket-fill.c | 40 +- app/core/gimpdrawable-combine.c | 40 +- app/core/gimpdrawable-desaturate.c | 4 +- app/core/gimpdrawable-equalize.c | 4 +- app/core/gimpdrawable-equalize.h | 2 +- app/core/gimpdrawable-histogram.c | 4 +- app/core/gimpdrawable-histogram.h | 2 +- app/core/gimpdrawable-invert.c | 4 +- app/core/gimpdrawable-offset.c | 290 ++++---- app/core/gimpdrawable-offset.h | 8 +- app/core/gimpdrawable-transform.c | 4 +- app/core/gimpdrawable.h | 38 +- app/core/gimpgradient-load.c | 14 +- app/core/gimpgradient-save.c | 32 +- app/core/gimpgradient.c | 200 +++--- app/core/gimpgrid.c | 36 +- app/core/gimpimage-colorhash.c | 40 +- app/core/gimpimage-colorhash.h | 8 +- app/core/gimpimage-contiguous-region.c | 110 ++-- app/core/gimpimage-crop.c | 88 +-- app/core/gimpimage-crop.h | 30 +- app/core/gimpimage-duplicate.c | 46 +- app/core/gimpimage-flip.c | 16 +- app/core/gimpimage-guides.c | 4 +- app/core/gimpimage-preview.c | 96 +-- app/core/gimpimage-rotate.c | 18 +- app/core/gimpimage-scale.c | 44 +- app/core/gimpimage-undo-push.c | 56 +- app/core/gimpimage.h | 130 ++-- app/core/gimpitem.h | 2 +- app/core/gimplayer-floating-sel.c | 196 +++--- app/core/gimplayer.c | 268 ++++---- app/core/gimplayermask.c | 16 +- app/core/gimplayermask.h | 12 +- app/core/gimplist.c | 38 +- app/core/gimpobject.c | 46 +- app/core/gimppalette-import.c | 82 +-- app/core/gimppalette-import.h | 12 +- app/core/gimpparasitelist.h | 4 +- app/core/gimppdbprogress.c | 2 +- app/core/gimppickable.c | 18 +- app/core/gimppreviewcache.c | 68 +- app/core/gimpprojection-construct.c | 188 +++--- app/core/gimpprojection.c | 22 +- app/core/gimpprojection.h | 2 +- app/core/gimpselection.c | 112 ++-- app/core/gimpstrokeoptions.c | 6 +- app/core/gimptemplate.c | 8 +- app/core/gimptoolinfo.c | 20 +- app/core/gimptoolinfo.h | 22 +- app/core/gimpunit.c | 62 +- app/dialogs/channel-options-dialog.c | 24 +- app/dialogs/channel-options-dialog.h | 2 +- app/dialogs/convert-dialog.c | 26 +- app/dialogs/desaturate-dialog.c | 2 +- app/dialogs/dialogs-constructors.c | 90 +-- app/dialogs/dialogs.c | 56 +- app/dialogs/grid-dialog.c | 2 +- app/dialogs/image-new-dialog.c | 2 +- app/dialogs/layer-add-mask-dialog.c | 2 +- app/dialogs/layer-options-dialog.c | 4 +- app/dialogs/module-dialog.c | 34 +- app/dialogs/offset-dialog.c | 18 +- app/dialogs/palette-import-dialog.c | 18 +- app/dialogs/preferences-dialog.c | 6 +- app/dialogs/print-size-dialog.c | 28 +- app/dialogs/resize-dialog.c | 6 +- app/dialogs/resolution-calibrate-dialog.c | 42 +- app/dialogs/tips-dialog.c | 26 +- app/dialogs/vectors-options-dialog.c | 4 +- app/display/gimpdisplay-foreach.c | 4 +- app/display/gimpdisplayshell-callbacks.c | 2 +- app/display/gimpdisplayshell-cursor.c | 32 +- app/display/gimpdisplayshell-dnd.c | 2 +- app/display/gimpdisplayshell-draw.c | 16 +- app/display/gimpdisplayshell-layer-select.c | 38 +- app/display/gimpdisplayshell-render.c | 380 +++++------ app/display/gimpdisplayshell-scroll.c | 4 +- app/display/gimpdisplayshell-selection.c | 104 +-- app/display/gimpdisplayshell-title.c | 182 ++--- app/errors.c | 58 +- app/file/file-open.c | 10 +- app/file/file-save.c | 6 +- app/file/file-utils.c | 72 +- app/file/gimprecentlist.c | 14 +- app/gui/color-history.c | 30 +- app/gui/gui.c | 22 +- app/gui/session.c | 18 +- app/gui/splash.h | 4 +- app/gui/themes.c | 20 +- app/main.c | 18 +- app/paint-funcs/scale-funcs.c | 112 ++-- app/paint/gimpairbrush.c | 40 +- app/paint/gimpbrushcore.c | 72 +- app/paint/gimpbrushcore.h | 2 +- app/paint/gimpconvolve.c | 26 +- app/paint/gimpdodgeburn.c | 22 +- app/paint/gimperaser.c | 12 +- app/paint/gimpink-blob.c | 466 ++++++------- app/paint/gimpink.c | 104 +-- app/paint/gimppaintcore-stroke.c | 8 +- app/paint/gimppaintcore.c | 18 +- app/paint/gimppaintcore.h | 6 +- app/paint/gimppaintoptions.c | 2 +- app/paint/gimpsmudge.c | 14 +- app/pdb/gimppluginprocedure.c | 134 ++-- app/pdb/gimppluginprocedure.h | 2 +- app/plug-in/gimpplugin-message.c | 176 ++--- app/plug-in/gimpplugin.c | 184 +++--- app/plug-in/gimpplugindebug.c | 2 +- app/plug-in/gimppluginmanager-call.c | 22 +- app/plug-in/gimppluginmanager-file.c | 4 +- app/plug-in/gimppluginmanager-run.c | 22 +- app/plug-in/gimppluginmanager.c | 74 +-- app/plug-in/gimppluginprocedure.c | 134 ++-- app/plug-in/gimppluginprocedure.h | 2 +- app/plug-in/gimppluginprocframe.c | 2 +- app/plug-in/gimppluginshm.c | 6 +- app/plug-in/plug-in-debug.c | 2 +- app/plug-in/plug-in-file.c | 4 +- app/plug-in/plug-in-message.c | 176 ++--- app/plug-in/plug-in-params.c | 288 ++++---- app/plug-in/plug-in-proc-frame.c | 2 +- app/plug-in/plug-in-rc.c | 108 +-- app/plug-in/plug-in-run.c | 22 +- app/plug-in/plug-in-shm.c | 6 +- app/plug-in/plug-in.c | 184 +++--- app/plug-in/plug-ins.c | 74 +-- app/text/gimptext-bitmap.c | 90 +-- app/text/gimptext-bitmap.h | 12 +- app/text/gimptext-compat.c | 26 +- app/text/gimptext-compat.h | 14 +- app/text/gimptext-parasite.c | 14 +- app/text/gimptext-private.h | 12 +- app/text/gimptext-vectors.c | 44 +- app/text/gimptext-vectors.h | 2 +- app/text/gimptext.c | 54 +- app/text/gimptextlayer.c | 14 +- app/text/gimptextlayout-render.c | 82 +-- app/text/gimptextlayout-render.h | 4 +- app/tools/gimp-tools.c | 20 +- app/tools/gimpairbrushtool.c | 2 +- app/tools/gimpaligntool.c | 26 +- app/tools/gimpbrightnesscontrasttool.c | 4 +- app/tools/gimpbrushtool.c | 26 +- app/tools/gimpcolorbalancetool.c | 10 +- app/tools/gimpcolortool.c | 12 +- app/tools/gimpconvolvetool.c | 8 +- app/tools/gimpdodgeburntool.c | 2 +- app/tools/gimpdrawtool.c | 62 +- app/tools/gimphuesaturationtool.c | 14 +- app/tools/gimpiscissorstool.c | 692 ++++++++++---------- app/tools/gimpmagnifytool.c | 40 +- app/tools/gimpmeasuretool.c | 232 +++---- app/tools/gimpmovetool.c | 88 +-- app/tools/gimpmovetool.h | 4 +- app/tools/gimppainttool.c | 26 +- app/tools/gimpposterizetool.c | 4 +- app/tools/gimprotatetool.c | 2 +- app/tools/gimpsheartool.c | 4 +- app/tools/gimptexttool.c | 20 +- app/tools/gimpthresholdtool.c | 2 +- app/tools/gimptool.h | 2 +- app/tools/gimptransformtool-undo.c | 2 +- app/tools/tool_manager.c | 60 +- app/tools/tools-types.h | 2 +- app/widgets/gimpactiongroup.c | 14 +- app/widgets/gimpactionview.c | 10 +- app/widgets/gimpblobeditor.c | 16 +- app/widgets/gimpbrushfactoryview.h | 10 +- app/widgets/gimpbrushselect.c | 16 +- app/widgets/gimpbufferview.h | 8 +- app/widgets/gimpcellrendereraccel.c | 2 +- app/widgets/gimpcellrendererdashes.c | 26 +- app/widgets/gimpcellrendererviewable.c | 16 +- app/widgets/gimpchanneltreeview.c | 8 +- app/widgets/gimpcolordialog.c | 16 +- app/widgets/gimpcolordisplayeditor.c | 8 +- app/widgets/gimpcoloreditor.c | 22 +- app/widgets/gimpcolorpanel.c | 10 +- app/widgets/gimpcontainercombobox.h | 2 +- app/widgets/gimpcontainereditor.h | 6 +- app/widgets/gimpcontainertreeview.h | 4 +- app/widgets/gimpcontrollerlist.c | 4 +- app/widgets/gimpcursorview.c | 4 +- app/widgets/gimpdasheditor.c | 4 +- app/widgets/gimpdataeditor.c | 8 +- app/widgets/gimpdatafactoryview.h | 18 +- app/widgets/gimpdeviceinfo.h | 4 +- app/widgets/gimpdialogfactory.h | 34 +- app/widgets/gimpdock.c | 44 +- app/widgets/gimpdockbook.c | 10 +- app/widgets/gimpdocked.c | 4 +- app/widgets/gimpdockseparator.c | 38 +- app/widgets/gimpdocumentview.c | 8 +- app/widgets/gimpdrawabletreeview.c | 8 +- app/widgets/gimpeditor.c | 12 +- app/widgets/gimpenumaction.c | 2 +- app/widgets/gimperrorconsole.c | 14 +- app/widgets/gimpfgbgeditor.c | 18 +- app/widgets/gimpfontview.c | 2 +- app/widgets/gimpgrideditor.c | 12 +- app/widgets/gimphelp.c | 14 +- app/widgets/gimphistogrameditor.c | 2 +- app/widgets/gimphistogramview.c | 10 +- app/widgets/gimphistogramview.h | 4 +- app/widgets/gimpimagedock.c | 8 +- app/widgets/gimpimageview.c | 12 +- app/widgets/gimpitemtreeview.c | 74 +-- app/widgets/gimpmenudock.c | 52 +- app/widgets/gimppaletteeditor.c | 50 +- app/widgets/gimppatternfactoryview.h | 8 +- app/widgets/gimppdbdialog.c | 2 +- app/widgets/gimppluginaction.c | 2 +- app/widgets/gimppropwidgets.c | 4 +- app/widgets/gimprender.c | 8 +- app/widgets/gimpsamplepointeditor.c | 4 +- app/widgets/gimpselectiondata.c | 38 +- app/widgets/gimpsessioninfo.c | 16 +- app/widgets/gimpstringaction.c | 2 +- app/widgets/gimptemplateeditor.c | 22 +- app/widgets/gimptemplateview.c | 16 +- app/widgets/gimptexteditor.c | 32 +- app/widgets/gimpthumbbox.c | 8 +- app/widgets/gimptoolbox-color-area.c | 6 +- app/widgets/gimptoolbox-dnd.c | 26 +- app/widgets/gimptoolbox.c | 50 +- app/widgets/gimpuimanager.c | 36 +- app/widgets/gimpundoeditor.c | 8 +- app/widgets/gimpvectorstreeview.c | 14 +- app/widgets/gimpwidgets-utils.c | 16 +- app/widgets/gtkhwrapbox.c | 432 ++++++------ app/widgets/gtkhwrapbox.h | 8 +- app/widgets/gtkvwrapbox.c | 432 ++++++------ app/widgets/gtkvwrapbox.h | 8 +- app/widgets/gtkwrapbox.c | 524 +++++++-------- app/widgets/gtkwrapbox.h | 98 +-- app/xcf/xcf-load.c | 4 +- app/xcf/xcf-load.h | 2 +- app/xcf/xcf-read.c | 16 +- app/xcf/xcf-read.h | 16 +- app/xcf/xcf-save.c | 640 +++++++++--------- app/xcf/xcf-save.h | 4 +- app/xcf/xcf-seek.c | 4 +- app/xcf/xcf-seek.h | 4 +- app/xcf/xcf-write.c | 24 +- app/xcf/xcf-write.h | 24 +- app/xcf/xcf.c | 56 +- 360 files changed, 8110 insertions(+), 8131 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8e92bda5df..d0e7e623c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-04-12 Sven Neumann + + * app/*.[ch] + * app/*/*.[ch]: converted tabs to spaces. + 2006-04-12 Sven Neumann * libgimp*/gimp*.[ch]: converted tabs to spaces. @@ -19,8 +24,7 @@ 2006-04-11 Carol Spears - * data/images/gimp-splash.png: new splash, nicknamed "Where's - bolsh?". + * data/images/gimp-splash.png: new splash, nicknamed "Where's bolsh?". 2006-04-11 Manish Singh @@ -19865,7 +19869,7 @@ as described on dev mailing list. * plug-ins/common/decompose.c: add "decompose-data" parasite - when decoposing, to support Recompose. Also add missing + when decomposing, to support Recompose. Also add missing alpha channels to newly produced layers 2004-12-28 Sven Neumann @@ -19892,7 +19896,7 @@ * app/paint/gimpbrushcore.c (gimp_brush_core_subsample_mask): don't set array outside its bounds. Should fix bug #161323. - Credit to Robert Ögren for figuring out what was wrong. + Credit to Robert Ögren for figuring out what was wrong. 2004-12-27 Sven Neumann diff --git a/app/actions/buffers-commands.c b/app/actions/buffers-commands.c index 87f965d320..4ac86424a9 100644 --- a/app/actions/buffers-commands.c +++ b/app/actions/buffers-commands.c @@ -143,7 +143,7 @@ buffers_paste (GimpBufferView *view, gint height = -1; if (display) - { + { GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (display->shell); gimp_display_shell_untransform_viewport (shell, @@ -158,10 +158,10 @@ buffers_paste (GimpBufferView *view, if (image) { - gimp_edit_paste (image, gimp_image_active_drawable (image), - buffer, paste_into, x, y, width, height); + gimp_edit_paste (image, gimp_image_active_drawable (image), + buffer, paste_into, x, y, width, height); - gimp_image_flush (image); - } + gimp_image_flush (image); + } } } diff --git a/app/actions/channels-commands.c b/app/actions/channels-commands.c index 8da72d531d..b748454566 100644 --- a/app/actions/channels-commands.c +++ b/app/actions/channels-commands.c @@ -90,7 +90,7 @@ channels_edit_attributes_cmd_callback (GtkAction *action, GIMP_HELP_CHANNEL_EDIT, _("Edit Channel Color"), _("_Fill opacity:"), - FALSE); + FALSE); g_signal_connect (options->dialog, "response", G_CALLBACK (channels_edit_channel_response), @@ -123,7 +123,7 @@ channels_new_cmd_callback (GtkAction *action, GIMP_HELP_CHANNEL_NEW, _("New Channel Color"), _("_Fill opacity:"), - TRUE); + TRUE); g_signal_connect (options->dialog, "response", G_CALLBACK (channels_new_channel_response), @@ -336,17 +336,17 @@ channels_new_channel_response (GtkWidget *widget, &channel_color); if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (options->save_sel_checkbutton))) - { - GimpChannel *selection = gimp_image_get_mask (options->image); + { + GimpChannel *selection = gimp_image_get_mask (options->image); - new_channel = + new_channel = GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (selection), GIMP_TYPE_CHANNEL, FALSE)); - gimp_object_set_name (GIMP_OBJECT (new_channel), channel_name); + gimp_object_set_name (GIMP_OBJECT (new_channel), channel_name); gimp_channel_set_color (new_channel, &channel_color, FALSE); - } + } else { new_channel = gimp_channel_new (options->image, diff --git a/app/actions/data-commands.c b/app/actions/data-commands.c index 62720134f9..ef0751726e 100644 --- a/app/actions/data-commands.c +++ b/app/actions/data-commands.c @@ -79,7 +79,7 @@ data_open_as_image_cmd_callback (GtkAction *action, data = (GimpData *) gimp_context_get_by_type (context, - view->factory->container->children_type); + view->factory->container->children_type); if (data && data->filename) { @@ -128,13 +128,13 @@ data_new_cmd_callback (GtkAction *action, data = gimp_data_factory_data_new (view->factory, _("Untitled")); if (data) - { - gimp_context_set_by_type (context, - view->factory->container->children_type, - GIMP_OBJECT (data)); + { + gimp_context_set_by_type (context, + view->factory->container->children_type, + GIMP_OBJECT (data)); - gtk_button_clicked (GTK_BUTTON (view->edit_button)); - } + gtk_button_clicked (GTK_BUTTON (view->edit_button)); + } } } @@ -150,23 +150,23 @@ data_duplicate_cmd_callback (GtkAction *action, data = (GimpData *) gimp_context_get_by_type (context, - view->factory->container->children_type); + view->factory->container->children_type); if (data && gimp_container_have (view->factory->container, - GIMP_OBJECT (data))) + GIMP_OBJECT (data))) { GimpData *new_data; new_data = gimp_data_factory_data_duplicate (view->factory, data); if (new_data) - { - gimp_context_set_by_type (context, - view->factory->container->children_type, - GIMP_OBJECT (new_data)); + { + gimp_context_set_by_type (context, + view->factory->container->children_type, + GIMP_OBJECT (new_data)); - gtk_button_clicked (GTK_BUTTON (view->edit_button)); - } + gtk_button_clicked (GTK_BUTTON (view->edit_button)); + } } } @@ -208,7 +208,7 @@ data_delete_cmd_callback (GtkAction *action, data = (GimpData *) gimp_context_get_by_type (context, - view->factory->container->children_type); + view->factory->container->children_type); if (data && data->deletable && gimp_container_have (view->factory->container, GIMP_OBJECT (data))) @@ -277,7 +277,7 @@ data_edit_cmd_callback (GtkAction *action, data = (GimpData *) gimp_context_get_by_type (context, - view->factory->container->children_type); + view->factory->container->children_type); if (data && gimp_container_have (view->factory->container, GIMP_OBJECT (data))) diff --git a/app/actions/debug-commands.c b/app/actions/debug-commands.c index 5c50f3b667..6111553b71 100644 --- a/app/actions/debug-commands.c +++ b/app/actions/debug-commands.c @@ -150,26 +150,26 @@ debug_dump_menus_recurse_menu (GtkWidget *menu, menu_item = GTK_WIDGET (list->data); if (GTK_IS_LABEL (GTK_BIN (menu_item)->child)) - { - label = gtk_label_get_text (GTK_LABEL (GTK_BIN (menu_item)->child)); - full_path = g_strconcat (path, "/", label, NULL); + { + label = gtk_label_get_text (GTK_LABEL (GTK_BIN (menu_item)->child)); + full_path = g_strconcat (path, "/", label, NULL); help_page = g_object_get_data (G_OBJECT (menu_item), "gimp-help-id"); help_page = g_strdup (help_page); - format_str = g_strdup_printf ("%%%ds%%%ds %%-20s %%s\n", - depth * 2, depth * 2 - 40); - g_print (format_str, - "", label, "", help_page ? help_page : ""); - g_free (format_str); - g_free (help_page); + format_str = g_strdup_printf ("%%%ds%%%ds %%-20s %%s\n", + depth * 2, depth * 2 - 40); + g_print (format_str, + "", label, "", help_page ? help_page : ""); + g_free (format_str); + g_free (help_page); - if (GTK_MENU_ITEM (menu_item)->submenu) - debug_dump_menus_recurse_menu (GTK_MENU_ITEM (menu_item)->submenu, + if (GTK_MENU_ITEM (menu_item)->submenu) + debug_dump_menus_recurse_menu (GTK_MENU_ITEM (menu_item)->submenu, depth + 1, full_path); - g_free (full_path); - } + g_free (full_path); + } } } diff --git a/app/actions/dialogs-commands.c b/app/actions/dialogs-commands.c index c6171118a7..d38eefce8a 100644 --- a/app/actions/dialogs-commands.c +++ b/app/actions/dialogs-commands.c @@ -59,7 +59,7 @@ dialogs_show_toolbox_cmd_callback (GtkAction *action, void dialogs_create_toplevel_cmd_callback (GtkAction *action, const gchar *value, - gpointer data) + gpointer data) { GtkWidget *widget; return_if_no_widget (widget, data); @@ -73,7 +73,7 @@ dialogs_create_toplevel_cmd_callback (GtkAction *action, void dialogs_create_dockable_cmd_callback (GtkAction *action, const gchar *value, - gpointer data) + gpointer data) { GtkWidget *widget; return_if_no_widget (widget, data); diff --git a/app/actions/dockable-actions.c b/app/actions/dockable-actions.c index c17b5bb77f..91b3fc9aaf 100644 --- a/app/actions/dockable-actions.c +++ b/app/actions/dockable-actions.c @@ -189,7 +189,7 @@ dockable_actions_update (GimpActionGroup *group, page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (dockbook)); dockable = (GimpDockable *) - gtk_notebook_get_nth_page (GTK_NOTEBOOK (dockbook), page_num); + gtk_notebook_get_nth_page (GTK_NOTEBOOK (dockbook), page_num); } else if (GIMP_IS_DOCKABLE (data)) { diff --git a/app/actions/edit-commands.c b/app/actions/edit-commands.c index 90f2782990..1a147a8bda 100644 --- a/app/actions/edit-commands.c +++ b/app/actions/edit-commands.c @@ -421,8 +421,8 @@ cut_named_buffer_callback (GtkWidget *widget, static void copy_named_buffer_callback (GtkWidget *widget, - const gchar *name, - gpointer data) + const gchar *name, + gpointer data) { GimpImage *image = GIMP_IMAGE (data); GimpDrawable *drawable; diff --git a/app/actions/error-console-commands.c b/app/actions/error-console-commands.c index 8b75d48f68..cb8692a75c 100644 --- a/app/actions/error-console-commands.c +++ b/app/actions/error-console-commands.c @@ -104,14 +104,14 @@ error_console_save_cmd_callback (GtkAction *action, gtk_window_set_role (GTK_WINDOW (chooser), "gimp-save-errors"); g_signal_connect (chooser, "response", - G_CALLBACK (error_console_save_response), - console); + G_CALLBACK (error_console_save_response), + console); g_signal_connect (chooser, "delete-event", - G_CALLBACK (gtk_true), - NULL); + G_CALLBACK (gtk_true), + NULL); gimp_help_connect (GTK_WIDGET (chooser), gimp_standard_help_func, - GIMP_HELP_ERRORS_DIALOG, NULL); + GIMP_HELP_ERRORS_DIALOG, NULL); gtk_widget_show (GTK_WIDGET (chooser)); } diff --git a/app/actions/gradient-editor-commands.c b/app/actions/gradient-editor-commands.c index a475011f0e..f3dbe71d4e 100644 --- a/app/actions/gradient-editor-commands.c +++ b/app/actions/gradient-editor-commands.c @@ -126,9 +126,9 @@ gradient_editor_load_left_cmd_callback (GtkAction *action, { case GRADIENT_EDITOR_COLOR_NEIGHBOR_ENDPOINT: if (editor->control_sel_l->prev != NULL) - seg = editor->control_sel_l->prev; + seg = editor->control_sel_l->prev; else - seg = gimp_gradient_segment_get_last (editor->control_sel_l); + seg = gimp_gradient_segment_get_last (editor->control_sel_l); color = seg->right_color; break; @@ -230,9 +230,9 @@ gradient_editor_load_right_cmd_callback (GtkAction *action, { case GRADIENT_EDITOR_COLOR_NEIGHBOR_ENDPOINT: if (editor->control_sel_r->next != NULL) - seg = editor->control_sel_r->next; + seg = editor->control_sel_r->next; else - seg = gimp_gradient_segment_get_first (editor->control_sel_r); + seg = gimp_gradient_segment_get_first (editor->control_sel_r); color = seg->left_color; break; @@ -413,8 +413,8 @@ gradient_editor_replicate_cmd_callback (GtkAction *action, gtk_widget_show (scale); g_signal_connect (scale_data, "value-changed", - G_CALLBACK (gimp_int_adjustment_update), - &editor->replicate_times); + G_CALLBACK (gimp_int_adjustment_update), + &editor->replicate_times); gtk_widget_set_sensitive (GTK_WIDGET (editor), FALSE); gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager, @@ -513,8 +513,8 @@ gradient_editor_split_uniformly_cmd_callback (GtkAction *action, gtk_widget_show (scale); g_signal_connect (scale_data, "value-changed", - G_CALLBACK (gimp_int_adjustment_update), - &editor->split_parts); + G_CALLBACK (gimp_int_adjustment_update), + &editor->split_parts); gtk_widget_set_sensitive (GTK_WIDGET (editor), FALSE); gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager, @@ -725,9 +725,9 @@ gradient_editor_save_selection (GimpGradientEditor *editor) *seg = *oseg; /* Copy everything */ if (prev == NULL) - tmp = seg; /* Remember first segment */ + tmp = seg; /* Remember first segment */ else - prev->next = seg; + prev->next = seg; seg->prev = prev; seg->next = NULL; diff --git a/app/actions/gradients-commands.c b/app/actions/gradients-commands.c index 815e0e2475..9a520147f6 100644 --- a/app/actions/gradients-commands.c +++ b/app/actions/gradients-commands.c @@ -47,7 +47,7 @@ static void gradients_save_as_pov_ray_response (GtkWidget *dialog, void gradients_save_as_pov_ray_cmd_callback (GtkAction *action, - gpointer data) + gpointer data) { GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data); GimpContext *context; @@ -63,7 +63,7 @@ gradients_save_as_pov_ray_cmd_callback (GtkAction *action, return; title = g_strdup_printf (_("Save '%s' as POV-Ray"), - GIMP_OBJECT (gradient)->name); + GIMP_OBJECT (gradient)->name); chooser = GTK_FILE_CHOOSER (gtk_file_chooser_dialog_new (title, NULL, @@ -102,7 +102,7 @@ gradients_save_as_pov_ray_cmd_callback (GtkAction *action, G_CONNECT_SWAPPED); gimp_help_connect (GTK_WIDGET (chooser), gimp_standard_help_func, - GIMP_HELP_GRADIENT_SAVE_AS_POV, NULL); + GIMP_HELP_GRADIENT_SAVE_AS_POV, NULL); gtk_widget_show (GTK_WIDGET (chooser)); } diff --git a/app/actions/gradients-commands.h b/app/actions/gradients-commands.h index 95aff6cf60..a0cfacddf5 100644 --- a/app/actions/gradients-commands.h +++ b/app/actions/gradients-commands.h @@ -21,7 +21,7 @@ void gradients_save_as_pov_ray_cmd_callback (GtkAction *action, - gpointer data); + gpointer data); #endif /* __GRADIENTS_COMMANDS_H__ */ diff --git a/app/actions/help-commands.c b/app/actions/help-commands.c index 7203ef78e2..207e84a85a 100644 --- a/app/actions/help-commands.c +++ b/app/actions/help-commands.c @@ -30,14 +30,14 @@ void help_help_cmd_callback (GtkAction *action, - gpointer data) + gpointer data) { gimp_standard_help_func (NULL, NULL); } void help_context_help_cmd_callback (GtkAction *action, - gpointer data) + gpointer data) { GtkWidget *widget; return_if_no_widget (widget, data); diff --git a/app/actions/help-commands.h b/app/actions/help-commands.h index 85d18e57eb..90a0f60f99 100644 --- a/app/actions/help-commands.h +++ b/app/actions/help-commands.h @@ -21,9 +21,9 @@ void help_help_cmd_callback (GtkAction *action, - gpointer data); + gpointer data); void help_context_help_cmd_callback (GtkAction *action, - gpointer data); + gpointer data); #endif /* __HELP_COMMANDS_H__ */ diff --git a/app/actions/image-commands.c b/app/actions/image-commands.c index e408228505..6b65d3fa89 100644 --- a/app/actions/image-commands.c +++ b/app/actions/image-commands.c @@ -176,7 +176,7 @@ image_convert_cmd_callback (GtkAction *action, void image_resize_cmd_callback (GtkAction *action, - gpointer data) + gpointer data) { ImageResizeOptions *options; GimpImage *image; @@ -211,7 +211,7 @@ image_resize_cmd_callback (GtkAction *action, dialog, G_CONNECT_SWAPPED); g_object_weak_ref (G_OBJECT (dialog), - (GWeakNotify) g_free, options); + (GWeakNotify) g_free, options); gtk_widget_show (dialog); } @@ -265,7 +265,7 @@ image_print_size_cmd_callback (GtkAction *action, void image_scale_cmd_callback (GtkAction *action, - gpointer data) + gpointer data) { ImageScaleDialog *dialog; GimpDisplay *display; @@ -349,7 +349,7 @@ image_crop_cmd_callback (GtkAction *action, void image_duplicate_cmd_callback (GtkAction *action, - gpointer data) + gpointer data) { GimpDisplay *display; GimpDisplayShell *shell; diff --git a/app/actions/layers-commands.c b/app/actions/layers-commands.c index 530248ae20..a2ac42a833 100644 --- a/app/actions/layers-commands.c +++ b/app/actions/layers-commands.c @@ -182,7 +182,7 @@ layers_text_tool_cmd_callback (GtkAction *action, void layers_edit_attributes_cmd_callback (GtkAction *action, - gpointer data) + gpointer data) { LayerOptionsDialog *dialog; GimpImage *image; @@ -211,7 +211,7 @@ layers_edit_attributes_cmd_callback (GtkAction *action, void layers_new_cmd_callback (GtkAction *action, - gpointer data) + gpointer data) { LayerOptionsDialog *dialog; GimpImage *image; @@ -335,7 +335,7 @@ layers_select_cmd_callback (GtkAction *action, void layers_raise_cmd_callback (GtkAction *action, - gpointer data) + gpointer data) { GimpImage *image; GimpLayer *layer; @@ -347,7 +347,7 @@ layers_raise_cmd_callback (GtkAction *action, void layers_raise_to_top_cmd_callback (GtkAction *action, - gpointer data) + gpointer data) { GimpImage *image; GimpLayer *layer; @@ -359,7 +359,7 @@ layers_raise_to_top_cmd_callback (GtkAction *action, void layers_lower_cmd_callback (GtkAction *action, - gpointer data) + gpointer data) { GimpImage *image; GimpLayer *layer; @@ -371,7 +371,7 @@ layers_lower_cmd_callback (GtkAction *action, void layers_lower_to_bottom_cmd_callback (GtkAction *action, - gpointer data) + gpointer data) { GimpImage *image; GimpLayer *layer; @@ -383,7 +383,7 @@ layers_lower_to_bottom_cmd_callback (GtkAction *action, void layers_duplicate_cmd_callback (GtkAction *action, - gpointer data) + gpointer data) { GimpImage *image; GimpLayer *layer; @@ -401,7 +401,7 @@ layers_duplicate_cmd_callback (GtkAction *action, void layers_anchor_cmd_callback (GtkAction *action, - gpointer data) + gpointer data) { GimpImage *image; GimpLayer *layer; @@ -416,7 +416,7 @@ layers_anchor_cmd_callback (GtkAction *action, void layers_merge_down_cmd_callback (GtkAction *action, - gpointer data) + gpointer data) { GimpImage *image; GimpLayer *layer; @@ -429,7 +429,7 @@ layers_merge_down_cmd_callback (GtkAction *action, void layers_delete_cmd_callback (GtkAction *action, - gpointer data) + gpointer data) { GimpImage *image; GimpLayer *layer; @@ -457,7 +457,7 @@ layers_text_discard_cmd_callback (GtkAction *action, void layers_resize_cmd_callback (GtkAction *action, - gpointer data) + gpointer data) { GimpDisplay *display; GimpImage *image; @@ -488,7 +488,7 @@ layers_resize_cmd_callback (GtkAction *action, void layers_resize_to_image_cmd_callback (GtkAction *action, - gpointer data) + gpointer data) { GimpImage *image; GimpLayer *layer; @@ -500,7 +500,7 @@ layers_resize_to_image_cmd_callback (GtkAction *action, void layers_scale_cmd_callback (GtkAction *action, - gpointer data) + gpointer data) { GimpImage *image; GimpLayer *layer; diff --git a/app/actions/palette-editor-commands.c b/app/actions/palette-editor-commands.c index 75d8ebb7cf..622b627702 100644 --- a/app/actions/palette-editor-commands.c +++ b/app/actions/palette-editor-commands.c @@ -64,7 +64,7 @@ palette_editor_edit_color_cmd_callback (GtkAction *action, if (! editor->color_dialog) { editor->color_dialog = - gimp_color_dialog_new (GIMP_VIEWABLE (palette), + gimp_color_dialog_new (GIMP_VIEWABLE (palette), _("Edit Palette Color"), GIMP_STOCK_PALETTE, _("Edit Color Palette Entry"), @@ -161,10 +161,10 @@ palette_editor_edit_color_update (GimpColorDialog *dialog, case GIMP_COLOR_DIALOG_OK: if (editor->color) - { - editor->color->color = *color; - gimp_data_dirty (GIMP_DATA (palette)); - } + { + editor->color->color = *color; + gimp_data_dirty (GIMP_DATA (palette)); + } /* Fallthrough */ case GIMP_COLOR_DIALOG_CANCEL: diff --git a/app/actions/palettes-commands.c b/app/actions/palettes-commands.c index 05926a69c5..fbf8ba84e2 100644 --- a/app/actions/palettes-commands.c +++ b/app/actions/palettes-commands.c @@ -121,21 +121,21 @@ palettes_merge_callback (GtkWidget *widget, palette = (GimpPalette *) GIMP_VIEW (list_item->preview)->viewable; if (palette) - { - for (cols = palette->colors; cols; cols = g_list_next (cols)) - { - entry = (GimpPaletteEntry *) cols->data; + { + for (cols = palette->colors; cols; cols = g_list_next (cols)) + { + entry = (GimpPaletteEntry *) cols->data; - gimp_palette_add_entry (new_palette, - entry->name, - &entry->color); - } - } + gimp_palette_add_entry (new_palette, + entry->name, + &entry->color); + } + } sel_list = sel_list->next; } gimp_container_add (editor->view->container, - GIMP_OBJECT (new_palette)); + GIMP_OBJECT (new_palette)); #endif } diff --git a/app/actions/plug-in-actions.c b/app/actions/plug-in-actions.c index 22648fca89..c36da61971 100644 --- a/app/actions/plug-in-actions.c +++ b/app/actions/plug-in-actions.c @@ -222,7 +222,7 @@ plug_in_actions_update (GimpActionGroup *group, gimp_action_group_set_action_sensitive (group, GIMP_OBJECT (proc)->name, sensitive); - } + } } if (group->gimp->last_plug_ins && diff --git a/app/actions/plug-in-commands.c b/app/actions/plug-in-commands.c index fd853949ee..59432b032b 100644 --- a/app/actions/plug-in-commands.c +++ b/app/actions/plug-in-commands.c @@ -113,7 +113,7 @@ plug_in_run_cmd_callback (GtkAction *action, } } } - } + } break; default: diff --git a/app/actions/quick-mask-commands.c b/app/actions/quick-mask-commands.c index 9c4f38f3ee..e9b334e895 100644 --- a/app/actions/quick-mask-commands.c +++ b/app/actions/quick-mask-commands.c @@ -110,7 +110,7 @@ quick_mask_configure_cmd_callback (GtkAction *action, GIMP_HELP_QUICK_MASK_EDIT, _("Edit Quick Mask Color"), _("_Mask opacity:"), - FALSE); + FALSE); g_signal_connect (options->dialog, "response", G_CALLBACK (quick_mask_configure_response), diff --git a/app/actions/tools-commands.c b/app/actions/tools-commands.c index fe64718788..1431d06940 100644 --- a/app/actions/tools-commands.c +++ b/app/actions/tools-commands.c @@ -55,7 +55,7 @@ static void tools_activate_enum_action (const gchar *action_desc, void tools_select_cmd_callback (GtkAction *action, const gchar *value, - gpointer data) + gpointer data) { Gimp *gimp; GimpToolInfo *tool_info; diff --git a/app/app_procs.c b/app/app_procs.c index 8ab8dee6f9..e1856fb4b9 100644 --- a/app/app_procs.c +++ b/app/app_procs.c @@ -208,8 +208,8 @@ app_run (const gchar *full_prog_name, gimp_message_log_func, &gimp); g_log_set_handler (NULL, - G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL, - gimp_error_log_func, &gimp); + G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL, + gimp_error_log_func, &gimp); units_init (gimp); @@ -222,7 +222,7 @@ app_run (const gchar *full_prog_name, #ifndef GIMP_CONSOLE_COMPILATION if (no_interface) #endif - { + { const gchar *msg; msg = _("GIMP is not properly installed for the current user.\n" @@ -230,14 +230,14 @@ app_run (const gchar *full_prog_name, "To perform user installation, run the GIMP without the '--no-interface' flag."); g_printerr ("%s\n\n", msg); - } + } #ifndef GIMP_CONSOLE_COMPILATION else - { + { user_install_dialog_run (alternate_system_gimprc, alternate_gimprc, be_verbose); - } + } #endif } diff --git a/app/base/base-types.h b/app/base/base-types.h index 059c9a13f8..3fa9d71652 100644 --- a/app/base/base-types.h +++ b/app/base/base-types.h @@ -74,7 +74,7 @@ typedef struct _PixelDataHandle PixelDataHandle; /* functions */ typedef void (* TileValidateProc) (TileManager *tm, - Tile *tile); + Tile *tile); #endif /* __BASE_TYPES_H__ */ diff --git a/app/base/base.c b/app/base/base.c index 0db23bb5bf..7bd3d941b3 100644 --- a/app/base/base.c +++ b/app/base/base.c @@ -32,7 +32,7 @@ #include #ifdef G_OS_WIN32 -#include /* for _getpid() */ +#include /* for _getpid() */ #include "libgimpbase/gimpwin32-io.h" #endif @@ -173,20 +173,20 @@ base_toast_old_swap_files (const gchar *swap_path) * we'll probably get it the next time around */ - gint pid = atoi (entry + 9); + gint pid = atoi (entry + 9); /* On Windows, you can't remove open files anyhow, * so no harm trying. */ #ifndef G_OS_WIN32 - if (kill (pid, 0)) + if (kill (pid, 0)) #endif - { + { gchar *filename = g_build_filename (dirname, entry, NULL); - g_unlink (filename); + g_unlink (filename); g_free (filename); - } + } } g_dir_close (dir); diff --git a/app/base/boundary.c b/app/base/boundary.c index 12932b80fb..d2987e7e6f 100644 --- a/app/base/boundary.c +++ b/app/base/boundary.c @@ -172,8 +172,8 @@ boundary_find (PixelRegion *maskPR, **/ BoundSeg * boundary_sort (const BoundSeg *segs, - gint num_segs, - gint *num_groups) + gint num_segs, + gint *num_groups) { Boundary *boundary; gint i; @@ -207,59 +207,59 @@ boundary_sort (const BoundSeg *segs, /* find the index of a non-visited segment to start a group */ for (i = 0; i < num_segs; i++) - if (segs[i].visited == FALSE) - { - index = i; - empty = FALSE; - i = num_segs; - } + if (segs[i].visited == FALSE) + { + index = i; + empty = FALSE; + i = num_segs; + } if (! empty) - { - boundary_add_seg (boundary, + { + boundary_add_seg (boundary, segs[index].x1, segs[index].y1, segs[index].x2, segs[index].y2, segs[index].open); - ((BoundSeg *) segs)[index].visited = TRUE; + ((BoundSeg *) segs)[index].visited = TRUE; - startx = segs[index].x1; - starty = segs[index].y1; - x = segs[index].x2; - y = segs[index].y2; + startx = segs[index].x1; + starty = segs[index].y1; + x = segs[index].x2; + y = segs[index].y2; - while ((index = find_segment (segs, num_segs, x, y)) != -1) - { - /* make sure ordering is correct */ - if (x == segs[index].x1 && y == segs[index].y1) - { - boundary_add_seg (boundary, + while ((index = find_segment (segs, num_segs, x, y)) != -1) + { + /* make sure ordering is correct */ + if (x == segs[index].x1 && y == segs[index].y1) + { + boundary_add_seg (boundary, segs[index].x1, segs[index].y1, segs[index].x2, segs[index].y2, segs[index].open); - x = segs[index].x2; - y = segs[index].y2; - } - else - { - boundary_add_seg (boundary, + x = segs[index].x2; + y = segs[index].y2; + } + else + { + boundary_add_seg (boundary, segs[index].x2, segs[index].y2, segs[index].x1, segs[index].y1, segs[index].open); - x = segs[index].x1; - y = segs[index].y1; - } + x = segs[index].x1; + y = segs[index].y1; + } - ((BoundSeg *) segs)[index].visited = TRUE; - } + ((BoundSeg *) segs)[index].visited = TRUE; + } - if (x != startx || y != starty) - g_warning ("sort_boundary(): Unconnected boundary group!"); + if (x != startx || y != starty) + g_warning ("sort_boundary(): Unconnected boundary group!"); - /* Mark the end of a group */ - *num_groups = *num_groups + 1; - boundary_add_seg (boundary, -1, -1, -1, -1, 0); - } + /* Mark the end of a group */ + *num_groups = *num_groups + 1; + boundary_add_seg (boundary, -1, -1, -1, -1, 0); + } } return boundary_free (boundary, FALSE); @@ -419,15 +419,15 @@ boundary_add_seg (Boundary *boundary, static void find_empty_segs (PixelRegion *maskPR, - gint scanline, - gint empty_segs[], - gint max_empty, - gint *num_empty, - BoundaryType type, - gint x1, - gint y1, - gint x2, - gint y2, + gint scanline, + gint empty_segs[], + gint max_empty, + gint *num_empty, + BoundaryType type, + gint x1, + gint y1, + gint x2, + gint y2, guchar threshold) { guchar *data; @@ -457,11 +457,11 @@ find_empty_segs (PixelRegion *maskPR, if (type == BOUNDARY_WITHIN_BOUNDS) { if (scanline < y1 || scanline >= y2) - { - empty_segs[(*num_empty)++] = 0; - empty_segs[(*num_empty)++] = G_MAXINT; - return; - } + { + empty_segs[(*num_empty)++] = 0; + empty_segs[(*num_empty)++] = G_MAXINT; + return; + } start = x1; end = x2; @@ -471,7 +471,7 @@ find_empty_segs (PixelRegion *maskPR, start = maskPR->x; end = maskPR->x + maskPR->w; if (scanline < y1 || scanline >= y2) - x2 = -1; + x2 = -1; } tilex = -1; @@ -498,12 +498,12 @@ find_empty_segs (PixelRegion *maskPR, if (tile) tile_release (tile, FALSE); tile = tile_manager_get_tile (maskPR->tiles, - x, scanline, TRUE, FALSE); + x, scanline, TRUE, FALSE); data = - (guchar *) tile_data_pointer (tile, - x % TILE_WIDTH, - scanline % TILE_HEIGHT) + - (tile_bpp(tile) - 1); + (guchar *) tile_data_pointer (tile, + x % TILE_WIDTH, + scanline % TILE_HEIGHT) + + (tile_bpp(tile) - 1); tilex = x / TILE_WIDTH; dstep = tile_bpp (tile); @@ -514,42 +514,42 @@ find_empty_segs (PixelRegion *maskPR, } if (type == BOUNDARY_IGNORE_BOUNDS && (endx > x1 || x < x2)) - { - for (; x < endx; x++) - { - if (*data > threshold) - if (x >= x1 && x < x2) - val = -1; - else - val = 1; - else - val = -1; + { + for (; x < endx; x++) + { + if (*data > threshold) + if (x >= x1 && x < x2) + val = -1; + else + val = 1; + else + val = -1; - data += dstep; + data += dstep; - if (last != val) - empty_segs[l_num_empty++] = x; + if (last != val) + empty_segs[l_num_empty++] = x; - last = val; - } - } + last = val; + } + } else - { - for (; x < endx; x++) - { - if (*data > threshold) - val = 1; - else - val = -1; + { + for (; x < endx; x++) + { + if (*data > threshold) + val = 1; + else + val = -1; - data += dstep; + data += dstep; - if (last != val) - empty_segs[l_num_empty++] = x; + if (last != val) + empty_segs[l_num_empty++] = x; - last = val; - } - } + last = val; + } + } } *num_empty = l_num_empty; @@ -566,10 +566,10 @@ find_empty_segs (PixelRegion *maskPR, static void process_horiz_seg (Boundary *boundary, gint x1, - gint y1, - gint x2, - gint y2, - gboolean open) + gint y1, + gint x2, + gint y2, + gboolean open) { /* This procedure accounts for any vertical segments that must be drawn to close in the horizontal segments. */ @@ -596,11 +596,11 @@ process_horiz_seg (Boundary *boundary, static void make_horiz_segs (Boundary *boundary, gint start, - gint end, - gint scanline, - gint empty[], - gint num_empty, - gint top) + gint end, + gint scanline, + gint empty[], + gint num_empty, + gint top) { gint empty_index; gint e_s, e_e; /* empty segment start and end values */ @@ -611,23 +611,23 @@ make_horiz_segs (Boundary *boundary, e_e = *empty++; if (e_s <= start && e_e >= end) - process_horiz_seg (boundary, + process_horiz_seg (boundary, start, scanline, end, scanline, top); else if ((e_s > start && e_s < end) || - (e_e < end && e_e > start)) - process_horiz_seg (boundary, + (e_e < end && e_e > start)) + process_horiz_seg (boundary, MAX (e_s, start), scanline, - MIN (e_e, end), scanline, top); + MIN (e_e, end), scanline, top); } } static Boundary * generate_boundary (PixelRegion *PR, - BoundaryType type, - gint x1, - gint y1, - gint x2, - gint y2, + BoundaryType type, + gint x1, + gint y1, + gint x2, + gint y2, guchar threshold) { Boundary *boundary; @@ -658,34 +658,34 @@ generate_boundary (PixelRegion *PR, /* Find the empty segments for the previous and current scanlines */ find_empty_segs (PR, start - 1, boundary->empty_segs_l, - boundary->max_empty_segs, &num_empty_l, - type, x1, y1, x2, y2, + boundary->max_empty_segs, &num_empty_l, + type, x1, y1, x2, y2, threshold); find_empty_segs (PR, start, boundary->empty_segs_c, - boundary->max_empty_segs, &num_empty_c, - type, x1, y1, x2, y2, + boundary->max_empty_segs, &num_empty_c, + type, x1, y1, x2, y2, threshold); for (scanline = start; scanline < end; scanline++) { /* find the empty segment list for the next scanline */ find_empty_segs (PR, scanline + 1, boundary->empty_segs_n, - boundary->max_empty_segs, &num_empty_n, - type, x1, y1, x2, y2, + boundary->max_empty_segs, &num_empty_n, + type, x1, y1, x2, y2, threshold); /* process the segments on the current scanline */ for (i = 1; i < num_empty_c - 1; i += 2) - { - make_horiz_segs (boundary, + { + make_horiz_segs (boundary, boundary->empty_segs_c [i], boundary->empty_segs_c [i+1], - scanline, boundary->empty_segs_l, num_empty_l, 1); - make_horiz_segs (boundary, + scanline, boundary->empty_segs_l, num_empty_l, 1); + make_horiz_segs (boundary, boundary->empty_segs_c [i], boundary->empty_segs_c [i+1], - scanline + 1, boundary->empty_segs_n, num_empty_n, 0); - } + scanline + 1, boundary->empty_segs_n, num_empty_n, 0); + } /* get the next scanline of empty segments, swap others */ tmp_segs = boundary->empty_segs_l; @@ -703,16 +703,16 @@ generate_boundary (PixelRegion *PR, static gint find_segment (const BoundSeg *segs, - gint num_segs, - gint x, - gint y) + gint num_segs, + gint x, + gint y) { gint index; for (index = 0; index < num_segs; index++) if (((segs[index].x1 == x && segs[index].y1 == y) || (segs[index].x2 == x && segs[index].y2 == y)) && - segs[index].visited == FALSE) + segs[index].visited == FALSE) return index; return -1; diff --git a/app/base/boundary.h b/app/base/boundary.h index 9c68178423..82338899e9 100644 --- a/app/base/boundary.h +++ b/app/base/boundary.h @@ -43,16 +43,16 @@ struct _BoundSeg BoundSeg * boundary_find (PixelRegion *maskPR, - BoundaryType type, - gint x1, - gint y1, - gint x2, - gint y2, + BoundaryType type, + gint x1, + gint y1, + gint x2, + gint y2, guchar threshold, - gint *num_segs); + gint *num_segs); BoundSeg * boundary_sort (const BoundSeg *segs, - gint num_segs, - gint *num_groups); + gint num_segs, + gint *num_groups); BoundSeg * boundary_simplify (BoundSeg *sorted_segs, gint num_groups, gint *num_segs); diff --git a/app/base/brush-scale.h b/app/base/brush-scale.h index e13d000c2b..816f0e6995 100644 --- a/app/base/brush-scale.h +++ b/app/base/brush-scale.h @@ -21,11 +21,11 @@ MaskBuf * brush_scale_mask (MaskBuf *brush_mask, - gint dest_width, - gint dest_height); + gint dest_width, + gint dest_height); MaskBuf * brush_scale_pixmap (MaskBuf *pixmap, - gint dest_width, - gint dest_height); + gint dest_width, + gint dest_height); #endif /* __BRUSH_SCALE_H__ */ diff --git a/app/base/color-balance.c b/app/base/color-balance.c index 72982acfa8..585da88d1a 100644 --- a/app/base/color-balance.c +++ b/app/base/color-balance.c @@ -149,7 +149,7 @@ color_balance_create_lookup_tables (ColorBalance *cb) void color_balance (ColorBalance *cb, PixelRegion *srcPR, - PixelRegion *destPR) + PixelRegion *destPR) { const guchar *src, *s; guchar *dest, *d; @@ -170,32 +170,32 @@ color_balance (ColorBalance *cb, d = dest; while (w--) - { - r = s[RED_PIX]; - g = s[GREEN_PIX]; - b = s[BLUE_PIX]; + { + r = s[RED_PIX]; + g = s[GREEN_PIX]; + b = s[BLUE_PIX]; - r_n = cb->r_lookup[r]; - g_n = cb->g_lookup[g]; - b_n = cb->b_lookup[b]; + r_n = cb->r_lookup[r]; + g_n = cb->g_lookup[g]; + b_n = cb->b_lookup[b]; - if (cb->preserve_luminosity) - { - gimp_rgb_to_hsl_int (&r_n, &g_n, &b_n); - b_n = gimp_rgb_to_l_int (r, g, b); - gimp_hsl_to_rgb_int (&r_n, &g_n, &b_n); - } + if (cb->preserve_luminosity) + { + gimp_rgb_to_hsl_int (&r_n, &g_n, &b_n); + b_n = gimp_rgb_to_l_int (r, g, b); + gimp_hsl_to_rgb_int (&r_n, &g_n, &b_n); + } - d[RED_PIX] = r_n; - d[GREEN_PIX] = g_n; - d[BLUE_PIX] = b_n; + d[RED_PIX] = r_n; + d[GREEN_PIX] = g_n; + d[BLUE_PIX] = b_n; - if (alpha) - d[ALPHA_PIX] = s[ALPHA_PIX]; + if (alpha) + d[ALPHA_PIX] = s[ALPHA_PIX]; - s += srcPR->bytes; - d += destPR->bytes; - } + s += srcPR->bytes; + d += destPR->bytes; + } src += srcPR->rowstride; dest += destPR->rowstride; @@ -213,12 +213,12 @@ color_balance_transfer_init (void) for (i = 0; i < 256; i++) { highlights_add[i] = - shadows_sub[255 - i] = (1.075 - 1 / ((gdouble) i / 16.0 + 1)); + shadows_sub[255 - i] = (1.075 - 1 / ((gdouble) i / 16.0 + 1)); midtones_add[i] = - midtones_sub[i] = 0.667 * (1 - SQR (((gdouble) i - 127.0) / 127.0)); + midtones_sub[i] = 0.667 * (1 - SQR (((gdouble) i - 127.0) / 127.0)); shadows_add[i] = - highlights_sub[i] = 0.667 * (1 - SQR (((gdouble) i - 127.0) / 127.0)); + highlights_sub[i] = 0.667 * (1 - SQR (((gdouble) i - 127.0) / 127.0)); } } diff --git a/app/base/color-balance.h b/app/base/color-balance.h index 1e589dd495..92709a6ed4 100644 --- a/app/base/color-balance.h +++ b/app/base/color-balance.h @@ -40,7 +40,7 @@ void color_balance_range_reset (ColorBalance *cb, void color_balance_create_lookup_tables (ColorBalance *cb); void color_balance (ColorBalance *cb, PixelRegion *srcPR, - PixelRegion *destPR); + PixelRegion *destPR); #endif /* __COLOR_BALANCE_H__ */ diff --git a/app/base/colorize.c b/app/base/colorize.c index 79f5a5af70..27ddc91cd3 100644 --- a/app/base/colorize.c +++ b/app/base/colorize.c @@ -97,7 +97,7 @@ colorize (Colorize *colorize, d = dest; while (w--) - { + { lum = (colorize->lum_red_lookup[s[RED_PIX]] + colorize->lum_green_lookup[s[GREEN_PIX]] + colorize->lum_blue_lookup[s[BLUE_PIX]]); /* luminosity */ @@ -117,12 +117,12 @@ colorize (Colorize *colorize, d[GREEN_PIX] = colorize->final_green_lookup[lum]; d[BLUE_PIX] = colorize->final_blue_lookup[lum]; - if (alpha) - d[ALPHA_PIX] = s[ALPHA_PIX]; + if (alpha) + d[ALPHA_PIX] = s[ALPHA_PIX]; - s += srcPR->bytes; - d += destPR->bytes; - } + s += srcPR->bytes; + d += destPR->bytes; + } src += srcPR->rowstride; dest += destPR->rowstride; diff --git a/app/base/cpercep.c b/app/base/cpercep.c index 4b49025223..3b9e98034f 100644 --- a/app/base/cpercep.c +++ b/app/base/cpercep.c @@ -277,8 +277,8 @@ rgbxyzrgb_init(void) static void xyz_to_rgb (double *inx_outr, - double *iny_outg, - double *inz_outb) + double *iny_outg, + double *inz_outb) { const double x = *inx_outr; const double y = *iny_outg; @@ -292,8 +292,8 @@ xyz_to_rgb (double *inx_outr, static void rgb_to_xyz (double *inr_outx, - double *ing_outy, - double *inb_outz) + double *ing_outy, + double *inb_outz) { const double r = *inr_outx; const double g = *ing_outy; @@ -335,8 +335,8 @@ ffunc_inv(const double t) static void xyz_to_lab (double *inx, - double *iny, - double *inz) + double *iny, + double *inz) { double L,a,b; double ffuncY; @@ -347,24 +347,24 @@ xyz_to_lab (double *inx, if (Y > 0.0F) { if (Y > 0.008856F) - { - L = (116.0F * cbrt(Y)) - 16.0F; - } + { + L = (116.0F * cbrt(Y)) - 16.0F; + } else - { - L = (Y * 903.3F); - } + { + L = (Y * 903.3F); + } #ifdef SANITY if (L < 0.0F) - { - g_printerr (" %f \007",(float)L); - } + { + g_printerr (" %f \007",(float)L); + } if (L > 100.0F) - { - g_printerr (" %f \007",(float)L); - } + { + g_printerr (" %f \007",(float)L); + } #endif } else @@ -384,8 +384,8 @@ xyz_to_lab (double *inx, static void lab_to_xyz (double *inl, - double *ina, - double *inb) + double *ina, + double *inb) { double X,Y,Z; double P; @@ -413,19 +413,19 @@ lab_to_xyz (double *inl, if (X<-0.00000F) { if (X<-0.0001F) - g_printerr ("{badX %f {%f,%f,%f}}",X,L,a,b); + g_printerr ("{badX %f {%f,%f,%f}}",X,L,a,b); X = 0.0F; } if (Y<-0.00000F) { if (Y<-0.0001F) - g_printerr ("{badY %f}",Y); + g_printerr ("{badY %f}",Y); Y = 0.0F; } if (Z<-0.00000F) { if (Z<-0.1F) - g_printerr ("{badZ %f}",Z); + g_printerr ("{badZ %f}",Z); Z = 0.0F; } #endif @@ -454,7 +454,7 @@ void cpercep_rgb_to_space (double inr, double ing, double inb, - double *outr, + double *outr, double *outg, double *outb) { @@ -519,7 +519,7 @@ cpercep_rgb_to_space (double inr, if (inr < 0.0F || ing < 0.0F || inb < 0.0F) { g_printerr (" [BAD2 XYZ: %f,%f,%f]\007 ", - inr,ing,inb); + inr,ing,inb); } #endif /* SANITY */ @@ -535,7 +535,7 @@ void cpercep_space_to_rgb (double inr, double ing, double inb, - double *outr, + double *outr, double *outg, double *outb) { @@ -545,7 +545,7 @@ cpercep_space_to_rgb (double inr, if (inr<-0.0F || ing<-0.0F || inb<-0.0F) { g_printerr (" [BAD1 XYZ: %f,%f,%f]\007 ", - inr,ing,inb); + inr,ing,inb); } #endif @@ -588,7 +588,7 @@ cpercep_space_to_rgb (double inr, const double xscaler(const double start, const double end, - const double me, const double him) + const double me, const double him) { return start + ((end-start) * him) / (me + him); } @@ -596,9 +596,9 @@ xscaler(const double start, const double end, void mix_colours (const double L1, const double a1, const double b1, - const double L2, const double a2, const double b2, - double *rtnL, double *rtna, double *rtnb, - double mass1, double mass2) + const double L2, const double a2, const double b2, + double *rtnL, double *rtna, double *rtnb, + double mass1, double mass2) { double w1, w2; @@ -622,7 +622,7 @@ mix_colours (const double L1, const double a1, const double b1, w2 <= 0.0) { *rtna = - *rtnb = 0.0; + *rtnb = 0.0; #ifdef SANITY /* g_printerr ("\007OUCH. "); */ #endif diff --git a/app/base/cpercep.h b/app/base/cpercep.h index 82bc5c0d62..26ee9e0e95 100644 --- a/app/base/cpercep.h +++ b/app/base/cpercep.h @@ -56,7 +56,7 @@ void cpercep_space_to_rgb (double inr, /* This is in the header so that it can potentially be inlined. */ static const double cpercep_distance_space (const double L1, const double a1, const double b1, - const double L2, const double a2, const double b2) + const double L2, const double a2, const double b2) { const double Ld = L1 - L2; const double ad = a1 - a2; diff --git a/app/base/curves.c b/app/base/curves.c index c264ac9702..6117163c50 100644 --- a/app/base/curves.c +++ b/app/base/curves.c @@ -118,31 +118,31 @@ curves_calculate_curve (Curves *curves, /* cycle through the curves */ num_pts = 0; for (i = 0; i < CURVES_NUM_POINTS; i++) - if (curves->points[channel][i][0] != -1) - points[num_pts++] = i; + if (curves->points[channel][i][0] != -1) + points[num_pts++] = i; /* Initialize boundary curve points */ if (num_pts != 0) - { - for (i = 0; i < curves->points[channel][points[0]][0]; i++) - curves->curve[channel][i] = curves->points[channel][points[0]][1]; + { + for (i = 0; i < curves->points[channel][points[0]][0]; i++) + curves->curve[channel][i] = curves->points[channel][points[0]][1]; - for (i = curves->points[channel][points[num_pts - 1]][0]; + for (i = curves->points[channel][points[num_pts - 1]][0]; i < 256; i++) - curves->curve[channel][i] = + curves->curve[channel][i] = curves->points[channel][points[num_pts - 1]][1]; - } + } for (i = 0; i < num_pts - 1; i++) - { - p1 = (i == 0) ? points[i] : points[(i - 1)]; - p2 = points[i]; - p3 = points[i + 1]; - p4 = (i == (num_pts - 2)) ? points[num_pts - 1] : points[i + 2]; + { + p1 = (i == 0) ? points[i] : points[(i - 1)]; + p2 = points[i]; + p3 = points[i + 1]; + p4 = (i == (num_pts - 2)) ? points[num_pts - 1] : points[i + 2]; - curves_plot_curve (curves, channel, p1, p2, p3, p4); - } + curves_plot_curve (curves, channel, p1, p2, p3, p4); + } /* ensure that the control points are used exactly */ for (i = 0; i < num_pts; i++) @@ -159,9 +159,9 @@ curves_calculate_curve (Curves *curves, gfloat curves_lut_func (Curves *curves, - gint n_channels, - gint channel, - gfloat value) + gint n_channels, + gint channel, + gfloat value) { gfloat f; gint index; @@ -217,10 +217,10 @@ curves_lut_func (Curves *curves, static void curves_plot_curve (Curves *curves, gint channel, - gint p1, - gint p2, - gint p3, - gint p4) + gint p1, + gint p2, + gint p3, + gint p4) { CRMatrix geometry; CRMatrix tmp1, tmp2; @@ -301,7 +301,7 @@ curves_plot_curve (Curves *curves, /* if this point is different than the last one...then draw it */ if ((lastx != newx) || (lasty != newy)) - curves->curve[channel][newx] = newy; + curves->curve[channel][newx] = newy; lastx = newx; lasty = newy; @@ -310,8 +310,8 @@ curves_plot_curve (Curves *curves, static void curves_CR_compose (CRMatrix a, - CRMatrix b, - CRMatrix ab) + CRMatrix b, + CRMatrix ab) { gint i, j; diff --git a/app/base/curves.h b/app/base/curves.h index c35ab05d9d..8d89e1a64f 100644 --- a/app/base/curves.h +++ b/app/base/curves.h @@ -35,9 +35,9 @@ void curves_channel_reset (Curves *curves, void curves_calculate_curve (Curves *curves, GimpHistogramChannel channel); gfloat curves_lut_func (Curves *curves, - gint nchannels, - gint channel, - gfloat value); + gint nchannels, + gint channel, + gfloat value); #endif /* __CURVES_H__ */ diff --git a/app/base/gimphistogram.c b/app/base/gimphistogram.c index 83afd31cdd..2a651161e0 100644 --- a/app/base/gimphistogram.c +++ b/app/base/gimphistogram.c @@ -86,8 +86,8 @@ gimp_histogram_free (GimpHistogram *histogram) void gimp_histogram_calculate (GimpHistogram *histogram, - PixelRegion *region, - PixelRegion *mask) + PixelRegion *region, + PixelRegion *mask) { gint i; @@ -129,7 +129,7 @@ gimp_histogram_calculate (GimpHistogram *histogram, gdouble gimp_histogram_get_maximum (GimpHistogram *histogram, - GimpHistogramChannel channel) + GimpHistogramChannel channel) { gdouble max = 0.0; gint x; @@ -147,9 +147,9 @@ gimp_histogram_get_maximum (GimpHistogram *histogram, if (channel == GIMP_HISTOGRAM_RGB) for (x = 0; x < 256; x++) { - max = MAX (max, HISTOGRAM_VALUE (GIMP_HISTOGRAM_RED, x)); - max = MAX (max, HISTOGRAM_VALUE (GIMP_HISTOGRAM_GREEN, x)); - max = MAX (max, HISTOGRAM_VALUE (GIMP_HISTOGRAM_BLUE, x)); + max = MAX (max, HISTOGRAM_VALUE (GIMP_HISTOGRAM_RED, x)); + max = MAX (max, HISTOGRAM_VALUE (GIMP_HISTOGRAM_GREEN, x)); + max = MAX (max, HISTOGRAM_VALUE (GIMP_HISTOGRAM_BLUE, x)); } else for (x = 0; x < 256; x++) @@ -162,8 +162,8 @@ gimp_histogram_get_maximum (GimpHistogram *histogram, gdouble gimp_histogram_get_value (GimpHistogram *histogram, - GimpHistogramChannel channel, - gint bin) + GimpHistogramChannel channel, + gint bin) { g_return_val_if_fail (histogram != NULL, 0.0); @@ -193,8 +193,8 @@ gimp_histogram_get_value (GimpHistogram *histogram, gdouble gimp_histogram_get_channel (GimpHistogram *histogram, - GimpHistogramChannel channel, - gint bin) + GimpHistogramChannel channel, + gint bin) { g_return_val_if_fail (histogram != NULL, 0.0); @@ -215,8 +215,8 @@ gimp_histogram_n_channels (GimpHistogram *histogram) gdouble gimp_histogram_get_count (GimpHistogram *histogram, GimpHistogramChannel channel, - gint start, - gint end) + gint start, + gint end) { gint i; gdouble count = 0.0; @@ -230,9 +230,9 @@ gimp_histogram_get_count (GimpHistogram *histogram, if (channel == GIMP_HISTOGRAM_RGB) return (gimp_histogram_get_count (histogram, GIMP_HISTOGRAM_RED, start, end) + - gimp_histogram_get_count (histogram, + gimp_histogram_get_count (histogram, GIMP_HISTOGRAM_GREEN, start, end) + - gimp_histogram_get_count (histogram, + gimp_histogram_get_count (histogram, GIMP_HISTOGRAM_BLUE, start, end)); if (! histogram->values[0] || @@ -251,9 +251,9 @@ gimp_histogram_get_count (GimpHistogram *histogram, gdouble gimp_histogram_get_mean (GimpHistogram *histogram, - GimpHistogramChannel channel, - gint start, - gint end) + GimpHistogramChannel channel, + gint start, + gint end) { gint i; gdouble mean = 0.0; @@ -277,14 +277,14 @@ gimp_histogram_get_mean (GimpHistogram *histogram, if (channel == GIMP_HISTOGRAM_RGB) { for (i = start; i <= end; i++) - mean += (i * HISTOGRAM_VALUE (GIMP_HISTOGRAM_RED, i) + - i * HISTOGRAM_VALUE (GIMP_HISTOGRAM_GREEN, i) + - i * HISTOGRAM_VALUE (GIMP_HISTOGRAM_BLUE, i)); + mean += (i * HISTOGRAM_VALUE (GIMP_HISTOGRAM_RED, i) + + i * HISTOGRAM_VALUE (GIMP_HISTOGRAM_GREEN, i) + + i * HISTOGRAM_VALUE (GIMP_HISTOGRAM_BLUE, i)); } else { for (i = start; i <= end; i++) - mean += i * HISTOGRAM_VALUE (channel, i); + mean += i * HISTOGRAM_VALUE (channel, i); } count = gimp_histogram_get_count (histogram, channel, start, end); @@ -297,9 +297,9 @@ gimp_histogram_get_mean (GimpHistogram *histogram, gint gimp_histogram_get_median (GimpHistogram *histogram, - GimpHistogramChannel channel, - gint start, - gint end) + GimpHistogramChannel channel, + gint start, + gint end) { gint i; gdouble sum = 0.0; @@ -325,20 +325,20 @@ gimp_histogram_get_median (GimpHistogram *histogram, if (channel == GIMP_HISTOGRAM_RGB) for (i = start; i <= end; i++) { - sum += (HISTOGRAM_VALUE (GIMP_HISTOGRAM_RED, i) + - HISTOGRAM_VALUE (GIMP_HISTOGRAM_GREEN, i) + - HISTOGRAM_VALUE (GIMP_HISTOGRAM_BLUE, i)); + sum += (HISTOGRAM_VALUE (GIMP_HISTOGRAM_RED, i) + + HISTOGRAM_VALUE (GIMP_HISTOGRAM_GREEN, i) + + HISTOGRAM_VALUE (GIMP_HISTOGRAM_BLUE, i)); - if (sum * 2 > count) - return i; + if (sum * 2 > count) + return i; } else for (i = start; i <= end; i++) { - sum += HISTOGRAM_VALUE (channel, i); + sum += HISTOGRAM_VALUE (channel, i); - if (sum * 2 > count) - return i; + if (sum * 2 > count) + return i; } return -1; @@ -346,9 +346,9 @@ gimp_histogram_get_median (GimpHistogram *histogram, gdouble gimp_histogram_get_std_dev (GimpHistogram *histogram, - GimpHistogramChannel channel, - gint start, - gint end) + GimpHistogramChannel channel, + gint start, + gint end) { gint i; gdouble dev = 0.0; @@ -413,8 +413,8 @@ gimp_histogram_free_values (GimpHistogram *histogram) static void gimp_histogram_calculate_sub_region (GimpHistogram *histogram, - PixelRegion *region, - PixelRegion *mask) + PixelRegion *region, + PixelRegion *mask) { const guchar *src, *msrc; const guchar *m, *s; @@ -466,15 +466,15 @@ gimp_histogram_calculate_sub_region (GimpHistogram *histogram, m = msrc; w = region->w; - while (w--) - { - masked = m[0] / 255.0; + while (w--) + { + masked = m[0] / 255.0; - VALUE (0, s[0]) += masked; + VALUE (0, s[0]) += masked; - s += 1; - m += 1; - } + s += 1; + m += 1; + } src += region->rowstride; msrc += mask->rowstride; @@ -488,16 +488,16 @@ gimp_histogram_calculate_sub_region (GimpHistogram *histogram, m = msrc; w = region->w; - while (w--) - { - masked = m[0] / 255.0; + while (w--) + { + masked = m[0] / 255.0; - VALUE (0, s[0]) += masked; - VALUE (1, s[1]) += masked; + VALUE (0, s[0]) += masked; + VALUE (1, s[1]) += masked; - s += 2; - m += 1; - } + s += 2; + m += 1; + } src += region->rowstride; msrc += mask->rowstride; @@ -511,24 +511,24 @@ gimp_histogram_calculate_sub_region (GimpHistogram *histogram, m = msrc; w = region->w; - while (w--) - { - masked = m[0] / 255.0; + while (w--) + { + masked = m[0] / 255.0; - VALUE (1, s[0]) += masked; - VALUE (2, s[1]) += masked; - VALUE (3, s[2]) += masked; + VALUE (1, s[0]) += masked; + VALUE (2, s[1]) += masked; + VALUE (3, s[2]) += masked; - max = (s[0] > s[1]) ? s[0] : s[1]; + max = (s[0] > s[1]) ? s[0] : s[1]; - if (s[2] > max) - VALUE (0, s[2]) += masked; - else - VALUE (0, max) += masked; + if (s[2] > max) + VALUE (0, s[2]) += masked; + else + VALUE (0, max) += masked; - s += 3; - m += 1; - } + s += 3; + m += 1; + } src += region->rowstride; msrc += mask->rowstride; @@ -542,31 +542,31 @@ gimp_histogram_calculate_sub_region (GimpHistogram *histogram, m = msrc; w = region->w; - while (w--) - { - masked = m[0] / 255.0; + while (w--) + { + masked = m[0] / 255.0; - VALUE (1, s[0]) += masked; - VALUE (2, s[1]) += masked; - VALUE (3, s[2]) += masked; - VALUE (4, s[3]) += masked; + VALUE (1, s[0]) += masked; + VALUE (2, s[1]) += masked; + VALUE (3, s[2]) += masked; + VALUE (4, s[3]) += masked; - max = (s[0] > s[1]) ? s[0] : s[1]; + max = (s[0] > s[1]) ? s[0] : s[1]; - if (s[2] > max) - VALUE (0, s[2]) += masked; - else - VALUE (0, max) += masked; + if (s[2] > max) + VALUE (0, s[2]) += masked; + else + VALUE (0, max) += masked; - s += 4; - m += 1; - } + s += 4; + m += 1; + } src += region->rowstride; msrc += mask->rowstride; } break; - } + } } else /* no mask */ { @@ -580,12 +580,12 @@ gimp_histogram_calculate_sub_region (GimpHistogram *histogram, s = src; w = region->w; - while (w--) - { + while (w--) + { VALUE (0, s[0]) += 1.0; - s += 1; - } + s += 1; + } src += region->rowstride; } @@ -597,13 +597,13 @@ gimp_histogram_calculate_sub_region (GimpHistogram *histogram, s = src; w = region->w; - while (w--) - { + while (w--) + { VALUE (0, s[0]) += 1.0; VALUE (1, s[1]) += 1.0; - s += 2; - } + s += 2; + } src += region->rowstride; } @@ -615,21 +615,21 @@ gimp_histogram_calculate_sub_region (GimpHistogram *histogram, s = src; w = region->w; - while (w--) - { + while (w--) + { VALUE (1, s[0]) += 1.0; VALUE (2, s[1]) += 1.0; VALUE (3, s[2]) += 1.0; - max = (s[0] > s[1]) ? s[0] : s[1]; + max = (s[0] > s[1]) ? s[0] : s[1]; - if (s[2] > max) - VALUE (0, s[2]) += 1.0; - else - VALUE (0, max) += 1.0; + if (s[2] > max) + VALUE (0, s[2]) += 1.0; + else + VALUE (0, max) += 1.0; - s += 3; - } + s += 3; + } src += region->rowstride; } @@ -641,27 +641,27 @@ gimp_histogram_calculate_sub_region (GimpHistogram *histogram, s = src; w = region->w; - while (w--) - { + while (w--) + { VALUE (1, s[0]) += 1.0; VALUE (2, s[1]) += 1.0; VALUE (3, s[2]) += 1.0; VALUE (4, s[3]) += 1.0; - max = (s[0] > s[1]) ? s[0] : s[1]; + max = (s[0] > s[1]) ? s[0] : s[1]; - if (s[2] > max) - VALUE (0, s[2]) += 1.0; - else - VALUE (0, max) += 1.0; + if (s[2] > max) + VALUE (0, s[2]) += 1.0; + else + VALUE (0, max) += 1.0; - s += 4; - } + s += 4; + } src += region->rowstride; } break; - } + } } #ifdef ENABLE_MP diff --git a/app/base/gimplut.c b/app/base/gimplut.c index 42f78e0d56..61a9fd1e49 100644 --- a/app/base/gimplut.c +++ b/app/base/gimplut.c @@ -55,9 +55,9 @@ gimp_lut_free (GimpLut *lut) void gimp_lut_setup (GimpLut *lut, - GimpLutFunc func, - void *user_data, - gint nchannels) + GimpLutFunc func, + void *user_data, + gint nchannels) { guint i, v; gdouble val; @@ -65,7 +65,7 @@ gimp_lut_setup (GimpLut *lut, if (lut->luts) { for (i = 0; i < lut->nchannels; i++) - g_free (lut->luts[i]); + g_free (lut->luts[i]); g_free (lut->luts); } @@ -78,29 +78,29 @@ gimp_lut_setup (GimpLut *lut, 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; + { + /* 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; - lut->luts[i][v] = CLAMP (val, 0, 255); - } + lut->luts[i][v] = CLAMP (val, 0, 255); + } } } /* see comment in gimplut.h */ void gimp_lut_setup_exact (GimpLut *lut, - GimpLutFunc func, - void *user_data, - gint nchannels) + GimpLutFunc func, + void *user_data, + gint nchannels) { gimp_lut_setup (lut, func, user_data, nchannels); } void gimp_lut_process (GimpLut *lut, - PixelRegion *srcPR, - PixelRegion *destPR) + PixelRegion *srcPR, + PixelRegion *destPR) { const guchar *src; guchar *dest; @@ -132,48 +132,48 @@ gimp_lut_process (GimpLut *lut, 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); - } + { + 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; @@ -183,7 +183,7 @@ gimp_lut_process (GimpLut *lut, void gimp_lut_process_inline (GimpLut *lut, - PixelRegion *srcPR) + PixelRegion *srcPR) { guint h, width, src_r_i; guchar *src; @@ -212,44 +212,44 @@ gimp_lut_process_inline (GimpLut *lut, 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); - } + { + 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; } diff --git a/app/base/gimplut.h b/app/base/gimplut.h index 0f364c4716..5897faf6b4 100644 --- a/app/base/gimplut.h +++ b/app/base/gimplut.h @@ -36,37 +36,37 @@ struct _GimpLut * and do no correction as this will be handled by gimp_lut_setup */ typedef gfloat (*GimpLutFunc) (gpointer user_data, - gint nchannels, - gint channel, - gfloat value); + gint nchannels, + gint channel, + gfloat value); GimpLut * gimp_lut_new (void); void gimp_lut_free (GimpLut *lut); void gimp_lut_setup (GimpLut *lut, - GimpLutFunc func, - gpointer user_data, - gint nchannels); + GimpLutFunc func, + gpointer user_data, + gint nchannels); /* gimp_lut_setup_exact is currently identical to gimp_lut_setup. It * however is guaranteed to never perform any interpolation or gamma * correction on the lut */ void gimp_lut_setup_exact (GimpLut *lut, - GimpLutFunc func, - gpointer user_data, - gint nchannels); + GimpLutFunc func, + gpointer user_data, + gint nchannels); void gimp_lut_process (GimpLut *lut, - PixelRegion *srcPR, - PixelRegion *destPR); + PixelRegion *srcPR, + PixelRegion *destPR); /* gimp_lut_process_inline is like gimp_lut_process except it uses a * single PixelRegion as both the source and destination */ void gimp_lut_process_inline (GimpLut *lut, - PixelRegion *src_destPR); + PixelRegion *src_destPR); #endif /* __GIMP_LUT_H__ */ diff --git a/app/base/hue-saturation.c b/app/base/hue-saturation.c index 32b9e10620..0e0d3ad551 100644 --- a/app/base/hue-saturation.c +++ b/app/base/hue-saturation.c @@ -65,43 +65,43 @@ hue_saturation_calculate_transfers (HueSaturation *hs) for (hue = 0; hue < 6; hue++) for (i = 0; i < 256; i++) { - value = (hs->hue[0] + hs->hue[hue + 1]) * 255.0 / 360.0; - if ((i + value) < 0) - hs->hue_transfer[hue][i] = 255 + (i + value); - else if ((i + value) > 255) - hs->hue_transfer[hue][i] = i + value - 255; - else - hs->hue_transfer[hue][i] = i + value; + value = (hs->hue[0] + hs->hue[hue + 1]) * 255.0 / 360.0; + if ((i + value) < 0) + hs->hue_transfer[hue][i] = 255 + (i + value); + else if ((i + value) > 255) + hs->hue_transfer[hue][i] = i + value - 255; + else + hs->hue_transfer[hue][i] = i + value; - /* Lightness */ - value = (hs->lightness[0] + hs->lightness[hue + 1]) * 127.0 / 100.0; - value = CLAMP (value, -255, 255); + /* Lightness */ + value = (hs->lightness[0] + hs->lightness[hue + 1]) * 127.0 / 100.0; + value = CLAMP (value, -255, 255); - if (value < 0) - hs->lightness_transfer[hue][i] = (guchar) ((i * (255 + value)) / 255); - else - hs->lightness_transfer[hue][i] = (guchar) (i + ((255 - i) * value) / 255); + if (value < 0) + hs->lightness_transfer[hue][i] = (guchar) ((i * (255 + value)) / 255); + else + hs->lightness_transfer[hue][i] = (guchar) (i + ((255 - i) * value) / 255); - /* Saturation */ - value = (hs->saturation[0] + hs->saturation[hue + 1]) * 255.0 / 100.0; - value = CLAMP (value, -255, 255); + /* Saturation */ + value = (hs->saturation[0] + hs->saturation[hue + 1]) * 255.0 / 100.0; + value = CLAMP (value, -255, 255); - /* This change affects the way saturation is computed. With the - old code (different code for value < 0), increasing the - saturation affected muted colors very much, and bright colors - less. With the new code, it affects muted colors and bright - colors more or less evenly. For enhancing the color in photos, - the new behavior is exactly what you want. It's hard for me - to imagine a case in which the old behavior is better. - */ - hs->saturation_transfer[hue][i] = CLAMP ((i * (255 + value)) / 255, 0, 255); + /* This change affects the way saturation is computed. With the + old code (different code for value < 0), increasing the + saturation affected muted colors very much, and bright colors + less. With the new code, it affects muted colors and bright + colors more or less evenly. For enhancing the color in photos, + the new behavior is exactly what you want. It's hard for me + to imagine a case in which the old behavior is better. + */ + hs->saturation_transfer[hue][i] = CLAMP ((i * (255 + value)) / 255, 0, 255); } } void hue_saturation (HueSaturation *hs, PixelRegion *srcPR, - PixelRegion *destPR) + PixelRegion *destPR) { const guchar *src, *s; guchar *dest, *d; @@ -130,12 +130,12 @@ hue_saturation (HueSaturation *hs, d = dest; while (w--) - { + { r = s[RED_PIX]; g = s[GREEN_PIX]; b = s[BLUE_PIX]; - gimp_rgb_to_hsl_int (&r, &g, &b); + gimp_rgb_to_hsl_int (&r, &g, &b); hue = (r + (128 / 6)) / 6; @@ -186,18 +186,18 @@ hue_saturation (HueSaturation *hs, b = hs->lightness_transfer[hue][b]; } - gimp_hsl_to_rgb_int (&r, &g, &b); + gimp_hsl_to_rgb_int (&r, &g, &b); - d[RED_PIX] = r; - d[GREEN_PIX] = g; - d[BLUE_PIX] = b; + d[RED_PIX] = r; + d[GREEN_PIX] = g; + d[BLUE_PIX] = b; - if (alpha) - d[ALPHA_PIX] = s[ALPHA_PIX]; + if (alpha) + d[ALPHA_PIX] = s[ALPHA_PIX]; - s += srcPR->bytes; - d += destPR->bytes; - } + s += srcPR->bytes; + d += destPR->bytes; + } src += srcPR->rowstride; dest += destPR->rowstride; diff --git a/app/base/hue-saturation.h b/app/base/hue-saturation.h index f817c9b140..bacac21c91 100644 --- a/app/base/hue-saturation.h +++ b/app/base/hue-saturation.h @@ -39,7 +39,7 @@ void hue_saturation_partition_reset (HueSaturation *hs, void hue_saturation_calculate_transfers (HueSaturation *hs); void hue_saturation (HueSaturation *hs, PixelRegion *srcPR, - PixelRegion *destPR); + PixelRegion *destPR); #endif /* __HUE_SATURATION_H__ */ diff --git a/app/base/levels.c b/app/base/levels.c index db4d7d63e2..d77efcc6ce 100644 --- a/app/base/levels.c +++ b/app/base/levels.c @@ -79,7 +79,7 @@ levels_stretch (Levels *levels, for (channel = GIMP_HISTOGRAM_RED; channel <= GIMP_HISTOGRAM_BLUE; channel++) - levels_channel_stretch (levels, hist, channel); + levels_channel_stretch (levels, hist, channel); } else { @@ -115,41 +115,41 @@ levels_channel_stretch (Levels *levels, new_count = 0.0; for (i = 0; i < 255; i++) - { - new_count += gimp_histogram_get_value (hist, channel, i); - percentage = new_count / count; - next_percentage = - (new_count + gimp_histogram_get_value (hist, - channel, - i + 1)) / count; - if (fabs (percentage - 0.006) < fabs (next_percentage - 0.006)) - { - levels->low_input[channel] = i + 1; - break; - } - } + { + new_count += gimp_histogram_get_value (hist, channel, i); + percentage = new_count / count; + next_percentage = + (new_count + gimp_histogram_get_value (hist, + channel, + i + 1)) / count; + if (fabs (percentage - 0.006) < fabs (next_percentage - 0.006)) + { + levels->low_input[channel] = i + 1; + break; + } + } /* Set the high input */ new_count = 0.0; for (i = 255; i > 0; i--) - { - new_count += gimp_histogram_get_value (hist, channel, i); - percentage = new_count / count; - next_percentage = - (new_count + gimp_histogram_get_value (hist, - channel, - i - 1)) / count; - if (fabs (percentage - 0.006) < fabs (next_percentage - 0.006)) - { - levels->high_input[channel] = i - 1; - break; - } - } + { + new_count += gimp_histogram_get_value (hist, channel, i); + percentage = new_count / count; + next_percentage = + (new_count + gimp_histogram_get_value (hist, + channel, + i - 1)) / count; + if (fabs (percentage - 0.006) < fabs (next_percentage - 0.006)) + { + levels->high_input[channel] = i - 1; + break; + } + } } } static gint levels_input_from_color (GimpHistogramChannel channel, - guchar *color) + guchar *color) { switch (channel) { @@ -200,11 +200,11 @@ levels_adjust_by_colors (Levels *levels, range = levels->high_input[channel] - levels->low_input[channel]; if (range <= 0) - return; + return; input -= levels->low_input[channel]; if (input < 0) - return; + return; /* Normalize input and lightness */ inten = (gdouble) input / (gdouble) range; @@ -230,33 +230,33 @@ levels_calculate_transfers (Levels *levels) for (j = 0; j < 5; j++) { for (i = 0; i < 256; i++) - { - /* determine input intensity */ - if (levels->high_input[j] != levels->low_input[j]) + { + /* determine input intensity */ + if (levels->high_input[j] != levels->low_input[j]) { inten = ((gdouble) (i - levels->low_input[j]) / (double) (levels->high_input[j] - levels->low_input[j])); } - else + else { inten = (gdouble) (i - levels->low_input[j]); } - inten = CLAMP (inten, 0.0, 1.0); + inten = CLAMP (inten, 0.0, 1.0); - if (levels->gamma[j] != 0.0) - inten = pow (inten, (1.0 / levels->gamma[j])); + if (levels->gamma[j] != 0.0) + inten = pow (inten, (1.0 / levels->gamma[j])); - levels->input[j][i] = (guchar) (inten * 255.0 + 0.5); - } + levels->input[j][i] = (guchar) (inten * 255.0 + 0.5); + } } } gfloat levels_lut_func (Levels *levels, - gint n_channels, - gint channel, - gfloat value) + gint n_channels, + gint channel, + gfloat value) { gdouble inten; gint j; @@ -278,8 +278,8 @@ levels_lut_func (Levels *levels, { /* don't apply the overall curve to the alpha channel */ if (j == 0 && (n_channels == 2 || n_channels == 4) && - channel == n_channels - 1) - return inten; + channel == n_channels - 1) + return inten; /* determine input intensity */ if (levels->high_input[j] != levels->low_input[j]) @@ -293,21 +293,21 @@ levels_lut_func (Levels *levels, } if (levels->gamma[j] != 0.0) - { - if (inten >= 0.0) - inten = pow ( inten, (1.0 / levels->gamma[j])); - else - inten = -pow (-inten, (1.0 / levels->gamma[j])); - } + { + if (inten >= 0.0) + inten = pow ( inten, (1.0 / levels->gamma[j])); + else + inten = -pow (-inten, (1.0 / levels->gamma[j])); + } /* determine the output intensity */ if (levels->high_output[j] >= levels->low_output[j]) - inten = (gdouble) (inten * (levels->high_output[j] - + inten = (gdouble) (inten * (levels->high_output[j] - levels->low_output[j]) + - levels->low_output[j]); + levels->low_output[j]); else if (levels->high_output[j] < levels->low_output[j]) - inten = (gdouble) (levels->low_output[j] - inten * - (levels->low_output[j] - levels->high_output[j])); + inten = (gdouble) (levels->low_output[j] - inten * + (levels->low_output[j] - levels->high_output[j])); inten /= 255.0; } diff --git a/app/base/pixel-processor.c b/app/base/pixel-processor.c index c8ad219ce8..1309f5c30b 100644 --- a/app/base/pixel-processor.c +++ b/app/base/pixel-processor.c @@ -103,45 +103,45 @@ do_parallel_regions (PixelProcessor *processor) processor->PRI->portion_height); for (i = 0; i < processor->num_regions; i++) - if (processor->regions[i]) - { - memcpy (&tr[i], processor->regions[i], sizeof (PixelRegion)); - if (tr[i].tiles) - tile_lock (tr[i].curtile); - } + if (processor->regions[i]) + { + memcpy (&tr[i], processor->regions[i], sizeof (PixelRegion)); + if (tr[i].tiles) + tile_lock (tr[i].curtile); + } g_mutex_unlock (processor->mutex); switch(processor->num_regions) - { - case 1: - ((p1_func) processor->func) (processor->data, + { + case 1: + ((p1_func) processor->func) (processor->data, processor->regions[0] ? &tr[0] : NULL); - break; + break; - case 2: - ((p2_func) processor->func) (processor->data, + case 2: + ((p2_func) processor->func) (processor->data, processor->regions[0] ? &tr[0] : NULL, processor->regions[1] ? &tr[1] : NULL); - break; + break; - case 3: - ((p3_func) processor->func) (processor->data, + case 3: + ((p3_func) processor->func) (processor->data, processor->regions[0] ? &tr[0] : NULL, processor->regions[1] ? &tr[1] : NULL, processor->regions[2] ? &tr[2] : NULL); - break; + break; - case 4: - ((p4_func) processor->func) (processor->data, + case 4: + ((p4_func) processor->func) (processor->data, processor->regions[0] ? &tr[0] : NULL, processor->regions[1] ? &tr[1] : NULL, processor->regions[2] ? &tr[2] : NULL, processor->regions[3] ? &tr[3] : NULL); - break; + break; - default: - g_warning ("do_parallel_regions: Bad number of regions %d\n", + default: + g_warning ("do_parallel_regions: Bad number of regions %d\n", processor->num_regions); break; } @@ -158,7 +158,7 @@ do_parallel_regions (PixelProcessor *processor) processor->progress += pixels; if (processor->PRI) - processor->PRI = pixel_regions_process (processor->PRI); + processor->PRI = pixel_regions_process (processor->PRI); } processor->threads--; @@ -252,7 +252,7 @@ do_parallel_regions_single (PixelProcessor *processor, } } while (processor->PRI && - (processor->PRI = pixel_regions_process (processor->PRI))); + (processor->PRI = pixel_regions_process (processor->PRI))); return NULL; } @@ -292,7 +292,7 @@ pixel_regions_do_parallel (PixelProcessor *processor, { g_warning ("thread creation failed: %s", error->message); g_clear_error (&error); - processor->threads--; + processor->threads--; } } @@ -300,13 +300,13 @@ pixel_regions_do_parallel (PixelProcessor *processor, { while (processor->threads != 0) { - GTimeVal timeout; + GTimeVal timeout; gulong progress; - g_get_current_time (&timeout); - g_time_val_add (&timeout, PROGRESS_TIMEOUT * 1024); + g_get_current_time (&timeout); + g_time_val_add (&timeout, PROGRESS_TIMEOUT * 1024); - g_cond_timed_wait (pool_cond, pool_mutex, &timeout); + g_cond_timed_wait (pool_cond, pool_mutex, &timeout); g_mutex_lock (processor->mutex); progress = processor->progress; @@ -462,9 +462,9 @@ pixel_processor_exit (void) void pixel_regions_process_parallel (PixelProcessorFunc func, - gpointer data, - gint num_regions, - ...) + gpointer data, + gint num_regions, + ...) { va_list va; diff --git a/app/base/pixel-region.c b/app/base/pixel-region.c index 49070027f0..a6fcde27c7 100644 --- a/app/base/pixel-region.c +++ b/app/base/pixel-region.c @@ -46,12 +46,12 @@ static void pixel_region_configure (PixelRegionHolder *PRH, void pixel_region_init (PixelRegion *PR, - TileManager *tiles, - gint x, - gint y, - gint w, - gint h, - gboolean dirty) + TileManager *tiles, + gint x, + gint y, + gint w, + gint h, + gboolean dirty) { PR->data = NULL; PR->tiles = tiles; @@ -118,10 +118,10 @@ pixel_region_init_data (PixelRegion *PR, void pixel_region_resize (PixelRegion *PR, - gint x, - gint y, - gint w, - gint h) + gint x, + gint y, + gint w, + gint h) { /* If the data is non-null, data is contiguous--need to advance */ if (PR->data != NULL) @@ -139,10 +139,10 @@ pixel_region_resize (PixelRegion *PR, /* request that tiles within a region be fetched asynchronously */ void pixel_region_get_async (PixelRegion *PR, - gint ulx, - gint uly, - gint lrx, - gint lry) + gint ulx, + gint uly, + gint lrx, + gint lry) { gint x; gint y; @@ -155,11 +155,11 @@ pixel_region_get_async (PixelRegion *PR, void pixel_region_get_row (PixelRegion *PR, - gint x, - gint y, - gint w, - guchar *data, - gint subsample) + gint x, + gint y, + gint w, + guchar *data, + gint subsample) { Tile *tile; guchar *tile_data; @@ -184,33 +184,33 @@ pixel_region_get_row (PixelRegion *PR, else { while (x < end) - { - tile = tile_manager_get_tile (PR->tiles, x, y, TRUE, FALSE); - tile_data = tile_data_pointer (tile, x % TILE_WIDTH, y % TILE_HEIGHT); - npixels = tile_ewidth (tile) - (x % TILE_WIDTH); + { + tile = tile_manager_get_tile (PR->tiles, x, y, TRUE, FALSE); + tile_data = tile_data_pointer (tile, x % TILE_WIDTH, y % TILE_HEIGHT); + npixels = tile_ewidth (tile) - (x % TILE_WIDTH); - if ((x + npixels) > end) /* make sure we don't write past the end */ - npixels = end - x; + if ((x + npixels) > end) /* make sure we don't write past the end */ + npixels = end - x; - boundary = x + npixels; - for ( ; x < boundary; x += subsample) - { - for (b = 0; b < tilebpp; b++) - *data++ = tile_data[b]; + boundary = x + npixels; + for ( ; x < boundary; x += subsample) + { + for (b = 0; b < tilebpp; b++) + *data++ = tile_data[b]; - tile_data += inc; - } - tile_release (tile, FALSE); - } + tile_data += inc; + } + tile_release (tile, FALSE); + } } } void pixel_region_set_row (PixelRegion *PR, - gint x, - gint y, - gint w, - guchar *data) + gint x, + gint y, + gint w, + guchar *data) { gint end; gint bpp; @@ -226,11 +226,11 @@ pixel_region_set_row (PixelRegion *PR, void pixel_region_get_col (PixelRegion *PR, - gint x, - gint y, - gint h, - guchar *data, - gint subsample) + gint x, + gint y, + gint h, + guchar *data, + gint subsample) { Tile *tile; guchar *tile_data; @@ -253,17 +253,17 @@ pixel_region_get_col (PixelRegion *PR, boundary = y + (tile_eheight(tile) - (y % TILE_HEIGHT)); if (boundary > end) /* make sure we don't write past the end */ - boundary = end; + boundary = end; inc = subsample * tilebpp * tile_ewidth (tile); for ( ; y < boundary; y += subsample) - { - for (b = 0; b < tilebpp; b++) - *data++ = tile_data[b]; + { + for (b = 0; b < tilebpp; b++) + *data++ = tile_data[b]; - tile_data += inc; - } + tile_data += inc; + } tile_release (tile, FALSE); } @@ -272,10 +272,10 @@ pixel_region_get_col (PixelRegion *PR, void pixel_region_set_col (PixelRegion *PR, - gint x, - gint y, - gint h, - guchar *data) + gint x, + gint y, + gint h, + guchar *data) { gint tilebpp; gint end; @@ -300,7 +300,7 @@ pixel_region_has_alpha (PixelRegion *PR) PixelRegionIterator * pixel_regions_register (gint num_regions, - ...) + ...) { PixelRegionIterator *PRI; gboolean found; @@ -326,23 +326,23 @@ pixel_regions_register (gint num_regions, PRH->PR = PR; if (PR != NULL) - { - /* If there is a defined value for data, make sure tiles is NULL */ - if (PR->data) - PR->tiles = NULL; + { + /* If there is a defined value for data, make sure tiles is NULL */ + if (PR->data) + PR->tiles = NULL; - PRH->original_data = PR->data; - PRH->startx = PR->x; - PRH->starty = PR->y; - PRH->PR->process_count = 0; + PRH->original_data = PR->data; + PRH->startx = PR->x; + PRH->starty = PR->y; + PRH->PR->process_count = 0; - if (!found) - { - found = TRUE; - PRI->region_width = PR->w; - PRI->region_height = PR->h; - } - } + if (!found) + { + found = TRUE; + PRI->region_width = PR->w; + PRI->region_height = PR->h; + } + } /* Add the pixel region holder to the list */ PRI->pixel_regions = g_slist_prepend (PRI->pixel_regions, PRH); @@ -368,30 +368,30 @@ pixel_regions_process (PixelRegionIterator *PRI) PixelRegionHolder *PRH = list->data; if ((PRH->PR != NULL) && (PRH->PR->process_count != PRI->process_count)) - { - /* This eliminates the possibility of incrementing the - * same region twice - */ - PRH->PR->process_count++; + { + /* This eliminates the possibility of incrementing the + * same region twice + */ + PRH->PR->process_count++; - /* Unref the last referenced tile if the underlying region - is a tile manager */ - if (PRH->PR->tiles) - { - /* only set the dirty flag if PRH->dirty_tiles == TRUE */ - tile_release (PRH->PR->curtile, - PRH->PR->dirty && PRI->dirty_tiles); - PRH->PR->curtile = NULL; - } + /* Unref the last referenced tile if the underlying region + is a tile manager */ + if (PRH->PR->tiles) + { + /* only set the dirty flag if PRH->dirty_tiles == TRUE */ + tile_release (PRH->PR->curtile, + PRH->PR->dirty && PRI->dirty_tiles); + PRH->PR->curtile = NULL; + } - PRH->PR->x += PRI->portion_width; + PRH->PR->x += PRI->portion_width; - if ((PRH->PR->x - PRH->startx) >= PRI->region_width) - { - PRH->PR->x = PRH->startx; - PRH->PR->y += PRI->portion_height; - } - } + if ((PRH->PR->x - PRH->startx) >= PRI->region_width) + { + PRH->PR->x = PRH->startx; + PRH->PR->y += PRI->portion_height; + } + } } return pixel_regions_configure (PRI); @@ -411,26 +411,26 @@ pixel_regions_process_stop (PixelRegionIterator *PRI) PixelRegionHolder *PRH = list->data; if ((PRH->PR != NULL) && (PRH->PR->process_count != PRI->process_count)) - { - /* This eliminates the possibility of incrementing the - * same region twice - */ - PRH->PR->process_count++; + { + /* This eliminates the possibility of incrementing the + * same region twice + */ + PRH->PR->process_count++; - /* Unref the last referenced tile if the underlying region - is a tile manager */ - if (PRH->PR->tiles) - { - tile_release (PRH->PR->curtile, PRH->PR->dirty); - PRH->PR->curtile = NULL; - } - } + /* Unref the last referenced tile if the underlying region + is a tile manager */ + if (PRH->PR->tiles) + { + tile_release (PRH->PR->curtile, PRH->PR->dirty); + PRH->PR->curtile = NULL; + } + } } if (PRI->pixel_regions) { for (list = PRI->pixel_regions; list; list = g_slist_next (list)) - g_free (list->data); + g_free (list->data); g_slist_free (PRI->pixel_regions); g_free (PRI); @@ -458,26 +458,26 @@ get_portion_height (PixelRegionIterator *PRI) PixelRegionHolder *PRH = list->data; if (PRH->PR) - { - /* Check if we're past the point of no return */ - if ((PRH->PR->y - PRH->starty) >= PRI->region_height) - return 0; + { + /* Check if we're past the point of no return */ + if ((PRH->PR->y - PRH->starty) >= PRI->region_height) + return 0; - if (PRH->PR->tiles) - { - height = TILE_HEIGHT - (PRH->PR->y % TILE_HEIGHT); - height = CLAMP (height, - 0, - (PRI->region_height - (PRH->PR->y - PRH->starty))); - } - else + if (PRH->PR->tiles) + { + height = TILE_HEIGHT - (PRH->PR->y % TILE_HEIGHT); + height = CLAMP (height, + 0, + (PRI->region_height - (PRH->PR->y - PRH->starty))); + } + else { height = (PRI->region_height - (PRH->PR->y - PRH->starty)); } - if (height < min_height) - min_height = height; - } + if (height < min_height) + min_height = height; + } } return min_height; @@ -501,26 +501,26 @@ get_portion_width (PixelRegionIterator *PRI) PixelRegionHolder *PRH = list->data; if (PRH->PR) - { - /* Check if we're past the point of no return */ - if ((PRH->PR->x - PRH->startx) >= PRI->region_width) - return 0; + { + /* Check if we're past the point of no return */ + if ((PRH->PR->x - PRH->startx) >= PRI->region_width) + return 0; - if (PRH->PR->tiles) - { - width = TILE_WIDTH - (PRH->PR->x % TILE_WIDTH); - width = CLAMP (width, - 0, - (PRI->region_width - (PRH->PR->x - PRH->startx))); - } - else + if (PRH->PR->tiles) + { + width = TILE_WIDTH - (PRH->PR->x % TILE_WIDTH); + width = CLAMP (width, + 0, + (PRI->region_width - (PRH->PR->x - PRH->startx))); + } + else { width = (PRI->region_width - (PRH->PR->x - PRH->startx)); } - if (width < min_width) - min_width = width; - } + if (width < min_width) + min_width = width; + } } return min_width; @@ -541,13 +541,13 @@ pixel_regions_configure (PixelRegionIterator *PRI) { /* free the pixel regions list */ if (PRI->pixel_regions) - { - for (list = PRI->pixel_regions; list; list = g_slist_next (list)) - g_free (list->data); + { + for (list = PRI->pixel_regions; list; list = g_slist_next (list)) + g_free (list->data); - g_slist_free (PRI->pixel_regions); - g_free (PRI); - } + g_slist_free (PRI->pixel_regions); + g_free (PRI); + } return NULL; } @@ -559,10 +559,10 @@ pixel_regions_configure (PixelRegionIterator *PRI) PixelRegionHolder *PRH = list->data; if ((PRH->PR != NULL) && (PRH->PR->process_count != PRI->process_count)) - { - PRH->PR->process_count++; - pixel_region_configure (PRH, PRI); - } + { + PRH->PR->process_count++; + pixel_region_configure (PRH, PRI); + } } return PRI; @@ -571,7 +571,7 @@ pixel_regions_configure (PixelRegionIterator *PRI) static void pixel_region_configure (PixelRegionHolder *PRH, - PixelRegionIterator *PRI) + PixelRegionIterator *PRI) { /* Configure the rowstride and data pointer for the pixel region * based on the current offsets into the region and whether the @@ -580,18 +580,18 @@ pixel_region_configure (PixelRegionHolder *PRH, if (PRH->PR->tiles) { PRH->PR->curtile = tile_manager_get_tile (PRH->PR->tiles, - PRH->PR->x, - PRH->PR->y, - TRUE, - PRH->PR->dirty); + PRH->PR->x, + PRH->PR->y, + TRUE, + PRH->PR->dirty); PRH->PR->offx = PRH->PR->x % TILE_WIDTH; PRH->PR->offy = PRH->PR->y % TILE_HEIGHT; PRH->PR->rowstride = tile_ewidth (PRH->PR->curtile) * PRH->PR->bytes; PRH->PR->data = tile_data_pointer (PRH->PR->curtile, - PRH->PR->offx, - PRH->PR->offy); + PRH->PR->offx, + PRH->PR->offy); } else { diff --git a/app/base/pixel-region.h b/app/base/pixel-region.h index cacd49f6a4..4a3ce9edc7 100644 --- a/app/base/pixel-region.h +++ b/app/base/pixel-region.h @@ -61,12 +61,12 @@ struct _PixelRegionIterator /* PixelRegion functions */ void pixel_region_init (PixelRegion *PR, - TileManager *tiles, - gint x, - gint y, - gint w, - gint h, - gboolean dirty); + TileManager *tiles, + gint x, + gint y, + gint w, + gint h, + gboolean dirty); void pixel_region_init_temp_buf (PixelRegion *PR, TempBuf *temp_buf, gint x, @@ -82,37 +82,37 @@ void pixel_region_init_data (PixelRegion *PR, gint w, gint h); void pixel_region_resize (PixelRegion *PR, - gint x, - gint y, - gint w, - gint h); + gint x, + gint y, + gint w, + gint h); void pixel_region_get_async (PixelRegion *PR, - gint ulx, - gint uly, - gint lrx, - gint lry); + gint ulx, + gint uly, + gint lrx, + gint lry); void pixel_region_get_row (PixelRegion *PR, - gint x, - gint y, - gint w, - guchar *data, - gint subsample); + gint x, + gint y, + gint w, + guchar *data, + gint subsample); void pixel_region_set_row (PixelRegion *PR, - gint x, - gint y, - gint w, - guchar *data); + gint x, + gint y, + gint w, + guchar *data); void pixel_region_get_col (PixelRegion *PR, - gint x, - gint y, - gint h, - guchar *data, - gint subsample); + gint x, + gint y, + gint h, + guchar *data, + gint subsample); void pixel_region_set_col (PixelRegion *PR, - gint x, - gint y, - gint h, - guchar *data); + gint x, + gint y, + gint h, + guchar *data); gboolean pixel_region_has_alpha (PixelRegion *PR); PixelRegionIterator * pixel_regions_register (gint num_regions, diff --git a/app/base/pixel-surround.c b/app/base/pixel-surround.c index fefa41db8b..ee33b6a03c 100644 --- a/app/base/pixel-surround.c +++ b/app/base/pixel-surround.c @@ -30,10 +30,10 @@ void pixel_surround_init (PixelSurround *ps, - TileManager *tm, - gint w, - gint h, - const guchar bg[MAX_CHANNELS]) + TileManager *tm, + gint w, + gint h, + const guchar bg[MAX_CHANNELS]) { gint i; @@ -53,8 +53,8 @@ pixel_surround_init (PixelSurround *ps, guchar * pixel_surround_lock (PixelSurround *ps, - gint x, - gint y) + gint x, + gint y) { gint i, j; guchar *k; @@ -89,26 +89,26 @@ pixel_surround_lock (PixelSurround *ps, for (j = y; j < y + ps->h; ++j) { for (i = x; i < x + ps->w; ++i) - { - Tile *tile = tile_manager_get_tile (ps->mgr, i, j, TRUE, FALSE); + { + Tile *tile = tile_manager_get_tile (ps->mgr, i, j, TRUE, FALSE); - if (tile) - { - guchar *buff = tile_data_pointer (tile, - i % TILE_WIDTH, - j % TILE_HEIGHT); + if (tile) + { + guchar *buff = tile_data_pointer (tile, + i % TILE_WIDTH, + j % TILE_HEIGHT); - for (k = buff; k < buff+ps->bpp; ++k, ++ptr) + for (k = buff; k < buff+ps->bpp; ++k, ++ptr) *ptr = *k; - tile_release (tile, FALSE); - } - else - { - for (k = ps->bg; k < ps->bg + ps->bpp; ++k, ++ptr) + tile_release (tile, FALSE); + } + else + { + for (k = ps->bg; k < ps->bg + ps->bpp; ++k, ++ptr) *ptr = *k; - } - } + } + } } ps->rowstride = ps->w * ps->bpp; diff --git a/app/base/siox.c b/app/base/siox.c index 2f5832d7b3..88c99ca4d0 100644 --- a/app/base/siox.c +++ b/app/base/siox.c @@ -375,9 +375,9 @@ create_signature (lab *input, gint *returnlength, const gfloat *limits, const gint dims, - SioxProgressFunc progress_callback, + SioxProgressFunc progress_callback, gpointer progress_data, - gdouble progress_value) + gdouble progress_value) { gint size1 = 0; gint size2 = 0; @@ -909,12 +909,12 @@ siox_foreground_extract (SioxState *state, map += mapPR.rowstride; } - pixels += mapPR.w * mapPR.h; + pixels += mapPR.w * mapPR.h; - if (n % 16 == 0) - siox_progress_update (progress_callback, progress_data, - 0.1 * ((gdouble) pixels / (gdouble) total)); - } + if (n % 16 == 0) + siox_progress_update (progress_callback, progress_data, + 0.1 * ((gdouble) pixels / (gdouble) total)); + } #ifdef SIOX_DEBUG g_printerr ("siox.c: usermask #surebg=%d #surefg=%d\n", @@ -1062,9 +1062,9 @@ siox_foreground_extract (SioxState *state, &state->bgsiglen, limits, state->bpp == 1 ? SIOX_GRAY_DIMS : SIOX_COLOR_DIMS, - progress_callback, - progress_data, - 0.3); + progress_callback, + progress_data, + 0.3); g_free (surebg); if (state->bgsiglen < 1) @@ -1083,8 +1083,8 @@ siox_foreground_extract (SioxState *state, &state->fgsiglen, limits, state->bpp == 1 ? SIOX_GRAY_DIMS : SIOX_COLOR_DIMS, - progress_callback, - progress_data, + progress_callback, + progress_data, 0.45); g_free (surefg); } diff --git a/app/base/temp-buf.c b/app/base/temp-buf.c index 0bea61e448..810f9b96de 100644 --- a/app/base/temp-buf.c +++ b/app/base/temp-buf.c @@ -35,9 +35,9 @@ static guchar * temp_buf_allocate (guint size); static void temp_buf_to_color (TempBuf *src_buf, - TempBuf *dest_buf); + TempBuf *dest_buf); static void temp_buf_to_gray (TempBuf *src_buf, - TempBuf *dest_buf); + TempBuf *dest_buf); /* Memory management */ @@ -53,7 +53,7 @@ temp_buf_allocate (guint size) static void temp_buf_to_color (TempBuf *src_buf, - TempBuf *dest_buf) + TempBuf *dest_buf) { guchar *src; guchar *dest; @@ -98,7 +98,7 @@ temp_buf_to_color (TempBuf *src_buf, static void temp_buf_to_gray (TempBuf *src_buf, - TempBuf *dest_buf) + TempBuf *dest_buf) { guchar *src; guchar *dest; @@ -144,11 +144,11 @@ temp_buf_to_gray (TempBuf *src_buf, TempBuf * temp_buf_new (gint width, - gint height, - gint bytes, - gint x, - gint y, - guchar *col) + gint height, + gint bytes, + gint x, + gint y, + guchar *col) { glong i; guchar *data; @@ -214,9 +214,9 @@ temp_buf_new (gint width, TempBuf * temp_buf_new_check (gint width, - gint height, - GimpCheckType check_type, - GimpCheckSize check_size) + gint height, + GimpCheckType check_type, + GimpCheckSize check_size) { TempBuf *newbuf; guchar *data; @@ -255,7 +255,7 @@ temp_buf_new_check (gint width, guchar color = (check_dark & 0x1) ? check_light : check_dark; for (x = 0; x < width; x++) - { + { *data++ = color; *data++ = color; *data++ = color; @@ -273,7 +273,7 @@ temp_buf_new_check (gint width, TempBuf * temp_buf_copy (TempBuf *src, - TempBuf *dest) + TempBuf *dest) { glong length; @@ -311,11 +311,11 @@ temp_buf_copy (TempBuf *src, TempBuf * temp_buf_resize (TempBuf *buf, - gint bytes, - gint x, - gint y, - gint width, - gint height) + gint bytes, + gint x, + gint y, + gint width, + gint height) { g_return_val_if_fail (width > 0 && height > 0, NULL); @@ -346,8 +346,8 @@ temp_buf_resize (TempBuf *buf, TempBuf * temp_buf_scale (TempBuf *src, - gint new_width, - gint new_height) + gint new_width, + gint new_height) { gint loop1; gint loop2; @@ -361,9 +361,9 @@ temp_buf_scale (TempBuf *src, g_return_val_if_fail (new_width > 0 && new_height > 0, NULL); dest = temp_buf_new (new_width, - new_height, - src->bytes, - 0, 0, NULL); + new_height, + src->bytes, + 0, 0, NULL); src_data = temp_buf_data (src); dest_data = temp_buf_data (dest); @@ -374,21 +374,21 @@ temp_buf_scale (TempBuf *src, for (loop1 = 0 ; loop1 < new_height ; loop1++) { for (loop2 = 0 ; loop2 < new_width ; loop2++) - { - gint i; - guchar *src_pixel; - guchar *dest_pixel; + { + gint i; + guchar *src_pixel; + guchar *dest_pixel; - src_pixel = src_data + - (gint) (loop2 * x_ratio) * src->bytes + - (gint) (loop1 * y_ratio) * src->bytes * src->width; + src_pixel = src_data + + (gint) (loop2 * x_ratio) * src->bytes + + (gint) (loop1 * y_ratio) * src->bytes * src->width; - dest_pixel = dest_data + - (loop2 + loop1 * new_width) * src->bytes; + dest_pixel = dest_data + + (loop2 + loop1 * new_width) * src->bytes; - for (i = 0 ; i < src->bytes; i++) - *dest_pixel++ = *src_pixel++; - } + for (i = 0 ; i < src->bytes; i++) + *dest_pixel++ = *src_pixel++; + } } return dest; @@ -396,13 +396,13 @@ temp_buf_scale (TempBuf *src, TempBuf * temp_buf_copy_area (TempBuf *src, - TempBuf *dest, - gint x, - gint y, - gint width, - gint height, - gint dest_x, - gint dest_y) + TempBuf *dest, + gint x, + gint y, + gint width, + gint height, + gint dest_x, + gint dest_y) { TempBuf *new; PixelRegion srcPR = { 0, }; @@ -434,10 +434,10 @@ temp_buf_copy_area (TempBuf *src, if (! dest) { new = temp_buf_new (width + dest_x, - height + dest_y, - src->bytes, - 0, 0, - empty); + height + dest_y, + src->bytes, + 0, 0, + empty); } else { @@ -476,7 +476,7 @@ temp_buf_data_clear (TempBuf *temp_buf) g_return_val_if_fail (temp_buf != NULL, NULL); memset (temp_buf->data, 0, - temp_buf->height * temp_buf->width * temp_buf->bytes); + temp_buf->height * temp_buf->width * temp_buf->bytes); return temp_buf->data; } @@ -502,7 +502,7 @@ temp_buf_get_memsize (TempBuf *temp_buf) MaskBuf * mask_buf_new (gint width, - gint height) + gint height) { static guchar empty = 0; diff --git a/app/base/temp-buf.h b/app/base/temp-buf.h index c21c87c31f..f126a7a5dc 100644 --- a/app/base/temp-buf.h +++ b/app/base/temp-buf.h @@ -40,7 +40,7 @@ TempBuf * temp_buf_new (gint width, gint y, guchar *col); TempBuf * temp_buf_new_check (gint width, - gint height, + gint height, GimpCheckType check_type, GimpCheckSize check_size); TempBuf * temp_buf_copy (TempBuf *src, diff --git a/app/base/threshold.c b/app/base/threshold.c index 70b88ab83e..febf709d25 100644 --- a/app/base/threshold.c +++ b/app/base/threshold.c @@ -29,7 +29,7 @@ void threshold (Threshold *tr, PixelRegion *srcPR, - PixelRegion *destPR) + PixelRegion *destPR) { const guchar *src, *s; guchar *dest, *d; @@ -51,30 +51,30 @@ threshold (Threshold *tr, d = dest; while (w--) - { - if (tr->color) - { - value = MAX (s[RED_PIX], s[GREEN_PIX]); - value = MAX (value, s[BLUE_PIX]); + { + if (tr->color) + { + value = MAX (s[RED_PIX], s[GREEN_PIX]); + value = MAX (value, s[BLUE_PIX]); - value = (value >= tr->low_threshold && + value = (value >= tr->low_threshold && value <= tr->high_threshold ) ? 255 : 0; - } - else + } + else { value = (s[GRAY_PIX] >= tr->low_threshold && s[GRAY_PIX] <= tr->high_threshold) ? 255 : 0; } - for (b = 0; b < alpha; b++) - d[b] = value; + for (b = 0; b < alpha; b++) + d[b] = value; - if (has_alpha) - d[alpha] = s[alpha]; + if (has_alpha) + d[alpha] = s[alpha]; - s += srcPR->bytes; - d += destPR->bytes; - } + s += srcPR->bytes; + d += destPR->bytes; + } src += srcPR->rowstride; dest += destPR->rowstride; diff --git a/app/base/tile-cache.c b/app/base/tile-cache.c index ec0b2b533c..f9b2f12bea 100644 --- a/app/base/tile-cache.c +++ b/app/base/tile-cache.c @@ -95,8 +95,8 @@ tile_cache_init (gulong tile_cache_size) preswap_thread = g_thread_create (&tile_idle_thread, NULL, FALSE, NULL); #else idle_swapper = g_timeout_add (IDLE_SWAPPER_TIMEOUT, - tile_idle_preswap, - NULL); + tile_idle_preswap, + NULL); #endif } } @@ -134,17 +134,17 @@ tile_cache_insert (Tile *tile) if (list) { /* Tile is in the cache. Remove it from its current list and - put it at the tail of the proper list (clean or dirty) */ + put it at the tail of the proper list (clean or dirty) */ if (tile->next) - tile->next->prev = tile->prev; + tile->next->prev = tile->prev; else - list->last = tile->prev; + list->last = tile->prev; if (tile->prev) - tile->prev->next = tile->next; + tile->prev->next = tile->next; else - list->first = tile->next; + list->first = tile->next; tile->listhead = NULL; @@ -160,13 +160,13 @@ tile_cache_insert (Tile *tile) * it won't be possible to put it in the cache. */ while ((cur_cache_size + max_tile_size) > max_cache_size) - { - if (! tile_cache_zorch_next ()) - { - g_warning ("cache: unable to find room for a tile"); - goto out; - } - } + { + if (! tile_cache_zorch_next ()) + { + g_warning ("cache: unable to find room for a tile"); + goto out; + } + } cur_cache_size += tile->size; } @@ -232,14 +232,14 @@ tile_cache_flush_internal (Tile *tile) cur_cache_dirty -= tile->size; if (tile->next) - tile->next->prev = tile->prev; + tile->next->prev = tile->prev; else - list->last = tile->prev; + list->last = tile->prev; if (tile->prev) - tile->prev->next = tile->next; + tile->prev->next = tile->next; else - list->first = tile->next; + list->first = tile->next; tile->listhead = NULL; } @@ -256,7 +256,7 @@ tile_cache_set_size (gulong cache_size) while (cur_cache_size > max_cache_size) { if (!tile_cache_zorch_next ()) - break; + break; } CACHE_UNLOCK; @@ -319,67 +319,67 @@ tile_idle_thread (gpointer data) CACHE_LOCK; if (count > 5 || dirty_list.first == NULL) - { - CACHE_UNLOCK; + { + CACHE_UNLOCK; - count = 0; + count = 0; - g_mutex_lock (dirty_mutex); - g_cond_wait (dirty_signal, dirty_mutex); - g_mutex_unlock (dirty_mutex); + g_mutex_lock (dirty_mutex); + g_cond_wait (dirty_signal, dirty_mutex); + g_mutex_unlock (dirty_mutex); - CACHE_LOCK; - } + CACHE_LOCK; + } if ((tile = dirty_list.first)) - { - CACHE_UNLOCK; - TILE_MUTEX_LOCK (tile); - CACHE_LOCK; + { + CACHE_UNLOCK; + TILE_MUTEX_LOCK (tile); + CACHE_LOCK; - if (tile->dirty || tile->swap_offset == -1) - { - list = tile->listhead; + if (tile->dirty || tile->swap_offset == -1) + { + list = tile->listhead; - if (list == &dirty_list) + if (list == &dirty_list) cur_cache_dirty -= tile->size; - if (tile->next) - tile->next->prev = tile->prev; - else - list->last = tile->prev; + if (tile->next) + tile->next->prev = tile->prev; + else + list->last = tile->prev; - if (tile->prev) - tile->prev->next = tile->next; - else - list->first = tile->next; + if (tile->prev) + tile->prev->next = tile->next; + else + list->first = tile->next; - tile->next = NULL; - tile->prev = clean_list.last; - tile->listhead = &clean_list; + tile->next = NULL; + tile->prev = clean_list.last; + tile->listhead = &clean_list; - if (clean_list.last) + if (clean_list.last) clean_list.last->next = tile; - else + else clean_list.first = tile; clean_list.last = tile; - CACHE_UNLOCK; + CACHE_UNLOCK; - tile_swap_out (tile); - } - else - { - CACHE_UNLOCK; - } + tile_swap_out (tile); + } + else + { + CACHE_UNLOCK; + } - TILE_MUTEX_UNLOCK (tile); - } + TILE_MUTEX_UNLOCK (tile); + } else - { - CACHE_UNLOCK; - } + { + CACHE_UNLOCK; + } count++; } @@ -402,9 +402,9 @@ tile_idle_preswap (gpointer data) dirty_list.first = tile->next; if (tile->next) - tile->next->prev = NULL; + tile->next->prev = NULL; else - dirty_list.last = NULL; + dirty_list.last = NULL; tile->next = NULL; tile->prev = clean_list.last; diff --git a/app/base/tile-manager-crop.c b/app/base/tile-manager-crop.c index f53043efbc..871221d751 100644 --- a/app/base/tile-manager-crop.c +++ b/app/base/tile-manager-crop.c @@ -32,7 +32,7 @@ TileManager * tile_manager_crop (TileManager *tiles, - gint border) + gint border) { PixelRegion PR; TileManager *new_tiles; @@ -68,35 +68,35 @@ tile_manager_crop (TileManager *tiles, ey = PR.y + PR.h; for (y = PR.y; y < ey; y++) - { - found = FALSE; + { + found = FALSE; - for (x = PR.x; x < ex; x++, data += bytes) - if (*data) - { - if (x < x1) - x1 = x; - if (x > x2) - x2 = x; + for (x = PR.x; x < ex; x++, data += bytes) + if (*data) + { + if (x < x1) + x1 = x; + if (x > x2) + x2 = x; - found = TRUE; - } + found = TRUE; + } - if (found) - { - if (y < y1) - y1 = y; - if (y > y2) - y2 = y; - } - } + if (found) + { + if (y < y1) + y1 = y; + if (y > y2) + y2 = y; + } + } } x2 = CLAMP (x2 + 1, 0, tile_manager_width (tiles)); y2 = CLAMP (y2 + 1, 0, tile_manager_height (tiles)); empty = (x1 == tile_manager_width (tiles) && - y1 == tile_manager_height (tiles)); + y1 == tile_manager_height (tiles)); if (empty) { @@ -105,9 +105,9 @@ tile_manager_crop (TileManager *tiles, new_tiles = NULL; } else if (x1 == 0 && y1 == 0 && - x2 == tile_manager_width (tiles) && - y2 == tile_manager_height (tiles) && - border == 0) + x2 == tile_manager_width (tiles) && + y2 == tile_manager_height (tiles) && + border == 0) { /* If no cropping, return original buffer */ @@ -126,32 +126,32 @@ tile_manager_crop (TileManager *tiles, /* If there is a border, make sure to clear the new tiles first */ if (border) - { - pixel_region_init (&destPR, new_tiles, - 0, 0, new_width, border, - TRUE); - color_region (&destPR, black); + { + pixel_region_init (&destPR, new_tiles, + 0, 0, new_width, border, + TRUE); + color_region (&destPR, black); - pixel_region_init (&destPR, new_tiles, - 0, border, border, (y2 - y1), - TRUE); - color_region (&destPR, black); + pixel_region_init (&destPR, new_tiles, + 0, border, border, (y2 - y1), + TRUE); + color_region (&destPR, black); - pixel_region_init (&destPR, new_tiles, - new_width - border, border, border, (y2 - y1), - TRUE); - color_region (&destPR, black); + pixel_region_init (&destPR, new_tiles, + new_width - border, border, border, (y2 - y1), + TRUE); + color_region (&destPR, black); - pixel_region_init (&destPR, new_tiles, - 0, new_height - border, new_width, border, - TRUE); - color_region (&destPR, black); - } + pixel_region_init (&destPR, new_tiles, + 0, new_height - border, new_width, border, + TRUE); + color_region (&destPR, black); + } pixel_region_init (&srcPR, tiles, - x1, y1, (x2 - x1), (y2 - y1), FALSE); + x1, y1, (x2 - x1), (y2 - y1), FALSE); pixel_region_init (&destPR, new_tiles, - border, border, (x2 - x1), (y2 - y1), TRUE); + border, border, (x2 - x1), (y2 - y1), TRUE); copy_region (&srcPR, &destPR); diff --git a/app/base/tile-manager-crop.h b/app/base/tile-manager-crop.h index 60488194db..9f6ea244b6 100644 --- a/app/base/tile-manager-crop.h +++ b/app/base/tile-manager-crop.h @@ -21,7 +21,7 @@ TileManager * tile_manager_crop (TileManager *tiles, - gint border); + gint border); #endif /* __TILE_MANAGER_CROP_H__ */ diff --git a/app/base/tile-manager-private.h b/app/base/tile-manager-private.h index 9005fd12c8..34f1c7f0b0 100644 --- a/app/base/tile-manager-private.h +++ b/app/base/tile-manager-private.h @@ -35,8 +35,8 @@ struct _TileManager Tile **tiles; /* the tiles for this level */ TileValidateProc validate_proc; /* this proc is called when an attempt - * to get an invalid tile is made. - */ + * to get an invalid tile is made. + */ gint cached_num; /* number of cached tile */ Tile *cached_tile; /* the actual cached tile */ @@ -49,8 +49,8 @@ struct _PixelDataHandlePrivate { PixelDataHandle public; TileManager *tm; - gint x1, x2, y1, y2; - gboolean readable; + gint x1, x2, y1, y2; + gboolean readable; gboolean writeable; gboolean local_buffer; Tile *tile; diff --git a/app/base/tile-manager.c b/app/base/tile-manager.c index 18406dcffa..944e9876e2 100644 --- a/app/base/tile-manager.c +++ b/app/base/tile-manager.c @@ -34,8 +34,8 @@ static inline gint tile_manager_get_tile_num (TileManager *tm, - gint xpixel, - gint ypixel) + gint xpixel, + gint ypixel) { if ((xpixel < 0) || (xpixel >= tm->width) || (ypixel < 0) || (ypixel >= tm->height)) @@ -47,8 +47,8 @@ tile_manager_get_tile_num (TileManager *tm, TileManager * tile_manager_new (gint toplevel_width, - gint toplevel_height, - gint bpp) + gint toplevel_height, + gint bpp) { TileManager *tm; gint width; @@ -126,7 +126,7 @@ tile_manager_unref (TileManager *tm) void tile_manager_set_validate_proc (TileManager *tm, - TileValidateProc proc) + TileValidateProc proc) { g_return_if_fail (tm != NULL); @@ -136,10 +136,10 @@ tile_manager_set_validate_proc (TileManager *tm, Tile * tile_manager_get_tile (TileManager *tm, - gint xpixel, - gint ypixel, - gint wantread, - gint wantwrite) + gint xpixel, + gint ypixel, + gint wantread, + gint wantwrite) { g_return_val_if_fail (tm != NULL, NULL); @@ -150,9 +150,9 @@ tile_manager_get_tile (TileManager *tm, Tile * tile_manager_get (TileManager *tm, - gint tile_num, - gint wantread, - gint wantwrite) + gint tile_num, + gint wantread, + gint wantwrite) { Tile **tiles; Tile **tile_ptr; @@ -181,25 +181,25 @@ tile_manager_get (TileManager *tm, bottom_tile = tm->height - ((nrows - 1) * TILE_HEIGHT); for (i = 0, k = 0; i < nrows; i++) - { - for (j = 0; j < ncols; j++, k++) - { + { + for (j = 0; j < ncols; j++, k++) + { Tile *new = g_new (Tile, 1); - tile_init (new, tm->bpp); - tile_attach (new, tm, k); + tile_init (new, tm->bpp); + tile_attach (new, tm, k); - if (j == (ncols - 1)) - new->ewidth = right_tile; + if (j == (ncols - 1)) + new->ewidth = right_tile; - if (i == (nrows - 1)) - new->eheight = bottom_tile; + if (i == (nrows - 1)) + new->eheight = bottom_tile; new->size = new->ewidth * new->eheight * new->bpp; - tiles[k] = new; - } - } + tiles[k] = new; + } + } } tile_ptr = &tm->tiles[tile_num]; @@ -219,23 +219,23 @@ tile_manager_get (TileManager *tm, { TILE_MUTEX_LOCK (*tile_ptr); if (wantwrite) - { - if ((*tile_ptr)->share_count > 1) - { - /* Copy-on-write required */ - Tile *new = g_new (Tile, 1); + { + if ((*tile_ptr)->share_count > 1) + { + /* Copy-on-write required */ + Tile *new = g_new (Tile, 1); - tile_init (new, (*tile_ptr)->bpp); + tile_init (new, (*tile_ptr)->bpp); - new->ewidth = (*tile_ptr)->ewidth; - new->eheight = (*tile_ptr)->eheight; - new->valid = (*tile_ptr)->valid; + new->ewidth = (*tile_ptr)->ewidth; + new->eheight = (*tile_ptr)->eheight; + new->valid = (*tile_ptr)->valid; new->size = new->ewidth * new->eheight * new->bpp; - new->data = g_new (guchar, new->size); + new->data = g_new (guchar, new->size); - if (!new->valid) - g_warning ("Oh boy, r/w tile is invalid... we suck. " + if (!new->valid) + g_warning ("Oh boy, r/w tile is invalid... we suck. " "Please report."); if ((*tile_ptr)->rowhint) @@ -243,33 +243,33 @@ tile_manager_get (TileManager *tm, new->eheight * sizeof (TileRowHint)); - if ((*tile_ptr)->data) - { - memcpy (new->data, (*tile_ptr)->data, new->size); - } - else - { - tile_lock (*tile_ptr); - memcpy (new->data, (*tile_ptr)->data, new->size); - tile_release (*tile_ptr, FALSE); - } + if ((*tile_ptr)->data) + { + memcpy (new->data, (*tile_ptr)->data, new->size); + } + else + { + tile_lock (*tile_ptr); + memcpy (new->data, (*tile_ptr)->data, new->size); + tile_release (*tile_ptr, FALSE); + } - tile_detach (*tile_ptr, tm, tile_num); - TILE_MUTEX_LOCK (new); - tile_attach (new, tm, tile_num); - *tile_ptr = new; - } + tile_detach (*tile_ptr, tm, tile_num); + TILE_MUTEX_LOCK (new); + tile_attach (new, tm, tile_num); + *tile_ptr = new; + } - (*tile_ptr)->write_count++; - (*tile_ptr)->dirty = TRUE; - } + (*tile_ptr)->write_count++; + (*tile_ptr)->dirty = TRUE; + } #ifdef DEBUG_TILE_MANAGER else - { - if ((*tile_ptr)->write_count) - g_printerr ("STINK! r/o on r/w tile (%d)\n", + { + if ((*tile_ptr)->write_count) + g_printerr ("STINK! r/o on r/w tile (%d)\n", (*tile_ptr)->write_count); - } + } #endif TILE_MUTEX_UNLOCK (*tile_ptr); @@ -300,7 +300,7 @@ tile_manager_get_async (TileManager *tm, void tile_manager_validate (TileManager *tm, - Tile *tile) + Tile *tile) { g_return_if_fail (tm != NULL); g_return_if_fail (tile != NULL); @@ -317,7 +317,7 @@ tile_manager_validate (TileManager *tm, void tile_manager_invalidate_tiles (TileManager *tm, - Tile *toplevel_tile) + Tile *toplevel_tile) { gdouble x, y; gint row, col; @@ -344,9 +344,9 @@ tile_manager_invalidate_tiles (TileManager *tm, void tile_invalidate_tile (Tile **tile_ptr, - TileManager *tm, - gint xpixel, - gint ypixel) + TileManager *tm, + gint xpixel, + gint ypixel) { gint tile_num; @@ -362,8 +362,8 @@ tile_invalidate_tile (Tile **tile_ptr, void tile_invalidate (Tile **tile_ptr, - TileManager *tm, - gint tile_num) + TileManager *tm, + gint tile_num) { Tile *tile = *tile_ptr; @@ -416,9 +416,9 @@ leave: void tile_manager_map_tile (TileManager *tm, - gint xpixel, - gint ypixel, - Tile *srctile) + gint xpixel, + gint ypixel, + Tile *srctile) { gint tile_num; @@ -437,8 +437,8 @@ tile_manager_map_tile (TileManager *tm, void tile_manager_map (TileManager *tm, - gint tile_num, - Tile *srctile) + gint tile_num, + Tile *srctile) { Tile **tiles; Tile **tile_ptr; @@ -473,28 +473,28 @@ tile_manager_map (TileManager *tm, bottom_tile = tm->height - ((nrows - 1) * TILE_HEIGHT); for (i = 0, k = 0; i < nrows; i++) - { - for (j = 0; j < ncols; j++, k++) - { + { + for (j = 0; j < ncols; j++, k++) + { Tile *new = g_new (Tile, 1); #ifdef DEBUG_TILE_MANAGER - g_printerr (","); + g_printerr (","); #endif - tile_init (new, tm->bpp); - tile_attach (new, tm, k); + tile_init (new, tm->bpp); + tile_attach (new, tm, k); - if (j == (ncols - 1)) - new->ewidth = right_tile; + if (j == (ncols - 1)) + new->ewidth = right_tile; - if (i == (nrows - 1)) - new->eheight = bottom_tile; + if (i == (nrows - 1)) + new->eheight = bottom_tile; new->size = new->ewidth * new->eheight * new->bpp; - tiles[k] = new; - } - } + tiles[k] = new; + } + } } tile_ptr = &tm->tiles[tile_num]; @@ -512,7 +512,7 @@ tile_manager_map (TileManager *tm, (*tile_ptr)->bpp != srctile->bpp) { g_warning ("tile_manager_map: nonconformant map (%p -> %p)", - srctile, *tile_ptr); + srctile, *tile_ptr); } tile_detach (*tile_ptr, tm, tile_num); @@ -538,7 +538,7 @@ tile_manager_map (TileManager *tm, void tile_manager_set_user_data (TileManager *tm, - gpointer user_data) + gpointer user_data) { g_return_if_fail (tm != NULL); @@ -579,8 +579,8 @@ tile_manager_bpp (const TileManager *tm) void tile_manager_get_offsets (const TileManager *tm, - gint *x, - gint *y) + gint *x, + gint *y) { g_return_if_fail (tm != NULL); g_return_if_fail (x != NULL && y != NULL); @@ -591,8 +591,8 @@ tile_manager_get_offsets (const TileManager *tm, void tile_manager_set_offsets (TileManager *tm, - gint x, - gint y) + gint x, + gint y) { g_return_if_fail (tm != NULL); @@ -642,9 +642,9 @@ tile_manager_get_memsize (const TileManager *tm, void tile_manager_get_tile_coordinates (TileManager *tm, - Tile *tile, - gint *x, - gint *y) + Tile *tile, + gint *x, + gint *y) { TileLink *tl; @@ -669,8 +669,8 @@ tile_manager_get_tile_coordinates (TileManager *tm, void tile_manager_map_over_tile (TileManager *tm, - Tile *tile, - Tile *srctile) + Tile *tile, + Tile *srctile) { TileLink *tl; @@ -695,12 +695,12 @@ tile_manager_map_over_tile (TileManager *tm, PixelDataHandle * request_pixel_data (TileManager *tm, - gint x1, - gint y1, - gint x2, - gint y2, - gboolean wantread, - gboolean wantwrite) + gint x1, + gint y1, + gint x2, + gint y2, + gboolean wantread, + gboolean wantwrite) { PixelDataHandlePrivate *pdh; guint tile_num_1, tile_num_2; @@ -738,8 +738,8 @@ request_pixel_data (TileManager *tm, pdh->tile = NULL; if (wantread) - read_pixel_data (tm, x1, y1, x2, y2, - pdh->public.data, pdh->public.stride); + read_pixel_data (tm, x1, y1, x2, y2, + pdh->public.data, pdh->public.stride); } return (PixelDataHandle *) pdh; } @@ -752,8 +752,8 @@ release_pixel_data (PixelDataHandle *xpdh) if (pdh->local_buffer) { if (pdh->writeable) - write_pixel_data (pdh->tm, pdh->x1, pdh->y1, pdh->x2, pdh->y2, - pdh->public.data, pdh->public.stride); + write_pixel_data (pdh->tm, pdh->x1, pdh->y1, pdh->x2, pdh->y2, + pdh->public.data, pdh->public.stride); g_free (pdh->public.data); } else @@ -766,12 +766,12 @@ release_pixel_data (PixelDataHandle *xpdh) void read_pixel_data (TileManager *tm, - gint x1, - gint y1, - gint x2, - gint y2, - guchar *buffer, - guint stride) + gint x1, + gint y1, + gint x2, + gint y2, + guchar *buffer, + guint stride) { Tile *t; guchar *s, *d; @@ -782,39 +782,39 @@ read_pixel_data (TileManager *tm, for (y = y1; y <= y2; y += TILE_HEIGHT - (y % TILE_HEIGHT)) for (x = x1; x <= x2; x += TILE_WIDTH - (x % TILE_WIDTH)) { - t = tile_manager_get_tile (tm, x, y, TRUE, FALSE); - s = tile_data_pointer (t, x % TILE_WIDTH, y % TILE_HEIGHT); - d = buffer + stride * (y - y1) + tm->bpp * (x - x1); + t = tile_manager_get_tile (tm, x, y, TRUE, FALSE); + s = tile_data_pointer (t, x % TILE_WIDTH, y % TILE_HEIGHT); + d = buffer + stride * (y - y1) + tm->bpp * (x - x1); - rows = tile_eheight (t) - y % TILE_HEIGHT; - if (rows > (y2 - y + 1)) - rows = y2 - y + 1; + rows = tile_eheight (t) - y % TILE_HEIGHT; + if (rows > (y2 - y + 1)) + rows = y2 - y + 1; - cols = tile_ewidth (t) - x % TILE_WIDTH; - if (cols > (x2 - x + 1)) - cols = x2 - x + 1; + cols = tile_ewidth (t) - x % TILE_WIDTH; + if (cols > (x2 - x + 1)) + cols = x2 - x + 1; - srcstride = tile_ewidth (t) * tile_bpp (t); + srcstride = tile_ewidth (t) * tile_bpp (t); - while (rows --) - { - memcpy (d, s, cols * tm->bpp); - s += srcstride; - d += stride; - } + while (rows --) + { + memcpy (d, s, cols * tm->bpp); + s += srcstride; + d += stride; + } - tile_release (t, FALSE); + tile_release (t, FALSE); } } void write_pixel_data (TileManager *tm, - gint x1, - gint y1, - gint x2, - gint y2, - const guchar *buffer, - guint stride) + gint x1, + gint y1, + gint x2, + gint y2, + const guchar *buffer, + guint stride) { Tile *t; const guchar *s; @@ -826,35 +826,35 @@ write_pixel_data (TileManager *tm, for (y = y1; y <= y2; y += TILE_HEIGHT - (y % TILE_HEIGHT)) for (x = x1; x <= x2; x += TILE_WIDTH - (x % TILE_WIDTH)) { - t = tile_manager_get_tile (tm, x, y, TRUE, TRUE); - s = buffer + stride * (y - y1) + tm->bpp * (x - x1); - d = tile_data_pointer (t, x % TILE_WIDTH, y % TILE_HEIGHT); - rows = tile_eheight (t) - y % TILE_HEIGHT; - if (rows > (y2 - y + 1)) - rows = y2 - y + 1; + t = tile_manager_get_tile (tm, x, y, TRUE, TRUE); + s = buffer + stride * (y - y1) + tm->bpp * (x - x1); + d = tile_data_pointer (t, x % TILE_WIDTH, y % TILE_HEIGHT); + rows = tile_eheight (t) - y % TILE_HEIGHT; + if (rows > (y2 - y + 1)) + rows = y2 - y + 1; - cols = tile_ewidth (t) - x % TILE_WIDTH; - if (cols > (x2 - x + 1)) - cols = x2 - x + 1; + cols = tile_ewidth (t) - x % TILE_WIDTH; + if (cols > (x2 - x + 1)) + cols = x2 - x + 1; - dststride = tile_ewidth (t) * tile_bpp (t); + dststride = tile_ewidth (t) * tile_bpp (t); - while (rows --) - { - memcpy (d, s, cols * tm->bpp); - s += stride; - d += dststride; - } + while (rows --) + { + memcpy (d, s, cols * tm->bpp); + s += stride; + d += dststride; + } - tile_release (t, TRUE); + tile_release (t, TRUE); } } void read_pixel_data_1 (TileManager *tm, - gint x, - gint y, - guchar *buffer) + gint x, + gint y, + guchar *buffer) { if (x >= 0 && y >= 0 && x < tm->width && y < tm->height) { @@ -894,9 +894,9 @@ read_pixel_data_1 (TileManager *tm, void write_pixel_data_1 (TileManager *tm, - gint x, - gint y, - const guchar *buffer) + gint x, + gint y, + const guchar *buffer) { Tile *tile; guchar *dest; diff --git a/app/base/tile-manager.h b/app/base/tile-manager.h index 1e41cf10cc..d09c687206 100644 --- a/app/base/tile-manager.h +++ b/app/base/tile-manager.h @@ -23,9 +23,9 @@ struct _PixelDataHandle { guchar *data; gint width; - gint height; + gint height; gint stride; - gint bpp; + gint bpp; }; /* Creates a new tile manager with the specified @@ -39,8 +39,8 @@ struct _PixelDataHandle * than TILE_WIDTH x TILE_HEIGHT */ TileManager * tile_manager_new (gint toplevel_width, - gint toplevel_height, - gint bpp); + gint toplevel_height, + gint bpp); /* Ref/Unref a tile manager. */ @@ -54,22 +54,22 @@ void tile_manager_unref (TileManager *tm); * not initialized. */ void tile_manager_set_validate_proc (TileManager *tm, - TileValidateProc proc); + TileValidateProc proc); /* Get a specified tile from a tile manager. */ Tile * tile_manager_get_tile (TileManager *tm, - gint xpixel, - gint ypixel, - gint wantread, - gint wantwrite); + gint xpixel, + gint ypixel, + gint wantread, + gint wantwrite); /* Get a specified tile from a tile manager. */ Tile * tile_manager_get (TileManager *tm, - gint tile_num, - gint wantread, - gint wantwrite); + 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. @@ -77,39 +77,39 @@ Tile * tile_manager_get (TileManager *tm, * if it is convenient... */ void tile_manager_get_async (TileManager *tm, - gint xpixel, - gint ypixel); + gint xpixel, + gint ypixel); void tile_manager_map_tile (TileManager *tm, - gint xpixel, - gint ypixel, - Tile *srctile); + gint xpixel, + gint ypixel, + Tile *srctile); void tile_manager_map (TileManager *tm, - gint tile_num, - Tile *srctile); + gint tile_num, + Tile *srctile); /* Validate a tiles memory. */ void tile_manager_validate (TileManager *tm, - Tile *tile); + Tile *tile); void tile_invalidate (Tile **tile_ptr, - TileManager *tm, - gint tile_num); + TileManager *tm, + gint tile_num); void tile_invalidate_tile (Tile **tile_ptr, - TileManager *tm, - gint xpixel, - gint ypixel); + 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); + Tile *toplevel_tile); void tile_manager_set_user_data (TileManager *tm, - gpointer user_data); + gpointer user_data); gpointer tile_manager_get_user_data (const TileManager *tm); gint tile_manager_width (const TileManager *tm); @@ -117,31 +117,31 @@ gint tile_manager_height (const TileManager *tm); gint tile_manager_bpp (const TileManager *tm); void tile_manager_get_offsets (const TileManager *tm, - gint *x, - gint *y); + gint *x, + gint *y); void tile_manager_set_offsets (TileManager *tm, - gint x, - gint y); + gint x, + gint y); gint64 tile_manager_get_memsize (const TileManager *tm, gboolean sparse); void tile_manager_get_tile_coordinates (TileManager *tm, - Tile *tile, - gint *x, - gint *y); + Tile *tile, + gint *x, + gint *y); void tile_manager_map_over_tile (TileManager *tm, - Tile *tile, - Tile *srctile); + Tile *tile, + Tile *srctile); PixelDataHandle * request_pixel_data (TileManager *tm, - gint x1, - gint y1, - gint x2, - gint y2, - gboolean wantread, - gboolean wantwrite); + gint x1, + gint y1, + gint x2, + gint y2, + gboolean wantread, + gboolean wantwrite); void release_pixel_data (PixelDataHandle *pdh); @@ -164,14 +164,14 @@ void write_pixel_data (TileManager *tm, /* Fill buffer with the pixeldata for the pixel at coordinates x,y * if x,y is outside the area of the tilemanger, nothing is done. */ -void read_pixel_data_1 (TileManager *tm, - gint x, - gint y, +void read_pixel_data_1 (TileManager *tm, + gint x, + gint y, guchar *buffer); -void write_pixel_data_1 (TileManager *tm, - gint x, - gint y, - const guchar *buffer); +void write_pixel_data_1 (TileManager *tm, + gint x, + gint y, + const guchar *buffer); #endif /* __TILE_MANAGER_H__ */ diff --git a/app/base/tile-private.h b/app/base/tile-private.h index 2af33a2ba0..fdbe64c3a5 100644 --- a/app/base/tile-private.h +++ b/app/base/tile-private.h @@ -29,20 +29,20 @@ struct _TileLink TileLink *next; gint tile_num; /* the number of this tile within the drawable */ TileManager *tm; /* A pointer to the tile manager for this tile. - * We need this in order to call the tile managers - * validate proc whenever the tile is referenced - * yet invalid. - */ + * We need this in order to call the tile managers + * validate proc whenever the tile is referenced + * yet invalid. + */ }; struct _Tile { 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. - */ + * 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. + */ gshort write_count; /* write count: number of references that are for write access */ gshort share_count; /* share count: number of tile managers that @@ -53,10 +53,10 @@ struct _Tile 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. - */ + * 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. + */ gint size; /* size of the tile data (ewidth * eheight * bpp) */ TileRowHint *rowhint; /* An array of hints for rendering purposes */ @@ -70,7 +70,7 @@ struct _Tile * 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 + * if the tile data is in memory this will be set * to -1. */ diff --git a/app/base/tile-swap.c b/app/base/tile-swap.c index 8ebf4951ca..3cbf0c0c97 100644 --- a/app/base/tile-swap.c +++ b/app/base/tile-swap.c @@ -92,35 +92,35 @@ struct _AsyncSwapArgs static guint tile_swap_hash (gint *key); static gint tile_swap_compare (gint *a, - gint *b); + gint *b); static void tile_swap_command (Tile *tile, - gint command); + gint command); static void tile_swap_open (SwapFile *swap_file); static gint tile_swap_default (gint fd, - Tile *tile, - gint cmd, - gpointer user_data); + Tile *tile, + gint cmd, + gpointer user_data); static void tile_swap_default_in (DefSwapFile *def_swap_file, - gint fd, - Tile *tile); + gint fd, + Tile *tile); static void tile_swap_default_in_async (DefSwapFile *def_swap_file, - gint fd, - Tile *tile); + gint fd, + Tile *tile); static void tile_swap_default_out (DefSwapFile *def_swap_file, - gint fd, - Tile *tile); + gint fd, + Tile *tile); static void tile_swap_default_delete (DefSwapFile *def_swap_file, - gint fd, - Tile *tile); + gint fd, + Tile *tile); static off_t tile_swap_find_offset (DefSwapFile *def_swap_file, - gint fd, - off_t bytes); + gint fd, + off_t bytes); static void tile_swap_resize (DefSwapFile *def_swap_file, - gint fd, - off_t new_size); + gint fd, + off_t new_size); static Gap * tile_swap_gap_new (off_t start, - off_t end); + off_t end); static void tile_swap_gap_destroy (Gap *gap); #ifdef ENABLE_THREADED_TILE_SWAPPER static gpointer tile_swap_in_thread (gpointer); @@ -171,8 +171,8 @@ tile_swap_print_gaps (DefSwapFile *def_swap_file) static void tile_swap_exit1 (gpointer key, - gpointer value, - gpointer data) + gpointer value, + gpointer data) { extern gint tile_ref_count; SwapFile *swap_file; @@ -188,20 +188,20 @@ tile_swap_exit1 (gpointer key, #ifdef GIMP_UNSTABLE if (def_swap_file->swap_file_end != 0) - { - g_warning ("swap file not empty: \"%s\"\n", - gimp_filename_to_utf8 (swap_file->filename)); - tile_swap_print_gaps (def_swap_file); - } + { + g_warning ("swap file not empty: \"%s\"\n", + gimp_filename_to_utf8 (swap_file->filename)); + tile_swap_print_gaps (def_swap_file); + } #endif #ifdef G_OS_WIN32 /* should close before unlink */ if (swap_file->fd > 0) - { - close (swap_file->fd); - swap_file->fd = -1; - } + { + close (swap_file->fd); + swap_file->fd = -1; + } #endif g_unlink (swap_file->filename); } @@ -259,7 +259,7 @@ tile_swap_exit (void) extern int tile_exist_peak; g_printerr ("Tile exist peak was %d Tile structs (%d bytes)", - tile_exist_peak, tile_exist_peak * sizeof(Tile)); + tile_exist_peak, tile_exist_peak * sizeof(Tile)); #endif if (swap_files) @@ -268,8 +268,8 @@ tile_swap_exit (void) gint tile_swap_add (gchar *filename, - SwapFunc swap_func, - gpointer user_data) + SwapFunc swap_func, + gpointer user_data) { SwapFile *swap_file; DefSwapFile *def_swap_file; @@ -415,14 +415,14 @@ tile_swap_hash (gint *key) static gint tile_swap_compare (gint *a, - gint *b) + gint *b) { return (*a == *b); } static void tile_swap_command (Tile *tile, - gint command) + gint command) { SwapFile *swap_file; @@ -436,20 +436,20 @@ tile_swap_command (Tile *tile, swap_file = g_hash_table_lookup (swap_files, &tile->swap_num); if (!swap_file) { - g_warning ("could not find swap file for tile"); - goto out; + g_warning ("could not find swap file for tile"); + goto out; } if (swap_file->fd == -1) { - tile_swap_open (swap_file); + tile_swap_open (swap_file); - if (swap_file->fd == -1) - goto out; + if (swap_file->fd == -1) + goto out; } } while ((* swap_file->swap_func) (swap_file->fd, - tile, command, swap_file->user_data)); + tile, command, swap_file->user_data)); out: #ifdef ENABLE_THREADED_TILE_SWAPPER @@ -508,9 +508,9 @@ tile_swap_open (SwapFile *swap_file) static int tile_swap_default (gint fd, - Tile *tile, - gint cmd, - gpointer user_data) + Tile *tile, + gint cmd, + gpointer user_data) { DefSwapFile *def_swap_file; @@ -540,8 +540,8 @@ tile_swap_default (gint fd, static void tile_swap_default_in_async (DefSwapFile *def_swap_file, - gint fd, - Tile *tile) + gint fd, + Tile *tile) { #ifdef ENABLE_THREADED_TILE_SWAPPER AsyncSwapArgs *args = g_new (AsyncSwapArgs, 1); @@ -585,8 +585,8 @@ tile_swap_default_in_async (DefSwapFile *def_swap_file, */ static void tile_swap_default_in (DefSwapFile *def_swap_file, - gint fd, - Tile *tile) + gint fd, + Tile *tile) { gint err; gint nleft; @@ -605,12 +605,12 @@ tile_swap_default_in (DefSwapFile *def_swap_file, offset = lseek (fd, tile->swap_offset, SEEK_SET); if (offset == -1) - { - if (seek_err_msg) - g_message ("unable to seek to tile location on disk: %d", err); - seek_err_msg = FALSE; - return; - } + { + if (seek_err_msg) + g_message ("unable to seek to tile location on disk: %d", err); + seek_err_msg = FALSE; + return; + } } tile_alloc (tile); @@ -619,19 +619,19 @@ tile_swap_default_in (DefSwapFile *def_swap_file, while (nleft > 0) { do - { - err = read (fd, tile->data + tile->size - nleft, nleft); - } + { + err = read (fd, tile->data + tile->size - nleft, nleft); + } while ((err == -1) && ((errno == EAGAIN) || (errno == EINTR))); if (err <= 0) - { - if (read_err_msg) - g_message ("unable to read tile data from disk: %s (%d/%d bytes read)", - g_strerror (errno), err, nleft); - read_err_msg = FALSE; - return; - } + { + if (read_err_msg) + g_message ("unable to read tile data from disk: %s (%d/%d bytes read)", + g_strerror (errno), err, nleft); + read_err_msg = FALSE; + return; + } nleft -= err; } @@ -646,8 +646,8 @@ tile_swap_default_in (DefSwapFile *def_swap_file, static void tile_swap_default_out (DefSwapFile *def_swap_file, - int fd, - Tile *tile) + int fd, + Tile *tile) { gint bytes; gint err; @@ -667,13 +667,13 @@ tile_swap_default_out (DefSwapFile *def_swap_file, { offset = lseek (fd, newpos, SEEK_SET); if (offset == -1) - { - if (seek_err_msg) - g_message ("unable to seek to tile location on disk: %s", - g_strerror (errno)); - seek_err_msg = FALSE; - return; - } + { + if (seek_err_msg) + g_message ("unable to seek to tile location on disk: %s", + g_strerror (errno)); + seek_err_msg = FALSE; + return; + } def_swap_file->cur_position = newpos; } @@ -682,13 +682,13 @@ tile_swap_default_out (DefSwapFile *def_swap_file, { err = write (fd, tile->data + tile->size - nleft, nleft); if (err <= 0) - { - if (write_err_msg) - g_message ("unable to write tile data to disk: %s (%d/%d bytes written)", - g_strerror (errno), err, nleft); - write_err_msg = FALSE; - return; - } + { + if (write_err_msg) + g_message ("unable to write tile data to disk: %s (%d/%d bytes written)", + g_strerror (errno), err, nleft); + write_err_msg = FALSE; + return; + } nleft -= err; } @@ -706,8 +706,8 @@ tile_swap_default_out (DefSwapFile *def_swap_file, static void tile_swap_default_delete (DefSwapFile *def_swap_file, - gint fd, - Tile *tile) + gint fd, + Tile *tile) { GList *tmp; GList *tmp2; @@ -729,65 +729,65 @@ tile_swap_default_delete (DefSwapFile *def_swap_file, gap = tmp->data; if (end == gap->start) - { - gap->start = start; + { + gap->start = start; - if (tmp->prev) - { - gap2 = tmp->prev->data; - if (gap->start == gap2->end) - { - gap2->end = gap->end; - tile_swap_gap_destroy (gap); - def_swap_file->gaps = - g_list_remove_link (def_swap_file->gaps, tmp); - g_list_free (tmp); - } - } - break; - } + if (tmp->prev) + { + gap2 = tmp->prev->data; + if (gap->start == gap2->end) + { + gap2->end = gap->end; + tile_swap_gap_destroy (gap); + def_swap_file->gaps = + g_list_remove_link (def_swap_file->gaps, tmp); + g_list_free (tmp); + } + } + break; + } else if (start == gap->end) - { - gap->end = end; + { + gap->end = end; - if (tmp->next) - { - gap2 = tmp->next->data; - if (gap->end == gap2->start) - { - gap2->start = gap->start; - tile_swap_gap_destroy (gap); - def_swap_file->gaps = - g_list_remove_link (def_swap_file->gaps, tmp); - g_list_free (tmp); - } - } - break; - } + if (tmp->next) + { + gap2 = tmp->next->data; + if (gap->end == gap2->start) + { + gap2->start = gap->start; + tile_swap_gap_destroy (gap); + def_swap_file->gaps = + g_list_remove_link (def_swap_file->gaps, tmp); + g_list_free (tmp); + } + } + break; + } else if (end < gap->start) - { - gap = tile_swap_gap_new (start, end); + { + gap = tile_swap_gap_new (start, end); - tmp2 = g_list_alloc (); - tmp2->data = gap; - tmp2->next = tmp; - tmp2->prev = tmp->prev; - if (tmp->prev) - tmp->prev->next = tmp2; - tmp->prev = tmp2; + tmp2 = g_list_alloc (); + tmp2->data = gap; + tmp2->next = tmp; + tmp2->prev = tmp->prev; + if (tmp->prev) + tmp->prev->next = tmp2; + tmp->prev = tmp2; - if (tmp == def_swap_file->gaps) - def_swap_file->gaps = tmp2; - break; - } + if (tmp == def_swap_file->gaps) + def_swap_file->gaps = tmp2; + break; + } else if (!tmp->next) - { - gap = tile_swap_gap_new (start, end); - tmp->next = g_list_alloc (); - tmp->next->data = gap; - tmp->next->prev = tmp; - break; - } + { + gap = tile_swap_gap_new (start, end); + tmp->next = g_list_alloc (); + tmp->next->data = gap; + tmp->next->prev = tmp; + break; + } tmp = tmp->next; } @@ -812,8 +812,8 @@ tile_swap_default_delete (DefSwapFile *def_swap_file, static void tile_swap_resize (DefSwapFile *def_swap_file, - gint fd, - off_t new_size) + gint fd, + off_t new_size) { if (def_swap_file->swap_file_end > new_size) { @@ -829,8 +829,8 @@ tile_swap_resize (DefSwapFile *def_swap_file, static off_t tile_swap_find_offset (DefSwapFile *def_swap_file, - gint fd, - off_t bytes) + gint fd, + off_t bytes) { GList *tmp; Gap *gap; @@ -842,20 +842,20 @@ tile_swap_find_offset (DefSwapFile *def_swap_file, gap = tmp->data; if ((gap->end - gap->start) >= bytes) - { - offset = gap->start; - gap->start += bytes; + { + offset = gap->start; + gap->start += bytes; - if (gap->start == gap->end) - { - tile_swap_gap_destroy (gap); - def_swap_file->gaps = - g_list_remove_link (def_swap_file->gaps, tmp); - g_list_free (tmp); - } + if (gap->start == gap->end) + { + tile_swap_gap_destroy (gap); + def_swap_file->gaps = + g_list_remove_link (def_swap_file->gaps, tmp); + g_list_free (tmp); + } - return offset; - } + return offset; + } tmp = tmp->next; } @@ -863,7 +863,7 @@ tile_swap_find_offset (DefSwapFile *def_swap_file, offset = def_swap_file->swap_file_end; tile_swap_resize (def_swap_file, fd, - def_swap_file->swap_file_end + swap_file_grow); + def_swap_file->swap_file_end + swap_file_grow); if ((offset + bytes) < (def_swap_file->swap_file_end)) { @@ -876,7 +876,7 @@ tile_swap_find_offset (DefSwapFile *def_swap_file, static Gap * tile_swap_gap_new (off_t start, - off_t end) + off_t end) { Gap *gap; @@ -908,8 +908,8 @@ tile_swap_gap_destroy (Gap *gap) static void tile_swap_in_attempt (DefSwapFile *def_swap_file, - gint fd, - Tile *tile) + gint fd, + Tile *tile) { gint err = -1; gint nleft; @@ -926,7 +926,7 @@ tile_swap_in_attempt (DefSwapFile *def_swap_file, def_swap_file->cur_position = tile->swap_offset; if (lseek (fd, tile->swap_offset, SEEK_SET) == -1) - return; + return; } tile_alloc (tile); @@ -935,15 +935,15 @@ tile_swap_in_attempt (DefSwapFile *def_swap_file, while (nleft > 0) { do - { - err = read (fd, tile->data + tile->size - nleft, nleft); - } + { + err = read (fd, tile->data + tile->size - nleft, nleft); + } while ((err == -1) && ((errno == EAGAIN) || (errno == EINTR))); if (err <= 0) { - g_free (tile->data); - return; + g_free (tile->data); + return; } nleft -= err; diff --git a/app/base/tile.c b/app/base/tile.c index 062d17fb0e..9700c4d290 100644 --- a/app/base/tile.c +++ b/app/base/tile.c @@ -50,7 +50,7 @@ tile_sanitize_rowhints (Tile *tile) TileRowHint tile_get_rowhint (Tile *tile, - gint yoff) + gint yoff) { #ifdef HINTS_SANITY if (yoff < tile_eheight(tile) && yoff>=0) @@ -67,8 +67,8 @@ tile_get_rowhint (Tile *tile, void tile_set_rowhint (Tile *tile, - gint yoff, - TileRowHint rowhint) + gint yoff, + TileRowHint rowhint) { #ifdef HINTS_SANITY if (yoff < tile_eheight(tile) && yoff>=0) @@ -84,7 +84,7 @@ tile_set_rowhint (Tile *tile, void tile_init (Tile *tile, - gint bpp) + gint bpp) { tile->ref_count = 0; tile->write_count = 0; @@ -135,10 +135,10 @@ tile_lock (Tile *tile) if (tile->ref_count == 1) { if (tile->listhead) - { - /* remove from cache, move to main store */ - tile_cache_flush (tile); - } + { + /* remove from cache, move to main store */ + tile_cache_flush (tile); + } tile_active_count++; } if (tile->data == NULL) @@ -160,7 +160,7 @@ tile_lock (Tile *tile) void tile_release (Tile *tile, - gboolean dirty) + gboolean dirty) { /* Decrement the global reference count. */ @@ -181,12 +181,12 @@ tile_release (Tile *tile, tile->write_count--; if (tile->rowhint) - { - for (y = 0; y < tile->eheight; y++) - { - tile->rowhint[y] = TILEROWHINT_UNKNOWN; - } - } + { + for (y = 0; y < tile->eheight; y++) + { + tile->rowhint[y] = TILEROWHINT_UNKNOWN; + } + } } if (tile->ref_count == 0) @@ -194,17 +194,17 @@ tile_release (Tile *tile, tile_active_count--; if (tile->share_count == 0) - { - /* tile is truly dead */ - tile_destroy (tile); - return; /* skip terminal unlock */ - } + { + /* tile is truly dead */ + tile_destroy (tile); + return; /* skip terminal unlock */ + } else - { - /* last reference was just released, so move the tile to the - tile cache */ - tile_cache_insert (tile); - } + { + /* last reference was just released, so move the tile to the + tile cache */ + tile_cache_insert (tile); + } } TILE_MUTEX_UNLOCK (tile); @@ -320,8 +320,8 @@ tile_mark_valid (Tile *tile) void tile_attach (Tile *tile, - void *tm, - gint tile_num) + void *tm, + gint tile_num) { TileLink *tmp; @@ -350,8 +350,8 @@ tile_attach (Tile *tile, void tile_detach (Tile *tile, - void *tm, - gint tile_num) + void *tm, + gint tile_num) { TileLink **link; TileLink *tmp; @@ -366,7 +366,7 @@ tile_detach (Tile *tile, link = &(*link)->next) { if (((*link)->tm == tm) && ((*link)->tile_num == tile_num)) - break; + break; } if (*link == NULL) @@ -392,8 +392,8 @@ tile_detach (Tile *tile, gpointer tile_data_pointer (Tile *tile, - gint xoff, - gint yoff) + gint xoff, + gint yoff) { gint offset = yoff * tile->ewidth + xoff; diff --git a/app/base/tile.h b/app/base/tile.h index 545769c219..91a4d19501 100644 --- a/app/base/tile.h +++ b/app/base/tile.h @@ -42,7 +42,7 @@ typedef guchar TileRowHint; /* Initializes the fields of a tile to "good" values. */ void tile_init (Tile *tile, - gint bpp); + gint bpp); /* @@ -56,7 +56,7 @@ void tile_init (Tile *tile, void tile_lock (Tile *tile); void tile_release (Tile *tile, - gboolean dirty); + gboolean dirty); /* Allocate the data for the tile. */ @@ -75,15 +75,15 @@ gboolean tile_is_valid (Tile *tile); void tile_mark_valid (Tile *tile); TileRowHint tile_get_rowhint (Tile *tile, - gint yoff); + gint yoff); void tile_set_rowhint (Tile *tile, - gint yoff, - TileRowHint rowhint); + gint yoff, + TileRowHint rowhint); void tile_sanitize_rowhints (Tile *tile); void * tile_data_pointer (Tile *tile, - gint xoff, - gint yoff); + 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 @@ -93,11 +93,11 @@ void * tile_data_pointer (Tile *tile, */ void tile_attach (Tile *tile, - void *tm, - gint tile_num); + void *tm, + gint tile_num); void tile_detach (Tile *tile, - void *tm, - gint tile_num); + void *tm, + gint tile_num); #endif /* __TILE_H__ */ diff --git a/app/batch.c b/app/batch.c index 58d6cd5021..b393a40c30 100644 --- a/app/batch.c +++ b/app/batch.c @@ -128,7 +128,7 @@ batch_run_cmd (Gimp *gimp, const gchar *proc_name, GimpProcedure *procedure, GimpRunMode run_mode, - const gchar *cmd) + const gchar *cmd) { GValueArray *args; GValueArray *return_vals; diff --git a/app/composite/gimp-composite-3dnow.c b/app/composite/gimp-composite-3dnow.c index 4d4cae2ad9..b3d344aa37 100644 --- a/app/composite/gimp-composite-3dnow.c +++ b/app/composite/gimp-composite-3dnow.c @@ -1,8 +1,6 @@ /* The GIMP -- an image manipulation program * Copyright (C) 1995 Spencer Kimball and Peter Mattis * - * -*- mode: c tab-width: 2; -*- - * * 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 diff --git a/app/composite/gimp-composite-3dnow.h b/app/composite/gimp-composite-3dnow.h index e17a06978c..4e060be320 100644 --- a/app/composite/gimp-composite-3dnow.h +++ b/app/composite/gimp-composite-3dnow.h @@ -4,8 +4,8 @@ extern gboolean gimp_composite_3dnow_init (void); /* - * The function gimp_composite_*_install() is defined in the code generated by make-install.py - * I hate to create a .h file just for that declaration, so I do it here (for now). + * The function gimp_composite_*_install() is defined in the code generated by make-install.py + * I hate to create a .h file just for that declaration, so I do it here (for now). */ extern gboolean gimp_composite_3dnow_install (void); diff --git a/app/composite/gimp-composite-altivec.c b/app/composite/gimp-composite-altivec.c index 0cc5483af9..0c913e58c3 100644 --- a/app/composite/gimp-composite-altivec.c +++ b/app/composite/gimp-composite-altivec.c @@ -2,8 +2,6 @@ * Copyright (C) 1995 Spencer Kimball and Peter Mattis * Copyright (C) 2005 Frederic Leroy * - * -*- mode: c tab-width: 2; -*- - * * 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 diff --git a/app/composite/gimp-composite-altivec.h b/app/composite/gimp-composite-altivec.h index 4477e4e98c..ca071c7826 100644 --- a/app/composite/gimp-composite-altivec.h +++ b/app/composite/gimp-composite-altivec.h @@ -4,8 +4,8 @@ extern gboolean gimp_composite_altivec_init (void); /* - * The function gimp_composite_*_install() is defined in the code generated by make-install.py - * I hate to create a .h file just for that declaration, so I do it here (for now). + * The function gimp_composite_*_install() is defined in the code generated by make-install.py + * I hate to create a .h file just for that declaration, so I do it here (for now). */ extern gboolean gimp_composite_altivec_install (void); diff --git a/app/composite/gimp-composite-generic.c b/app/composite/gimp-composite-generic.c index 6e2279aa26..c62a80ba12 100644 --- a/app/composite/gimp-composite-generic.c +++ b/app/composite/gimp-composite-generic.c @@ -1,5 +1,4 @@ -/* -*- mode: c tab-width: 2; c-basic-indent: 2; indent-tabs-mode: nil -*- - * The GIMP -- an image manipulation program +/* 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 diff --git a/app/composite/gimp-composite-mmx.c b/app/composite/gimp-composite-mmx.c index eff9777b8b..fe394a9072 100644 --- a/app/composite/gimp-composite-mmx.c +++ b/app/composite/gimp-composite-mmx.c @@ -1,9 +1,6 @@ -/* -*- mode: c tab-width: 2; c-basic-indent: 2; indent-tabs-mode: nil -*- - * - * The GIMP -- an image manipulation program +/* 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 diff --git a/app/composite/gimp-composite-mmx.h b/app/composite/gimp-composite-mmx.h index a27432e90b..c42006d8fa 100644 --- a/app/composite/gimp-composite-mmx.h +++ b/app/composite/gimp-composite-mmx.h @@ -4,9 +4,9 @@ extern gboolean gimp_composite_mmx_init (void); /* - * The function gimp_composite_*_install() is defined in the code - * generated by make-install.py I hate to have make-install.py create - * a .h file just for that declaration, so I do it here. + * The function gimp_composite_*_install() is defined in the code + * generated by make-install.py I hate to have make-install.py create + * a .h file just for that declaration, so I do it here. */ extern gboolean gimp_composite_mmx_install (void); diff --git a/app/composite/gimp-composite-regression.c b/app/composite/gimp-composite-regression.c index be0f8fa1e1..4a7c57852f 100644 --- a/app/composite/gimp-composite-regression.c +++ b/app/composite/gimp-composite-regression.c @@ -1,8 +1,6 @@ -/* -*- mode: c tab-width: 2; c-basic-indent: 2; indent-tabs-mode: nil -*- - * The GIMP -- an image manipulation program +/* The GIMP -- an image manipulation program * Copyright (C) 1995 Spencer Kimball and Peter Mattis * - * * Gimp image compositing * Copyright (C) 2003 Helvetix Victorinox, a pseudonym, * @@ -68,29 +66,29 @@ void gimp_composite_regression_print_vector (guchar vector[], GimpPixelFormat format, gulong n_pixels) { - switch (format) - { - case GIMP_PIXELFORMAT_V8: - gimp_composite_regression_print_vector_v8 ((gimp_v8_t *) vector, n_pixels); - break; + switch (format) + { + case GIMP_PIXELFORMAT_V8: + gimp_composite_regression_print_vector_v8 ((gimp_v8_t *) vector, n_pixels); + break; - case GIMP_PIXELFORMAT_VA8: - gimp_composite_regression_print_vector_va8 ((gimp_va8_t *) vector, n_pixels); - break; + case GIMP_PIXELFORMAT_VA8: + gimp_composite_regression_print_vector_va8 ((gimp_va8_t *) vector, n_pixels); + break; - case GIMP_PIXELFORMAT_RGB8: - gimp_composite_regression_print_vector_rgb8 ((gimp_rgb8_t *) vector, n_pixels); - break; + case GIMP_PIXELFORMAT_RGB8: + gimp_composite_regression_print_vector_rgb8 ((gimp_rgb8_t *) vector, n_pixels); + break; - case GIMP_PIXELFORMAT_RGBA8: - gimp_composite_regression_print_vector_rgba8 ((gimp_rgba8_t *) vector, n_pixels); - break; + case GIMP_PIXELFORMAT_RGBA8: + gimp_composite_regression_print_vector_rgba8 ((gimp_rgba8_t *) vector, n_pixels); + break; - case GIMP_PIXELFORMAT_ANY: - case GIMP_PIXELFORMAT_N: - default: - break; - } + case GIMP_PIXELFORMAT_ANY: + case GIMP_PIXELFORMAT_N: + default: + break; + } } @@ -104,12 +102,12 @@ gimp_composite_regression_print_vector (guchar vector[], GimpPixelFormat format, void gimp_composite_regression_print_vector_v8 (gimp_v8_t v[], unsigned int n_pixels) { - unsigned int i; + unsigned int i; - for (i = 0; i < n_pixels; i++) - { - printf ("#%02x\n", v[i].v); - } + for (i = 0; i < n_pixels; i++) + { + printf ("#%02x\n", v[i].v); + } } /** @@ -122,12 +120,12 @@ gimp_composite_regression_print_vector_v8 (gimp_v8_t v[], unsigned int n_pixels) void gimp_composite_regression_print_vector_va8 (gimp_va8_t v[], unsigned int n_pixels) { - unsigned int i; + unsigned int i; - for (i = 0; i < n_pixels; i++) - { - printf ("#%02x,%02X\n", v[i].v, v[i].a); - } + for (i = 0; i < n_pixels; i++) + { + printf ("#%02x,%02X\n", v[i].v, v[i].a); + } } /** @@ -140,12 +138,12 @@ gimp_composite_regression_print_vector_va8 (gimp_va8_t v[], unsigned int n_pixel void gimp_composite_regression_print_vector_rgb8 (gimp_rgb8_t v[], unsigned int n_pixels) { - unsigned int i; + unsigned int i; - for (i = 0; i < n_pixels; i++) - { - printf ("#%02x%02x%02x\n", v[i].r, v[i].g, v[i].b); - } + for (i = 0; i < n_pixels; i++) + { + printf ("#%02x%02x%02x\n", v[i].r, v[i].g, v[i].b); + } } /** @@ -158,12 +156,12 @@ gimp_composite_regression_print_vector_rgb8 (gimp_rgb8_t v[], unsigned int n_pix void gimp_composite_regression_print_vector_rgba8 (gimp_rgba8_t v[], unsigned int n_pixels) { - unsigned int i; + unsigned int i; - for (i = 0; i < n_pixels; i++) - { - printf ("#%02x%02x%02x,%02X\n", v[i].r, v[i].g, v[i].b, v[i].a); - } + for (i = 0; i < n_pixels; i++) + { + printf ("#%02x%02x%02x,%02X\n", v[i].r, v[i].g, v[i].b, v[i].a); + } } /** @@ -536,30 +534,30 @@ gimp_composite_regression_fixed_rgba8 (u_long n_pixels) **/ GimpCompositeContext * gimp_composite_context_init (GimpCompositeContext *ctx, - GimpCompositeOperation op, - GimpPixelFormat a_format, - GimpPixelFormat b_format, - GimpPixelFormat d_format, - GimpPixelFormat m_format, - unsigned long n_pixels, - unsigned char *A, - unsigned char *B, - unsigned char *M, - unsigned char *D) + GimpCompositeOperation op, + GimpPixelFormat a_format, + GimpPixelFormat b_format, + GimpPixelFormat d_format, + GimpPixelFormat m_format, + unsigned long n_pixels, + unsigned char *A, + unsigned char *B, + unsigned char *M, + unsigned char *D) { - memset ((void *) ctx, 0, sizeof(*ctx)); - ctx->op = op; - ctx->n_pixels = n_pixels; - ctx->scale.scale = 2; - ctx->pixelformat_A = a_format; - ctx->pixelformat_B = b_format; - ctx->pixelformat_D = d_format; - ctx->pixelformat_M = m_format; - ctx->A = (unsigned char *) A; - ctx->B = (unsigned char *) B; - ctx->M = (unsigned char *) B; - ctx->D = (unsigned char *) D; - memset (ctx->D, 0, ctx->n_pixels * gimp_composite_pixel_bpp[ctx->pixelformat_D]); + memset ((void *) ctx, 0, sizeof(*ctx)); + ctx->op = op; + ctx->n_pixels = n_pixels; + ctx->scale.scale = 2; + ctx->pixelformat_A = a_format; + ctx->pixelformat_B = b_format; + ctx->pixelformat_D = d_format; + ctx->pixelformat_M = m_format; + ctx->A = (unsigned char *) A; + ctx->B = (unsigned char *) B; + ctx->M = (unsigned char *) B; + ctx->D = (unsigned char *) D; + memset (ctx->D, 0, ctx->n_pixels * gimp_composite_pixel_bpp[ctx->pixelformat_D]); - return (ctx); + return (ctx); } diff --git a/app/composite/gimp-composite-regression.h b/app/composite/gimp-composite-regression.h index 259c5e56b7..f21a54ffd4 100644 --- a/app/composite/gimp-composite-regression.h +++ b/app/composite/gimp-composite-regression.h @@ -2,10 +2,10 @@ #define gimp_composite_regression_h /* * The following typedefs are temporary and only used in regression testing. - */ + */ typedef struct { - guint8 v; + guint8 v; } gimp_v8_t; typedef struct @@ -86,60 +86,60 @@ typedef struct #endif extern void gimp_composite_regression_print_vector (guchar vector[], - GimpPixelFormat format, - gulong n_pixels); + GimpPixelFormat format, + gulong n_pixels); extern void gimp_composite_regression_print_vector_v8 (gimp_v8_t v[], - unsigned int n_pixels); + unsigned int n_pixels); extern void gimp_composite_regression_print_vector_va8 (gimp_va8_t v[], - unsigned int n_pixels); + unsigned int n_pixels); extern void gimp_composite_regression_print_vector_rgb8 (gimp_rgb8_t v[], - unsigned int n_pixels); + unsigned int n_pixels); extern void gimp_composite_regression_print_vector_rgba8 (gimp_rgba8_t v[], - unsigned int n_pixels); + unsigned int n_pixels); extern double gimp_composite_regression_time_function (u_long iterations, - void (*func)(), - GimpCompositeContext *ctx); + void (*func)(), + GimpCompositeContext *ctx); extern int gimp_composite_regression_comp_rgba8 (char *str, - gimp_rgba8_t *rgba8A, - gimp_rgba8_t *rgba8B, - gimp_rgba8_t *expected, - gimp_rgba8_t *actual, - u_long length); + gimp_rgba8_t *rgba8A, + gimp_rgba8_t *rgba8B, + gimp_rgba8_t *expected, + gimp_rgba8_t *actual, + u_long length); extern int gimp_composite_regression_comp_va8 (char *str, - gimp_va8_t *va8A, - gimp_va8_t *va8B, - gimp_va8_t *expected, - gimp_va8_t *actual, - u_long length); + gimp_va8_t *va8A, + gimp_va8_t *va8B, + gimp_va8_t *expected, + gimp_va8_t *actual, + u_long length); extern int gimp_composite_regression_compare_contexts (char *, - GimpCompositeContext *ctx1, - GimpCompositeContext *ctx2); + GimpCompositeContext *ctx1, + GimpCompositeContext *ctx2); extern void gimp_composite_regression_dump_rgba8 (char *str, - gimp_rgba8_t *rgba, - u_long n_pixels); + gimp_rgba8_t *rgba, + u_long n_pixels); extern void gimp_composite_regression_print_rgba8 (gimp_rgba8_t *rgba8); extern void gimp_composite_regression_print_va8 (gimp_va8_t *va8); extern void gimp_composite_regression_timer_report (char *name, - double t1, - double t2); + double t1, + double t2); extern gimp_rgba8_t *gimp_composite_regression_random_rgba8 (u_long n_pixels); extern gimp_rgba8_t *gimp_composite_regression_fixed_rgba8 (u_long n_pixels); extern GimpCompositeContext *gimp_composite_context_init (GimpCompositeContext *ctx, - GimpCompositeOperation op, - GimpPixelFormat a_format, - GimpPixelFormat b_format, - GimpPixelFormat d_format, - GimpPixelFormat m_format, - unsigned long n_pixels, - unsigned char *A, - unsigned char *B, - unsigned char *M, - unsigned char *D); + GimpCompositeOperation op, + GimpPixelFormat a_format, + GimpPixelFormat b_format, + GimpPixelFormat d_format, + GimpPixelFormat m_format, + unsigned long n_pixels, + unsigned char *A, + unsigned char *B, + unsigned char *M, + unsigned char *D); #endif diff --git a/app/composite/gimp-composite-sse.c b/app/composite/gimp-composite-sse.c index 1d82432170..7311aa467a 100644 --- a/app/composite/gimp-composite-sse.c +++ b/app/composite/gimp-composite-sse.c @@ -1,9 +1,6 @@ -/* -*- mode: c tab-width: 2; c-basic-indent: 2; indent-tabs-mode: nil -*- - * - * The GIMP -- an image manipulation program +/* 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 diff --git a/app/composite/gimp-composite-sse.h b/app/composite/gimp-composite-sse.h index 24ecdb7bee..cacd061947 100644 --- a/app/composite/gimp-composite-sse.h +++ b/app/composite/gimp-composite-sse.h @@ -4,8 +4,8 @@ extern gboolean gimp_composite_sse_init (void); /* - * The function gimp_composite_*_install() is defined in the code generated by make-install.py - * I hate to create a .h file just for that declaration, so I do it here (for now). + * The function gimp_composite_*_install() is defined in the code generated by make-install.py + * I hate to create a .h file just for that declaration, so I do it here (for now). */ extern gboolean gimp_composite_sse_install (void); @@ -19,7 +19,7 @@ extern gboolean gimp_composite_sse_install (void); #endif /* __GNUC__ >= 3 */ #endif /* defined(ARCH_X86) */ #endif /* defined(USE_SSE) */ -#endif /* */ +#endif /* */ #ifdef COMPILE_SSE_IS_OKAY /* diff --git a/app/composite/gimp-composite-sse2.c b/app/composite/gimp-composite-sse2.c index e1831da019..6a44f7de4e 100644 --- a/app/composite/gimp-composite-sse2.c +++ b/app/composite/gimp-composite-sse2.c @@ -1,10 +1,6 @@ -/* -*- mode: c tab-width: 2; c-basic-indent: 2; indent-tabs-mode: nil -*- - * - * The GIMP -- an image manipulation program +/* The GIMP -- an image manipulation program * Copyright (C) 1995 Spencer Kimball and Peter Mattis * - * -*- mode: c tab-width: 2; c-basic-indent: 2; indent-tabs-mode: nil -*- - * * 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 @@ -328,7 +324,7 @@ gimp_composite_grain_extract_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op) asm volatile (" movq %0,%%mm0\n" "\tpxor %%mm6,%%mm6\n" "\tmovq %1,%%mm7\n" - "\tmovdqu %2,%%xmm0\n" + "\tmovdqu %2,%%xmm0\n" "\tpxor %%xmm6,%%xmm6\n" "\tmovdqu %3,%%xmm7\n" : /* empty */ diff --git a/app/composite/gimp-composite-sse2.h b/app/composite/gimp-composite-sse2.h index 8730adc571..74b7dec50c 100644 --- a/app/composite/gimp-composite-sse2.h +++ b/app/composite/gimp-composite-sse2.h @@ -4,8 +4,8 @@ extern gboolean gimp_composite_sse2_init (void); /* - * The function gimp_composite_*_install() is defined in the code generated by make-install.py - * I hate to create a .h file just for that declaration, so I do it here (for now). + * The function gimp_composite_*_install() is defined in the code generated by make-install.py + * I hate to create a .h file just for that declaration, so I do it here (for now). */ extern gboolean gimp_composite_sse2_install (void); diff --git a/app/composite/gimp-composite-vis.c b/app/composite/gimp-composite-vis.c index 092a956901..66e159d26a 100644 --- a/app/composite/gimp-composite-vis.c +++ b/app/composite/gimp-composite-vis.c @@ -1,8 +1,6 @@ /* The GIMP -- an image manipulation program * Copyright (C) 1995 Spencer Kimball and Peter Mattis * - * -*- mode: c tab-width: 2; c-basic-indent: 2; indent-tabs-mode: nil -*- - * * 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 diff --git a/app/composite/gimp-composite-vis.h b/app/composite/gimp-composite-vis.h index d3ed74c3f1..e1d2359178 100644 --- a/app/composite/gimp-composite-vis.h +++ b/app/composite/gimp-composite-vis.h @@ -4,8 +4,8 @@ extern gboolean gimp_composite_vis_init (void); /* - * The function gimp_composite_*_install() is defined in the code generated by make-install.py - * I hate to create a .h file just for that declaration, so I do it here (for now). + * The function gimp_composite_*_install() is defined in the code generated by make-install.py + * I hate to create a .h file just for that declaration, so I do it here (for now). */ extern gboolean gimp_composite_vis_install (void); diff --git a/app/composite/gimp-composite-x86.h b/app/composite/gimp-composite-x86.h index 96ee741ba9..5bdde5e44c 100644 --- a/app/composite/gimp-composite-x86.h +++ b/app/composite/gimp-composite-x86.h @@ -1,9 +1,6 @@ -/* -*- mode: c tab-width: 2; c-basic-indent: 2; indent-tabs-mode: nil -*- - * - * The GIMP -- an image manipulation program +/* 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 @@ -205,7 +202,7 @@ "psrlq $32,%%"#dividend ";" \ "psrlq $32,%%"#divisor ";" \ xmm_pdivwX(dividend,divisor,scratch) \ - "psllq $96,%%"#scratch ";" \ + "psllq $96,%%"#scratch ";" \ "por %%"#scratch ",%%"#quotient /* equivalent to the INT_MULT() macro in gimp-composite-generic.c */ diff --git a/app/composite/gimp-composite.c b/app/composite/gimp-composite.c index d4234a5a7e..aae05c2636 100644 --- a/app/composite/gimp-composite.c +++ b/app/composite/gimp-composite.c @@ -1,8 +1,6 @@ -/* -*- mode: c tab-width: 2; c-basic-indent: 2; indent-tabs-mode: nil -*- - * The GIMP -- an image manipulation program +/* The GIMP -- an image manipulation program * Copyright (C) 1995 Spencer Kimball and Peter Mattis * - * * Gimp image compositing * Copyright (C) 2003 Helvetix Victorinox, a pseudonym, * diff --git a/app/composite/gimp-composite.h b/app/composite/gimp-composite.h index 377132cc9d..b6894fe703 100644 --- a/app/composite/gimp-composite.h +++ b/app/composite/gimp-composite.h @@ -1,5 +1,4 @@ -/* -*- mode: c; c-default-style: "gnu"; tab-width: 2; c-basic-indent: 2; indent-tabs-mode: nil -*- - * The GIMP -- an image manipulation program +/* The GIMP -- an image manipulation program * Copyright (C) 1995 Spencer Kimball and Peter Mattis * * Gimp Image Compositing diff --git a/app/config/gimpbaseconfig.c b/app/config/gimpbaseconfig.c index 54aa4f5d08..e40b181804 100644 --- a/app/config/gimpbaseconfig.c +++ b/app/config/gimpbaseconfig.c @@ -76,13 +76,13 @@ gimp_base_config_class_init (GimpBaseConfigClass *klass) GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_TEMP_PATH, "temp-path", TEMP_PATH_BLURB, - GIMP_CONFIG_PATH_DIR, + GIMP_CONFIG_PATH_DIR, "${gimp_dir}" G_DIR_SEPARATOR_S "tmp", GIMP_PARAM_STATIC_STRINGS | GIMP_CONFIG_PARAM_RESTART); GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_SWAP_PATH, "swap-path", SWAP_PATH_BLURB, - GIMP_CONFIG_PATH_DIR, + GIMP_CONFIG_PATH_DIR, "${gimp_dir}", GIMP_PARAM_STATIC_STRINGS | GIMP_CONFIG_PARAM_RESTART); diff --git a/app/config/gimpconfig-dump.c b/app/config/gimpconfig-dump.c index 9d02ff11b3..4b6bc8a666 100644 --- a/app/config/gimpconfig-dump.c +++ b/app/config/gimpconfig-dump.c @@ -45,14 +45,14 @@ static void dump_gimprc_system (GimpConfig *rc, - GimpConfigWriter *writer, + GimpConfigWriter *writer, gint fd); static void dump_gimprc_manpage (GimpConfig *rc, - GimpConfigWriter *writer, + GimpConfigWriter *writer, gint fd); static gchar * dump_describe_param (GParamSpec *param_spec); static void dump_with_linebreaks (gint fd, - const gchar *text); + const gchar *text); gboolean @@ -71,7 +71,7 @@ gimp_config_dump (GimpConfigDumpFormat format) case GIMP_CONFIG_DUMP_GIMPRC: gimp_config_writer_comment (writer, - "Dump of the GIMP default configuration"); + "Dump of the GIMP default configuration"); gimp_config_writer_linefeed (writer); gimp_config_serialize_properties (rc, writer); gimp_config_writer_linefeed (writer); @@ -110,7 +110,7 @@ static const gchar *system_gimprc_header = static void dump_gimprc_system (GimpConfig *rc, - GimpConfigWriter *writer, + GimpConfigWriter *writer, gint fd) { GObjectClass *klass; @@ -137,10 +137,10 @@ dump_gimprc_system (GimpConfig *rc, comment = dump_describe_param (prop_spec); if (comment) - { - gimp_config_writer_comment (writer, comment); - g_free (comment); - } + { + gimp_config_writer_comment (writer, comment); + g_free (comment); + } gimp_config_writer_comment_mode (writer, TRUE); gimp_config_writer_linefeed (writer); @@ -243,7 +243,7 @@ static const gchar *man_page_footer = static void dump_gimprc_manpage (GimpConfig *rc, - GimpConfigWriter *writer, + GimpConfigWriter *writer, gint fd) { GObjectClass *klass; @@ -270,15 +270,15 @@ dump_gimprc_manpage (GimpConfig *rc, write (fd, ".TP\n", strlen (".TP\n")); if (gimp_config_serialize_property (rc, prop_spec, writer)) - { - write (fd, "\n", 1); + { + write (fd, "\n", 1); - desc = dump_describe_param (prop_spec); + desc = dump_describe_param (prop_spec); - dump_with_linebreaks (fd, desc); - write (fd, "\n", 1); + dump_with_linebreaks (fd, desc); + write (fd, "\n", 1); - g_free (desc); + g_free (desc); } } @@ -333,7 +333,7 @@ dump_describe_param (GParamSpec *param_spec) g_warning ("FIXME: Property '%s' has no blurb.", param_spec->name); blurb = g_strdup_printf ("The %s property has no description.", - param_spec->name); + param_spec->name); } type = param_spec->value_type; @@ -341,65 +341,65 @@ dump_describe_param (GParamSpec *param_spec) if (g_type_is_a (type, GIMP_TYPE_RGB)) { values = - "The color is specified in the form (color-rgba red green blue alpha) " - "with channel values as floats between 0.0 and 1.0."; + "The color is specified in the form (color-rgba red green blue alpha) " + "with channel values as floats between 0.0 and 1.0."; } else if (g_type_is_a (type, GIMP_TYPE_MEMSIZE)) { values = - "The integer size can contain a suffix of 'B', 'K', 'M' or 'G' which " - "makes GIMP interpret the size as being specified in bytes, kilobytes, " - "megabytes or gigabytes. If no suffix is specified the size defaults " - "to being specified in kilobytes."; + "The integer size can contain a suffix of 'B', 'K', 'M' or 'G' which " + "makes GIMP interpret the size as being specified in bytes, kilobytes, " + "megabytes or gigabytes. If no suffix is specified the size defaults " + "to being specified in kilobytes."; } else if (g_type_is_a (type, GIMP_TYPE_CONFIG_PATH)) { switch (gimp_param_spec_config_path_type (param_spec)) - { - case GIMP_CONFIG_PATH_FILE: - values = "This is a single filename."; - break; + { + case GIMP_CONFIG_PATH_FILE: + values = "This is a single filename."; + break; - case GIMP_CONFIG_PATH_FILE_LIST: - switch (G_SEARCHPATH_SEPARATOR) - { - case ':': - values = "This is a colon-separated list of files."; - break; - case ';': - values = "This is a semicolon-separated list of files."; - break; - default: - g_warning ("unhandled G_SEARCHPATH_SEPARATOR value"); - break; - } - break; + case GIMP_CONFIG_PATH_FILE_LIST: + switch (G_SEARCHPATH_SEPARATOR) + { + case ':': + values = "This is a colon-separated list of files."; + break; + case ';': + values = "This is a semicolon-separated list of files."; + break; + default: + g_warning ("unhandled G_SEARCHPATH_SEPARATOR value"); + break; + } + break; - case GIMP_CONFIG_PATH_DIR: - values = "This is a single folder."; - break; + case GIMP_CONFIG_PATH_DIR: + values = "This is a single folder."; + break; - case GIMP_CONFIG_PATH_DIR_LIST: - switch (G_SEARCHPATH_SEPARATOR) - { - case ':': - values = "This is a colon-separated list of folders to search."; - break; - case ';': - values = "This is a semicolon-separated list of folders to search."; - break; - default: - g_warning ("unhandled G_SEARCHPATH_SEPARATOR value"); - break; - } - break; - } + case GIMP_CONFIG_PATH_DIR_LIST: + switch (G_SEARCHPATH_SEPARATOR) + { + case ':': + values = "This is a colon-separated list of folders to search."; + break; + case ';': + values = "This is a semicolon-separated list of folders to search."; + break; + default: + g_warning ("unhandled G_SEARCHPATH_SEPARATOR value"); + break; + } + break; + } } else if (g_type_is_a (type, GIMP_TYPE_UNIT)) { values = - "The unit can be one inches, millimeters, points or picas plus " - "those in your user units database."; + "The unit can be one inches, millimeters, points or picas plus " + "those in your user units database."; } else if (g_type_is_a (type, GIMP_TYPE_CONFIG)) { @@ -408,72 +408,72 @@ dump_describe_param (GParamSpec *param_spec) else { switch (G_TYPE_FUNDAMENTAL (type)) - { - case G_TYPE_BOOLEAN: - values = "Possible values are yes and no."; - break; - case G_TYPE_INT: - case G_TYPE_UINT: - case G_TYPE_LONG: - case G_TYPE_ULONG: - values = "This is an integer value."; - break; - case G_TYPE_FLOAT: - case G_TYPE_DOUBLE: - values = "This is a float value."; - break; - case G_TYPE_STRING: - /* eek */ - if (strcmp (g_param_spec_get_name (param_spec), "image-title-format") - && - strcmp (g_param_spec_get_name (param_spec), "image-status-format")) - { - values = "This is a string value."; - } - else - { - values = display_format_description; - } - break; - case G_TYPE_ENUM: - { - GEnumClass *enum_class; - GEnumValue *enum_value; - GString *str; - gint i; + { + case G_TYPE_BOOLEAN: + values = "Possible values are yes and no."; + break; + case G_TYPE_INT: + case G_TYPE_UINT: + case G_TYPE_LONG: + case G_TYPE_ULONG: + values = "This is an integer value."; + break; + case G_TYPE_FLOAT: + case G_TYPE_DOUBLE: + values = "This is a float value."; + break; + case G_TYPE_STRING: + /* eek */ + if (strcmp (g_param_spec_get_name (param_spec), "image-title-format") + && + strcmp (g_param_spec_get_name (param_spec), "image-status-format")) + { + values = "This is a string value."; + } + else + { + values = display_format_description; + } + break; + case G_TYPE_ENUM: + { + GEnumClass *enum_class; + GEnumValue *enum_value; + GString *str; + gint i; - enum_class = g_type_class_peek (type); + enum_class = g_type_class_peek (type); - str = g_string_new (blurb); + str = g_string_new (blurb); - g_string_append (str, " Possible values are "); + g_string_append (str, " Possible values are "); - for (i = 0, enum_value = enum_class->values; - i < enum_class->n_values; - i++, enum_value++) - { - g_string_append (str, enum_value->value_nick); + for (i = 0, enum_value = enum_class->values; + i < enum_class->n_values; + i++, enum_value++) + { + g_string_append (str, enum_value->value_nick); - switch (enum_class->n_values - i) - { - case 1: - g_string_append_c (str, '.'); - break; - case 2: - g_string_append (str, " and "); - break; - default: - g_string_append (str, ", "); - break; - } - } + switch (enum_class->n_values - i) + { + case 1: + g_string_append_c (str, '.'); + break; + case 2: + g_string_append (str, " and "); + break; + default: + g_string_append (str, ", "); + break; + } + } - return g_string_free (str, FALSE); - } - break; - default: - break; - } + return g_string_free (str, FALSE); + } + break; + default: + break; + } } if (!values) @@ -487,7 +487,7 @@ dump_describe_param (GParamSpec *param_spec) static void dump_with_linebreaks (gint fd, - const gchar *text) + const gchar *text) { gint len = strlen (text); @@ -515,7 +515,7 @@ dump_with_linebreaks (gint fd, write (fd, "\n", 1); if (*t == '\n') - write (fd, ".br\n", 4); + write (fd, ".br\n", 4); i++; diff --git a/app/config/gimpconfig-file.c b/app/config/gimpconfig-file.c index d69306d11d..f2952741f2 100644 --- a/app/config/gimpconfig-file.c +++ b/app/config/gimpconfig-file.c @@ -72,14 +72,14 @@ gimp_config_file_copy (const gchar *source, while ((nbytes = fread (buffer, 1, sizeof (buffer), sfile)) > 0) { if (fwrite (buffer, 1, nbytes, dfile) < nbytes) - { - g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno), + { + g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno), _("Error while writing '%s': %s"), gimp_filename_to_utf8 (dest), g_strerror (errno)); - fclose (sfile); - fclose (dfile); - return FALSE; - } + fclose (sfile); + fclose (dfile); + return FALSE; + } } if (ferror (sfile)) diff --git a/app/config/gimpcoreconfig.c b/app/config/gimpcoreconfig.c index da7a5051af..aa2a4afa7d 100644 --- a/app/config/gimpcoreconfig.c +++ b/app/config/gimpcoreconfig.c @@ -136,35 +136,35 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass) path = gimp_config_build_plug_in_path ("plug-ins"); GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_PLUG_IN_PATH, "plug-in-path", PLUG_IN_PATH_BLURB, - GIMP_CONFIG_PATH_DIR_LIST, path, + GIMP_CONFIG_PATH_DIR_LIST, path, GIMP_PARAM_STATIC_STRINGS | GIMP_CONFIG_PARAM_RESTART); g_free (path); path = gimp_config_build_plug_in_path ("modules"); GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_MODULE_PATH, "module-path", MODULE_PATH_BLURB, - GIMP_CONFIG_PATH_DIR_LIST, path, + GIMP_CONFIG_PATH_DIR_LIST, path, GIMP_PARAM_STATIC_STRINGS | GIMP_CONFIG_PARAM_RESTART); g_free (path); path = gimp_config_build_plug_in_path ("interpreters"); GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_INTERPRETER_PATH, "interpreter-path", INTERPRETER_PATH_BLURB, - GIMP_CONFIG_PATH_DIR_LIST, path, + GIMP_CONFIG_PATH_DIR_LIST, path, GIMP_PARAM_STATIC_STRINGS | GIMP_CONFIG_PARAM_RESTART); g_free (path); path = gimp_config_build_plug_in_path ("environ"); GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_ENVIRON_PATH, "environ-path", ENVIRON_PATH_BLURB, - GIMP_CONFIG_PATH_DIR_LIST, path, + GIMP_CONFIG_PATH_DIR_LIST, path, GIMP_PARAM_STATIC_STRINGS | GIMP_CONFIG_PARAM_RESTART); g_free (path); path = gimp_config_build_data_path ("brushes"); GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_BRUSH_PATH, "brush-path", BRUSH_PATH_BLURB, - GIMP_CONFIG_PATH_DIR_LIST, path, + GIMP_CONFIG_PATH_DIR_LIST, path, GIMP_PARAM_STATIC_STRINGS | GIMP_CONFIG_PARAM_RESTART); g_free (path); @@ -172,14 +172,14 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass) GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_BRUSH_PATH_WRITABLE, "brush-path-writable", BRUSH_PATH_WRITABLE_BLURB, - GIMP_CONFIG_PATH_DIR_LIST, path, + GIMP_CONFIG_PATH_DIR_LIST, path, GIMP_PARAM_STATIC_STRINGS | GIMP_CONFIG_PARAM_RESTART); g_free (path); path = gimp_config_build_data_path ("patterns"); GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_PATTERN_PATH, "pattern-path", PATTERN_PATH_BLURB, - GIMP_CONFIG_PATH_DIR_LIST, path, + GIMP_CONFIG_PATH_DIR_LIST, path, GIMP_PARAM_STATIC_STRINGS | GIMP_CONFIG_PARAM_RESTART); g_free (path); @@ -187,7 +187,7 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass) GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_PATTERN_PATH_WRITABLE, "pattern-path-writable", PATTERN_PATH_WRITABLE_BLURB, - GIMP_CONFIG_PATH_DIR_LIST, path, + GIMP_CONFIG_PATH_DIR_LIST, path, GIMP_PARAM_STATIC_STRINGS | GIMP_CONFIG_PARAM_RESTART); g_free (path); @@ -202,14 +202,14 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass) GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_PALETTE_PATH_WRITABLE, "palette-path-writable", PALETTE_PATH_WRITABLE_BLURB, - GIMP_CONFIG_PATH_DIR_LIST, path, + GIMP_CONFIG_PATH_DIR_LIST, path, GIMP_PARAM_STATIC_STRINGS | GIMP_CONFIG_PARAM_RESTART); g_free (path); path = gimp_config_build_data_path ("gradients"); GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_GRADIENT_PATH, "gradient-path", GRADIENT_PATH_BLURB, - GIMP_CONFIG_PATH_DIR_LIST, path, + GIMP_CONFIG_PATH_DIR_LIST, path, GIMP_PARAM_STATIC_STRINGS | GIMP_CONFIG_PARAM_RESTART); g_free (path); @@ -217,20 +217,20 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass) GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_GRADIENT_PATH_WRITABLE, "gradient-path-writable", GRADIENT_PATH_WRITABLE_BLURB, - GIMP_CONFIG_PATH_DIR_LIST, path, + GIMP_CONFIG_PATH_DIR_LIST, path, GIMP_PARAM_STATIC_STRINGS | GIMP_CONFIG_PARAM_RESTART); g_free (path); path = gimp_config_build_data_path ("fonts"); GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_FONT_PATH, "font-path", FONT_PATH_BLURB, - GIMP_CONFIG_PATH_DIR_LIST, path, + GIMP_CONFIG_PATH_DIR_LIST, path, GIMP_PARAM_STATIC_STRINGS | GIMP_CONFIG_PARAM_CONFIRM); g_free (path); GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_FONT_PATH_WRITABLE, "font-path-writable", NULL, - GIMP_CONFIG_PATH_DIR_LIST, NULL, + GIMP_CONFIG_PATH_DIR_LIST, NULL, GIMP_PARAM_STATIC_STRINGS | GIMP_CONFIG_PARAM_IGNORE); GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_DEFAULT_BRUSH, @@ -308,7 +308,7 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass) GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_PLUGINRC_PATH, "pluginrc-path", PLUGINRC_PATH_BLURB, - GIMP_CONFIG_PATH_FILE, + GIMP_CONFIG_PATH_FILE, "${gimp_dir}" G_DIR_SEPARATOR_S "pluginrc", GIMP_PARAM_STATIC_STRINGS | GIMP_CONFIG_PARAM_RESTART); @@ -347,9 +347,9 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass) GIMP_PARAM_STATIC_STRINGS | GIMP_CONFIG_PARAM_AGGREGATE); GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SAVE_DOCUMENT_HISTORY, - "save-document-history", + "save-document-history", SAVE_DOCUMENT_HISTORY_BLURB, - TRUE, + TRUE, GIMP_PARAM_STATIC_STRINGS); } diff --git a/app/config/gimpdisplayconfig.c b/app/config/gimpdisplayconfig.c index 68b9502de6..723c5a4188 100644 --- a/app/config/gimpdisplayconfig.c +++ b/app/config/gimpdisplayconfig.c @@ -261,9 +261,9 @@ gimp_display_config_finalize (GObject *object) static void gimp_display_config_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { GimpDisplayConfig *display_config = GIMP_DISPLAY_CONFIG (object); @@ -354,9 +354,9 @@ gimp_display_config_set_property (GObject *object, static void gimp_display_config_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { GimpDisplayConfig *display_config = GIMP_DISPLAY_CONFIG (object); diff --git a/app/config/gimpguiconfig.c b/app/config/gimpguiconfig.c index baa21f057e..b348a3d7f3 100644 --- a/app/config/gimpguiconfig.c +++ b/app/config/gimpguiconfig.c @@ -200,7 +200,7 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass) path = gimp_config_build_data_path ("themes"); GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_THEME_PATH, "theme-path", THEME_PATH_BLURB, - GIMP_CONFIG_PATH_DIR_LIST, path, + GIMP_CONFIG_PATH_DIR_LIST, path, GIMP_PARAM_STATIC_STRINGS | GIMP_CONFIG_PARAM_RESTART); g_free (path); diff --git a/app/config/gimppluginconfig.c b/app/config/gimppluginconfig.c index 42cdaafe99..f080b3ffd6 100644 --- a/app/config/gimppluginconfig.c +++ b/app/config/gimppluginconfig.c @@ -74,7 +74,7 @@ gimp_plugin_config_class_init (GimpPluginConfigClass *klass) PROP_FRACTALEXPLORER_PATH, "fractalexplorer-path", FRACTALEXPLORER_PATH_BLURB, - GIMP_CONFIG_PATH_DIR_LIST, path, + GIMP_CONFIG_PATH_DIR_LIST, path, GIMP_PARAM_STATIC_STRINGS); g_free (path); @@ -82,7 +82,7 @@ gimp_plugin_config_class_init (GimpPluginConfigClass *klass) GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_GFIG_PATH, "gfig-path", GFIG_PATH_BLURB, - GIMP_CONFIG_PATH_DIR_LIST, path, + GIMP_CONFIG_PATH_DIR_LIST, path, GIMP_PARAM_STATIC_STRINGS); g_free (path); @@ -90,7 +90,7 @@ gimp_plugin_config_class_init (GimpPluginConfigClass *klass) GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_GFLARE_PATH, "gflare-path", GFLARE_PATH_BLURB, - GIMP_CONFIG_PATH_DIR_LIST, path, + GIMP_CONFIG_PATH_DIR_LIST, path, GIMP_PARAM_STATIC_STRINGS); g_free (path); @@ -99,7 +99,7 @@ gimp_plugin_config_class_init (GimpPluginConfigClass *klass) PROP_GIMPRESSIONIST_PATH, "gimpressionist-path", GIMPRESSIONIST_PATH_BLURB, - GIMP_CONFIG_PATH_DIR_LIST, path, + GIMP_CONFIG_PATH_DIR_LIST, path, GIMP_PARAM_STATIC_STRINGS); g_free (path); @@ -108,7 +108,7 @@ gimp_plugin_config_class_init (GimpPluginConfigClass *klass) PROP_SCRIPT_FU_PATH, "script-fu-path", SCRIPT_FU_PATH_BLURB, - GIMP_CONFIG_PATH_DIR_LIST, path, + GIMP_CONFIG_PATH_DIR_LIST, path, GIMP_PARAM_STATIC_STRINGS); g_free (path); } diff --git a/app/config/gimprc-deserialize.c b/app/config/gimprc-deserialize.c index 00ceaacf16..555e80c829 100644 --- a/app/config/gimprc-deserialize.c +++ b/app/config/gimprc-deserialize.c @@ -51,8 +51,8 @@ gimp_rc_deserialize (GimpConfig *config, guint i; guint scope_id; guint old_scope_id; - GTokenType token; - GTokenType next; + GTokenType token; + GTokenType next; g_return_val_if_fail (GIMP_IS_CONFIG (config), FALSE); @@ -132,7 +132,7 @@ gimp_rc_deserialize (GimpConfig *config, if (token == G_TOKEN_STRING && next == G_TOKEN_IDENTIFIER) { g_scanner_unexp_token (scanner, G_TOKEN_SYMBOL, NULL, NULL, NULL, - _("fatal parse error"), TRUE); + _("fatal parse error"), TRUE); return FALSE; } diff --git a/app/config/gimprc.c b/app/config/gimprc.c index 6b87e28981..fd940e4ed5 100644 --- a/app/config/gimprc.c +++ b/app/config/gimprc.c @@ -87,23 +87,23 @@ gimp_rc_class_init (GimpRcClass *klass) object_class->get_property = gimp_rc_get_property; g_object_class_install_property (object_class, PROP_VERBOSE, - g_param_spec_boolean ("verbose", - NULL, NULL, - FALSE, - G_PARAM_READWRITE | - G_PARAM_CONSTRUCT)); + g_param_spec_boolean ("verbose", + NULL, NULL, + FALSE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT)); g_object_class_install_property (object_class, PROP_SYSTEM_GIMPRC, - g_param_spec_string ("system-gimprc", + g_param_spec_string ("system-gimprc", NULL, NULL, - NULL, + NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property (object_class, PROP_USER_GIMPRC, - g_param_spec_string ("user-gimprc", + g_param_spec_string ("user-gimprc", NULL, NULL, - NULL, + NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); } @@ -257,23 +257,23 @@ gimp_rc_load (GimpRc *rc) if (rc->verbose) g_print (_("Parsing '%s'\n"), - gimp_filename_to_utf8 (rc->system_gimprc)); + gimp_filename_to_utf8 (rc->system_gimprc)); if (! gimp_config_deserialize_file (GIMP_CONFIG (rc), - rc->system_gimprc, NULL, &error)) + rc->system_gimprc, NULL, &error)) { if (error->code != GIMP_CONFIG_ERROR_OPEN_ENOENT) - g_message (error->message); + g_message (error->message); g_clear_error (&error); } if (rc->verbose) g_print (_("Parsing '%s'\n"), - gimp_filename_to_utf8 (rc->user_gimprc)); + gimp_filename_to_utf8 (rc->user_gimprc)); if (! gimp_config_deserialize_file (GIMP_CONFIG (rc), - rc->user_gimprc, NULL, &error)) + rc->user_gimprc, NULL, &error)) { if (error->code != GIMP_CONFIG_ERROR_OPEN_ENOENT) { @@ -510,18 +510,18 @@ gimp_rc_save (GimpRc *rc) global = g_object_new (GIMP_TYPE_RC, NULL); gimp_config_deserialize_file (GIMP_CONFIG (global), - rc->system_gimprc, NULL, NULL); + rc->system_gimprc, NULL, NULL); header = g_strconcat (top, rc->system_gimprc, bottom, NULL); if (rc->verbose) g_print (_("Saving '%s'\n"), - gimp_filename_to_utf8 (rc->user_gimprc)); + gimp_filename_to_utf8 (rc->user_gimprc)); if (! gimp_config_serialize_to_file (GIMP_CONFIG (rc), - rc->user_gimprc, - header, footer, global, - &error)) + rc->user_gimprc, + header, footer, global, + &error)) { g_message (error->message); g_error_free (error); diff --git a/app/config/test-config.c b/app/config/test-config.c index c6852c3e6b..00ec6f366a 100644 --- a/app/config/test-config.c +++ b/app/config/test-config.c @@ -83,9 +83,9 @@ main (int argc, g_type_name (G_TYPE_FROM_INSTANCE (grid)), filename); if (! gimp_config_serialize_to_file (grid, - filename, - "foorc", "end of foorc", - NULL, &error)) + filename, + "foorc", "end of foorc", + NULL, &error)) { g_print ("%s\n", error->message); return EXIT_FAILURE; diff --git a/app/core/core-types.h b/app/core/core-types.h index 5606488716..54edde1b06 100644 --- a/app/core/core-types.h +++ b/app/core/core-types.h @@ -87,7 +87,7 @@ typedef struct _GimpToolInfo GimpToolInfo; typedef struct _GimpDataFactory GimpDataFactory; typedef struct _GimpData GimpData; -typedef struct _GimpBrush GimpBrush; +typedef struct _GimpBrush GimpBrush; typedef struct _GimpBrushGenerated GimpBrushGenerated; typedef struct _GimpBrushPipe GimpBrushPipe; typedef struct _GimpGradient GimpGradient; diff --git a/app/core/gimp-documents.c b/app/core/gimp-documents.c index 4fe156826f..41b5302da0 100644 --- a/app/core/gimp-documents.c +++ b/app/core/gimp-documents.c @@ -49,9 +49,9 @@ gimp_documents_load (Gimp *gimp) g_print ("Parsing '%s'\n", gimp_filename_to_utf8 (filename)); if (! gimp_config_deserialize_file (GIMP_CONFIG (gimp->documents), - filename, - GINT_TO_POINTER (gimp->config->thumbnail_size), - &error)) + filename, + GINT_TO_POINTER (gimp->config->thumbnail_size), + &error)) { if (error->code != GIMP_CONFIG_ERROR_OPEN_ENOENT) g_message (error->message); @@ -83,9 +83,9 @@ gimp_documents_save (Gimp *gimp) g_print ("Writing '%s'\n", gimp_filename_to_utf8 (filename)); if (! gimp_config_serialize_to_file (GIMP_CONFIG (gimp->documents), - filename, - header, footer, NULL, - &error)) + filename, + header, footer, NULL, + &error)) { g_message (error->message); g_error_free (error); diff --git a/app/core/gimp-edit.c b/app/core/gimp-edit.c index 70b0417410..d3c95aa90b 100644 --- a/app/core/gimp-edit.c +++ b/app/core/gimp-edit.c @@ -73,7 +73,7 @@ static gboolean gimp_edit_fill_internal (GimpImage *image, const GimpBuffer * gimp_edit_cut (GimpImage *image, - GimpDrawable *drawable, + GimpDrawable *drawable, GimpContext *context) { GimpBuffer *buffer; @@ -98,7 +98,7 @@ gimp_edit_cut (GimpImage *image, const GimpBuffer * gimp_edit_copy (GimpImage *image, - GimpDrawable *drawable, + GimpDrawable *drawable, GimpContext *context) { GimpBuffer *buffer; @@ -145,9 +145,9 @@ gimp_edit_copy_visible (GimpImage *image, GimpLayer * gimp_edit_paste (GimpImage *image, - GimpDrawable *drawable, - GimpBuffer *paste, - gboolean paste_into, + GimpDrawable *drawable, + GimpBuffer *paste, + gboolean paste_into, gint viewport_x, gint viewport_y, gint viewport_width, @@ -273,8 +273,8 @@ gimp_edit_paste (GimpImage *image, GimpImage * gimp_edit_paste_as_new (Gimp *gimp, - GimpImage *invoke, - GimpBuffer *paste) + GimpImage *invoke, + GimpBuffer *paste) { GimpImage *image; GimpLayer *layer; @@ -297,23 +297,23 @@ gimp_edit_paste_as_new (Gimp *gimp, /* create a new image (always of type GIMP_RGB) */ image = gimp_create_image (gimp, - gimp_buffer_get_width (paste), + gimp_buffer_get_width (paste), gimp_buffer_get_height (paste), - GIMP_IMAGE_TYPE_BASE_TYPE (type), - TRUE); + GIMP_IMAGE_TYPE_BASE_TYPE (type), + TRUE); gimp_image_undo_disable (image); if (invoke) { gimp_image_set_resolution (image, - invoke->xresolution, invoke->yresolution); + invoke->xresolution, invoke->yresolution); gimp_image_set_unit (image, gimp_image_get_unit (invoke)); } layer = gimp_layer_new_from_tiles (paste->tiles, image, type, - _("Pasted Layer"), - GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE); + _("Pasted Layer"), + GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE); if (! layer) { @@ -411,7 +411,7 @@ gimp_edit_named_copy_visible (GimpImage *image, gboolean gimp_edit_clear (GimpImage *image, - GimpDrawable *drawable, + GimpDrawable *drawable, GimpContext *context) { g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); @@ -427,9 +427,9 @@ gimp_edit_clear (GimpImage *image, gboolean gimp_edit_fill (GimpImage *image, - GimpDrawable *drawable, + GimpDrawable *drawable, GimpContext *context, - GimpFillType fill_type) + GimpFillType fill_type) { const gchar *undo_desc; @@ -517,7 +517,7 @@ gimp_edit_extract_visible (GimpImage *image, if ((x1 == x2) || (y1 == y2)) { g_message (_("Unable to cut or copy because the " - "selected region is empty.")); + "selected region is empty.")); return NULL; } @@ -530,7 +530,7 @@ gimp_edit_extract_visible (GimpImage *image, tile_manager_set_offsets (tiles, x1, y1); pixel_region_init (&srcPR, gimp_pickable_get_tiles (pickable), - x1, y1, + x1, y1, x2 - x1, y2 - y1, FALSE); pixel_region_init (&destPR, tiles, diff --git a/app/core/gimp-gui.c b/app/core/gimp-gui.c index ce52c57c7b..2523862f8f 100644 --- a/app/core/gimp-gui.c +++ b/app/core/gimp-gui.c @@ -124,8 +124,8 @@ gimp_set_busy_until_idle (Gimp *gimp) gimp_set_busy (gimp); gimp->busy_idle_id = g_idle_add_full (G_PRIORITY_HIGH, - gimp_idle_unset_busy, gimp, - NULL); + gimp_idle_unset_busy, gimp, + NULL); } } diff --git a/app/core/gimp-modules.c b/app/core/gimp-modules.c index 4c9aafea73..5e66d455ad 100644 --- a/app/core/gimp-modules.c +++ b/app/core/gimp-modules.c @@ -158,7 +158,7 @@ gimp_modules_load (Gimp *gimp) static void add_to_inhibit_string (gpointer data, - gpointer user_data) + gpointer user_data) { GimpModule *module = data; GString *str = user_data; diff --git a/app/core/gimp-parasites.c b/app/core/gimp-parasites.c index ab3717be13..0183967e44 100644 --- a/app/core/gimp-parasites.c +++ b/app/core/gimp-parasites.c @@ -31,7 +31,7 @@ void gimp_parasite_attach (Gimp *gimp, - const GimpParasite *parasite) + const GimpParasite *parasite) { g_return_if_fail (GIMP_IS_GIMP (gimp)); g_return_if_fail (parasite != NULL); @@ -41,7 +41,7 @@ gimp_parasite_attach (Gimp *gimp, void gimp_parasite_detach (Gimp *gimp, - const gchar *name) + const gchar *name) { g_return_if_fail (GIMP_IS_GIMP (gimp)); g_return_if_fail (name != NULL); @@ -51,7 +51,7 @@ gimp_parasite_detach (Gimp *gimp, const GimpParasite * gimp_parasite_find (Gimp *gimp, - const gchar *name) + const gchar *name) { g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); g_return_val_if_fail (name != NULL, NULL); @@ -61,15 +61,15 @@ gimp_parasite_find (Gimp *gimp, static void list_func (const gchar *key, - GimpParasite *parasite, - gchar ***current) + GimpParasite *parasite, + gchar ***current) { *(*current)++ = g_strdup (key); } gchar ** gimp_parasite_list (Gimp *gimp, - gint *count) + gint *count) { gchar **list; gchar **current; @@ -114,7 +114,7 @@ gimp_parasiterc_load (Gimp *gimp) g_print ("Parsing '%s'\n", gimp_filename_to_utf8 (filename)); if (! gimp_config_deserialize_file (GIMP_CONFIG (gimp->parasites), - filename, NULL, &error)) + filename, NULL, &error)) { if (error->code != GIMP_CONFIG_ERROR_OPEN_ENOENT) g_message (error->message); @@ -146,9 +146,9 @@ gimp_parasiterc_save (Gimp *gimp) g_print ("Writing '%s'\n", gimp_filename_to_utf8 (filename)); if (! gimp_config_serialize_to_file (GIMP_CONFIG (gimp->parasites), - filename, - header, footer, NULL, - &error)) + filename, + header, footer, NULL, + &error)) { g_message (error->message); g_error_free (error); diff --git a/app/core/gimp-templates.c b/app/core/gimp-templates.c index 4bf9ea971d..9ef2919f6c 100644 --- a/app/core/gimp-templates.c +++ b/app/core/gimp-templates.c @@ -50,7 +50,7 @@ gimp_templates_load (Gimp *gimp) g_print ("Parsing '%s'\n", gimp_filename_to_utf8 (filename)); if (!gimp_config_deserialize_file (GIMP_CONFIG (gimp->templates), - filename, NULL, &error)) + filename, NULL, &error)) { if (error->code == GIMP_CONFIG_ERROR_OPEN_ENOENT) { @@ -101,9 +101,9 @@ gimp_templates_save (Gimp *gimp) g_print ("Writing '%s'\n", gimp_filename_to_utf8 (filename)); if (! gimp_config_serialize_to_file (GIMP_CONFIG (gimp->templates), - filename, - header, footer, NULL, - &error)) + filename, + header, footer, NULL, + &error)) { g_message (error->message); g_error_free (error); diff --git a/app/core/gimp-transform-region.c b/app/core/gimp-transform-region.c index aa4cf1fcd0..0ee7a8b70a 100644 --- a/app/core/gimp-transform-region.c +++ b/app/core/gimp-transform-region.c @@ -908,7 +908,7 @@ gimp_drawable_transform_affine (GimpDrawable *drawable, /* Start a transform undo group */ gimp_image_undo_group_start (image, - GIMP_UNDO_GROUP_TRANSFORM, _("Transform")); + GIMP_UNDO_GROUP_TRANSFORM, _("Transform")); /* Cut/Copy from the specified drawable */ orig_tiles = gimp_drawable_transform_cut (drawable, context, &new_layer); @@ -1763,7 +1763,7 @@ sample_lanczos (PixelSurround *surround, gdouble lu[LANCZOS_WIDTH2]; /* Lanczos sample value */ gdouble lv[LANCZOS_WIDTH2]; /* Lanczos sample value */ gdouble lusum, lvsum, weight; /* Lanczos weighting vars */ - gint i,j,row, byte; /* loop vars to fill source window */ + gint i,j,row, byte; /* loop vars to fill source window */ gint du,dv; guchar *data; diff --git a/app/core/gimp-units.c b/app/core/gimp-units.c index 30693893a8..ce88ac4f16 100644 --- a/app/core/gimp-units.c +++ b/app/core/gimp-units.c @@ -189,15 +189,15 @@ gimp_unitrc_save (Gimp *gimp) writer = gimp_config_writer_new_file (filename, - TRUE, - "GIMP units\n\n" - "This file contains the user unit database. " - "You can edit this list with the unit " - "editor. You are not supposed to edit it " - "manually, but of course you can do.\n" - "This file will be entirely rewritten every " - "time you quit the gimp.", - NULL); + TRUE, + "GIMP units\n\n" + "This file contains the user unit database. " + "You can edit this list with the unit " + "editor. You are not supposed to edit it " + "manually, but of course you can do.\n" + "This file will be entirely rewritten every " + "time you quit the gimp.", + NULL); g_free (filename); diff --git a/app/core/gimp-utils.c b/app/core/gimp-utils.c index 6a0ef7a152..12112a0ccc 100644 --- a/app/core/gimp-utils.c +++ b/app/core/gimp-utils.c @@ -180,15 +180,15 @@ gimp_get_default_language (const gchar *category) { p = getenv ("LANG"); if (p != NULL) - lang = g_strdup (p); + lang = g_strdup (p); else - { - p = getenv (category); - if (p != NULL) - lang = g_strdup (p); - else - lang = g_win32_getlocale (); - } + { + p = getenv (category); + if (p != NULL) + lang = g_strdup (p); + else + lang = g_win32_getlocale (); + } } #else diff --git a/app/core/gimp.h b/app/core/gimp.h index c4a49b13f4..df0c5fb399 100644 --- a/app/core/gimp.h +++ b/app/core/gimp.h @@ -182,17 +182,17 @@ void gimp_set_last_plug_in (Gimp *gimp, GimpPlugInProcedure *procedure); GimpImage * gimp_create_image (Gimp *gimp, - gint width, - gint height, - GimpImageBaseType type, - gboolean attach_comment); + gint width, + gint height, + GimpImageBaseType type, + gboolean attach_comment); void gimp_set_default_context (Gimp *gimp, - GimpContext *context); + GimpContext *context); GimpContext * gimp_get_default_context (Gimp *gimp); void gimp_set_user_context (Gimp *gimp, - GimpContext *context); + GimpContext *context); GimpContext * gimp_get_user_context (Gimp *gimp); diff --git a/app/core/gimparea.c b/app/core/gimparea.c index 40b7fc917f..c3987258b6 100644 --- a/app/core/gimparea.c +++ b/app/core/gimparea.c @@ -75,14 +75,14 @@ gimp_area_list_process (GSList *list, new_list = g_slist_prepend (new_list, ga2); } else - { - area->x1 = MIN (area->x1, ga2->x1); - area->y1 = MIN (area->y1, ga2->y1); - area->x2 = MAX (area->x2, ga2->x2); - area->y2 = MAX (area->y2, ga2->y2); + { + area->x1 = MIN (area->x1, ga2->x1); + area->y1 = MIN (area->y1, ga2->y1); + area->x2 = MAX (area->x2, ga2->x2); + area->y2 = MAX (area->y2, ga2->y2); - g_free (ga2); - } + g_free (ga2); + } } if (list) diff --git a/app/core/gimpbrushpipe-load.c b/app/core/gimpbrushpipe-load.c index a275dcaf7f..ca30855627 100644 --- a/app/core/gimpbrushpipe-load.c +++ b/app/core/gimpbrushpipe-load.c @@ -132,8 +132,8 @@ gimp_brush_pipe_finalize (GObject *object) gint i; for (i = 0; i < pipe->nbrushes; i++) - if (pipe->brushes[i]) - g_object_unref (pipe->brushes[i]); + if (pipe->brushes[i]) + g_object_unref (pipe->brushes[i]); g_free (pipe->brushes); pipe->brushes = NULL; @@ -387,31 +387,31 @@ gimp_brush_pipe_load (const gchar *filename, /* placement is not used at all ?? */ if (params.free_placement_string) - g_free (params.placement); + g_free (params.placement); for (i = 0; i < pipe->dimension; i++) - { - pipe->rank[i] = MAX (1, params.rank[i]); - if (strcmp (params.selection[i], "incremental") == 0) - pipe->select[i] = PIPE_SELECT_INCREMENTAL; - else if (strcmp (params.selection[i], "angular") == 0) - pipe->select[i] = PIPE_SELECT_ANGULAR; - else if (strcmp (params.selection[i], "velocity") == 0) - pipe->select[i] = PIPE_SELECT_VELOCITY; - else if (strcmp (params.selection[i], "random") == 0) - pipe->select[i] = PIPE_SELECT_RANDOM; - else if (strcmp (params.selection[i], "pressure") == 0) - pipe->select[i] = PIPE_SELECT_PRESSURE; - else if (strcmp (params.selection[i], "xtilt") == 0) - pipe->select[i] = PIPE_SELECT_TILT_X; - else if (strcmp (params.selection[i], "ytilt") == 0) - pipe->select[i] = PIPE_SELECT_TILT_Y; - else - pipe->select[i] = PIPE_SELECT_CONSTANT; - if (params.free_selection_string) - g_free (params.selection[i]); - pipe->index[i] = 0; - } + { + pipe->rank[i] = MAX (1, params.rank[i]); + if (strcmp (params.selection[i], "incremental") == 0) + pipe->select[i] = PIPE_SELECT_INCREMENTAL; + else if (strcmp (params.selection[i], "angular") == 0) + pipe->select[i] = PIPE_SELECT_ANGULAR; + else if (strcmp (params.selection[i], "velocity") == 0) + pipe->select[i] = PIPE_SELECT_VELOCITY; + else if (strcmp (params.selection[i], "random") == 0) + pipe->select[i] = PIPE_SELECT_RANDOM; + else if (strcmp (params.selection[i], "pressure") == 0) + pipe->select[i] = PIPE_SELECT_PRESSURE; + else if (strcmp (params.selection[i], "xtilt") == 0) + pipe->select[i] = PIPE_SELECT_TILT_X; + else if (strcmp (params.selection[i], "ytilt") == 0) + pipe->select[i] = PIPE_SELECT_TILT_Y; + else + pipe->select[i] = PIPE_SELECT_CONSTANT; + if (params.free_selection_string) + g_free (params.selection[i]); + pipe->index[i] = 0; + } } else { @@ -426,16 +426,16 @@ gimp_brush_pipe_load (const gchar *filename, g_string_free (buffer, TRUE); - totalcells = 1; /* Not all necessarily present, maybe */ + totalcells = 1; /* Not all necessarily present, maybe */ for (i = 0; i < pipe->dimension; i++) totalcells *= pipe->rank[i]; pipe->stride = g_new0 (gint, pipe->dimension); for (i = 0; i < pipe->dimension; i++) { if (i == 0) - pipe->stride[i] = totalcells / pipe->rank[i]; + pipe->stride[i] = totalcells / pipe->rank[i]; else - pipe->stride[i] = pipe->stride[i-1] / pipe->rank[i]; + pipe->stride[i] = pipe->stride[i-1] / pipe->rank[i]; } g_assert (pipe->stride[pipe->dimension-1] == 1); @@ -446,20 +446,20 @@ gimp_brush_pipe_load (const gchar *filename, pipe->brushes[pipe->nbrushes] = gimp_brush_load_brush (fd, filename, NULL); if (pipe->brushes[pipe->nbrushes]) - { - gimp_object_set_name (GIMP_OBJECT (pipe->brushes[pipe->nbrushes]), - NULL); - } + { + gimp_object_set_name (GIMP_OBJECT (pipe->brushes[pipe->nbrushes]), + NULL); + } else - { - g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ, + { + g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ, _("Fatal parse error in brush file '%s': " "File is corrupt."), gimp_filename_to_utf8 (filename)); - close (fd); - g_object_unref (pipe); - return NULL; - } + close (fd); + g_object_unref (pipe); + return NULL; + } pipe->nbrushes++; } diff --git a/app/core/gimpbrushpipe.c b/app/core/gimpbrushpipe.c index a275dcaf7f..ca30855627 100644 --- a/app/core/gimpbrushpipe.c +++ b/app/core/gimpbrushpipe.c @@ -132,8 +132,8 @@ gimp_brush_pipe_finalize (GObject *object) gint i; for (i = 0; i < pipe->nbrushes; i++) - if (pipe->brushes[i]) - g_object_unref (pipe->brushes[i]); + if (pipe->brushes[i]) + g_object_unref (pipe->brushes[i]); g_free (pipe->brushes); pipe->brushes = NULL; @@ -387,31 +387,31 @@ gimp_brush_pipe_load (const gchar *filename, /* placement is not used at all ?? */ if (params.free_placement_string) - g_free (params.placement); + g_free (params.placement); for (i = 0; i < pipe->dimension; i++) - { - pipe->rank[i] = MAX (1, params.rank[i]); - if (strcmp (params.selection[i], "incremental") == 0) - pipe->select[i] = PIPE_SELECT_INCREMENTAL; - else if (strcmp (params.selection[i], "angular") == 0) - pipe->select[i] = PIPE_SELECT_ANGULAR; - else if (strcmp (params.selection[i], "velocity") == 0) - pipe->select[i] = PIPE_SELECT_VELOCITY; - else if (strcmp (params.selection[i], "random") == 0) - pipe->select[i] = PIPE_SELECT_RANDOM; - else if (strcmp (params.selection[i], "pressure") == 0) - pipe->select[i] = PIPE_SELECT_PRESSURE; - else if (strcmp (params.selection[i], "xtilt") == 0) - pipe->select[i] = PIPE_SELECT_TILT_X; - else if (strcmp (params.selection[i], "ytilt") == 0) - pipe->select[i] = PIPE_SELECT_TILT_Y; - else - pipe->select[i] = PIPE_SELECT_CONSTANT; - if (params.free_selection_string) - g_free (params.selection[i]); - pipe->index[i] = 0; - } + { + pipe->rank[i] = MAX (1, params.rank[i]); + if (strcmp (params.selection[i], "incremental") == 0) + pipe->select[i] = PIPE_SELECT_INCREMENTAL; + else if (strcmp (params.selection[i], "angular") == 0) + pipe->select[i] = PIPE_SELECT_ANGULAR; + else if (strcmp (params.selection[i], "velocity") == 0) + pipe->select[i] = PIPE_SELECT_VELOCITY; + else if (strcmp (params.selection[i], "random") == 0) + pipe->select[i] = PIPE_SELECT_RANDOM; + else if (strcmp (params.selection[i], "pressure") == 0) + pipe->select[i] = PIPE_SELECT_PRESSURE; + else if (strcmp (params.selection[i], "xtilt") == 0) + pipe->select[i] = PIPE_SELECT_TILT_X; + else if (strcmp (params.selection[i], "ytilt") == 0) + pipe->select[i] = PIPE_SELECT_TILT_Y; + else + pipe->select[i] = PIPE_SELECT_CONSTANT; + if (params.free_selection_string) + g_free (params.selection[i]); + pipe->index[i] = 0; + } } else { @@ -426,16 +426,16 @@ gimp_brush_pipe_load (const gchar *filename, g_string_free (buffer, TRUE); - totalcells = 1; /* Not all necessarily present, maybe */ + totalcells = 1; /* Not all necessarily present, maybe */ for (i = 0; i < pipe->dimension; i++) totalcells *= pipe->rank[i]; pipe->stride = g_new0 (gint, pipe->dimension); for (i = 0; i < pipe->dimension; i++) { if (i == 0) - pipe->stride[i] = totalcells / pipe->rank[i]; + pipe->stride[i] = totalcells / pipe->rank[i]; else - pipe->stride[i] = pipe->stride[i-1] / pipe->rank[i]; + pipe->stride[i] = pipe->stride[i-1] / pipe->rank[i]; } g_assert (pipe->stride[pipe->dimension-1] == 1); @@ -446,20 +446,20 @@ gimp_brush_pipe_load (const gchar *filename, pipe->brushes[pipe->nbrushes] = gimp_brush_load_brush (fd, filename, NULL); if (pipe->brushes[pipe->nbrushes]) - { - gimp_object_set_name (GIMP_OBJECT (pipe->brushes[pipe->nbrushes]), - NULL); - } + { + gimp_object_set_name (GIMP_OBJECT (pipe->brushes[pipe->nbrushes]), + NULL); + } else - { - g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ, + { + g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ, _("Fatal parse error in brush file '%s': " "File is corrupt."), gimp_filename_to_utf8 (filename)); - close (fd); - g_object_unref (pipe); - return NULL; - } + close (fd); + g_object_unref (pipe); + return NULL; + } pipe->nbrushes++; } diff --git a/app/core/gimpbrushpipe.h b/app/core/gimpbrushpipe.h index 73b7fdd0b0..8ad23fd3a6 100644 --- a/app/core/gimpbrushpipe.h +++ b/app/core/gimpbrushpipe.h @@ -55,14 +55,14 @@ struct _GimpBrushPipe GimpBrush parent_instance; gint dimension; - gint *rank; /* Size in each dimension */ - gint *stride; /* Aux for indexing */ - PipeSelectModes *select; /* One mode per dimension */ + gint *rank; /* Size in each dimension */ + gint *stride; /* Aux for indexing */ + PipeSelectModes *select; /* One mode per dimension */ - gint *index; /* Current index for incremental dimensions */ + gint *index; /* Current index for incremental dimensions */ - gint nbrushes; /* Might be less than the product of the - * ranks in some odd special case */ + gint nbrushes; /* Might be less than the product of the + * ranks in some odd special case */ GimpBrush **brushes; GimpBrush *current; /* Currently selected brush */ }; diff --git a/app/core/gimpchannel-combine.c b/app/core/gimpchannel-combine.c index d1d810d56f..d1aba38ea0 100644 --- a/app/core/gimpchannel-combine.c +++ b/app/core/gimpchannel-combine.c @@ -34,10 +34,10 @@ void gimp_channel_add_segment (GimpChannel *mask, - gint x, - gint y, - gint width, - gint value) + gint x, + gint y, + gint width, + gint value) { PixelRegion maskPR; guchar *data; @@ -59,7 +59,7 @@ gimp_channel_add_segment (GimpChannel *mask, return; pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, - x, y, width, 1, TRUE); + x, y, width, 1, TRUE); for (pr = pixel_regions_register (1, &maskPR); pr != NULL; @@ -68,21 +68,21 @@ gimp_channel_add_segment (GimpChannel *mask, data = maskPR.data; width = maskPR.w; while (width--) - { - val = *data + value; - if (val > 255) - val = 255; - *data++ = val; - } + { + val = *data + value; + if (val > 255) + val = 255; + *data++ = val; + } } } void gimp_channel_sub_segment (GimpChannel *mask, - gint x, - gint y, - gint width, - gint value) + gint x, + gint y, + gint width, + gint value) { PixelRegion maskPR; guchar *data; @@ -114,22 +114,22 @@ gimp_channel_sub_segment (GimpChannel *mask, data = maskPR.data; width = maskPR.w; while (width--) - { - val = *data - value; - if (val < 0) - val = 0; - *data++ = val; - } + { + val = *data - value; + if (val < 0) + val = 0; + *data++ = val; + } } } void gimp_channel_combine_rect (GimpChannel *mask, - GimpChannelOps op, - gint x, - gint y, - gint w, - gint h) + GimpChannelOps op, + gint x, + gint y, + gint w, + gint h) { PixelRegion maskPR; guchar color; @@ -144,7 +144,7 @@ gimp_channel_combine_rect (GimpChannel *mask, return; pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, - x, y, w, h, TRUE); + x, y, w, h, TRUE); if (op == GIMP_CHANNEL_OP_ADD || op == GIMP_CHANNEL_OP_REPLACE) color = OPAQUE_OPACITY; @@ -157,13 +157,13 @@ gimp_channel_combine_rect (GimpChannel *mask, if (mask->bounds_known && (op == GIMP_CHANNEL_OP_ADD) && !mask->empty) { if (x < mask->x1) - mask->x1 = x; + mask->x1 = x; if (y < mask->y1) - mask->y1 = y; + mask->y1 = y; if ((x + w) > mask->x2) - mask->x2 = (x + w); + mask->x2 = (x + w); if ((y + h) > mask->y2) - mask->y2 = (y + h); + mask->y2 = (y + h); } else if (op == GIMP_CHANNEL_OP_REPLACE || mask->empty) { @@ -368,20 +368,20 @@ gimp_channel_combine_ellipse (GimpChannel *mask, } } } - } + } } /* determine new boundary */ if (mask->bounds_known && (op == GIMP_CHANNEL_OP_ADD) && !mask->empty) { if (x < mask->x1) - mask->x1 = x; + mask->x1 = x; if (y < mask->y1) - mask->y1 = y; + mask->y1 = y; if ((x + w) > mask->x2) - mask->x2 = (x + w); + mask->x2 = (x + w); if ((y + h) > mask->y2) - mask->y2 = (y + h); + mask->y2 = (y + h); } else if (op == GIMP_CHANNEL_OP_REPLACE || mask->empty) { @@ -406,8 +406,8 @@ gimp_channel_combine_ellipse (GimpChannel *mask, static void gimp_channel_combine_sub_region_add (gpointer unused, - PixelRegion *srcPR, - PixelRegion *destPR) + PixelRegion *srcPR, + PixelRegion *destPR) { guchar *src, *dest; gint x, y, val; @@ -418,13 +418,13 @@ gimp_channel_combine_sub_region_add (gpointer unused, for (y = 0; y < srcPR->h; y++) { for (x = 0; x < srcPR->w; x++) - { - val = dest[x] + src[x]; - if (val > 255) - dest[x] = 255; - else - dest[x] = val; - } + { + val = dest[x] + src[x]; + if (val > 255) + dest[x] = 255; + else + dest[x] = val; + } src += srcPR->rowstride; dest += destPR->rowstride; } @@ -432,8 +432,8 @@ gimp_channel_combine_sub_region_add (gpointer unused, static void gimp_channel_combine_sub_region_sub (gpointer unused, - PixelRegion *srcPR, - PixelRegion *destPR) + PixelRegion *srcPR, + PixelRegion *destPR) { guchar *src, *dest; gint x, y; @@ -444,12 +444,12 @@ gimp_channel_combine_sub_region_sub (gpointer unused, for (y = 0; y < srcPR->h; y++) { for (x = 0; x < srcPR->w; x++) - { - if (src[x] > dest[x]) - dest[x] = 0; - else - dest[x]-= src[x]; - } + { + if (src[x] > dest[x]) + dest[x] = 0; + else + dest[x]-= src[x]; + } src += srcPR->rowstride; dest += destPR->rowstride; } @@ -457,8 +457,8 @@ gimp_channel_combine_sub_region_sub (gpointer unused, static void gimp_channel_combine_sub_region_intersect (gpointer unused, - PixelRegion *srcPR, - PixelRegion *destPR) + PixelRegion *srcPR, + PixelRegion *destPR) { guchar *src, *dest; gint x, y; @@ -469,9 +469,9 @@ gimp_channel_combine_sub_region_intersect (gpointer unused, for (y = 0; y < srcPR->h; y++) { for (x = 0; x < srcPR->w; x++) - { - dest[x] = MIN (dest[x], src[x]); - } + { + dest[x] = MIN (dest[x], src[x]); + } src += srcPR->rowstride; dest += destPR->rowstride; @@ -480,10 +480,10 @@ gimp_channel_combine_sub_region_intersect (gpointer unused, void gimp_channel_combine_mask (GimpChannel *mask, - GimpChannel *add_on, - GimpChannelOps op, - gint off_x, - gint off_y) + GimpChannel *add_on, + GimpChannelOps op, + gint off_x, + gint off_y) { PixelRegion srcPR, destPR; gint x, y, w, h; @@ -501,7 +501,7 @@ gimp_channel_combine_mask (GimpChannel *mask, return; pixel_region_init (&srcPR, GIMP_DRAWABLE (add_on)->tiles, - x - off_x, y - off_y, w, h, FALSE); + x - off_x, y - off_y, w, h, FALSE); pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles, x, y, w, h, TRUE); @@ -510,20 +510,20 @@ gimp_channel_combine_mask (GimpChannel *mask, case GIMP_CHANNEL_OP_ADD: case GIMP_CHANNEL_OP_REPLACE: pixel_regions_process_parallel ((PixelProcessorFunc) - gimp_channel_combine_sub_region_add, - NULL, 2, &srcPR, &destPR); + gimp_channel_combine_sub_region_add, + NULL, 2, &srcPR, &destPR); break; case GIMP_CHANNEL_OP_SUBTRACT: pixel_regions_process_parallel ((PixelProcessorFunc) - gimp_channel_combine_sub_region_sub, - NULL, 2, &srcPR, &destPR); + gimp_channel_combine_sub_region_sub, + NULL, 2, &srcPR, &destPR); break; case GIMP_CHANNEL_OP_INTERSECT: pixel_regions_process_parallel ((PixelProcessorFunc) - gimp_channel_combine_sub_region_intersect, - NULL, 2, &srcPR, &destPR); + gimp_channel_combine_sub_region_intersect, + NULL, 2, &srcPR, &destPR); break; default: diff --git a/app/core/gimpchannel.c b/app/core/gimpchannel.c index c0f64afe44..1177cbebb3 100644 --- a/app/core/gimpchannel.c +++ b/app/core/gimpchannel.c @@ -228,12 +228,12 @@ gimp_channel_class_init (GimpChannelClass *klass) channel_signals[COLOR_CHANGED] = g_signal_new ("color-changed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpChannelClass, color_changed), - NULL, NULL, - gimp_marshal_VOID__VOID, - G_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpChannelClass, color_changed), + NULL, NULL, + gimp_marshal_VOID__VOID, + G_TYPE_NONE, 0); object_class->finalize = gimp_channel_finalize; @@ -826,7 +826,7 @@ gimp_channel_get_opacity_at (GimpPickable *pickable, if (channel->bounds_known) { if (channel->empty) - return 0; + return 0; else if (x < channel->x1 || x >= channel->x2 || y < channel->y1 || y >= channel->y2) return 0; @@ -1323,7 +1323,7 @@ gimp_channel_real_border (GimpChannel *channel, gimp_drawable_invalidate_boundary (GIMP_DRAWABLE (channel)); pixel_region_init (&bPR, GIMP_DRAWABLE (channel)->tiles, x1, y1, - (x2-x1), (y2-y1), TRUE); + (x2-x1), (y2-y1), TRUE); border_region (&bPR, radius_x, radius_y); diff --git a/app/core/gimpcontainer.c b/app/core/gimpcontainer.c index d764966697..24bfdc1739 100644 --- a/app/core/gimpcontainer.c +++ b/app/core/gimpcontainer.c @@ -98,7 +98,7 @@ static gboolean gimp_container_deserialize (GimpConfig *config, gpointer data); static void gimp_container_disconnect_callback (GimpObject *object, - gpointer data); + gpointer data); G_DEFINE_TYPE_WITH_CODE (GimpContainer, gimp_container, GIMP_TYPE_OBJECT, @@ -118,52 +118,52 @@ gimp_container_class_init (GimpContainerClass *klass) container_signals[ADD] = g_signal_new ("add", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpContainerClass, add), - NULL, NULL, - gimp_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, - GIMP_TYPE_OBJECT); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpContainerClass, add), + NULL, NULL, + gimp_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GIMP_TYPE_OBJECT); container_signals[REMOVE] = g_signal_new ("remove", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpContainerClass, remove), - NULL, NULL, - gimp_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, - GIMP_TYPE_OBJECT); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpContainerClass, remove), + NULL, NULL, + gimp_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GIMP_TYPE_OBJECT); container_signals[REORDER] = g_signal_new ("reorder", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpContainerClass, reorder), - NULL, NULL, - gimp_marshal_VOID__OBJECT_INT, - G_TYPE_NONE, 2, - GIMP_TYPE_OBJECT, - G_TYPE_INT); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpContainerClass, reorder), + NULL, NULL, + gimp_marshal_VOID__OBJECT_INT, + G_TYPE_NONE, 2, + GIMP_TYPE_OBJECT, + G_TYPE_INT); container_signals[FREEZE] = g_signal_new ("freeze", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GimpContainerClass, freeze), - NULL, NULL, - gimp_marshal_VOID__VOID, - G_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GimpContainerClass, freeze), + NULL, NULL, + gimp_marshal_VOID__VOID, + G_TYPE_NONE, 0); container_signals[THAW] = g_signal_new ("thaw", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GimpContainerClass, thaw), - NULL, NULL, - gimp_marshal_VOID__VOID, - G_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GimpContainerClass, thaw), + NULL, NULL, + gimp_marshal_VOID__VOID, + G_TYPE_NONE, 0); object_class->dispose = gimp_container_dispose; object_class->set_property = gimp_container_set_property; @@ -185,13 +185,13 @@ gimp_container_class_init (GimpContainerClass *klass) klass->get_child_index = NULL; g_object_class_install_property (object_class, PROP_CHILDREN_TYPE, - g_param_spec_pointer ("children-type", + g_param_spec_pointer ("children-type", NULL, NULL, GIMP_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_POLICY, - g_param_spec_enum ("policy", + g_param_spec_enum ("policy", NULL, NULL, GIMP_TYPE_CONTAINER_POLICY, GIMP_CONTAINER_POLICY_STRONG, @@ -327,7 +327,7 @@ gimp_container_serialize_foreach (GObject *object, return; gimp_config_writer_open (serialize_data->writer, - g_type_name (G_TYPE_FROM_INSTANCE (object))); + g_type_name (G_TYPE_FROM_INSTANCE (object))); name = gimp_object_get_name (GIMP_OBJECT (object)); @@ -483,7 +483,7 @@ gimp_container_deserialize (GimpConfig *config, static void gimp_container_disconnect_callback (GimpObject *object, - gpointer data) + gpointer data) { GimpContainer *container = GIMP_CONTAINER (data); @@ -516,7 +516,7 @@ gimp_container_num_children (const GimpContainer *container) gboolean gimp_container_add (GimpContainer *container, - GimpObject *object) + GimpObject *object) { GimpContainerHandler *handler; GList *list; @@ -525,13 +525,13 @@ gimp_container_add (GimpContainer *container, g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE); g_return_val_if_fail (object != NULL, FALSE); g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (object, - container->children_type), - FALSE); + container->children_type), + FALSE); if (gimp_container_have (container, object)) { g_warning ("%s: container %p already contains object %p", - G_STRFUNC, container, object); + G_STRFUNC, container, object); return FALSE; } @@ -540,12 +540,12 @@ gimp_container_add (GimpContainer *container, handler = (GimpContainerHandler *) list->data; handler_id = g_signal_connect (object, - handler->signame, - handler->callback, - handler->callback_data); + handler->signame, + handler->callback, + handler->callback_data); g_object_set_qdata (G_OBJECT (object), handler->quark, - GUINT_TO_POINTER (handler_id)); + GUINT_TO_POINTER (handler_id)); } switch (container->policy) @@ -556,8 +556,8 @@ gimp_container_add (GimpContainer *container, case GIMP_CONTAINER_POLICY_WEAK: g_signal_connect (object, "disconnect", - G_CALLBACK (gimp_container_disconnect_callback), - container); + G_CALLBACK (gimp_container_disconnect_callback), + container); break; } @@ -570,7 +570,7 @@ gimp_container_add (GimpContainer *container, gboolean gimp_container_remove (GimpContainer *container, - GimpObject *object) + GimpObject *object) { GimpContainerHandler *handler; GList *list; @@ -579,13 +579,13 @@ gimp_container_remove (GimpContainer *container, g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE); g_return_val_if_fail (object != NULL, FALSE); g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (object, - container->children_type), - FALSE); + container->children_type), + FALSE); if (! gimp_container_have (container, object)) { g_warning ("%s: container %p does not contain object %p", - G_STRFUNC, container, object); + G_STRFUNC, container, object); return FALSE; } @@ -597,17 +597,17 @@ gimp_container_remove (GimpContainer *container, handler->quark)); if (handler_id) - { - g_signal_handler_disconnect (object, handler_id); + { + g_signal_handler_disconnect (object, handler_id); - g_object_set_qdata (G_OBJECT (object), handler->quark, NULL); - } + g_object_set_qdata (G_OBJECT (object), handler->quark, NULL); + } } container->num_children--; g_signal_emit (container, container_signals[REMOVE], 0, - object); + object); switch (container->policy) { @@ -627,22 +627,22 @@ gimp_container_remove (GimpContainer *container, gboolean gimp_container_insert (GimpContainer *container, - GimpObject *object, - gint index) + GimpObject *object, + gint index) { g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE); g_return_val_if_fail (object != NULL, FALSE); g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (object, - container->children_type), - FALSE); + container->children_type), + FALSE); g_return_val_if_fail (index >= -1 && - index <= container->num_children, FALSE); + index <= container->num_children, FALSE); if (gimp_container_have (container, object)) { g_warning ("%s: container %p already contains object %p", - G_STRFUNC, container, object); + G_STRFUNC, container, object); return FALSE; } @@ -656,22 +656,22 @@ gimp_container_insert (GimpContainer *container, gboolean gimp_container_reorder (GimpContainer *container, - GimpObject *object, - gint new_index) + GimpObject *object, + gint new_index) { g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE); g_return_val_if_fail (object != NULL, FALSE); g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (object, - container->children_type), - FALSE); + container->children_type), + FALSE); g_return_val_if_fail (new_index >= -1 && - new_index < container->num_children, FALSE); + new_index < container->num_children, FALSE); if (! gimp_container_have (container, object)) { g_warning ("%s: container %p does not contain object %p", - G_STRFUNC, container, object); + G_STRFUNC, container, object); return FALSE; } @@ -679,7 +679,7 @@ gimp_container_reorder (GimpContainer *container, return TRUE; g_signal_emit (container, container_signals[REORDER], 0, - object, new_index); + object, new_index); return TRUE; } @@ -738,7 +738,7 @@ gimp_container_is_empty (const GimpContainer *container) gboolean gimp_container_have (const GimpContainer *container, - GimpObject *object) + GimpObject *object) { g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE); @@ -750,8 +750,8 @@ gimp_container_have (const GimpContainer *container, void gimp_container_foreach (const GimpContainer *container, - GFunc func, - gpointer user_data) + GFunc func, + gpointer user_data) { g_return_if_fail (GIMP_IS_CONTAINER (container)); g_return_if_fail (func != NULL); @@ -762,7 +762,7 @@ gimp_container_foreach (const GimpContainer *container, GimpObject * gimp_container_get_child_by_name (const GimpContainer *container, - const gchar *name) + const gchar *name) { g_return_val_if_fail (GIMP_IS_CONTAINER (container), NULL); @@ -770,12 +770,12 @@ gimp_container_get_child_by_name (const GimpContainer *container, return NULL; return GIMP_CONTAINER_GET_CLASS (container)->get_child_by_name (container, - name); + name); } GimpObject * gimp_container_get_child_by_index (const GimpContainer *container, - gint index) + gint index) { g_return_val_if_fail (GIMP_IS_CONTAINER (container), NULL); @@ -783,21 +783,21 @@ gimp_container_get_child_by_index (const GimpContainer *container, return NULL; return GIMP_CONTAINER_GET_CLASS (container)->get_child_by_index (container, - index); + index); } gint gimp_container_get_child_index (const GimpContainer *container, - const GimpObject *object) + const GimpObject *object) { g_return_val_if_fail (GIMP_IS_CONTAINER (container), -1); g_return_val_if_fail (object != NULL, -1); g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (object, - container->children_type), - -1); + container->children_type), + -1); return GIMP_CONTAINER_GET_CLASS (container)->get_child_index (container, - object); + object); } static void @@ -835,24 +835,24 @@ gimp_container_get_name_array (const GimpContainer *container, static void gimp_container_add_handler_foreach_func (GimpObject *object, - GimpContainerHandler *handler) + GimpContainerHandler *handler) { gulong handler_id; handler_id = g_signal_connect (object, - handler->signame, - handler->callback, - handler->callback_data); + handler->signame, + handler->callback, + handler->callback_data); g_object_set_qdata (G_OBJECT (object), handler->quark, - GUINT_TO_POINTER (handler_id)); + GUINT_TO_POINTER (handler_id)); } GQuark gimp_container_add_handler (GimpContainer *container, - const gchar *signame, - GCallback callback, - gpointer callback_data) + const gchar *signame, + GCallback callback, + gpointer callback_data) { GimpContainerHandler *handler; gchar *key; @@ -884,15 +884,15 @@ gimp_container_add_handler (GimpContainer *container, container->handlers = g_list_prepend (container->handlers, handler); gimp_container_foreach (container, - (GFunc) gimp_container_add_handler_foreach_func, - handler); + (GFunc) gimp_container_add_handler_foreach_func, + handler); return handler->quark; } static void gimp_container_remove_handler_foreach_func (GimpObject *object, - GimpContainerHandler *handler) + GimpContainerHandler *handler) { gulong handler_id; @@ -909,7 +909,7 @@ gimp_container_remove_handler_foreach_func (GimpObject *object, void gimp_container_remove_handler (GimpContainer *container, - GQuark id) + GQuark id) { GimpContainerHandler *handler; GList *list; @@ -922,7 +922,7 @@ gimp_container_remove_handler (GimpContainer *container, handler = (GimpContainerHandler *) list->data; if (handler->quark == id) - break; + break; } if (! list) @@ -935,8 +935,8 @@ gimp_container_remove_handler (GimpContainer *container, D (g_print ("%s: id = %d\n", G_STRFUNC, handler->quark)); gimp_container_foreach (container, - (GFunc) gimp_container_remove_handler_foreach_func, - handler); + (GFunc) gimp_container_remove_handler_foreach_func, + handler); container->handlers = g_list_remove (container->handlers, handler); diff --git a/app/core/gimpcontainer.h b/app/core/gimpcontainer.h index 6818991d7e..9065e49c52 100644 --- a/app/core/gimpcontainer.h +++ b/app/core/gimpcontainer.h @@ -56,28 +56,28 @@ struct _GimpContainerClass /* signals */ void (* add) (GimpContainer *container, - GimpObject *object); + GimpObject *object); void (* remove) (GimpContainer *container, - GimpObject *object); + GimpObject *object); void (* reorder) (GimpContainer *container, - GimpObject *object, - gint new_index); + GimpObject *object, + gint new_index); void (* freeze) (GimpContainer *container); void (* thaw) (GimpContainer *container); /* virtual functions */ void (* clear) (GimpContainer *container); gboolean (* have) (const GimpContainer *container, - const GimpObject *object); + const GimpObject *object); void (* foreach) (const GimpContainer *container, - GFunc func, - gpointer user_data); + GFunc func, + gpointer user_data); GimpObject * (* get_child_by_name) (const GimpContainer *container, - const gchar *name); + const gchar *name); GimpObject * (* get_child_by_index) (const GimpContainer *container, - gint index); + gint index); gint (* get_child_index) (const GimpContainer *container, - const GimpObject *object); + const GimpObject *object); }; @@ -88,15 +88,15 @@ GimpContainerPolicy gimp_container_policy (const GimpContainer *container); gint gimp_container_num_children (const GimpContainer *container); gboolean gimp_container_add (GimpContainer *container, - GimpObject *object); + GimpObject *object); gboolean gimp_container_remove (GimpContainer *container, - GimpObject *object); + GimpObject *object); gboolean gimp_container_insert (GimpContainer *container, - GimpObject *object, - gint new_index); + GimpObject *object, + gint new_index); gboolean gimp_container_reorder (GimpContainer *container, - GimpObject *object, - gint new_index); + GimpObject *object, + gint new_index); void gimp_container_freeze (GimpContainer *container); void gimp_container_thaw (GimpContainer *container); @@ -105,27 +105,27 @@ gboolean gimp_container_frozen (GimpContainer *container); void gimp_container_clear (GimpContainer *container); gboolean gimp_container_is_empty (const GimpContainer *container); gboolean gimp_container_have (const GimpContainer *container, - GimpObject *object); + GimpObject *object); void gimp_container_foreach (const GimpContainer *container, - GFunc func, - gpointer user_data); + GFunc func, + gpointer user_data); GimpObject * gimp_container_get_child_by_name (const GimpContainer *container, - const gchar *name); + const gchar *name); GimpObject * gimp_container_get_child_by_index (const GimpContainer *container, - gint index); + gint index); gint gimp_container_get_child_index (const GimpContainer *container, - const GimpObject *object); + const GimpObject *object); gchar ** gimp_container_get_name_array (const GimpContainer *container, gint *length); GQuark gimp_container_add_handler (GimpContainer *container, - const gchar *signame, - GCallback callback, - gpointer callback_data); + const gchar *signame, + GCallback callback, + gpointer callback_data); void gimp_container_remove_handler (GimpContainer *container, - GQuark id); + GQuark id); #endif /* __GIMP_CONTAINER_H__ */ diff --git a/app/core/gimpdata.c b/app/core/gimpdata.c index c5842af500..e120a50928 100644 --- a/app/core/gimpdata.c +++ b/app/core/gimpdata.c @@ -150,24 +150,24 @@ gimp_data_class_init (GimpDataClass *klass) klass->duplicate = NULL; g_object_class_install_property (object_class, PROP_FILENAME, - g_param_spec_string ("filename", NULL, NULL, - NULL, - GIMP_PARAM_READWRITE)); + g_param_spec_string ("filename", NULL, NULL, + NULL, + GIMP_PARAM_READWRITE)); g_object_class_install_property (object_class, PROP_WRITABLE, - g_param_spec_boolean ("writable", NULL, NULL, + g_param_spec_boolean ("writable", NULL, NULL, FALSE, GIMP_PARAM_READWRITE)); g_object_class_install_property (object_class, PROP_WRITABLE, - g_param_spec_boolean ("deletable", NULL, NULL, + g_param_spec_boolean ("deletable", NULL, NULL, FALSE, GIMP_PARAM_READWRITE)); g_object_class_install_property (object_class, PROP_MIME_TYPE, - g_param_spec_string ("mime-type", NULL, NULL, - NULL, - GIMP_PARAM_READWRITE | + g_param_spec_string ("mime-type", NULL, NULL, + NULL, + GIMP_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); } diff --git a/app/core/gimpdata.h b/app/core/gimpdata.h index 547f70787c..e0827728bf 100644 --- a/app/core/gimpdata.h +++ b/app/core/gimpdata.h @@ -94,7 +94,7 @@ void gimp_data_set_filename (GimpData *data, gboolean writable, gboolean deletable); void gimp_data_create_filename (GimpData *data, - const gchar *dest_dir); + const gchar *dest_dir); const gchar * gimp_data_get_mime_type (GimpData *data); diff --git a/app/core/gimpdatafactory.c b/app/core/gimpdatafactory.c index c247dd73d5..707134b769 100644 --- a/app/core/gimpdatafactory.c +++ b/app/core/gimpdatafactory.c @@ -129,12 +129,12 @@ gimp_data_factory_get_memsize (GimpObject *object, GimpDataFactory * gimp_data_factory_new (Gimp *gimp, GType data_type, - const gchar *path_property_name, + const gchar *path_property_name, const gchar *writable_property_name, - const GimpDataFactoryLoaderEntry *loader_entries, - gint n_loader_entries, - GimpDataNewFunc new_func, - GimpDataGetStandardFunc standard_func) + const GimpDataFactoryLoaderEntry *loader_entries, + gint n_loader_entries, + GimpDataNewFunc new_func, + GimpDataGetStandardFunc standard_func) { GimpDataFactory *factory; @@ -166,7 +166,7 @@ gimp_data_factory_new (Gimp *gimp, void gimp_data_factory_data_init (GimpDataFactory *factory, - gboolean no_data) + gboolean no_data) { g_return_if_fail (GIMP_IS_DATA_FACTORY (factory)); @@ -433,7 +433,7 @@ gimp_data_factory_data_free (GimpDataFactory *factory) GimpData * gimp_data_factory_data_new (GimpDataFactory *factory, - const gchar *name) + const gchar *name) { g_return_val_if_fail (GIMP_IS_DATA_FACTORY (factory), NULL); g_return_val_if_fail (name != NULL, NULL); diff --git a/app/core/gimpdatafactory.h b/app/core/gimpdatafactory.h index 96adc844fa..1834ec89a7 100644 --- a/app/core/gimpdatafactory.h +++ b/app/core/gimpdatafactory.h @@ -79,23 +79,23 @@ GType gimp_data_factory_get_type (void) G_GNUC_CONST; GimpDataFactory * gimp_data_factory_new (Gimp *gimp, GType data_type, - const gchar *path_property_name, + const gchar *path_property_name, const gchar *writable_property_name, - const GimpDataFactoryLoaderEntry *loader_entries, - gint n_loader_entries, - GimpDataNewFunc new_func, - GimpDataGetStandardFunc standard_func); + const GimpDataFactoryLoaderEntry *loader_entries, + gint n_loader_entries, + GimpDataNewFunc new_func, + GimpDataGetStandardFunc standard_func); void gimp_data_factory_data_init (GimpDataFactory *factory, - gboolean no_data); + gboolean no_data); void gimp_data_factory_data_refresh (GimpDataFactory *factory); void gimp_data_factory_data_save (GimpDataFactory *factory); void gimp_data_factory_data_free (GimpDataFactory *factory); GimpData * gimp_data_factory_data_new (GimpDataFactory *factory, - const gchar *name); + const gchar *name); GimpData * gimp_data_factory_data_duplicate (GimpDataFactory *factory, - GimpData *data); + GimpData *data); gboolean gimp_data_factory_data_delete (GimpDataFactory *factory, GimpData *data, gboolean delete_from_disk, diff --git a/app/core/gimpdrawable-blend.c b/app/core/gimpdrawable-blend.c index 99374ec9d1..1b99aa06a7 100644 --- a/app/core/gimpdrawable-blend.c +++ b/app/core/gimpdrawable-blend.c @@ -87,16 +87,16 @@ static gdouble gradient_calc_square_factor (gdouble dist, gdouble offset, gdouble x, gdouble y); -static gdouble gradient_calc_radial_factor (gdouble dist, - gdouble offset, +static gdouble gradient_calc_radial_factor (gdouble dist, + gdouble offset, gdouble x, - gdouble y); -static gdouble gradient_calc_linear_factor (gdouble dist, + gdouble y); +static gdouble gradient_calc_linear_factor (gdouble dist, gdouble *vec, gdouble offset, gdouble x, gdouble y); -static gdouble gradient_calc_bilinear_factor (gdouble dist, +static gdouble gradient_calc_bilinear_factor (gdouble dist, gdouble *vec, gdouble offset, gdouble x, @@ -116,7 +116,7 @@ static gdouble gradient_calc_shapeburst_dimpled_factor (gdouble x, gdouble y); static void gradient_precalc_shapeburst (GimpImage *image, - GimpDrawable *drawable, + GimpDrawable *drawable, PixelRegion *PR, gdouble dist, GimpProgress *progress); @@ -128,7 +128,7 @@ static void gradient_render_pixel (gdouble x, static void gradient_put_pixel (gint x, gint y, GimpRGB *color, - gpointer put_pixel_data); + gpointer put_pixel_data); static void gradient_fill_region (GimpImage *image, GimpDrawable *drawable, @@ -228,12 +228,12 @@ gimp_drawable_blend (GimpDrawable *drawable, pixel_region_init (&bufPR, buf_tiles, 0, 0, width, height, TRUE); gradient_fill_region (image, drawable, context, - &bufPR, width, height, - blend_mode, gradient_type, offset, repeat, reverse, - supersample, max_depth, threshold, dither, - (startx - x), (starty - y), - (endx - x), (endy - y), - progress); + &bufPR, width, height, + blend_mode, gradient_type, offset, repeat, reverse, + supersample, max_depth, threshold, dither, + (startx - x), (starty - y), + (endx - x), (endy - y), + progress); if (distR.tiles) { @@ -258,10 +258,10 @@ gimp_drawable_blend (GimpDrawable *drawable, static gdouble gradient_calc_conical_sym_factor (gdouble dist, - gdouble *axis, - gdouble offset, - gdouble x, - gdouble y) + gdouble *axis, + gdouble offset, + gdouble x, + gdouble y) { if (dist == 0.0) { @@ -283,9 +283,9 @@ gradient_calc_conical_sym_factor (gdouble dist, rat = axis[0] * vec[0] + axis[1] * vec[1]; /* Dot product */ if (rat > 1.0) - rat = 1.0; + rat = 1.0; else if (rat < -1.0) - rat = -1.0; + rat = -1.0; /* This cool idea is courtesy Josh MacDonald, * Ali Rahimi --- two more XCF losers. */ @@ -303,10 +303,10 @@ gradient_calc_conical_sym_factor (gdouble dist, static gdouble gradient_calc_conical_asym_factor (gdouble dist, - gdouble *axis, - gdouble offset, - gdouble x, - gdouble y) + gdouble *axis, + gdouble offset, + gdouble x, + gdouble y) { if (dist == 0.0) { @@ -340,9 +340,9 @@ gradient_calc_conical_asym_factor (gdouble dist, static gdouble gradient_calc_square_factor (gdouble dist, - gdouble offset, - gdouble x, - gdouble y) + gdouble offset, + gdouble x, + gdouble y) { if (dist == 0.0) { @@ -361,19 +361,19 @@ gradient_calc_square_factor (gdouble dist, rat = r / dist; if (rat < offset) - return 0.0; + return 0.0; else if (offset == 1.0) - return (rat >= 1.0) ? 1.0 : 0.0; + return (rat >= 1.0) ? 1.0 : 0.0; else - return (rat - offset) / (1.0 - offset); + return (rat - offset) / (1.0 - offset); } } static gdouble gradient_calc_radial_factor (gdouble dist, - gdouble offset, - gdouble x, - gdouble y) + gdouble offset, + gdouble x, + gdouble y) { if (dist == 0.0) { @@ -392,20 +392,20 @@ gradient_calc_radial_factor (gdouble dist, rat = r / dist; if (rat < offset) - return 0.0; + return 0.0; else if (offset == 1.0) - return (rat >= 1.0) ? 1.0 : 0.0; + return (rat >= 1.0) ? 1.0 : 0.0; else - return (rat - offset) / (1.0 - offset); + return (rat - offset) / (1.0 - offset); } } static gdouble gradient_calc_linear_factor (gdouble dist, - gdouble *vec, - gdouble offset, - gdouble x, - gdouble y) + gdouble *vec, + gdouble offset, + gdouble x, + gdouble y) { if (dist == 0.0) { @@ -422,22 +422,22 @@ gradient_calc_linear_factor (gdouble dist, rat = r / dist; if (rat >= 0.0 && rat < offset) - return 0.0; + return 0.0; else if (offset == 1.0) - return (rat >= 1.0) ? 1.0 : 0.0; + return (rat >= 1.0) ? 1.0 : 0.0; else if (rat < 0.0) - return rat / (1.0 - offset); + return rat / (1.0 - offset); else - return (rat - offset) / (1.0 - offset); + return (rat - offset) / (1.0 - offset); } } static gdouble gradient_calc_bilinear_factor (gdouble dist, - gdouble *vec, - gdouble offset, - gdouble x, - gdouble y) + gdouble *vec, + gdouble offset, + gdouble x, + gdouble y) { if (dist == 0.0) { @@ -456,21 +456,21 @@ gradient_calc_bilinear_factor (gdouble dist, rat = r / dist; if (fabs (rat) < offset) - return 0.0; + return 0.0; else if (offset == 1.0) - return (rat == 1.0) ? 1.0 : 0.0; + return (rat == 1.0) ? 1.0 : 0.0; else - return (fabs (rat) - offset) / (1.0 - offset); + return (fabs (rat) - offset) / (1.0 - offset); } } static gdouble gradient_calc_spiral_factor (gdouble dist, - gdouble *axis, - gdouble offset, - gdouble x, - gdouble y, - gboolean clockwise) + gdouble *axis, + gdouble offset, + gdouble x, + gdouble y, + gboolean clockwise) { if (dist == 0.0) { @@ -505,7 +505,7 @@ gradient_calc_spiral_factor (gdouble dist, static gdouble gradient_calc_shapeburst_angular_factor (gdouble x, - gdouble y) + gdouble y) { Tile *tile; gfloat value; @@ -526,7 +526,7 @@ gradient_calc_shapeburst_angular_factor (gdouble x, static gdouble gradient_calc_shapeburst_spherical_factor (gdouble x, - gdouble y) + gdouble y) { Tile *tile; gfloat value; @@ -548,7 +548,7 @@ gradient_calc_shapeburst_spherical_factor (gdouble x, static gdouble gradient_calc_shapeburst_dimpled_factor (gdouble x, - gdouble y) + gdouble y) { Tile *tile; gfloat value; @@ -569,9 +569,9 @@ gradient_calc_shapeburst_dimpled_factor (gdouble x, static void gradient_precalc_shapeburst (GimpImage *image, - GimpDrawable *drawable, - PixelRegion *PR, - gdouble dist, + GimpDrawable *drawable, + PixelRegion *PR, + gdouble dist, GimpProgress *progress) { GimpChannel *mask; @@ -602,7 +602,7 @@ gradient_precalc_shapeburst (GimpImage *image, gimp_item_offsets (GIMP_ITEM (drawable), &offx, &offy); pixel_region_init (&maskR, gimp_drawable_get_tiles (GIMP_DRAWABLE (mask)), - x1 + offx, y1 + offy, (x2 - x1), (y2 - y1), FALSE); + x1 + offx, y1 + offy, (x2 - x1), (y2 - y1), FALSE); /* copy the mask to the temp mask */ copy_region (&maskR, &tempR); @@ -611,19 +611,19 @@ gradient_precalc_shapeburst (GimpImage *image, { /* If the intended drawable has an alpha channel, use that */ if (gimp_drawable_has_alpha (drawable)) - { - PixelRegion drawableR; + { + PixelRegion drawableR; - pixel_region_init (&drawableR, gimp_drawable_get_tiles (drawable), - PR->x, PR->y, PR->w, PR->h, FALSE); + pixel_region_init (&drawableR, gimp_drawable_get_tiles (drawable), + PR->x, PR->y, PR->w, PR->h, FALSE); - extract_alpha_region (&drawableR, NULL, &tempR); - } + extract_alpha_region (&drawableR, NULL, &tempR); + } else - { - /* Otherwise, just fill the shapeburst to white */ - color_region (&tempR, white); - } + { + /* Otherwise, just fill the shapeburst to white */ + color_region (&tempR, white); + } } pixel_region_init (&tempR, tempR.tiles, 0, 0, PR->w, PR->h, TRUE); @@ -639,15 +639,15 @@ gradient_precalc_shapeburst (GimpImage *image, pixel_region_init (&distR, distR.tiles, 0, 0, PR->w, PR->h, TRUE); for (pr = pixel_regions_register (1, &distR); - pr != NULL; - pr = pixel_regions_process (pr)) - { - distp = (gfloat *) distR.data; - size = distR.w * distR.h; + pr != NULL; + pr = pixel_regions_process (pr)) + { + distp = (gfloat *) distR.data; + size = distR.w * distR.h; - while (size--) - *distp++ /= max_iteration; - } + while (size--) + *distp++ /= max_iteration; + } pixel_region_init (&distR, distR.tiles, 0, 0, PR->w, PR->h, FALSE); } @@ -658,9 +658,9 @@ gradient_precalc_shapeburst (GimpImage *image, static void gradient_render_pixel (gdouble x, - gdouble y, - GimpRGB *color, - gpointer render_data) + gdouble y, + GimpRGB *color, + gpointer render_data) { RenderBlendData *rbd = render_data; gdouble factor; @@ -672,36 +672,36 @@ gradient_render_pixel (gdouble x, case GIMP_GRADIENT_LINEAR: factor = gradient_calc_linear_factor (rbd->dist, rbd->vec, rbd->offset, - x - rbd->sx, y - rbd->sy); + x - rbd->sx, y - rbd->sy); break; case GIMP_GRADIENT_BILINEAR: factor = gradient_calc_bilinear_factor (rbd->dist, rbd->vec, rbd->offset, - x - rbd->sx, y - rbd->sy); + x - rbd->sx, y - rbd->sy); break; case GIMP_GRADIENT_RADIAL: factor = gradient_calc_radial_factor (rbd->dist, rbd->offset, - x - rbd->sx, y - rbd->sy); + x - rbd->sx, y - rbd->sy); break; case GIMP_GRADIENT_SQUARE: factor = gradient_calc_square_factor (rbd->dist, rbd->offset, - x - rbd->sx, y - rbd->sy); + x - rbd->sx, y - rbd->sy); break; case GIMP_GRADIENT_CONICAL_SYMMETRIC: factor = gradient_calc_conical_sym_factor (rbd->dist, rbd->vec, rbd->offset, - x - rbd->sx, y - rbd->sy); + x - rbd->sx, y - rbd->sy); break; case GIMP_GRADIENT_CONICAL_ASYMMETRIC: factor = gradient_calc_conical_asym_factor (rbd->dist, rbd->vec, rbd->offset, - x - rbd->sx, y - rbd->sy); + x - rbd->sx, y - rbd->sy); break; case GIMP_GRADIENT_SHAPEBURST_ANGULAR: @@ -719,13 +719,13 @@ gradient_render_pixel (gdouble x, case GIMP_GRADIENT_SPIRAL_CLOCKWISE: factor = gradient_calc_spiral_factor (rbd->dist, rbd->vec, rbd->offset, - x - rbd->sx, y - rbd->sy, TRUE); + x - rbd->sx, y - rbd->sy, TRUE); break; case GIMP_GRADIENT_SPIRAL_ANTICLOCKWISE: factor = gradient_calc_spiral_factor (rbd->dist, rbd->vec, rbd->offset, - x - rbd->sx, y - rbd->sy, FALSE); + x - rbd->sx, y - rbd->sy, FALSE); break; default: @@ -791,9 +791,9 @@ gradient_render_pixel (gdouble x, static void gradient_put_pixel (gint x, - gint y, - GimpRGB *color, - gpointer put_pixel_data) + gint y, + GimpRGB *color, + gpointer put_pixel_data) { PutPixelData *ppd = put_pixel_data; guchar *dest = ppd->row_data + ppd->bytes * x; @@ -844,25 +844,25 @@ gradient_put_pixel (gint x, static void gradient_fill_region (GimpImage *image, - GimpDrawable *drawable, + GimpDrawable *drawable, GimpContext *context, - PixelRegion *PR, - gint width, - gint height, - GimpBlendMode blend_mode, - GimpGradientType gradient_type, - gdouble offset, - GimpRepeatMode repeat, + PixelRegion *PR, + gint width, + gint height, + GimpBlendMode blend_mode, + GimpGradientType gradient_type, + gdouble offset, + GimpRepeatMode repeat, gboolean reverse, - gboolean supersample, - gint max_depth, - gdouble threshold, - gboolean dither, - gdouble sx, - gdouble sy, - gdouble ex, - gdouble ey, - GimpProgress *progress) + gboolean supersample, + gint max_depth, + gdouble threshold, + gboolean dither, + gdouble sx, + gdouble sy, + gdouble ex, + gdouble ey, + GimpProgress *progress) { RenderBlendData rbd; @@ -927,10 +927,10 @@ gradient_fill_region (GimpImage *image, rbd.dist = sqrt (SQR (ex - sx) + SQR (ey - sy)); if (rbd.dist > 0.0) - { - rbd.vec[0] = (ex - sx) / rbd.dist; - rbd.vec[1] = (ey - sy) / rbd.dist; - } + { + rbd.vec[0] = (ex - sx) / rbd.dist; + rbd.vec[1] = (ey - sy) / rbd.dist; + } break; @@ -968,10 +968,10 @@ gradient_fill_region (GimpImage *image, ppd.dither_rand = g_rand_new (); gimp_adaptive_supersample_area (0, 0, (width - 1), (height - 1), - max_depth, threshold, - gradient_render_pixel, &rbd, - gradient_put_pixel, &ppd, - progress ? + max_depth, threshold, + gradient_render_pixel, &rbd, + gradient_put_pixel, &ppd, + progress ? gimp_progress_update_and_flush : NULL, progress); diff --git a/app/core/gimpdrawable-bucket-fill.c b/app/core/gimpdrawable-bucket-fill.c index 5ed88c11ca..6f3ae07e52 100644 --- a/app/core/gimpdrawable-bucket-fill.c +++ b/app/core/gimpdrawable-bucket-fill.c @@ -81,10 +81,10 @@ gimp_drawable_bucket_fill (GimpDrawable *drawable, pattern = gimp_context_get_pattern (context); if (! pattern) - { - g_message (_("No patterns available for this operation.")); - return; - } + { + g_message (_("No patterns available for this operation.")); + return; + } } else { @@ -199,30 +199,30 @@ gimp_drawable_bucket_fill_full (GimpDrawable *drawable, /* make sure we handle the mask correctly if it was sample-merged */ if (sample_merged) - { + { GimpItem *item; - gint off_x, off_y; + gint off_x, off_y; item = GIMP_ITEM (drawable); - /* Limit the channel bounds to the drawable's extents */ - gimp_item_offsets (item, &off_x, &off_y); + /* Limit the channel bounds to the drawable's extents */ + gimp_item_offsets (item, &off_x, &off_y); - x1 = CLAMP (x1, off_x, (off_x + gimp_item_width (item))); - y1 = CLAMP (y1, off_y, (off_y + gimp_item_height (item))); - x2 = CLAMP (x2, off_x, (off_x + gimp_item_width (item))); - y2 = CLAMP (y2, off_y, (off_y + gimp_item_height (item))); + x1 = CLAMP (x1, off_x, (off_x + gimp_item_width (item))); + y1 = CLAMP (y1, off_y, (off_y + gimp_item_height (item))); + x2 = CLAMP (x2, off_x, (off_x + gimp_item_width (item))); + y2 = CLAMP (y2, off_y, (off_y + gimp_item_height (item))); - pixel_region_init (&maskPR, + pixel_region_init (&maskPR, gimp_drawable_get_tiles (GIMP_DRAWABLE (mask)), - x1, y1, (x2 - x1), (y2 - y1), TRUE); + x1, y1, (x2 - x1), (y2 - y1), TRUE); - /* translate mask bounds to drawable coords */ - x1 -= off_x; - y1 -= off_y; - x2 -= off_x; - y2 -= off_y; - } + /* translate mask bounds to drawable coords */ + x1 -= off_x; + y1 -= off_y; + x2 -= off_x; + y2 -= off_y; + } else { pixel_region_init (&maskPR, diff --git a/app/core/gimpdrawable-combine.c b/app/core/gimpdrawable-combine.c index b24154018f..e5b0e8de4b 100644 --- a/app/core/gimpdrawable-combine.c +++ b/app/core/gimpdrawable-combine.c @@ -105,15 +105,15 @@ gimp_drawable_real_apply_region (GimpDrawable *drawable, */ if (src1_tiles) pixel_region_init (&src1PR, src1_tiles, - x1, y1, (x2 - x1), (y2 - y1), FALSE); + x1, y1, (x2 - x1), (y2 - y1), FALSE); else pixel_region_init (&src1PR, gimp_drawable_get_tiles (drawable), - x1, y1, (x2 - x1), (y2 - y1), FALSE); + x1, y1, (x2 - x1), (y2 - y1), FALSE); pixel_region_init (&destPR, gimp_drawable_get_tiles (drawable), - x1, y1, (x2 - x1), (y2 - y1), TRUE); + x1, y1, (x2 - x1), (y2 - y1), TRUE); pixel_region_resize (src2PR, - src2PR->x + (x1 - x), src2PR->y + (y1 - y), - (x2 - x1), (y2 - y1)); + src2PR->x + (x1 - x), src2PR->y + (y1 - y), + (x2 - x1), (y2 - y1)); if (mask) { @@ -127,13 +127,13 @@ gimp_drawable_real_apply_region (GimpDrawable *drawable, my = y1 + offset_y; pixel_region_init (&maskPR, - gimp_drawable_get_tiles (GIMP_DRAWABLE (mask)), - mx, my, - (x2 - x1), (y2 - y1), - FALSE); + gimp_drawable_get_tiles (GIMP_DRAWABLE (mask)), + mx, my, + (x2 - x1), (y2 - y1), + FALSE); combine_regions (&src1PR, src2PR, &destPR, &maskPR, NULL, - opacity * 255.999, + opacity * 255.999, mode, active_components, operation); @@ -141,7 +141,7 @@ gimp_drawable_real_apply_region (GimpDrawable *drawable, else { combine_regions (&src1PR, src2PR, &destPR, NULL, NULL, - opacity * 255.999, + opacity * 255.999, mode, active_components, operation); @@ -226,12 +226,12 @@ gimp_drawable_real_replace_region (GimpDrawable *drawable, * If an alternative to using the drawable's data as src1 was provided... */ pixel_region_init (&src1PR, gimp_drawable_get_tiles (drawable), - x1, y1, (x2 - x1), (y2 - y1), FALSE); + x1, y1, (x2 - x1), (y2 - y1), FALSE); pixel_region_init (&destPR, gimp_drawable_get_tiles (drawable), - x1, y1, (x2 - x1), (y2 - y1), TRUE); + x1, y1, (x2 - x1), (y2 - y1), TRUE); pixel_region_resize (src2PR, - src2PR->x + (x1 - x), src2PR->y + (y1 - y), - (x2 - x1), (y2 - y1)); + src2PR->x + (x1 - x), src2PR->y + (y1 - y), + (x2 - x1), (y2 - y1)); if (mask) { @@ -247,10 +247,10 @@ gimp_drawable_real_replace_region (GimpDrawable *drawable, my = y1 + offset_y; pixel_region_init (&mask2PR, - gimp_drawable_get_tiles (GIMP_DRAWABLE (mask)), - mx, my, - (x2 - x1), (y2 - y1), - FALSE); + gimp_drawable_get_tiles (GIMP_DRAWABLE (mask)), + mx, my, + (x2 - x1), (y2 - y1), + FALSE); temp_data = g_malloc ((y2 - y1) * (x2 - x1)); @@ -277,7 +277,7 @@ gimp_drawable_real_replace_region (GimpDrawable *drawable, else { combine_regions_replace (&src1PR, src2PR, &destPR, maskPR, NULL, - opacity * 255.999, + opacity * 255.999, active_components, operation); } diff --git a/app/core/gimpdrawable-desaturate.c b/app/core/gimpdrawable-desaturate.c index 80cf4869d0..744584df1b 100644 --- a/app/core/gimpdrawable-desaturate.c +++ b/app/core/gimpdrawable-desaturate.c @@ -87,9 +87,9 @@ gimp_drawable_desaturate (GimpDrawable *drawable, has_alpha = gimp_drawable_has_alpha (drawable); pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable), - x, y, width, height, FALSE); + x, y, width, height, FALSE); pixel_region_init (&destPR, gimp_drawable_get_shadow_tiles (drawable), - x, y, width, height, TRUE); + x, y, width, height, TRUE); pixel_regions_process_parallel (function, GINT_TO_POINTER (has_alpha), 2, &srcPR, &destPR); diff --git a/app/core/gimpdrawable-equalize.c b/app/core/gimpdrawable-equalize.c index 2332df3ca4..e1df090582 100644 --- a/app/core/gimpdrawable-equalize.c +++ b/app/core/gimpdrawable-equalize.c @@ -64,9 +64,9 @@ gimp_drawable_equalize (GimpDrawable *drawable, /* Apply the histogram */ pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable), - x, y, width, height, FALSE); + x, y, width, height, FALSE); pixel_region_init (&destPR, gimp_drawable_get_shadow_tiles (drawable), - x, y, width, height, TRUE); + x, y, width, height, TRUE); pixel_regions_process_parallel ((PixelProcessorFunc) gimp_lut_process, lut, 2, &srcPR, &destPR); diff --git a/app/core/gimpdrawable-equalize.h b/app/core/gimpdrawable-equalize.h index 5d4e9172f9..ca7a44473c 100644 --- a/app/core/gimpdrawable-equalize.h +++ b/app/core/gimpdrawable-equalize.h @@ -21,7 +21,7 @@ void gimp_drawable_equalize (GimpDrawable *drawable, - gboolean mask_only); + gboolean mask_only); #endif /* __GIMP_DRAWABLE_EQUALIZE_H__ */ diff --git a/app/core/gimpdrawable-histogram.c b/app/core/gimpdrawable-histogram.c index c77e79a9c0..2068a3fe83 100644 --- a/app/core/gimpdrawable-histogram.c +++ b/app/core/gimpdrawable-histogram.c @@ -33,7 +33,7 @@ void gimp_drawable_calculate_histogram (GimpDrawable *drawable, - GimpHistogram *histogram) + GimpHistogram *histogram) { PixelRegion region; PixelRegion mask; @@ -64,7 +64,7 @@ gimp_drawable_calculate_histogram (GimpDrawable *drawable, gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y); pixel_region_init (&mask, gimp_drawable_get_tiles (GIMP_DRAWABLE (sel_mask)), - x1 + off_x, y1 + off_y, (x2 - x1), (y2 - y1), FALSE); + x1 + off_x, y1 + off_y, (x2 - x1), (y2 - y1), FALSE); gimp_histogram_calculate (histogram, ®ion, &mask); } else diff --git a/app/core/gimpdrawable-histogram.h b/app/core/gimpdrawable-histogram.h index 13b5a45ff8..53233fcc08 100644 --- a/app/core/gimpdrawable-histogram.h +++ b/app/core/gimpdrawable-histogram.h @@ -23,7 +23,7 @@ void gimp_drawable_calculate_histogram (GimpDrawable *drawable, - GimpHistogram *histogram); + GimpHistogram *histogram); #endif /* __GIMP_HISTOGRAM_H__ */ diff --git a/app/core/gimpdrawable-invert.c b/app/core/gimpdrawable-invert.c index 3e2972cb47..6d1f9c3b88 100644 --- a/app/core/gimpdrawable-invert.c +++ b/app/core/gimpdrawable-invert.c @@ -49,9 +49,9 @@ gimp_drawable_invert (GimpDrawable *drawable) lut = invert_lut_new (gimp_drawable_bytes (drawable)); pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable), - x, y, width, height, FALSE); + x, y, width, height, FALSE); pixel_region_init (&destPR, gimp_drawable_get_shadow_tiles (drawable), - x, y, width, height, TRUE); + x, y, width, height, TRUE); pixel_regions_process_parallel ((PixelProcessorFunc) gimp_lut_process, lut, 2, &srcPR, &destPR); diff --git a/app/core/gimpdrawable-offset.c b/app/core/gimpdrawable-offset.c index fd270aff89..143ce76053 100644 --- a/app/core/gimpdrawable-offset.c +++ b/app/core/gimpdrawable-offset.c @@ -44,10 +44,10 @@ void gimp_drawable_offset (GimpDrawable *drawable, GimpContext *context, - gboolean wrap_around, - GimpOffsetType fill_type, - gint offset_x, - gint offset_y) + gboolean wrap_around, + GimpOffsetType fill_type, + gint offset_x, + gint offset_y) { GimpItem *item; PixelRegion srcPR, destPR; @@ -69,9 +69,9 @@ gimp_drawable_offset (GimpDrawable *drawable, { /* avoid modulo operation on negative values */ while (offset_x < 0) - offset_x += width; + offset_x += width; while (offset_y < 0) - offset_y += height; + offset_y += height; offset_x %= width; offset_y %= height; @@ -116,9 +116,9 @@ gimp_drawable_offset (GimpDrawable *drawable, if (width && height) { pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable), - src_x, src_y, width, height, FALSE); + src_x, src_y, width, height, FALSE); pixel_region_init (&destPR, new_tiles, - dest_x, dest_y, width, height, TRUE); + dest_x, dest_y, width, height, TRUE); copy_region (&srcPR, &destPR); } @@ -127,189 +127,189 @@ gimp_drawable_offset (GimpDrawable *drawable, if (wrap_around == TRUE) { if (offset_x >= 0 && offset_y >= 0) - { - src_x = gimp_item_width (item) - offset_x; - src_y = gimp_item_height (item) - offset_y; - } + { + src_x = gimp_item_width (item) - offset_x; + src_y = gimp_item_height (item) - offset_y; + } else if (offset_x >= 0 && offset_y < 0) - { - src_x = gimp_item_width (item) - offset_x; - src_y = 0; - } + { + src_x = gimp_item_width (item) - offset_x; + src_y = 0; + } else if (offset_x < 0 && offset_y >= 0) - { - src_x = 0; - src_y = gimp_item_height (item) - offset_y; - } + { + src_x = 0; + src_y = gimp_item_height (item) - offset_y; + } else if (offset_x < 0 && offset_y < 0) - { - src_x = 0; - src_y = 0; - } + { + src_x = 0; + src_y = 0; + } dest_x = (src_x + offset_x) % gimp_item_width (item); if (dest_x < 0) - dest_x = gimp_item_width (item) + dest_x; + dest_x = gimp_item_width (item) + dest_x; dest_y = (src_y + offset_y) % gimp_item_height (item); if (dest_y < 0) - dest_y = gimp_item_height (item) + dest_y; + dest_y = gimp_item_height (item) + dest_y; /* intersecting region */ if (offset_x != 0 && offset_y != 0) - { - pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable), - src_x, src_y, + { + pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable), + src_x, src_y, ABS (offset_x), ABS (offset_y), - FALSE); - pixel_region_init (&destPR, new_tiles, - dest_x, dest_y, + FALSE); + pixel_region_init (&destPR, new_tiles, + dest_x, dest_y, ABS (offset_x), ABS (offset_y), - TRUE); - copy_region (&srcPR, &destPR); - } + TRUE); + copy_region (&srcPR, &destPR); + } /* X offset */ if (offset_x != 0) - { - if (offset_y >= 0) - { - pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable), - src_x, 0, ABS (offset_x), - gimp_item_height (item) - ABS (offset_y), - FALSE); - pixel_region_init (&destPR, new_tiles, - dest_x, dest_y + offset_y, - ABS (offset_x), - gimp_item_height (item) - ABS (offset_y), - TRUE); - } - else if (offset_y < 0) - { - pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable), - src_x, src_y - offset_y, - ABS (offset_x), - gimp_item_height (item) - ABS (offset_y), - FALSE); - pixel_region_init (&destPR, new_tiles, - dest_x, 0, - ABS (offset_x), - gimp_item_height (item) - ABS (offset_y), - TRUE); - } + { + if (offset_y >= 0) + { + pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable), + src_x, 0, ABS (offset_x), + gimp_item_height (item) - ABS (offset_y), + FALSE); + pixel_region_init (&destPR, new_tiles, + dest_x, dest_y + offset_y, + ABS (offset_x), + gimp_item_height (item) - ABS (offset_y), + TRUE); + } + else if (offset_y < 0) + { + pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable), + src_x, src_y - offset_y, + ABS (offset_x), + gimp_item_height (item) - ABS (offset_y), + FALSE); + pixel_region_init (&destPR, new_tiles, + dest_x, 0, + ABS (offset_x), + gimp_item_height (item) - ABS (offset_y), + TRUE); + } - copy_region (&srcPR, &destPR); - } + copy_region (&srcPR, &destPR); + } /* X offset */ if (offset_y != 0) - { - if (offset_x >= 0) - { - pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable), - 0, src_y, - gimp_item_width (item) - ABS (offset_x), - ABS (offset_y), FALSE); - pixel_region_init (&destPR, new_tiles, dest_x + offset_x, dest_y, - gimp_item_width (item) - ABS (offset_x), - ABS (offset_y), TRUE); - } - else if (offset_x < 0) - { - pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable), - src_x - offset_x, src_y, - gimp_item_width (item) - ABS (offset_x), - ABS (offset_y), FALSE); - pixel_region_init (&destPR, new_tiles, 0, dest_y, - gimp_item_width (item) - ABS (offset_x), - ABS (offset_y), TRUE); - } + { + if (offset_x >= 0) + { + pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable), + 0, src_y, + gimp_item_width (item) - ABS (offset_x), + ABS (offset_y), FALSE); + pixel_region_init (&destPR, new_tiles, dest_x + offset_x, dest_y, + gimp_item_width (item) - ABS (offset_x), + ABS (offset_y), TRUE); + } + else if (offset_x < 0) + { + pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable), + src_x - offset_x, src_y, + gimp_item_width (item) - ABS (offset_x), + ABS (offset_y), FALSE); + pixel_region_init (&destPR, new_tiles, 0, dest_y, + gimp_item_width (item) - ABS (offset_x), + ABS (offset_y), TRUE); + } - copy_region (&srcPR, &destPR); - } + copy_region (&srcPR, &destPR); + } } /* Otherwise, fill the vacated regions */ else { if (fill_type == GIMP_OFFSET_BACKGROUND) - { - GimpRGB color; + { + GimpRGB color; - gimp_context_get_background (context, &color); + gimp_context_get_background (context, &color); - gimp_rgb_get_uchar (&color, &fill[0], &fill[1], &fill[2]); + gimp_rgb_get_uchar (&color, &fill[0], &fill[1], &fill[2]); - if (gimp_drawable_has_alpha (drawable)) - fill[gimp_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) - { - dest_x = 0; - dest_y = 0; - } + { + dest_x = 0; + dest_y = 0; + } else if (offset_x >= 0 && offset_y < 0) - { - dest_x = 0; - dest_y = gimp_item_height (item) + offset_y; - } + { + dest_x = 0; + dest_y = gimp_item_height (item) + offset_y; + } else if (offset_x < 0 && offset_y >= 0) - { - dest_x = gimp_item_width (item) + offset_x; - dest_y = 0; - } + { + dest_x = gimp_item_width (item) + offset_x; + dest_y = 0; + } else if (offset_x < 0 && offset_y < 0) - { - dest_x = gimp_item_width (item) + offset_x; - dest_y = gimp_item_height (item) + offset_y; - } + { + dest_x = gimp_item_width (item) + offset_x; + dest_y = gimp_item_height (item) + offset_y; + } /* intersecting region */ if (offset_x != 0 && offset_y != 0) - { - pixel_region_init (&destPR, new_tiles, dest_x, dest_y, - ABS (offset_x), ABS (offset_y), TRUE); - color_region (&destPR, fill); - } + { + pixel_region_init (&destPR, new_tiles, dest_x, dest_y, + ABS (offset_x), ABS (offset_y), TRUE); + color_region (&destPR, fill); + } /* X offset */ if (offset_x != 0) - { - if (offset_y >= 0) - pixel_region_init (&destPR, new_tiles, - dest_x, dest_y + offset_y, - ABS (offset_x), - gimp_item_height (item) - ABS (offset_y), - TRUE); - else if (offset_y < 0) - pixel_region_init (&destPR, new_tiles, - dest_x, 0, - ABS (offset_x), - gimp_item_height (item) - ABS (offset_y), - TRUE); + { + if (offset_y >= 0) + pixel_region_init (&destPR, new_tiles, + dest_x, dest_y + offset_y, + ABS (offset_x), + gimp_item_height (item) - ABS (offset_y), + TRUE); + else if (offset_y < 0) + pixel_region_init (&destPR, new_tiles, + dest_x, 0, + ABS (offset_x), + gimp_item_height (item) - ABS (offset_y), + TRUE); - color_region (&destPR, fill); - } + color_region (&destPR, fill); + } /* X offset */ if (offset_y != 0) - { - if (offset_x >= 0) - pixel_region_init (&destPR, new_tiles, - dest_x + offset_x, - dest_y, - gimp_item_width (item) - ABS (offset_x), - ABS (offset_y), - TRUE); - else if (offset_x < 0) - pixel_region_init (&destPR, new_tiles, - 0, dest_y, - gimp_item_width (item) - ABS (offset_x), - ABS (offset_y), - TRUE); + { + if (offset_x >= 0) + pixel_region_init (&destPR, new_tiles, + dest_x + offset_x, + dest_y, + gimp_item_width (item) - ABS (offset_x), + ABS (offset_y), + TRUE); + else if (offset_x < 0) + pixel_region_init (&destPR, new_tiles, + 0, dest_y, + gimp_item_width (item) - ABS (offset_x), + ABS (offset_y), + TRUE); - color_region (&destPR, fill); - } + color_region (&destPR, fill); + } } gimp_drawable_set_tiles (drawable, gimp_item_is_attached (item), diff --git a/app/core/gimpdrawable-offset.h b/app/core/gimpdrawable-offset.h index 51532d20e3..76ff53909c 100644 --- a/app/core/gimpdrawable-offset.h +++ b/app/core/gimpdrawable-offset.h @@ -22,10 +22,10 @@ void gimp_drawable_offset (GimpDrawable *drawable, GimpContext *context, - gboolean wrap_around, - GimpOffsetType fill_type, - gint offset_x, - gint offset_y); + gboolean wrap_around, + GimpOffsetType fill_type, + gint offset_x, + gint offset_y); #endif /* __GIMP_DRAWABLE_OFFSET_H__ */ diff --git a/app/core/gimpdrawable-transform.c b/app/core/gimpdrawable-transform.c index aa4cf1fcd0..0ee7a8b70a 100644 --- a/app/core/gimpdrawable-transform.c +++ b/app/core/gimpdrawable-transform.c @@ -908,7 +908,7 @@ gimp_drawable_transform_affine (GimpDrawable *drawable, /* Start a transform undo group */ gimp_image_undo_group_start (image, - GIMP_UNDO_GROUP_TRANSFORM, _("Transform")); + GIMP_UNDO_GROUP_TRANSFORM, _("Transform")); /* Cut/Copy from the specified drawable */ orig_tiles = gimp_drawable_transform_cut (drawable, context, &new_layer); @@ -1763,7 +1763,7 @@ sample_lanczos (PixelSurround *surround, gdouble lu[LANCZOS_WIDTH2]; /* Lanczos sample value */ gdouble lv[LANCZOS_WIDTH2]; /* Lanczos sample value */ gdouble lusum, lvsum, weight; /* Lanczos weighting vars */ - gint i,j,row, byte; /* loop vars to fill source window */ + gint i,j,row, byte; /* loop vars to fill source window */ gint du,dv; guchar *data; diff --git a/app/core/gimpdrawable.h b/app/core/gimpdrawable.h index ea70980053..8746c2a16c 100644 --- a/app/core/gimpdrawable.h +++ b/app/core/gimpdrawable.h @@ -110,19 +110,19 @@ struct _GimpDrawableClass GType gimp_drawable_get_type (void) G_GNUC_CONST; void gimp_drawable_configure (GimpDrawable *drawable, - GimpImage *image, + GimpImage *image, gint offset_x, gint offset_y, - gint width, - gint height, - GimpImageType type, - const gchar *name); + gint width, + gint height, + GimpImageType type, + const gchar *name); void gimp_drawable_update (GimpDrawable *drawable, - gint x, - gint y, - gint width, - gint height); + gint x, + gint y, + gint width, + gint height); void gimp_drawable_alpha_changed (GimpDrawable *drawable); void gimp_drawable_invalidate_boundary (GimpDrawable *drawable); @@ -170,24 +170,24 @@ void gimp_drawable_swap_pixels (GimpDrawable *drawable, void gimp_drawable_push_undo (GimpDrawable *drawable, const gchar *undo_desc, - gint x1, - gint y1, - gint x2, - gint y2, - TileManager *tiles, - gboolean sparse); + gint x1, + gint y1, + gint x2, + gint y2, + TileManager *tiles, + gboolean sparse); TileManager * gimp_drawable_get_shadow_tiles (GimpDrawable *drawable); void gimp_drawable_merge_shadow (GimpDrawable *drawable, - gboolean push_undo, + gboolean push_undo, const gchar *undo_desc); void gimp_drawable_fill (GimpDrawable *drawable, - const GimpRGB *color, + const GimpRGB *color, const GimpPattern *pattern); void gimp_drawable_fill_by_type (GimpDrawable *drawable, - GimpContext *context, - GimpFillType fill_type); + GimpContext *context, + GimpFillType fill_type); gboolean gimp_drawable_mask_bounds (GimpDrawable *drawable, gint *x1, diff --git a/app/core/gimpgradient-load.c b/app/core/gimpgradient-load.c index c233cf1692..9bffcaa3e1 100644 --- a/app/core/gimpgradient-load.c +++ b/app/core/gimpgradient-load.c @@ -121,9 +121,9 @@ gimp_gradient_load (const gchar *filename, seg->prev = prev; if (prev) - prev->next = seg; + prev->next = seg; else - gradient->segments = seg; + gradient->segments = seg; fgets (line, 1024, file); @@ -154,17 +154,17 @@ gimp_gradient_load (const gchar *filename, if (errno != ERANGE && sscanf (end, "%d %d", &type, &color) == 2) { - seg->type = (GimpGradientSegmentType) type; - seg->color = (GimpGradientSegmentColor) color; + seg->type = (GimpGradientSegmentType) type; + seg->color = (GimpGradientSegmentColor) color; } else { - g_message (_("Corrupt segment %d in gradient file '%s'."), - i, gimp_filename_to_utf8 (filename)); + g_message (_("Corrupt segment %d in gradient file '%s'."), + i, gimp_filename_to_utf8 (filename)); g_object_unref (gradient); fclose (file); return NULL; - } + } if ( (prev && (prev->right < seg->left)) || (!prev && (0. < seg->left) )) diff --git a/app/core/gimpgradient-save.c b/app/core/gimpgradient-save.c index 9098ea9a4d..706831a13b 100644 --- a/app/core/gimpgradient-save.c +++ b/app/core/gimpgradient-save.c @@ -50,7 +50,7 @@ gimp_gradient_save (GimpData *data, g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_OPEN, _("Could not open '%s' for writing: %s"), gimp_filename_to_utf8 (data->filename), - g_strerror (errno)); + g_strerror (errno)); return FALSE; } @@ -111,8 +111,8 @@ gimp_gradient_save (GimpData *data, fprintf (file, "%s %s %s %s %s %s %s %s %s %s %s %d %d\n", buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7], buf[8], buf[9], buf[10], - (gint) seg->type, - (gint) seg->color); + (gint) seg->type, + (gint) seg->color); } fclose (file); @@ -151,8 +151,8 @@ gimp_gradient_save_as_pov (GimpGradient *gradient, fprintf (file, "color_map {\n"); for (seg = gradient->segments; seg; seg = seg->next) - { - /* Left */ + { + /* Left */ g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", seg->left); g_ascii_formatd (color_buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", @@ -164,11 +164,11 @@ gimp_gradient_save_as_pov (GimpGradient *gradient, g_ascii_formatd (color_buf[3], G_ASCII_DTOSTR_BUF_SIZE, "%f", 1.0 - seg->left_color.a); - fprintf (file, "\t[%s color rgbt <%s, %s, %s, %s>]\n", - buf, + fprintf (file, "\t[%s color rgbt <%s, %s, %s, %s>]\n", + buf, color_buf[0], color_buf[1], color_buf[2], color_buf[3]); - /* Middle */ + /* Middle */ g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", seg->middle); g_ascii_formatd (color_buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", @@ -180,11 +180,11 @@ gimp_gradient_save_as_pov (GimpGradient *gradient, g_ascii_formatd (color_buf[3], G_ASCII_DTOSTR_BUF_SIZE, "%f", 1.0 - (seg->left_color.a + seg->right_color.a) / 2.0); - fprintf (file, "\t[%s color rgbt <%s, %s, %s, %s>]\n", - buf, - color_buf[0], color_buf[1], color_buf[2], color_buf[3]); + fprintf (file, "\t[%s color rgbt <%s, %s, %s, %s>]\n", + buf, + color_buf[0], color_buf[1], color_buf[2], color_buf[3]); - /* Right */ + /* Right */ g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", seg->right); g_ascii_formatd (color_buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", @@ -196,10 +196,10 @@ gimp_gradient_save_as_pov (GimpGradient *gradient, g_ascii_formatd (color_buf[3], G_ASCII_DTOSTR_BUF_SIZE, "%f", 1.0 - seg->right_color.a); - fprintf (file, "\t[%s color rgbt <%s, %s, %s, %s>]\n", - buf, - color_buf[0], color_buf[1], color_buf[2], color_buf[3]); - } + fprintf (file, "\t[%s color rgbt <%s, %s, %s, %s>]\n", + buf, + color_buf[0], color_buf[1], color_buf[2], color_buf[3]); + } fprintf (file, "} /* color_map */\n"); fclose (file); diff --git a/app/core/gimpgradient.c b/app/core/gimpgradient.c index d336e4aa24..545427a8c4 100644 --- a/app/core/gimpgradient.c +++ b/app/core/gimpgradient.c @@ -173,8 +173,8 @@ gimp_gradient_get_popup_size (GimpViewable *viewable, static TempBuf * gimp_gradient_get_new_preview (GimpViewable *viewable, - gint width, - gint height) + gint width, + gint height) { GimpGradient *gradient = GIMP_GRADIENT (viewable); GimpGradientSegment *seg = NULL; @@ -238,9 +238,9 @@ gimp_gradient_duplicate (GimpData *data) cur->next = NULL; if (prev) - prev->next = cur; + prev->next = cur; else - head = cur; /* Remember head */ + head = cur; /* Remember head */ prev = cur; orig = orig->next; @@ -367,7 +367,7 @@ gimp_gradient_get_color_at (GimpGradient *gradient, default: g_warning ("%s: Unknown gradient type %d.", - G_STRFUNC, seg->type); + G_STRFUNC, seg->type); break; } @@ -379,10 +379,10 @@ gimp_gradient_get_color_at (GimpGradient *gradient, seg->left_color.r + (seg->right_color.r - seg->left_color.r) * factor; rgb.g = - seg->left_color.g + (seg->right_color.g - seg->left_color.g) * factor; + seg->left_color.g + (seg->right_color.g - seg->left_color.g) * factor; rgb.b = - seg->left_color.b + (seg->right_color.b - seg->left_color.b) * factor; + seg->left_color.b + (seg->right_color.b - seg->left_color.b) * factor; } else { @@ -396,40 +396,40 @@ gimp_gradient_get_color_at (GimpGradient *gradient, left_hsv.v = left_hsv.v + (right_hsv.v - left_hsv.v) * factor; switch (seg->color) - { - case GIMP_GRADIENT_SEGMENT_HSV_CCW: - if (left_hsv.h < right_hsv.h) - { - left_hsv.h += (right_hsv.h - left_hsv.h) * factor; - } - else - { - left_hsv.h += (1.0 - (left_hsv.h - right_hsv.h)) * factor; + { + case GIMP_GRADIENT_SEGMENT_HSV_CCW: + if (left_hsv.h < right_hsv.h) + { + left_hsv.h += (right_hsv.h - left_hsv.h) * factor; + } + else + { + left_hsv.h += (1.0 - (left_hsv.h - right_hsv.h)) * factor; - if (left_hsv.h > 1.0) - left_hsv.h -= 1.0; - } - break; + if (left_hsv.h > 1.0) + left_hsv.h -= 1.0; + } + break; - case GIMP_GRADIENT_SEGMENT_HSV_CW: - if (right_hsv.h < left_hsv.h) - { - left_hsv.h -= (left_hsv.h - right_hsv.h) * factor; - } - else - { - left_hsv.h -= (1.0 - (right_hsv.h - left_hsv.h)) * factor; + case GIMP_GRADIENT_SEGMENT_HSV_CW: + if (right_hsv.h < left_hsv.h) + { + left_hsv.h -= (left_hsv.h - right_hsv.h) * factor; + } + else + { + left_hsv.h -= (1.0 - (right_hsv.h - left_hsv.h)) * factor; - if (left_hsv.h < 0.0) - left_hsv.h += 1.0; - } - break; + if (left_hsv.h < 0.0) + left_hsv.h += 1.0; + } + break; - default: - g_warning ("%s: Unknown coloring mode %d", - G_STRFUNC, (gint) seg->color); - break; - } + default: + g_warning ("%s: Unknown coloring mode %d", + G_STRFUNC, (gint) seg->color); + break; + } gimp_hsv_to_rgb (&left_hsv, &rgb); } @@ -641,7 +641,7 @@ gimp_gradient_segment_split_uniform (GimpGradient *gradient, seg = gimp_gradient_segment_new (); if (i == 0) - tmp = seg; /* Remember first segment */ + tmp = seg; /* Remember first segment */ seg->left = lseg->left + i * seg_len; seg->right = lseg->left + (i + 1) * seg_len; @@ -659,7 +659,7 @@ gimp_gradient_segment_split_uniform (GimpGradient *gradient, seg->next = NULL; if (prev) - prev->next = seg; + prev->next = seg; prev = seg; } @@ -963,21 +963,21 @@ gimp_gradient_segment_range_blend (GimpGradient *gradient, do { if (blend_colors) - { - seg->left_color.r = rgb1->r + (seg->left - left) / len * d.r; - seg->left_color.g = rgb1->g + (seg->left - left) / len * d.g; - seg->left_color.b = rgb1->b + (seg->left - left) / len * d.b; + { + seg->left_color.r = rgb1->r + (seg->left - left) / len * d.r; + seg->left_color.g = rgb1->g + (seg->left - left) / len * d.g; + seg->left_color.b = rgb1->b + (seg->left - left) / len * d.b; - seg->right_color.r = rgb1->r + (seg->right - left) / len * d.r; - seg->right_color.g = rgb1->g + (seg->right - left) / len * d.g; - seg->right_color.b = rgb1->b + (seg->right - left) / len * d.b; - } + seg->right_color.r = rgb1->r + (seg->right - left) / len * d.r; + seg->right_color.g = rgb1->g + (seg->right - left) / len * d.g; + seg->right_color.b = rgb1->b + (seg->right - left) / len * d.b; + } if (blend_opacity) - { - seg->left_color.a = rgb1->a + (seg->left - left) / len * d.a; - seg->right_color.a = rgb1->a + (seg->right - left) / len * d.a; - } + { + seg->left_color.a = rgb1->a + (seg->left - left) / len * d.a; + seg->right_color.a = rgb1->a + (seg->right - left) / len * d.a; + } aseg = seg; seg = seg->next; @@ -1072,12 +1072,12 @@ gimp_gradient_segment_range_flip (GimpGradient *gradient, seg = gimp_gradient_segment_new (); if (prev == NULL) - { - seg->left = left; - tmp = seg; /* Remember first segment */ - } + { + seg->left = left; + tmp = seg; /* Remember first segment */ + } else - seg->left = left + right - oseg->right; + seg->left = left + right - oseg->right; seg->middle = left + right - oseg->middle; seg->right = left + right - oseg->left; @@ -1087,38 +1087,38 @@ gimp_gradient_segment_range_flip (GimpGradient *gradient, seg->right_color = oseg->left_color; switch (oseg->type) - { - case GIMP_GRADIENT_SEGMENT_SPHERE_INCREASING: - seg->type = GIMP_GRADIENT_SEGMENT_SPHERE_DECREASING; - break; + { + case GIMP_GRADIENT_SEGMENT_SPHERE_INCREASING: + seg->type = GIMP_GRADIENT_SEGMENT_SPHERE_DECREASING; + break; - case GIMP_GRADIENT_SEGMENT_SPHERE_DECREASING: - seg->type = GIMP_GRADIENT_SEGMENT_SPHERE_INCREASING; - break; + case GIMP_GRADIENT_SEGMENT_SPHERE_DECREASING: + seg->type = GIMP_GRADIENT_SEGMENT_SPHERE_INCREASING; + break; - default: - seg->type = oseg->type; - } + default: + seg->type = oseg->type; + } switch (oseg->color) - { - case GIMP_GRADIENT_SEGMENT_HSV_CCW: - seg->color = GIMP_GRADIENT_SEGMENT_HSV_CW; - break; + { + case GIMP_GRADIENT_SEGMENT_HSV_CCW: + seg->color = GIMP_GRADIENT_SEGMENT_HSV_CW; + break; - case GIMP_GRADIENT_SEGMENT_HSV_CW: - seg->color = GIMP_GRADIENT_SEGMENT_HSV_CCW; - break; + case GIMP_GRADIENT_SEGMENT_HSV_CW: + seg->color = GIMP_GRADIENT_SEGMENT_HSV_CCW; + break; - default: - seg->color = oseg->color; - } + default: + seg->color = oseg->color; + } seg->prev = prev; seg->next = NULL; if (prev) - prev->next = seg; + prev->next = seg; prev = seg; @@ -1418,7 +1418,7 @@ gimp_gradient_segment_range_delete (GimpGradient *gradient, /* Calculate join point */ join = (start_seg->left + - end_seg->right) / 2.0; + end_seg->right) / 2.0; if (lseg == NULL) join = 0.0; @@ -1714,20 +1714,20 @@ gimp_gradient_get_segment_at_internal (GimpGradient *gradient, while (seg) { if (pos >= seg->left) - { - if (pos <= seg->right) - { - return seg; - } - else - { - seg = seg->next; - } - } + { + if (pos <= seg->right) + { + return seg; + } + else + { + seg = seg->next; + } + } else - { - seg = seg->prev; - } + { + seg = seg->prev; + } } /* Oops: we should have found a segment, but we didn't */ @@ -1738,14 +1738,14 @@ gimp_gradient_get_segment_at_internal (GimpGradient *gradient, static inline gdouble gimp_gradient_calc_linear_factor (gdouble middle, - gdouble pos) + gdouble pos) { if (pos <= middle) { if (middle < EPSILON) - return 0.0; + return 0.0; else - return 0.5 * pos / middle; + return 0.5 * pos / middle; } else { @@ -1753,15 +1753,15 @@ gimp_gradient_calc_linear_factor (gdouble middle, middle = 1.0 - middle; if (middle < EPSILON) - return 1.0; + return 1.0; else - return 0.5 + 0.5 * pos / middle; + return 0.5 + 0.5 * pos / middle; } } static inline gdouble gimp_gradient_calc_curved_factor (gdouble middle, - gdouble pos) + gdouble pos) { if (middle < EPSILON) middle = EPSILON; @@ -1771,7 +1771,7 @@ gimp_gradient_calc_curved_factor (gdouble middle, static inline gdouble gimp_gradient_calc_sine_factor (gdouble middle, - gdouble pos) + gdouble pos) { pos = gimp_gradient_calc_linear_factor (middle, pos); @@ -1780,7 +1780,7 @@ gimp_gradient_calc_sine_factor (gdouble middle, static inline gdouble gimp_gradient_calc_sphere_increasing_factor (gdouble middle, - gdouble pos) + gdouble pos) { pos = gimp_gradient_calc_linear_factor (middle, pos) - 1.0; @@ -1790,7 +1790,7 @@ gimp_gradient_calc_sphere_increasing_factor (gdouble middle, static inline gdouble gimp_gradient_calc_sphere_decreasing_factor (gdouble middle, - gdouble pos) + gdouble pos) { pos = gimp_gradient_calc_linear_factor (middle, pos); diff --git a/app/core/gimpgrid.c b/app/core/gimpgrid.c index 025e2c9ba8..4b1ae6d4b4 100644 --- a/app/core/gimpgrid.c +++ b/app/core/gimpgrid.c @@ -98,37 +98,37 @@ gimp_grid_class_init (GimpGridClass *klass) &white, GIMP_PARAM_STATIC_STRINGS); GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_XSPACING, - "xspacing", + "xspacing", N_("Horizontal spacing of grid lines."), - 1.0, GIMP_MAX_IMAGE_SIZE, 32.0, - GIMP_PARAM_STATIC_STRINGS); + 1.0, GIMP_MAX_IMAGE_SIZE, 32.0, + GIMP_PARAM_STATIC_STRINGS); GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_YSPACING, - "yspacing", + "yspacing", N_("Vertical spacing of grid lines."), - 1.0, GIMP_MAX_IMAGE_SIZE, 32.0, - GIMP_PARAM_STATIC_STRINGS); + 1.0, GIMP_MAX_IMAGE_SIZE, 32.0, + GIMP_PARAM_STATIC_STRINGS); GIMP_CONFIG_INSTALL_PROP_UNIT (object_class, PROP_SPACING_UNIT, - "spacing-unit", NULL, - FALSE, FALSE, GIMP_UNIT_INCH, - GIMP_PARAM_STATIC_STRINGS); + "spacing-unit", NULL, + FALSE, FALSE, GIMP_UNIT_INCH, + GIMP_PARAM_STATIC_STRINGS); GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_XOFFSET, - "xoffset", + "xoffset", N_("Horizontal offset of the first grid " "line; this may be a negative number."), - - GIMP_MAX_IMAGE_SIZE, + - GIMP_MAX_IMAGE_SIZE, GIMP_MAX_IMAGE_SIZE, 0.0, - GIMP_PARAM_STATIC_STRINGS); + GIMP_PARAM_STATIC_STRINGS); GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_YOFFSET, - "yoffset", + "yoffset", N_("Vertical offset of the first grid " "line; this may be a negative number."), - - GIMP_MAX_IMAGE_SIZE, + - GIMP_MAX_IMAGE_SIZE, GIMP_MAX_IMAGE_SIZE, 0.0, - GIMP_PARAM_STATIC_STRINGS); + GIMP_PARAM_STATIC_STRINGS); GIMP_CONFIG_INSTALL_PROP_UNIT (object_class, PROP_OFFSET_UNIT, - "offset-unit", NULL, - FALSE, FALSE, GIMP_UNIT_INCH, - GIMP_PARAM_STATIC_STRINGS); + "offset-unit", NULL, + FALSE, FALSE, GIMP_UNIT_INCH, + GIMP_PARAM_STATIC_STRINGS); } static void diff --git a/app/core/gimpimage-colorhash.c b/app/core/gimpimage-colorhash.c index 708b63db2e..d5ff45122e 100644 --- a/app/core/gimpimage-colorhash.c +++ b/app/core/gimpimage-colorhash.c @@ -77,7 +77,7 @@ gimp_image_color_hash_exit (void) void gimp_image_color_hash_invalidate (GimpImage *image, - gint index) + gint index) { gint i; @@ -86,7 +86,7 @@ gimp_image_color_hash_invalidate (GimpImage *image, if (index == -1) /* invalidate all entries */ { for (i = 0; i < HASH_TABLE_SIZE; i++) - if (color_hash_table[i].image == image) + if (color_hash_table[i].image == image) { color_hash_table[i].pixel = 0; color_hash_table[i].index = 0; @@ -96,8 +96,8 @@ gimp_image_color_hash_invalidate (GimpImage *image, else { for (i = 0; i < HASH_TABLE_SIZE; i++) - if (color_hash_table[i].image == image && - color_hash_table[i].index == index) + if (color_hash_table[i].image == image && + color_hash_table[i].index == index) { color_hash_table[i].pixel = 0; color_hash_table[i].index = 0; @@ -108,9 +108,9 @@ gimp_image_color_hash_invalidate (GimpImage *image, gint gimp_image_color_hash_rgb_to_indexed (const GimpImage *image, - gint r, - gint g, - gint b) + gint r, + gint g, + gint b) { guchar *cmap; gint num_cols; @@ -144,22 +144,22 @@ gimp_image_color_hash_rgb_to_indexed (const GimpImage *image, col = cmap; for (i = 0; i < num_cols; i++) - { - diff = r - *col++; - sum = diff * diff; + { + diff = r - *col++; + sum = diff * diff; - diff = g - *col++; - sum += diff * diff; + diff = g - *col++; + sum += diff * diff; - diff = b - *col++; - sum += diff * diff; + diff = b - *col++; + sum += diff * diff; - if (sum < max) - { - cmap_index = i; - max = sum; - } - } + if (sum < max) + { + cmap_index = i; + max = sum; + } + } /* update the hash table */ color_hash_table[hash_index].pixel = pixel; diff --git a/app/core/gimpimage-colorhash.h b/app/core/gimpimage-colorhash.h index a470d057d9..40beca2235 100644 --- a/app/core/gimpimage-colorhash.h +++ b/app/core/gimpimage-colorhash.h @@ -24,12 +24,12 @@ void gimp_image_color_hash_init (void); void gimp_image_color_hash_exit (void); void gimp_image_color_hash_invalidate (GimpImage *image, - gint index); + gint index); gint gimp_image_color_hash_rgb_to_indexed (const GimpImage *image, - gint r, - gint g, - gint b); + gint r, + gint g, + gint b); #endif /* __GIMP_IMAGE_COLOR_HASH_H__ */ diff --git a/app/core/gimpimage-contiguous-region.c b/app/core/gimpimage-contiguous-region.c index 0f4b897972..591804eabe 100644 --- a/app/core/gimpimage-contiguous-region.c +++ b/app/core/gimpimage-contiguous-region.c @@ -142,10 +142,10 @@ gimp_image_contiguous_region_by_seed (GimpImage *image, mask = gimp_channel_new_mask (image, srcPR.w, srcPR.h); pixel_region_init (&maskPR, gimp_drawable_get_tiles (GIMP_DRAWABLE (mask)), - 0, 0, - gimp_item_width (GIMP_ITEM (mask)), - gimp_item_height (GIMP_ITEM (mask)), - TRUE); + 0, 0, + gimp_item_width (GIMP_ITEM (mask)), + gimp_item_height (GIMP_ITEM (mask)), + TRUE); tile = tile_manager_get_tile (srcPR.tiles, x, y, TRUE, FALSE); if (tile) @@ -266,7 +266,7 @@ gimp_image_contiguous_region_by_color (GimpImage *image, mask = gimp_channel_new_mask (image, width, height); pixel_region_init (&maskPR, gimp_drawable_get_tiles (GIMP_DRAWABLE (mask)), - 0, 0, width, height, + 0, 0, width, height, TRUE); pixel_regions_process_parallel ((PixelProcessorFunc) @@ -356,30 +356,30 @@ pixel_difference (guchar *col1, gfloat aa = 1.5 - ((gfloat) max / threshold); if (aa <= 0.0) - return 0; + return 0; else if (aa < 0.5) - return (guchar) (aa * 512); + return (guchar) (aa * 512); else - return 255; + return 255; } else { if (max > threshold) - return 0; + return 0; else - return 255; + return 255; } } static void ref_tiles (TileManager *src, - TileManager *mask, - Tile **s_tile, - Tile **m_tile, - gint x, - gint y, - guchar **s, - guchar **m) + TileManager *mask, + Tile **s_tile, + Tile **m_tile, + gint x, + gint y, + guchar **s, + guchar **m) { if (*s_tile != NULL) tile_release (*s_tile, FALSE); @@ -396,18 +396,18 @@ ref_tiles (TileManager *src, static int find_contiguous_segment (GimpImage *image, guchar *col, - PixelRegion *src, - PixelRegion *mask, - gint width, - gint bytes, + PixelRegion *src, + PixelRegion *mask, + gint width, + gint bytes, GimpImageType src_type, - gboolean has_alpha, + gboolean has_alpha, gboolean select_transparent, - gboolean antialias, - gint threshold, - gint initial, - gint *start, - gint *end) + gboolean antialias, + gint threshold, + gint initial, + gint *start, + gint *end) { guchar *s; guchar *m; @@ -450,7 +450,7 @@ find_contiguous_segment (GimpImage *image, while (*start >= 0 && diff) { if (! ((*start + 1) % TILE_WIDTH)) - ref_tiles (src->tiles, mask->tiles, + ref_tiles (src->tiles, mask->tiles, &s_tile, &m_tile, *start, src->y, &s, &m); if (GIMP_IMAGE_TYPE_IS_INDEXED (src_type)) @@ -467,10 +467,10 @@ find_contiguous_segment (GimpImage *image, } if ((*m-- = diff)) - { - s -= bytes; - (*start)--; - } + { + s -= bytes; + (*start)--; + } } diff = 1; @@ -483,7 +483,7 @@ find_contiguous_segment (GimpImage *image, while (*end < width && diff) { if (! (*end % TILE_WIDTH)) - ref_tiles (src->tiles, mask->tiles, + ref_tiles (src->tiles, mask->tiles, &s_tile, &m_tile, *end, src->y, &s, &m); if (GIMP_IMAGE_TYPE_IS_INDEXED (src_type)) @@ -500,10 +500,10 @@ find_contiguous_segment (GimpImage *image, } if ((*m++ = diff)) - { - s += bytes; - (*end)++; - } + { + s += bytes; + (*end)++; + } } tile_release (s_tile, FALSE); @@ -515,15 +515,15 @@ find_contiguous_segment (GimpImage *image, static void find_contiguous_region_helper (GimpImage *image, PixelRegion *mask, - PixelRegion *src, + PixelRegion *src, GimpImageType src_type, - gboolean has_alpha, + gboolean has_alpha, gboolean select_transparent, - gboolean antialias, - gint threshold, - gint x, - gint y, - guchar *col) + gboolean antialias, + gint threshold, + gint x, + gint y, + guchar *col) { gint start, end; gint new_start, new_end; @@ -550,31 +550,31 @@ find_contiguous_region_helper (GimpImage *image, for (x = start + 1; x < end; x++) { - tile = tile_manager_get_tile (mask->tiles, x, y, TRUE, FALSE); - val = *(guchar *) (tile_data_pointer (tile, + tile = tile_manager_get_tile (mask->tiles, x, y, TRUE, FALSE); + val = *(guchar *) (tile_data_pointer (tile, x % TILE_WIDTH, y % TILE_HEIGHT)); - tile_release (tile, FALSE); - if (val != 0) + tile_release (tile, FALSE); + if (val != 0) continue; - src->x = x; - src->y = y; + src->x = x; + src->y = y; - if (! find_contiguous_segment (image, col, src, mask, src->w, + if (! find_contiguous_segment (image, col, src, mask, src->w, src->bytes, src_type, has_alpha, select_transparent, antialias, - threshold, x, &new_start, &new_end)) - continue; + threshold, x, &new_start, &new_end)) + continue; - if (y + 1 < src->h) + if (y + 1 < src->h) { g_queue_push_tail (coord_stack, GINT_TO_POINTER (y + 1)); g_queue_push_tail (coord_stack, GINT_TO_POINTER (new_start)); g_queue_push_tail (coord_stack, GINT_TO_POINTER (new_end)); } - if (y - 1 >= 0) + if (y - 1 >= 0) { g_queue_push_tail (coord_stack, GINT_TO_POINTER (y - 1)); g_queue_push_tail (coord_stack, GINT_TO_POINTER (new_start)); diff --git a/app/core/gimpimage-crop.c b/app/core/gimpimage-crop.c index 03070d7b36..841fe0992b 100644 --- a/app/core/gimpimage-crop.c +++ b/app/core/gimpimage-crop.c @@ -77,12 +77,12 @@ static gint gimp_image_crop_colors_alpha (guchar *col1, void gimp_image_crop (GimpImage *image, GimpContext *context, - gint x1, - gint y1, - gint x2, - gint y2, - gboolean active_layer_only, - gboolean crop_layers) + gint x1, + gint y1, + gint x2, + gint y2, + gboolean active_layer_only, + gboolean crop_layers) { gint width, height; @@ -269,15 +269,15 @@ gimp_image_crop (GimpImage *image, gboolean gimp_image_crop_auto_shrink (GimpImage *image, - gint x1, - gint y1, - gint x2, - gint y2, - gboolean active_drawable_only, - gint *shrunk_x1, - gint *shrunk_y1, - gint *shrunk_x2, - gint *shrunk_y2) + gint x1, + gint y1, + gint x2, + gint y2, + gboolean active_drawable_only, + gint *shrunk_x1, + gint *shrunk_y1, + gint *shrunk_x2, + gint *shrunk_y2) { GimpDrawable *active_drawable = NULL; GimpPickable *pickable; @@ -311,7 +311,7 @@ gimp_image_crop_auto_shrink (GimpImage *image, active_drawable = gimp_image_active_drawable (image); if (! active_drawable) - goto FINISH; + goto FINISH; pickable = GIMP_PICKABLE (active_drawable); } @@ -327,8 +327,8 @@ gimp_image_crop_auto_shrink (GimpImage *image, has_alpha = GIMP_IMAGE_TYPE_HAS_ALPHA (type); switch (gimp_image_crop_guess_bgcolor (pickable, - bytes, has_alpha, bgcolor, - x1, x2-1, y1, y2-1)) + bytes, has_alpha, bgcolor, + x1, x2-1, y1, y2-1)) { case AUTO_CROP_ALPHA: colors_equal_func = (ColorsEqualFunc) gimp_image_crop_colors_alpha; @@ -359,7 +359,7 @@ gimp_image_crop_auto_shrink (GimpImage *image, { pixel_region_get_row (&PR, x1, y, width, buffer, 1); for (x = 0; x < width && !abort; x++) - abort = !(colors_equal_func) (bgcolor, buffer + x * bytes, bytes); + abort = !(colors_equal_func) (bgcolor, buffer + x * bytes, bytes); } if (y == y2 && !abort) goto FINISH; @@ -371,7 +371,7 @@ gimp_image_crop_auto_shrink (GimpImage *image, { pixel_region_get_row (&PR, x1, y-1 , width, buffer, 1); for (x = 0; x < width && !abort; x++) - abort = !(colors_equal_func) (bgcolor, buffer + x * bytes, bytes); + abort = !(colors_equal_func) (bgcolor, buffer + x * bytes, bytes); } y2 = y + 1; @@ -384,7 +384,7 @@ gimp_image_crop_auto_shrink (GimpImage *image, { pixel_region_get_col (&PR, x, y1, height, buffer, 1); for (y = 0; y < height && !abort; y++) - abort = !(colors_equal_func) (bgcolor, buffer + y * bytes, bytes); + abort = !(colors_equal_func) (bgcolor, buffer + y * bytes, bytes); } x1 = x - 1; @@ -394,7 +394,7 @@ gimp_image_crop_auto_shrink (GimpImage *image, { pixel_region_get_col (&PR, x-1, y1, height, buffer, 1); for (y = 0; y < height && !abort; y++) - abort = !(colors_equal_func) (bgcolor, buffer + y * bytes, bytes); + abort = !(colors_equal_func) (bgcolor, buffer + y * bytes, bytes); } x2 = x + 1; @@ -417,13 +417,13 @@ gimp_image_crop_auto_shrink (GimpImage *image, static AutoCropType gimp_image_crop_guess_bgcolor (GimpPickable *pickable, - gint bytes, - gboolean has_alpha, - guchar *color, - gint x1, - gint x2, - gint y1, - gint y2) + gint bytes, + gboolean has_alpha, + guchar *color, + gint x1, + gint x2, + gint y1, + gint y2) { guchar *tl = NULL; guchar *tr = NULL; @@ -451,16 +451,16 @@ gimp_image_crop_guess_bgcolor (GimpPickable *pickable, { alpha = bytes - 1; if ((tl[alpha] == 0 && tr[alpha] == 0) || - (tl[alpha] == 0 && bl[alpha] == 0) || - (tr[alpha] == 0 && br[alpha] == 0) || - (bl[alpha] == 0 && br[alpha] == 0)) - { - g_free (tl); - g_free (tr); - g_free (bl); - g_free (br); - return AUTO_CROP_ALPHA; - } + (tl[alpha] == 0 && bl[alpha] == 0) || + (tr[alpha] == 0 && br[alpha] == 0) || + (bl[alpha] == 0 && br[alpha] == 0)) + { + g_free (tl); + g_free (tr); + g_free (bl); + g_free (br); + return AUTO_CROP_ALPHA; + } } if (gimp_image_crop_colors_equal (tl, tr, bytes) || @@ -469,7 +469,7 @@ gimp_image_crop_guess_bgcolor (GimpPickable *pickable, memcpy (color, tl, bytes); } else if (gimp_image_crop_colors_equal (br, bl, bytes) || - gimp_image_crop_colors_equal (br, tr, bytes)) + gimp_image_crop_colors_equal (br, tr, bytes)) { memcpy (color, br, bytes); } @@ -494,8 +494,8 @@ gimp_image_crop_guess_bgcolor (GimpPickable *pickable, static int gimp_image_crop_colors_equal (guchar *col1, - guchar *col2, - gint bytes) + guchar *col2, + gint bytes) { gint b; @@ -510,8 +510,8 @@ gimp_image_crop_colors_equal (guchar *col1, static gboolean gimp_image_crop_colors_alpha (guchar *dummy, - guchar *col, - gint bytes) + guchar *col, + gint bytes) { return (col[bytes - 1] == 0); } diff --git a/app/core/gimpimage-crop.h b/app/core/gimpimage-crop.h index a48238fcd5..df0d97416a 100644 --- a/app/core/gimpimage-crop.h +++ b/app/core/gimpimage-crop.h @@ -22,23 +22,23 @@ void gimp_image_crop (GimpImage *image, GimpContext *context, - gint x1, - gint y1, - gint x2, - gint y2, - gboolean active_layer_only, - gboolean crop_layers); + gint x1, + gint y1, + gint x2, + gint y2, + gboolean active_layer_only, + gboolean crop_layers); gboolean gimp_image_crop_auto_shrink (GimpImage *image, - gint x1, - gint y1, - gint x2, - gint y2, - gboolean active_drawable_only, - gint *shrunk_x1, - gint *shrunk_y1, - gint *shrunk_x2, - gint *shrunk_y2); + gint x1, + gint y1, + gint x2, + gint y2, + gboolean active_drawable_only, + gint *shrunk_x1, + gint *shrunk_y1, + gint *shrunk_x2, + gint *shrunk_y2); #endif /* __GIMP_IMAGE_CROP_H__ */ diff --git a/app/core/gimpimage-duplicate.c b/app/core/gimpimage-duplicate.c index deba49825f..ed41e59713 100644 --- a/app/core/gimpimage-duplicate.c +++ b/app/core/gimpimage-duplicate.c @@ -61,9 +61,9 @@ gimp_image_duplicate (GimpImage *image) /* Create a new image */ new_image = gimp_create_image (image->gimp, - image->width, image->height, - image->base_type, - FALSE); + image->width, image->height, + image->base_type, + FALSE); gimp_image_undo_disable (new_image); /* Copy the colormap if necessary */ @@ -103,7 +103,7 @@ gimp_image_duplicate (GimpImage *image) /* Make sure the copied layer doesn't say: " copy" */ gimp_object_set_name (GIMP_OBJECT (new_layer), - gimp_object_get_name (GIMP_OBJECT (layer))); + gimp_object_get_name (GIMP_OBJECT (layer))); /* Make sure that if the layer has a layer mask, * its name isn't screwed up @@ -113,16 +113,16 @@ gimp_image_duplicate (GimpImage *image) gimp_object_get_name (GIMP_OBJECT (layer->mask))); if (gimp_image_get_active_layer (image) == layer) - active_layer = new_layer; + active_layer = new_layer; if (image->floating_sel == layer) - floating_layer = new_layer; + floating_layer = new_layer; if (floating_sel_drawable == GIMP_DRAWABLE (layer)) - new_floating_sel_drawable = GIMP_DRAWABLE (new_layer); + new_floating_sel_drawable = GIMP_DRAWABLE (new_layer); if (floating_layer != new_layer) - gimp_image_add_layer (new_image, new_layer, count++); + gimp_image_add_layer (new_image, new_layer, count++); } /* Copy the channels */ @@ -141,13 +141,13 @@ gimp_image_duplicate (GimpImage *image) /* Make sure the copied channel doesn't say: " copy" */ gimp_object_set_name (GIMP_OBJECT (new_channel), - gimp_object_get_name (GIMP_OBJECT (channel))); + gimp_object_get_name (GIMP_OBJECT (channel))); if (gimp_image_get_active_channel (image) == channel) - active_channel = (new_channel); + active_channel = (new_channel); if (floating_sel_drawable == GIMP_DRAWABLE (channel)) - new_floating_sel_drawable = GIMP_DRAWABLE (new_channel); + new_floating_sel_drawable = GIMP_DRAWABLE (new_channel); gimp_image_add_channel (new_image, new_channel, count++); } @@ -168,10 +168,10 @@ gimp_image_duplicate (GimpImage *image) /* Make sure the copied vectors doesn't say: " copy" */ gimp_object_set_name (GIMP_OBJECT (new_vectors), - gimp_object_get_name (GIMP_OBJECT (vectors))); + gimp_object_get_name (GIMP_OBJECT (vectors))); if (gimp_image_get_active_vectors (image) == vectors) - active_vectors = new_vectors; + active_vectors = new_vectors; gimp_image_add_vectors (new_image, new_vectors, count++); } @@ -224,18 +224,18 @@ gimp_image_duplicate (GimpImage *image) GimpGuide *guide = list->data; switch (guide->orientation) - { - case GIMP_ORIENTATION_HORIZONTAL: - gimp_image_add_hguide (new_image, guide->position, FALSE); - break; + { + case GIMP_ORIENTATION_HORIZONTAL: + gimp_image_add_hguide (new_image, guide->position, FALSE); + break; - case GIMP_ORIENTATION_VERTICAL: - gimp_image_add_vguide (new_image, guide->position, FALSE); - break; + case GIMP_ORIENTATION_VERTICAL: + gimp_image_add_vguide (new_image, guide->position, FALSE); + break; - default: - g_error ("Unknown guide orientation.\n"); - } + default: + g_error ("Unknown guide orientation.\n"); + } } /* Copy any sample points */ diff --git a/app/core/gimpimage-flip.c b/app/core/gimpimage-flip.c index e15484d4e7..a188d869a9 100644 --- a/app/core/gimpimage-flip.c +++ b/app/core/gimpimage-flip.c @@ -127,22 +127,22 @@ gimp_image_flip (GimpImage *image, GimpGuide *guide = list->data; switch (guide->orientation) - { - case GIMP_ORIENTATION_HORIZONTAL: + { + case GIMP_ORIENTATION_HORIZONTAL: if (flip_type == GIMP_ORIENTATION_VERTICAL) gimp_image_move_guide (image, guide, image->height - guide->position, TRUE); - break; + break; - case GIMP_ORIENTATION_VERTICAL: + case GIMP_ORIENTATION_VERTICAL: if (flip_type == GIMP_ORIENTATION_HORIZONTAL) gimp_image_move_guide (image, guide, image->width - guide->position, TRUE); - break; - - default: break; - } + + default: + break; + } } /* Flip all sample points */ diff --git a/app/core/gimpimage-guides.c b/app/core/gimpimage-guides.c index de1ed57a69..c3a5542bb2 100644 --- a/app/core/gimpimage-guides.c +++ b/app/core/gimpimage-guides.c @@ -109,7 +109,7 @@ gimp_image_guide_unref (GimpGuide *guide) void gimp_image_add_guide (GimpImage *image, - GimpGuide *guide, + GimpGuide *guide, gint position) { g_return_if_fail (GIMP_IS_IMAGE (image)); @@ -131,7 +131,7 @@ gimp_image_add_guide (GimpImage *image, void gimp_image_remove_guide (GimpImage *image, - GimpGuide *guide, + GimpGuide *guide, gboolean push_undo) { g_return_if_fail (GIMP_IS_IMAGE (image)); diff --git a/app/core/gimpimage-preview.c b/app/core/gimpimage-preview.c index 7f7b83f8de..55d206ff39 100644 --- a/app/core/gimpimage-preview.c +++ b/app/core/gimpimage-preview.c @@ -108,8 +108,8 @@ gimp_image_get_popup_size (GimpViewable *viewable, TempBuf * gimp_image_get_preview (GimpViewable *viewable, - gint width, - gint height) + gint width, + gint height) { GimpImage *image = GIMP_IMAGE (viewable); @@ -127,14 +127,14 @@ gimp_image_get_preview (GimpViewable *viewable, { /* The hard way */ if (image->comp_preview) - temp_buf_free (image->comp_preview); + temp_buf_free (image->comp_preview); /* Actually construct the composite preview from the layer previews! * This might seem ridiculous, but it's actually the best way, given * a number of unsavory alternatives. */ image->comp_preview = gimp_image_get_new_preview (viewable, - width, height); + width, height); image->comp_preview_valid = TRUE; @@ -144,8 +144,8 @@ gimp_image_get_preview (GimpViewable *viewable, TempBuf * gimp_image_get_new_preview (GimpViewable *viewable, - gint width, - gint height) + gint width, + gint height) { GimpImage *image; GimpLayer *layer; @@ -201,25 +201,25 @@ gimp_image_get_new_preview (GimpViewable *viewable, /* only add layers that are visible to the list */ if (gimp_item_get_visible (GIMP_ITEM (layer))) - { - /* floating selections are added right above the layer - * they are attached to - */ - if (gimp_layer_is_floating_sel (layer)) - { - floating_sel = layer; - } - else - { - if (floating_sel && - floating_sel->fs.drawable == GIMP_DRAWABLE (layer)) - { - reverse_list = g_slist_prepend (reverse_list, floating_sel); - } + { + /* floating selections are added right above the layer + * they are attached to + */ + if (gimp_layer_is_floating_sel (layer)) + { + floating_sel = layer; + } + else + { + if (floating_sel && + floating_sel->fs.drawable == GIMP_DRAWABLE (layer)) + { + reverse_list = g_slist_prepend (reverse_list, floating_sel); + } - reverse_list = g_slist_prepend (reverse_list, layer); - } - } + reverse_list = g_slist_prepend (reverse_list, layer); + } + } } construct_flag = FALSE; @@ -251,7 +251,7 @@ gimp_image_get_new_preview (GimpViewable *viewable, h = (gint) RINT (ratio * gimp_item_height (GIMP_ITEM (layer))); if (w < 1 || h < 1) - continue; + continue; if ((w * h) > (width * height * 4)) use_sub_preview = TRUE; @@ -262,7 +262,7 @@ gimp_image_get_new_preview (GimpViewable *viewable, y2 = CLAMP (y + h, 0, height); if (x2 == x1 || y2 == y1) - continue; + continue; pixel_region_init_temp_buf (&src1PR, comp, x1, y1, x2 - x1, y2 - y1); @@ -293,7 +293,7 @@ gimp_image_get_new_preview (GimpViewable *viewable, } if (layer->mask && layer->mask->apply_mask) - { + { if (use_sub_preview) { mask_buf = @@ -316,12 +316,12 @@ gimp_image_get_new_preview (GimpViewable *viewable, } mask = &maskPR; - } + } else - { + { mask_buf = NULL; - mask = NULL; - } + mask = NULL; + } /* Based on the type of the layer, project the layer onto the * composite preview... @@ -331,36 +331,36 @@ gimp_image_get_new_preview (GimpViewable *viewable, * for previews */ if (gimp_drawable_has_alpha (GIMP_DRAWABLE (layer))) - { - if (! construct_flag) - initial_region (&src2PR, &src1PR, - mask, NULL, + { + if (! construct_flag) + initial_region (&src2PR, &src1PR, + mask, NULL, layer->opacity * 255.999, - layer->mode, + layer->mode, visible_components, INITIAL_INTENSITY_ALPHA); - else - combine_regions (&src1PR, &src2PR, &src1PR, - mask, NULL, + else + combine_regions (&src1PR, &src2PR, &src1PR, + mask, NULL, layer->opacity * 255.999, - layer->mode, + layer->mode, visible_components, COMBINE_INTEN_A_INTEN_A); } else { - if (! construct_flag) - initial_region (&src2PR, &src1PR, - mask, NULL, + if (! construct_flag) + initial_region (&src2PR, &src1PR, + mask, NULL, layer->opacity * 255.999, - layer->mode, + layer->mode, visible_components, INITIAL_INTENSITY); - else - combine_regions (&src1PR, &src2PR, &src1PR, - mask, NULL, + else + combine_regions (&src1PR, &src2PR, &src1PR, + mask, NULL, layer->opacity * 255.999, - layer->mode, + layer->mode, visible_components, COMBINE_INTEN_A_INTEN); } diff --git a/app/core/gimpimage-rotate.c b/app/core/gimpimage-rotate.c index 6885cd21b1..eaf61733a5 100644 --- a/app/core/gimpimage-rotate.c +++ b/app/core/gimpimage-rotate.c @@ -132,9 +132,9 @@ gimp_image_rotate (GimpImage *image, item->offset_y = 0; gimp_item_translate (item, - (new_image_width - image->width) / 2, - (new_image_height - image->height) / 2, - FALSE); + (new_image_width - image->width) / 2, + (new_image_height - image->height) / 2, + FALSE); if (progress) gimp_progress_set_value (progress, progress_current++ / progress_max); @@ -210,10 +210,10 @@ gimp_image_rotate (GimpImage *image, static void gimp_image_rotate_item_offset (GimpImage *image, - GimpRotationType rotate_type, - GimpItem *item, - gint off_x, - gint off_y) + GimpRotationType rotate_type, + GimpItem *item, + gint off_x, + gint off_y) { gint x = 0; gint y = 0; @@ -311,7 +311,7 @@ gimp_image_rotate_guides (GimpImage *image, break; } break; - } + } } } @@ -348,6 +348,6 @@ gimp_image_rotate_sample_points (GimpImage *image, sample_point->x = image->width - old_y; sample_point->y = old_x; break; - } + } } } diff --git a/app/core/gimpimage-scale.c b/app/core/gimpimage-scale.c index 2cac840b54..8a6573c492 100644 --- a/app/core/gimpimage-scale.c +++ b/app/core/gimpimage-scale.c @@ -40,8 +40,8 @@ void gimp_image_scale (GimpImage *image, - gint new_width, - gint new_height, + gint new_width, + gint new_height, GimpInterpolationType interpolation_type, GimpProgress *progress) { @@ -133,12 +133,12 @@ gimp_image_scale (GimpImage *image, if (! gimp_item_scale_by_factors (item, img_scale_w, img_scale_h, interpolation_type, NULL)) - { - /* Since 0 < img_scale_w, img_scale_h, failure due to one or more - * vanishing scaled layer dimensions. Implicit delete implemented - * here. Upstream warning implemented in resize_check_layer_scaling(), - * which offers the user the chance to bail out. - */ + { + /* Since 0 < img_scale_w, img_scale_h, failure due to one or more + * vanishing scaled layer dimensions. Implicit delete implemented + * here. Upstream warning implemented in resize_check_layer_scaling(), + * which offers the user the chance to bail out. + */ remove = g_list_prepend (remove, item); } @@ -166,20 +166,20 @@ gimp_image_scale (GimpImage *image, GimpGuide *guide = list->data; switch (guide->orientation) - { - case GIMP_ORIENTATION_HORIZONTAL: - gimp_image_undo_push_image_guide (image, NULL, guide); - guide->position = (guide->position * new_height) / old_height; - break; - - case GIMP_ORIENTATION_VERTICAL: - gimp_image_undo_push_image_guide (image, NULL, guide); - guide->position = (guide->position * new_width) / old_width; - break; - - default: + { + case GIMP_ORIENTATION_HORIZONTAL: + gimp_image_undo_push_image_guide (image, NULL, guide); + guide->position = (guide->position * new_height) / old_height; break; - } + + case GIMP_ORIENTATION_VERTICAL: + gimp_image_undo_push_image_guide (image, NULL, guide); + guide->position = (guide->position * new_width) / old_width; + break; + + default: + break; + } } /* Scale all sample points */ @@ -270,7 +270,7 @@ gimp_image_scale_check (const GimpImage *image, GimpItem *item = list->data; if (! gimp_item_check_scaling (item, new_width, new_height)) - return GIMP_IMAGE_SCALE_TOO_SMALL; + return GIMP_IMAGE_SCALE_TOO_SMALL; } return GIMP_IMAGE_SCALE_OK; diff --git a/app/core/gimpimage-undo-push.c b/app/core/gimpimage-undo-push.c index c0755307b6..4e8ed5785f 100644 --- a/app/core/gimpimage-undo-push.c +++ b/app/core/gimpimage-undo-push.c @@ -806,7 +806,7 @@ struct _DrawableModUndo TileManager *tiles; GimpImageType type; gint offset_x; - gint offset_y; + gint offset_y; }; static gboolean undo_pop_drawable_mod (GimpUndo *undo, @@ -997,12 +997,12 @@ undo_pop_mask (GimpUndo *undo, pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles, x1, y1, (x2 - x1), (y2 - y1), FALSE); pixel_region_init (&destPR, new_tiles, - 0, 0, (x2 - x1), (y2 - y1), TRUE); + 0, 0, (x2 - x1), (y2 - y1), TRUE); copy_region (&srcPR, &destPR); pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles, - x1, y1, (x2 - x1), (y2 - y1), TRUE); + x1, y1, (x2 - x1), (y2 - y1), TRUE); color_region (&srcPR, &empty); } @@ -1017,9 +1017,9 @@ undo_pop_mask (GimpUndo *undo, height = tile_manager_height (mu->tiles); pixel_region_init (&srcPR, mu->tiles, - 0, 0, width, height, FALSE); + 0, 0, width, height, FALSE); pixel_region_init (&destPR, GIMP_DRAWABLE (channel)->tiles, - mu->x, mu->y, width, height, TRUE); + mu->x, mu->y, width, height, TRUE); copy_region (&srcPR, &destPR); @@ -1449,7 +1449,7 @@ gimp_image_undo_push_layer_remove (GimpImage *image, static gboolean undo_push_layer (GimpImage *image, const gchar *undo_desc, - GimpUndoType type, + GimpUndoType type, GimpLayer *layer, gint prev_position, GimpLayer *prev_layer) @@ -1510,7 +1510,7 @@ undo_pop_layer (GimpUndo *undo, layer); if (gimp_layer_is_floating_sel (layer)) - { + { /* invalidate the boundary *before* setting the * floating_sel pointer to NULL because the selection's * outline is affected by the floating_sel and won't be @@ -1518,13 +1518,13 @@ undo_pop_layer (GimpUndo *undo, */ gimp_drawable_invalidate_boundary (GIMP_DRAWABLE (layer)); - undo->image->floating_sel = NULL; + undo->image->floating_sel = NULL; - /* activate the underlying drawable */ - floating_sel_activate_drawable (layer); + /* activate the underlying drawable */ + floating_sel_activate_drawable (layer); gimp_image_floating_selection_changed (undo->image); - } + } else if (layer == gimp_image_get_active_layer (undo->image)) { if (lu->prev_layer) @@ -1555,14 +1555,14 @@ undo_pop_layer (GimpUndo *undo, /* if this is a floating selection, set the fs pointer */ if (gimp_layer_is_floating_sel (layer)) - undo->image->floating_sel = layer; + undo->image->floating_sel = layer; gimp_container_insert (undo->image->layers, - GIMP_OBJECT (layer), lu->prev_position); + GIMP_OBJECT (layer), lu->prev_position); gimp_image_set_active_layer (undo->image, layer); if (gimp_layer_is_floating_sel (layer)) - gimp_image_floating_selection_changed (undo->image); + gimp_image_floating_selection_changed (undo->image); GIMP_ITEM (layer)->removed = FALSE; @@ -1973,7 +1973,7 @@ gimp_image_undo_push_layer_mask_remove (GimpImage *image, static gboolean undo_push_layer_mask (GimpImage *image, const gchar *undo_desc, - GimpUndoType type, + GimpUndoType type, GimpLayer *layer, GimpLayerMask *mask) { @@ -2225,7 +2225,7 @@ gimp_image_undo_push_channel_remove (GimpImage *image, static gboolean undo_push_channel (GimpImage *image, const gchar *undo_desc, - GimpUndoType type, + GimpUndoType type, GimpChannel *channel, gint prev_position, GimpChannel *prev_channel) @@ -2300,7 +2300,7 @@ undo_pop_channel (GimpUndo *undo, cu->prev_channel = gimp_image_get_active_channel (undo->image); gimp_container_insert (undo->image->channels, - GIMP_OBJECT (channel), cu->prev_position); + GIMP_OBJECT (channel), cu->prev_position); gimp_image_set_active_channel (undo->image, channel); GIMP_ITEM (channel)->removed = FALSE; @@ -2523,7 +2523,7 @@ gimp_image_undo_push_vectors_remove (GimpImage *image, static gboolean undo_push_vectors (GimpImage *image, const gchar *undo_desc, - GimpUndoType type, + GimpUndoType type, GimpVectors *vectors, gint prev_position, GimpVectors *prev_vectors) @@ -2593,7 +2593,7 @@ undo_pop_vectors (GimpUndo *undo, vu->prev_vectors = gimp_image_get_active_vectors (undo->image); gimp_container_insert (undo->image->vectors, - GIMP_OBJECT (vectors), vu->prev_position); + GIMP_OBJECT (vectors), vu->prev_position); gimp_image_set_active_vectors (undo->image, vectors); GIMP_ITEM (vectors)->removed = FALSE; @@ -2895,9 +2895,9 @@ undo_pop_fs_to_layer (GimpUndo *undo, gimp_object_name_changed (GIMP_OBJECT (fsu->floating_layer)); gimp_drawable_update (GIMP_DRAWABLE (fsu->floating_layer), - 0, 0, - GIMP_ITEM (fsu->floating_layer)->width, - GIMP_ITEM (fsu->floating_layer)->height); + 0, 0, + GIMP_ITEM (fsu->floating_layer)->width, + GIMP_ITEM (fsu->floating_layer)->height); gimp_image_floating_selection_changed (undo->image); @@ -3207,27 +3207,27 @@ undo_pop_parasite (GimpUndo *undo, pu->parasite = gimp_parasite_copy (gimp_image_parasite_find (undo->image, pu->name)); if (tmp) - gimp_parasite_list_add (pu->image->parasites, tmp); + gimp_parasite_list_add (pu->image->parasites, tmp); else - gimp_parasite_list_remove (pu->image->parasites, pu->name); + gimp_parasite_list_remove (pu->image->parasites, pu->name); } else if (pu->item) { pu->parasite = gimp_parasite_copy (gimp_item_parasite_find (pu->item, pu->name)); if (tmp) - gimp_parasite_list_add (pu->item->parasites, tmp); + gimp_parasite_list_add (pu->item->parasites, tmp); else - gimp_parasite_list_remove (pu->item->parasites, pu->name); + gimp_parasite_list_remove (pu->item->parasites, pu->name); } else { pu->parasite = gimp_parasite_copy (gimp_parasite_find (undo->image->gimp, pu->name)); if (tmp) - gimp_parasite_attach (undo->image->gimp, tmp); + gimp_parasite_attach (undo->image->gimp, tmp); else - gimp_parasite_detach (undo->image->gimp, pu->name); + gimp_parasite_detach (undo->image->gimp, pu->name); } if (tmp) diff --git a/app/core/gimpimage.h b/app/core/gimpimage.h index 2bdfcde3bc..7da2169e4d 100644 --- a/app/core/gimpimage.h +++ b/app/core/gimpimage.h @@ -24,15 +24,15 @@ #define GIMP_IMAGE_TYPE_IS_RGB(t) ((t) == GIMP_RGB_IMAGE || \ - (t) == GIMP_RGBA_IMAGE) + (t) == GIMP_RGBA_IMAGE) #define GIMP_IMAGE_TYPE_IS_GRAY(t) ((t) == GIMP_GRAY_IMAGE || \ - (t) == GIMP_GRAYA_IMAGE) + (t) == GIMP_GRAYA_IMAGE) #define GIMP_IMAGE_TYPE_IS_INDEXED(t) ((t) == GIMP_INDEXED_IMAGE || \ - (t) == GIMP_INDEXEDA_IMAGE) + (t) == GIMP_INDEXEDA_IMAGE) #define GIMP_IMAGE_TYPE_HAS_ALPHA(t) ((t) == GIMP_RGBA_IMAGE || \ - (t) == GIMP_GRAYA_IMAGE || \ - (t) == GIMP_INDEXEDA_IMAGE) + (t) == GIMP_GRAYA_IMAGE || \ + (t) == GIMP_INDEXEDA_IMAGE) #define GIMP_IMAGE_TYPE_WITH_ALPHA(t) (((t) == GIMP_RGB_IMAGE || \ (t) == GIMP_RGBA_IMAGE) ? \ @@ -187,9 +187,9 @@ struct _GimpImageClass void (* active_channel_changed) (GimpImage *image); void (* active_vectors_changed) (GimpImage *image); void (* component_visibility_changed) (GimpImage *image, - GimpChannelType channel); + GimpChannelType channel); void (* component_active_changed) (GimpImage *image, - GimpChannelType channel); + GimpChannelType channel); void (* mask_changed) (GimpImage *image); void (* resolution_changed) (GimpImage *image); void (* unit_changed) (GimpImage *image); @@ -202,10 +202,10 @@ struct _GimpImageClass void (* dirty) (GimpImage *image, GimpDirtyMask dirty_mask); void (* update) (GimpImage *image, - gint x, - gint y, - gint width, - gint height); + gint x, + gint y, + gint width, + gint height); void (* update_guide) (GimpImage *image, GimpGuide *guide); void (* update_sample_point) (GimpImage *image, @@ -215,9 +215,9 @@ struct _GimpImageClass void (* sample_point_removed) (GimpImage *image, GimpSamplePoint *sample_point); void (* colormap_changed) (GimpImage *image, - gint color_index); + gint color_index); void (* undo_event) (GimpImage *image, - GimpUndoEvent event, + GimpUndoEvent event, GimpUndo *undo); void (* flush) (GimpImage *image); @@ -232,7 +232,7 @@ GimpImage * gimp_image_new (Gimp *gimp, GimpImageBaseType base_type); GimpImageBaseType gimp_image_base_type (const GimpImage *image); -GimpImageType gimp_image_base_type_with_alpha (const GimpImage *image); +GimpImageType gimp_image_base_type_with_alpha (const GimpImage *image); CombinationMode gimp_image_get_combination_mode (GimpImageType dest_type, gint src_bytes); @@ -265,8 +265,8 @@ void gimp_image_set_unit (GimpImage *image, GimpUnit gimp_image_get_unit (const GimpImage *image); void gimp_image_unit_changed (GimpImage *image); -gint gimp_image_get_width (const GimpImage *image); -gint gimp_image_get_height (const GimpImage *image); +gint gimp_image_get_width (const GimpImage *image); +gint gimp_image_get_height (const GimpImage *image); gboolean gimp_image_has_alpha (const GimpImage *image); gboolean gimp_image_is_empty (const GimpImage *image); @@ -281,16 +281,16 @@ gint gimp_image_get_component_index (const GimpImage *image, GimpChannelType channel); void gimp_image_set_component_active (GimpImage *image, - GimpChannelType type, - gboolean active); + GimpChannelType type, + gboolean active); gboolean gimp_image_get_component_active (const GimpImage *image, - GimpChannelType type); + GimpChannelType type); void gimp_image_set_component_visible (GimpImage *image, - GimpChannelType type, - gboolean visible); + GimpChannelType type, + gboolean visible); gboolean gimp_image_get_component_visible (const GimpImage *image, - GimpChannelType type); + GimpChannelType type); void gimp_image_mode_changed (GimpImage *image); void gimp_image_alpha_changed (GimpImage *image); @@ -307,7 +307,7 @@ void gimp_image_sample_point_added (GimpImage *image, GimpSamplePoint *sample_point); void gimp_image_sample_point_removed (GimpImage *image, GimpSamplePoint *sample_point); -void gimp_image_colormap_changed (GimpImage *image, +void gimp_image_colormap_changed (GimpImage *image, gint col); void gimp_image_selection_control (GimpImage *image, GimpSelectionControl control); @@ -321,7 +321,7 @@ gboolean gimp_image_undo_enable (GimpImage *image); gboolean gimp_image_undo_disable (GimpImage *image); gboolean gimp_image_undo_freeze (GimpImage *image); gboolean gimp_image_undo_thaw (GimpImage *image); -void gimp_image_undo_event (GimpImage *image, +void gimp_image_undo_event (GimpImage *image, GimpUndoEvent event, GimpUndo *undo); gint gimp_image_dirty (GimpImage *image, @@ -406,9 +406,9 @@ GimpChannel * gimp_image_get_active_channel (const GimpImage *image); GimpVectors * gimp_image_get_active_vectors (const GimpImage *image); GimpLayer * gimp_image_set_active_layer (GimpImage *image, - GimpLayer *layer); + GimpLayer *layer); GimpChannel * gimp_image_set_active_channel (GimpImage *image, - GimpChannel *channel); + GimpChannel *channel); GimpChannel * gimp_image_unset_active_channel (GimpImage *image); GimpVectors * gimp_image_set_active_vectors (GimpImage *image, GimpVectors *vectors); @@ -418,92 +418,92 @@ void gimp_image_active_channel_changed (GimpImage *image); void gimp_image_active_vectors_changed (GimpImage *image); gint gimp_image_get_layer_index (const GimpImage *image, - const GimpLayer *layer); + const GimpLayer *layer); gint gimp_image_get_channel_index (const GimpImage *image, - const GimpChannel *channel); + const GimpChannel *channel); gint gimp_image_get_vectors_index (const GimpImage *image, const GimpVectors *vectors); GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *image, - GimpTattoo tatoo); + GimpTattoo tatoo); GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *image, - GimpTattoo tatoo); + GimpTattoo tatoo); GimpVectors * gimp_image_get_vectors_by_tattoo (const GimpImage *image, GimpTattoo tatoo); GimpLayer * gimp_image_get_layer_by_name (const GimpImage *image, - const gchar *name); + const gchar *name); GimpChannel * gimp_image_get_channel_by_name (const GimpImage *image, - const gchar *name); + const gchar *name); GimpVectors * gimp_image_get_vectors_by_name (const GimpImage *image, - const gchar *name); + const gchar *name); gboolean gimp_image_add_layer (GimpImage *image, - GimpLayer *layer, - gint position); + GimpLayer *layer, + gint position); void gimp_image_remove_layer (GimpImage *image, - GimpLayer *layer); + GimpLayer *layer); gboolean gimp_image_raise_layer (GimpImage *image, - GimpLayer *layer); + GimpLayer *layer); gboolean gimp_image_lower_layer (GimpImage *image, - GimpLayer *layer); + GimpLayer *layer); gboolean gimp_image_raise_layer_to_top (GimpImage *image, - GimpLayer *layer); + GimpLayer *layer); gboolean gimp_image_lower_layer_to_bottom (GimpImage *image, - GimpLayer *layer); + GimpLayer *layer); gboolean gimp_image_position_layer (GimpImage *image, - GimpLayer *layer, - gint new_index, - gboolean push_undo, + GimpLayer *layer, + gint new_index, + gboolean push_undo, const gchar *undo_desc); gboolean gimp_image_add_channel (GimpImage *image, - GimpChannel *channel, - gint position); + GimpChannel *channel, + gint position); void gimp_image_remove_channel (GimpImage *image, - GimpChannel *channel); + GimpChannel *channel); gboolean gimp_image_raise_channel (GimpImage *image, - GimpChannel *channel); + GimpChannel *channel); gboolean gimp_image_raise_channel_to_top (GimpImage *image, - GimpChannel *channel); + GimpChannel *channel); gboolean gimp_image_lower_channel (GimpImage *image, - GimpChannel *channel); + GimpChannel *channel); gboolean gimp_image_lower_channel_to_bottom (GimpImage *image, - GimpChannel *channel); + GimpChannel *channel); gboolean gimp_image_position_channel (GimpImage *image, - GimpChannel *channel, - gint new_index, + GimpChannel *channel, + gint new_index, gboolean push_undo, const gchar *undo_desc); gboolean gimp_image_add_vectors (GimpImage *image, - GimpVectors *vectors, - gint position); + GimpVectors *vectors, + gint position); void gimp_image_remove_vectors (GimpImage *image, - GimpVectors *vectors); + GimpVectors *vectors); gboolean gimp_image_raise_vectors (GimpImage *image, - GimpVectors *vectors); + GimpVectors *vectors); gboolean gimp_image_raise_vectors_to_top (GimpImage *image, - GimpVectors *vectors); + GimpVectors *vectors); gboolean gimp_image_lower_vectors (GimpImage *image, - GimpVectors *vectors); + GimpVectors *vectors); gboolean gimp_image_lower_vectors_to_bottom (GimpImage *image, - GimpVectors *vectors); + GimpVectors *vectors); gboolean gimp_image_position_vectors (GimpImage *image, - GimpVectors *vectors, - gint new_index, + GimpVectors *vectors, + gint new_index, gboolean push_undo, const gchar *undo_desc); gboolean gimp_image_layer_boundary (const GimpImage *image, - BoundSeg **segs, - gint *n_segs); + BoundSeg **segs, + gint *n_segs); GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *image, - gint x, - gint y); + gint x, + gint y); gboolean gimp_image_coords_in_active_drawable (GimpImage *image, const GimpCoords *coords); diff --git a/app/core/gimpitem.h b/app/core/gimpitem.h index 1bbeca75ed..de39c56c9d 100644 --- a/app/core/gimpitem.h +++ b/app/core/gimpitem.h @@ -242,7 +242,7 @@ const GimpParasite *gimp_item_parasite_find(const GimpItem *item, gchar ** gimp_item_parasite_list (const GimpItem *item, gint *count); -gboolean gimp_item_get_visible (const GimpItem *item); +gboolean gimp_item_get_visible (const GimpItem *item); void gimp_item_set_visible (GimpItem *item, gboolean visible, gboolean push_undo); diff --git a/app/core/gimplayer-floating-sel.c b/app/core/gimplayer-floating-sel.c index d6528e70d3..1d68664fd7 100644 --- a/app/core/gimplayer-floating-sel.c +++ b/app/core/gimplayer-floating-sel.c @@ -42,7 +42,7 @@ void floating_sel_attach (GimpLayer *layer, - GimpDrawable *drawable) + GimpDrawable *drawable) { GimpImage *image; GimpLayer *floating_sel; @@ -67,7 +67,7 @@ floating_sel_attach (GimpLayer *layer, * to the drawable */ if (drawable == (GimpDrawable *) floating_sel) - drawable = gimp_image_active_drawable (image); + drawable = gimp_image_active_drawable (image); } /* set the drawable and allocate a backing store */ @@ -127,7 +127,7 @@ floating_sel_anchor (GimpLayer *layer) if (! gimp_layer_is_floating_sel (layer)) { g_message (_("Cannot anchor this layer because " - "it is not a floating selection.")); + "it is not a floating selection.")); return; } @@ -145,10 +145,10 @@ floating_sel_anchor (GimpLayer *layer) /* Composite the floating selection contents */ floating_sel_composite (layer, - GIMP_ITEM (layer)->offset_x, - GIMP_ITEM (layer)->offset_y, - GIMP_ITEM (layer)->width, - GIMP_ITEM (layer)->height, TRUE); + GIMP_ITEM (layer)->offset_x, + GIMP_ITEM (layer)->offset_y, + GIMP_ITEM (layer)->width, + GIMP_ITEM (layer)->height, TRUE); drawable = layer->fs.drawable; @@ -207,7 +207,7 @@ floating_sel_to_layer (GimpLayer *layer) if (GIMP_IS_CHANNEL (layer->fs.drawable)) { g_message (_("Cannot create a new layer from the floating selection " - "because it belongs to a layer mask or channel.")); + "because it belongs to a layer mask or channel.")); return; } @@ -216,10 +216,10 @@ floating_sel_to_layer (GimpLayer *layer) /* restore the contents of the drawable */ floating_sel_restore (layer, - item->offset_x, - item->offset_y, - item->width, - item->height); + item->offset_x, + item->offset_y, + item->width, + item->height); gimp_image_undo_push_fs_to_layer (image, NULL, layer, layer->fs.drawable); @@ -237,19 +237,19 @@ floating_sel_to_layer (GimpLayer *layer) gimp_object_name_changed (GIMP_OBJECT (layer)); gimp_drawable_update (GIMP_DRAWABLE (layer), - 0, 0, - GIMP_ITEM (layer)->width, - GIMP_ITEM (layer)->height); + 0, 0, + GIMP_ITEM (layer)->width, + GIMP_ITEM (layer)->height); gimp_image_floating_selection_changed (image); } void floating_sel_store (GimpLayer *layer, - gint x, - gint y, - gint w, - gint h) + gint x, + gint y, + gint w, + gint h) { PixelRegion srcPR, destPR; gint offx, offy; @@ -270,9 +270,9 @@ floating_sel_store (GimpLayer *layer, tile_manager_unref (layer->fs.backing_store); layer->fs.backing_store = - tile_manager_new (GIMP_ITEM (layer)->width, - GIMP_ITEM (layer)->height, - gimp_drawable_bytes (layer->fs.drawable)); + tile_manager_new (GIMP_ITEM (layer)->width, + GIMP_ITEM (layer)->height, + gimp_drawable_bytes (layer->fs.drawable)); } /* What this function does is save the specified area of the @@ -285,9 +285,9 @@ floating_sel_store (GimpLayer *layer, x1 = MAX (GIMP_ITEM (layer)->offset_x, offx); y1 = MAX (GIMP_ITEM (layer)->offset_y, offy); x2 = MIN (GIMP_ITEM (layer)->offset_x + GIMP_ITEM (layer)->width, - offx + gimp_item_width (GIMP_ITEM (layer->fs.drawable))); + offx + gimp_item_width (GIMP_ITEM (layer->fs.drawable))); y2 = MIN (GIMP_ITEM (layer)->offset_y + GIMP_ITEM (layer)->height, - offy + gimp_item_height (GIMP_ITEM (layer->fs.drawable))); + offy + gimp_item_height (GIMP_ITEM (layer->fs.drawable))); x1 = CLAMP (x, x1, x2); y1 = CLAMP (y, y1, y2); @@ -298,11 +298,11 @@ floating_sel_store (GimpLayer *layer, { /* Copy the area from the drawable to the backing store */ pixel_region_init (&srcPR, gimp_drawable_get_tiles (layer->fs.drawable), - (x1 - offx), (y1 - offy), (x2 - x1), (y2 - y1), FALSE); + (x1 - offx), (y1 - offy), (x2 - x1), (y2 - y1), FALSE); pixel_region_init (&destPR, layer->fs.backing_store, - (x1 - GIMP_ITEM (layer)->offset_x), - (y1 - GIMP_ITEM (layer)->offset_y), - (x2 - x1), (y2 - y1), TRUE); + (x1 - GIMP_ITEM (layer)->offset_x), + (y1 - GIMP_ITEM (layer)->offset_y), + (x2 - x1), (y2 - y1), TRUE); copy_region (&srcPR, &destPR); } @@ -310,10 +310,10 @@ floating_sel_store (GimpLayer *layer, void floating_sel_restore (GimpLayer *layer, - gint x, - gint y, - gint w, - gint h) + gint x, + gint y, + gint w, + gint h) { PixelRegion srcPR, destPR; gint offx, offy; @@ -334,9 +334,9 @@ floating_sel_restore (GimpLayer *layer, x1 = MAX (GIMP_ITEM (layer)->offset_x, offx); y1 = MAX (GIMP_ITEM (layer)->offset_y, offy); x2 = MIN (GIMP_ITEM (layer)->offset_x + GIMP_ITEM (layer)->width, - offx + gimp_item_width (GIMP_ITEM (layer->fs.drawable))); + offx + gimp_item_width (GIMP_ITEM (layer->fs.drawable))); y2 = MIN (GIMP_ITEM(layer)->offset_y + GIMP_ITEM (layer)->height, - offy + gimp_item_height (GIMP_ITEM (layer->fs.drawable))); + offy + gimp_item_height (GIMP_ITEM (layer->fs.drawable))); x1 = CLAMP (x, x1, x2); y1 = CLAMP (y, y1, y2); @@ -347,11 +347,11 @@ floating_sel_restore (GimpLayer *layer, { /* Copy the area from the backing store to the drawable */ pixel_region_init (&srcPR, layer->fs.backing_store, - (x1 - GIMP_ITEM (layer)->offset_x), - (y1 - GIMP_ITEM (layer)->offset_y), - (x2 - x1), (y2 - y1), FALSE); + (x1 - GIMP_ITEM (layer)->offset_x), + (y1 - GIMP_ITEM (layer)->offset_y), + (x2 - x1), (y2 - y1), FALSE); pixel_region_init (&destPR, gimp_drawable_get_tiles (layer->fs.drawable), - (x1 - offx), (y1 - offy), (x2 - x1), (y2 - y1), TRUE); + (x1 - offx), (y1 - offy), (x2 - x1), (y2 - y1), TRUE); copy_region (&srcPR, &destPR); } @@ -359,17 +359,17 @@ floating_sel_restore (GimpLayer *layer, void floating_sel_rigor (GimpLayer *layer, - gboolean push_undo) + gboolean push_undo) { g_return_if_fail (GIMP_IS_LAYER (layer)); g_return_if_fail (gimp_layer_is_floating_sel (layer)); /* store the affected area from the drawable in the backing store */ floating_sel_store (layer, - GIMP_ITEM (layer)->offset_x, - GIMP_ITEM (layer)->offset_y, - GIMP_ITEM (layer)->width, - GIMP_ITEM (layer)->height); + GIMP_ITEM (layer)->offset_x, + GIMP_ITEM (layer)->offset_y, + GIMP_ITEM (layer)->width, + GIMP_ITEM (layer)->height); layer->fs.initial = TRUE; if (push_undo) @@ -380,7 +380,7 @@ floating_sel_rigor (GimpLayer *layer, void floating_sel_relax (GimpLayer *layer, - gboolean push_undo) + gboolean push_undo) { g_return_if_fail (GIMP_IS_LAYER (layer)); g_return_if_fail (gimp_layer_is_floating_sel (layer)); @@ -388,10 +388,10 @@ floating_sel_relax (GimpLayer *layer, /* restore the contents of drawable the floating layer is attached to */ if (layer->fs.initial == FALSE) floating_sel_restore (layer, - GIMP_ITEM (layer)->offset_x, - GIMP_ITEM (layer)->offset_y, - GIMP_ITEM (layer)->width, - GIMP_ITEM (layer)->height); + GIMP_ITEM (layer)->offset_x, + GIMP_ITEM (layer)->offset_y, + GIMP_ITEM (layer)->width, + GIMP_ITEM (layer)->height); layer->fs.initial = TRUE; if (push_undo) @@ -402,11 +402,11 @@ floating_sel_relax (GimpLayer *layer, void floating_sel_composite (GimpLayer *layer, - gint x, - gint y, - gint w, - gint h, - gboolean push_undo) + gint x, + gint y, + gint w, + gint h, + gboolean push_undo) { PixelRegion fsPR; GimpImage *image; @@ -447,11 +447,11 @@ floating_sel_composite (GimpLayer *layer, x1 = MAX (GIMP_ITEM (layer)->offset_x, offx); y1 = MAX (GIMP_ITEM (layer)->offset_y, offy); x2 = MIN (GIMP_ITEM (layer)->offset_x + - GIMP_ITEM (layer)->width, - offx + gimp_item_width (GIMP_ITEM (layer->fs.drawable))); + GIMP_ITEM (layer)->width, + offx + gimp_item_width (GIMP_ITEM (layer->fs.drawable))); y2 = MIN (GIMP_ITEM (layer)->offset_y + - GIMP_ITEM (layer)->height, - offy + gimp_item_height (GIMP_ITEM (layer->fs.drawable))); + GIMP_ITEM (layer)->height, + offy + gimp_item_height (GIMP_ITEM (layer->fs.drawable))); x1 = CLAMP (x, x1, x2); y1 = CLAMP (y, y1, y2); @@ -459,61 +459,61 @@ floating_sel_composite (GimpLayer *layer, y2 = CLAMP (y + h, y1, y2); if ((x2 - x1) > 0 && (y2 - y1) > 0) - { - /* composite the area from the layer to the drawable */ - pixel_region_init (&fsPR, GIMP_DRAWABLE (layer)->tiles, - (x1 - GIMP_ITEM (layer)->offset_x), - (y1 - GIMP_ITEM (layer)->offset_y), - (x2 - x1), (y2 - y1), FALSE); + { + /* composite the area from the layer to the drawable */ + pixel_region_init (&fsPR, GIMP_DRAWABLE (layer)->tiles, + (x1 - GIMP_ITEM (layer)->offset_x), + (y1 - GIMP_ITEM (layer)->offset_y), + (x2 - x1), (y2 - y1), FALSE); - /* a kludge here to prevent the case of the drawable - * underneath having lock alpha on, and disallowing - * the composited floating selection from being shown - */ - if (GIMP_IS_LAYER (layer->fs.drawable)) - { - d_layer = GIMP_LAYER (layer->fs.drawable); - if ((lock_alpha = gimp_layer_get_lock_alpha (d_layer))) - gimp_layer_set_lock_alpha (d_layer, FALSE, FALSE); - } - else - lock_alpha = FALSE; + /* a kludge here to prevent the case of the drawable + * underneath having lock alpha on, and disallowing + * the composited floating selection from being shown + */ + if (GIMP_IS_LAYER (layer->fs.drawable)) + { + d_layer = GIMP_LAYER (layer->fs.drawable); + if ((lock_alpha = gimp_layer_get_lock_alpha (d_layer))) + gimp_layer_set_lock_alpha (d_layer, FALSE, FALSE); + } + else + lock_alpha = FALSE; - /* We need to set all image channels to active to make sure that - * nothing strange happens while applying the floating selection. - * It wouldn't make sense for the floating selection to be affected - * by the active image channels. - */ - for (i = 0; i < MAX_CHANNELS; i++) - { - active[i] = image->active[i]; - image->active[i] = 1; - } + /* We need to set all image channels to active to make sure that + * nothing strange happens while applying the floating selection. + * It wouldn't make sense for the floating selection to be affected + * by the active image channels. + */ + for (i = 0; i < MAX_CHANNELS; i++) + { + active[i] = image->active[i]; + image->active[i] = 1; + } - /* apply the fs with the undo specified by the value - * passed to this function - */ - gimp_drawable_apply_region (layer->fs.drawable, &fsPR, + /* apply the fs with the undo specified by the value + * passed to this function + */ + gimp_drawable_apply_region (layer->fs.drawable, &fsPR, push_undo, NULL, layer->opacity, layer->mode, NULL, (x1 - offx), (y1 - offy)); - /* restore lock alpha */ - if (lock_alpha) - gimp_layer_set_lock_alpha (d_layer, TRUE, FALSE); + /* restore lock alpha */ + if (lock_alpha) + gimp_layer_set_lock_alpha (d_layer, TRUE, FALSE); - /* restore image active channels */ - for (i = 0; i < MAX_CHANNELS; i++) - image->active[i] = active[i]; - } + /* restore image active channels */ + for (i = 0; i < MAX_CHANNELS; i++) + image->active[i] = active[i]; + } } } const BoundSeg * floating_sel_boundary (GimpLayer *layer, - gint *n_segs) + gint *n_segs) { PixelRegion bPR; gint i; @@ -532,7 +532,7 @@ floating_sel_boundary (GimpLayer *layer, gimp_item_offsets (GIMP_ITEM (layer), &off_x, &off_y); if (layer->fs.segs) - g_free (layer->fs.segs); + g_free (layer->fs.segs); if (gimp_drawable_has_alpha (GIMP_DRAWABLE (layer))) { diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c index 017e9f8559..1999767c71 100644 --- a/app/core/gimplayer.c +++ b/app/core/gimplayer.c @@ -185,39 +185,39 @@ gimp_layer_class_init (GimpLayerClass *klass) layer_signals[OPACITY_CHANGED] = g_signal_new ("opacity-changed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpLayerClass, opacity_changed), - NULL, NULL, - gimp_marshal_VOID__VOID, - G_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpLayerClass, opacity_changed), + NULL, NULL, + gimp_marshal_VOID__VOID, + G_TYPE_NONE, 0); layer_signals[MODE_CHANGED] = g_signal_new ("mode-changed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpLayerClass, mode_changed), - NULL, NULL, - gimp_marshal_VOID__VOID, - G_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpLayerClass, mode_changed), + NULL, NULL, + gimp_marshal_VOID__VOID, + G_TYPE_NONE, 0); layer_signals[LOCK_ALPHA_CHANGED] = g_signal_new ("lock-alpha-changed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpLayerClass, lock_alpha_changed), - NULL, NULL, - gimp_marshal_VOID__VOID, - G_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpLayerClass, lock_alpha_changed), + NULL, NULL, + gimp_marshal_VOID__VOID, + G_TYPE_NONE, 0); layer_signals[MASK_CHANGED] = g_signal_new ("mask-changed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpLayerClass, mask_changed), - NULL, NULL, - gimp_marshal_VOID__VOID, - G_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpLayerClass, mask_changed), + NULL, NULL, + gimp_marshal_VOID__VOID, + G_TYPE_NONE, 0); object_class->set_property = gimp_layer_set_property; object_class->get_property = gimp_layer_get_property; @@ -658,8 +658,8 @@ gimp_layer_rename (GimpItem *item, static void gimp_layer_translate (GimpItem *item, - gint offset_x, - gint offset_y, + gint offset_x, + gint offset_y, gboolean push_undo) { GimpLayer *layer = GIMP_LAYER (item); @@ -719,10 +719,10 @@ gimp_layer_scale (GimpItem *item, static void gimp_layer_resize (GimpItem *item, GimpContext *context, - gint new_width, - gint new_height, - gint offset_x, - gint offset_y) + gint new_width, + gint new_height, + gint offset_x, + gint offset_y) { GimpLayer *layer = GIMP_LAYER (item); @@ -828,8 +828,8 @@ gimp_layer_invalidate_boundary (GimpDrawable *drawable) static gint gimp_layer_get_opacity_at (GimpPickable *pickable, - gint x, - gint y) + gint x, + gint y) { GimpLayer *layer = GIMP_LAYER (pickable); Tile *tile; @@ -843,28 +843,28 @@ gimp_layer_get_opacity_at (GimpPickable *pickable, * alpha channel, success! */ if (! gimp_drawable_has_alpha (GIMP_DRAWABLE (layer))) - return OPAQUE_OPACITY; + return OPAQUE_OPACITY; /* Otherwise, determine if the alpha value at * the given point is non-zero */ tile = tile_manager_get_tile (GIMP_DRAWABLE (layer)->tiles, - x, y, TRUE, FALSE); + x, y, TRUE, FALSE); val = * ((guchar *) tile_data_pointer (tile, - x % TILE_WIDTH, - y % TILE_HEIGHT) + - tile_bpp (tile) - 1); + x % TILE_WIDTH, + y % TILE_HEIGHT) + + tile_bpp (tile) - 1); if (layer->mask) - { - gint mask_val; + { + gint mask_val; mask_val = gimp_pickable_get_opacity_at (GIMP_PICKABLE (layer->mask), x, y); - val = val * mask_val / 255; - } + val = val * mask_val / 255; + } tile_release (tile, FALSE); } @@ -874,10 +874,10 @@ gimp_layer_get_opacity_at (GimpPickable *pickable, static void gimp_layer_transform_color (GimpImage *image, - PixelRegion *layerPR, - PixelRegion *bufPR, - GimpDrawable *drawable, - GimpImageType src_type) + PixelRegion *layerPR, + PixelRegion *bufPR, + GimpDrawable *drawable, + GimpImageType src_type) { GimpImageBaseType base_type = GIMP_IMAGE_TYPE_BASE_TYPE (src_type); gboolean alpha = GIMP_IMAGE_TYPE_HAS_ALPHA (src_type); @@ -892,26 +892,26 @@ gimp_layer_transform_color (GimpImage *image, gint h = layerPR->h; while (h--) - { + { const guchar *s = src; guchar *d = dest; gint i; - for (i = 0; i < layerPR->w; i++) - { - gimp_image_transform_color (image, drawable, d, base_type, s); + for (i = 0; i < layerPR->w; i++) + { + gimp_image_transform_color (image, drawable, d, base_type, s); - /* alpha channel */ + /* alpha channel */ d[layerPR->bytes - 1] = (alpha ? s[bufPR->bytes - 1] : OPAQUE_OPACITY); s += bufPR->bytes; d += layerPR->bytes; - } + } - src += bufPR->rowstride; - dest += layerPR->rowstride; - } + src += bufPR->rowstride; + dest += layerPR->rowstride; + } } } @@ -937,12 +937,12 @@ gimp_layer_layer_mask_update (GimpDrawable *drawable, GimpLayer * gimp_layer_new (GimpImage *image, - gint width, - gint height, - GimpImageType type, - const gchar *name, - gdouble opacity, - GimpLayerModeEffects mode) + gint width, + gint height, + GimpImageType type, + const gchar *name, + gdouble opacity, + GimpLayerModeEffects mode) { GimpLayer *layer; @@ -953,7 +953,7 @@ gimp_layer_new (GimpImage *image, layer = g_object_new (GIMP_TYPE_LAYER, NULL); gimp_drawable_configure (GIMP_DRAWABLE (layer), - image, + image, 0, 0, width, height, type, name); @@ -985,9 +985,9 @@ GimpLayer * gimp_layer_new_from_tiles (TileManager *tiles, GimpImage *dest_image, GimpImageType type, - const gchar *name, - gdouble opacity, - GimpLayerModeEffects mode) + const gchar *name, + gdouble opacity, + GimpLayerModeEffects mode) { PixelRegion bufPR; @@ -996,7 +996,7 @@ gimp_layer_new_from_tiles (TileManager *tiles, g_return_val_if_fail (name != NULL, NULL); pixel_region_init (&bufPR, tiles, - 0, 0, + 0, 0, tile_manager_width (tiles), tile_manager_height (tiles), FALSE); @@ -1093,7 +1093,7 @@ gimp_layer_new_from_region (PixelRegion *region, } new_layer = gimp_layer_new (dest_image, width, height, type, name, - opacity, mode); + opacity, mode); if (! new_layer) { @@ -1102,8 +1102,8 @@ gimp_layer_new_from_region (PixelRegion *region, } pixel_region_init (&layerPR, GIMP_DRAWABLE (new_layer)->tiles, - 0, 0, width, height, - TRUE); + 0, 0, width, height, + TRUE); switch (type) { @@ -1200,7 +1200,7 @@ gimp_layer_new_from_region (PixelRegion *region, GimpLayerMask * gimp_layer_add_mask (GimpLayer *layer, - GimpLayerMask *mask, + GimpLayerMask *mask, gboolean push_undo) { GimpImage *image; @@ -1223,7 +1223,7 @@ gimp_layer_add_mask (GimpLayer *layer, if (layer->mask) { g_message (_("Unable to add a layer mask since " - "the layer already has one.")); + "the layer already has one.")); return NULL; } @@ -1272,7 +1272,7 @@ gimp_layer_add_mask (GimpLayer *layer, GimpLayerMask * gimp_layer_create_mask (const GimpLayer *layer, - GimpAddMaskType add_mask_type) + GimpAddMaskType add_mask_type) { GimpDrawable *drawable; GimpItem *item; @@ -1290,12 +1290,12 @@ gimp_layer_create_mask (const GimpLayer *layer, image = gimp_item_get_image (item); mask_name = g_strdup_printf (_("%s mask"), - gimp_object_get_name (GIMP_OBJECT (layer))); + gimp_object_get_name (GIMP_OBJECT (layer))); mask = gimp_layer_mask_new (image, - item->width, - item->height, - mask_name, &black); + item->width, + item->height, + mask_name, &black); g_free (mask_name); @@ -1314,10 +1314,10 @@ gimp_layer_create_mask (const GimpLayer *layer, } pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles, - 0, 0, - GIMP_ITEM (mask)->width, + 0, 0, + GIMP_ITEM (mask)->width, GIMP_ITEM (mask)->height, - TRUE); + TRUE); switch (add_mask_type) { @@ -1328,13 +1328,13 @@ gimp_layer_create_mask (const GimpLayer *layer, case GIMP_ADD_ALPHA_MASK: case GIMP_ADD_ALPHA_TRANSFER_MASK: if (gimp_drawable_has_alpha (drawable)) - { - pixel_region_init (&srcPR, drawable->tiles, - 0, 0, - item->width, item->height, - FALSE); + { + pixel_region_init (&srcPR, drawable->tiles, + 0, 0, + item->width, item->height, + FALSE); - extract_alpha_region (&srcPR, NULL, &destPR); + extract_alpha_region (&srcPR, NULL, &destPR); if (add_mask_type == GIMP_ADD_ALPHA_TRANSFER_MASK) { @@ -1374,7 +1374,7 @@ gimp_layer_create_mask (const GimpLayer *layer, } } } - } + } break; case GIMP_ADD_SELECTION_MASK: @@ -1475,7 +1475,7 @@ gimp_layer_create_mask (const GimpLayer *layer, void gimp_layer_apply_mask (GimpLayer *layer, - GimpMaskApplyMode mode, + GimpMaskApplyMode mode, gboolean push_undo) { GimpItem *item; @@ -1528,15 +1528,15 @@ gimp_layer_apply_mask (GimpLayer *layer, /* Combine the current layer's alpha channel and the mask */ pixel_region_init (&srcPR, GIMP_DRAWABLE (layer)->tiles, - 0, 0, - item->width, - item->height, - TRUE); + 0, 0, + item->width, + item->height, + TRUE); pixel_region_init (&maskPR, GIMP_DRAWABLE (layer->mask)->tiles, - 0, 0, - item->width, - item->height, - FALSE); + 0, 0, + item->width, + item->height, + FALSE); apply_mask_to_region (&srcPR, &maskPR, OPAQUE_OPACITY); } @@ -1556,9 +1556,9 @@ gimp_layer_apply_mask (GimpLayer *layer, if (view_changed) { gimp_drawable_update (GIMP_DRAWABLE (layer), - 0, 0, - item->width, - item->height); + 0, 0, + item->width, + item->height); } else { @@ -1584,20 +1584,20 @@ gimp_layer_add_alpha (GimpLayer *layer) /* Allocate the new tiles */ new_tiles = tile_manager_new (GIMP_ITEM (layer)->width, - GIMP_ITEM (layer)->height, - GIMP_IMAGE_TYPE_BYTES (new_type)); + GIMP_ITEM (layer)->height, + GIMP_IMAGE_TYPE_BYTES (new_type)); /* Configure the pixel regions */ pixel_region_init (&srcPR, GIMP_DRAWABLE (layer)->tiles, - 0, 0, - GIMP_ITEM (layer)->width, - GIMP_ITEM (layer)->height, - FALSE); + 0, 0, + GIMP_ITEM (layer)->width, + GIMP_ITEM (layer)->height, + FALSE); pixel_region_init (&destPR, new_tiles, - 0, 0, - GIMP_ITEM (layer)->width, - GIMP_ITEM (layer)->height, - TRUE); + 0, 0, + GIMP_ITEM (layer)->width, + GIMP_ITEM (layer)->height, + TRUE); /* Add an alpha channel */ add_alpha_region (&srcPR, &destPR); @@ -1635,20 +1635,20 @@ gimp_layer_flatten (GimpLayer *layer, /* Allocate the new tiles */ new_tiles = tile_manager_new (GIMP_ITEM (layer)->width, - GIMP_ITEM (layer)->height, - GIMP_IMAGE_TYPE_BYTES (new_type)); + GIMP_ITEM (layer)->height, + GIMP_IMAGE_TYPE_BYTES (new_type)); /* Configure the pixel regions */ pixel_region_init (&srcPR, GIMP_DRAWABLE (layer)->tiles, - 0, 0, - GIMP_ITEM (layer)->width, - GIMP_ITEM (layer)->height, - FALSE); + 0, 0, + GIMP_ITEM (layer)->width, + GIMP_ITEM (layer)->height, + FALSE); pixel_region_init (&destPR, new_tiles, - 0, 0, - GIMP_ITEM (layer)->width, - GIMP_ITEM (layer)->height, - TRUE); + 0, 0, + GIMP_ITEM (layer)->width, + GIMP_ITEM (layer)->height, + TRUE); /* Remove alpha channel */ flatten_region (&srcPR, &destPR, bg); @@ -1689,7 +1689,7 @@ gimp_layer_resize_to_image (GimpLayer *layer, BoundSeg * gimp_layer_boundary (GimpLayer *layer, - gint *num_segs) + gint *num_segs) { GimpItem *item; BoundSeg *new_segs; @@ -1708,19 +1708,19 @@ gimp_layer_boundary (GimpLayer *layer, if (gimp_layer_is_floating_sel (layer)) { if (GIMP_IS_CHANNEL (layer->fs.drawable)) - { - /* if the owner drawable is a channel, just return nothing */ + { + /* if the owner drawable is a channel, just return nothing */ - g_free (new_segs); - *num_segs = 0; - return NULL; - } + g_free (new_segs); + *num_segs = 0; + return NULL; + } else - { - /* otherwise, set the layer to the owner drawable */ + { + /* otherwise, set the layer to the owner drawable */ - layer = GIMP_LAYER (layer->fs.drawable); - } + layer = GIMP_LAYER (layer->fs.drawable); + } } new_segs[0].x1 = item->offset_x; @@ -1794,9 +1794,9 @@ gimp_layer_set_opacity (GimpLayer *layer, g_object_notify (G_OBJECT (layer), "opacity"); gimp_drawable_update (GIMP_DRAWABLE (layer), - 0, 0, - GIMP_ITEM (layer)->width, - GIMP_ITEM (layer)->height); + 0, 0, + GIMP_ITEM (layer)->width, + GIMP_ITEM (layer)->height); } } @@ -1830,9 +1830,9 @@ gimp_layer_set_mode (GimpLayer *layer, g_object_notify (G_OBJECT (layer), "mode"); gimp_drawable_update (GIMP_DRAWABLE (layer), - 0, 0, - GIMP_ITEM (layer)->width, - GIMP_ITEM (layer)->height); + 0, 0, + GIMP_ITEM (layer)->width, + GIMP_ITEM (layer)->height); } } diff --git a/app/core/gimplayermask.c b/app/core/gimplayermask.c index 42499b5d0c..94cf9131e2 100644 --- a/app/core/gimplayermask.c +++ b/app/core/gimplayermask.c @@ -170,7 +170,7 @@ gimp_layer_mask_new (GimpImage *image, layer_mask = g_object_new (GIMP_TYPE_LAYER_MASK, NULL); gimp_drawable_configure (GIMP_DRAWABLE (layer_mask), - image, + image, 0, 0, width, height, GIMP_GRAY_IMAGE, name); @@ -187,7 +187,7 @@ gimp_layer_mask_new (GimpImage *image, void gimp_layer_mask_set_layer (GimpLayerMask *layer_mask, - GimpLayer *layer) + GimpLayer *layer) { g_return_if_fail (GIMP_IS_LAYER_MASK (layer_mask)); g_return_if_fail (layer == NULL || GIMP_IS_LAYER (layer)); @@ -238,9 +238,9 @@ gimp_layer_mask_set_apply (GimpLayerMask *layer_mask, GimpDrawable *drawable = GIMP_DRAWABLE (layer_mask->layer); gimp_drawable_update (drawable, - 0, 0, - gimp_item_width (GIMP_ITEM (drawable)), - gimp_item_height (GIMP_ITEM (drawable))); + 0, 0, + gimp_item_width (GIMP_ITEM (drawable)), + gimp_item_height (GIMP_ITEM (drawable))); } g_signal_emit (layer_mask, layer_mask_signals[APPLY_CHANGED], 0); @@ -299,9 +299,9 @@ gimp_layer_mask_set_show (GimpLayerMask *layer_mask, GimpDrawable *drawable = GIMP_DRAWABLE (layer_mask->layer); gimp_drawable_update (drawable, - 0, 0, - gimp_item_width (GIMP_ITEM (drawable)), - gimp_item_height (GIMP_ITEM (drawable))); + 0, 0, + gimp_item_width (GIMP_ITEM (drawable)), + gimp_item_height (GIMP_ITEM (drawable))); } g_signal_emit (layer_mask, layer_mask_signals[SHOW_CHANGED], 0); diff --git a/app/core/gimplayermask.h b/app/core/gimplayermask.h index 0298933006..29fd2d835c 100644 --- a/app/core/gimplayermask.h +++ b/app/core/gimplayermask.h @@ -58,14 +58,14 @@ struct _GimpLayerMaskClass GType gimp_layer_mask_get_type (void) G_GNUC_CONST; -GimpLayerMask * gimp_layer_mask_new (GimpImage *image, - gint width, - gint height, - const gchar *name, - const GimpRGB *color); +GimpLayerMask * gimp_layer_mask_new (GimpImage *image, + gint width, + gint height, + const gchar *name, + const GimpRGB *color); void gimp_layer_mask_set_layer (GimpLayerMask *layer_mask, - GimpLayer *layer); + GimpLayer *layer); GimpLayer * gimp_layer_mask_get_layer (const GimpLayerMask *layer_mask); void gimp_layer_mask_set_apply (GimpLayerMask *layer_mask, diff --git a/app/core/gimplist.c b/app/core/gimplist.c index eca9076462..9981b9d650 100644 --- a/app/core/gimplist.c +++ b/app/core/gimplist.c @@ -105,14 +105,14 @@ gimp_list_class_init (GimpListClass *klass) container_class->get_child_index = gimp_list_get_child_index; g_object_class_install_property (object_class, PROP_UNIQUE_NAMES, - g_param_spec_boolean ("unique-names", + g_param_spec_boolean ("unique-names", NULL, NULL, FALSE, GIMP_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_SORT_FUNC, - g_param_spec_pointer ("sort-func", + g_param_spec_pointer ("sort-func", NULL, NULL, GIMP_PARAM_READWRITE | G_PARAM_CONSTRUCT)); @@ -195,7 +195,7 @@ gimp_list_get_memsize (GimpObject *object, static void gimp_list_add (GimpContainer *container, - GimpObject *object) + GimpObject *object) { GimpList *list = GIMP_LIST (container); @@ -215,7 +215,7 @@ gimp_list_add (GimpContainer *container, static void gimp_list_remove (GimpContainer *container, - GimpObject *object) + GimpObject *object) { GimpList *list = GIMP_LIST (container); @@ -229,8 +229,8 @@ gimp_list_remove (GimpContainer *container, static void gimp_list_reorder (GimpContainer *container, - GimpObject *object, - gint new_index) + GimpObject *object, + gint new_index) { GimpList *list = GIMP_LIST (container); @@ -253,7 +253,7 @@ gimp_list_clear (GimpContainer *container) static gboolean gimp_list_have (const GimpContainer *container, - const GimpObject *object) + const GimpObject *object) { GimpList *list = GIMP_LIST (container); @@ -262,8 +262,8 @@ gimp_list_have (const GimpContainer *container, static void gimp_list_foreach (const GimpContainer *container, - GFunc func, - gpointer user_data) + GFunc func, + gpointer user_data) { GimpList *list = GIMP_LIST (container); @@ -272,7 +272,7 @@ gimp_list_foreach (const GimpContainer *container, static GimpObject * gimp_list_get_child_by_name (const GimpContainer *container, - const gchar *name) + const gchar *name) { GimpList *list = GIMP_LIST (container); GList *glist; @@ -282,7 +282,7 @@ gimp_list_get_child_by_name (const GimpContainer *container, GimpObject *object = glist->data; if (! strcmp (object->name, name)) - return object; + return object; } return NULL; @@ -290,7 +290,7 @@ gimp_list_get_child_by_name (const GimpContainer *container, static GimpObject * gimp_list_get_child_by_index (const GimpContainer *container, - gint index) + gint index) { GimpList *list = GIMP_LIST (container); GList *glist; @@ -305,7 +305,7 @@ gimp_list_get_child_by_index (const GimpContainer *container, static gint gimp_list_get_child_index (const GimpContainer *container, - const GimpObject *object) + const GimpObject *object) { GimpList *list = GIMP_LIST (container); @@ -476,9 +476,9 @@ gimp_list_uniquefy_name (GimpList *gimp_list, GimpObject *object2 = GIMP_OBJECT (list->data); if (object != object2 && - strcmp (gimp_object_get_name (GIMP_OBJECT (object)), - gimp_object_get_name (GIMP_OBJECT (object2))) == 0) - { + strcmp (gimp_object_get_name (GIMP_OBJECT (object)), + gimp_object_get_name (GIMP_OBJECT (object2))) == 0) + { ext = strrchr (object->name, '#'); if (ext) @@ -522,14 +522,14 @@ gimp_list_uniquefy_name (GimpList *gimp_list, continue; if (! strcmp (object2->name, new_name)) - break; + break; } } while (list2); gimp_object_take_name (object, new_name); - break; - } + break; + } } } diff --git a/app/core/gimpobject.c b/app/core/gimpobject.c index 3498ed0b6e..1d4c1e5086 100644 --- a/app/core/gimpobject.c +++ b/app/core/gimpobject.c @@ -74,21 +74,21 @@ gimp_object_class_init (GimpObjectClass *klass) object_signals[DISCONNECT] = g_signal_new ("disconnect", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpObjectClass, disconnect), - NULL, NULL, - gimp_marshal_VOID__VOID, - G_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpObjectClass, disconnect), + NULL, NULL, + gimp_marshal_VOID__VOID, + G_TYPE_NONE, 0); object_signals[NAME_CHANGED] = g_signal_new ("name-changed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpObjectClass, name_changed), - NULL, NULL, - gimp_marshal_VOID__VOID, - G_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpObjectClass, name_changed), + NULL, NULL, + gimp_marshal_VOID__VOID, + G_TYPE_NONE, 0); object_class->dispose = gimp_object_dispose; object_class->finalize = gimp_object_finalize; @@ -100,10 +100,10 @@ gimp_object_class_init (GimpObjectClass *klass) klass->get_memsize = gimp_object_real_get_memsize; g_object_class_install_property (object_class, PROP_NAME, - g_param_spec_string ("name", - NULL, NULL, - NULL, - GIMP_PARAM_READWRITE | + g_param_spec_string ("name", + NULL, NULL, + NULL, + GIMP_PARAM_READWRITE | G_PARAM_CONSTRUCT)); } @@ -139,9 +139,9 @@ gimp_object_finalize (GObject *object) static void gimp_object_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { GimpObject *gimp_object = GIMP_OBJECT (object); @@ -158,9 +158,9 @@ gimp_object_set_property (GObject *object, static void gimp_object_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { GimpObject *gimp_object = GIMP_OBJECT (object); @@ -188,7 +188,7 @@ gimp_object_get_property (GObject *object, **/ void gimp_object_set_name (GimpObject *object, - const gchar *name) + const gchar *name) { g_return_if_fail (GIMP_IS_OBJECT (object)); diff --git a/app/core/gimppalette-import.c b/app/core/gimppalette-import.c index 1de828f189..4e2b75099d 100644 --- a/app/core/gimppalette-import.c +++ b/app/core/gimppalette-import.c @@ -61,8 +61,8 @@ GimpPalette * gimp_palette_import_from_gradient (GimpGradient *gradient, gboolean reverse, - const gchar *palette_name, - gint n_colors) + const gchar *palette_name, + gint n_colors) { GimpPalette *palette; GimpGradientSegment *seg = NULL; @@ -107,9 +107,9 @@ static gint count_color_entries = 0; static GHashTable * gimp_palette_import_store_colors (GHashTable *table, - guchar *colors, - guchar *colors_real, - gint n_colors) + guchar *colors, + guchar *colors_real, + gint n_colors) { gpointer found_color = NULL; ImgColors *new_color; @@ -128,10 +128,10 @@ gimp_palette_import_store_colors (GHashTable *table, if (found_color == NULL) { if (count_color_entries > MAX_IMAGE_COLORS) - { - /* Don't add any more new ones */ - return table; - } + { + /* Don't add any more new ones */ + return table; + } count_color_entries++; @@ -152,7 +152,7 @@ gimp_palette_import_store_colors (GHashTable *table, new_color = found_color; if (new_color->count < (G_MAXINT - 1)) - new_color->count++; + new_color->count++; /* Now do the adjustments ...*/ new_color->r_adj += (colors_real[0] - colors[0]); @@ -161,13 +161,13 @@ gimp_palette_import_store_colors (GHashTable *table, /* Boundary conditions */ if(new_color->r_adj > (G_MAXINT - 255)) - new_color->r_adj /= new_color->count; + new_color->r_adj /= new_color->count; if(new_color->g_adj > (G_MAXINT - 255)) - new_color->g_adj /= new_color->count; + new_color->g_adj /= new_color->count; if(new_color->b_adj > (G_MAXINT - 255)) - new_color->b_adj /= new_color->count; + new_color->b_adj /= new_color->count; } return table; @@ -186,7 +186,7 @@ gimp_palette_import_create_list (gpointer key, static gint gimp_palette_import_sort_colors (gconstpointer a, - gconstpointer b) + gconstpointer b) { const ImgColors *s1 = a; const ImgColors *s2 = b; @@ -201,7 +201,7 @@ gimp_palette_import_sort_colors (gconstpointer a, static void gimp_palette_import_create_image_palette (gpointer data, - gpointer user_data) + gpointer user_data) { GimpPalette *palette = user_data; ImgColors *color_tab = data; @@ -210,7 +210,7 @@ gimp_palette_import_create_image_palette (gpointer data, GimpRGB color; n_colors = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (palette), - "import-n-colors")); + "import-n-colors")); if (palette->n_colors >= n_colors) return; @@ -245,7 +245,7 @@ gimp_palette_import_make_palette (GHashTable *table, list = g_slist_sort (list, gimp_palette_import_sort_colors); g_object_set_data (G_OBJECT (palette), "import-n-colors", - GINT_TO_POINTER (n_colors)); + GINT_TO_POINTER (n_colors)); g_slist_foreach (list, gimp_palette_import_create_image_palette, palette); @@ -289,14 +289,14 @@ gimp_palette_import_extract (GimpImage *image, gint i, j; for (i = 0; i < region.h; i++) - { - const guchar *idata = data; + { + const guchar *idata = data; - for (j = 0; j < region.w; j++) - { + for (j = 0; j < region.w; j++) + { guchar rgba[MAX_CHANNELS]; - gimp_image_get_color (image, type, idata, rgba); + gimp_image_get_color (image, type, idata, rgba); /* ignore completely transparent pixels */ if (rgba[ALPHA_PIX]) @@ -314,11 +314,11 @@ gimp_palette_import_extract (GimpImage *image, n_colors); } - idata += region.bytes; - } + idata += region.bytes; + } - data += region.rowstride; - } + data += region.rowstride; + } } return colors; @@ -326,9 +326,9 @@ gimp_palette_import_extract (GimpImage *image, GimpPalette * gimp_palette_import_from_image (GimpImage *image, - const gchar *palette_name, - gint n_colors, - gint threshold) + const gchar *palette_name, + gint n_colors, + gint threshold) { GimpPickable *pickable; GHashTable *colors; @@ -355,7 +355,7 @@ gimp_palette_import_from_image (GimpImage *image, GimpPalette * gimp_palette_import_from_indexed_image (GimpImage *image, - const gchar *palette_name) + const gchar *palette_name) { GimpPalette *palette; gint count; @@ -374,10 +374,10 @@ gimp_palette_import_from_indexed_image (GimpImage *image, g_snprintf (name, sizeof (name), _("Index %d"), count); gimp_rgba_set_uchar (&color, - image->cmap[count * 3 + 0], - image->cmap[count * 3 + 1], - image->cmap[count * 3 + 2], - 255); + image->cmap[count * 3 + 0], + image->cmap[count * 3 + 1], + image->cmap[count * 3 + 2], + 255); gimp_palette_add_entry (palette, -1, name, &color); } @@ -440,22 +440,22 @@ gimp_palette_detect_file_format (const gchar *filename) { if (read (fd, header, sizeof (header)) == sizeof (header)) { - if (strncmp (header + 0, "RIFF", 4) == 0 && + if (strncmp (header + 0, "RIFF", 4) == 0 && strncmp (header + 8, "PAL data", 8) == 0) - { + { format = GIMP_PALETTE_FILE_FORMAT_RIFF_PAL; - } + } - if (strncmp (header, "GIMP Palette", 12) == 0) - { + if (strncmp (header, "GIMP Palette", 12) == 0) + { format = GIMP_PALETTE_FILE_FORMAT_GPL; - } + } if (strncmp (header, "JASC-PAL", 8) == 0) { format = GIMP_PALETTE_FILE_FORMAT_PSP_PAL; } - } + } if (fstat (fd, &file_stat) >= 0) { diff --git a/app/core/gimppalette-import.h b/app/core/gimppalette-import.h index 0396fb1ede..7bbcab2e92 100644 --- a/app/core/gimppalette-import.h +++ b/app/core/gimppalette-import.h @@ -22,14 +22,14 @@ GimpPalette * gimp_palette_import_from_gradient (GimpGradient *gradient, gboolean reverse, - const gchar *palette_name, - gint n_colors); + const gchar *palette_name, + gint n_colors); GimpPalette * gimp_palette_import_from_image (GimpImage *image, - const gchar *palette_name, - gint n_colors, - gint treshold); + const gchar *palette_name, + gint n_colors, + gint treshold); GimpPalette * gimp_palette_import_from_indexed_image (GimpImage *image, - const gchar *palette_name); + const gchar *palette_name); GimpPalette * gimp_palette_import_from_drawable (GimpDrawable *drawable, const gchar *palette_name, gint n_colors, diff --git a/app/core/gimpparasitelist.h b/app/core/gimpparasitelist.h index 455734db05..efb10ea60a 100644 --- a/app/core/gimpparasitelist.h +++ b/app/core/gimpparasitelist.h @@ -44,9 +44,9 @@ struct _GimpParasiteListClass GimpObjectClass parent_class; void (* add) (GimpParasiteList *list, - GimpParasite *parasite); + GimpParasite *parasite); void (* remove) (GimpParasiteList *list, - GimpParasite *parasite); + GimpParasite *parasite); }; diff --git a/app/core/gimppdbprogress.c b/app/core/gimppdbprogress.c index 8727d5bfd2..855e039a96 100644 --- a/app/core/gimppdbprogress.c +++ b/app/core/gimppdbprogress.c @@ -397,7 +397,7 @@ gimp_pdb_progress_get_by_callback (GimpPdbProgressClass *klass, if (progress->callback_name && strcmp (callback_name, progress->callback_name) == 0) - return progress; + return progress; } return NULL; diff --git a/app/core/gimppickable.c b/app/core/gimppickable.c index 9d7886ba5b..18529ba427 100644 --- a/app/core/gimppickable.c +++ b/app/core/gimppickable.c @@ -188,18 +188,18 @@ gimp_pickable_pick_color (GimpPickable *pickable, gint radius = (gint) average_radius; for (i = x - radius; i <= x + radius; i++) - for (j = y - radius; j <= y + radius; j++) - if ((tmp_col = gimp_pickable_get_color_at (pickable, i, j))) - { - count++; + for (j = y - radius; j <= y + radius; j++) + if ((tmp_col = gimp_pickable_get_color_at (pickable, i, j))) + { + count++; - color_avg[RED_PIX] += tmp_col[RED_PIX]; - color_avg[GREEN_PIX] += tmp_col[GREEN_PIX]; - color_avg[BLUE_PIX] += tmp_col[BLUE_PIX]; + color_avg[RED_PIX] += tmp_col[RED_PIX]; + color_avg[GREEN_PIX] += tmp_col[GREEN_PIX]; + color_avg[BLUE_PIX] += tmp_col[BLUE_PIX]; color_avg[ALPHA_PIX] += tmp_col[ALPHA_PIX]; - g_free (tmp_col); - } + g_free (tmp_col); + } col[RED_PIX] = (guchar) (color_avg[RED_PIX] / count); col[GREEN_PIX] = (guchar) (color_avg[GREEN_PIX] / count); diff --git a/app/core/gimppreviewcache.c b/app/core/gimppreviewcache.c index b77f305c34..ab2f5a1115 100644 --- a/app/core/gimppreviewcache.c +++ b/app/core/gimppreviewcache.c @@ -40,7 +40,7 @@ typedef struct static gint preview_cache_compare (gconstpointer a, - gconstpointer b) + gconstpointer b) { const TempBuf *buf1 = a; const TempBuf *buf2 = b; @@ -53,7 +53,7 @@ preview_cache_compare (gconstpointer a, static void preview_cache_find_exact (gpointer data, - gpointer udata) + gpointer udata) { TempBuf *buf = data; PreviewNearest *nearest = udata; @@ -70,7 +70,7 @@ preview_cache_find_exact (gpointer data, static void preview_cache_find_biggest (gpointer data, - gpointer udata) + gpointer udata) { TempBuf *buf = data; PreviewNearest *nearest = udata; @@ -81,11 +81,11 @@ preview_cache_find_biggest (gpointer data, * If we already have it are these bigger dimensions? */ if (nearest->buf) - { - if (nearest->buf->width > buf->width && - nearest->buf->height > buf->height) - return; - } + { + if (nearest->buf->width > buf->width && + nearest->buf->height > buf->height) + return; + } nearest->buf = buf; } @@ -104,18 +104,18 @@ preview_cache_remove_smallest (GSList **plist) for (list = *plist; list; list = list->next) { if (!smallest) - { - smallest = list->data; - } + { + smallest = list->data; + } else - { - TempBuf *this = list->data; + { + TempBuf *this = list->data; - if (smallest->height * smallest->width > this->height * this->width) - { - smallest = this; - } - } + if (smallest->height * smallest->width > this->height * this->width) + { + smallest = this; + } + } } if (smallest) @@ -164,7 +164,7 @@ gimp_preview_cache_invalidate (GSList **plist) void gimp_preview_cache_add (GSList **plist, - TempBuf *buf) + TempBuf *buf) { #ifdef PREVIEW_CACHE_DEBUG g_print ("gimp_preview_cache_add: %d x %d\n", buf->width, buf->height); @@ -181,8 +181,8 @@ gimp_preview_cache_add (GSList **plist, TempBuf * gimp_preview_cache_get (GSList **plist, - gint width, - gint height) + gint width, + gint height) { PreviewNearest pn; @@ -248,22 +248,22 @@ gimp_preview_cache_get (GSList **plist, dest_data = temp_buf_data (preview); for (loop1 = 0 ; loop1 < height ; loop1++) - for (loop2 = 0 ; loop2 < width ; loop2++) - { - gint i; - guchar *src_pixel; - guchar *dest_pixel; + for (loop2 = 0 ; loop2 < width ; loop2++) + { + gint i; + guchar *src_pixel; + guchar *dest_pixel; - src_pixel = src_data + - ((gint) (loop2 * x_ratio)) * preview->bytes + - ((gint) (loop1 * y_ratio)) * pwidth * preview->bytes; + src_pixel = src_data + + ((gint) (loop2 * x_ratio)) * preview->bytes + + ((gint) (loop1 * y_ratio)) * pwidth * preview->bytes; - dest_pixel = dest_data + - (loop2 + loop1 * width) * preview->bytes; + dest_pixel = dest_data + + (loop2 + loop1 * width) * preview->bytes; - for (i = 0; i < preview->bytes; i++) - *dest_pixel++ = *src_pixel++; - } + for (i = 0; i < preview->bytes; i++) + *dest_pixel++ = *src_pixel++; + } gimp_preview_cache_add (plist, preview); diff --git a/app/core/gimpprojection-construct.c b/app/core/gimpprojection-construct.c index bf88b66688..88f1bcfd67 100644 --- a/app/core/gimpprojection-construct.c +++ b/app/core/gimpprojection-construct.c @@ -134,7 +134,7 @@ gimp_projection_construct (GimpProjection *proj, return; } - } + } } #endif @@ -187,10 +187,10 @@ gimp_projection_construct_layers (GimpProjection *proj, * to the list */ if (! gimp_layer_is_floating_sel (layer) && - gimp_item_get_visible (GIMP_ITEM (layer))) - { - reverse_list = g_list_prepend (reverse_list, layer); - } + gimp_item_get_visible (GIMP_ITEM (layer))) + { + reverse_list = g_list_prepend (reverse_list, layer); + } } for (list = reverse_list; list; list = g_list_next (list)) @@ -210,67 +210,67 @@ gimp_projection_construct_layers (GimpProjection *proj, /* configure the pixel regions */ pixel_region_init (&src1PR, gimp_projection_get_tiles (proj), - x1, y1, (x2 - x1), (y2 - y1), - TRUE); + x1, y1, (x2 - x1), (y2 - y1), + TRUE); /* If we're showing the layer mask instead of the layer... */ if (layer->mask && layer->mask->show_mask) - { - pixel_region_init (&src2PR, - gimp_drawable_get_tiles (GIMP_DRAWABLE (layer->mask)), - (x1 - off_x), (y1 - off_y), - (x2 - x1), (y2 - y1), FALSE); + { + pixel_region_init (&src2PR, + gimp_drawable_get_tiles (GIMP_DRAWABLE (layer->mask)), + (x1 - off_x), (y1 - off_y), + (x2 - x1), (y2 - y1), FALSE); - copy_gray_to_region (&src2PR, &src1PR); - } + copy_gray_to_region (&src2PR, &src1PR); + } /* Otherwise, normal */ else - { + { PixelRegion *mask = NULL; - pixel_region_init (&src2PR, - gimp_drawable_get_tiles (GIMP_DRAWABLE (layer)), - (x1 - off_x), (y1 - off_y), - (x2 - x1), (y2 - y1), FALSE); + pixel_region_init (&src2PR, + gimp_drawable_get_tiles (GIMP_DRAWABLE (layer)), + (x1 - off_x), (y1 - off_y), + (x2 - x1), (y2 - y1), FALSE); - if (layer->mask && layer->mask->apply_mask) - { - pixel_region_init (&maskPR, - gimp_drawable_get_tiles (GIMP_DRAWABLE (layer->mask)), - (x1 - off_x), (y1 - off_y), - (x2 - x1), (y2 - y1), FALSE); - mask = &maskPR; - } + if (layer->mask && layer->mask->apply_mask) + { + pixel_region_init (&maskPR, + gimp_drawable_get_tiles (GIMP_DRAWABLE (layer->mask)), + (x1 - off_x), (y1 - off_y), + (x2 - x1), (y2 - y1), FALSE); + mask = &maskPR; + } - /* Based on the type of the layer, project the layer onto the - * projection image... - */ - switch (gimp_drawable_type (GIMP_DRAWABLE (layer))) - { - case GIMP_RGB_IMAGE: + /* Based on the type of the layer, project the layer onto the + * projection image... + */ + switch (gimp_drawable_type (GIMP_DRAWABLE (layer))) + { + case GIMP_RGB_IMAGE: case GIMP_GRAY_IMAGE: - /* no mask possible */ - project_intensity (proj, layer, &src2PR, &src1PR, mask); - break; + /* no mask possible */ + project_intensity (proj, layer, &src2PR, &src1PR, mask); + break; - case GIMP_RGBA_IMAGE: + case GIMP_RGBA_IMAGE: case GIMP_GRAYA_IMAGE: - project_intensity_alpha (proj, layer, &src2PR, &src1PR, mask); - break; + project_intensity_alpha (proj, layer, &src2PR, &src1PR, mask); + break; - case GIMP_INDEXED_IMAGE: - /* no mask possible */ - project_indexed (proj, layer, &src2PR, &src1PR); - break; + case GIMP_INDEXED_IMAGE: + /* no mask possible */ + project_indexed (proj, layer, &src2PR, &src1PR); + break; - case GIMP_INDEXEDA_IMAGE: - project_indexed_alpha (proj, layer, &src2PR, &src1PR, mask); - break; + case GIMP_INDEXEDA_IMAGE: + project_indexed_alpha (proj, layer, &src2PR, &src1PR, mask); + break; - default: - break; - } - } + default: + break; + } + } proj->construct_flag = TRUE; /* something was projected */ } @@ -301,24 +301,24 @@ gimp_projection_construct_channels (GimpProjection *proj, GimpChannel *channel = list->data; if (gimp_item_get_visible (GIMP_ITEM (channel))) - { + { PixelRegion src1PR; PixelRegion src2PR; - /* configure the pixel regions */ - pixel_region_init (&src1PR, - gimp_projection_get_tiles (proj), - x, y, w, h, - TRUE); - pixel_region_init (&src2PR, - gimp_drawable_get_tiles (GIMP_DRAWABLE (channel)), - x, y, w, h, - FALSE); + /* configure the pixel regions */ + pixel_region_init (&src1PR, + gimp_projection_get_tiles (proj), + x, y, w, h, + TRUE); + pixel_region_init (&src2PR, + gimp_drawable_get_tiles (GIMP_DRAWABLE (channel)), + x, y, w, h, + FALSE); - project_channel (proj, channel, &src1PR, &src2PR); + project_channel (proj, channel, &src1PR, &src2PR); - proj->construct_flag = TRUE; - } + proj->construct_flag = TRUE; + } } g_list_free (reverse_list); @@ -350,15 +350,15 @@ gimp_projection_initialize (GimpProjection *proj, gimp_item_offsets (item, &off_x, &off_y); if (gimp_item_get_visible (item) && - ! gimp_drawable_has_alpha (GIMP_DRAWABLE (item)) && - (off_x <= x) && - (off_y <= y) && - (off_x + gimp_item_width (item) >= x + w) && - (off_y + gimp_item_height (item) >= y + h)) - { - coverage = TRUE; - break; - } + ! gimp_drawable_has_alpha (GIMP_DRAWABLE (item)) && + (off_x <= x) && + (off_y <= y) && + (off_x + gimp_item_width (item) >= x + w) && + (off_y + gimp_item_height (item) >= y + h)) + { + coverage = TRUE; + break; + } } if (!coverage) @@ -367,17 +367,17 @@ gimp_projection_initialize (GimpProjection *proj, guchar clear[4] = { 0, 0, 0, 0 }; pixel_region_init (&PR, gimp_projection_get_tiles (proj), - x, y, w, h, TRUE); + x, y, w, h, TRUE); color_region (&PR, clear); } } static void project_intensity (GimpProjection *proj, - GimpLayer *layer, - PixelRegion *src, - PixelRegion *dest, - PixelRegion *mask) + GimpLayer *layer, + PixelRegion *src, + PixelRegion *dest, + PixelRegion *mask) { if (! proj->construct_flag) initial_region (src, dest, mask, NULL, @@ -395,10 +395,10 @@ project_intensity (GimpProjection *proj, static void project_intensity_alpha (GimpProjection *proj, - GimpLayer *layer, - PixelRegion *src, - PixelRegion *dest, - PixelRegion *mask) + GimpLayer *layer, + PixelRegion *src, + PixelRegion *dest, + PixelRegion *mask) { if (! proj->construct_flag) initial_region (src, dest, mask, NULL, @@ -416,9 +416,9 @@ project_intensity_alpha (GimpProjection *proj, static void project_indexed (GimpProjection *proj, - GimpLayer *layer, - PixelRegion *src, - PixelRegion *dest) + GimpLayer *layer, + PixelRegion *src, + PixelRegion *dest) { g_return_if_fail (proj->image->cmap != NULL); @@ -434,10 +434,10 @@ project_indexed (GimpProjection *proj, static void project_indexed_alpha (GimpProjection *proj, - GimpLayer *layer, - PixelRegion *src, - PixelRegion *dest, - PixelRegion *mask) + GimpLayer *layer, + PixelRegion *src, + PixelRegion *dest, + PixelRegion *mask) { g_return_if_fail (proj->image->cmap != NULL); @@ -457,21 +457,21 @@ project_indexed_alpha (GimpProjection *proj, static void project_channel (GimpProjection *proj, - GimpChannel *channel, - PixelRegion *src, - PixelRegion *src2) + GimpChannel *channel, + PixelRegion *src, + PixelRegion *src2) { guchar col[3]; guchar opacity; gint type; gimp_rgba_get_uchar (&channel->color, - &col[0], &col[1], &col[2], &opacity); + &col[0], &col[1], &col[2], &opacity); if (! proj->construct_flag) { type = (channel->show_masked) ? - INITIAL_CHANNEL_MASK : INITIAL_CHANNEL_SELECTION; + INITIAL_CHANNEL_MASK : INITIAL_CHANNEL_SELECTION; initial_region (src2, src, NULL, col, opacity, @@ -482,7 +482,7 @@ project_channel (GimpProjection *proj, else { type = (channel->show_masked) ? - COMBINE_INTEN_A_CHANNEL_MASK : COMBINE_INTEN_A_CHANNEL_SELECTION; + COMBINE_INTEN_A_CHANNEL_MASK : COMBINE_INTEN_A_CHANNEL_SELECTION; combine_regions (src, src2, src, NULL, col, opacity, diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c index 983ed280a2..4708d55465 100644 --- a/app/core/gimpprojection.c +++ b/app/core/gimpprojection.c @@ -114,17 +114,17 @@ gimp_projection_class_init (GimpProjectionClass *klass) projection_signals[UPDATE] = g_signal_new ("update", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpProjectionClass, update), - NULL, NULL, - gimp_marshal_VOID__BOOLEAN_INT_INT_INT_INT, - G_TYPE_NONE, 5, + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpProjectionClass, update), + NULL, NULL, + gimp_marshal_VOID__BOOLEAN_INT_INT_INT_INT, + G_TYPE_NONE, 5, G_TYPE_BOOLEAN, - G_TYPE_INT, - G_TYPE_INT, - G_TYPE_INT, - G_TYPE_INT); + G_TYPE_INT, + G_TYPE_INT, + G_TYPE_INT, + G_TYPE_INT); object_class->finalize = gimp_projection_finalize; @@ -645,7 +645,7 @@ gimp_projection_invalidate (GimpProjection *proj, for (i = y; i < (y + h); i += (TILE_HEIGHT - (i % TILE_HEIGHT))) for (j = x; j < (x + w); j += (TILE_WIDTH - (j % TILE_WIDTH))) { - tile = tile_manager_get_tile (tm, j, i, FALSE, FALSE); + tile = tile_manager_get_tile (tm, j, i, FALSE, FALSE); tile_invalidate_tile (&tile, tm, j, i); } diff --git a/app/core/gimpprojection.h b/app/core/gimpprojection.h index 6cfb9e603f..8a9954e281 100644 --- a/app/core/gimpprojection.h +++ b/app/core/gimpprojection.h @@ -83,7 +83,7 @@ GimpProjection * gimp_projection_new (GimpImage *image); TileManager * gimp_projection_get_tiles (GimpProjection *proj); GimpImage * gimp_projection_get_image (const GimpProjection *proj); -GimpImageType gimp_projection_get_image_type (const GimpProjection *proj); +GimpImageType gimp_projection_get_image_type (const GimpProjection *proj); gint gimp_projection_get_bytes (const GimpProjection *proj); gdouble gimp_projection_get_opacity (const GimpProjection *proj); diff --git a/app/core/gimpselection.c b/app/core/gimpselection.c index e6d8cf9416..6a56762b5f 100644 --- a/app/core/gimpselection.c +++ b/app/core/gimpselection.c @@ -299,9 +299,9 @@ gimp_selection_invalidate_boundary (GimpDrawable *drawable) if (layer && gimp_layer_is_floating_sel (layer)) gimp_drawable_update (GIMP_DRAWABLE (layer), - 0, 0, - GIMP_ITEM (layer)->width, - GIMP_ITEM (layer)->height); + 0, 0, + GIMP_ITEM (layer)->width, + GIMP_ITEM (layer)->height); /* invalidate the preview */ drawable->preview_valid = FALSE; @@ -345,7 +345,7 @@ gimp_selection_boundary (GimpChannel *channel, return TRUE; } else if ((drawable = gimp_image_active_drawable (image)) && - GIMP_IS_CHANNEL (drawable)) + GIMP_IS_CHANNEL (drawable)) { /* Otherwise, return the boundary...if a channel is active */ @@ -372,9 +372,9 @@ gimp_selection_boundary (GimpChannel *channel, x1 = CLAMP (off_x, 0, image->width); y1 = CLAMP (off_y, 0, image->height); x2 = CLAMP (off_x + gimp_item_width (GIMP_ITEM (layer)), 0, - image->width); + image->width); y2 = CLAMP (off_y + gimp_item_height (GIMP_ITEM (layer)), 0, - image->height); + image->height); return GIMP_CHANNEL_CLASS (parent_class)->boundary (channel, segs_in, segs_out, @@ -492,7 +492,7 @@ gimp_selection_validate (TileManager *tm, { /* Set the contents of the tile to empty */ memset (tile_data_pointer (tile, 0, 0), - TRANSPARENT_OPACITY, tile_size (tile)); + TRANSPARENT_OPACITY, tile_size (tile)); } @@ -523,7 +523,7 @@ gimp_selection_new (GimpImage *image, /* Set the validate procedure */ tile_manager_set_validate_proc (GIMP_DRAWABLE (channel)->tiles, - gimp_selection_validate); + gimp_selection_validate); return channel; } @@ -550,10 +550,10 @@ gimp_selection_load (GimpChannel *selection, /* copy the channel to the mask */ pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles, - 0, 0, src_item->width, src_item->height, + 0, 0, src_item->width, src_item->height, FALSE); pixel_region_init (&destPR, GIMP_DRAWABLE (selection)->tiles, - 0, 0, dest_item->width, dest_item->height, + 0, 0, dest_item->width, dest_item->height, TRUE); copy_region (&srcPR, &destPR); @@ -620,7 +620,7 @@ gimp_selection_extract (GimpChannel *selection, if (non_empty && ((x1 == x2) || (y1 == y2))) { g_message (_("Unable to cut or copy because the " - "selected region is empty.")); + "selected region is empty.")); return NULL; } @@ -645,16 +645,16 @@ gimp_selection_extract (GimpChannel *selection, case GIMP_INDEXED: if (keep_indexed) - { - bytes = add_alpha ? 2 : drawable->bytes; - base_type = GIMP_GRAY; - } + { + bytes = add_alpha ? 2 : drawable->bytes; + base_type = GIMP_GRAY; + } else - { - bytes = (add_alpha || + { + bytes = (add_alpha || gimp_drawable_has_alpha (drawable)) ? 4 : 3; - base_type = GIMP_INDEXED; - } + base_type = GIMP_INDEXED; + } break; default: @@ -678,7 +678,7 @@ gimp_selection_extract (GimpChannel *selection, /* configure the pixel regions */ pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable), - x1, y1, + x1, y1, x2 - x1, y2 - y1, cut_image); pixel_region_init (&destPR, tiles, @@ -690,58 +690,58 @@ gimp_selection_extract (GimpChannel *selection, { pixel_region_init (&maskPR, gimp_drawable_get_tiles (GIMP_DRAWABLE (selection)), - (x1 + off_x), (y1 + off_y), (x2 - x1), (y2 - y1), - FALSE); + (x1 + off_x), (y1 + off_y), (x2 - x1), (y2 - y1), + FALSE); extract_from_region (&srcPR, &destPR, &maskPR, - gimp_drawable_get_colormap (drawable), - bg_color, base_type, cut_image); + gimp_drawable_get_colormap (drawable), + bg_color, base_type, cut_image); if (cut_image) - { - /* Clear the region */ - gimp_channel_clear (selection, NULL, TRUE); + { + /* Clear the region */ + gimp_channel_clear (selection, NULL, TRUE); - /* Update the region */ - gimp_drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1)); - } + /* Update the region */ + gimp_drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1)); + } } else /* Otherwise, get the entire active layer */ { /* If the layer is indexed...we need to extract pixels */ if (base_type == GIMP_INDEXED && !keep_indexed) - extract_from_region (&srcPR, &destPR, NULL, - gimp_drawable_get_colormap (drawable), - bg_color, base_type, FALSE); + extract_from_region (&srcPR, &destPR, NULL, + gimp_drawable_get_colormap (drawable), + bg_color, base_type, FALSE); /* If the layer doesn't have an alpha channel, add one */ else if (bytes > srcPR.bytes) - add_alpha_region (&srcPR, &destPR); + add_alpha_region (&srcPR, &destPR); /* Otherwise, do a straight copy */ else - copy_region (&srcPR, &destPR); + copy_region (&srcPR, &destPR); /* If we're cutting, remove either the layer (or floating selection), * the layer mask, or the channel */ if (cut_image) - { - if (GIMP_IS_LAYER (drawable)) - { - if (gimp_layer_is_floating_sel (GIMP_LAYER (drawable))) - floating_sel_remove (GIMP_LAYER (drawable)); - else - gimp_image_remove_layer (image, GIMP_LAYER (drawable)); - } - else if (GIMP_IS_LAYER_MASK (drawable)) - { - gimp_layer_apply_mask (gimp_layer_mask_get_layer (GIMP_LAYER_MASK (drawable)), - GIMP_MASK_DISCARD, TRUE); - } - else if (GIMP_IS_CHANNEL (drawable)) - { - gimp_image_remove_channel (image, GIMP_CHANNEL (drawable)); - } - } + { + if (GIMP_IS_LAYER (drawable)) + { + if (gimp_layer_is_floating_sel (GIMP_LAYER (drawable))) + floating_sel_remove (GIMP_LAYER (drawable)); + else + gimp_image_remove_layer (image, GIMP_LAYER (drawable)); + } + else if (GIMP_IS_LAYER_MASK (drawable)) + { + gimp_layer_apply_mask (gimp_layer_mask_get_layer (GIMP_LAYER_MASK (drawable)), + GIMP_MASK_DISCARD, TRUE); + } + else if (GIMP_IS_CHANNEL (drawable)) + { + gimp_image_remove_channel (image, GIMP_CHANNEL (drawable)); + } + } } return tiles; @@ -773,7 +773,7 @@ gimp_selection_float (GimpChannel *selection, if (! non_empty || (x1 == x2) || (y1 == y2)) { g_message (_("Cannot float selection because the " - "selected region is empty.")); + "selected region is empty.")); return NULL; } @@ -796,8 +796,8 @@ gimp_selection_float (GimpChannel *selection, layer = gimp_layer_new_from_tiles (tiles, image, gimp_drawable_type_with_alpha (drawable), - _("Floated Layer"), - GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE); + _("Floated Layer"), + GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE); /* Set the offsets */ tile_manager_get_offsets (tiles, &x1, &y1); diff --git a/app/core/gimpstrokeoptions.c b/app/core/gimpstrokeoptions.c index 46f4bd285e..ca3c913c66 100644 --- a/app/core/gimpstrokeoptions.c +++ b/app/core/gimpstrokeoptions.c @@ -103,9 +103,9 @@ gimp_stroke_options_class_init (GimpStrokeOptionsClass *klass) 0.0, 2000.0, 6.0, GIMP_PARAM_STATIC_STRINGS); GIMP_CONFIG_INSTALL_PROP_UNIT (object_class, PROP_UNIT, - "unit", NULL, - TRUE, FALSE, GIMP_UNIT_PIXEL, - GIMP_PARAM_STATIC_STRINGS); + "unit", NULL, + TRUE, FALSE, GIMP_UNIT_PIXEL, + GIMP_PARAM_STATIC_STRINGS); GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_CAP_STYLE, "cap-style", NULL, GIMP_TYPE_CAP_STYLE, GIMP_CAP_BUTT, diff --git a/app/core/gimptemplate.c b/app/core/gimptemplate.c index da12c7f7b2..dd0d21af30 100644 --- a/app/core/gimptemplate.c +++ b/app/core/gimptemplate.c @@ -369,9 +369,9 @@ gimp_template_create_image (Gimp *gimp, g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); image = gimp_create_image (gimp, - template->width, template->height, - template->image_type, - FALSE); + template->width, template->height, + template->image_type, + FALSE); gimp_image_undo_disable (image); @@ -409,7 +409,7 @@ gimp_template_create_image (Gimp *gimp, layer = gimp_layer_new (image, width, height, type, _("Background"), - GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE); + GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE); gimp_drawable_fill_by_type (GIMP_DRAWABLE (layer), context, template->fill_type); diff --git a/app/core/gimptoolinfo.c b/app/core/gimptoolinfo.c index 871a362b08..ab2259fc9b 100644 --- a/app/core/gimptoolinfo.c +++ b/app/core/gimptoolinfo.c @@ -204,18 +204,18 @@ gimp_tool_info_get_description (GimpViewable *viewable, GimpToolInfo * gimp_tool_info_new (Gimp *gimp, - GType tool_type, + GType tool_type, GType tool_options_type, GimpContextPropMask context_props, - const gchar *identifier, - const gchar *blurb, - const gchar *help, - const gchar *menu_path, - const gchar *menu_accel, - const gchar *help_domain, - const gchar *help_id, + const gchar *identifier, + const gchar *blurb, + const gchar *help, + const gchar *menu_path, + const gchar *menu_accel, + const gchar *help_domain, + const gchar *help_id, const gchar *paint_core_name, - const gchar *stock_id) + const gchar *stock_id) { GimpPaintInfo *paint_info; GimpToolInfo *tool_info; @@ -288,7 +288,7 @@ gimp_tool_info_new (Gimp *gimp, void gimp_tool_info_set_standard (Gimp *gimp, - GimpToolInfo *tool_info) + GimpToolInfo *tool_info) { g_return_if_fail (GIMP_IS_GIMP (gimp)); g_return_if_fail (! tool_info || GIMP_IS_TOOL_INFO (tool_info)); diff --git a/app/core/gimptoolinfo.h b/app/core/gimptoolinfo.h index 9211c53200..19f31ddf50 100644 --- a/app/core/gimptoolinfo.h +++ b/app/core/gimptoolinfo.h @@ -68,21 +68,21 @@ struct _GimpToolInfoClass GType gimp_tool_info_get_type (void) G_GNUC_CONST; GimpToolInfo * gimp_tool_info_new (Gimp *gimp, - GType tool_type, + GType tool_type, GType tool_options_type, - GimpContextPropMask context_props, - const gchar *identifier, - const gchar *blurb, - const gchar *help, - const gchar *menu_path, - const gchar *menu_accel, - const gchar *help_domain, - const gchar *help_id, + GimpContextPropMask context_props, + const gchar *identifier, + const gchar *blurb, + const gchar *help, + const gchar *menu_path, + const gchar *menu_accel, + const gchar *help_domain, + const gchar *help_id, const gchar *paint_core_name, - const gchar *stock_id); + const gchar *stock_id); void gimp_tool_info_set_standard (Gimp *gimp, - GimpToolInfo *tool_info); + GimpToolInfo *tool_info); GimpToolInfo * gimp_tool_info_get_standard (Gimp *gimp); diff --git a/app/core/gimpunit.c b/app/core/gimpunit.c index 1cc6f3151f..894688e223 100644 --- a/app/core/gimpunit.c +++ b/app/core/gimpunit.c @@ -75,7 +75,7 @@ static const GimpUnitDef gimp_unit_percent = static GimpUnitDef * _gimp_unit_get_user_unit (Gimp *gimp, - GimpUnit unit) + GimpUnit unit) { return g_list_nth_data (gimp->user_units, unit - GIMP_UNIT_END); } @@ -97,13 +97,13 @@ _gimp_unit_get_number_of_built_in_units (Gimp *gimp) GimpUnit _gimp_unit_new (Gimp *gimp, - const gchar *identifier, - gdouble factor, - gint digits, - const gchar *symbol, - const gchar *abbreviation, - const gchar *singular, - const gchar *plural) + const gchar *identifier, + gdouble factor, + gint digits, + const gchar *symbol, + const gchar *abbreviation, + const gchar *singular, + const gchar *plural) { GimpUnitDef *user_unit; @@ -126,7 +126,7 @@ _gimp_unit_new (Gimp *gimp, gboolean _gimp_unit_get_deletion_flag (Gimp *gimp, - GimpUnit unit) + GimpUnit unit) { g_return_val_if_fail (unit < (GIMP_UNIT_END + gimp->n_user_units), FALSE); @@ -138,11 +138,11 @@ _gimp_unit_get_deletion_flag (Gimp *gimp, void _gimp_unit_set_deletion_flag (Gimp *gimp, - GimpUnit unit, - gboolean deletion_flag) + GimpUnit unit, + gboolean deletion_flag) { g_return_if_fail ((unit >= GIMP_UNIT_END) && - (unit < (GIMP_UNIT_END + gimp->n_user_units))); + (unit < (GIMP_UNIT_END + gimp->n_user_units))); _gimp_unit_get_user_unit (gimp, unit)->delete_on_exit = deletion_flag ? TRUE : FALSE; @@ -150,10 +150,10 @@ _gimp_unit_set_deletion_flag (Gimp *gimp, gdouble _gimp_unit_get_factor (Gimp *gimp, - GimpUnit unit) + GimpUnit unit) { g_return_val_if_fail (unit < (GIMP_UNIT_END + gimp->n_user_units), - gimp_unit_defs[GIMP_UNIT_INCH].factor); + gimp_unit_defs[GIMP_UNIT_INCH].factor); if (unit < GIMP_UNIT_END) return gimp_unit_defs[unit].factor; @@ -163,10 +163,10 @@ _gimp_unit_get_factor (Gimp *gimp, gint _gimp_unit_get_digits (Gimp *gimp, - GimpUnit unit) + GimpUnit unit) { g_return_val_if_fail (unit < (GIMP_UNIT_END + gimp->n_user_units), - gimp_unit_defs[GIMP_UNIT_INCH].digits); + gimp_unit_defs[GIMP_UNIT_INCH].digits); if (unit < GIMP_UNIT_END) return gimp_unit_defs[unit].digits; @@ -176,11 +176,11 @@ _gimp_unit_get_digits (Gimp *gimp, const gchar * _gimp_unit_get_identifier (Gimp *gimp, - GimpUnit unit) + GimpUnit unit) { g_return_val_if_fail ((unit < (GIMP_UNIT_END + gimp->n_user_units)) || - (unit == GIMP_UNIT_PERCENT), - gimp_unit_defs[GIMP_UNIT_INCH].identifier); + (unit == GIMP_UNIT_PERCENT), + gimp_unit_defs[GIMP_UNIT_INCH].identifier); if (unit < GIMP_UNIT_END) return gimp_unit_defs[unit].identifier; @@ -193,11 +193,11 @@ _gimp_unit_get_identifier (Gimp *gimp, const gchar * _gimp_unit_get_symbol (Gimp *gimp, - GimpUnit unit) + GimpUnit unit) { g_return_val_if_fail ((unit < (GIMP_UNIT_END + gimp->n_user_units)) || - (unit == GIMP_UNIT_PERCENT), - gimp_unit_defs[GIMP_UNIT_INCH].symbol); + (unit == GIMP_UNIT_PERCENT), + gimp_unit_defs[GIMP_UNIT_INCH].symbol); if (unit < GIMP_UNIT_END) return gimp_unit_defs[unit].symbol; @@ -210,11 +210,11 @@ _gimp_unit_get_symbol (Gimp *gimp, const gchar * _gimp_unit_get_abbreviation (Gimp *gimp, - GimpUnit unit) + GimpUnit unit) { g_return_val_if_fail ((unit < (GIMP_UNIT_END + gimp->n_user_units)) || - (unit == GIMP_UNIT_PERCENT), - gimp_unit_defs[GIMP_UNIT_INCH].abbreviation); + (unit == GIMP_UNIT_PERCENT), + gimp_unit_defs[GIMP_UNIT_INCH].abbreviation); if (unit < GIMP_UNIT_END) return gimp_unit_defs[unit].abbreviation; @@ -227,11 +227,11 @@ _gimp_unit_get_abbreviation (Gimp *gimp, const gchar * _gimp_unit_get_singular (Gimp *gimp, - GimpUnit unit) + GimpUnit unit) { g_return_val_if_fail ((unit < (GIMP_UNIT_END + gimp->n_user_units)) || - (unit == GIMP_UNIT_PERCENT), - gettext (gimp_unit_defs[GIMP_UNIT_INCH].singular)); + (unit == GIMP_UNIT_PERCENT), + gettext (gimp_unit_defs[GIMP_UNIT_INCH].singular)); if (unit < GIMP_UNIT_END) return gettext (gimp_unit_defs[unit].singular); @@ -244,11 +244,11 @@ _gimp_unit_get_singular (Gimp *gimp, const gchar * _gimp_unit_get_plural (Gimp *gimp, - GimpUnit unit) + GimpUnit unit) { g_return_val_if_fail ((unit < (GIMP_UNIT_END + gimp->n_user_units)) || - (unit == GIMP_UNIT_PERCENT), - gettext (gimp_unit_defs[GIMP_UNIT_INCH].plural)); + (unit == GIMP_UNIT_PERCENT), + gettext (gimp_unit_defs[GIMP_UNIT_INCH].plural)); if (unit < GIMP_UNIT_END) return gettext (gimp_unit_defs[unit].plural); diff --git a/app/dialogs/channel-options-dialog.c b/app/dialogs/channel-options-dialog.c index cccc63fd5a..e27fadb78b 100644 --- a/app/dialogs/channel-options-dialog.c +++ b/app/dialogs/channel-options-dialog.c @@ -61,7 +61,7 @@ channel_options_dialog_new (GimpImage *image, const gchar *help_id, const gchar *color_label, const gchar *opacity_label, - gboolean show_from_sel) + gboolean show_from_sel) { ChannelOptionsDialog *options; GimpViewable *viewable; @@ -90,9 +90,9 @@ channel_options_dialog_new (GimpImage *image, options->channel = channel; options->color_panel = gimp_color_panel_new (color_label, - channel_color, - GIMP_COLOR_AREA_LARGE_CHECKS, - 48, 64); + channel_color, + GIMP_COLOR_AREA_LARGE_CHECKS, + 48, 64); gimp_color_panel_set_context (GIMP_COLOR_PANEL (options->color_panel), context); @@ -113,8 +113,8 @@ channel_options_dialog_new (GimpImage *image, NULL); g_object_weak_ref (G_OBJECT (options->dialog), - (GWeakNotify) g_free, - options); + (GWeakNotify) g_free, + options); gtk_dialog_set_alternative_button_order (GTK_DIALOG (options->dialog), GTK_RESPONSE_OK, @@ -156,16 +156,16 @@ channel_options_dialog_new (GimpImage *image, NULL, NULL); g_signal_connect (opacity_adj, "value-changed", - G_CALLBACK (channel_options_opacity_update), - options->color_panel); + G_CALLBACK (channel_options_opacity_update), + options->color_panel); gtk_box_pack_start (GTK_BOX (hbox), options->color_panel, - TRUE, TRUE, 0); + TRUE, TRUE, 0); gtk_widget_show (options->color_panel); g_signal_connect (options->color_panel, "color-changed", - G_CALLBACK (channel_options_color_changed), - opacity_adj); + G_CALLBACK (channel_options_color_changed), + opacity_adj); if (show_from_sel) { @@ -173,7 +173,7 @@ channel_options_dialog_new (GimpImage *image, gtk_check_button_new_with_mnemonic (_("Initialize from _selection")); gtk_box_pack_start (GTK_BOX (vbox), options->save_sel_checkbutton, - FALSE, FALSE, 0); + FALSE, FALSE, 0); gtk_widget_show (options->save_sel_checkbutton); } diff --git a/app/dialogs/channel-options-dialog.h b/app/dialogs/channel-options-dialog.h index 8ff6e6a4c5..44afc20c37 100644 --- a/app/dialogs/channel-options-dialog.h +++ b/app/dialogs/channel-options-dialog.h @@ -48,7 +48,7 @@ ChannelOptionsDialog * channel_options_dialog_new (GimpImage *image, const gchar *help_id, const gchar *color_label, const gchar *opacity_label, - gboolean show_from_sel); + gboolean show_from_sel); #endif /* __CHANNEL_OPTIONS_DIALOG_H__ */ diff --git a/app/dialogs/convert-dialog.c b/app/dialogs/convert-dialog.c index b027d7b80f..c93361f98f 100644 --- a/app/dialogs/convert-dialog.c +++ b/app/dialogs/convert-dialog.c @@ -154,7 +154,7 @@ convert_dialog_new (GimpImage *image, main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog->dialog)->vbox), - main_vbox); + main_vbox); gtk_widget_show (main_vbox); @@ -187,14 +187,14 @@ convert_dialog_new (GimpImage *image, dialog->num_colors = 255; spinbutton = gimp_spin_button_new (&adjustment, dialog->num_colors, - 2, 256, 1, 8, 0, 1, 0); + 2, 256, 1, 8, 0, 1, 0); gtk_label_set_mnemonic_widget (GTK_LABEL (label), spinbutton); gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0); gtk_widget_show (spinbutton); g_signal_connect (adjustment, "value-changed", - G_CALLBACK (gimp_int_adjustment_update), - &dialog->num_colors); + G_CALLBACK (gimp_int_adjustment_update), + &dialog->num_colors); /* custom palette */ if (palette_box) @@ -214,8 +214,8 @@ convert_dialog_new (GimpImage *image, gtk_widget_show (toggle); g_signal_connect (toggle, "toggled", - G_CALLBACK (gimp_toggle_button_update), - &dialog->remove_dups); + G_CALLBACK (gimp_toggle_button_update), + &dialog->remove_dups); } @@ -255,8 +255,8 @@ convert_dialog_new (GimpImage *image, gtk_widget_show (toggle); g_signal_connect (toggle, "toggled", - G_CALLBACK (gimp_toggle_button_update), - &dialog->alpha_dither); + G_CALLBACK (gimp_toggle_button_update), + &dialog->alpha_dither); return dialog->dialog; } @@ -341,10 +341,10 @@ convert_dialog_palette_box (IndexedDialog *dialog) /* Preferentially, the initial default is 'Web' if available */ if (web_palette == NULL && - g_ascii_strcasecmp (GIMP_OBJECT (palette)->name, "Web") == 0) - { - web_palette = palette; - } + g_ascii_strcasecmp (GIMP_OBJECT (palette)->name, "Web") == 0) + { + web_palette = palette; + } if (saved_palette == palette) { @@ -381,7 +381,7 @@ convert_dialog_palette_filter (const GimpObject *object, static void convert_dialog_palette_changed (GimpContext *context, - GimpPalette *palette, + GimpPalette *palette, IndexedDialog *dialog) { if (! palette) diff --git a/app/dialogs/desaturate-dialog.c b/app/dialogs/desaturate-dialog.c index 1b0d6cfb51..de9e237bd0 100644 --- a/app/dialogs/desaturate-dialog.c +++ b/app/dialogs/desaturate-dialog.c @@ -81,7 +81,7 @@ desaturate_dialog_new (GimpDrawable *drawable, gtk_window_set_resizable (GTK_WINDOW (dialog->dialog), FALSE); g_object_weak_ref (G_OBJECT (dialog->dialog), - (GWeakNotify) g_free, dialog); + (GWeakNotify) g_free, dialog); vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (vbox), 12); diff --git a/app/dialogs/dialogs-constructors.c b/app/dialogs/dialogs-constructors.c index 15cef20071..7685d6fd73 100644 --- a/app/dialogs/dialogs-constructors.c +++ b/app/dialogs/dialogs-constructors.c @@ -129,7 +129,7 @@ dialogs_file_save_new (GimpDialogFactory *factory, GtkWidget * dialogs_preferences_get (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { return preferences_dialog_create (context->gimp); @@ -153,7 +153,7 @@ dialogs_module_get (GimpDialogFactory *factory, GtkWidget * dialogs_tips_get (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { return tips_dialog_create (context->gimp); @@ -161,7 +161,7 @@ dialogs_tips_get (GimpDialogFactory *factory, GtkWidget * dialogs_about_get (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { return about_dialog_create (context); @@ -198,7 +198,7 @@ dialogs_quit_get (GimpDialogFactory *factory, GtkWidget * dialogs_toolbox_get (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { /* we pass "global_dock_factory", _not_ "global_toolbox_factory" to @@ -210,7 +210,7 @@ dialogs_toolbox_get (GimpDialogFactory *factory, GtkWidget * dialogs_dock_new (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { return gimp_menu_dock_new (factory, @@ -256,7 +256,7 @@ dialogs_dockable_constructor (GimpDialogFactory *factory, GtkWidget * dialogs_tool_options_new (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { return gimp_tool_options_editor_new (context->gimp, @@ -273,7 +273,7 @@ dialogs_device_status_new (GimpDialogFactory *factory, GtkWidget * dialogs_error_console_new (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { return gimp_error_console_new (context->gimp, @@ -293,7 +293,7 @@ dialogs_cursor_view_new (GimpDialogFactory *factory, GtkWidget * dialogs_image_list_view_new (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { return gimp_image_view_new (GIMP_VIEW_TYPE_LIST, @@ -305,20 +305,20 @@ dialogs_image_list_view_new (GimpDialogFactory *factory, GtkWidget * dialogs_brush_list_view_new (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { return gimp_brush_factory_view_new (GIMP_VIEW_TYPE_LIST, - context->gimp->brush_factory, - context, - TRUE, - view_size, 1, + context->gimp->brush_factory, + context, + TRUE, + view_size, 1, factory->menu_factory); } GtkWidget * dialogs_pattern_list_view_new (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { return gimp_pattern_factory_view_new (GIMP_VIEW_TYPE_LIST, @@ -330,7 +330,7 @@ dialogs_pattern_list_view_new (GimpDialogFactory *factory, GtkWidget * dialogs_gradient_list_view_new (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { return gimp_data_factory_view_new (GIMP_VIEW_TYPE_LIST, @@ -344,7 +344,7 @@ dialogs_gradient_list_view_new (GimpDialogFactory *factory, GtkWidget * dialogs_palette_list_view_new (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { return gimp_data_factory_view_new (GIMP_VIEW_TYPE_LIST, @@ -370,7 +370,7 @@ dialogs_font_list_view_new (GimpDialogFactory *factory, GtkWidget * dialogs_tool_list_view_new (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { return gimp_tool_view_new (GIMP_VIEW_TYPE_LIST, @@ -382,13 +382,13 @@ dialogs_tool_list_view_new (GimpDialogFactory *factory, GtkWidget * dialogs_buffer_list_view_new (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { return gimp_buffer_view_new (GIMP_VIEW_TYPE_LIST, - context->gimp->named_buffers, - context, - view_size, 1, + context->gimp->named_buffers, + context, + view_size, 1, factory->menu_factory); } @@ -421,7 +421,7 @@ dialogs_template_list_view_new (GimpDialogFactory *factory, GtkWidget * dialogs_image_grid_view_new (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { return gimp_image_view_new (GIMP_VIEW_TYPE_GRID, @@ -433,20 +433,20 @@ dialogs_image_grid_view_new (GimpDialogFactory *factory, GtkWidget * dialogs_brush_grid_view_new (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { return gimp_brush_factory_view_new (GIMP_VIEW_TYPE_GRID, - context->gimp->brush_factory, - context, - TRUE, - view_size, 1, + context->gimp->brush_factory, + context, + TRUE, + view_size, 1, factory->menu_factory); } GtkWidget * dialogs_pattern_grid_view_new (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { return gimp_pattern_factory_view_new (GIMP_VIEW_TYPE_GRID, @@ -458,7 +458,7 @@ dialogs_pattern_grid_view_new (GimpDialogFactory *factory, GtkWidget * dialogs_gradient_grid_view_new (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { return gimp_data_factory_view_new (GIMP_VIEW_TYPE_GRID, @@ -472,7 +472,7 @@ dialogs_gradient_grid_view_new (GimpDialogFactory *factory, GtkWidget * dialogs_palette_grid_view_new (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { return gimp_data_factory_view_new (GIMP_VIEW_TYPE_GRID, @@ -498,7 +498,7 @@ dialogs_font_grid_view_new (GimpDialogFactory *factory, GtkWidget * dialogs_tool_grid_view_new (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { return gimp_tool_view_new (GIMP_VIEW_TYPE_GRID, @@ -510,13 +510,13 @@ dialogs_tool_grid_view_new (GimpDialogFactory *factory, GtkWidget * dialogs_buffer_grid_view_new (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { return gimp_buffer_view_new (GIMP_VIEW_TYPE_GRID, - context->gimp->named_buffers, - context, - view_size, 1, + context->gimp->named_buffers, + context, + view_size, 1, factory->menu_factory); } @@ -549,7 +549,7 @@ dialogs_template_grid_view_new (GimpDialogFactory *factory, GtkWidget * dialogs_layer_list_view_new (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { if (view_size < 1) @@ -564,7 +564,7 @@ dialogs_layer_list_view_new (GimpDialogFactory *factory, GtkWidget * dialogs_channel_list_view_new (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { if (view_size < 1) @@ -579,7 +579,7 @@ dialogs_channel_list_view_new (GimpDialogFactory *factory, GtkWidget * dialogs_vectors_list_view_new (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { if (view_size < 1) @@ -594,7 +594,7 @@ dialogs_vectors_list_view_new (GimpDialogFactory *factory, GtkWidget * dialogs_colormap_editor_new (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { GtkWidget *view; @@ -602,8 +602,8 @@ dialogs_colormap_editor_new (GimpDialogFactory *factory, view = gimp_colormap_editor_new (factory->menu_factory); g_signal_connect (view, "selected", - G_CALLBACK (dialogs_indexed_palette_selected), - NULL); + G_CALLBACK (dialogs_indexed_palette_selected), + NULL); return view; } @@ -670,7 +670,7 @@ dialogs_color_editor_new (GimpDialogFactory *factory, GtkWidget * dialogs_brush_editor_get (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { return gimp_brush_editor_new (context->gimp, @@ -679,7 +679,7 @@ dialogs_brush_editor_get (GimpDialogFactory *factory, GtkWidget * dialogs_gradient_editor_get (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { return gimp_gradient_editor_new (context->gimp, @@ -688,7 +688,7 @@ dialogs_gradient_editor_get (GimpDialogFactory *factory, GtkWidget * dialogs_palette_editor_get (GimpDialogFactory *factory, - GimpContext *context, + GimpContext *context, gint view_size) { return gimp_palette_editor_new (context->gimp, @@ -701,7 +701,7 @@ dialogs_palette_editor_get (GimpDialogFactory *factory, static void dialogs_indexed_palette_selected (GimpColormapEditor *editor, GdkModifierType state, - gpointer data) + gpointer data) { GimpImageEditor *image_editor = GIMP_IMAGE_EDITOR (editor); diff --git a/app/dialogs/dialogs.c b/app/dialogs/dialogs.c index a7f3546ecf..e3cfc3446c 100644 --- a/app/dialogs/dialogs.c +++ b/app/dialogs/dialogs.c @@ -236,9 +236,9 @@ dialogs_init (Gimp *gimp, g_return_if_fail (GIMP_IS_MENU_FACTORY (menu_factory)); global_dialog_factory = gimp_dialog_factory_new ("toplevel", - gimp_get_user_context (gimp), - menu_factory, - NULL); + gimp_get_user_context (gimp), + menu_factory, + NULL); global_toolbox_factory = gimp_dialog_factory_new ("toolbox", gimp_get_user_context (gimp), @@ -248,39 +248,39 @@ dialogs_init (Gimp *gimp, dialogs_dockable_constructor); global_dock_factory = gimp_dialog_factory_new ("dock", - gimp_get_user_context (gimp), - menu_factory, - dialogs_dock_new); + gimp_get_user_context (gimp), + menu_factory, + dialogs_dock_new); gimp_dialog_factory_set_constructor (global_dock_factory, dialogs_dockable_constructor); for (i = 0; i < G_N_ELEMENTS (toplevel_entries); i++) gimp_dialog_factory_register_entry (global_dialog_factory, - toplevel_entries[i].identifier, - gettext (toplevel_entries[i].name), - gettext (toplevel_entries[i].blurb), - toplevel_entries[i].stock_id, - toplevel_entries[i].help_id, - toplevel_entries[i].new_func, - toplevel_entries[i].view_size, - toplevel_entries[i].singleton, - toplevel_entries[i].session_managed, - toplevel_entries[i].remember_size, - toplevel_entries[i].remember_if_open); + toplevel_entries[i].identifier, + gettext (toplevel_entries[i].name), + gettext (toplevel_entries[i].blurb), + toplevel_entries[i].stock_id, + toplevel_entries[i].help_id, + toplevel_entries[i].new_func, + toplevel_entries[i].view_size, + toplevel_entries[i].singleton, + toplevel_entries[i].session_managed, + toplevel_entries[i].remember_size, + toplevel_entries[i].remember_if_open); for (i = 0; i < G_N_ELEMENTS (dock_entries); i++) gimp_dialog_factory_register_entry (global_dock_factory, - dock_entries[i].identifier, - gettext (dock_entries[i].name), - gettext (dock_entries[i].blurb), - dock_entries[i].stock_id, - dock_entries[i].help_id, - dock_entries[i].new_func, - dock_entries[i].view_size, - dock_entries[i].singleton, - dock_entries[i].session_managed, - dock_entries[i].remember_size, - dock_entries[i].remember_if_open); + dock_entries[i].identifier, + gettext (dock_entries[i].name), + gettext (dock_entries[i].blurb), + dock_entries[i].stock_id, + dock_entries[i].help_id, + dock_entries[i].new_func, + dock_entries[i].view_size, + dock_entries[i].singleton, + dock_entries[i].session_managed, + dock_entries[i].remember_size, + dock_entries[i].remember_if_open); } void diff --git a/app/dialogs/grid-dialog.c b/app/dialogs/grid-dialog.c index 1f3f88d178..c4e3e20bde 100644 --- a/app/dialogs/grid-dialog.c +++ b/app/dialogs/grid-dialog.c @@ -106,7 +106,7 @@ grid_dialog_new (GimpImage *image, image->yresolution); gtk_container_set_border_width (GTK_CONTAINER (editor), 12); gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), - editor); + editor); gtk_widget_show (editor); diff --git a/app/dialogs/image-new-dialog.c b/app/dialogs/image-new-dialog.c index 890ec8bfe3..55d4c769dd 100644 --- a/app/dialogs/image-new-dialog.c +++ b/app/dialogs/image-new-dialog.c @@ -122,7 +122,7 @@ image_new_dialog_new (Gimp *gimp) main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog->dialog)->vbox), - main_vbox, TRUE, TRUE, 0); + main_vbox, TRUE, TRUE, 0); gtk_widget_show (main_vbox); table = gtk_table_new (1, 2, FALSE); diff --git a/app/dialogs/layer-add-mask-dialog.c b/app/dialogs/layer-add-mask-dialog.c index 5b2b6f2d79..4dd6db28af 100644 --- a/app/dialogs/layer-add-mask-dialog.c +++ b/app/dialogs/layer-add-mask-dialog.c @@ -73,7 +73,7 @@ layer_add_mask_dialog_new (GimpLayer *layer, gtk_window_set_resizable (GTK_WINDOW (dialog->dialog), FALSE); g_object_weak_ref (G_OBJECT (dialog->dialog), - (GWeakNotify) g_free, dialog); + (GWeakNotify) g_free, dialog); gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog->dialog), GTK_RESPONSE_OK, diff --git a/app/dialogs/layer-options-dialog.c b/app/dialogs/layer-options-dialog.c index 9d779c20c8..fafccf730f 100644 --- a/app/dialogs/layer-options-dialog.c +++ b/app/dialogs/layer-options-dialog.c @@ -93,7 +93,7 @@ layer_options_dialog_new (GimpImage *image, NULL); g_object_weak_ref (G_OBJECT (options->dialog), - (GWeakNotify) g_free, options); + (GWeakNotify) g_free, options); gtk_dialog_set_alternative_button_order (GTK_DIALOG (options->dialog), GTK_RESPONSE_OK, @@ -103,7 +103,7 @@ layer_options_dialog_new (GimpImage *image, vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (vbox), 12); gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->dialog)->vbox), - vbox); + vbox); gtk_widget_show (vbox); table = gtk_table_new (layer ? 1 : 3, 2, FALSE); diff --git a/app/dialogs/module-dialog.c b/app/dialogs/module-dialog.c index 08e3c38bb0..84216864b3 100644 --- a/app/dialogs/module-dialog.c +++ b/app/dialogs/module-dialog.c @@ -142,10 +142,10 @@ module_dialog_new (Gimp *gimp) listbox = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (listbox), - GTK_SHADOW_IN); + GTK_SHADOW_IN); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (listbox), - GTK_POLICY_AUTOMATIC, - GTK_POLICY_AUTOMATIC); + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); gtk_box_pack_start (GTK_BOX (vbox), listbox, TRUE, TRUE, 0); gtk_widget_set_size_request (listbox, 125, 100); gtk_widget_show (listbox); @@ -340,7 +340,7 @@ dialog_load_unload_callback (GtkWidget *widget, static void make_list_item (gpointer data, - gpointer user_data) + gpointer user_data) { GimpModule *module = data; ModuleDialog *dialog = user_data; @@ -351,10 +351,10 @@ make_list_item (gpointer data, gtk_list_store_append (dialog->list, &iter); gtk_list_store_set (dialog->list, &iter, - PATH_COLUMN, module->filename, + PATH_COLUMN, module->filename, AUTO_COLUMN, ! module->load_inhibit, - MODULE_COLUMN, module, - -1); + MODULE_COLUMN, module, + -1); } static void @@ -381,19 +381,19 @@ dialog_info_remove (GimpModuleDB *db, do { gtk_tree_model_get (GTK_TREE_MODEL (dialog->list), &iter, - MODULE_COLUMN, &module, - -1); + MODULE_COLUMN, &module, + -1); if (module == mod) - { - gtk_list_store_remove (dialog->list, &iter); - return; - } + { + gtk_list_store_remove (dialog->list, &iter); + return; + } } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (dialog->list), &iter)); g_warning ("%s: Tried to remove a module not in the dialog's list.", - G_STRFUNC); + G_STRFUNC); } static void @@ -414,7 +414,7 @@ dialog_info_update (GimpModuleDB *db, if (! module) { for (i = 0; i < NUM_INFO_LINES; i++) - gtk_label_set_text (GTK_LABEL (dialog->label[i]), ""); + gtk_label_set_text (GTK_LABEL (dialog->label[i]), ""); gtk_label_set_text (GTK_LABEL (dialog->button_label), _("")); gtk_widget_set_sensitive (GTK_WIDGET (dialog->button), FALSE); return; @@ -512,14 +512,14 @@ dialog_info_init (ModuleDialog *dialog, label = gtk_label_new (gettext (text[i])); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach (GTK_TABLE (table), label, 0, 1, i, i + 1, - GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 2); + GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 2); gtk_widget_show (label); dialog->label[i] = gtk_label_new (""); gtk_misc_set_alignment (GTK_MISC (dialog->label[i]), 0.0, 0.5); gtk_table_attach (GTK_TABLE (dialog->table), dialog->label[i], 1, 2, i, i + 1, - GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 2); + GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 2); gtk_widget_show (dialog->label[i]); } } diff --git a/app/dialogs/offset-dialog.c b/app/dialogs/offset-dialog.c index 0af8ab9419..ad78f35f17 100644 --- a/app/dialogs/offset-dialog.c +++ b/app/dialogs/offset-dialog.c @@ -64,9 +64,9 @@ struct _OffsetDialog static void offset_response (GtkWidget *widget, gint response_id, - OffsetDialog *dialog); + OffsetDialog *dialog); static void offset_halfheight_callback (GtkWidget *widget, - OffsetDialog *dialog); + OffsetDialog *dialog); /* public functions */ @@ -187,10 +187,10 @@ offset_dialog_new (GimpDrawable *drawable, gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (dialog->off_se), 0, -dialog->image->width, - dialog->image->width); + dialog->image->width); gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (dialog->off_se), 1, - -dialog->image->height, - dialog->image->height); + -dialog->image->height, + dialog->image->height); gimp_size_entry_set_size (GIMP_SIZE_ENTRY (dialog->off_se), 0, 0, dialog->image->width); @@ -205,8 +205,8 @@ offset_dialog_new (GimpDrawable *drawable, gtk_widget_show (button); g_signal_connect (button, "clicked", - G_CALLBACK (offset_halfheight_callback), - dialog); + G_CALLBACK (offset_halfheight_callback), + dialog); /* The edge behavior frame */ frame = gimp_int_radio_group_new (TRUE, _("Edge Behavior"), @@ -277,7 +277,7 @@ offset_halfheight_callback (GtkWidget *widget, GimpImage *image = dialog->image; gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (dialog->off_se), - 0, image->width / 2); + 0, image->width / 2); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (dialog->off_se), - 1, image->height / 2); + 1, image->height / 2); } diff --git a/app/dialogs/palette-import-dialog.c b/app/dialogs/palette-import-dialog.c index 70c1f4a5d7..4b1f1b35d9 100644 --- a/app/dialogs/palette-import-dialog.c +++ b/app/dialogs/palette-import-dialog.c @@ -394,11 +394,11 @@ palette_import_dialog_new (Gimp *gimp) dialog); g_signal_connect (dialog->context, "gradient-changed", - G_CALLBACK (palette_import_gradient_changed), - dialog); + G_CALLBACK (palette_import_gradient_changed), + dialog); g_signal_connect (dialog->context, "image-changed", - G_CALLBACK (palette_import_image_changed), - dialog); + G_CALLBACK (palette_import_image_changed), + dialog); g_signal_connect (dialog->filename_entry, "filename-changed", G_CALLBACK (palette_import_filename_changed), dialog); @@ -460,7 +460,7 @@ palette_import_gradient_changed (GimpContext *context, if (gradient && dialog->import_type == GRADIENT_IMPORT) { gtk_entry_set_text (GTK_ENTRY (dialog->entry), - GIMP_OBJECT (gradient)->name); + GIMP_OBJECT (gradient)->name); palette_import_make_palette (dialog); } @@ -551,7 +551,7 @@ import_dialog_drop_callback (GtkWidget *widget, static void palette_import_grad_callback (GtkWidget *widget, - ImportDialog *dialog) + ImportDialog *dialog) { GimpGradient *gradient; @@ -578,7 +578,7 @@ palette_import_grad_callback (GtkWidget *widget, static void palette_import_image_callback (GtkWidget *widget, - ImportDialog *dialog) + ImportDialog *dialog) { GimpImage *image; @@ -654,8 +654,8 @@ palette_import_columns_changed (GtkAdjustment *adj, static void palette_import_image_add (GimpContainer *container, - GimpImage *image, - ImportDialog *dialog) + GimpImage *image, + ImportDialog *dialog) { if (! GTK_WIDGET_IS_SENSITIVE (dialog->image_radio)) { diff --git a/app/dialogs/preferences-dialog.c b/app/dialogs/preferences-dialog.c index 17cd35673b..16bc6a6c82 100644 --- a/app/dialogs/preferences-dialog.c +++ b/app/dialogs/preferences-dialog.c @@ -1378,8 +1378,8 @@ prefs_dialog_new (Gimp *gimp, vbox2 = prefs_frame_new (_("Document History"), GTK_CONTAINER (vbox), FALSE); prefs_check_button_add (object, "save-document-history", - _("Save document _history on exit"), - GTK_BOX (vbox2)); + _("Save document _history on exit"), + GTK_BOX (vbox2)); /***************/ @@ -2190,7 +2190,7 @@ prefs_dialog_new (Gimp *gimp, for (i = 0, row = 3; i < G_N_ELEMENTS (profiles); i++, row++) { #if 0 - button = gimp_prop_file_entry_new (color_config, + button = gimp_prop_file_entry_new (color_config, profiles[i].property_name, gettext (profiles[i].fs_label), FALSE, TRUE); diff --git a/app/dialogs/print-size-dialog.c b/app/dialogs/print-size-dialog.c index 87b0c53e98..76fbd30c5e 100644 --- a/app/dialogs/print-size-dialog.c +++ b/app/dialogs/print-size-dialog.c @@ -163,14 +163,14 @@ print_size_dialog_new (GimpImage *image, gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_label_set_mnemonic_widget (GTK_LABEL (label), width); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, - GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); + GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); gtk_widget_show (label); label = gtk_label_new_with_mnemonic (_("H_eight:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_label_set_mnemonic_widget (GTK_LABEL (label), height); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, - GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); + GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); gtk_widget_show (label); hbox = gtk_hbox_new (FALSE, 0); @@ -184,12 +184,12 @@ print_size_dialog_new (GimpImage *image, gtk_widget_show (entry); gimp_size_entry_add_field (GIMP_SIZE_ENTRY (entry), - GTK_SPIN_BUTTON (height), NULL); + GTK_SPIN_BUTTON (height), NULL); gtk_table_attach_defaults (GTK_TABLE (entry), height, 0, 1, 1, 2); gtk_widget_show (height); gimp_size_entry_add_field (GIMP_SIZE_ENTRY (entry), - GTK_SPIN_BUTTON (width), NULL); + GTK_SPIN_BUTTON (width), NULL); gtk_table_attach_defaults (GTK_TABLE (entry), width, 0, 1, 0, 1); gtk_widget_show (width); @@ -280,11 +280,11 @@ print_size_dialog_new (GimpImage *image, g_list_free (focus_chain); g_signal_connect (private->size_entry, "value-changed", - G_CALLBACK (print_size_dialog_size_changed), - private); + G_CALLBACK (print_size_dialog_size_changed), + private); g_signal_connect (private->resolution_entry, "value-changed", - G_CALLBACK (print_size_dialog_resolution_changed), - private); + G_CALLBACK (print_size_dialog_resolution_changed), + private); return dialog; } @@ -391,13 +391,13 @@ print_size_dialog_set_resolution (PrintSizeDialog *private, if (private->chain && gimp_chain_button_get_active (private->chain)) { if (xres != private->xres) - { - yres = xres; - } + { + yres = xres; + } else - { - xres = yres; - } + { + xres = yres; + } } private->xres = xres; diff --git a/app/dialogs/resize-dialog.c b/app/dialogs/resize-dialog.c index 59f69b9810..a43d9f4208 100644 --- a/app/dialogs/resize-dialog.c +++ b/app/dialogs/resize-dialog.c @@ -382,7 +382,7 @@ size_notify (GimpSizeBox *box, static gint resize_bound_off_x (ResizeDialog *private, - gint offset_x) + gint offset_x) { GimpSizeBox *box = GIMP_SIZE_BOX (private->box); @@ -394,7 +394,7 @@ resize_bound_off_x (ResizeDialog *private, static gint resize_bound_off_y (ResizeDialog *private, - gint off_y) + gint off_y) { GimpSizeBox *box = GIMP_SIZE_BOX (private->box); @@ -406,7 +406,7 @@ resize_bound_off_y (ResizeDialog *private, static void offset_update (GtkWidget *widget, - ResizeDialog *private) + ResizeDialog *private) { GimpSizeEntry *entry = GIMP_SIZE_ENTRY (private->offset); gint off_x; diff --git a/app/dialogs/resolution-calibrate-dialog.c b/app/dialogs/resolution-calibrate-dialog.c index 17e91d6dde..835ab74168 100644 --- a/app/dialogs/resolution-calibrate-dialog.c +++ b/app/dialogs/resolution-calibrate-dialog.c @@ -68,15 +68,15 @@ resolution_calibrate_dialog (GtkWidget *resolution_entry, return; dialog = gimp_dialog_new (_("Calibrate Monitor Resolution"), - "calibrate_resolution", + "calibrate_resolution", gtk_widget_get_toplevel (resolution_entry), GTK_DIALOG_DESTROY_WITH_PARENT, - NULL, NULL, + NULL, NULL, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OK, GTK_RESPONSE_OK, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OK, GTK_RESPONSE_OK, - NULL); + NULL); gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog), GTK_RESPONSE_OK, @@ -109,14 +109,14 @@ resolution_calibrate_dialog (GtkWidget *resolution_entry, gtk_widget_set_size_request (ruler, ruler_width, 32); gtk_ruler_set_range (GTK_RULER (ruler), 0, ruler_width, 0, ruler_width); gtk_table_attach (GTK_TABLE (table), ruler, 1, 3, 0, 1, - GTK_SHRINK, GTK_SHRINK, 0, 0); + GTK_SHRINK, GTK_SHRINK, 0, 0); gtk_widget_show (ruler); ruler = gtk_vruler_new (); gtk_widget_set_size_request (ruler, 32, ruler_height); gtk_ruler_set_range (GTK_RULER (ruler), 0, ruler_height, 0, ruler_height); gtk_table_attach (GTK_TABLE (table), ruler, 0, 1, 1, 3, - GTK_SHRINK, GTK_SHRINK, 0, 0); + GTK_SHRINK, GTK_SHRINK, 0, 0); gtk_widget_show (ruler); vbox = gtk_vbox_new (FALSE, 12); @@ -146,20 +146,20 @@ resolution_calibrate_dialog (GtkWidget *resolution_entry, calibrate_entry = gimp_coordinates_new (GIMP_UNIT_INCH, "%p", - FALSE, FALSE, 10, - GIMP_SIZE_ENTRY_UPDATE_SIZE, - FALSE, - FALSE, - _("_Horizontal:"), - ruler_width, - calibrate_xres, - 1, GIMP_MAX_IMAGE_SIZE, - 0, 0, - _("_Vertical:"), - ruler_height, - calibrate_yres, - 1, GIMP_MAX_IMAGE_SIZE, - 0, 0); + FALSE, FALSE, 10, + GIMP_SIZE_ENTRY_UPDATE_SIZE, + FALSE, + FALSE, + _("_Horizontal:"), + ruler_width, + calibrate_xres, + 1, GIMP_MAX_IMAGE_SIZE, + 0, 0, + _("_Vertical:"), + ruler_height, + calibrate_yres, + 1, GIMP_MAX_IMAGE_SIZE, + 0, 0); gtk_widget_hide (GTK_WIDGET (GIMP_COORDINATES_CHAINBUTTON (calibrate_entry))); g_signal_connect (dialog, "destroy", G_CALLBACK (gtk_widget_destroyed), diff --git a/app/dialogs/tips-dialog.c b/app/dialogs/tips-dialog.c index b156dfabd3..cfa1129be5 100644 --- a/app/dialogs/tips-dialog.c +++ b/app/dialogs/tips-dialog.c @@ -125,7 +125,7 @@ tips_dialog_create (Gimp *gimp) tips_dialog = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_type_hint (GTK_WINDOW (tips_dialog), - GDK_WINDOW_TYPE_HINT_DIALOG); + GDK_WINDOW_TYPE_HINT_DIALOG); gtk_window_set_role (GTK_WINDOW (tips_dialog), "gimp-tip-of-the-day"); gtk_window_set_title (GTK_WINDOW (tips_dialog), _("GIMP Tip of the Day")); gtk_window_set_position (GTK_WINDOW (tips_dialog), GTK_WIN_POS_CENTER); @@ -136,8 +136,8 @@ tips_dialog_create (Gimp *gimp) NULL); g_signal_connect (tips_dialog, "destroy", - G_CALLBACK (tips_dialog_destroy), - config); + G_CALLBACK (tips_dialog_destroy), + config); vbox = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (tips_dialog), vbox); @@ -206,8 +206,8 @@ tips_dialog_create (Gimp *gimp) gtk_widget_show (button); g_signal_connect_swapped (button, "clicked", - G_CALLBACK (gtk_widget_destroy), - tips_dialog); + G_CALLBACK (gtk_widget_destroy), + tips_dialog); bbox = gtk_hbutton_box_new (); gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_END); @@ -221,8 +221,8 @@ tips_dialog_create (Gimp *gimp) gtk_widget_show (button); g_signal_connect (button, "clicked", - G_CALLBACK (tips_show_previous), - NULL); + G_CALLBACK (tips_show_previous), + NULL); button = tips_button_new (_("_Next Tip"), FALSE); gtk_widget_set_sensitive (button, (tips_count > 1)); @@ -230,11 +230,11 @@ tips_dialog_create (Gimp *gimp) gtk_widget_show (button); g_signal_connect (button, "clicked", - G_CALLBACK (tips_show_next), - NULL); + G_CALLBACK (tips_show_next), + NULL); gimp_help_connect (tips_dialog, gimp_standard_help_func, - GIMP_HELP_TIPS_DIALOG, NULL); + GIMP_HELP_TIPS_DIALOG, NULL); tips_set_labels (current_tip->data); @@ -243,7 +243,7 @@ tips_dialog_create (Gimp *gimp) static void tips_dialog_destroy (GtkWidget *widget, - gpointer data) + gpointer data) { GimpGuiConfig *config = GIMP_GUI_CONFIG (data); @@ -315,7 +315,7 @@ tips_set_labels (GimpTip *tip) static void tips_show_previous (GtkWidget *widget, - gpointer data) + gpointer data) { current_tip = current_tip->prev ? current_tip->prev : g_list_last (tips); @@ -324,7 +324,7 @@ tips_show_previous (GtkWidget *widget, static void tips_show_next (GtkWidget *widget, - gpointer data) + gpointer data) { current_tip = current_tip->next ? current_tip->next : tips; diff --git a/app/dialogs/vectors-options-dialog.c b/app/dialogs/vectors-options-dialog.c index 2b32ca2d34..cab915f2f2 100644 --- a/app/dialogs/vectors-options-dialog.c +++ b/app/dialogs/vectors-options-dialog.c @@ -93,8 +93,8 @@ vectors_options_dialog_new (GimpImage *image, -1); g_object_weak_ref (G_OBJECT (options->dialog), - (GWeakNotify) g_free, - options); + (GWeakNotify) g_free, + options); hbox = gtk_hbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (hbox), 12); diff --git a/app/display/gimpdisplay-foreach.c b/app/display/gimpdisplay-foreach.c index 691d31e065..99f68f7bf8 100644 --- a/app/display/gimpdisplay-foreach.c +++ b/app/display/gimpdisplay-foreach.c @@ -47,7 +47,7 @@ gimp_displays_dirty (Gimp *gimp) GimpDisplay *display = list->data; if (display->image->dirty) - return TRUE; + return TRUE; } return FALSE; @@ -183,7 +183,7 @@ gimp_displays_reconnect (Gimp *gimp, GimpDisplay *display = list->data; if (display->image == old) - gimp_display_reconnect (display, new); + gimp_display_reconnect (display, new); } /* set the new_image on the remembered contexts (in reverse diff --git a/app/display/gimpdisplayshell-callbacks.c b/app/display/gimpdisplayshell-callbacks.c index c5db20324d..f29e2c3915 100644 --- a/app/display/gimpdisplayshell-callbacks.c +++ b/app/display/gimpdisplayshell-callbacks.c @@ -774,7 +774,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas, { GdkEventButton *bevent = (GdkEventButton *) event; - gimp_display_shell_autoscroll_stop (shell); + gimp_display_shell_autoscroll_stop (shell); if (gimp->busy) return TRUE; diff --git a/app/display/gimpdisplayshell-cursor.c b/app/display/gimpdisplayshell-cursor.c index 8170709300..8a9813df96 100644 --- a/app/display/gimpdisplayshell-cursor.c +++ b/app/display/gimpdisplayshell-cursor.c @@ -40,10 +40,10 @@ static void gimp_display_shell_real_set_cursor (GimpDisplayShell *shell, - GimpCursorType cursor_type, - GimpToolCursorType tool_cursor, - GimpCursorModifier modifier, - gboolean always_install); + GimpCursorType cursor_type, + GimpToolCursorType tool_cursor, + GimpCursorModifier modifier, + gboolean always_install); void @@ -208,20 +208,20 @@ gimp_display_shell_real_set_cursor (GimpDisplayShell *shell, cursor_type != GIMP_CURSOR_BAD) { switch (config->cursor_mode) - { - case GIMP_CURSOR_MODE_TOOL_ICON: - break; + { + case GIMP_CURSOR_MODE_TOOL_ICON: + break; - case GIMP_CURSOR_MODE_TOOL_CROSSHAIR: - cursor_type = GIMP_CURSOR_CROSSHAIR_SMALL; - break; + case GIMP_CURSOR_MODE_TOOL_CROSSHAIR: + cursor_type = GIMP_CURSOR_CROSSHAIR_SMALL; + break; - case GIMP_CURSOR_MODE_CROSSHAIR: - cursor_type = GIMP_CURSOR_CROSSHAIR; - tool_cursor = GIMP_TOOL_CURSOR_NONE; - modifier = GIMP_CURSOR_MODIFIER_NONE; - break; - } + case GIMP_CURSOR_MODE_CROSSHAIR: + cursor_type = GIMP_CURSOR_CROSSHAIR; + tool_cursor = GIMP_TOOL_CURSOR_NONE; + modifier = GIMP_CURSOR_MODIFIER_NONE; + break; + } } cursor_format = GIMP_GUI_CONFIG (config)->cursor_format; diff --git a/app/display/gimpdisplayshell-dnd.c b/app/display/gimpdisplayshell-dnd.c index 53a7b5a294..17d2d5960e 100644 --- a/app/display/gimpdisplayshell-dnd.c +++ b/app/display/gimpdisplayshell-dnd.c @@ -385,7 +385,7 @@ gimp_display_shell_drop_buffer (GtkWidget *widget, /* FIXME: popup a menu for selecting "Paste Into" */ gimp_edit_paste (image, gimp_image_active_drawable (image), - buffer, FALSE, + buffer, FALSE, x, y, width, height); gimp_image_flush (image); diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c index 1c78575a4a..70c2e4f36f 100644 --- a/app/display/gimpdisplayshell-draw.c +++ b/app/display/gimpdisplayshell-draw.c @@ -121,11 +121,11 @@ gimp_display_shell_draw_guides (GimpDisplayShell *shell) for (list = shell->display->image->guides; list; list = g_list_next (list)) - { - gimp_display_shell_draw_guide (shell, + { + gimp_display_shell_draw_guide (shell, (GimpGuide *) list->data, FALSE); - } + } } } @@ -423,9 +423,9 @@ gimp_display_shell_draw_sample_points (GimpDisplayShell *shell) for (list = shell->display->image->sample_points; list; list = g_list_next (list)) - { - gimp_display_shell_draw_sample_point (shell, list->data, FALSE); - } + { + gimp_display_shell_draw_sample_point (shell, list->data, FALSE); + } } } @@ -490,12 +490,12 @@ gimp_display_shell_draw_vectors (GimpDisplayShell *shell) for (list = GIMP_LIST (shell->display->image->vectors)->list; list; list = list->next) - { + { GimpVectors *vectors = list->data; if (gimp_item_get_visible (GIMP_ITEM (vectors))) gimp_display_shell_draw_vector (shell, vectors); - } + } } } diff --git a/app/display/gimpdisplayshell-layer-select.c b/app/display/gimpdisplayshell-layer-select.c index cd7a8cac37..483bcda0e6 100644 --- a/app/display/gimpdisplayshell-layer-select.c +++ b/app/display/gimpdisplayshell-layer-select.c @@ -186,7 +186,7 @@ layer_select_destroy (LayerSelect *layer_select, static void layer_select_advance (LayerSelect *layer_select, - gint move) + gint move) { GimpLayer *current_layer; GimpLayer *next_layer; @@ -231,7 +231,7 @@ layer_select_advance (LayerSelect *layer_select, static gboolean layer_select_events (GtkWidget *widget, - GdkEvent *event, + GdkEvent *event, LayerSelect *layer_select) { GdkEventKey *kevent; @@ -249,14 +249,14 @@ layer_select_events (GtkWidget *widget, kevent = (GdkEventKey *) event; switch (kevent->keyval) - { - case GDK_Tab: + { + case GDK_Tab: layer_select_advance (layer_select, 1); break; - case GDK_ISO_Left_Tab: + case GDK_ISO_Left_Tab: layer_select_advance (layer_select, -1); - break; - } + break; + } return TRUE; break; @@ -264,20 +264,20 @@ layer_select_events (GtkWidget *widget, kevent = (GdkEventKey *) event; switch (kevent->keyval) - { - case GDK_Alt_L: case GDK_Alt_R: - kevent->state &= ~GDK_MOD1_MASK; - break; - case GDK_Control_L: case GDK_Control_R: - kevent->state &= ~GDK_CONTROL_MASK; - break; - case GDK_Shift_L: case GDK_Shift_R: - kevent->state &= ~GDK_SHIFT_MASK; - break; - } + { + case GDK_Alt_L: case GDK_Alt_R: + kevent->state &= ~GDK_MOD1_MASK; + break; + case GDK_Control_L: case GDK_Control_R: + kevent->state &= ~GDK_CONTROL_MASK; + break; + case GDK_Shift_L: case GDK_Shift_R: + kevent->state &= ~GDK_SHIFT_MASK; + break; + } if (! (kevent->state & GDK_CONTROL_MASK)) - layer_select_destroy (layer_select, kevent->time); + layer_select_destroy (layer_select, kevent->time); return TRUE; break; diff --git a/app/display/gimpdisplayshell-render.c b/app/display/gimpdisplayshell-render.c index 6e8183ec3d..7e1059f083 100644 --- a/app/display/gimpdisplayshell-render.c +++ b/app/display/gimpdisplayshell-render.c @@ -163,21 +163,21 @@ static void render_image_indexed (RenderInfo *info); static void render_image_indexed_a (RenderInfo *info); static void render_image_init_info_full (RenderInfo *info, - GimpDisplayShell *shell, - gint x, - gint y, - gint w, - gint h, + GimpDisplayShell *shell, + gint x, + gint y, + gint w, + gint h, GimpProjection *projection); static void render_image_init_info (RenderInfo *info, - GimpDisplayShell *shell, - gint x, - gint y, + GimpDisplayShell *shell, + gint x, + gint y, TileManager *tiles); static guint * render_image_init_alpha (gint mult); static guchar * render_image_accelerate_scaling (gint width, - gint start, - gdouble scalex); + gint start, + gdouble scalex); static guchar * render_image_tile_fault (RenderInfo *info); @@ -357,13 +357,13 @@ gimp_display_shell_render_mask (GimpDisplayShell *shell, RINT (floor ((y + 1) / info->scaley) - floor (y / info->scaley)); if (!initial && (error == 0)) - { - memcpy (info->dest, info->dest - info->dest_bpl, info->dest_width); - } + { + memcpy (info->dest, info->dest - info->dest_bpl, info->dest_width); + } else - { - const guchar *src = info->src; - guchar *dest = info->dest; + { + const guchar *src = info->src; + guchar *dest = info->dest; switch (shell->mask_color) { @@ -411,12 +411,12 @@ gimp_display_shell_render_mask (GimpDisplayShell *shell, info->dest += info->dest_bpl; if (error) - { - info->src_y += error; - info->src = render_image_tile_fault (info); + { + info->src_y += error; + info->src = render_image_tile_fault (info); - initial = TRUE; - } + initial = TRUE; + } else { initial = FALSE; @@ -451,26 +451,26 @@ render_image_indexed (RenderInfo *info) RINT (floor ((y + 1) / info->scaley) - floor (y / info->scaley)); if (!initial && (error == 0)) - { - memcpy (info->dest, info->dest - info->dest_bpl, info->dest_width); - } + { + memcpy (info->dest, info->dest - info->dest_bpl, info->dest_width); + } else - { - const guchar *src = info->src; - guchar *dest = info->dest; + { + const guchar *src = info->src; + guchar *dest = info->dest; - for (x = info->x; x < xe; x++) - { + for (x = info->x; x < xe; x++) + { guint val = src[INDEXED_PIX] * 3; - src += 1; + src += 1; - dest[0] = cmap[val + 0]; - dest[1] = cmap[val + 1]; - dest[2] = cmap[val + 2]; - dest += 3; - } - } + dest[0] = cmap[val + 0]; + dest[1] = cmap[val + 1]; + dest[2] = cmap[val + 2]; + dest += 3; + } + } if (++y == ye) break; @@ -478,12 +478,12 @@ render_image_indexed (RenderInfo *info) info->dest += info->dest_bpl; if (error) - { - info->src_y += error; - info->src = render_image_tile_fault (info); + { + info->src_y += error; + info->src = render_image_tile_fault (info); - initial = TRUE; - } + initial = TRUE; + } else { initial = FALSE; @@ -512,46 +512,46 @@ render_image_indexed_a (RenderInfo *info) RINT (floor ((y + 1) / info->scaley) - floor (y / info->scaley)); if (!initial && (error == 0) && (y & check_mod)) - { - memcpy (info->dest, info->dest - info->dest_bpl, info->dest_width); - } + { + memcpy (info->dest, info->dest - info->dest_bpl, info->dest_width); + } else - { + { const guchar *src = info->src; guchar *dest = info->dest; guint dark_light; - dark_light = (y >> check_shift) + (info->x >> check_shift); + dark_light = (y >> check_shift) + (info->x >> check_shift); - for (x = info->x; x < xe; x++) - { - guint r, g, b, a = alpha[src[ALPHA_I_PIX]]; + for (x = info->x; x < xe; x++) + { + guint r, g, b, a = alpha[src[ALPHA_I_PIX]]; guint val = src[INDEXED_PIX] * 3; - src += 2; + src += 2; - if (dark_light & 0x1) - { - r = gimp_render_blend_dark_check[(a | cmap[val + 0])]; - g = gimp_render_blend_dark_check[(a | cmap[val + 1])]; - b = gimp_render_blend_dark_check[(a | cmap[val + 2])]; - } - else - { - r = gimp_render_blend_light_check[(a | cmap[val + 0])]; - g = gimp_render_blend_light_check[(a | cmap[val + 1])]; - b = gimp_render_blend_light_check[(a | cmap[val + 2])]; - } + if (dark_light & 0x1) + { + r = gimp_render_blend_dark_check[(a | cmap[val + 0])]; + g = gimp_render_blend_dark_check[(a | cmap[val + 1])]; + b = gimp_render_blend_dark_check[(a | cmap[val + 2])]; + } + else + { + r = gimp_render_blend_light_check[(a | cmap[val + 0])]; + g = gimp_render_blend_light_check[(a | cmap[val + 1])]; + b = gimp_render_blend_light_check[(a | cmap[val + 2])]; + } - dest[0] = r; - dest[1] = g; - dest[2] = b; - dest += 3; + dest[0] = r; + dest[1] = g; + dest[2] = b; + dest += 3; - if (((x + 1) & check_mod) == 0) - dark_light += 1; - } - } + if (((x + 1) & check_mod) == 0) + dark_light += 1; + } + } if (++y == ye) break; @@ -559,12 +559,12 @@ render_image_indexed_a (RenderInfo *info) info->dest += info->dest_bpl; if (error) - { - info->src_y += error; - info->src = render_image_tile_fault (info); + { + info->src_y += error; + info->src = render_image_tile_fault (info); - initial = TRUE; - } + initial = TRUE; + } else { initial = FALSE; @@ -591,26 +591,26 @@ render_image_gray (RenderInfo *info) RINT (floor ((y + 1) / info->scaley) - floor (y / info->scaley)); if (!initial && (error == 0)) - { - memcpy (info->dest, info->dest - info->dest_bpl, info->dest_width); - } + { + memcpy (info->dest, info->dest - info->dest_bpl, info->dest_width); + } else - { - const guchar *src = info->src; - guchar *dest = info->dest; + { + const guchar *src = info->src; + guchar *dest = info->dest; - for (x = info->x; x < xe; x++) - { - guint val = src[GRAY_PIX]; + for (x = info->x; x < xe; x++) + { + guint val = src[GRAY_PIX]; - src += 1; + src += 1; - dest[0] = val; - dest[1] = val; - dest[2] = val; - dest += 3; - } - } + dest[0] = val; + dest[1] = val; + dest[2] = val; + dest += 3; + } + } if (++y == ye) break; @@ -618,12 +618,12 @@ render_image_gray (RenderInfo *info) info->dest += info->dest_bpl; if (error) - { - info->src_y += error; - info->src = render_image_tile_fault (info); + { + info->src_y += error; + info->src = render_image_tile_fault (info); - initial = TRUE; - } + initial = TRUE; + } else { initial = FALSE; @@ -651,38 +651,38 @@ render_image_gray_a (RenderInfo *info) RINT (floor ((y + 1) / info->scaley) - floor (y / info->scaley)); if (!initial && (error == 0) && (y & check_mod)) - { - memcpy (info->dest, info->dest - info->dest_bpl, info->dest_width); - } + { + memcpy (info->dest, info->dest - info->dest_bpl, info->dest_width); + } else - { - const guchar *src = info->src; - guchar *dest = info->dest; + { + const guchar *src = info->src; + guchar *dest = info->dest; guint dark_light; - dark_light = (y >> check_shift) + (info->x >> check_shift); + dark_light = (y >> check_shift) + (info->x >> check_shift); - for (x = info->x; x < xe; x++) - { - guint a = alpha[src[ALPHA_G_PIX]]; + for (x = info->x; x < xe; x++) + { + guint a = alpha[src[ALPHA_G_PIX]]; guint val; - if (dark_light & 0x1) - val = gimp_render_blend_dark_check[(a | src[GRAY_PIX])]; - else - val = gimp_render_blend_light_check[(a | src[GRAY_PIX])]; + if (dark_light & 0x1) + val = gimp_render_blend_dark_check[(a | src[GRAY_PIX])]; + else + val = gimp_render_blend_light_check[(a | src[GRAY_PIX])]; - src += 2; + src += 2; - dest[0] = val; - dest[1] = val; - dest[2] = val; - dest += 3; + dest[0] = val; + dest[1] = val; + dest[2] = val; + dest += 3; - if (((x + 1) & check_mod) == 0) - dark_light += 1; - } - } + if (((x + 1) & check_mod) == 0) + dark_light += 1; + } + } if (++y == ye) break; @@ -690,12 +690,12 @@ render_image_gray_a (RenderInfo *info) info->dest += info->dest_bpl; if (error) - { - info->src_y += error; - info->src = render_image_tile_fault (info); + { + info->src_y += error; + info->src = render_image_tile_fault (info); - initial = TRUE; - } + initial = TRUE; + } else { initial = FALSE; @@ -722,13 +722,13 @@ render_image_rgb (RenderInfo *info) RINT (floor ((y + 1) / info->scaley) - floor (y / info->scaley)); if (!initial && (error == 0)) - { - memcpy (info->dest, info->dest - info->dest_bpl, info->dest_width); - } + { + memcpy (info->dest, info->dest - info->dest_bpl, info->dest_width); + } else - { + { memcpy (info->dest, info->src, 3 * info->w); - } + } if (++y == ye) break; @@ -736,12 +736,12 @@ render_image_rgb (RenderInfo *info) info->dest += info->dest_bpl; if (error) - { - info->src_y += error; - info->src = render_image_tile_fault (info); + { + info->src_y += error; + info->src = render_image_tile_fault (info); - initial = TRUE; - } + initial = TRUE; + } else { initial = FALSE; @@ -769,45 +769,45 @@ render_image_rgb_a (RenderInfo *info) RINT (floor ((y + 1) / info->scaley) - floor (y / info->scaley)); if (!initial && (error == 0) && (y & check_mod)) - { - memcpy (info->dest, info->dest - info->dest_bpl, info->dest_width); - } + { + memcpy (info->dest, info->dest - info->dest_bpl, info->dest_width); + } else - { - const guchar *src = info->src; - guchar *dest = info->dest; + { + const guchar *src = info->src; + guchar *dest = info->dest; guint dark_light; - dark_light = (y >> check_shift) + (info->x >> check_shift); + dark_light = (y >> check_shift) + (info->x >> check_shift); - for (x = info->x; x < xe; x++) - { + for (x = info->x; x < xe; x++) + { guint r, g, b, a = alpha[src[ALPHA_PIX]]; - if (dark_light & 0x1) - { - r = gimp_render_blend_dark_check[(a | src[RED_PIX])]; - g = gimp_render_blend_dark_check[(a | src[GREEN_PIX])]; - b = gimp_render_blend_dark_check[(a | src[BLUE_PIX])]; - } - else - { - r = gimp_render_blend_light_check[(a | src[RED_PIX])]; - g = gimp_render_blend_light_check[(a | src[GREEN_PIX])]; - b = gimp_render_blend_light_check[(a | src[BLUE_PIX])]; - } + if (dark_light & 0x1) + { + r = gimp_render_blend_dark_check[(a | src[RED_PIX])]; + g = gimp_render_blend_dark_check[(a | src[GREEN_PIX])]; + b = gimp_render_blend_dark_check[(a | src[BLUE_PIX])]; + } + else + { + r = gimp_render_blend_light_check[(a | src[RED_PIX])]; + g = gimp_render_blend_light_check[(a | src[GREEN_PIX])]; + b = gimp_render_blend_light_check[(a | src[BLUE_PIX])]; + } - src += 4; + src += 4; - dest[0] = r; - dest[1] = g; - dest[2] = b; - dest += 3; + dest[0] = r; + dest[1] = g; + dest[2] = b; + dest += 3; - if (((x + 1) & check_mod) == 0) - dark_light += 1; - } - } + if (((x + 1) & check_mod) == 0) + dark_light += 1; + } + } if (++y == ye) break; @@ -815,12 +815,12 @@ render_image_rgb_a (RenderInfo *info) info->dest += info->dest_bpl; if (error) - { - info->src_y += error; - info->src = render_image_tile_fault (info); + { + info->src_y += error; + info->src = render_image_tile_fault (info); - initial = TRUE; - } + initial = TRUE; + } else { initial = FALSE; @@ -861,9 +861,9 @@ render_image_init_info_full (RenderInfo *info, static void render_image_init_info (RenderInfo *info, - GimpDisplayShell *shell, - gint x, - gint y, + GimpDisplayShell *shell, + gint x, + gint y, TileManager *tiles) { info->src_tiles = tiles; @@ -885,11 +885,11 @@ render_image_init_alpha (gint mult) if (alpha_val != mult) { if (!alpha_mult) - alpha_mult = g_new (guint, 256); + alpha_mult = g_new (guint, 256); alpha_val = mult; for (i = 0; i < 256; i++) - alpha_mult[i] = ((mult * i) / 255) << 8; + alpha_mult[i] = ((mult * i) / 255) << 8; } return alpha_mult; @@ -897,8 +897,8 @@ render_image_init_alpha (gint mult) static guchar * render_image_accelerate_scaling (gint width, - gint start, - gdouble scalex) + gint start, + gdouble scalex) { static guchar *scale = NULL; @@ -930,7 +930,7 @@ render_image_tile_fault (RenderInfo *info) gint x; tile = tile_manager_get_tile (info->src_tiles, - info->src_x, info->src_y, TRUE, FALSE); + info->src_x, info->src_y, TRUE, FALSE); g_return_val_if_fail (tile != NULL, tile_buf); @@ -966,25 +966,25 @@ render_image_tile_fault (RenderInfo *info) step = *scale++; if (step) - { - x += step; - src += step * bpp; + { + x += step; + src += step * bpp; - if ((x >> tile_shift) != tilex) - { - tile_release (tile, FALSE); - tilex += 1; + if ((x >> tile_shift) != tilex) + { + tile_release (tile, FALSE); + tilex += 1; - tile = tile_manager_get_tile (info->src_tiles, + tile = tile_manager_get_tile (info->src_tiles, x, info->src_y, TRUE, FALSE); - if (!tile) - return tile_buf; + if (!tile) + return tile_buf; - src = tile_data_pointer (tile, + src = tile_data_pointer (tile, x % TILE_WIDTH, info->src_y % TILE_HEIGHT); - } - } + } + } } while (--width); diff --git a/app/display/gimpdisplayshell-scroll.c b/app/display/gimpdisplayshell-scroll.c index a379436b39..af24be8cfb 100644 --- a/app/display/gimpdisplayshell-scroll.c +++ b/app/display/gimpdisplayshell-scroll.c @@ -96,8 +96,8 @@ gimp_display_shell_scroll_clamp_offsets (GimpDisplayShell *shell) sy = SCALEY (shell, shell->display->image->height); shell->offset_x = CLAMP (shell->offset_x, 0, - MAX (sx - shell->disp_width, 0)); + MAX (sx - shell->disp_width, 0)); shell->offset_y = CLAMP (shell->offset_y, 0, - MAX (sy - shell->disp_height, 0)); + MAX (sy - shell->disp_height, 0)); } diff --git a/app/display/gimpdisplayshell-selection.c b/app/display/gimpdisplayshell-selection.c index a82316f3c7..3ed8e07e6b 100644 --- a/app/display/gimpdisplayshell-selection.c +++ b/app/display/gimpdisplayshell-selection.c @@ -124,8 +124,8 @@ gimp_display_shell_selection_resume (Selection *select) { select->state = INTRO; select->timeout_id = g_timeout_add (INITIAL_DELAY, - selection_start_marching, - select); + selection_start_marching, + select); } select->paused--; @@ -154,8 +154,8 @@ gimp_display_shell_selection_start (Selection *select, g_source_remove (select->timeout_id); select->timeout_id = g_timeout_add (INITIAL_DELAY, - selection_start_marching, - select); + selection_start_marching, + select); } void @@ -262,10 +262,10 @@ gimp_display_shell_selection_layer_set_hidden (Selection *select, static void selection_add_point (GdkPoint *points[8], - gint max_npoints[8], - gint npoints[8], - gint x, - gint y) + gint max_npoints[8], + gint npoints[8], + gint x, + gint y) { gint i, j; @@ -308,41 +308,41 @@ selection_render_points (Selection *select) { #ifdef VERBOSE g_print ("%2d: (%d, %d) - (%d, %d)\n", i, - select->segs_in[i].x1, - select->segs_in[i].y1, - select->segs_in[i].x2, - select->segs_in[i].y2); + select->segs_in[i].x1, + select->segs_in[i].y1, + select->segs_in[i].x2, + select->segs_in[i].y2); #endif x = select->segs_in[i].x1; dxa = select->segs_in[i].x2 - x; if (dxa > 0) - { - dx = 1; - } + { + dx = 1; + } else - { - dxa = -dxa; - dx = -1; - } + { + dxa = -dxa; + dx = -1; + } y = select->segs_in[i].y1; dya = select->segs_in[i].y2 - y; if (dya > 0) - { - dy = 1; - } + { + dy = 1; + } else - { - dya = -dya; - dy = -1; - } + { + dya = -dya; + dy = -1; + } if (dxa > dya) - { - r = dya; - do + { + r = dya; + do { selection_add_point (select->points_in, max_npoints, @@ -357,11 +357,11 @@ selection_render_points (Selection *select) r -= (dxa << 1); } } while (x != select->segs_in[i].x2); - } + } else if (dxa < dya) - { - r = dxa; - do + { + r = dxa; + do { selection_add_point (select->points_in, max_npoints, @@ -376,7 +376,7 @@ selection_render_points (Selection *select) r -= (dya << 1); } } while (y != select->segs_in[i].y2); - } + } else { selection_add_point (select->points_in, @@ -414,33 +414,33 @@ selection_draw (Selection *select) gint i; if (select->index == 0) - { - for (i = 0; i < 4; i++) - if (select->num_points_in[i]) + { + for (i = 0; i < 4; i++) + if (select->num_points_in[i]) gimp_canvas_draw_points (canvas, GIMP_CANVAS_STYLE_WHITE, select->points_in[i], select->num_points_in[i]); - for (i = 4; i < 8; i++) - if (select->num_points_in[i]) + for (i = 4; i < 8; i++) + if (select->num_points_in[i]) gimp_canvas_draw_points (canvas, GIMP_CANVAS_STYLE_BLACK, select->points_in[i], select->num_points_in[i]); - } + } else - { - i = ((select->index + 3) & 7); - if (select->num_points_in[i]) + { + i = ((select->index + 3) & 7); + if (select->num_points_in[i]) gimp_canvas_draw_points (canvas, GIMP_CANVAS_STYLE_WHITE, select->points_in[i], select->num_points_in[i]); - i = ((select->index + 7) & 7); - if (select->num_points_in[i]) + i = ((select->index + 7) & 7); + if (select->num_points_in[i]) gimp_canvas_draw_points (canvas, GIMP_CANVAS_STYLE_BLACK, select->points_in[i], select->num_points_in[i]); - } + } } #else /* ! USE_DRAWPOINTS */ @@ -456,9 +456,9 @@ selection_draw (Selection *select) static void selection_transform_segs (Selection *select, - const BoundSeg *src_segs, - GdkSegment *dest_segs, - gint num_segs) + const BoundSeg *src_segs, + GdkSegment *dest_segs, + gint num_segs) { gint x, y; gint i; @@ -586,7 +586,7 @@ selection_free_segs (Selection *select) for (j = 0; j < 8; j++) { if (select->points_in[j]) - g_free (select->points_in[j]); + g_free (select->points_in[j]); select->points_in[j] = NULL; select->num_points_in[j] = 0; @@ -642,8 +642,8 @@ selection_start_marching (gpointer data) /* Reset the timer */ select->timeout_id = g_timeout_add (config->marching_ants_speed, - selection_march_ants, - select); + selection_march_ants, + select); return FALSE; } diff --git a/app/display/gimpdisplayshell-title.c b/app/display/gimpdisplayshell-title.c index bb8626f27c..56c2f59013 100644 --- a/app/display/gimpdisplayshell-title.c +++ b/app/display/gimpdisplayshell-title.c @@ -167,53 +167,53 @@ gimp_display_shell_format_title (GimpDisplayShell *shell, while (i < title_len && *format) { switch (*format) - { - case '%': - format++; - switch (*format) - { - case 0: - /* format string ends within %-sequence, print literal '%' */ + { + case '%': + format++; + switch (*format) + { + case 0: + /* format string ends within %-sequence, print literal '%' */ - case '%': - title[i++] = '%'; - break; + case '%': + title[i++] = '%'; + break; - case 'f': /* pruned filename */ - { + case 'f': /* pruned filename */ + { const gchar *uri = gimp_image_get_uri (image); - gchar *basename; + gchar *basename; - basename = file_utils_uri_display_basename (uri); + basename = file_utils_uri_display_basename (uri); - i += print (title, title_len, i, "%s", basename); + i += print (title, title_len, i, "%s", basename); - g_free (basename); - } - break; + g_free (basename); + } + break; - case 'F': /* full filename */ - { - gchar *filename; + case 'F': /* full filename */ + { + gchar *filename; const gchar *uri = gimp_image_get_uri (image); - filename = file_utils_uri_display_name (uri); + filename = file_utils_uri_display_name (uri); i += print (title, title_len, i, "%s", filename); g_free (filename); } - break; + break; - case 'p': /* PDB id */ - i += print (title, title_len, i, "%d", gimp_image_get_ID (image)); - break; + case 'p': /* PDB id */ + i += print (title, title_len, i, "%d", gimp_image_get_ID (image)); + break; - case 'i': /* instance */ - i += print (title, title_len, i, "%d", shell->display->instance); - break; + case 'i': /* instance */ + i += print (title, title_len, i, "%d", shell->display->instance); + break; - case 't': /* type */ + case 't': /* type */ { const gchar *image_type_str = NULL; gboolean empty = gimp_image_is_empty (image); @@ -236,58 +236,58 @@ gimp_display_shell_format_title (GimpDisplayShell *shell, i += print (title, title_len, i, "%s", image_type_str); } - break; + break; - case 's': /* user source zoom factor */ - i += print (title, title_len, i, "%d", denom); - break; + case 's': /* user source zoom factor */ + i += print (title, title_len, i, "%d", denom); + break; - case 'd': /* user destination zoom factor */ - i += print (title, title_len, i, "%d", num); - break; + case 'd': /* user destination zoom factor */ + i += print (title, title_len, i, "%d", num); + break; - case 'z': /* user zoom factor (percentage) */ + case 'z': /* user zoom factor (percentage) */ { gdouble scale = gimp_zoom_model_get_factor (shell->zoom); i += print (title, title_len, i, scale >= 0.15 ? "%.0f" : "%.2f", 100.0 * scale); } - break; + break; - case 'D': /* dirty flag */ - if (format[1] == 0) - { - /* format string ends within %D-sequence, print literal '%D' */ + case 'D': /* dirty flag */ + if (format[1] == 0) + { + /* format string ends within %D-sequence, print literal '%D' */ i += print (title, title_len, i, "%%D"); - break; - } - if (image->dirty) - title[i++] = format[1]; - format++; - break; + break; + } + if (image->dirty) + title[i++] = format[1]; + format++; + break; - case 'C': /* clean flag */ - if (format[1] == 0) - { - /* format string ends within %C-sequence, print literal '%C' */ + case 'C': /* clean flag */ + if (format[1] == 0) + { + /* format string ends within %C-sequence, print literal '%C' */ i += print (title, title_len, i, "%%C"); - break; - } - if (! image->dirty) - title[i++] = format[1]; - format++; - break; + break; + } + if (! image->dirty) + title[i++] = format[1]; + format++; + break; - case 'B': /* dirty flag (long) */ - if (image->dirty) + case 'B': /* dirty flag (long) */ + if (image->dirty) i += print (title, title_len, i, "%s", _("(modified)")); - break; + break; - case 'A': /* clean flag (long) */ - if (! image->dirty) + case 'A': /* clean flag (long) */ + if (! image->dirty) i += print (title, title_len, i, "%s", _("(clean)")); - break; + break; case 'm': /* memory used by image */ { @@ -341,7 +341,7 @@ gimp_display_shell_format_title (GimpDisplayShell *shell, } break; - case 'W': /* width in real-world units */ + case 'W': /* width in real-world units */ if (shell->unit != GIMP_UNIT_PIXEL) { gchar unit_format[8]; @@ -355,11 +355,11 @@ gimp_display_shell_format_title (GimpDisplayShell *shell, break; } /* else fallthru */ - case 'w': /* width in pixels */ - i += print (title, title_len, i, "%d", image->width); - break; + case 'w': /* width in pixels */ + i += print (title, title_len, i, "%d", image->width); + break; - case 'H': /* height in real-world units */ + case 'H': /* height in real-world units */ if (shell->unit != GIMP_UNIT_PIXEL) { gchar unit_format[8]; @@ -373,38 +373,38 @@ gimp_display_shell_format_title (GimpDisplayShell *shell, break; } /* else fallthru */ - case 'h': /* height in pixels */ - i += print (title, title_len, i, "%d", image->height); - break; + case 'h': /* height in pixels */ + i += print (title, title_len, i, "%d", image->height); + break; - case 'u': /* unit symbol */ - i += print (title, title_len, i, "%s", - _gimp_unit_get_symbol (gimp, shell->unit)); - break; + case 'u': /* unit symbol */ + i += print (title, title_len, i, "%s", + _gimp_unit_get_symbol (gimp, shell->unit)); + break; - case 'U': /* unit abbreviation */ - i += print (title, title_len, i, "%s", - _gimp_unit_get_abbreviation (gimp, shell->unit)); - break; + case 'U': /* unit abbreviation */ + i += print (title, title_len, i, "%s", + _gimp_unit_get_abbreviation (gimp, shell->unit)); + break; - /* Other cool things to be added: - * %r = xresolution + /* Other cool things to be added: + * %r = xresolution * %R = yresolution * %ø = image's fractal dimension * %þ = the answer to everything - */ + */ - default: + default: /* format string contains unknown %-sequence, print it literally */ i += print (title, title_len, i, "%%%c", *format); break; - } - break; + } + break; - default: - title[i++] = *format; - break; - } + default: + title[i++] = *format; + break; + } format++; } diff --git a/app/errors.c b/app/errors.c index bb679119d3..9d410078e2 100644 --- a/app/errors.c +++ b/app/errors.c @@ -67,7 +67,7 @@ gimp_errors_init (const gchar *_full_prog_name, #ifdef GIMP_UNSTABLE g_printerr ("This is a development version of GIMP. " - "Debug messages may appear here.\n\n"); + "Debug messages may appear here.\n\n"); #ifdef G_OS_WIN32 g_printerr ("You can minimize this window, but don't close it.\n\n"); @@ -81,9 +81,9 @@ gimp_errors_init (const gchar *_full_prog_name, void gimp_message_log_func (const gchar *log_domain, - GLogLevelFlags flags, - const gchar *message, - gpointer data) + GLogLevelFlags flags, + const gchar *message, + gpointer data) { Gimp **gimp = (Gimp **) data; @@ -98,9 +98,9 @@ gimp_message_log_func (const gchar *log_domain, void gimp_error_log_func (const gchar *domain, - GLogLevelFlags flags, - const gchar *message, - gpointer data) + GLogLevelFlags flags, + const gchar *message, + gpointer data) { gimp_fatal_error (message); } @@ -147,33 +147,33 @@ gimp_eek (const gchar *reason, if (use_handler) { switch (stack_trace_mode) - { - case GIMP_STACK_TRACE_NEVER: - break; + { + case GIMP_STACK_TRACE_NEVER: + break; - case GIMP_STACK_TRACE_QUERY: - { - sigset_t sigset; + case GIMP_STACK_TRACE_QUERY: + { + sigset_t sigset; - sigemptyset (&sigset); - sigprocmask (SIG_SETMASK, &sigset, NULL); - g_on_error_query (full_prog_name); - } - break; + sigemptyset (&sigset); + sigprocmask (SIG_SETMASK, &sigset, NULL); + g_on_error_query (full_prog_name); + } + break; - case GIMP_STACK_TRACE_ALWAYS: - { - sigset_t sigset; + case GIMP_STACK_TRACE_ALWAYS: + { + sigset_t sigset; - sigemptyset (&sigset); - sigprocmask (SIG_SETMASK, &sigset, NULL); - g_on_error_stack_trace (full_prog_name); - } - break; + sigemptyset (&sigset); + sigprocmask (SIG_SETMASK, &sigset, NULL); + g_on_error_stack_trace (full_prog_name); + } + break; - default: - break; - } + default: + break; + } } #else diff --git a/app/file/file-open.c b/app/file/file-open.c index b959662439..0249d2cfdf 100644 --- a/app/file/file-open.c +++ b/app/file/file-open.c @@ -75,11 +75,11 @@ GimpImage * file_open_image (Gimp *gimp, GimpContext *context, GimpProgress *progress, - const gchar *uri, - const gchar *entered_filename, - GimpPlugInProcedure *file_proc, - GimpRunMode run_mode, - GimpPDBStatusType *status, + const gchar *uri, + const gchar *entered_filename, + GimpPlugInProcedure *file_proc, + GimpRunMode run_mode, + GimpPDBStatusType *status, const gchar **mime_type, GError **error) { diff --git a/app/file/file-save.c b/app/file/file-save.c index 26988fbcd6..6a1cf374c2 100644 --- a/app/file/file-save.c +++ b/app/file/file-save.c @@ -151,16 +151,16 @@ file_save (GimpImage *image, (GDestroyNotify) g_free); } else - { + { /* reset the "save-a-copy" filename when the image URI changes */ if (strcmp (uri, gimp_image_get_uri (image))) g_object_set_data (G_OBJECT (image), "gimp-image-save-a-copy", NULL); - gimp_image_set_uri (image, uri); + gimp_image_set_uri (image, uri); gimp_image_set_save_proc (image, file_proc); gimp_image_clean_all (image); - } + } documents = GIMP_DOCUMENT_LIST (image->gimp->documents); imagefile = gimp_document_list_add_uri (documents, diff --git a/app/file/file-utils.c b/app/file/file-utils.c index ec618b5de3..071c7c1b1e 100644 --- a/app/file/file-utils.c +++ b/app/file/file-utils.c @@ -400,7 +400,7 @@ file_utils_load_thumbnail (const gchar *filename) gint height = gdk_pixbuf_get_height (pixbuf); if (gdk_pixbuf_get_n_channels (pixbuf) != 3) - { + { GdkPixbuf *tmp = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, width, height); @@ -469,15 +469,15 @@ file_proc_find_by_prefix (GSList *procs, GSList *prefixes; if (skip_magic && proc->magics_list) - continue; + continue; for (prefixes = proc->prefixes_list; - prefixes; - prefixes = g_slist_next (prefixes)) - { - if (strncmp (uri, prefixes->data, strlen (prefixes->data)) == 0) - return proc; - } + prefixes; + prefixes = g_slist_next (prefixes)) + { + if (strncmp (uri, prefixes->data, strlen (prefixes->data)) == 0) + return proc; + } } return NULL; @@ -502,27 +502,27 @@ file_proc_find_by_extension (GSList *procs, GSList *extensions; for (extensions = proc->extensions_list; - ext && extensions; - extensions = g_slist_next (extensions)) - { - const gchar *p1 = ext; - const gchar *p2 = extensions->data; + ext && extensions; + extensions = g_slist_next (extensions)) + { + const gchar *p1 = ext; + const gchar *p2 = extensions->data; if (skip_magic && proc->magics_list) - continue; + continue; - while (*p1 && *p2) - { - if (g_ascii_tolower (*p1) != g_ascii_tolower (*p2)) - break; + while (*p1 && *p2) + { + if (g_ascii_tolower (*p1) != g_ascii_tolower (*p2)) + break; - p1++; - p2++; - } + p1++; + p2++; + } - if (!(*p1) && !(*p2)) - return proc; - } + if (!(*p1) && !(*p2)) + return proc; + } } return NULL; @@ -530,8 +530,8 @@ file_proc_find_by_extension (GSList *procs, static GimpPlugInProcedure * file_proc_find_by_name (GSList *procs, - const gchar *uri, - gboolean skip_magic) + const gchar *uri, + gboolean skip_magic) { GimpPlugInProcedure *proc; @@ -545,9 +545,9 @@ file_proc_find_by_name (GSList *procs, static void file_convert_string (const gchar *instr, - gchar *outmem, - gint maxmem, - gint *nmem) + gchar *outmem, + gint maxmem, + gint *nmem) { /* Convert a string in C-notation to array of char */ const guchar *uin = (const guchar *) instr; @@ -695,7 +695,7 @@ file_check_single_magic (const gchar *offset, fileval = 0; if (numbytes == 5) /* Check for file size ? */ { - struct stat buf; + struct stat buf; if (fstat (fileno (ifp), &buf) < 0) return (0); fileval = buf.st_size; @@ -756,9 +756,9 @@ file_check_single_magic (const gchar *offset, */ static gint file_check_magic_list (GSList *magics_list, - const guchar *head, - gint headsize, - FILE *ifp) + const guchar *head, + gint headsize, + FILE *ifp) { const gchar *offset; @@ -782,14 +782,14 @@ file_check_magic_list (GSList *magics_list, head, headsize, ifp); if (and) - found = found && match_val; + found = found && match_val; else - found = match_val; + found = match_val; and = (strchr (offset, '&') != NULL); if ((!and) && found) - return match_val; + return match_val; } return 0; diff --git a/app/file/gimprecentlist.c b/app/file/gimprecentlist.c index 08458a7d3f..d378c83e9d 100644 --- a/app/file/gimprecentlist.c +++ b/app/file/gimprecentlist.c @@ -62,8 +62,8 @@ #define GIMP_RECENT_ITEM_LIST_UNREF(list) \ - g_list_foreach (list, (GFunc) gimp_recent_item_unref, NULL); \ - g_list_free (list); + g_list_foreach (list, (GFunc) gimp_recent_item_unref, NULL); \ + g_list_free (list); typedef struct @@ -124,7 +124,7 @@ static const GMarkupParser markup_parser = static void gimp_recent_list_add_new_groups (GimpRecentItem *item, - GimpRecentItem *upd_item) + GimpRecentItem *upd_item) { const GList *tmp; @@ -425,10 +425,10 @@ gimp_recent_list_write (gint fd, if (mime_type) g_string_append_printf (string, - " <" TAG_MIME_TYPE ">%s\n", mime_type); + " <" TAG_MIME_TYPE ">%s\n", mime_type); else g_string_append_printf (string, - " <" TAG_MIME_TYPE ">\n"); + " <" TAG_MIME_TYPE ">\n"); g_string_append_printf (string, " <" TAG_TIMESTAMP ">%d\n", (gint) timestamp); @@ -469,7 +469,7 @@ gimp_recent_list_write (gint fd, } string = g_string_append (string, - " \n"); + " \n"); g_free (escaped_uri); @@ -488,7 +488,7 @@ gimp_recent_list_write (gint fd, static gboolean gimp_recent_list_lock_file (gint fd) { - gint i; + gint i; /* Attempt to lock the file 5 times, * waiting a random interval (< 1 second) diff --git a/app/gui/color-history.c b/app/gui/color-history.c index e87d25bf07..512fdfc0ea 100644 --- a/app/gui/color-history.c +++ b/app/gui/color-history.c @@ -209,29 +209,29 @@ color_history_add (const GimpRGB *rgb) for (i = 0; i < COLOR_HISTORY_SIZE; i++) { if (gimp_rgba_distance (&color_history[i], rgb) < 0.0001) - { - shift_begin = i; + { + shift_begin = i; - goto doit; - } + goto doit; + } } /* if not, are there two equal colors? */ if (shift_begin == -1) { for (i = 0; i < COLOR_HISTORY_SIZE; i++) - { - for (j = i + 1; j < COLOR_HISTORY_SIZE; j++) - { - if (gimp_rgba_distance (&color_history[i], - &color_history[j]) < 0.0001) - { - shift_begin = i; + { + for (j = i + 1; j < COLOR_HISTORY_SIZE; j++) + { + if (gimp_rgba_distance (&color_history[i], + &color_history[j]) < 0.0001) + { + shift_begin = i; - goto doit; - } - } - } + goto doit; + } + } + } } /* if not, shift them all */ diff --git a/app/gui/gui.c b/app/gui/gui.c index 114a7aff63..e270c87ffc 100644 --- a/app/gui/gui.c +++ b/app/gui/gui.c @@ -360,8 +360,8 @@ gui_restore_callback (Gimp *gimp, image_disconnect_handler_id = gimp_container_add_handler (gimp->images, "disconnect", - G_CALLBACK (gui_image_disconnect), - gimp); + G_CALLBACK (gui_image_disconnect), + gimp); if (! gui_config->show_tooltips) gimp_help_disable_tooltips (); @@ -381,8 +381,8 @@ gui_restore_callback (Gimp *gimp, gimp); g_signal_connect (gimp_get_user_context (gimp), "display-changed", - G_CALLBACK (gui_display_changed), - gimp); + G_CALLBACK (gui_display_changed), + gimp); /* make sure the monitor resolution is valid */ if (display_config->monitor_res_from_gdk || @@ -394,10 +394,10 @@ gui_restore_callback (Gimp *gimp, gimp_get_screen_resolution (NULL, &xres, &yres); g_object_set (gimp->config, - "monitor-xresolution", xres, - "monitor-yresolution", yres, - "monitor-resolution-from-windowing-system", TRUE, - NULL); + "monitor-xresolution", xres, + "monitor-yresolution", yres, + "monitor-resolution-from-windowing-system", TRUE, + NULL); } actions_init (gimp); @@ -636,8 +636,8 @@ gui_menu_hide_tooltip (GimpUIManager *manager, static void gui_display_changed (GimpContext *context, - GimpDisplay *display, - Gimp *gimp) + GimpDisplay *display, + Gimp *gimp) { if (! display) { @@ -674,7 +674,7 @@ gui_display_changed (GimpContext *context, static void gui_image_disconnect (GimpImage *image, - Gimp *gimp) + Gimp *gimp) { /* check if this is the last image and if it had a display */ if (gimp_container_num_children (gimp->images) == 1 && diff --git a/app/gui/session.c b/app/gui/session.c index 338d68c8b0..e41b97d264 100644 --- a/app/gui/session.c +++ b/app/gui/session.c @@ -134,7 +134,7 @@ session_init (Gimp *gimp) } else if (scanner->value.v_symbol == GINT_TO_POINTER (LAST_TIP_SHOWN)) { - GimpGuiConfig *config = GIMP_GUI_CONFIG (gimp->config); + GimpGuiConfig *config = GIMP_GUI_CONFIG (gimp->config); token = G_TOKEN_INT; @@ -205,17 +205,17 @@ session_save (Gimp *gimp, writer = gimp_config_writer_new_file (filename, - TRUE, - "GIMP sessionrc\n\n" - "This file takes session-specific info " - "(that is info, you want to keep between " - "two GIMP sessions). You are not supposed " - "to edit it manually, but of course you " - "can do. The sessionrc will be entirely " + TRUE, + "GIMP sessionrc\n\n" + "This file takes session-specific info " + "(that is info, you want to keep between " + "two GIMP sessions). You are not supposed " + "to edit it manually, but of course you " + "can do. The sessionrc will be entirely " "rewritten every time you quit GIMP. " "If this file isn't found, defaults are " "used.", - NULL); + NULL); g_free (filename); if (!writer) diff --git a/app/gui/splash.h b/app/gui/splash.h index 432d25bebb..c9a7a936a5 100644 --- a/app/gui/splash.h +++ b/app/gui/splash.h @@ -24,8 +24,8 @@ void splash_create (void); void splash_destroy (void); void splash_update (const gchar *label1, - const gchar *label2, - gdouble percentage); + const gchar *label2, + gdouble percentage); #endif /* __SPLASH_H__ */ diff --git a/app/gui/themes.c b/app/gui/themes.c index d76154164d..c672a33201 100644 --- a/app/gui/themes.c +++ b/app/gui/themes.c @@ -68,9 +68,9 @@ themes_init (Gimp *gimp) config = GIMP_GUI_CONFIG (gimp->config); themes_hash = g_hash_table_new_full (g_str_hash, - g_str_equal, - g_free, - g_free); + g_str_equal, + g_free, + g_free); if (config->theme_path) { @@ -79,9 +79,9 @@ themes_init (Gimp *gimp) path = gimp_config_path_expand (config->theme_path, TRUE, NULL); gimp_datafiles_read_directories (path, - G_FILE_TEST_IS_DIR, - themes_directories_foreach, - gimp); + G_FILE_TEST_IS_DIR, + themes_directories_foreach, + gimp); g_free (path); } @@ -229,7 +229,7 @@ themes_apply_theme (Gimp *gimp, if (gimp->be_verbose) g_print (_("Writing '%s'\n"), - gimp_filename_to_utf8 (themerc)); + gimp_filename_to_utf8 (themerc)); file = g_fopen (themerc, "w"); @@ -283,11 +283,11 @@ themes_directories_foreach (const GimpDatafileData *file_data, if (gimp->be_verbose) g_print (_("Adding theme '%s' (%s)\n"), gimp_filename_to_utf8 (file_data->basename), - gimp_filename_to_utf8 (file_data->filename)); + gimp_filename_to_utf8 (file_data->filename)); g_hash_table_insert (themes_hash, - g_strdup (file_data->basename), - g_strdup (file_data->filename)); + g_strdup (file_data->basename), + g_strdup (file_data->filename)); } static void diff --git a/app/main.c b/app/main.c index 692341e9a0..f52f6a81ec 100644 --- a/app/main.c +++ b/app/main.c @@ -269,13 +269,13 @@ main (int argc, continue; if ((strcmp (arg, "--no-interface") == 0) || (strcmp (arg, "-i") == 0)) - { - no_interface = TRUE; - } + { + no_interface = TRUE; + } else if ((strcmp (arg, "--version") == 0) || (strcmp (arg, "-v") == 0)) - { - gimp_show_version_and_exit (); - } + { + gimp_show_version_and_exit (); + } } #ifdef GIMP_CONSOLE_COMPILATION @@ -349,9 +349,9 @@ main (int argc, int _stdcall WinMain (struct HINSTANCE__ *hInstance, - struct HINSTANCE__ *hPrevInstance, - char *lpszCmdLine, - int nCmdShow) + struct HINSTANCE__ *hPrevInstance, + char *lpszCmdLine, + int nCmdShow) { return main (__argc, __argv); } diff --git a/app/paint-funcs/scale-funcs.c b/app/paint-funcs/scale-funcs.c index 4b5492d77e..0643960a3f 100644 --- a/app/paint-funcs/scale-funcs.c +++ b/app/paint-funcs/scale-funcs.c @@ -971,7 +971,7 @@ scale_region_lanczos (PixelRegion *srcPR, gdouble du ,dv; /* Pos in source image (double) */ gint u, v; /* Pos in source image (integer part)*/ gint x, y; /* Position in destination image */ - gint i, j, byte; /* loop vars to fill source window */ + gint i, j, byte; /* loop vars to fill source window */ gdouble sx, sy; /* Scalefactor */ gdouble trans[6], itrans[6]; /* Scale transformations */ @@ -1079,69 +1079,69 @@ scale_region_lanczos (PixelRegion *srcPR, } } - /* get weight for fractional error */ - su = (gint) ((du-u) * LANCZOS_SPP); - sv = (gint) ((dv-v) * LANCZOS_SPP); + /* get weight for fractional error */ + su = (gint) ((du-u) * LANCZOS_SPP); + sv = (gint) ((dv-v) * LANCZOS_SPP); - for (lusum = lvsum = i = 0, j = LANCZOS_WIDTH - 1; - j >= -LANCZOS_WIDTH; - j--, i++) - { - lusum += lu[i] = kernel[ABS (j * LANCZOS_SPP + su)]; - lvsum += lv[i] = kernel[ABS (j * LANCZOS_SPP + sv)]; - } + for (lusum = lvsum = i = 0, j = LANCZOS_WIDTH - 1; + j >= -LANCZOS_WIDTH; + j--, i++) + { + lusum += lu[i] = kernel[ABS (j * LANCZOS_SPP + su)]; + lvsum += lv[i] = kernel[ABS (j * LANCZOS_SPP + sv)]; + } - weight = (lusum * lvsum); + weight = (lusum * lvsum); - if (pixel_region_has_alpha (srcPR)) - { - alpha = bytes - 1; + if (pixel_region_has_alpha (srcPR)) + { + alpha = bytes - 1; - for (aval = 0, row = 0; row < LANCZOS_WIDTH2; row++) - aval += lv[row] * lanczos_sum (src, lu, row, u, bytes, alpha); + for (aval = 0, row = 0; row < LANCZOS_WIDTH2; row++) + aval += lv[row] * lanczos_sum (src, lu, row, u, bytes, alpha); - /* calculate alpha of result */ - aval /= weight; + /* calculate alpha of result */ + aval /= weight; - if (aval <= 0.0) - { - arecip = 0.0; - dst_buf[x * bytes + alpha] = 0; - } - else if (aval > 255.0) - { - arecip = 1.0 / aval; - dst_buf[x * bytes + alpha] = 255; - } - else - { - arecip = 1.0 / aval; - dst_buf[x * bytes + alpha] = RINT (aval); - } + if (aval <= 0.0) + { + arecip = 0.0; + dst_buf[x * bytes + alpha] = 0; + } + else if (aval > 255.0) + { + arecip = 1.0 / aval; + dst_buf[x * bytes + alpha] = 255; + } + else + { + arecip = 1.0 / aval; + dst_buf[x * bytes + alpha] = RINT (aval); + } - for (byte = 0; byte < alpha; byte++) - { - for (newval = 0, row = 0; row < LANCZOS_WIDTH2; row ++) - newval += lv[row] * lanczos_sum_mul (src, lu, - row, u, bytes, - byte, alpha); + for (byte = 0; byte < alpha; byte++) + { + for (newval = 0, row = 0; row < LANCZOS_WIDTH2; row ++) + newval += lv[row] * lanczos_sum_mul (src, lu, + row, u, bytes, + byte, alpha); - newval *= arecip; - dst_buf[x * bytes + byte] = CLAMP (newval, 0, 255); - } - } - else - { - for (byte = 0; byte < bytes; byte++) - { - for (newval = 0, row = 0 ; row < LANCZOS_WIDTH2 ; row++ ) - newval += lv[row] * lanczos_sum (src, lu, - row, u, bytes, byte); - newval /= weight; - dst_buf[x * bytes + byte] = CLAMP ((gint) newval, 0, 255); - } - } - } + newval *= arecip; + dst_buf[x * bytes + byte] = CLAMP (newval, 0, 255); + } + } + else + { + for (byte = 0; byte < bytes; byte++) + { + for (newval = 0, row = 0 ; row < LANCZOS_WIDTH2 ; row++ ) + newval += lv[row] * lanczos_sum (src, lu, + row, u, bytes, byte); + newval /= weight; + dst_buf[x * bytes + byte] = CLAMP ((gint) newval, 0, 255); + } + } + } pixel_region_set_row (dstPR, 0, y , dst_width, dst_buf); } diff --git a/app/paint/gimpairbrush.c b/app/paint/gimpairbrush.c index c5873edb55..0dc4113939 100644 --- a/app/paint/gimpairbrush.c +++ b/app/paint/gimpairbrush.c @@ -115,10 +115,10 @@ gimp_airbrush_paint (GimpPaintCore *paint_core, { case GIMP_PAINT_STATE_INIT: if (airbrush->timeout_id) - { - g_source_remove (airbrush->timeout_id); - airbrush->timeout_id = 0; - } + { + g_source_remove (airbrush->timeout_id); + airbrush->timeout_id = 0; + } GIMP_PAINT_CORE_CLASS (parent_class)->paint (paint_core, drawable, paint_options, @@ -127,36 +127,36 @@ gimp_airbrush_paint (GimpPaintCore *paint_core, case GIMP_PAINT_STATE_MOTION: if (airbrush->timeout_id) - { - g_source_remove (airbrush->timeout_id); - airbrush->timeout_id = 0; - } + { + g_source_remove (airbrush->timeout_id); + airbrush->timeout_id = 0; + } gimp_airbrush_motion (paint_core, drawable, paint_options); if (options->rate != 0.0) - { - gdouble timeout; + { + gdouble timeout; - airbrush->drawable = drawable; + airbrush->drawable = drawable; airbrush->paint_options = paint_options; - timeout = (paint_options->pressure_options->rate ? - (10000 / (options->rate * PRESSURE_SCALE * paint_core->cur_coords.pressure)) : - (10000 / options->rate)); + timeout = (paint_options->pressure_options->rate ? + (10000 / (options->rate * PRESSURE_SCALE * paint_core->cur_coords.pressure)) : + (10000 / options->rate)); - airbrush->timeout_id = g_timeout_add (timeout, + airbrush->timeout_id = g_timeout_add (timeout, gimp_airbrush_timeout, airbrush); - } + } break; case GIMP_PAINT_STATE_FINISH: if (airbrush->timeout_id) - { - g_source_remove (airbrush->timeout_id); - airbrush->timeout_id = 0; - } + { + g_source_remove (airbrush->timeout_id); + airbrush->timeout_id = 0; + } GIMP_PAINT_CORE_CLASS (parent_class)->paint (paint_core, drawable, paint_options, diff --git a/app/paint/gimpbrushcore.c b/app/paint/gimpbrushcore.c index 7c393fffbf..c1d1c8fb48 100644 --- a/app/paint/gimpbrushcore.c +++ b/app/paint/gimpbrushcore.c @@ -142,13 +142,13 @@ gimp_brush_core_class_init (GimpBrushCoreClass *klass) core_signals[SET_BRUSH] = g_signal_new ("set-brush", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GimpBrushCoreClass, set_brush), - NULL, NULL, - gimp_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, - GIMP_TYPE_BRUSH); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GimpBrushCoreClass, set_brush), + NULL, NULL, + gimp_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GIMP_TYPE_BRUSH); object_class->finalize = gimp_brush_core_finalize; @@ -285,8 +285,8 @@ gimp_brush_core_pre_paint (GimpPaintCore *paint_core, * pixmap to select.) */ if (paint_core->last_coords.x == paint_core->cur_coords.x && - paint_core->last_coords.y == paint_core->cur_coords.y && - ! gimp_brush_want_null_motion (core->main_brush, + paint_core->last_coords.y == paint_core->cur_coords.y && + ! gimp_brush_want_null_motion (core->main_brush, &paint_core->last_coords, &paint_core->cur_coords)) { @@ -321,7 +321,7 @@ gimp_brush_core_post_paint (GimpPaintCore *paint_core, static gboolean gimp_brush_core_start (GimpPaintCore *paint_core, - GimpDrawable *drawable, + GimpDrawable *drawable, GimpPaintOptions *paint_options, GimpCoords *coords) { @@ -374,7 +374,7 @@ gimp_avoid_exact_integer (gdouble *x) static void gimp_brush_core_interpolate (GimpPaintCore *paint_core, - GimpDrawable *drawable, + GimpDrawable *drawable, GimpPaintOptions *paint_options, guint32 time) { @@ -418,11 +418,11 @@ gimp_brush_core_interpolate (GimpPaintCore *paint_core, /* calculate the distance traveled in the coordinate space of the brush */ mag = gimp_vector2_length (&(core->brush->x_axis)); xd = gimp_vector2_inner_product (&delta_vec, - &(core->brush->x_axis)) / (mag * mag); + &(core->brush->x_axis)) / (mag * mag); mag = gimp_vector2_length (&(core->brush->y_axis)); yd = gimp_vector2_inner_product (&delta_vec, - &(core->brush->y_axis)) / (mag * mag); + &(core->brush->y_axis)) / (mag * mag); dist = 0.5 * sqrt (xd * xd + yd * yd); total = dist + paint_core->distance; @@ -487,7 +487,7 @@ gimp_brush_core_interpolate (GimpPaintCore *paint_core, */ if (num_points == 0 && (delta_vec.x == 0 || delta_vec.y == 0)) - return; + return; } else if (fabs (st_factor) < EPSILON) { @@ -602,12 +602,12 @@ gimp_brush_core_interpolate (GimpPaintCore *paint_core, p * delta_wheel); if (core->jitter > 0.0) - { + { gdouble jitter_x; gdouble jitter_y; - jitter_x = g_random_double_range (-core->jitter, core->jitter); - jitter_y = g_random_double_range (-core->jitter, core->jitter); + jitter_x = g_random_double_range (-core->jitter, core->jitter); + jitter_y = g_random_double_range (-core->jitter, core->jitter); paint_core->cur_coords.x += jitter_x * core->brush->x_axis.x; paint_core->cur_coords.y += jitter_y * core->brush->y_axis.y; @@ -727,9 +727,9 @@ gimp_brush_core_set_brush (GimpBrushCore *core, void gimp_brush_core_paste_canvas (GimpBrushCore *core, - GimpDrawable *drawable, - gdouble brush_opacity, - gdouble image_opacity, + GimpDrawable *drawable, + gdouble brush_opacity, + gdouble image_opacity, GimpLayerModeEffects paint_mode, GimpBrushApplicationMode brush_hardness, GimpPaintApplicationMode mode) @@ -771,11 +771,11 @@ gimp_brush_core_paste_canvas (GimpBrushCore *core, */ void gimp_brush_core_replace_canvas (GimpBrushCore *core, - GimpDrawable *drawable, - gdouble brush_opacity, - gdouble image_opacity, - GimpBrushApplicationMode brush_hardness, - GimpPaintApplicationMode mode) + GimpDrawable *drawable, + gdouble brush_opacity, + gdouble image_opacity, + GimpBrushApplicationMode brush_hardness, + GimpPaintApplicationMode mode) { MaskBuf *brush_mask = gimp_brush_core_get_brush_mask (core, brush_hardness, @@ -811,7 +811,7 @@ gimp_brush_core_replace_canvas (GimpBrushCore *core, static void gimp_brush_core_invalidate_cache (GimpBrush *brush, - GimpBrushCore *core) + GimpBrushCore *core) { /* Make sure we don't cache data for a brush that has changed */ @@ -846,9 +846,9 @@ gimp_brush_core_calc_brush_size (GimpBrushCore *core, gdouble ratio; if (scale < 1 / 256) - ratio = 1 / 16; + ratio = 1 / 16; else - ratio = sqrt (scale); + ratio = sqrt (scale); *width = MAX ((gint) (mask->width * ratio + 0.5), 1); *height = MAX ((gint) (mask->height * ratio + 0.5), 1); @@ -857,7 +857,7 @@ gimp_brush_core_calc_brush_size (GimpBrushCore *core, static inline void rotate_pointers (gulong **p, - guint32 n) + guint32 n) { guint32 i; gulong *tmp; @@ -873,8 +873,8 @@ rotate_pointers (gulong **p, static MaskBuf * gimp_brush_core_subsample_mask (GimpBrushCore *core, MaskBuf *mask, - gdouble x, - gdouble y) + gdouble x, + gdouble y) { MaskBuf *dest; gdouble left; @@ -932,7 +932,7 @@ gimp_brush_core_subsample_mask (GimpBrushCore *core, if (mask == core->last_brush_mask && ! core->cache_invalid) { if (core->kernel_brushes[index2][index1]) - return core->kernel_brushes[index2][index1]; + return core->kernel_brushes[index2][index1]; } else { @@ -1041,9 +1041,9 @@ gimp_brush_core_pressurize_mask (GimpBrushCore *core, * low pressure medium pressure high pressure * * | / -- - * | / / - * / / | - * -- / | + * | / / + * / / | + * -- / | */ { static gdouble map[256]; @@ -1074,7 +1074,7 @@ gimp_brush_core_pressurize_mask (GimpBrushCore *core, map[i] = s / c; s += c * ds; c += s * ds; - } + } for (i = 0; i < 256; i++) mapi[i] = (gint) (255 * (1 - map[i] / map[0])); diff --git a/app/paint/gimpbrushcore.h b/app/paint/gimpbrushcore.h index 7bb3d54851..1a04e2ef92 100644 --- a/app/paint/gimpbrushcore.h +++ b/app/paint/gimpbrushcore.h @@ -106,7 +106,7 @@ void gimp_brush_core_paste_canvas (GimpBrushCore *core, GimpBrushApplicationMode brush_hardness, GimpPaintApplicationMode mode); void gimp_brush_core_replace_canvas (GimpBrushCore *core, - GimpDrawable *drawable, + GimpDrawable *drawable, gdouble brush_opacity, gdouble image_opacity, GimpBrushApplicationMode brush_hardness, diff --git a/app/paint/gimpconvolve.c b/app/paint/gimpconvolve.c index 023fc309eb..d5975db824 100644 --- a/app/paint/gimpconvolve.c +++ b/app/paint/gimpconvolve.c @@ -193,7 +193,7 @@ gimp_convolve_motion (GimpPaintCore *paint_core, /* configure the source pixel region */ pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable), - area->x, area->y, area->width, area->height, FALSE); + area->x, area->y, area->width, area->height, FALSE); /* configure the destination pixel region */ pixel_region_init_temp_buf (&destPR, area, @@ -254,11 +254,11 @@ gimp_convolve_motion (GimpPaintCore *paint_core, gint bytes; if (! gimp_drawable_has_alpha (drawable)) - { - /* note: this particular approach needlessly convolves the totally- - opaque alpha channel. A faster approach would be to keep - tempPR the same number of bytes as srcPR, and extend the - paint_core_replace_canvas API to handle non-alpha images. */ + { + /* note: this particular approach needlessly convolves the totally- + opaque alpha channel. A faster approach would be to keep + tempPR the same number of bytes as srcPR, and extend the + paint_core_replace_canvas API to handle non-alpha images. */ bytes = srcPR.bytes + 1; @@ -269,9 +269,9 @@ gimp_convolve_motion (GimpPaintCore *paint_core, 0, 0, area->width, area->height); add_alpha_region (&srcPR, &tempPR); - } + } else - { + { bytes = srcPR.bytes; temp_data = g_malloc (area->height * bytes * area->width); @@ -281,7 +281,7 @@ gimp_convolve_motion (GimpPaintCore *paint_core, 0, 0, area->width, area->height); copy_region (&srcPR, &tempPR); - } + } /* Convolve the region */ pixel_region_init_data (&tempPR, temp_data, @@ -348,9 +348,9 @@ gimp_convolve_motion (GimpPaintCore *paint_core, area->height); if (! gimp_drawable_has_alpha (drawable)) - add_alpha_region (&srcPR, &ovrsz1PR); + add_alpha_region (&srcPR, &ovrsz1PR); else - copy_region (&srcPR, &ovrsz1PR); + copy_region (&srcPR, &ovrsz1PR); /* Convolve the region */ pixel_region_init_data (&ovrsz1PR, ovrsz1_data, @@ -379,8 +379,8 @@ gimp_convolve_motion (GimpPaintCore *paint_core, gimp_brush_core_replace_canvas (brush_core, drawable, MIN (opacity, GIMP_OPACITY_OPAQUE), - gimp_context_get_opacity (context), - gimp_paint_options_get_brush_mode (paint_options), + gimp_context_get_opacity (context), + gimp_paint_options_get_brush_mode (paint_options), GIMP_PAINT_INCREMENTAL); } diff --git a/app/paint/gimpdodgeburn.c b/app/paint/gimpdodgeburn.c index 5f61df848d..276ccef64f 100644 --- a/app/paint/gimpdodgeburn.c +++ b/app/paint/gimpdodgeburn.c @@ -149,10 +149,10 @@ gimp_dodge_burn_paint (GimpPaintCore *paint_core, case GIMP_PAINT_STATE_FINISH: if (dodgeburn->lut) - { - gimp_lut_free (dodgeburn->lut); - dodgeburn->lut = NULL; - } + { + gimp_lut_free (dodgeburn->lut); + dodgeburn->lut = NULL; + } break; } } @@ -239,9 +239,9 @@ gimp_dodge_burn_motion (GimpPaintCore *paint_core, /* Replace the newly dodgedburned area (canvas_buf) to the image */ gimp_brush_core_replace_canvas (GIMP_BRUSH_CORE (paint_core), drawable, - MIN (opacity, GIMP_OPACITY_OPAQUE), - gimp_context_get_opacity (context), - gimp_paint_options_get_brush_mode (paint_options), + MIN (opacity, GIMP_OPACITY_OPAQUE), + gimp_context_get_opacity (context), + gimp_paint_options_get_brush_mode (paint_options), GIMP_PAINT_CONSTANT); g_free (temp_data); @@ -281,8 +281,8 @@ gimp_dodge_burn_make_luts (GimpDodgeBurn *dodgeburn, } gimp_lut_setup_exact (dodgeburn->lut, - lut_func, (gpointer) &exposure, - nchannels); + lut_func, (gpointer) &exposure, + nchannels); } static gfloat @@ -348,9 +348,9 @@ gimp_dodge_burn_shadows_lut_func (gpointer user_data, { factor = -0.333333 * exposure; if (value < factor) - new_value = 0; + new_value = 0; else /*factor <= value <=1*/ - new_value = (value - factor)/(1 - factor); + new_value = (value - factor)/(1 - factor); } return new_value; diff --git a/app/paint/gimperaser.c b/app/paint/gimperaser.c index 0a2cff9ecd..e55604be1e 100644 --- a/app/paint/gimperaser.c +++ b/app/paint/gimperaser.c @@ -128,16 +128,16 @@ gimp_eraser_motion (GimpPaintCore *paint_core, /* color the pixels */ color_pixels (temp_buf_data (area), col, - area->width * area->height, area->bytes); + area->width * area->height, area->bytes); if (pressure_options->opacity) opacity *= PRESSURE_SCALE * paint_core->cur_coords.pressure; gimp_brush_core_paste_canvas (GIMP_BRUSH_CORE (paint_core), drawable, - MIN (opacity, GIMP_OPACITY_OPAQUE), - gimp_context_get_opacity (context), - (options->anti_erase ? + MIN (opacity, GIMP_OPACITY_OPAQUE), + gimp_context_get_opacity (context), + (options->anti_erase ? GIMP_ANTI_ERASE_MODE : GIMP_ERASE_MODE), - gimp_paint_options_get_brush_mode (paint_options), - paint_options->application_mode); + gimp_paint_options_get_brush_mode (paint_options), + paint_options->application_mode); } diff --git a/app/paint/gimpink-blob.c b/app/paint/gimpink-blob.c index 651a6564e1..6fb384d920 100644 --- a/app/paint/gimpink-blob.c +++ b/app/paint/gimpink-blob.c @@ -82,9 +82,9 @@ blob_polygon (BlobPoint *points, for (i = 1; i < npoints; i++) { if (points[i].y > ymax) - ymax = points[i].y; + ymax = points[i].y; if (points[i].y < ymin) - ymin = points[i].y; + ymin = points[i].y; } result = blob_new (ymin, ymax - ymin + 1); @@ -100,45 +100,45 @@ blob_polygon (BlobPoint *points, gint j = points[i].y - ymin; if (points[i].y < points[im1].y) - sides |= EDGE_RIGHT; + sides |= EDGE_RIGHT; else if (points[i].y > points[im1].y) - sides |= EDGE_LEFT; + sides |= EDGE_LEFT; if (points[ip1].y < points[i].y) - sides |= EDGE_RIGHT; + sides |= EDGE_RIGHT; else if (points[ip1].y > points[i].y) - sides |= EDGE_LEFT; + sides |= EDGE_LEFT; if (sides & EDGE_RIGHT) - { - if (present[j] & EDGE_RIGHT) - { - result->data[j].right = MAX (result->data[j].right, points[i].x); - } - else - { - present[j] |= EDGE_RIGHT; - result->data[j].right = points[i].x; - } - } + { + if (present[j] & EDGE_RIGHT) + { + result->data[j].right = MAX (result->data[j].right, points[i].x); + } + else + { + present[j] |= EDGE_RIGHT; + result->data[j].right = points[i].x; + } + } if (sides & EDGE_LEFT) - { - if (present[j] & EDGE_LEFT) - { - result->data[j].left = MIN (result->data[j].left, points[i].x); - } - else - { - present[j] |= EDGE_LEFT; - result->data[j].left = points[i].x; - } - } + { + if (present[j] & EDGE_LEFT) + { + result->data[j].left = MIN (result->data[j].left, points[i].x); + } + else + { + present[j] |= EDGE_LEFT; + result->data[j].left = points[i].x; + } + } im1 = i; ip1++; if (ip1 == npoints) - ip1 = 0; + ip1 = 0; } blob_fill (result, present); @@ -267,7 +267,7 @@ blob_ellipse (gdouble xc, trig_initialized = TRUE; for (i = 0; i < 256; i++) - trig_table[i] = 0.5 + sin (i * (G_PI / 128.0)) * (1 << TABLE_SHIFT); + trig_table[i] = 0.5 + sin (i * (G_PI / 128.0)) * (1 << TABLE_SHIFT); } /* Make sure we traverse ellipse in ccw direction */ @@ -311,37 +311,37 @@ blob_ellipse (gdouble xc, gint c = trig_table[(TABLE_SIZE + TABLE_SIZE / 4 - i) % TABLE_SIZE]; gint x = (xc_shift + c * xp_shift + s * xq_shift + - (1 << (TOTAL_SHIFT - 1))) >> TOTAL_SHIFT; + (1 << (TOTAL_SHIFT - 1))) >> TOTAL_SHIFT; gint y = ((yc_shift + c * yp_shift + s * yq_shift + - (1 << (TOTAL_SHIFT - 1))) >> TOTAL_SHIFT) - result->y; + (1 << (TOTAL_SHIFT - 1))) >> TOTAL_SHIFT) - result->y; gint dydi = c * yq_shift - s * yp_shift; if (dydi <= 0) /* left edge */ - { - if (present[y] & EDGE_LEFT) - { - result->data[y].left = MIN (result->data[y].left, x); - } - else - { - present[y] |= EDGE_LEFT; - result->data[y].left = x; - } - } + { + if (present[y] & EDGE_LEFT) + { + result->data[y].left = MIN (result->data[y].left, x); + } + else + { + present[y] |= EDGE_LEFT; + result->data[y].left = x; + } + } if (dydi >= 0) /* right edge */ - { - if (present[y] & EDGE_RIGHT) - { - result->data[y].right = MAX (result->data[y].right, x); - } - else - { - present[y] |= EDGE_RIGHT; - result->data[y].right = x; - } - } + { + if (present[y] & EDGE_RIGHT) + { + result->data[y].right = MAX (result->data[y].right, x); + } + else + { + present[y] |= EDGE_RIGHT; + result->data[y].right = x; + } + } } /* Now fill in missing points */ @@ -373,11 +373,11 @@ blob_bounds (Blob *b, x1 = b->data[i].right + 1; while (i < b->height && b->data[i].left <= b->data[i].right) - { - x0 = MIN (b->data[i].left, x0); - x1 = MAX (b->data[i].right + 1, x1); - i++; - } + { + x0 = MIN (b->data[i].left, x0); + x1 = MAX (b->data[i].right + 1, x1); + i++; + } y1 = b->y + i; } @@ -417,31 +417,31 @@ blob_convex_union (Blob *b1, for (i = 0, j = b1->y-y; i < b1->height; i++, j++) { if (b1->data[i].right >= b1->data[i].left) - { - present[j] = EDGE_LEFT | EDGE_RIGHT; - result->data[j].left = b1->data[i].left; - result->data[j].right = b1->data[i].right; - } + { + present[j] = EDGE_LEFT | EDGE_RIGHT; + result->data[j].left = b1->data[i].left; + result->data[j].right = b1->data[i].right; + } } for (i = 0, j = b2->y - y; i < b2->height; i++, j++) { if (b2->data[i].right >= b2->data[i].left) - { - if (present[j]) - { - if (result->data[j].left > b2->data[i].left) - result->data[j].left = b2->data[i].left; - if (result->data[j].right < b2->data[i].right) - result->data[j].right = b2->data[i].right; - } - else - { - present[j] = EDGE_LEFT | EDGE_RIGHT; - result->data[j].left = b2->data[i].left; - result->data[j].right = b2->data[i].right; - } - } + { + if (present[j]) + { + if (result->data[j].left > b2->data[i].left) + result->data[j].left = b2->data[i].left; + if (result->data[j].right < b2->data[i].right) + result->data[j].right = b2->data[i].right; + } + else + { + present[j] = EDGE_LEFT | EDGE_RIGHT; + result->data[j].left = b2->data[i].left; + result->data[j].right = b2->data[i].right; + } + } } blob_make_convex (result, present); @@ -468,10 +468,10 @@ blob_dump (Blob *b) for (i = 0; i < b->height; i++) { for (j = 0; j < b->data[i].left; j++) - putchar (' '); + putchar (' '); for (j = b->data[i].left; j <= b->data[i].right; j++) - putchar ('*'); + putchar ('*'); putchar ('\n'); } @@ -483,7 +483,7 @@ blob_dump (Blob *b) static Blob * blob_new (gint y, - gint height) + gint height) { Blob *result; @@ -497,7 +497,7 @@ blob_new (gint y, static void blob_fill (Blob *b, - EdgeType *present) + EdgeType *present) { gint start; gint x1, x2, i1, i2; @@ -516,9 +516,9 @@ blob_fill (Blob *b, if (present[start] != (EDGE_RIGHT | EDGE_LEFT)) { if (present[start] == EDGE_RIGHT) - b->data[start].left = b->data[start].right; + b->data[start].left = b->data[start].right; else - b->data[start].right = b->data[start].left; + b->data[start].right = b->data[start].left; present[start] = EDGE_RIGHT | EDGE_LEFT; } @@ -532,9 +532,9 @@ blob_fill (Blob *b, if (present[i] != (EDGE_RIGHT | EDGE_LEFT)) { if (present[i] == EDGE_RIGHT) - b->data[i].left = b->data[i].right; + b->data[i].left = b->data[i].right; else - b->data[i].right = b->data[i].left; + b->data[i].right = b->data[i].left; present[i] = EDGE_RIGHT | EDGE_LEFT; } @@ -553,52 +553,52 @@ blob_fill (Blob *b, { /* Find empty gaps */ if (! (present[i1 + 1] & EDGE_LEFT)) - { - gint increment; /* fractional part */ - gint denom; /* denominator of fraction */ - gint step; /* integral step */ - gint frac; /* fractional step */ - gint reverse; + { + gint increment; /* fractional part */ + gint denom; /* denominator of fraction */ + gint step; /* integral step */ + gint frac; /* fractional step */ + gint reverse; - /* find bottom of gap */ - i2 = i1 + 2; - while (i2 < b->height && ! (present[i2] & EDGE_LEFT)) + /* find bottom of gap */ + i2 = i1 + 2; + while (i2 < b->height && ! (present[i2] & EDGE_LEFT)) i2++; - if (i2 < b->height) - { - denom = i2 - i1; - x1 = b->data[i1].left; - x2 = b->data[i2].left; - step = (x2 - x1) / denom; - frac = x2 - x1 - step * denom; - if (frac < 0) - { - frac = -frac; - reverse = 1; - } - else - reverse = 0; + if (i2 < b->height) + { + denom = i2 - i1; + x1 = b->data[i1].left; + x2 = b->data[i2].left; + step = (x2 - x1) / denom; + frac = x2 - x1 - step * denom; + if (frac < 0) + { + frac = -frac; + reverse = 1; + } + else + reverse = 0; - increment = 0; - for (i = i1 + 1; i < i2; i++) - { - x1 += step; - increment += frac; - if (increment >= denom) - { - increment -= denom; - x1 += reverse ? -1 : 1; - } - if (increment == 0 || reverse) - b->data[i].left = x1; - else - b->data[i].left = x1 + 1; - } - } + increment = 0; + for (i = i1 + 1; i < i2; i++) + { + x1 += step; + increment += frac; + if (increment >= denom) + { + increment -= denom; + x1 += reverse ? -1 : 1; + } + if (increment == 0 || reverse) + b->data[i].left = x1; + else + b->data[i].left = x1 + 1; + } + } - i1 = i2 - 1; /* advance to next possibility */ - } + i1 = i2 - 1; /* advance to next possibility */ + } } /* right edge */ @@ -606,52 +606,52 @@ blob_fill (Blob *b, { /* Find empty gaps */ if (! (present[i1 + 1] & EDGE_RIGHT)) - { - gint increment; /* fractional part */ - gint denom; /* denominator of fraction */ - gint step; /* integral step */ - gint frac; /* fractional step */ - gint reverse; + { + gint increment; /* fractional part */ + gint denom; /* denominator of fraction */ + gint step; /* integral step */ + gint frac; /* fractional step */ + gint reverse; - /* find bottom of gap */ - i2 = i1 + 2; - while (i2 < b->height && ! (present[i2] & EDGE_RIGHT)) + /* find bottom of gap */ + i2 = i1 + 2; + while (i2 < b->height && ! (present[i2] & EDGE_RIGHT)) i2++; - if (i2 < b->height) - { - denom = i2 - i1; - x1 = b->data[i1].right; - x2 = b->data[i2].right; - step = (x2 - x1) / denom; - frac = x2 - x1 - step * denom; - if (frac < 0) - { - frac = -frac; - reverse = 1; - } - else - reverse = 0; + if (i2 < b->height) + { + denom = i2 - i1; + x1 = b->data[i1].right; + x2 = b->data[i2].right; + step = (x2 - x1) / denom; + frac = x2 - x1 - step * denom; + if (frac < 0) + { + frac = -frac; + reverse = 1; + } + else + reverse = 0; - increment = 0; - for (i = i1 + 1; i= denom) - { - increment -= denom; - x1 += reverse ? -1 : 1; - } - if (reverse && increment != 0) - b->data[i].right = x1 - 1; - else - b->data[i].right = x1; - } - } + increment = 0; + for (i = i1 + 1; i= denom) + { + increment -= denom; + x1 += reverse ? -1 : 1; + } + if (reverse && increment != 0) + b->data[i].right = x1 - 1; + else + b->data[i].right = x1; + } + } - i1 = i2 - 1; /* advance to next possibility */ - } + i1 = i2 - 1; /* advance to next possibility */ + } } } @@ -680,30 +680,30 @@ blob_make_convex (Blob *b, for (i = start + 1; i < b->height; i++) { if (! (present[i] & EDGE_LEFT)) - continue; + continue; x2 = b->data[i].left - b->data[i2].left; y2 = i - i2; while (x2 * y1 - x1 * y2 < 0) /* clockwise rotation */ - { - present[i2] &= ~EDGE_LEFT; - i2 = i1; - while ((--i1) >= start && (! (present[i1] & EDGE_LEFT))); + { + present[i2] &= ~EDGE_LEFT; + i2 = i1; + while ((--i1) >= start && (! (present[i1] & EDGE_LEFT))); - if (i1 < start) - { - x1 = b->data[start].left - b->data[start].right; - y1 = 0; - } - else - { - x1 = b->data[i2].left - b->data[i1].left; - y1 = i2 - i1; - } - x2 = b->data[i].left - b->data[i2].left; - y2 = i - i2; - } + if (i1 < start) + { + x1 = b->data[start].left - b->data[start].right; + y1 = 0; + } + else + { + x1 = b->data[i2].left - b->data[i1].left; + y1 = i2 - i1; + } + x2 = b->data[i].left - b->data[i2].left; + y2 = i - i2; + } x1 = x2; y1 = y2; @@ -721,31 +721,31 @@ blob_make_convex (Blob *b, for (i = start + 1; i < b->height; i++) { if (! (present[i] & EDGE_RIGHT)) - continue; + continue; x2 = b->data[i].right - b->data[i2].right; y2 = i - i2; while (x2 * y1 - x1 * y2 > 0) /* counter-clockwise rotation */ - { - present[i2] &= ~EDGE_RIGHT; - i2 = i1; - while ((--i1) >= start && (! (present[i1] & EDGE_RIGHT))); + { + present[i2] &= ~EDGE_RIGHT; + i2 = i1; + while ((--i1) >= start && (! (present[i1] & EDGE_RIGHT))); - if (i1 < start) - { - x1 = b->data[start].right - b->data[start].left; - y1 = 0; - } - else - { - x1 = b->data[i2].right - b->data[i1].right; - y1 = i2 - i1; - } + if (i1 < start) + { + x1 = b->data[start].right - b->data[start].left; + y1 = 0; + } + else + { + x1 = b->data[i2].right - b->data[i1].right; + y1 = i2 - i1; + } - x2 = b->data[i].right - b->data[i2].right; - y2 = i - i2; - } + x2 = b->data[i].right - b->data[i2].right; + y2 = i - i2; + } x1 = x2; y1 = y2; @@ -822,21 +822,21 @@ blob_line (Blob *b, blob_line_add_pixel (b, x, y); while (x != x1) - { - if (d <= 0) - { - d += incrE; - x += xstep; - } - else - { - d += incrNE; - x += xstep; - y += ystep; - } + { + if (d <= 0) + { + d += incrE; + x += xstep; + } + else + { + d += incrNE; + x += xstep; + y += ystep; + } - blob_line_add_pixel (b, x, y); - } + blob_line_add_pixel (b, x, y); + } } else { @@ -847,21 +847,21 @@ blob_line (Blob *b, blob_line_add_pixel (b, x, y); while (y != y1) - { - if (d <= 0) - { - d += incrE; - y += ystep; - } - else - { - d += incrNE; - x += xstep; - y += ystep; - } + { + if (d <= 0) + { + d += incrE; + y += ystep; + } + else + { + d += incrNE; + x += xstep; + y += ystep; + } - blob_line_add_pixel (b, x, y); - } + blob_line_add_pixel (b, x, y); + } } } diff --git a/app/paint/gimpink.c b/app/paint/gimpink.c index 050651e6f5..24da759c0e 100644 --- a/app/paint/gimpink.c +++ b/app/paint/gimpink.c @@ -375,11 +375,11 @@ gimp_ink_motion (GimpPaintCore *paint_core, static Blob * ink_pen_ellipse (GimpInkOptions *options, gdouble x_center, - gdouble y_center, - gdouble pressure, - gdouble xtilt, - gdouble ytilt, - gdouble velocity) + gdouble y_center, + gdouble pressure, + gdouble xtilt, + gdouble ytilt, + gdouble velocity) { BlobFunc blob_function; gdouble size; @@ -589,7 +589,7 @@ enum { ROW_START, ROW_STOP }; */ static void insert_sort (gint *data, - gint n) + gint n) { gint i, j, k; gint tmp1, tmp2; @@ -600,13 +600,13 @@ insert_sort (gint *data, tmp2 = data[i + 1]; j = 0; while (data[j] < tmp1) - j += 2; + j += 2; for (k = i; k > j; k -= 2) - { - data[k] = data[k - 2]; - data[k + 1] = data[k - 1]; - } + { + data[k] = data[k - 2]; + data[k + 1] = data[k - 1]; + } data[j] = tmp1; data[j + 1] = tmp2; @@ -615,8 +615,8 @@ insert_sort (gint *data, static void fill_run (guchar *dest, - guchar alpha, - gint w) + guchar alpha, + gint w) { if (alpha == 255) { @@ -634,18 +634,18 @@ fill_run (guchar *dest, static void render_blob_line (Blob *blob, - guchar *dest, - gint x, - gint y, - gint width) + guchar *dest, + gint x, + gint y, + gint width) { gint buf[4 * SUBSAMPLE]; gint *data = buf; gint n = 0; gint i, j; gint current = 0; /* number of filled rows at this point - * in the scan line - */ + * in the scan line + */ gint last_x; /* Sort start and ends for all lines */ @@ -654,16 +654,16 @@ render_blob_line (Blob *blob, for (i = 0; i < SUBSAMPLE; i++) { if (j >= blob->height) - break; + break; if ((j > 0) && (blob->data[j].left <= blob->data[j].right)) - { - data[2 * n] = blob->data[j].left; - data[2 * n + 1] = ROW_START; - data[2 * SUBSAMPLE + 2 * n] = blob->data[j].right; - data[2 * SUBSAMPLE + 2 * n + 1] = ROW_STOP; - n++; - } + { + data[2 * n] = blob->data[j].left; + data[2 * n + 1] = ROW_START; + data[2 * SUBSAMPLE + 2 * n] = blob->data[j].right; + data[2 * SUBSAMPLE + 2 * n + 1] = ROW_STOP; + n++; + } j++; } @@ -671,7 +671,7 @@ render_blob_line (Blob *blob, if (n < SUBSAMPLE) { for (i = 0; i < 2 * n; i++) - data[2 * n + i] = data[2 * SUBSAMPLE + i]; + data[2 * n + i] = data[2 * SUBSAMPLE + i]; } /* Now count start and end separately */ @@ -684,9 +684,9 @@ render_blob_line (Blob *blob, while ((n > 0) && (data[0] < SUBSAMPLE*x)) { if (data[1] == ROW_START) - current++; + current++; else - current--; + current--; data += 2; n--; } @@ -704,31 +704,31 @@ render_blob_line (Blob *blob, /* Fill in portion leading up to this pixel */ if (current && cur_x != last_x) - fill_run (dest + last_x, (255 * current) / SUBSAMPLE, cur_x - last_x); + fill_run (dest + last_x, (255 * current) / SUBSAMPLE, cur_x - last_x); /* Compute the value for this pixel */ pixel = current * SUBSAMPLE; while (idata; for (i=0; ix, dest->y + i, dest->w); - s += dest->rowstride; - } + { + render_blob_line (blob, s, + dest->x, dest->y + i, dest->w); + s += dest->rowstride; + } } } diff --git a/app/paint/gimppaintcore-stroke.c b/app/paint/gimppaintcore-stroke.c index 54ece6ed67..7687217642 100644 --- a/app/paint/gimppaintcore-stroke.c +++ b/app/paint/gimppaintcore-stroke.c @@ -69,7 +69,7 @@ gimp_paint_core_stroke (GimpPaintCore *core, core->cur_coords = strokes[i]; gimp_paint_core_interpolate (core, drawable, paint_options, 0); - } + } gimp_paint_core_paint (core, drawable, paint_options, GIMP_PAINT_STATE_FINISH, 0); @@ -141,14 +141,14 @@ gimp_paint_core_stroke_boundary (GimpPaintCore *core, stroke_segs[seg].x2 != -1 || stroke_segs[seg].y1 != -1 || stroke_segs[seg].y2 != -1) - { + { coords[n_coords] = default_coords; coords[n_coords].x = (gdouble) (stroke_segs[seg].x1 - off_x + 0.5); coords[n_coords].y = (gdouble) (stroke_segs[seg].y1 - off_y + 0.5); n_coords++; - seg++; - } + seg++; + } /* Close the stroke points up */ coords[n_coords] = coords[0]; diff --git a/app/paint/gimppaintcore.c b/app/paint/gimppaintcore.c index bf773df70d..f537d7b1e9 100644 --- a/app/paint/gimppaintcore.c +++ b/app/paint/gimppaintcore.c @@ -393,7 +393,7 @@ gimp_paint_core_copy_valid_tiles (TileManager *src_tiles, void gimp_paint_core_cancel (GimpPaintCore *core, - GimpDrawable *drawable) + GimpDrawable *drawable) { g_return_if_fail (GIMP_IS_PAINT_CORE (core)); g_return_if_fail (GIMP_IS_DRAWABLE (drawable)); @@ -560,7 +560,7 @@ gimp_paint_core_get_orig_image (GimpPaintCore *core, undo_tile = tile_manager_get_tile (core->undo_tiles, srcPR.x, srcPR.y, TRUE, FALSE); - s = (guchar *) tile_data_pointer (undo_tile, + s = (guchar *) tile_data_pointer (undo_tile, srcPR.x % TILE_WIDTH, srcPR.y % TILE_HEIGHT); } @@ -655,7 +655,7 @@ gimp_paint_core_get_orig_proj (GimpPaintCore *core, saved_tile = tile_manager_get_tile (core->saved_proj_tiles, srcPR.x, srcPR.y, TRUE, FALSE); - s = (guchar *) tile_data_pointer (saved_tile, + s = (guchar *) tile_data_pointer (saved_tile, srcPR.x % TILE_WIDTH, srcPR.y % TILE_HEIGHT); } @@ -688,12 +688,12 @@ gimp_paint_core_get_orig_proj (GimpPaintCore *core, void gimp_paint_core_paste (GimpPaintCore *core, - PixelRegion *paint_maskPR, - GimpDrawable *drawable, - gdouble paint_opacity, - gdouble image_opacity, - GimpLayerModeEffects paint_mode, - GimpPaintApplicationMode mode) + PixelRegion *paint_maskPR, + GimpDrawable *drawable, + gdouble paint_opacity, + gdouble image_opacity, + GimpLayerModeEffects paint_mode, + GimpPaintApplicationMode mode) { GimpImage *image; PixelRegion srcPR; diff --git a/app/paint/gimppaintcore.h b/app/paint/gimppaintcore.h index dc9f70fcb5..544000db7c 100644 --- a/app/paint/gimppaintcore.h +++ b/app/paint/gimppaintcore.h @@ -150,14 +150,14 @@ TempBuf * gimp_paint_core_get_orig_proj (GimpPaintCore *core, void gimp_paint_core_paste (GimpPaintCore *core, PixelRegion *paint_maskPR, GimpDrawable *drawable, - gdouble paint_opacity, - gdouble image_opacity, + gdouble paint_opacity, + gdouble image_opacity, GimpLayerModeEffects paint_mode, GimpPaintApplicationMode mode); void gimp_paint_core_replace (GimpPaintCore *core, PixelRegion *paint_maskPR, GimpDrawable *drawable, - gdouble paint_opacity, + gdouble paint_opacity, gdouble image_opacity, GimpPaintApplicationMode mode); diff --git a/app/paint/gimppaintoptions.c b/app/paint/gimppaintoptions.c index f9994ed73f..85b6c49e18 100644 --- a/app/paint/gimppaintoptions.c +++ b/app/paint/gimppaintoptions.c @@ -592,7 +592,7 @@ gimp_paint_options_get_fade (GimpPaintOptions *paint_options, gdouble gimp_paint_options_get_jitter (GimpPaintOptions *paint_options, - GimpImage *image) + GimpImage *image) { GimpJitterOptions *jitter_options; diff --git a/app/paint/gimpsmudge.c b/app/paint/gimpsmudge.c index eda2702047..3014713b60 100644 --- a/app/paint/gimpsmudge.c +++ b/app/paint/gimpsmudge.c @@ -128,11 +128,11 @@ gimp_smudge_paint (GimpPaintCore *paint_core, case GIMP_PAINT_STATE_MOTION: /* initialization fails if the user starts outside the drawable */ if (! smudge->initialized) - smudge->initialized = gimp_smudge_start (paint_core, drawable, + smudge->initialized = gimp_smudge_start (paint_core, drawable, paint_options); if (smudge->initialized) - gimp_smudge_motion (paint_core, drawable, paint_options); + gimp_smudge_motion (paint_core, drawable, paint_options); break; case GIMP_PAINT_STATE_FINISH: @@ -202,7 +202,7 @@ gimp_smudge_start (GimpPaintCore *paint_core, } pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable), - area->x, area->y, area->width, area->height, FALSE); + area->x, area->y, area->width, area->height, FALSE); pixel_region_init_data (&smudge->accumPR, smudge->accum_data, bytes, bytes * w, @@ -259,7 +259,7 @@ gimp_smudge_motion (GimpPaintCore *paint_core, /* srcPR will be the pixels under the current painthit from the drawable */ pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable), - area->x, area->y, area->width, area->height, FALSE); + area->x, area->y, area->width, area->height, FALSE); /* Enable pressure sensitive rate */ if (pressure_options->rate) @@ -309,9 +309,9 @@ gimp_smudge_motion (GimpPaintCore *paint_core, opacity *= PRESSURE_SCALE * paint_core->cur_coords.pressure; gimp_brush_core_replace_canvas (GIMP_BRUSH_CORE (paint_core), drawable, - MIN (opacity, GIMP_OPACITY_OPAQUE), - gimp_context_get_opacity (context), - gimp_paint_options_get_brush_mode (paint_options), + MIN (opacity, GIMP_OPACITY_OPAQUE), + gimp_context_get_opacity (context), + gimp_paint_options_get_brush_mode (paint_options), GIMP_PAINT_INCREMENTAL); } diff --git a/app/pdb/gimppluginprocedure.c b/app/pdb/gimppluginprocedure.c index 031f29f0f7..dbecad4e6c 100644 --- a/app/pdb/gimppluginprocedure.c +++ b/app/pdb/gimppluginprocedure.c @@ -555,77 +555,77 @@ image_types_parse (const gchar *image_types) while (*image_types) { while (*image_types && - ((*image_types == ' ') || - (*image_types == '\t') || - (*image_types == ','))) - image_types++; + ((*image_types == ' ') || + (*image_types == '\t') || + (*image_types == ','))) + image_types++; if (*image_types) - { - if (strncmp (image_types, "RGBA", 4) == 0) - { - types |= PLUG_IN_RGBA_IMAGE; - image_types += 4; - } - else if (strncmp (image_types, "RGB*", 4) == 0) - { - types |= PLUG_IN_RGB_IMAGE | PLUG_IN_RGBA_IMAGE; - image_types += 4; - } - else if (strncmp (image_types, "RGB", 3) == 0) - { - types |= PLUG_IN_RGB_IMAGE; - image_types += 3; - } - else if (strncmp (image_types, "GRAYA", 5) == 0) - { - types |= PLUG_IN_GRAYA_IMAGE; - image_types += 5; - } - else if (strncmp (image_types, "GRAY*", 5) == 0) - { - types |= PLUG_IN_GRAY_IMAGE | PLUG_IN_GRAYA_IMAGE; - image_types += 5; - } - else if (strncmp (image_types, "GRAY", 4) == 0) - { - types |= PLUG_IN_GRAY_IMAGE; - image_types += 4; - } - else if (strncmp (image_types, "INDEXEDA", 8) == 0) - { - types |= PLUG_IN_INDEXEDA_IMAGE; - image_types += 8; - } - else if (strncmp (image_types, "INDEXED*", 8) == 0) - { - types |= PLUG_IN_INDEXED_IMAGE | PLUG_IN_INDEXEDA_IMAGE; - image_types += 8; - } - else if (strncmp (image_types, "INDEXED", 7) == 0) - { - types |= PLUG_IN_INDEXED_IMAGE; - image_types += 7; - } - else if (strncmp (image_types, "*", 1) == 0) - { - types |= PLUG_IN_RGB_IMAGE | PLUG_IN_RGBA_IMAGE - | PLUG_IN_GRAY_IMAGE | PLUG_IN_GRAYA_IMAGE - | PLUG_IN_INDEXED_IMAGE | PLUG_IN_INDEXEDA_IMAGE; - image_types += 1; - } - else - { + { + if (strncmp (image_types, "RGBA", 4) == 0) + { + types |= PLUG_IN_RGBA_IMAGE; + image_types += 4; + } + else if (strncmp (image_types, "RGB*", 4) == 0) + { + types |= PLUG_IN_RGB_IMAGE | PLUG_IN_RGBA_IMAGE; + image_types += 4; + } + else if (strncmp (image_types, "RGB", 3) == 0) + { + types |= PLUG_IN_RGB_IMAGE; + image_types += 3; + } + else if (strncmp (image_types, "GRAYA", 5) == 0) + { + types |= PLUG_IN_GRAYA_IMAGE; + image_types += 5; + } + else if (strncmp (image_types, "GRAY*", 5) == 0) + { + types |= PLUG_IN_GRAY_IMAGE | PLUG_IN_GRAYA_IMAGE; + image_types += 5; + } + else if (strncmp (image_types, "GRAY", 4) == 0) + { + types |= PLUG_IN_GRAY_IMAGE; + image_types += 4; + } + else if (strncmp (image_types, "INDEXEDA", 8) == 0) + { + types |= PLUG_IN_INDEXEDA_IMAGE; + image_types += 8; + } + else if (strncmp (image_types, "INDEXED*", 8) == 0) + { + types |= PLUG_IN_INDEXED_IMAGE | PLUG_IN_INDEXEDA_IMAGE; + image_types += 8; + } + else if (strncmp (image_types, "INDEXED", 7) == 0) + { + types |= PLUG_IN_INDEXED_IMAGE; + image_types += 7; + } + else if (strncmp (image_types, "*", 1) == 0) + { + types |= PLUG_IN_RGB_IMAGE | PLUG_IN_RGBA_IMAGE + | PLUG_IN_GRAY_IMAGE | PLUG_IN_GRAYA_IMAGE + | PLUG_IN_INDEXED_IMAGE | PLUG_IN_INDEXEDA_IMAGE; + image_types += 1; + } + else + { g_printerr ("image_type contains unrecognizable parts: '%s'\n", type_spec); - while (*image_types && + while (*image_types && ((*image_types != ' ') || (*image_types != '\t') || (*image_types != ','))) - image_types++; - } - } + image_types++; + } + } } return types; @@ -662,10 +662,10 @@ extensions_parse (gchar *extensions) extension = strtok (next_token, " \t,"); while (extension) - { - list = g_slist_prepend (list, g_strdup (extension)); - extension = strtok (NULL, " \t,"); - } + { + list = g_slist_prepend (list, g_strdup (extension)); + extension = strtok (NULL, " \t,"); + } g_free (extensions); } diff --git a/app/pdb/gimppluginprocedure.h b/app/pdb/gimppluginprocedure.h index 11b6261de7..845775af11 100644 --- a/app/pdb/gimppluginprocedure.h +++ b/app/pdb/gimppluginprocedure.h @@ -52,7 +52,7 @@ struct _GimpPlugInProcedure gchar *image_types; PlugInImageType image_types_val; time_t mtime; - gboolean installed_during_init; + gboolean installed_during_init; /* file proc specific members */ gboolean file_proc; diff --git a/app/plug-in/gimpplugin-message.c b/app/plug-in/gimpplugin-message.c index 4223612f12..b04fad01df 100644 --- a/app/plug-in/gimpplugin-message.c +++ b/app/plug-in/gimpplugin-message.c @@ -79,9 +79,9 @@ plug_in_handle_message (PlugIn *plug_in, case GP_CONFIG: g_message ("Plug-In \"%s\"\n(%s)\n\n" - "sent a CONFIG message. This should not happen.", + "sent a CONFIG message. This should not happen.", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); + gimp_filename_to_utf8 (plug_in->prog)); plug_in_close (plug_in, TRUE); break; @@ -91,17 +91,17 @@ plug_in_handle_message (PlugIn *plug_in, case GP_TILE_ACK: g_message ("Plug-In \"%s\"\n(%s)\n\n" - "sent a TILE_ACK message. This should not happen.", + "sent a TILE_ACK message. This should not happen.", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); + gimp_filename_to_utf8 (plug_in->prog)); plug_in_close (plug_in, TRUE); break; case GP_TILE_DATA: g_message ("Plug-In \"%s\"\n(%s)\n\n" - "sent a TILE_DATA message. This should not happen.", + "sent a TILE_DATA message. This should not happen.", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); + gimp_filename_to_utf8 (plug_in->prog)); plug_in_close (plug_in, TRUE); break; @@ -115,9 +115,9 @@ plug_in_handle_message (PlugIn *plug_in, case GP_TEMP_PROC_RUN: g_message ("Plug-In \"%s\"\n(%s)\n\n" - "sent a TEMP_PROC_RUN message. This should not happen.", + "sent a TEMP_PROC_RUN message. This should not happen.", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); + gimp_filename_to_utf8 (plug_in->prog)); plug_in_close (plug_in, TRUE); break; @@ -180,25 +180,25 @@ plug_in_handle_tile_req (PlugIn *plug_in, tile_data.data = NULL; if (! gp_tile_data_write (plug_in->my_write, &tile_data, plug_in)) - { - g_warning ("plug_in_handle_tile_req: ERROR"); - plug_in_close (plug_in, TRUE); - return; - } + { + g_warning ("plug_in_handle_tile_req: ERROR"); + plug_in_close (plug_in, TRUE); + return; + } if (! gimp_wire_read_msg (plug_in->my_read, &msg, plug_in)) - { - g_warning ("plug_in_handle_tile_req: ERROR"); - plug_in_close (plug_in, TRUE); - return; - } + { + g_warning ("plug_in_handle_tile_req: ERROR"); + plug_in_close (plug_in, TRUE); + return; + } if (msg.type != GP_TILE_DATA) - { - g_warning ("expected tile data and received: %d", msg.type); - plug_in_close (plug_in, TRUE); - return; - } + { + g_warning ("expected tile data and received: %d", msg.type); + plug_in_close (plug_in, TRUE); + return; + } tile_info = msg.data; @@ -206,38 +206,38 @@ plug_in_handle_tile_req (PlugIn *plug_in, tile_info->drawable_ID); if (! GIMP_IS_DRAWABLE (drawable)) - { + { g_message ("Plug-In \"%s\"\n(%s)\n\n" "requested invalid drawable (killing)", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); - plug_in_close (plug_in, TRUE); - return; - } + gimp_filename_to_utf8 (plug_in->prog)); + plug_in_close (plug_in, TRUE); + return; + } if (tile_info->shadow) - tm = gimp_drawable_get_shadow_tiles (drawable); + tm = gimp_drawable_get_shadow_tiles (drawable); else - tm = gimp_drawable_get_tiles (drawable); + tm = gimp_drawable_get_tiles (drawable); tile = tile_manager_get (tm, tile_info->tile_num, TRUE, TRUE); if (! tile) - { + { g_message ("Plug-In \"%s\"\n(%s)\n\n" "requested invalid tile (killing)", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); - plug_in_close (plug_in, TRUE); - return; - } + gimp_filename_to_utf8 (plug_in->prog)); + plug_in_close (plug_in, TRUE); + return; + } if (tile_data.use_shm) - memcpy (tile_data_pointer (tile, 0, 0), + memcpy (tile_data_pointer (tile, 0, 0), plug_in_shm_get_addr (plug_in->gimp), tile_size (tile)); else - memcpy (tile_data_pointer (tile, 0, 0), + memcpy (tile_data_pointer (tile, 0, 0), tile_info->data, tile_size (tile)); @@ -245,11 +245,11 @@ plug_in_handle_tile_req (PlugIn *plug_in, gimp_wire_destroy (&msg); if (! gp_tile_ack_write (plug_in->my_write, plug_in)) - { - g_warning ("plug_in_handle_tile_req: ERROR"); - plug_in_close (plug_in, TRUE); - return; - } + { + g_warning ("plug_in_handle_tile_req: ERROR"); + plug_in_close (plug_in, TRUE); + return; + } } else { @@ -259,31 +259,31 @@ plug_in_handle_tile_req (PlugIn *plug_in, tile_req->drawable_ID); if (! GIMP_IS_DRAWABLE (drawable)) - { + { g_message ("Plug-In \"%s\"\n(%s)\n\n" "requested invalid drawable (killing)", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); - plug_in_close (plug_in, TRUE); - return; - } + gimp_filename_to_utf8 (plug_in->prog)); + plug_in_close (plug_in, TRUE); + return; + } if (tile_req->shadow) - tm = gimp_drawable_get_shadow_tiles (drawable); + tm = gimp_drawable_get_shadow_tiles (drawable); else - tm = gimp_drawable_get_tiles (drawable); + tm = gimp_drawable_get_tiles (drawable); tile = tile_manager_get (tm, tile_req->tile_num, TRUE, FALSE); if (! tile) - { + { g_message ("Plug-In \"%s\"\n(%s)\n\n" "requested invalid tile (killing)", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); - plug_in_close (plug_in, TRUE); - return; - } + gimp_filename_to_utf8 (plug_in->prog)); + plug_in_close (plug_in, TRUE); + return; + } tile_data.drawable_ID = tile_req->drawable_ID; tile_data.tile_num = tile_req->tile_num; @@ -294,34 +294,34 @@ plug_in_handle_tile_req (PlugIn *plug_in, tile_data.use_shm = (shm_ID == -1) ? FALSE : TRUE; if (tile_data.use_shm) - memcpy (plug_in_shm_get_addr (plug_in->gimp), + memcpy (plug_in_shm_get_addr (plug_in->gimp), tile_data_pointer (tile, 0, 0), tile_size (tile)); else - tile_data.data = tile_data_pointer (tile, 0, 0); + tile_data.data = tile_data_pointer (tile, 0, 0); if (! gp_tile_data_write (plug_in->my_write, &tile_data, plug_in)) - { - g_message ("plug_in_handle_tile_req: ERROR"); - plug_in_close (plug_in, TRUE); - return; - } + { + g_message ("plug_in_handle_tile_req: ERROR"); + plug_in_close (plug_in, TRUE); + return; + } tile_release (tile, FALSE); if (! gimp_wire_read_msg (plug_in->my_read, &msg, plug_in)) - { - g_message ("plug_in_handle_tile_req: ERROR"); - plug_in_close (plug_in, TRUE); - return; - } + { + g_message ("plug_in_handle_tile_req: ERROR"); + plug_in_close (plug_in, TRUE); + return; + } if (msg.type != GP_TILE_ACK) - { - g_warning ("expected tile ack and received: %d", msg.type); - plug_in_close (plug_in, TRUE); - return; - } + { + g_warning ("expected tile ack and received: %d", msg.type); + plug_in_close (plug_in, TRUE); + return; + } gimp_wire_destroy (&msg); } @@ -360,7 +360,7 @@ plug_in_handle_proc_run (PlugIn *plug_in, "called deprecated procedure '%s'.\n" "It should call '%s' instead!", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog), + gimp_filename_to_utf8 (plug_in->prog), canonical, proc_name); } } @@ -476,10 +476,10 @@ plug_in_handle_temp_proc_return (PlugIn *plug_in, else { g_message ("Plug-In \"%s\"\n(%s)\n\n" - "sent a TEMP_PROC_RETURN message while not running " + "sent a TEMP_PROC_RETURN message while not running " "a temporary procedure. This should not happen.", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); + gimp_filename_to_utf8 (plug_in->prog)); plug_in_close (plug_in, TRUE); } } @@ -501,22 +501,22 @@ plug_in_handle_proc_install (PlugIn *plug_in, for (i = 1; i < proc_install->nparams; i++) { if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY || - proc_install->params[i].type == GIMP_PDB_INT8ARRAY || - proc_install->params[i].type == GIMP_PDB_FLOATARRAY || - proc_install->params[i].type == GIMP_PDB_STRINGARRAY) + proc_install->params[i].type == GIMP_PDB_INT8ARRAY || + proc_install->params[i].type == GIMP_PDB_FLOATARRAY || + proc_install->params[i].type == GIMP_PDB_STRINGARRAY) && - proc_install->params[i - 1].type != GIMP_PDB_INT32) - { - g_message ("Plug-In \"%s\"\n(%s)\n\n" + proc_install->params[i - 1].type != GIMP_PDB_INT32) + { + g_message ("Plug-In \"%s\"\n(%s)\n\n" "attempted to install procedure \"%s\" " "which fails to comply with the array parameter " "passing standard. Argument %d is noncompliant.", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog), + gimp_filename_to_utf8 (plug_in->prog), canonical, i); g_free (canonical); - return; - } + return; + } } /* Sanity check strings for UTF-8 validity */ @@ -559,7 +559,7 @@ plug_in_handle_proc_install (PlugIn *plug_in, g_message ("Plug-In \"%s\"\n(%s)\n\n" "attempted to install a procedure with invalid UTF-8 strings.", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); + gimp_filename_to_utf8 (plug_in->prog)); g_free (canonical); return; } @@ -695,10 +695,10 @@ plug_in_handle_extension_ack (PlugIn *plug_in) else { g_message ("Plug-In \"%s\"\n(%s)\n\n" - "sent an EXTENSION_ACK message while not being started " + "sent an EXTENSION_ACK message while not being started " "as an extension. This should not happen.", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); + gimp_filename_to_utf8 (plug_in->prog)); plug_in_close (plug_in, TRUE); } } @@ -713,10 +713,10 @@ plug_in_handle_has_init (PlugIn *plug_in) else { g_message ("Plug-In \"%s\"\n(%s)\n\n" - "sent an HAS_INIT message while not in query(). " + "sent an HAS_INIT message while not in query(). " "This should not happen.", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); + gimp_filename_to_utf8 (plug_in->prog)); plug_in_close (plug_in, TRUE); } } diff --git a/app/plug-in/gimpplugin.c b/app/plug-in/gimpplugin.c index bd006a3a6c..af1852e9a6 100644 --- a/app/plug-in/gimpplugin.c +++ b/app/plug-in/gimpplugin.c @@ -56,10 +56,10 @@ #endif #ifdef G_WITH_CYGWIN -#define O_TEXT 0x0100 /* text file */ -#define _O_TEXT 0x0100 /* text file */ -#define O_BINARY 0x0200 /* binary file */ -#define _O_BINARY 0x0200 /* binary file */ +#define O_TEXT 0x0100 /* text file */ +#define _O_TEXT 0x0100 /* text file */ +#define O_BINARY 0x0200 /* binary file */ +#define _O_BINARY 0x0200 /* binary file */ #endif #endif /* G_OS_WIN32 || G_WITH_CYGWIN */ @@ -178,22 +178,22 @@ plug_in_call_query (Gimp *gimp, plug_in->plug_in_def = plug_in_def; if (plug_in_open (plug_in)) - { - while (plug_in->open) - { + { + while (plug_in->open) + { GimpWireMessage msg; - if (! gimp_wire_read_msg (plug_in->my_read, &msg, plug_in)) + if (! gimp_wire_read_msg (plug_in->my_read, &msg, plug_in)) { plug_in_close (plug_in, TRUE); } - else - { - plug_in_handle_message (plug_in, &msg); - gimp_wire_destroy (&msg); - } - } - } + else + { + plug_in_handle_message (plug_in, &msg); + gimp_wire_destroy (&msg); + } + } + } plug_in_unref (plug_in); } @@ -219,22 +219,22 @@ plug_in_call_init (Gimp *gimp, plug_in->plug_in_def = plug_in_def; if (plug_in_open (plug_in)) - { - while (plug_in->open) - { + { + while (plug_in->open) + { GimpWireMessage msg; - if (! gimp_wire_read_msg (plug_in->my_read, &msg, plug_in)) + if (! gimp_wire_read_msg (plug_in->my_read, &msg, plug_in)) { plug_in_close (plug_in, TRUE); } - else - { - plug_in_handle_message (plug_in, &msg); - gimp_wire_destroy (&msg); - } - } - } + else + { + plug_in_handle_message (plug_in, &msg); + gimp_wire_destroy (&msg); + } + } + } plug_in_unref (plug_in); } @@ -368,7 +368,7 @@ plug_in_open (PlugIn *plug_in) { g_message ("Unable to run plug-in \"%s\"\n(%s)\n\npipe() failed: %s", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog), + gimp_filename_to_utf8 (plug_in->prog), g_strerror (errno)); return FALSE; } @@ -461,11 +461,11 @@ plug_in_open (PlugIn *plug_in) debug_argv = plug_in_debug_argv (gimp, plug_in->name, debug_flag, args); if (debug_argv) - { - debug = TRUE; - argv = debug_argv; - spawn_flags |= G_SPAWN_SEARCH_PATH; - } + { + debug = TRUE; + argv = debug_argv; + spawn_flags |= G_SPAWN_SEARCH_PATH; + } } /* Fork another process. We'll remember the process id so that we @@ -478,7 +478,7 @@ plug_in_open (PlugIn *plug_in) { g_message ("Unable to run plug-in \"%s\"\n(%s)\n\n%s", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog), + gimp_filename_to_utf8 (plug_in->prog), error->message); g_error_free (error); goto cleanup; @@ -527,7 +527,7 @@ cleanup: void plug_in_close (PlugIn *plug_in, - gboolean kill_it) + gboolean kill_it) { Gimp *gimp; #ifndef G_OS_WIN32 @@ -700,8 +700,8 @@ plug_in_close (PlugIn *plug_in, static gboolean plug_in_recv_message (GIOChannel *channel, - GIOCondition cond, - gpointer data) + GIOCondition cond, + gpointer data) { PlugIn *plug_in = data; gboolean got_message = FALSE; @@ -724,32 +724,32 @@ plug_in_recv_message (GIOChannel *channel, memset (&msg, 0, sizeof (GimpWireMessage)); if (! gimp_wire_read_msg (plug_in->my_read, &msg, plug_in)) - { - plug_in_close (plug_in, TRUE); - } + { + plug_in_close (plug_in, TRUE); + } else - { - plug_in_handle_message (plug_in, &msg); - gimp_wire_destroy (&msg); - got_message = TRUE; - } + { + plug_in_handle_message (plug_in, &msg); + gimp_wire_destroy (&msg); + got_message = TRUE; + } } if (cond & (G_IO_ERR | G_IO_HUP)) { if (plug_in->open) - { - plug_in_close (plug_in, TRUE); - } + { + plug_in_close (plug_in, TRUE); + } } if (! got_message) g_message (_("Plug-in crashed: \"%s\"\n(%s)\n\n" - "The dying plug-in may have messed up GIMP's internal state. " - "You may want to save your images and restart GIMP " - "to be on the safe side."), - gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); + "The dying plug-in may have messed up GIMP's internal state. " + "You may want to save your images and restart GIMP " + "to be on the safe side."), + gimp_filename_to_utf8 (plug_in->name), + gimp_filename_to_utf8 (plug_in->prog)); if (! plug_in->open) plug_in_unref (plug_in); @@ -759,8 +759,8 @@ plug_in_recv_message (GIOChannel *channel, static gboolean plug_in_write (GIOChannel *channel, - const guint8 *buf, - gulong count, + const guint8 *buf, + gulong count, gpointer user_data) { PlugIn *plug_in = user_data; @@ -769,21 +769,21 @@ plug_in_write (GIOChannel *channel, while (count > 0) { if ((plug_in->write_buffer_index + count) >= WRITE_BUFFER_SIZE) - { - bytes = WRITE_BUFFER_SIZE - plug_in->write_buffer_index; - memcpy (&plug_in->write_buffer[plug_in->write_buffer_index], + { + bytes = WRITE_BUFFER_SIZE - plug_in->write_buffer_index; + memcpy (&plug_in->write_buffer[plug_in->write_buffer_index], buf, bytes); - plug_in->write_buffer_index += bytes; - if (! gimp_wire_flush (channel, plug_in)) - return FALSE; - } + plug_in->write_buffer_index += bytes; + if (! gimp_wire_flush (channel, plug_in)) + return FALSE; + } else - { - bytes = count; - memcpy (&plug_in->write_buffer[plug_in->write_buffer_index], + { + bytes = count; + memcpy (&plug_in->write_buffer[plug_in->write_buffer_index], buf, bytes); - plug_in->write_buffer_index += bytes; - } + plug_in->write_buffer_index += bytes; + } buf += bytes; count -= bytes; @@ -808,34 +808,34 @@ plug_in_flush (GIOChannel *channel, count = 0; while (count != plug_in->write_buffer_index) { - do - { - bytes = 0; - status = g_io_channel_write_chars (channel, - &plug_in->write_buffer[count], - (plug_in->write_buffer_index - count), - &bytes, - &error); - } - while (status == G_IO_STATUS_AGAIN); + do + { + bytes = 0; + status = g_io_channel_write_chars (channel, + &plug_in->write_buffer[count], + (plug_in->write_buffer_index - count), + &bytes, + &error); + } + while (status == G_IO_STATUS_AGAIN); - if (status != G_IO_STATUS_NORMAL) - { - if (error) - { - g_warning ("%s: plug_in_flush(): error: %s", - gimp_filename_to_utf8 (g_get_prgname ()), - error->message); - g_error_free (error); - } - else - { - g_warning ("%s: plug_in_flush(): error", - gimp_filename_to_utf8 (g_get_prgname ())); - } + if (status != G_IO_STATUS_NORMAL) + { + if (error) + { + g_warning ("%s: plug_in_flush(): error: %s", + gimp_filename_to_utf8 (g_get_prgname ()), + error->message); + g_error_free (error); + } + else + { + g_warning ("%s: plug_in_flush(): error", + gimp_filename_to_utf8 (g_get_prgname ())); + } - return FALSE; - } + return FALSE; + } count += bytes; } diff --git a/app/plug-in/gimpplugindebug.c b/app/plug-in/gimpplugindebug.c index 62a6949f69..31876e44ae 100644 --- a/app/plug-in/gimpplugindebug.c +++ b/app/plug-in/gimpplugindebug.c @@ -117,7 +117,7 @@ plug_in_debug_exit (Gimp *gimp) gchar ** plug_in_debug_argv (Gimp *gimp, - const gchar *name, + const gchar *name, GimpDebugWrapFlag flag, gchar **args) { diff --git a/app/plug-in/gimppluginmanager-call.c b/app/plug-in/gimppluginmanager-call.c index 4bb08f3324..5570fc17e8 100644 --- a/app/plug-in/gimppluginmanager-call.c +++ b/app/plug-in/gimppluginmanager-call.c @@ -54,10 +54,10 @@ plug_in_run (Gimp *gimp, GimpContext *context, GimpProgress *progress, GimpPlugInProcedure *procedure, - GValueArray *args, - gboolean synchronous, - gboolean destroy_return_vals, - gint display_ID) + GValueArray *args, + gboolean synchronous, + gboolean destroy_return_vals, + gint display_ID) { GValueArray *return_vals = NULL; PlugIn *plug_in; @@ -80,7 +80,7 @@ plug_in_run (Gimp *gimp, gint monitor; if (! plug_in_open (plug_in)) - { + { plug_in_unref (plug_in); goto done; } @@ -186,7 +186,7 @@ plug_in_run_temp (Gimp *gimp, GimpContext *context, GimpProgress *progress, GimpTemporaryProcedure *procedure, - GValueArray *args) + GValueArray *args) { GValueArray *return_vals = NULL; PlugIn *plug_in; @@ -212,16 +212,16 @@ plug_in_run_temp (Gimp *gimp, proc_run.params = plug_in_args_to_params (args, FALSE); if (! gp_temp_proc_run_write (plug_in->my_write, &proc_run, plug_in) || - ! gimp_wire_flush (plug_in->my_write, plug_in)) - { + ! gimp_wire_flush (plug_in->my_write, plug_in)) + { g_free (proc_run.params); plug_in_proc_frame_pop (plug_in); - return_vals = + return_vals = gimp_procedure_get_return_values (GIMP_PROCEDURE (procedure), FALSE); - goto done; - } + goto done; + } g_free (proc_run.params); diff --git a/app/plug-in/gimppluginmanager-file.c b/app/plug-in/gimppluginmanager-file.c index 09654d3f83..6314923b06 100644 --- a/app/plug-in/gimppluginmanager-file.c +++ b/app/plug-in/gimppluginmanager-file.c @@ -61,7 +61,7 @@ plug_in_file_register_load_handler (Gimp *gimp, if (! file_proc) { g_message ("attempt to register nonexistent load handler \"%s\"", - name); + name); return FALSE; } @@ -111,7 +111,7 @@ plug_in_file_register_save_handler (Gimp *gimp, if (! file_proc) { g_message ("attempt to register nonexistent save handler \"%s\"", - name); + name); return FALSE; } diff --git a/app/plug-in/gimppluginmanager-run.c b/app/plug-in/gimppluginmanager-run.c index 4bb08f3324..5570fc17e8 100644 --- a/app/plug-in/gimppluginmanager-run.c +++ b/app/plug-in/gimppluginmanager-run.c @@ -54,10 +54,10 @@ plug_in_run (Gimp *gimp, GimpContext *context, GimpProgress *progress, GimpPlugInProcedure *procedure, - GValueArray *args, - gboolean synchronous, - gboolean destroy_return_vals, - gint display_ID) + GValueArray *args, + gboolean synchronous, + gboolean destroy_return_vals, + gint display_ID) { GValueArray *return_vals = NULL; PlugIn *plug_in; @@ -80,7 +80,7 @@ plug_in_run (Gimp *gimp, gint monitor; if (! plug_in_open (plug_in)) - { + { plug_in_unref (plug_in); goto done; } @@ -186,7 +186,7 @@ plug_in_run_temp (Gimp *gimp, GimpContext *context, GimpProgress *progress, GimpTemporaryProcedure *procedure, - GValueArray *args) + GValueArray *args) { GValueArray *return_vals = NULL; PlugIn *plug_in; @@ -212,16 +212,16 @@ plug_in_run_temp (Gimp *gimp, proc_run.params = plug_in_args_to_params (args, FALSE); if (! gp_temp_proc_run_write (plug_in->my_write, &proc_run, plug_in) || - ! gimp_wire_flush (plug_in->my_write, plug_in)) - { + ! gimp_wire_flush (plug_in->my_write, plug_in)) + { g_free (proc_run.params); plug_in_proc_frame_pop (plug_in); - return_vals = + return_vals = gimp_procedure_get_return_values (GIMP_PROCEDURE (procedure), FALSE); - goto done; - } + goto done; + } g_free (proc_run.params); diff --git a/app/plug-in/gimppluginmanager.c b/app/plug-in/gimppluginmanager.c index e87e5e4a9d..6947cb7b21 100644 --- a/app/plug-in/gimppluginmanager.c +++ b/app/plug-in/gimppluginmanager.c @@ -94,7 +94,7 @@ plug_ins_init (Gimp *gimp, gimp_datafiles_read_directories (path, G_FILE_TEST_IS_EXECUTABLE, - plug_ins_add_from_file, + plug_ins_add_from_file, &gimp->plug_in_defs); g_free (path); @@ -225,7 +225,7 @@ plug_ins_init (Gimp *gimp, for (list2 = plug_in_def->procedures; list2; list2 = list2->next) { - plug_ins_procedure_add (gimp, list2->data); + plug_ins_procedure_add (gimp, list2->data); } } @@ -233,7 +233,7 @@ plug_ins_init (Gimp *gimp, if (gimp->write_pluginrc) { if (gimp->be_verbose) - g_print (_("Writing '%s'\n"), gimp_filename_to_utf8 (pluginrc)); + g_print (_("Writing '%s'\n"), gimp_filename_to_utf8 (pluginrc)); if (! plug_in_rc_write (gimp->plug_in_defs, pluginrc, &error)) { @@ -289,9 +289,9 @@ plug_ins_init (Gimp *gimp, GimpPlugInProcedure *proc = list->data; if (proc->prog && - GIMP_PROCEDURE (proc)->proc_type == GIMP_EXTENSION && - GIMP_PROCEDURE (proc)->num_args == 0) - { + GIMP_PROCEDURE (proc)->proc_type == GIMP_EXTENSION && + GIMP_PROCEDURE (proc)->num_args == 0) + { extensions = g_list_prepend (extensions, proc); } } @@ -311,20 +311,20 @@ plug_ins_init (Gimp *gimp, GimpPlugInProcedure *proc = list->data; GValueArray *args; - if (gimp->be_verbose) - g_print (_("Starting extension: '%s'\n"), + if (gimp->be_verbose) + g_print (_("Starting extension: '%s'\n"), GIMP_OBJECT (proc)->name); - status_callback (NULL, GIMP_OBJECT (proc)->name, + status_callback (NULL, GIMP_OBJECT (proc)->name, (gdouble) nth / (gdouble) n_extensions); args = g_value_array_new (0); - gimp_procedure_execute_async (GIMP_PROCEDURE (proc), + gimp_procedure_execute_async (GIMP_PROCEDURE (proc), gimp, context, NULL, args, -1); g_value_array_free (args); - } + } g_list_free (extensions); } @@ -470,14 +470,14 @@ plug_ins_add_from_file (const GimpDatafileData *file_data, plug_in_name = g_path_get_basename (plug_in_def->prog); if (g_ascii_strcasecmp (file_data->basename, plug_in_name) == 0) - { - g_printerr ("skipping duplicate plug-in: '%s'\n", + { + g_printerr ("skipping duplicate plug-in: '%s'\n", gimp_filename_to_utf8 (file_data->filename)); g_free (plug_in_name); - return; - } + return; + } g_free (plug_in_name); } @@ -524,12 +524,12 @@ plug_ins_add_from_rc (Gimp *gimp, if (! proc->extensions && ! proc->prefixes && ! proc->magics && - proc->menu_paths && - (! strncmp (proc->menu_paths->data, "", 6) || - ! strncmp (proc->menu_paths->data, "", 6))) - { - proc->extensions = g_strdup (""); - } + proc->menu_paths && + (! strncmp (proc->menu_paths->data, "", 6) || + ! strncmp (proc->menu_paths->data, "", 6))) + { + proc->extensions = g_strdup (""); + } } /* Check if the entry mentioned in pluginrc matches an executable @@ -543,26 +543,26 @@ plug_ins_add_from_rc (Gimp *gimp, basename2 = g_path_get_basename (ondisk_plug_in_def->prog); if (! strcmp (basename1, basename2)) - { - if (! g_ascii_strcasecmp (plug_in_def->prog, + { + if (! g_ascii_strcasecmp (plug_in_def->prog, ondisk_plug_in_def->prog) && - (plug_in_def->mtime == ondisk_plug_in_def->mtime)) - { - /* Use pluginrc entry, deleting ondisk entry */ - list->data = plug_in_def; - plug_in_def_free (ondisk_plug_in_def); - } - else - { + (plug_in_def->mtime == ondisk_plug_in_def->mtime)) + { + /* Use pluginrc entry, deleting ondisk entry */ + list->data = plug_in_def; + plug_in_def_free (ondisk_plug_in_def); + } + else + { /* Use ondisk entry, deleting pluginrc entry */ - plug_in_def_free (plug_in_def); - } + plug_in_def_free (plug_in_def); + } - g_free (basename2); - g_free (basename1); + g_free (basename2); + g_free (basename1); - return; - } + return; + } g_free (basename2); } diff --git a/app/plug-in/gimppluginprocedure.c b/app/plug-in/gimppluginprocedure.c index 031f29f0f7..dbecad4e6c 100644 --- a/app/plug-in/gimppluginprocedure.c +++ b/app/plug-in/gimppluginprocedure.c @@ -555,77 +555,77 @@ image_types_parse (const gchar *image_types) while (*image_types) { while (*image_types && - ((*image_types == ' ') || - (*image_types == '\t') || - (*image_types == ','))) - image_types++; + ((*image_types == ' ') || + (*image_types == '\t') || + (*image_types == ','))) + image_types++; if (*image_types) - { - if (strncmp (image_types, "RGBA", 4) == 0) - { - types |= PLUG_IN_RGBA_IMAGE; - image_types += 4; - } - else if (strncmp (image_types, "RGB*", 4) == 0) - { - types |= PLUG_IN_RGB_IMAGE | PLUG_IN_RGBA_IMAGE; - image_types += 4; - } - else if (strncmp (image_types, "RGB", 3) == 0) - { - types |= PLUG_IN_RGB_IMAGE; - image_types += 3; - } - else if (strncmp (image_types, "GRAYA", 5) == 0) - { - types |= PLUG_IN_GRAYA_IMAGE; - image_types += 5; - } - else if (strncmp (image_types, "GRAY*", 5) == 0) - { - types |= PLUG_IN_GRAY_IMAGE | PLUG_IN_GRAYA_IMAGE; - image_types += 5; - } - else if (strncmp (image_types, "GRAY", 4) == 0) - { - types |= PLUG_IN_GRAY_IMAGE; - image_types += 4; - } - else if (strncmp (image_types, "INDEXEDA", 8) == 0) - { - types |= PLUG_IN_INDEXEDA_IMAGE; - image_types += 8; - } - else if (strncmp (image_types, "INDEXED*", 8) == 0) - { - types |= PLUG_IN_INDEXED_IMAGE | PLUG_IN_INDEXEDA_IMAGE; - image_types += 8; - } - else if (strncmp (image_types, "INDEXED", 7) == 0) - { - types |= PLUG_IN_INDEXED_IMAGE; - image_types += 7; - } - else if (strncmp (image_types, "*", 1) == 0) - { - types |= PLUG_IN_RGB_IMAGE | PLUG_IN_RGBA_IMAGE - | PLUG_IN_GRAY_IMAGE | PLUG_IN_GRAYA_IMAGE - | PLUG_IN_INDEXED_IMAGE | PLUG_IN_INDEXEDA_IMAGE; - image_types += 1; - } - else - { + { + if (strncmp (image_types, "RGBA", 4) == 0) + { + types |= PLUG_IN_RGBA_IMAGE; + image_types += 4; + } + else if (strncmp (image_types, "RGB*", 4) == 0) + { + types |= PLUG_IN_RGB_IMAGE | PLUG_IN_RGBA_IMAGE; + image_types += 4; + } + else if (strncmp (image_types, "RGB", 3) == 0) + { + types |= PLUG_IN_RGB_IMAGE; + image_types += 3; + } + else if (strncmp (image_types, "GRAYA", 5) == 0) + { + types |= PLUG_IN_GRAYA_IMAGE; + image_types += 5; + } + else if (strncmp (image_types, "GRAY*", 5) == 0) + { + types |= PLUG_IN_GRAY_IMAGE | PLUG_IN_GRAYA_IMAGE; + image_types += 5; + } + else if (strncmp (image_types, "GRAY", 4) == 0) + { + types |= PLUG_IN_GRAY_IMAGE; + image_types += 4; + } + else if (strncmp (image_types, "INDEXEDA", 8) == 0) + { + types |= PLUG_IN_INDEXEDA_IMAGE; + image_types += 8; + } + else if (strncmp (image_types, "INDEXED*", 8) == 0) + { + types |= PLUG_IN_INDEXED_IMAGE | PLUG_IN_INDEXEDA_IMAGE; + image_types += 8; + } + else if (strncmp (image_types, "INDEXED", 7) == 0) + { + types |= PLUG_IN_INDEXED_IMAGE; + image_types += 7; + } + else if (strncmp (image_types, "*", 1) == 0) + { + types |= PLUG_IN_RGB_IMAGE | PLUG_IN_RGBA_IMAGE + | PLUG_IN_GRAY_IMAGE | PLUG_IN_GRAYA_IMAGE + | PLUG_IN_INDEXED_IMAGE | PLUG_IN_INDEXEDA_IMAGE; + image_types += 1; + } + else + { g_printerr ("image_type contains unrecognizable parts: '%s'\n", type_spec); - while (*image_types && + while (*image_types && ((*image_types != ' ') || (*image_types != '\t') || (*image_types != ','))) - image_types++; - } - } + image_types++; + } + } } return types; @@ -662,10 +662,10 @@ extensions_parse (gchar *extensions) extension = strtok (next_token, " \t,"); while (extension) - { - list = g_slist_prepend (list, g_strdup (extension)); - extension = strtok (NULL, " \t,"); - } + { + list = g_slist_prepend (list, g_strdup (extension)); + extension = strtok (NULL, " \t,"); + } g_free (extensions); } diff --git a/app/plug-in/gimppluginprocedure.h b/app/plug-in/gimppluginprocedure.h index 11b6261de7..845775af11 100644 --- a/app/plug-in/gimppluginprocedure.h +++ b/app/plug-in/gimppluginprocedure.h @@ -52,7 +52,7 @@ struct _GimpPlugInProcedure gchar *image_types; PlugInImageType image_types_val; time_t mtime; - gboolean installed_during_init; + gboolean installed_during_init; /* file proc specific members */ gboolean file_proc; diff --git a/app/plug-in/gimppluginprocframe.c b/app/plug-in/gimppluginprocframe.c index f632d35e5a..33b5ae90ce 100644 --- a/app/plug-in/gimppluginprocframe.c +++ b/app/plug-in/gimppluginprocframe.c @@ -169,7 +169,7 @@ plug_in_proc_frame_get_return_vals (PlugInProcFrame *proc_frame) /* Copy all of the arguments we can. */ memcpy (return_vals->values, proc_frame->return_vals->values, - sizeof (GValue) * MIN (proc_frame->return_vals->n_values, + sizeof (GValue) * MIN (proc_frame->return_vals->n_values, proc_frame->procedure->num_values + 1)); /* Free the old argument pointer. This will cause a memory leak diff --git a/app/plug-in/gimppluginshm.c b/app/plug-in/gimppluginshm.c index a99d74f262..0a079165ff 100644 --- a/app/plug-in/gimppluginshm.c +++ b/app/plug-in/gimppluginshm.c @@ -205,9 +205,9 @@ plug_in_shm_init (Gimp *gimp) /* Verify that we mapped our view */ if (gimp->plug_in_shm->shm_addr != MAP_FAILED) - { - gimp->plug_in_shm->shm_ID = pid; - } + { + gimp->plug_in_shm->shm_ID = pid; + } else { g_warning ("mmap() failed: %s\n" ERRMSG_SHM_DISABLE, diff --git a/app/plug-in/plug-in-debug.c b/app/plug-in/plug-in-debug.c index 62a6949f69..31876e44ae 100644 --- a/app/plug-in/plug-in-debug.c +++ b/app/plug-in/plug-in-debug.c @@ -117,7 +117,7 @@ plug_in_debug_exit (Gimp *gimp) gchar ** plug_in_debug_argv (Gimp *gimp, - const gchar *name, + const gchar *name, GimpDebugWrapFlag flag, gchar **args) { diff --git a/app/plug-in/plug-in-file.c b/app/plug-in/plug-in-file.c index 09654d3f83..6314923b06 100644 --- a/app/plug-in/plug-in-file.c +++ b/app/plug-in/plug-in-file.c @@ -61,7 +61,7 @@ plug_in_file_register_load_handler (Gimp *gimp, if (! file_proc) { g_message ("attempt to register nonexistent load handler \"%s\"", - name); + name); return FALSE; } @@ -111,7 +111,7 @@ plug_in_file_register_save_handler (Gimp *gimp, if (! file_proc) { g_message ("attempt to register nonexistent save handler \"%s\"", - name); + name); return FALSE; } diff --git a/app/plug-in/plug-in-message.c b/app/plug-in/plug-in-message.c index 4223612f12..b04fad01df 100644 --- a/app/plug-in/plug-in-message.c +++ b/app/plug-in/plug-in-message.c @@ -79,9 +79,9 @@ plug_in_handle_message (PlugIn *plug_in, case GP_CONFIG: g_message ("Plug-In \"%s\"\n(%s)\n\n" - "sent a CONFIG message. This should not happen.", + "sent a CONFIG message. This should not happen.", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); + gimp_filename_to_utf8 (plug_in->prog)); plug_in_close (plug_in, TRUE); break; @@ -91,17 +91,17 @@ plug_in_handle_message (PlugIn *plug_in, case GP_TILE_ACK: g_message ("Plug-In \"%s\"\n(%s)\n\n" - "sent a TILE_ACK message. This should not happen.", + "sent a TILE_ACK message. This should not happen.", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); + gimp_filename_to_utf8 (plug_in->prog)); plug_in_close (plug_in, TRUE); break; case GP_TILE_DATA: g_message ("Plug-In \"%s\"\n(%s)\n\n" - "sent a TILE_DATA message. This should not happen.", + "sent a TILE_DATA message. This should not happen.", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); + gimp_filename_to_utf8 (plug_in->prog)); plug_in_close (plug_in, TRUE); break; @@ -115,9 +115,9 @@ plug_in_handle_message (PlugIn *plug_in, case GP_TEMP_PROC_RUN: g_message ("Plug-In \"%s\"\n(%s)\n\n" - "sent a TEMP_PROC_RUN message. This should not happen.", + "sent a TEMP_PROC_RUN message. This should not happen.", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); + gimp_filename_to_utf8 (plug_in->prog)); plug_in_close (plug_in, TRUE); break; @@ -180,25 +180,25 @@ plug_in_handle_tile_req (PlugIn *plug_in, tile_data.data = NULL; if (! gp_tile_data_write (plug_in->my_write, &tile_data, plug_in)) - { - g_warning ("plug_in_handle_tile_req: ERROR"); - plug_in_close (plug_in, TRUE); - return; - } + { + g_warning ("plug_in_handle_tile_req: ERROR"); + plug_in_close (plug_in, TRUE); + return; + } if (! gimp_wire_read_msg (plug_in->my_read, &msg, plug_in)) - { - g_warning ("plug_in_handle_tile_req: ERROR"); - plug_in_close (plug_in, TRUE); - return; - } + { + g_warning ("plug_in_handle_tile_req: ERROR"); + plug_in_close (plug_in, TRUE); + return; + } if (msg.type != GP_TILE_DATA) - { - g_warning ("expected tile data and received: %d", msg.type); - plug_in_close (plug_in, TRUE); - return; - } + { + g_warning ("expected tile data and received: %d", msg.type); + plug_in_close (plug_in, TRUE); + return; + } tile_info = msg.data; @@ -206,38 +206,38 @@ plug_in_handle_tile_req (PlugIn *plug_in, tile_info->drawable_ID); if (! GIMP_IS_DRAWABLE (drawable)) - { + { g_message ("Plug-In \"%s\"\n(%s)\n\n" "requested invalid drawable (killing)", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); - plug_in_close (plug_in, TRUE); - return; - } + gimp_filename_to_utf8 (plug_in->prog)); + plug_in_close (plug_in, TRUE); + return; + } if (tile_info->shadow) - tm = gimp_drawable_get_shadow_tiles (drawable); + tm = gimp_drawable_get_shadow_tiles (drawable); else - tm = gimp_drawable_get_tiles (drawable); + tm = gimp_drawable_get_tiles (drawable); tile = tile_manager_get (tm, tile_info->tile_num, TRUE, TRUE); if (! tile) - { + { g_message ("Plug-In \"%s\"\n(%s)\n\n" "requested invalid tile (killing)", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); - plug_in_close (plug_in, TRUE); - return; - } + gimp_filename_to_utf8 (plug_in->prog)); + plug_in_close (plug_in, TRUE); + return; + } if (tile_data.use_shm) - memcpy (tile_data_pointer (tile, 0, 0), + memcpy (tile_data_pointer (tile, 0, 0), plug_in_shm_get_addr (plug_in->gimp), tile_size (tile)); else - memcpy (tile_data_pointer (tile, 0, 0), + memcpy (tile_data_pointer (tile, 0, 0), tile_info->data, tile_size (tile)); @@ -245,11 +245,11 @@ plug_in_handle_tile_req (PlugIn *plug_in, gimp_wire_destroy (&msg); if (! gp_tile_ack_write (plug_in->my_write, plug_in)) - { - g_warning ("plug_in_handle_tile_req: ERROR"); - plug_in_close (plug_in, TRUE); - return; - } + { + g_warning ("plug_in_handle_tile_req: ERROR"); + plug_in_close (plug_in, TRUE); + return; + } } else { @@ -259,31 +259,31 @@ plug_in_handle_tile_req (PlugIn *plug_in, tile_req->drawable_ID); if (! GIMP_IS_DRAWABLE (drawable)) - { + { g_message ("Plug-In \"%s\"\n(%s)\n\n" "requested invalid drawable (killing)", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); - plug_in_close (plug_in, TRUE); - return; - } + gimp_filename_to_utf8 (plug_in->prog)); + plug_in_close (plug_in, TRUE); + return; + } if (tile_req->shadow) - tm = gimp_drawable_get_shadow_tiles (drawable); + tm = gimp_drawable_get_shadow_tiles (drawable); else - tm = gimp_drawable_get_tiles (drawable); + tm = gimp_drawable_get_tiles (drawable); tile = tile_manager_get (tm, tile_req->tile_num, TRUE, FALSE); if (! tile) - { + { g_message ("Plug-In \"%s\"\n(%s)\n\n" "requested invalid tile (killing)", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); - plug_in_close (plug_in, TRUE); - return; - } + gimp_filename_to_utf8 (plug_in->prog)); + plug_in_close (plug_in, TRUE); + return; + } tile_data.drawable_ID = tile_req->drawable_ID; tile_data.tile_num = tile_req->tile_num; @@ -294,34 +294,34 @@ plug_in_handle_tile_req (PlugIn *plug_in, tile_data.use_shm = (shm_ID == -1) ? FALSE : TRUE; if (tile_data.use_shm) - memcpy (plug_in_shm_get_addr (plug_in->gimp), + memcpy (plug_in_shm_get_addr (plug_in->gimp), tile_data_pointer (tile, 0, 0), tile_size (tile)); else - tile_data.data = tile_data_pointer (tile, 0, 0); + tile_data.data = tile_data_pointer (tile, 0, 0); if (! gp_tile_data_write (plug_in->my_write, &tile_data, plug_in)) - { - g_message ("plug_in_handle_tile_req: ERROR"); - plug_in_close (plug_in, TRUE); - return; - } + { + g_message ("plug_in_handle_tile_req: ERROR"); + plug_in_close (plug_in, TRUE); + return; + } tile_release (tile, FALSE); if (! gimp_wire_read_msg (plug_in->my_read, &msg, plug_in)) - { - g_message ("plug_in_handle_tile_req: ERROR"); - plug_in_close (plug_in, TRUE); - return; - } + { + g_message ("plug_in_handle_tile_req: ERROR"); + plug_in_close (plug_in, TRUE); + return; + } if (msg.type != GP_TILE_ACK) - { - g_warning ("expected tile ack and received: %d", msg.type); - plug_in_close (plug_in, TRUE); - return; - } + { + g_warning ("expected tile ack and received: %d", msg.type); + plug_in_close (plug_in, TRUE); + return; + } gimp_wire_destroy (&msg); } @@ -360,7 +360,7 @@ plug_in_handle_proc_run (PlugIn *plug_in, "called deprecated procedure '%s'.\n" "It should call '%s' instead!", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog), + gimp_filename_to_utf8 (plug_in->prog), canonical, proc_name); } } @@ -476,10 +476,10 @@ plug_in_handle_temp_proc_return (PlugIn *plug_in, else { g_message ("Plug-In \"%s\"\n(%s)\n\n" - "sent a TEMP_PROC_RETURN message while not running " + "sent a TEMP_PROC_RETURN message while not running " "a temporary procedure. This should not happen.", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); + gimp_filename_to_utf8 (plug_in->prog)); plug_in_close (plug_in, TRUE); } } @@ -501,22 +501,22 @@ plug_in_handle_proc_install (PlugIn *plug_in, for (i = 1; i < proc_install->nparams; i++) { if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY || - proc_install->params[i].type == GIMP_PDB_INT8ARRAY || - proc_install->params[i].type == GIMP_PDB_FLOATARRAY || - proc_install->params[i].type == GIMP_PDB_STRINGARRAY) + proc_install->params[i].type == GIMP_PDB_INT8ARRAY || + proc_install->params[i].type == GIMP_PDB_FLOATARRAY || + proc_install->params[i].type == GIMP_PDB_STRINGARRAY) && - proc_install->params[i - 1].type != GIMP_PDB_INT32) - { - g_message ("Plug-In \"%s\"\n(%s)\n\n" + proc_install->params[i - 1].type != GIMP_PDB_INT32) + { + g_message ("Plug-In \"%s\"\n(%s)\n\n" "attempted to install procedure \"%s\" " "which fails to comply with the array parameter " "passing standard. Argument %d is noncompliant.", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog), + gimp_filename_to_utf8 (plug_in->prog), canonical, i); g_free (canonical); - return; - } + return; + } } /* Sanity check strings for UTF-8 validity */ @@ -559,7 +559,7 @@ plug_in_handle_proc_install (PlugIn *plug_in, g_message ("Plug-In \"%s\"\n(%s)\n\n" "attempted to install a procedure with invalid UTF-8 strings.", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); + gimp_filename_to_utf8 (plug_in->prog)); g_free (canonical); return; } @@ -695,10 +695,10 @@ plug_in_handle_extension_ack (PlugIn *plug_in) else { g_message ("Plug-In \"%s\"\n(%s)\n\n" - "sent an EXTENSION_ACK message while not being started " + "sent an EXTENSION_ACK message while not being started " "as an extension. This should not happen.", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); + gimp_filename_to_utf8 (plug_in->prog)); plug_in_close (plug_in, TRUE); } } @@ -713,10 +713,10 @@ plug_in_handle_has_init (PlugIn *plug_in) else { g_message ("Plug-In \"%s\"\n(%s)\n\n" - "sent an HAS_INIT message while not in query(). " + "sent an HAS_INIT message while not in query(). " "This should not happen.", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); + gimp_filename_to_utf8 (plug_in->prog)); plug_in_close (plug_in, TRUE); } } diff --git a/app/plug-in/plug-in-params.c b/app/plug-in/plug-in-params.c index b0fe2d7e68..649f10f457 100644 --- a/app/plug-in/plug-in-params.c +++ b/app/plug-in/plug-in-params.c @@ -37,9 +37,9 @@ GValueArray * plug_in_params_to_args (GParamSpec **pspecs, gint n_pspecs, GPParam *params, - gint n_params, + gint n_params, gboolean return_values, - gboolean full_copy) + gboolean full_copy) { GValueArray *args; gint i; @@ -79,8 +79,8 @@ plug_in_params_to_args (GParamSpec **pspecs, g_value_init (&value, type); switch (gimp_pdb_compat_arg_type_from_gtype (type)) - { - case GIMP_PDB_INT32: + { + case GIMP_PDB_INT32: if (G_VALUE_HOLDS_INT (&value)) g_value_set_int (&value, params[i].data.d_int32); else if (G_VALUE_HOLDS_UINT (&value)) @@ -95,28 +95,28 @@ plug_in_params_to_args (GParamSpec **pspecs, G_STRFUNC, g_type_name (G_VALUE_TYPE (&value))); g_return_val_if_reached (args); } - break; + break; - case GIMP_PDB_INT16: - g_value_set_int (&value, params[i].data.d_int16); - break; + case GIMP_PDB_INT16: + g_value_set_int (&value, params[i].data.d_int16); + break; - case GIMP_PDB_INT8: - g_value_set_uint (&value, params[i].data.d_int8); - break; + case GIMP_PDB_INT8: + g_value_set_uint (&value, params[i].data.d_int8); + break; - case GIMP_PDB_FLOAT: - g_value_set_double (&value, params[i].data.d_float); - break; + case GIMP_PDB_FLOAT: + g_value_set_double (&value, params[i].data.d_float); + break; - case GIMP_PDB_STRING: - if (full_copy) - g_value_set_string (&value, params[i].data.d_string); - else - g_value_set_static_string (&value, params[i].data.d_string); - break; + case GIMP_PDB_STRING: + if (full_copy) + g_value_set_string (&value, params[i].data.d_string); + else + g_value_set_static_string (&value, params[i].data.d_string); + break; - case GIMP_PDB_INT32ARRAY: + case GIMP_PDB_INT32ARRAY: count = g_value_get_int (&args->values[i - 1]); if (full_copy) gimp_value_set_int32array (&value, @@ -126,9 +126,9 @@ plug_in_params_to_args (GParamSpec **pspecs, gimp_value_set_static_int32array (&value, params[i].data.d_int32array, count); - break; + break; - case GIMP_PDB_INT16ARRAY: + case GIMP_PDB_INT16ARRAY: count = g_value_get_int (&args->values[i - 1]); if (full_copy) gimp_value_set_int16array (&value, @@ -138,9 +138,9 @@ plug_in_params_to_args (GParamSpec **pspecs, gimp_value_set_static_int16array (&value, params[i].data.d_int16array, count); - break; + break; - case GIMP_PDB_INT8ARRAY: + case GIMP_PDB_INT8ARRAY: count = g_value_get_int (&args->values[i - 1]); if (full_copy) gimp_value_set_int8array (&value, @@ -150,9 +150,9 @@ plug_in_params_to_args (GParamSpec **pspecs, gimp_value_set_static_int8array (&value, (guint8 *) params[i].data.d_int8array, count); - break; + break; - case GIMP_PDB_FLOATARRAY: + case GIMP_PDB_FLOATARRAY: count = g_value_get_int (&args->values[i - 1]); if (full_copy) gimp_value_set_floatarray (&value, @@ -162,9 +162,9 @@ plug_in_params_to_args (GParamSpec **pspecs, gimp_value_set_static_floatarray (&value, params[i].data.d_floatarray, count); - break; + break; - case GIMP_PDB_STRINGARRAY: + case GIMP_PDB_STRINGARRAY: count = g_value_get_int (&args->values[i - 1]); if (full_copy) gimp_value_set_stringarray (&value, @@ -174,62 +174,62 @@ plug_in_params_to_args (GParamSpec **pspecs, gimp_value_set_static_stringarray (&value, (const gchar **) params[i].data.d_stringarray, count); - break; + break; - case GIMP_PDB_COLOR: - gimp_value_set_rgb (&value, ¶ms[i].data.d_color); - break; + case GIMP_PDB_COLOR: + gimp_value_set_rgb (&value, ¶ms[i].data.d_color); + break; - case GIMP_PDB_REGION: - g_message ("the \"region\" argument type is not supported"); - break; + case GIMP_PDB_REGION: + g_message ("the \"region\" argument type is not supported"); + break; - case GIMP_PDB_DISPLAY: - g_value_set_int (&value, params[i].data.d_display); - break; + case GIMP_PDB_DISPLAY: + g_value_set_int (&value, params[i].data.d_display); + break; - case GIMP_PDB_IMAGE: - g_value_set_int (&value, params[i].data.d_image); - break; + case GIMP_PDB_IMAGE: + g_value_set_int (&value, params[i].data.d_image); + break; - case GIMP_PDB_LAYER: - g_value_set_int (&value, params[i].data.d_layer); - break; + case GIMP_PDB_LAYER: + g_value_set_int (&value, params[i].data.d_layer); + break; - case GIMP_PDB_CHANNEL: - g_value_set_int (&value, params[i].data.d_channel); - break; + case GIMP_PDB_CHANNEL: + g_value_set_int (&value, params[i].data.d_channel); + break; - case GIMP_PDB_DRAWABLE: - g_value_set_int (&value, params[i].data.d_drawable); - break; + case GIMP_PDB_DRAWABLE: + g_value_set_int (&value, params[i].data.d_drawable); + break; - case GIMP_PDB_SELECTION: - g_value_set_int (&value, params[i].data.d_selection); - break; + case GIMP_PDB_SELECTION: + g_value_set_int (&value, params[i].data.d_selection); + break; - case GIMP_PDB_BOUNDARY: - g_message ("the \"boundary\" arg type is not currently supported"); - break; + case GIMP_PDB_BOUNDARY: + g_message ("the \"boundary\" arg type is not currently supported"); + break; - case GIMP_PDB_VECTORS: - g_value_set_int (&value, params[i].data.d_vectors); - break; + case GIMP_PDB_VECTORS: + g_value_set_int (&value, params[i].data.d_vectors); + break; - case GIMP_PDB_PARASITE: - if (full_copy) - g_value_set_boxed (&value, ¶ms[i].data.d_parasite); - else - g_value_set_static_boxed (&value, ¶ms[i].data.d_parasite); - break; + case GIMP_PDB_PARASITE: + if (full_copy) + g_value_set_boxed (&value, ¶ms[i].data.d_parasite); + else + g_value_set_static_boxed (&value, ¶ms[i].data.d_parasite); + break; - case GIMP_PDB_STATUS: - g_value_set_enum (&value, params[i].data.d_status); - break; + case GIMP_PDB_STATUS: + g_value_set_enum (&value, params[i].data.d_status); + break; - case GIMP_PDB_END: - break; - } + case GIMP_PDB_END: + break; + } g_value_array_append (args, &value); g_value_unset (&value); @@ -240,7 +240,7 @@ plug_in_params_to_args (GParamSpec **pspecs, GPParam * plug_in_args_to_params (GValueArray *args, - gboolean full_copy) + gboolean full_copy) { GPParam *params; gint i; @@ -257,8 +257,8 @@ plug_in_args_to_params (GValueArray *args, gimp_pdb_compat_arg_type_from_gtype (G_VALUE_TYPE (value)); switch (params[i].type) - { - case GIMP_PDB_INT32: + { + case GIMP_PDB_INT32: if (G_VALUE_HOLDS_INT (value)) params[i].data.d_int32 = g_value_get_int (value); else if (G_VALUE_HOLDS_UINT (value)) @@ -273,103 +273,103 @@ plug_in_args_to_params (GValueArray *args, G_STRFUNC, g_type_name (G_VALUE_TYPE (value))); g_return_val_if_reached (params); } - break; + break; - case GIMP_PDB_INT16: - params[i].data.d_int16 = g_value_get_int (value); - break; + case GIMP_PDB_INT16: + params[i].data.d_int16 = g_value_get_int (value); + break; - case GIMP_PDB_INT8: - params[i].data.d_int8 = g_value_get_uint (value); - break; + case GIMP_PDB_INT8: + params[i].data.d_int8 = g_value_get_uint (value); + break; - case GIMP_PDB_FLOAT: - params[i].data.d_float = g_value_get_double (value); - break; + case GIMP_PDB_FLOAT: + params[i].data.d_float = g_value_get_double (value); + break; - case GIMP_PDB_STRING: - if (full_copy) - params[i].data.d_string = g_value_dup_string (value); - else - params[i].data.d_string = (gchar *) g_value_get_string (value); - break; + case GIMP_PDB_STRING: + if (full_copy) + params[i].data.d_string = g_value_dup_string (value); + else + params[i].data.d_string = (gchar *) g_value_get_string (value); + break; - case GIMP_PDB_INT32ARRAY: - if (full_copy) + case GIMP_PDB_INT32ARRAY: + if (full_copy) params[i].data.d_int32array = gimp_value_dup_int32array (value); else params[i].data.d_int32array = (gint32 *) gimp_value_get_int32array (value); - break; + break; - case GIMP_PDB_INT16ARRAY: - if (full_copy) + case GIMP_PDB_INT16ARRAY: + if (full_copy) params[i].data.d_int16array = gimp_value_dup_int16array (value); else params[i].data.d_int16array = (gint16 *) gimp_value_get_int16array (value); - break; + break; - case GIMP_PDB_INT8ARRAY: - if (full_copy) + case GIMP_PDB_INT8ARRAY: + if (full_copy) params[i].data.d_int8array = (gint8 *) gimp_value_dup_int8array (value); else params[i].data.d_int8array = (gint8 *) gimp_value_get_int8array (value); - break; + break; - case GIMP_PDB_FLOATARRAY: - if (full_copy) + case GIMP_PDB_FLOATARRAY: + if (full_copy) params[i].data.d_floatarray = gimp_value_dup_floatarray (value); else params[i].data.d_floatarray = (gdouble *) gimp_value_get_floatarray (value); - break; + break; - case GIMP_PDB_STRINGARRAY: - if (full_copy) + case GIMP_PDB_STRINGARRAY: + if (full_copy) params[i].data.d_stringarray = gimp_value_dup_stringarray (value); else params[i].data.d_stringarray = (gchar **) gimp_value_get_stringarray (value); - break; + break; - case GIMP_PDB_COLOR: - gimp_value_get_rgb (value, ¶ms[i].data.d_color); - break; + case GIMP_PDB_COLOR: + gimp_value_get_rgb (value, ¶ms[i].data.d_color); + break; - case GIMP_PDB_REGION: - g_message ("the \"region\" argument type is not supported"); - break; + case GIMP_PDB_REGION: + g_message ("the \"region\" argument type is not supported"); + break; - case GIMP_PDB_DISPLAY: - params[i].data.d_display = g_value_get_int (value); - break; + case GIMP_PDB_DISPLAY: + params[i].data.d_display = g_value_get_int (value); + break; - case GIMP_PDB_IMAGE: - params[i].data.d_image = g_value_get_int (value); - break; + case GIMP_PDB_IMAGE: + params[i].data.d_image = g_value_get_int (value); + break; - case GIMP_PDB_LAYER: - params[i].data.d_layer = g_value_get_int (value); - break; + case GIMP_PDB_LAYER: + params[i].data.d_layer = g_value_get_int (value); + break; - case GIMP_PDB_CHANNEL: - params[i].data.d_channel = g_value_get_int (value); - break; + case GIMP_PDB_CHANNEL: + params[i].data.d_channel = g_value_get_int (value); + break; - case GIMP_PDB_DRAWABLE: - params[i].data.d_drawable = g_value_get_int (value); - break; + case GIMP_PDB_DRAWABLE: + params[i].data.d_drawable = g_value_get_int (value); + break; - case GIMP_PDB_SELECTION: - params[i].data.d_selection = g_value_get_int (value); - break; + case GIMP_PDB_SELECTION: + params[i].data.d_selection = g_value_get_int (value); + break; - case GIMP_PDB_BOUNDARY: - g_message ("the \"boundary\" arg type is not currently supported"); - break; + case GIMP_PDB_BOUNDARY: + g_message ("the \"boundary\" arg type is not currently supported"); + break; - case GIMP_PDB_VECTORS: - params[i].data.d_vectors = g_value_get_int (value); - break; + case GIMP_PDB_VECTORS: + params[i].data.d_vectors = g_value_get_int (value); + break; - case GIMP_PDB_PARASITE: + case GIMP_PDB_PARASITE: { GimpParasite *parasite = (full_copy ? g_value_dup_boxed (value) : @@ -393,15 +393,15 @@ plug_in_args_to_params (GValueArray *args, params[i].data.d_parasite.data = NULL; } } - break; + break; - case GIMP_PDB_STATUS: - params[i].data.d_status = g_value_get_enum (value); - break; + case GIMP_PDB_STATUS: + params[i].data.d_status = g_value_get_enum (value); + break; - case GIMP_PDB_END: - break; - } + case GIMP_PDB_END: + break; + } } return params; diff --git a/app/plug-in/plug-in-proc-frame.c b/app/plug-in/plug-in-proc-frame.c index f632d35e5a..33b5ae90ce 100644 --- a/app/plug-in/plug-in-proc-frame.c +++ b/app/plug-in/plug-in-proc-frame.c @@ -169,7 +169,7 @@ plug_in_proc_frame_get_return_vals (PlugInProcFrame *proc_frame) /* Copy all of the arguments we can. */ memcpy (return_vals->values, proc_frame->return_vals->values, - sizeof (GValue) * MIN (proc_frame->return_vals->n_values, + sizeof (GValue) * MIN (proc_frame->return_vals->n_values, proc_frame->procedure->num_values + 1)); /* Free the old argument pointer. This will cause a memory leak diff --git a/app/plug-in/plug-in-rc.c b/app/plug-in/plug-in-rc.c index 767fe64404..e63cba8e99 100644 --- a/app/plug-in/plug-in-rc.c +++ b/app/plug-in/plug-in-rc.c @@ -754,12 +754,12 @@ plug_in_rc_write (GSList *plug_in_defs, GSList *list; writer = gimp_config_writer_new_file (filename, - FALSE, - "GIMP pluginrc\n\n" - "This file can safely be removed and " - "will be automatically regenerated by " - "querying the installed plugins.", - error); + FALSE, + "GIMP pluginrc\n\n" + "This file can safely be removed and " + "will be automatically regenerated by " + "querying the installed plugins.", + error); if (!writer) return FALSE; @@ -775,23 +775,23 @@ plug_in_rc_write (GSList *plug_in_defs, PlugInDef *plug_in_def = list->data; if (plug_in_def->procedures) - { + { GSList *list2; gimp_config_writer_open (writer, "plug-in-def"); gimp_config_writer_string (writer, plug_in_def->prog); gimp_config_writer_printf (writer, "%ld", plug_in_def->mtime); - for (list2 = plug_in_def->procedures; list2; list2 = list2->next) - { + for (list2 = plug_in_def->procedures; list2; list2 = list2->next) + { GimpPlugInProcedure *proc = list2->data; GimpProcedure *procedure = GIMP_PROCEDURE (proc); GEnumValue *enum_value; GList *list3; gint i; - if (proc->installed_during_init) - continue; + if (proc->installed_during_init) + continue; gimp_config_writer_open (writer, "proc-def"); gimp_config_writer_printf (writer, "\"%s\" %d", @@ -800,16 +800,16 @@ plug_in_rc_write (GSList *plug_in_defs, gimp_config_writer_linefeed (writer); gimp_config_writer_string (writer, procedure->blurb); gimp_config_writer_linefeed (writer); - gimp_config_writer_string (writer, procedure->help); - gimp_config_writer_linefeed (writer); - gimp_config_writer_string (writer, procedure->author); - gimp_config_writer_linefeed (writer); - gimp_config_writer_string (writer, procedure->copyright); - gimp_config_writer_linefeed (writer); - gimp_config_writer_string (writer, procedure->date); - gimp_config_writer_linefeed (writer); - gimp_config_writer_string (writer, proc->menu_label); - gimp_config_writer_linefeed (writer); + gimp_config_writer_string (writer, procedure->help); + gimp_config_writer_linefeed (writer); + gimp_config_writer_string (writer, procedure->author); + gimp_config_writer_linefeed (writer); + gimp_config_writer_string (writer, procedure->copyright); + gimp_config_writer_linefeed (writer); + gimp_config_writer_string (writer, procedure->date); + gimp_config_writer_linefeed (writer); + gimp_config_writer_string (writer, proc->menu_label); + gimp_config_writer_linefeed (writer); gimp_config_writer_printf (writer, "%d", g_list_length (proc->menu_paths)); @@ -887,82 +887,82 @@ plug_in_rc_write (GSList *plug_in_defs, gimp_config_writer_linefeed (writer); - gimp_config_writer_string (writer, proc->image_types); - gimp_config_writer_linefeed (writer); + gimp_config_writer_string (writer, proc->image_types); + gimp_config_writer_linefeed (writer); - gimp_config_writer_printf (writer, "%d %d", + gimp_config_writer_printf (writer, "%d %d", procedure->num_args, procedure->num_values); - for (i = 0; i < procedure->num_args; i++) - { + for (i = 0; i < procedure->num_args; i++) + { GParamSpec *pspec = procedure->args[i]; gimp_config_writer_open (writer, "proc-arg"); gimp_config_writer_printf (writer, "%d", gimp_pdb_compat_arg_type_from_gtype (G_PARAM_SPEC_VALUE_TYPE (pspec))); - gimp_config_writer_string (writer, + gimp_config_writer_string (writer, g_param_spec_get_name (pspec)); - gimp_config_writer_string (writer, + gimp_config_writer_string (writer, g_param_spec_get_blurb (pspec)); gimp_config_writer_close (writer); - } + } - for (i = 0; i < procedure->num_values; i++) - { + for (i = 0; i < procedure->num_values; i++) + { GParamSpec *pspec = procedure->values[i]; - gimp_config_writer_open (writer, "proc-arg"); + gimp_config_writer_open (writer, "proc-arg"); gimp_config_writer_printf (writer, "%d", gimp_pdb_compat_arg_type_from_gtype (G_PARAM_SPEC_VALUE_TYPE (pspec))); - gimp_config_writer_string (writer, + gimp_config_writer_string (writer, g_param_spec_get_name (pspec)); - gimp_config_writer_string (writer, + gimp_config_writer_string (writer, g_param_spec_get_blurb (pspec)); gimp_config_writer_close (writer); - } + } - gimp_config_writer_close (writer); - } + gimp_config_writer_close (writer); + } - if (plug_in_def->locale_domain_name) - { + if (plug_in_def->locale_domain_name) + { gimp_config_writer_open (writer, "locale-def"); gimp_config_writer_string (writer, plug_in_def->locale_domain_name); - if (plug_in_def->locale_domain_path) - gimp_config_writer_string (writer, + if (plug_in_def->locale_domain_path) + gimp_config_writer_string (writer, plug_in_def->locale_domain_path); gimp_config_writer_close (writer); - } + } - if (plug_in_def->help_domain_name) - { - gimp_config_writer_open (writer, "help-def"); + if (plug_in_def->help_domain_name) + { + gimp_config_writer_open (writer, "help-def"); gimp_config_writer_string (writer, plug_in_def->help_domain_name); - if (plug_in_def->help_domain_uri) - gimp_config_writer_string (writer, + if (plug_in_def->help_domain_uri) + gimp_config_writer_string (writer, plug_in_def->help_domain_uri); gimp_config_writer_close (writer); - } + } - if (plug_in_def->has_init) - { - gimp_config_writer_open (writer, "has-init"); + if (plug_in_def->has_init) + { + gimp_config_writer_open (writer, "has-init"); gimp_config_writer_close (writer); - } + } - gimp_config_writer_close (writer); - } + gimp_config_writer_close (writer); + } } g_type_class_unref (enum_class); diff --git a/app/plug-in/plug-in-run.c b/app/plug-in/plug-in-run.c index 4bb08f3324..5570fc17e8 100644 --- a/app/plug-in/plug-in-run.c +++ b/app/plug-in/plug-in-run.c @@ -54,10 +54,10 @@ plug_in_run (Gimp *gimp, GimpContext *context, GimpProgress *progress, GimpPlugInProcedure *procedure, - GValueArray *args, - gboolean synchronous, - gboolean destroy_return_vals, - gint display_ID) + GValueArray *args, + gboolean synchronous, + gboolean destroy_return_vals, + gint display_ID) { GValueArray *return_vals = NULL; PlugIn *plug_in; @@ -80,7 +80,7 @@ plug_in_run (Gimp *gimp, gint monitor; if (! plug_in_open (plug_in)) - { + { plug_in_unref (plug_in); goto done; } @@ -186,7 +186,7 @@ plug_in_run_temp (Gimp *gimp, GimpContext *context, GimpProgress *progress, GimpTemporaryProcedure *procedure, - GValueArray *args) + GValueArray *args) { GValueArray *return_vals = NULL; PlugIn *plug_in; @@ -212,16 +212,16 @@ plug_in_run_temp (Gimp *gimp, proc_run.params = plug_in_args_to_params (args, FALSE); if (! gp_temp_proc_run_write (plug_in->my_write, &proc_run, plug_in) || - ! gimp_wire_flush (plug_in->my_write, plug_in)) - { + ! gimp_wire_flush (plug_in->my_write, plug_in)) + { g_free (proc_run.params); plug_in_proc_frame_pop (plug_in); - return_vals = + return_vals = gimp_procedure_get_return_values (GIMP_PROCEDURE (procedure), FALSE); - goto done; - } + goto done; + } g_free (proc_run.params); diff --git a/app/plug-in/plug-in-shm.c b/app/plug-in/plug-in-shm.c index a99d74f262..0a079165ff 100644 --- a/app/plug-in/plug-in-shm.c +++ b/app/plug-in/plug-in-shm.c @@ -205,9 +205,9 @@ plug_in_shm_init (Gimp *gimp) /* Verify that we mapped our view */ if (gimp->plug_in_shm->shm_addr != MAP_FAILED) - { - gimp->plug_in_shm->shm_ID = pid; - } + { + gimp->plug_in_shm->shm_ID = pid; + } else { g_warning ("mmap() failed: %s\n" ERRMSG_SHM_DISABLE, diff --git a/app/plug-in/plug-in.c b/app/plug-in/plug-in.c index bd006a3a6c..af1852e9a6 100644 --- a/app/plug-in/plug-in.c +++ b/app/plug-in/plug-in.c @@ -56,10 +56,10 @@ #endif #ifdef G_WITH_CYGWIN -#define O_TEXT 0x0100 /* text file */ -#define _O_TEXT 0x0100 /* text file */ -#define O_BINARY 0x0200 /* binary file */ -#define _O_BINARY 0x0200 /* binary file */ +#define O_TEXT 0x0100 /* text file */ +#define _O_TEXT 0x0100 /* text file */ +#define O_BINARY 0x0200 /* binary file */ +#define _O_BINARY 0x0200 /* binary file */ #endif #endif /* G_OS_WIN32 || G_WITH_CYGWIN */ @@ -178,22 +178,22 @@ plug_in_call_query (Gimp *gimp, plug_in->plug_in_def = plug_in_def; if (plug_in_open (plug_in)) - { - while (plug_in->open) - { + { + while (plug_in->open) + { GimpWireMessage msg; - if (! gimp_wire_read_msg (plug_in->my_read, &msg, plug_in)) + if (! gimp_wire_read_msg (plug_in->my_read, &msg, plug_in)) { plug_in_close (plug_in, TRUE); } - else - { - plug_in_handle_message (plug_in, &msg); - gimp_wire_destroy (&msg); - } - } - } + else + { + plug_in_handle_message (plug_in, &msg); + gimp_wire_destroy (&msg); + } + } + } plug_in_unref (plug_in); } @@ -219,22 +219,22 @@ plug_in_call_init (Gimp *gimp, plug_in->plug_in_def = plug_in_def; if (plug_in_open (plug_in)) - { - while (plug_in->open) - { + { + while (plug_in->open) + { GimpWireMessage msg; - if (! gimp_wire_read_msg (plug_in->my_read, &msg, plug_in)) + if (! gimp_wire_read_msg (plug_in->my_read, &msg, plug_in)) { plug_in_close (plug_in, TRUE); } - else - { - plug_in_handle_message (plug_in, &msg); - gimp_wire_destroy (&msg); - } - } - } + else + { + plug_in_handle_message (plug_in, &msg); + gimp_wire_destroy (&msg); + } + } + } plug_in_unref (plug_in); } @@ -368,7 +368,7 @@ plug_in_open (PlugIn *plug_in) { g_message ("Unable to run plug-in \"%s\"\n(%s)\n\npipe() failed: %s", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog), + gimp_filename_to_utf8 (plug_in->prog), g_strerror (errno)); return FALSE; } @@ -461,11 +461,11 @@ plug_in_open (PlugIn *plug_in) debug_argv = plug_in_debug_argv (gimp, plug_in->name, debug_flag, args); if (debug_argv) - { - debug = TRUE; - argv = debug_argv; - spawn_flags |= G_SPAWN_SEARCH_PATH; - } + { + debug = TRUE; + argv = debug_argv; + spawn_flags |= G_SPAWN_SEARCH_PATH; + } } /* Fork another process. We'll remember the process id so that we @@ -478,7 +478,7 @@ plug_in_open (PlugIn *plug_in) { g_message ("Unable to run plug-in \"%s\"\n(%s)\n\n%s", gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog), + gimp_filename_to_utf8 (plug_in->prog), error->message); g_error_free (error); goto cleanup; @@ -527,7 +527,7 @@ cleanup: void plug_in_close (PlugIn *plug_in, - gboolean kill_it) + gboolean kill_it) { Gimp *gimp; #ifndef G_OS_WIN32 @@ -700,8 +700,8 @@ plug_in_close (PlugIn *plug_in, static gboolean plug_in_recv_message (GIOChannel *channel, - GIOCondition cond, - gpointer data) + GIOCondition cond, + gpointer data) { PlugIn *plug_in = data; gboolean got_message = FALSE; @@ -724,32 +724,32 @@ plug_in_recv_message (GIOChannel *channel, memset (&msg, 0, sizeof (GimpWireMessage)); if (! gimp_wire_read_msg (plug_in->my_read, &msg, plug_in)) - { - plug_in_close (plug_in, TRUE); - } + { + plug_in_close (plug_in, TRUE); + } else - { - plug_in_handle_message (plug_in, &msg); - gimp_wire_destroy (&msg); - got_message = TRUE; - } + { + plug_in_handle_message (plug_in, &msg); + gimp_wire_destroy (&msg); + got_message = TRUE; + } } if (cond & (G_IO_ERR | G_IO_HUP)) { if (plug_in->open) - { - plug_in_close (plug_in, TRUE); - } + { + plug_in_close (plug_in, TRUE); + } } if (! got_message) g_message (_("Plug-in crashed: \"%s\"\n(%s)\n\n" - "The dying plug-in may have messed up GIMP's internal state. " - "You may want to save your images and restart GIMP " - "to be on the safe side."), - gimp_filename_to_utf8 (plug_in->name), - gimp_filename_to_utf8 (plug_in->prog)); + "The dying plug-in may have messed up GIMP's internal state. " + "You may want to save your images and restart GIMP " + "to be on the safe side."), + gimp_filename_to_utf8 (plug_in->name), + gimp_filename_to_utf8 (plug_in->prog)); if (! plug_in->open) plug_in_unref (plug_in); @@ -759,8 +759,8 @@ plug_in_recv_message (GIOChannel *channel, static gboolean plug_in_write (GIOChannel *channel, - const guint8 *buf, - gulong count, + const guint8 *buf, + gulong count, gpointer user_data) { PlugIn *plug_in = user_data; @@ -769,21 +769,21 @@ plug_in_write (GIOChannel *channel, while (count > 0) { if ((plug_in->write_buffer_index + count) >= WRITE_BUFFER_SIZE) - { - bytes = WRITE_BUFFER_SIZE - plug_in->write_buffer_index; - memcpy (&plug_in->write_buffer[plug_in->write_buffer_index], + { + bytes = WRITE_BUFFER_SIZE - plug_in->write_buffer_index; + memcpy (&plug_in->write_buffer[plug_in->write_buffer_index], buf, bytes); - plug_in->write_buffer_index += bytes; - if (! gimp_wire_flush (channel, plug_in)) - return FALSE; - } + plug_in->write_buffer_index += bytes; + if (! gimp_wire_flush (channel, plug_in)) + return FALSE; + } else - { - bytes = count; - memcpy (&plug_in->write_buffer[plug_in->write_buffer_index], + { + bytes = count; + memcpy (&plug_in->write_buffer[plug_in->write_buffer_index], buf, bytes); - plug_in->write_buffer_index += bytes; - } + plug_in->write_buffer_index += bytes; + } buf += bytes; count -= bytes; @@ -808,34 +808,34 @@ plug_in_flush (GIOChannel *channel, count = 0; while (count != plug_in->write_buffer_index) { - do - { - bytes = 0; - status = g_io_channel_write_chars (channel, - &plug_in->write_buffer[count], - (plug_in->write_buffer_index - count), - &bytes, - &error); - } - while (status == G_IO_STATUS_AGAIN); + do + { + bytes = 0; + status = g_io_channel_write_chars (channel, + &plug_in->write_buffer[count], + (plug_in->write_buffer_index - count), + &bytes, + &error); + } + while (status == G_IO_STATUS_AGAIN); - if (status != G_IO_STATUS_NORMAL) - { - if (error) - { - g_warning ("%s: plug_in_flush(): error: %s", - gimp_filename_to_utf8 (g_get_prgname ()), - error->message); - g_error_free (error); - } - else - { - g_warning ("%s: plug_in_flush(): error", - gimp_filename_to_utf8 (g_get_prgname ())); - } + if (status != G_IO_STATUS_NORMAL) + { + if (error) + { + g_warning ("%s: plug_in_flush(): error: %s", + gimp_filename_to_utf8 (g_get_prgname ()), + error->message); + g_error_free (error); + } + else + { + g_warning ("%s: plug_in_flush(): error", + gimp_filename_to_utf8 (g_get_prgname ())); + } - return FALSE; - } + return FALSE; + } count += bytes; } diff --git a/app/plug-in/plug-ins.c b/app/plug-in/plug-ins.c index e87e5e4a9d..6947cb7b21 100644 --- a/app/plug-in/plug-ins.c +++ b/app/plug-in/plug-ins.c @@ -94,7 +94,7 @@ plug_ins_init (Gimp *gimp, gimp_datafiles_read_directories (path, G_FILE_TEST_IS_EXECUTABLE, - plug_ins_add_from_file, + plug_ins_add_from_file, &gimp->plug_in_defs); g_free (path); @@ -225,7 +225,7 @@ plug_ins_init (Gimp *gimp, for (list2 = plug_in_def->procedures; list2; list2 = list2->next) { - plug_ins_procedure_add (gimp, list2->data); + plug_ins_procedure_add (gimp, list2->data); } } @@ -233,7 +233,7 @@ plug_ins_init (Gimp *gimp, if (gimp->write_pluginrc) { if (gimp->be_verbose) - g_print (_("Writing '%s'\n"), gimp_filename_to_utf8 (pluginrc)); + g_print (_("Writing '%s'\n"), gimp_filename_to_utf8 (pluginrc)); if (! plug_in_rc_write (gimp->plug_in_defs, pluginrc, &error)) { @@ -289,9 +289,9 @@ plug_ins_init (Gimp *gimp, GimpPlugInProcedure *proc = list->data; if (proc->prog && - GIMP_PROCEDURE (proc)->proc_type == GIMP_EXTENSION && - GIMP_PROCEDURE (proc)->num_args == 0) - { + GIMP_PROCEDURE (proc)->proc_type == GIMP_EXTENSION && + GIMP_PROCEDURE (proc)->num_args == 0) + { extensions = g_list_prepend (extensions, proc); } } @@ -311,20 +311,20 @@ plug_ins_init (Gimp *gimp, GimpPlugInProcedure *proc = list->data; GValueArray *args; - if (gimp->be_verbose) - g_print (_("Starting extension: '%s'\n"), + if (gimp->be_verbose) + g_print (_("Starting extension: '%s'\n"), GIMP_OBJECT (proc)->name); - status_callback (NULL, GIMP_OBJECT (proc)->name, + status_callback (NULL, GIMP_OBJECT (proc)->name, (gdouble) nth / (gdouble) n_extensions); args = g_value_array_new (0); - gimp_procedure_execute_async (GIMP_PROCEDURE (proc), + gimp_procedure_execute_async (GIMP_PROCEDURE (proc), gimp, context, NULL, args, -1); g_value_array_free (args); - } + } g_list_free (extensions); } @@ -470,14 +470,14 @@ plug_ins_add_from_file (const GimpDatafileData *file_data, plug_in_name = g_path_get_basename (plug_in_def->prog); if (g_ascii_strcasecmp (file_data->basename, plug_in_name) == 0) - { - g_printerr ("skipping duplicate plug-in: '%s'\n", + { + g_printerr ("skipping duplicate plug-in: '%s'\n", gimp_filename_to_utf8 (file_data->filename)); g_free (plug_in_name); - return; - } + return; + } g_free (plug_in_name); } @@ -524,12 +524,12 @@ plug_ins_add_from_rc (Gimp *gimp, if (! proc->extensions && ! proc->prefixes && ! proc->magics && - proc->menu_paths && - (! strncmp (proc->menu_paths->data, "", 6) || - ! strncmp (proc->menu_paths->data, "", 6))) - { - proc->extensions = g_strdup (""); - } + proc->menu_paths && + (! strncmp (proc->menu_paths->data, "", 6) || + ! strncmp (proc->menu_paths->data, "", 6))) + { + proc->extensions = g_strdup (""); + } } /* Check if the entry mentioned in pluginrc matches an executable @@ -543,26 +543,26 @@ plug_ins_add_from_rc (Gimp *gimp, basename2 = g_path_get_basename (ondisk_plug_in_def->prog); if (! strcmp (basename1, basename2)) - { - if (! g_ascii_strcasecmp (plug_in_def->prog, + { + if (! g_ascii_strcasecmp (plug_in_def->prog, ondisk_plug_in_def->prog) && - (plug_in_def->mtime == ondisk_plug_in_def->mtime)) - { - /* Use pluginrc entry, deleting ondisk entry */ - list->data = plug_in_def; - plug_in_def_free (ondisk_plug_in_def); - } - else - { + (plug_in_def->mtime == ondisk_plug_in_def->mtime)) + { + /* Use pluginrc entry, deleting ondisk entry */ + list->data = plug_in_def; + plug_in_def_free (ondisk_plug_in_def); + } + else + { /* Use ondisk entry, deleting pluginrc entry */ - plug_in_def_free (plug_in_def); - } + plug_in_def_free (plug_in_def); + } - g_free (basename2); - g_free (basename1); + g_free (basename2); + g_free (basename1); - return; - } + return; + } g_free (basename2); } diff --git a/app/text/gimptext-bitmap.c b/app/text/gimptext-bitmap.c index de126e5da6..86537f83a7 100644 --- a/app/text/gimptext-bitmap.c +++ b/app/text/gimptext-bitmap.c @@ -39,12 +39,12 @@ void gimp_text_render_bitmap (PangoFont *font, - PangoGlyph glyph, - FT_Int32 flags, - FT_Matrix *trafo, - gint x, - gint y, - FT_Bitmap *bitmap) + PangoGlyph glyph, + FT_Int32 flags, + FT_Matrix *trafo, + gint x, + gint y, + FT_Bitmap *bitmap) { FT_Face face; gint y_start, y_limit, x_start, x_limit; @@ -58,19 +58,19 @@ gimp_text_render_bitmap (PangoFont *font, FT_Load_Glyph (face, (FT_UInt) glyph, flags); FT_Render_Glyph (face->glyph, - (flags & FT_LOAD_TARGET_MONO ? - ft_render_mode_mono : ft_render_mode_normal)); + (flags & FT_LOAD_TARGET_MONO ? + ft_render_mode_mono : ft_render_mode_normal)); x = PANGO_PIXELS (x); y = PANGO_PIXELS (y); x_start = MAX (0, - (x + face->glyph->bitmap_left)); x_limit = MIN (face->glyph->bitmap.width, - bitmap->width - (x + face->glyph->bitmap_left)); + bitmap->width - (x + face->glyph->bitmap_left)); y_start = MAX (0, - (y - face->glyph->bitmap_top)); y_limit = MIN (face->glyph->bitmap.rows, - bitmap->rows - (y - face->glyph->bitmap_top)); + bitmap->rows - (y - face->glyph->bitmap_top)); src = face->glyph->bitmap.buffer + y_start * face->glyph->bitmap.pitch; @@ -83,52 +83,52 @@ gimp_text_render_bitmap (PangoFont *font, case ft_pixel_mode_grays: src += x_start; for (iy = y_start; iy < y_limit; iy++) - { - const guchar *s = src; - guchar *d = dest; + { + const guchar *s = src; + guchar *d = dest; - for (ix = x_start; ix < x_limit; ix++) - { - switch (*s) - { - case 0: - break; - case 0xff: - *d = 0xff; - default: - *d = MIN ((gushort) *d + (const gushort) *s, 0xff); - break; - } + for (ix = x_start; ix < x_limit; ix++) + { + switch (*s) + { + case 0: + break; + case 0xff: + *d = 0xff; + default: + *d = MIN ((gushort) *d + (const gushort) *s, 0xff); + break; + } - s++; - d++; - } + s++; + d++; + } - dest += bitmap->pitch; - src += face->glyph->bitmap.pitch; - } + dest += bitmap->pitch; + src += face->glyph->bitmap.pitch; + } break; case ft_pixel_mode_mono: src += x_start / 8; for (iy = y_start; iy < y_limit; iy++) - { - const guchar *s = src; - guchar *d = dest; + { + const guchar *s = src; + guchar *d = dest; - for (ix = x_start; ix < x_limit; ix++) - { - if ((*s) & (1 << (7 - (ix % 8)))) - *d |= 0xff; + for (ix = x_start; ix < x_limit; ix++) + { + if ((*s) & (1 << (7 - (ix % 8)))) + *d |= 0xff; - if ((ix % 8) == 7) - s++; - d++; - } + if ((ix % 8) == 7) + s++; + d++; + } - dest += bitmap->pitch; - src += face->glyph->bitmap.pitch; - } + dest += bitmap->pitch; + src += face->glyph->bitmap.pitch; + } break; default: diff --git a/app/text/gimptext-bitmap.h b/app/text/gimptext-bitmap.h index 98fe1f6ee8..6f27e6fa3b 100644 --- a/app/text/gimptext-bitmap.h +++ b/app/text/gimptext-bitmap.h @@ -24,12 +24,12 @@ void gimp_text_render_bitmap (PangoFont *font, - PangoGlyph glyph, - FT_Int32 flags, - FT_Matrix *trafo, - gint x, - gint y, - FT_Bitmap *bitmap); + PangoGlyph glyph, + FT_Int32 flags, + FT_Matrix *trafo, + gint x, + gint y, + FT_Bitmap *bitmap); #endif /* __GIMP_TEXT_BITMAP_H__ */ diff --git a/app/text/gimptext-compat.c b/app/text/gimptext-compat.c index d5ab1f6cc2..44df5b6610 100644 --- a/app/text/gimptext-compat.c +++ b/app/text/gimptext-compat.c @@ -48,14 +48,14 @@ GimpLayer * text_render (GimpImage *image, - GimpDrawable *drawable, + GimpDrawable *drawable, GimpContext *context, - gint text_x, - gint text_y, - const gchar *fontname, - const gchar *text, - gint border, - gboolean antialias) + gint text_x, + gint text_y, + const gchar *fontname, + const gchar *text, + gint border, + gboolean antialias) { PangoFontDescription *desc; GimpText *gtext; @@ -89,7 +89,7 @@ text_render (GimpImage *image, "text", text, "font", font, "font-size", size, - "antialias", antialias, + "antialias", antialias, "border", border, "color", &color, NULL); @@ -133,11 +133,11 @@ text_render (GimpImage *image, gboolean text_get_extents (const gchar *fontname, - const gchar *text, - gint *width, - gint *height, - gint *ascent, - gint *descent) + const gchar *text, + gint *width, + gint *height, + gint *ascent, + gint *descent) { PangoFontDescription *font_desc; PangoContext *context; diff --git a/app/text/gimptext-compat.h b/app/text/gimptext-compat.h index e5e2de44ba..2e55871750 100644 --- a/app/text/gimptext-compat.h +++ b/app/text/gimptext-compat.h @@ -26,14 +26,14 @@ /* convenience functions that provide the 1.2 API, only used by the PDB */ GimpLayer * text_render (GimpImage *image, - GimpDrawable *drawable, + GimpDrawable *drawable, GimpContext *context, - gint text_x, - gint text_y, - const gchar *fontname, - const gchar *text, - gint border, - gboolean antialias); + gint text_x, + gint text_y, + const gchar *fontname, + const gchar *text, + gint border, + gboolean antialias); gboolean text_get_extents (const gchar *fontname, const gchar *text, gint *width, diff --git a/app/text/gimptext-parasite.c b/app/text/gimptext-parasite.c index da5d96b0df..8414ee50c1 100644 --- a/app/text/gimptext-parasite.c +++ b/app/text/gimptext-parasite.c @@ -108,14 +108,14 @@ gimp_text_gdyntext_parasite_name (void) enum { - TEXT = 0, + TEXT = 0, ANTIALIAS = 1, - ALIGNMENT = 2, - ROTATION = 3, - LINE_SPACING = 4, - COLOR = 5, + ALIGNMENT = 2, + ROTATION = 3, + LINE_SPACING = 4, + COLOR = 5, LAYER_ALIGNMENT = 6, - XLFD = 7, + XLFD = 7, NUM_PARAMS }; @@ -179,7 +179,7 @@ gimp_text_from_gdyntext_parasite (const GimpParasite *parasite) spacing = atof (params[LINE_SPACING]); - color = strtol (params[COLOR], NULL, 16); + color = strtol (params[COLOR], NULL, 16); gimp_rgba_set_uchar (&rgb, color >> 16, color >> 8, color, 255); retval = g_object_new (GIMP_TYPE_TEXT, diff --git a/app/text/gimptext-private.h b/app/text/gimptext-private.h index 4a0c5eda68..62fb9f0b51 100644 --- a/app/text/gimptext-private.h +++ b/app/text/gimptext-private.h @@ -43,12 +43,12 @@ struct _GimpTextLayoutClass typedef void (* GimpTextRenderFunc) (PangoFont *font, - PangoGlyph glyph, - FT_Int32 load_flags, - FT_Matrix *tranform, - gint x, - gint y, - gpointer render_data); + PangoGlyph glyph, + FT_Int32 load_flags, + FT_Matrix *tranform, + gint x, + gint y, + gpointer render_data); #endif /* __GIMP_TEXT_LAYOUT_PRIVATE_H__ */ diff --git a/app/text/gimptext-vectors.c b/app/text/gimptext-vectors.c index 684f6f306c..5d88f4cbd7 100644 --- a/app/text/gimptext-vectors.c +++ b/app/text/gimptext-vectors.c @@ -63,17 +63,17 @@ struct _RenderContext static void gimp_text_render_vectors (PangoFont *font, - PangoGlyph glyph, - FT_Int32 flags, - FT_Matrix *matrix, - gint x, - gint y, - RenderContext *context); + PangoGlyph glyph, + FT_Int32 flags, + FT_Matrix *matrix, + gint x, + gint y, + RenderContext *context); GimpVectors * gimp_text_vectors_new (GimpImage *image, - GimpText *text) + GimpText *text) { GimpVectors *vectors; GimpTextLayout *layout; @@ -93,8 +93,8 @@ gimp_text_vectors_new (GimpImage *image, context.vectors = vectors; gimp_text_layout_render (layout, - (GimpTextRenderFunc) gimp_text_render_vectors, - &context); + (GimpTextRenderFunc) gimp_text_render_vectors, + &context); g_object_unref (layout); @@ -121,7 +121,7 @@ gimp_text_vector_coords (RenderContext *context, static gint moveto (FT_Vector *to, - gpointer data) + gpointer data) { RenderContext *context = (RenderContext *) data; GimpCoords start; @@ -145,7 +145,7 @@ moveto (FT_Vector *to, static gint lineto (FT_Vector *to, - gpointer data) + gpointer data) { RenderContext *context = (RenderContext *) data; GimpCoords end; @@ -166,8 +166,8 @@ lineto (FT_Vector *to, static gint conicto (FT_Vector *ftcontrol, - FT_Vector *to, - gpointer data) + FT_Vector *to, + gpointer data) { RenderContext *context = (RenderContext *) data; GimpCoords control; @@ -190,9 +190,9 @@ conicto (FT_Vector *ftcontrol, static gint cubicto (FT_Vector *ftcontrol1, - FT_Vector *ftcontrol2, - FT_Vector *to, - gpointer data) + FT_Vector *ftcontrol2, + FT_Vector *to, + gpointer data) { RenderContext *context = (RenderContext *) data; GimpCoords control1; @@ -218,12 +218,12 @@ cubicto (FT_Vector *ftcontrol1, static void gimp_text_render_vectors (PangoFont *font, - PangoGlyph pango_glyph, - FT_Int32 flags, - FT_Matrix *trafo, - gint x, - gint y, - RenderContext *context) + PangoGlyph pango_glyph, + FT_Int32 flags, + FT_Matrix *trafo, + gint x, + gint y, + RenderContext *context) { const FT_Outline_Funcs outline_funcs = { diff --git a/app/text/gimptext-vectors.h b/app/text/gimptext-vectors.h index 5d6a320e81..057d5a802d 100644 --- a/app/text/gimptext-vectors.h +++ b/app/text/gimptext-vectors.h @@ -24,7 +24,7 @@ GimpVectors * gimp_text_vectors_new (GimpImage *image, - GimpText *text); + GimpText *text); #endif /* __GIMP_TEXT_VECTORS_H__ */ diff --git a/app/text/gimptext.c b/app/text/gimptext.c index 4ef1b7f952..eef427dd28 100644 --- a/app/text/gimptext.c +++ b/app/text/gimptext.c @@ -108,25 +108,25 @@ gimp_text_class_init (GimpTextClass *klass) language = gimp_get_default_language (NULL); GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_TEXT, - "text", NULL, - NULL, - GIMP_PARAM_STATIC_STRINGS); + "text", NULL, + NULL, + GIMP_PARAM_STATIC_STRINGS); GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_FONT, - "font", NULL, - "Sans", - GIMP_PARAM_STATIC_STRINGS); + "font", NULL, + "Sans", + GIMP_PARAM_STATIC_STRINGS); GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_FONT_SIZE, - "font-size", NULL, - 0.0, 8192.0, 18.0, - GIMP_PARAM_STATIC_STRINGS); + "font-size", NULL, + 0.0, 8192.0, 18.0, + GIMP_PARAM_STATIC_STRINGS); /* * We use the name "font-size-unit" for backward compatibility. * The unit is also used for other sizes in the text object. */ GIMP_CONFIG_INSTALL_PROP_UNIT (object_class, PROP_UNIT, - "font-size-unit", NULL, - TRUE, FALSE, GIMP_UNIT_PIXEL, - GIMP_PARAM_STATIC_STRINGS); + "font-size-unit", NULL, + TRUE, FALSE, GIMP_UNIT_PIXEL, + GIMP_PARAM_STATIC_STRINGS); GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_HINTING, "hinting", NULL, TRUE, @@ -146,9 +146,9 @@ gimp_text_class_init (GimpTextClass *klass) GIMP_PARAM_STATIC_STRINGS | GIMP_CONFIG_PARAM_DEFAULTS); GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_LANGUAGE, - "language", NULL, - language, - GIMP_PARAM_STATIC_STRINGS); + "language", NULL, + language, + GIMP_PARAM_STATIC_STRINGS); GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_BASE_DIR, "base-direction", NULL, GIMP_TYPE_TEXT_DIRECTION, @@ -170,19 +170,19 @@ gimp_text_class_init (GimpTextClass *klass) GIMP_TEXT_JUSTIFY_LEFT, GIMP_PARAM_STATIC_STRINGS); GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_INDENTATION, - "indent", NULL, - -8192.0, 8192.0, 0.0, - GIMP_PARAM_STATIC_STRINGS | + "indent", NULL, + -8192.0, 8192.0, 0.0, + GIMP_PARAM_STATIC_STRINGS | GIMP_CONFIG_PARAM_DEFAULTS); GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_LINE_SPACING, - "line-spacing", NULL, - -8192.0, 8192.0, 0.0, - GIMP_PARAM_STATIC_STRINGS | + "line-spacing", NULL, + -8192.0, 8192.0, 0.0, + GIMP_PARAM_STATIC_STRINGS | GIMP_CONFIG_PARAM_DEFAULTS); GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_LETTER_SPACING, - "letter-spacing", NULL, - -8192.0, 8192.0, 0.0, - GIMP_PARAM_STATIC_STRINGS | + "letter-spacing", NULL, + -8192.0, 8192.0, 0.0, + GIMP_PARAM_STATIC_STRINGS | GIMP_CONFIG_PARAM_DEFAULTS); GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_BOX_MODE, "box-mode", @@ -201,9 +201,9 @@ gimp_text_class_init (GimpTextClass *klass) GIMP_PARAM_STATIC_STRINGS | GIMP_CONFIG_PARAM_DEFAULTS); GIMP_CONFIG_INSTALL_PROP_UNIT (object_class, PROP_BOX_UNIT, - "box-unit", NULL, - TRUE, FALSE, GIMP_UNIT_PIXEL, - GIMP_PARAM_STATIC_STRINGS); + "box-unit", NULL, + TRUE, FALSE, GIMP_UNIT_PIXEL, + GIMP_PARAM_STATIC_STRINGS); GIMP_CONFIG_INSTALL_PROP_MATRIX2 (object_class, PROP_TRANSFORMATION, "transformation", NULL, &identity, diff --git a/app/text/gimptextlayer.c b/app/text/gimptextlayer.c index 67b58faed0..ab91535ae1 100644 --- a/app/text/gimptextlayer.c +++ b/app/text/gimptextlayer.c @@ -591,7 +591,7 @@ gimp_text_layer_render (GimpTextLayer *layer) static void gimp_text_layer_render_layout (GimpTextLayer *layer, - GimpTextLayout *layout) + GimpTextLayout *layout) { GimpDrawable *drawable = GIMP_DRAWABLE (layer); GimpItem *item = GIMP_ITEM (layer); @@ -612,23 +612,23 @@ gimp_text_layer_render_layout (GimpTextLayer *layer, bitmap.buffer = g_malloc0 (bitmap.rows * bitmap.pitch); gimp_text_layout_render (layout, - (GimpTextRenderFunc) gimp_text_render_bitmap, - &bitmap); + (GimpTextRenderFunc) gimp_text_render_bitmap, + &bitmap); mask = tile_manager_new (bitmap.width, bitmap.rows, 1); pixel_region_init (&maskPR, mask, 0, 0, bitmap.width, bitmap.rows, TRUE); for (i = 0; i < bitmap.rows; i++) pixel_region_set_row (&maskPR, - 0, i, bitmap.width, - bitmap.buffer + i * bitmap.pitch); + 0, i, bitmap.width, + bitmap.buffer + i * bitmap.pitch); g_free (bitmap.buffer); pixel_region_init (&textPR, drawable->tiles, - 0, 0, bitmap.width, bitmap.rows, TRUE); + 0, 0, bitmap.width, bitmap.rows, TRUE); pixel_region_init (&maskPR, mask, - 0, 0, bitmap.width, bitmap.rows, FALSE); + 0, 0, bitmap.width, bitmap.rows, FALSE); apply_mask_to_region (&textPR, &maskPR, OPAQUE_OPACITY); diff --git a/app/text/gimptextlayout-render.c b/app/text/gimptextlayout-render.c index fdad40fea0..9e582718f8 100644 --- a/app/text/gimptextlayout-render.c +++ b/app/text/gimptextlayout-render.c @@ -46,18 +46,18 @@ */ static void gimp_text_layout_render_line (GimpTextLayout *layout, - PangoLayoutLine *line, - GimpTextRenderFunc render_func, - gint x, - gint y, - gpointer render_data); + PangoLayoutLine *line, + GimpTextRenderFunc render_func, + gint x, + gint y, + gpointer render_data); static void gimp_text_layout_render_glyphs (GimpTextLayout *layout, - PangoFont *font, - PangoGlyphString *glyphs, - GimpTextRenderFunc render_func, - gint x, - gint y, - gpointer render_data); + PangoFont *font, + PangoGlyphString *glyphs, + GimpTextRenderFunc render_func, + gint x, + gint y, + gpointer render_data); static FT_Int32 gimp_text_layout_render_flags (GimpTextLayout *layout); static void gimp_text_layout_render_trafo (GimpTextLayout *layout, FT_Matrix *trafo); @@ -66,8 +66,8 @@ static void gimp_text_layout_render_trafo (GimpTextLayout *layout, void gimp_text_layout_render (GimpTextLayout *layout, - GimpTextRenderFunc render_func, - gpointer render_data) + GimpTextRenderFunc render_func, + gpointer render_data) { PangoLayoutIter *iter; gint x, y; @@ -94,10 +94,10 @@ gimp_text_layout_render (GimpTextLayout *layout, baseline = pango_layout_iter_get_baseline (iter); gimp_text_layout_render_line (layout, line, - render_func, - x + rect.x, - y + baseline, - render_data); + render_func, + x + rect.x, + y + baseline, + render_data); } while (pango_layout_iter_next_line (iter)); @@ -106,11 +106,11 @@ gimp_text_layout_render (GimpTextLayout *layout, static void gimp_text_layout_render_line (GimpTextLayout *layout, - PangoLayoutLine *line, - GimpTextRenderFunc render_func, - gint x, - gint y, - gpointer render_data) + PangoLayoutLine *line, + GimpTextRenderFunc render_func, + gint x, + gint y, + gpointer render_data) { PangoRectangle rect; GSList *list; @@ -121,12 +121,12 @@ gimp_text_layout_render_line (GimpTextLayout *layout, PangoLayoutRun *run = list->data; pango_glyph_string_extents (run->glyphs, run->item->analysis.font, - NULL, &rect); + NULL, &rect); gimp_text_layout_render_glyphs (layout, - run->item->analysis.font, run->glyphs, - render_func, - x + x_off, y, - render_data); + run->item->analysis.font, run->glyphs, + render_func, + x + x_off, y, + render_data); x_off += rect.width; } @@ -134,12 +134,12 @@ gimp_text_layout_render_line (GimpTextLayout *layout, static void gimp_text_layout_render_glyphs (GimpTextLayout *layout, - PangoFont *font, - PangoGlyphString *glyphs, - GimpTextRenderFunc render_func, - gint x, - gint y, - gpointer render_data) + PangoFont *font, + PangoGlyphString *glyphs, + GimpTextRenderFunc render_func, + gint x, + gint y, + gpointer render_data) { PangoGlyphInfo *gi; FT_Int32 flags; @@ -154,16 +154,16 @@ gimp_text_layout_render_glyphs (GimpTextLayout *layout, for (i = 0, gi = glyphs->glyphs; i < glyphs->num_glyphs; i++, gi++) { if (gi->glyph) - { - pos.x = x + x_position + gi->geometry.x_offset; - pos.y = y + gi->geometry.y_offset; + { + pos.x = x + x_position + gi->geometry.x_offset; + pos.y = y + gi->geometry.y_offset; - FT_Vector_Transform (&pos, &trafo); + FT_Vector_Transform (&pos, &trafo); - render_func (font, gi->glyph, flags, &trafo, - pos.x, pos.y, - render_data); - } + render_func (font, gi->glyph, flags, &trafo, + pos.x, pos.y, + render_data); + } x_position += glyphs->glyphs[i].geometry.width; } diff --git a/app/text/gimptextlayout-render.h b/app/text/gimptextlayout-render.h index 1c033e40e5..ef1f885ab1 100644 --- a/app/text/gimptextlayout-render.h +++ b/app/text/gimptextlayout-render.h @@ -24,8 +24,8 @@ void gimp_text_layout_render (GimpTextLayout *layout, - GimpTextRenderFunc render_func, - gpointer render_data); + GimpTextRenderFunc render_func, + gpointer render_data); #endif /* __GIMP_TEXT_LAYOUT_RENDER_H__ */ diff --git a/app/tools/gimp-tools.c b/app/tools/gimp-tools.c index e0fd8bba67..ba0a895789 100644 --- a/app/tools/gimp-tools.c +++ b/app/tools/gimp-tools.c @@ -528,18 +528,18 @@ gimp_tools_register (GType tool_type, } tool_info = gimp_tool_info_new (gimp, - tool_type, + tool_type, tool_options_type, - context_props, - identifier, - blurb, - help, - menu_path, - menu_accel, - help_domain, - help_data, + context_props, + identifier, + blurb, + help, + menu_path, + menu_accel, + help_domain, + help_data, paint_core_name, - stock_id); + stock_id); if (g_type_is_a (tool_type, GIMP_TYPE_IMAGE_MAP_TOOL)) g_object_set (tool_info, "visible", FALSE, NULL); diff --git a/app/tools/gimpairbrushtool.c b/app/tools/gimpairbrushtool.c index 91a7098b26..a9707fb3b4 100644 --- a/app/tools/gimpairbrushtool.c +++ b/app/tools/gimpairbrushtool.c @@ -45,7 +45,7 @@ G_DEFINE_TYPE (GimpAirbrushTool, gimp_airbrush_tool, GIMP_TYPE_PAINTBRUSH_TOOL); void gimp_airbrush_tool_register (GimpToolRegisterCallback callback, - gpointer data) + gpointer data) { (* callback) (GIMP_TYPE_AIRBRUSH_TOOL, GIMP_TYPE_AIRBRUSH_OPTIONS, diff --git a/app/tools/gimpaligntool.c b/app/tools/gimpaligntool.c index 706bea006c..f574e89522 100644 --- a/app/tools/gimpaligntool.c +++ b/app/tools/gimpaligntool.c @@ -355,26 +355,26 @@ gimp_align_tool_cursor_update (GimpTool *tool, if ((layer = gimp_image_pick_correlate_layer (display->image, coords->x, coords->y))) - { - /* if there is a floating selection, and this aint it... */ - if (gimp_image_floating_sel (display->image) && - ! gimp_layer_is_floating_sel (layer)) - { + { + /* if there is a floating selection, and this aint it... */ + if (gimp_image_floating_sel (display->image) && + ! gimp_layer_is_floating_sel (layer)) + { cursor = GIMP_CURSOR_MOUSE; tool_cursor = GIMP_TOOL_CURSOR_MOVE; modifier = GIMP_CURSOR_MODIFIER_ANCHOR; - } - else if (layer == gimp_image_get_active_layer (display->image)) - { + } + else if (layer == gimp_image_get_active_layer (display->image)) + { cursor = GIMP_CURSOR_MOUSE; - } - else - { + } + else + { cursor = GIMP_CURSOR_MOUSE; tool_cursor = GIMP_TOOL_CURSOR_HAND; modifier = GIMP_CURSOR_MODIFIER_MOVE; - } - } + } + } } gimp_tool_control_set_cursor (tool->control, cursor); diff --git a/app/tools/gimpbrightnesscontrasttool.c b/app/tools/gimpbrightnesscontrasttool.c index de8e9ddfa1..35d75261f8 100644 --- a/app/tools/gimpbrightnesscontrasttool.c +++ b/app/tools/gimpbrightnesscontrasttool.c @@ -182,8 +182,8 @@ gimp_brightness_contrast_tool_map (GimpImageMapTool *im_tool) brightness_contrast_lut_setup (bc_tool->lut, bc_tool->brightness / 255.0, - bc_tool->contrast / 127.0, - gimp_drawable_bytes (im_tool->drawable)); + bc_tool->contrast / 127.0, + gimp_drawable_bytes (im_tool->drawable)); gimp_image_map_apply (im_tool->image_map, (GimpImageMapApplyFunc) gimp_lut_process, bc_tool->lut); diff --git a/app/tools/gimpbrushtool.c b/app/tools/gimpbrushtool.c index b8845f1442..4f4d6690d1 100644 --- a/app/tools/gimpbrushtool.c +++ b/app/tools/gimpbrushtool.c @@ -66,7 +66,7 @@ static GObject * gimp_paint_tool_constructor (GType type, GObjectConstructParam *params); static void gimp_paint_tool_finalize (GObject *object); -static void gimp_paint_tool_control (GimpTool *tool, +static void gimp_paint_tool_control (GimpTool *tool, GimpToolAction action, GimpDisplay *display); static void gimp_paint_tool_button_press (GimpTool *tool, @@ -259,8 +259,8 @@ gimp_paint_tool_enable_color_picker (GimpPaintTool *tool, static void gimp_paint_tool_control (GimpTool *tool, - GimpToolAction action, - GimpDisplay *display) + GimpToolAction action, + GimpDisplay *display) { GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool); GimpDrawable *drawable; @@ -344,8 +344,8 @@ static void gimp_paint_tool_button_press (GimpTool *tool, GimpCoords *coords, guint32 time, - GdkModifierType state, - GimpDisplay *display) + GdkModifierType state, + GimpDisplay *display) { GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool); GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool); @@ -452,8 +452,8 @@ static void gimp_paint_tool_button_release (GimpTool *tool, GimpCoords *coords, guint32 time, - GdkModifierType state, - GimpDisplay *display) + GdkModifierType state, + GimpDisplay *display) { GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool); GimpPaintOptions *paint_options; @@ -493,8 +493,8 @@ static void gimp_paint_tool_motion (GimpTool *tool, GimpCoords *coords, guint32 time, - GdkModifierType state, - GimpDisplay *display) + GdkModifierType state, + GimpDisplay *display) { GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool); GimpPaintOptions *paint_options; @@ -756,8 +756,8 @@ gimp_paint_tool_draw (GimpDrawTool *draw_tool) { TempBuf *mask = gimp_brush_get_mask (brush_core->main_brush); PixelRegion PR = { 0, }; - BoundSeg *boundary; - gint num_groups; + BoundSeg *boundary; + gint num_groups; pixel_region_init_temp_buf (&PR, mask, 0, 0, mask->width, mask->height); @@ -771,9 +771,9 @@ gimp_paint_tool_draw (GimpDrawTool *draw_tool) boundary_sort (boundary, brush_core->n_brush_bound_segs, &num_groups); - brush_core->n_brush_bound_segs += num_groups; + brush_core->n_brush_bound_segs += num_groups; - g_free (boundary); + g_free (boundary); brush_core->brush_bound_width = mask->width; brush_core->brush_bound_height = mask->height; diff --git a/app/tools/gimpcolorbalancetool.c b/app/tools/gimpcolorbalancetool.c index 906b4e22ab..6502b68498 100644 --- a/app/tools/gimpcolorbalancetool.c +++ b/app/tools/gimpcolorbalancetool.c @@ -141,7 +141,7 @@ gimp_color_balance_tool_finalize (GObject *object) static gboolean gimp_color_balance_tool_initialize (GimpTool *tool, - GimpDisplay *display) + GimpDisplay *display) { GimpColorBalanceTool *cb_tool = GIMP_COLOR_BALANCE_TOOL (tool); GimpDrawable *drawable; @@ -198,7 +198,7 @@ create_levels_scale (const gchar *left, label = gtk_label_new (left); gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); gtk_table_attach (GTK_TABLE (table), label, 0, 1, col, col + 1, - GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); + GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); gtk_widget_show (label); spinbutton = gimp_spin_button_new (&adj, @@ -214,7 +214,7 @@ create_levels_scale (const gchar *left, label = gtk_label_new (right); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach (GTK_TABLE (table), label, 2, 3, col, col + 1, - GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); + GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); gtk_widget_show (label); gtk_table_attach (GTK_TABLE (table), spinbutton, 3, 4, col, col + 1, @@ -294,7 +294,7 @@ gimp_color_balance_tool_dialog (GimpImageMapTool *im_tool) cb_tool->preserve_toggle = gtk_check_button_new_with_mnemonic (_("Preserve _luminosity")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cb_tool->preserve_toggle), - cb_tool->color_balance->preserve_luminosity); + cb_tool->color_balance->preserve_luminosity); gtk_box_pack_end (GTK_BOX (im_tool->main_vbox), cb_tool->preserve_toggle, FALSE, FALSE, 0); gtk_widget_show (cb_tool->preserve_toggle); @@ -319,7 +319,7 @@ gimp_color_balance_tool_reset (GimpImageMapTool *im_tool) static void color_balance_update (GimpColorBalanceTool *cb_tool, - gint update) + gint update) { GimpTransferMode tm; diff --git a/app/tools/gimpcolortool.c b/app/tools/gimpcolortool.c index 4b389da673..7e9224700d 100644 --- a/app/tools/gimpcolortool.c +++ b/app/tools/gimpcolortool.c @@ -193,7 +193,7 @@ gimp_color_tool_control (GimpTool *tool, case RESUME: if (color_tool->sample_point && gimp_display_shell_get_show_sample_points (GIMP_DISPLAY_SHELL (shell))) - gimp_display_shell_draw_sample_point (GIMP_DISPLAY_SHELL (shell), + gimp_display_shell_draw_sample_point (GIMP_DISPLAY_SHELL (shell), color_tool->sample_point, TRUE); break; @@ -309,7 +309,7 @@ gimp_color_tool_button_release (GimpTool *tool, color_tool->sample_point, TRUE); color_tool->sample_point = NULL; } - } + } else { if (color_tool->sample_point) @@ -334,7 +334,7 @@ gimp_color_tool_button_release (GimpTool *tool, gimp_image_flush (display->image); if (color_tool->sample_point) - gimp_display_shell_draw_sample_point (shell, color_tool->sample_point, + gimp_display_shell_draw_sample_point (shell, color_tool->sample_point, TRUE); color_tool->moving_sample_point = FALSE; @@ -374,12 +374,12 @@ gimp_color_tool_motion (GimpTool *tool, if (tx < 0 || tx > shell->disp_width || ty < 0 || ty > shell->disp_height) - { - color_tool->sample_point_x = -1; + { + color_tool->sample_point_x = -1; color_tool->sample_point_y = -1; delete_point = TRUE; - } + } else { gint x, y, width, height; diff --git a/app/tools/gimpconvolvetool.c b/app/tools/gimpconvolvetool.c index da518177a4..e8a3dd4749 100644 --- a/app/tools/gimpconvolvetool.c +++ b/app/tools/gimpconvolvetool.c @@ -97,8 +97,8 @@ static void gimp_convolve_tool_modifier_key (GimpTool *tool, GdkModifierType key, gboolean press, - GdkModifierType state, - GimpDisplay *display) + GdkModifierType state, + GimpDisplay *display) { GimpConvolveOptions *options; @@ -126,8 +126,8 @@ gimp_convolve_tool_modifier_key (GimpTool *tool, static void gimp_convolve_tool_cursor_update (GimpTool *tool, GimpCoords *coords, - GdkModifierType state, - GimpDisplay *display) + GdkModifierType state, + GimpDisplay *display) { GimpConvolveOptions *options; diff --git a/app/tools/gimpdodgeburntool.c b/app/tools/gimpdodgeburntool.c index 4f350d2900..c31c018751 100644 --- a/app/tools/gimpdodgeburntool.c +++ b/app/tools/gimpdodgeburntool.c @@ -76,7 +76,7 @@ gimp_dodge_burn_tool_register (GimpToolRegisterCallback callback, static void gimp_dodge_burn_tool_class_init (GimpDodgeBurnToolClass *klass) { - GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass); + GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass); tool_class->modifier_key = gimp_dodge_burn_tool_modifier_key; tool_class->cursor_update = gimp_dodge_burn_tool_cursor_update; diff --git a/app/tools/gimpdrawtool.c b/app/tools/gimpdrawtool.c index ac98d40c4c..67ec4b2867 100644 --- a/app/tools/gimpdrawtool.c +++ b/app/tools/gimpdrawtool.c @@ -120,8 +120,8 @@ gimp_draw_tool_finalize (GObject *object) static void gimp_draw_tool_control (GimpTool *tool, - GimpToolAction action, - GimpDisplay *display) + GimpToolAction action, + GimpDisplay *display) { GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool); @@ -205,7 +205,7 @@ gimp_draw_tool_real_draw (GimpDrawTool *draw_tool) void gimp_draw_tool_start (GimpDrawTool *draw_tool, - GimpDisplay *display) + GimpDisplay *display) { GimpDisplayShell *shell; @@ -939,7 +939,7 @@ gimp_draw_tool_on_vectors_curve (GimpDrawTool *draw_tool, while ((stroke = gimp_vectors_stroke_get_next (vectors, stroke))) { cur_dist = gimp_stroke_nearest_point_get (stroke, coord, 1.0, - &cur_coords, + &cur_coords, &segment_start, &segment_end, &cur_pos); @@ -1027,9 +1027,9 @@ gimp_draw_tool_on_vectors (GimpDrawTool *draw_tool, void gimp_draw_tool_draw_lines (GimpDrawTool *draw_tool, - const gdouble *points, - gint n_points, - gboolean filled, + const gdouble *points, + gint n_points, + gboolean filled, gboolean use_offsets) { GimpDisplayShell *shell; @@ -1068,9 +1068,9 @@ gimp_draw_tool_draw_lines (GimpDrawTool *draw_tool, void gimp_draw_tool_draw_strokes (GimpDrawTool *draw_tool, - const GimpCoords *points, - gint n_points, - gboolean filled, + const GimpCoords *points, + gint n_points, + gboolean filled, gboolean use_offsets) { GimpDisplayShell *shell; @@ -1155,31 +1155,31 @@ gimp_draw_tool_draw_boundary (GimpDrawTool *draw_tool, for (i = 0; i < n_bound_segs; i++) { if (bound_segs[i].x1 == -1 && - bound_segs[i].y1 == -1 && - bound_segs[i].x2 == -1 && - bound_segs[i].y2 == -1) - { - /* Group ends */ - gimp_canvas_draw_lines (GIMP_CANVAS (shell->canvas), - GIMP_CANVAS_STYLE_XOR_DOTTED, - gdk_points, n_gdk_points); - n_gdk_points = 0; - continue; - } + bound_segs[i].y1 == -1 && + bound_segs[i].x2 == -1 && + bound_segs[i].y2 == -1) + { + /* Group ends */ + gimp_canvas_draw_lines (GIMP_CANVAS (shell->canvas), + GIMP_CANVAS_STYLE_XOR_DOTTED, + gdk_points, n_gdk_points); + n_gdk_points = 0; + continue; + } if (n_gdk_points == 0) - { - gimp_display_shell_transform_xy (shell, - bound_segs[i].x1 + offset_x, - bound_segs[i].y1 + offset_y, - &x, &y, - use_offsets); + { + gimp_display_shell_transform_xy (shell, + bound_segs[i].x1 + offset_x, + bound_segs[i].y1 + offset_y, + &x, &y, + use_offsets); - gdk_points[0].x = CLAMP (x, -1, xmax); - gdk_points[0].y = CLAMP (y, -1, ymax); + gdk_points[0].x = CLAMP (x, -1, xmax); + gdk_points[0].y = CLAMP (y, -1, ymax); - n_gdk_points++; - } + n_gdk_points++; + } g_assert (n_gdk_points < n_bound_segs + 1); diff --git a/app/tools/gimphuesaturationtool.c b/app/tools/gimphuesaturationtool.c index e19b7b269a..ab7376d9c5 100644 --- a/app/tools/gimphuesaturationtool.c +++ b/app/tools/gimphuesaturationtool.c @@ -160,7 +160,7 @@ gimp_hue_saturation_tool_finalize (GObject *object) static gboolean gimp_hue_saturation_tool_initialize (GimpTool *tool, - GimpDisplay *display) + GimpDisplay *display) { GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (tool); GimpDrawable *drawable; @@ -291,7 +291,7 @@ gimp_hue_saturation_tool_dialog (GimpImageMapTool *image_map_tool) hue_partition_table[i].frame_row, hue_partition_table[i].frame_row + 1, GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); - gtk_widget_show (frame); + gtk_widget_show (frame); hs_tool->hue_partition_da[i - 1] = gimp_color_area_new (&color, GIMP_COLOR_AREA_FLAT, @@ -435,7 +435,7 @@ gimp_hue_saturation_tool_reset (GimpImageMapTool *image_map_tool) static void hue_saturation_update (GimpHueSaturationTool *hs_tool, - gint update) + gint update) { gint rgb[3]; GimpRGB color; @@ -486,7 +486,7 @@ hue_saturation_update (GimpHueSaturationTool *hs_tool, static void hue_saturation_partition_callback (GtkWidget *widget, - gpointer data) + gpointer data) { GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (data); GimpHueRange partition; @@ -516,7 +516,7 @@ hue_saturation_partition_reset_callback (GtkWidget *widget, static void hue_saturation_hue_adjustment_update (GtkAdjustment *adjustment, - gpointer data) + gpointer data) { GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (data); GimpHueRange part = hs_tool->hue_partition; @@ -532,7 +532,7 @@ hue_saturation_hue_adjustment_update (GtkAdjustment *adjustment, static void hue_saturation_lightness_adjustment_update (GtkAdjustment *adjustment, - gpointer data) + gpointer data) { GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (data); GimpHueRange part = hs_tool->hue_partition; @@ -548,7 +548,7 @@ hue_saturation_lightness_adjustment_update (GtkAdjustment *adjustment, static void hue_saturation_saturation_adjustment_update (GtkAdjustment *adjustment, - gpointer data) + gpointer data) { GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (data); GimpHueRange part = hs_tool->hue_partition; diff --git a/app/tools/gimpiscissorstool.c b/app/tools/gimpiscissorstool.c index 4142dff116..5a57c8b677 100644 --- a/app/tools/gimpiscissorstool.c +++ b/app/tools/gimpiscissorstool.c @@ -161,42 +161,42 @@ static void iscissors_convert (GimpIscissorsTool *iscissors, static TileManager * gradient_map_new (GimpImage *image); static void find_optimal_path (TileManager *gradient_map, - TempBuf *dp_buf, - gint x1, - gint y1, - gint x2, - gint y2, - gint xs, - gint ys); + TempBuf *dp_buf, + gint x1, + gint y1, + gint x2, + gint y2, + gint xs, + gint ys); static void find_max_gradient (GimpIscissorsTool *iscissors, - GimpImage *image, - gint *x, - gint *y); + GimpImage *image, + gint *x, + gint *y); static void calculate_curve (GimpTool *tool, - ICurve *curve); + ICurve *curve); static void iscissors_draw_curve (GimpDrawTool *draw_tool, - ICurve *curve); + ICurve *curve); static void iscissors_free_icurves (GSList *list); static void iscissors_free_buffers (GimpIscissorsTool *iscissors); static gint mouse_over_vertex (GimpIscissorsTool *iscissors, - gdouble x, - gdouble y); + gdouble x, + gdouble y); static gboolean clicked_on_vertex (GimpTool *tool); static GSList * mouse_over_curve (GimpIscissorsTool *iscissors, - gdouble x, - gdouble y); + gdouble x, + gdouble y); static gboolean clicked_on_curve (GimpTool *tool); static void precalculate_arrays (void); static GPtrArray * plot_pixels (GimpIscissorsTool *iscissors, - TempBuf *dp_buf, - gint x1, - gint y1, - gint xs, - gint ys, - gint xe, - gint ye); + TempBuf *dp_buf, + gint x1, + gint y1, + gint xs, + gint ys, + gint xe, + gint ye); G_DEFINE_TYPE (GimpIscissorsTool, gimp_iscissors_tool, @@ -420,9 +420,9 @@ gimp_iscissors_tool_button_press (GimpTool *tool, iscissors->draw = DRAW_CURRENT_SEED; if (! (state & GDK_SHIFT_MASK)) - find_max_gradient (iscissors, + find_max_gradient (iscissors, display->image, - &iscissors->x, + &iscissors->x, &iscissors->y); iscissors->x = CLAMP (iscissors->x, 0, display->image->width - 1); @@ -438,25 +438,25 @@ gimp_iscissors_tool_button_press (GimpTool *tool, default: /* Check if the mouse click occurred on a vertex or the curve itself */ if (clicked_on_vertex (tool)) - { - iscissors->nx = iscissors->x; - iscissors->ny = iscissors->y; - iscissors->state = SEED_ADJUSTMENT; + { + iscissors->nx = iscissors->x; + iscissors->ny = iscissors->y; + iscissors->state = SEED_ADJUSTMENT; - iscissors->draw = DRAW_CURVE | DRAW_ACTIVE_CURVE; - gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool)); - } + iscissors->draw = DRAW_CURVE | DRAW_ACTIVE_CURVE; + gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool)); + } /* If the iscissors is connected, check if the click was inside */ else if (iscissors->connected && iscissors->mask && - gimp_pickable_get_opacity_at (GIMP_PICKABLE (iscissors->mask), + gimp_pickable_get_opacity_at (GIMP_PICKABLE (iscissors->mask), iscissors->x, iscissors->y)) - { - /* Undraw the curve */ - gimp_tool_control_halt (tool->control); + { + /* Undraw the curve */ + gimp_tool_control_halt (tool->control); - iscissors->draw = DRAW_CURVE; - gimp_draw_tool_stop (GIMP_DRAW_TOOL (tool)); + iscissors->draw = DRAW_CURVE; + gimp_draw_tool_stop (GIMP_DRAW_TOOL (tool)); gimp_channel_select_channel (gimp_image_get_mask (display->image), tool->tool_info->blurb, @@ -467,26 +467,26 @@ gimp_iscissors_tool_button_press (GimpTool *tool, options->feather_radius, options->feather_radius); - gimp_iscissors_tool_reset (iscissors); + gimp_iscissors_tool_reset (iscissors); - gimp_image_flush (display->image); - } + gimp_image_flush (display->image); + } else if (! iscissors->connected) - { + { /* if we're not connected, we're adding a new point */ /* pause the tool, but undraw nothing */ iscissors->draw = DRAW_NOTHING; - gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool)); + gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool)); - iscissors->state = SEED_PLACEMENT; - iscissors->draw = DRAW_CURRENT_SEED; + iscissors->state = SEED_PLACEMENT; + iscissors->draw = DRAW_CURRENT_SEED; if (options->interactive) iscissors->draw |= DRAW_LIVEWIRE; - gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool)); - } + gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool)); + } break; } } @@ -494,7 +494,7 @@ gimp_iscissors_tool_button_press (GimpTool *tool, static void iscissors_convert (GimpIscissorsTool *iscissors, - GimpDisplay *display) + GimpDisplay *display) { GimpSelectionOptions *options; GimpScanConvert *sc; @@ -523,11 +523,11 @@ iscissors_convert (GimpIscissorsTool *iscissors, points = g_new (GimpVector2, n_points); for (i = 0; i < n_points; i ++) - { - packed = GPOINTER_TO_INT (g_ptr_array_index (icurve->points, i)); - points[i].x = packed & 0x0000ffff; - points[i].y = packed >> 16; - } + { + packed = GPOINTER_TO_INT (g_ptr_array_index (icurve->points, i)); + points[i].x = packed & 0x0000ffff; + points[i].y = packed >> 16; + } gimp_scan_convert_add_points (sc, n_points, points, FALSE); g_free (points); @@ -569,7 +569,7 @@ gimp_iscissors_tool_button_release (GimpTool *tool, case SEED_PLACEMENT: iscissors->draw = DRAW_CURVE | DRAW_CURRENT_SEED; if (options->interactive) - iscissors->draw |= DRAW_LIVEWIRE; + iscissors->draw |= DRAW_LIVEWIRE; break; case SEED_ADJUSTMENT: iscissors->draw = DRAW_CURVE | DRAW_ACTIVE_CURVE; @@ -585,70 +585,70 @@ gimp_iscissors_tool_button_release (GimpTool *tool, { /* Progress to the next stage of intelligent selection */ switch (iscissors->state) - { - case SEED_PLACEMENT: - /* Add a new icurve */ - if (!iscissors->first_point) - { - /* Determine if we're connecting to the first point */ - if (iscissors->curves) - { - curve = (ICurve *) iscissors->curves->data; + { + case SEED_PLACEMENT: + /* Add a new icurve */ + if (!iscissors->first_point) + { + /* Determine if we're connecting to the first point */ + if (iscissors->curves) + { + curve = (ICurve *) iscissors->curves->data; - if (gimp_draw_tool_on_handle (GIMP_DRAW_TOOL (tool), display, + if (gimp_draw_tool_on_handle (GIMP_DRAW_TOOL (tool), display, iscissors->x, iscissors->y, GIMP_HANDLE_CIRCLE, curve->x1, curve->y1, POINT_WIDTH, POINT_WIDTH, GTK_ANCHOR_CENTER, FALSE)) - { - iscissors->x = curve->x1; - iscissors->y = curve->y1; - iscissors->connected = TRUE; + { + iscissors->x = curve->x1; + iscissors->y = curve->y1; + iscissors->connected = TRUE; } - } + } - /* Create the new curve segment */ - if (iscissors->ix != iscissors->x || - iscissors->iy != iscissors->y) - { - curve = g_new (ICurve, 1); + /* Create the new curve segment */ + if (iscissors->ix != iscissors->x || + iscissors->iy != iscissors->y) + { + curve = g_new (ICurve, 1); - curve->x1 = iscissors->ix; - curve->y1 = iscissors->iy; - iscissors->ix = curve->x2 = iscissors->x; - iscissors->iy = curve->y2 = iscissors->y; - curve->points = NULL; - iscissors->curves = g_slist_append (iscissors->curves, curve); - calculate_curve (tool, curve); - } - } - else /* this was our first point */ - { - iscissors->first_point = FALSE; - } - break; + curve->x1 = iscissors->ix; + curve->y1 = iscissors->iy; + iscissors->ix = curve->x2 = iscissors->x; + iscissors->iy = curve->y2 = iscissors->y; + curve->points = NULL; + iscissors->curves = g_slist_append (iscissors->curves, curve); + calculate_curve (tool, curve); + } + } + else /* this was our first point */ + { + iscissors->first_point = FALSE; + } + break; - case SEED_ADJUSTMENT: - /* recalculate both curves */ - if (iscissors->curve1) - { - iscissors->curve1->x1 = iscissors->nx; - iscissors->curve1->y1 = iscissors->ny; - calculate_curve (tool, iscissors->curve1); - } - if (iscissors->curve2) - { - iscissors->curve2->x2 = iscissors->nx; - iscissors->curve2->y2 = iscissors->ny; - calculate_curve (tool, iscissors->curve2); - } - break; + case SEED_ADJUSTMENT: + /* recalculate both curves */ + if (iscissors->curve1) + { + iscissors->curve1->x1 = iscissors->nx; + iscissors->curve1->y1 = iscissors->ny; + calculate_curve (tool, iscissors->curve1); + } + if (iscissors->curve2) + { + iscissors->curve2->x2 = iscissors->nx; + iscissors->curve2->y2 = iscissors->ny; + calculate_curve (tool, iscissors->curve2); + } + break; - default: - break; - } + default: + break; + } } iscissors->state = WAITING; @@ -682,7 +682,7 @@ gimp_iscissors_tool_motion (GimpTool *tool, iscissors->draw = DRAW_CURRENT_SEED; if (options->interactive) - iscissors->draw |= DRAW_LIVEWIRE; + iscissors->draw |= DRAW_LIVEWIRE; } else if (iscissors->state == SEED_ADJUSTMENT) { @@ -699,24 +699,24 @@ gimp_iscissors_tool_motion (GimpTool *tool, case SEED_PLACEMENT: /* Hold the shift key down to disable the auto-edge snap feature */ if (! (state & GDK_SHIFT_MASK)) - find_max_gradient (iscissors, display->image, - &iscissors->x, &iscissors->y); + find_max_gradient (iscissors, display->image, + &iscissors->x, &iscissors->y); iscissors->x = CLAMP (iscissors->x, 0, display->image->width - 1); iscissors->y = CLAMP (iscissors->y, 0, display->image->height - 1); if (iscissors->first_point) - { - iscissors->ix = iscissors->x; - iscissors->iy = iscissors->y; - } + { + iscissors->ix = iscissors->x; + iscissors->iy = iscissors->y; + } break; case SEED_ADJUSTMENT: /* Move the current seed to the location of the cursor */ if (! (state & GDK_SHIFT_MASK)) - find_max_gradient (iscissors, display->image, - &iscissors->x, &iscissors->y); + find_max_gradient (iscissors, display->image, + &iscissors->x, &iscissors->y); iscissors->x = CLAMP (iscissors->x, 0, display->image->width - 1); iscissors->y = CLAMP (iscissors->y, 0, display->image->height - 1); @@ -757,12 +757,12 @@ gimp_iscissors_tool_draw (GimpDrawTool *draw_tool) /* Draw a line boundary */ if (! iscissors->first_point && ! (iscissors->draw & DRAW_LIVEWIRE)) - { + { gimp_draw_tool_draw_line (draw_tool, iscissors->ix, iscissors->iy, iscissors->x, iscissors->y, FALSE); - } + } } /* Draw the livewire boundary */ @@ -770,11 +770,11 @@ gimp_iscissors_tool_draw (GimpDrawTool *draw_tool) { /* See if the mouse has moved. If so, create a new segment... */ if (! iscissors->livewire || - (iscissors->livewire && - (iscissors->ix != iscissors->livewire->x1 || - iscissors->x != iscissors->livewire->x2 || - iscissors->iy != iscissors->livewire->y1 || - iscissors->y != iscissors->livewire->y2))) + (iscissors->livewire && + (iscissors->ix != iscissors->livewire->x1 || + iscissors->x != iscissors->livewire->x2 || + iscissors->iy != iscissors->livewire->y1 || + iscissors->y != iscissors->livewire->y2))) { curve = g_new (ICurve, 1); @@ -792,7 +792,7 @@ gimp_iscissors_tool_draw (GimpDrawTool *draw_tool) g_free (iscissors->livewire); iscissors->livewire = NULL; - } + } iscissors->livewire = curve; calculate_curve (tool, curve); @@ -820,8 +820,8 @@ gimp_iscissors_tool_draw (GimpDrawTool *draw_tool) /* Go through the list of icurves, and render each one... */ for (list = iscissors->curves; list; list = g_slist_next (list)) - { - curve = (ICurve *) list->data; + { + curve = (ICurve *) list->data; if (iscissors->draw & DRAW_ACTIVE_CURVE) { @@ -846,32 +846,32 @@ gimp_iscissors_tool_draw (GimpDrawTool *draw_tool) continue; } - /* plot the curve */ - iscissors_draw_curve (draw_tool, curve); - } + /* plot the curve */ + iscissors_draw_curve (draw_tool, curve); + } } if (iscissors->draw & DRAW_ACTIVE_CURVE) { /* plot both curves, and the control point between them */ if (iscissors->curve1) - { + { gimp_draw_tool_draw_line (draw_tool, iscissors->curve1->x2, iscissors->curve1->y2, iscissors->nx, iscissors->ny, FALSE); - } + } if (iscissors->curve2) - { + { gimp_draw_tool_draw_line (draw_tool, iscissors->curve2->x1, iscissors->curve2->y1, iscissors->nx, iscissors->ny, FALSE); - } + } gimp_draw_tool_draw_handle (draw_tool, GIMP_HANDLE_FILLED_CIRCLE, @@ -887,7 +887,7 @@ gimp_iscissors_tool_draw (GimpDrawTool *draw_tool) static void iscissors_draw_curve (GimpDrawTool *draw_tool, - ICurve *curve) + ICurve *curve) { gpointer *point; guint len; @@ -911,20 +911,20 @@ iscissors_draw_curve (GimpDrawTool *draw_tool, point++; if (npts < MAX_POINTS) - { + { gimp_draw_tool_draw_line (draw_tool, (coords & 0x0000ffff), (coords >> 16), (coords_2 & 0x0000ffff), (coords_2 >> 16), FALSE); - npts++; - } + npts++; + } else - { - g_warning ("too many points in ICurve segment!"); - return; - } + { + g_warning ("too many points in ICurve segment!"); + return; + } } } @@ -963,17 +963,17 @@ gimp_iscissors_tool_oper_update (GimpTool *tool, else { switch (iscissors->state) - { - case WAITING: + { + case WAITING: iscissors->op = ISCISSORS_OP_ADD_POINT; - break; + break; - case SEED_PLACEMENT: - case SEED_ADJUSTMENT: - default: + case SEED_PLACEMENT: + case SEED_ADJUSTMENT: + default: iscissors->op = ISCISSORS_OP_NONE; break; - } + } } } @@ -1033,8 +1033,8 @@ gimp_iscissors_tool_reset (GimpIscissorsTool *iscissors) { /* release any tile we were using */ if (cur_tile) - { - tile_release (cur_tile, FALSE); + { + tile_release (cur_tile, FALSE); cur_tile = NULL; } @@ -1072,7 +1072,7 @@ iscissors_free_icurves (GSList *list) { curve = (ICurve *) list->data; if (curve->points) - g_ptr_array_free (curve->points, TRUE); + g_ptr_array_free (curve->points, TRUE); g_free (curve); list = g_slist_next (list); @@ -1094,8 +1094,8 @@ iscissors_free_buffers (GimpIscissorsTool *iscissors) static gint mouse_over_vertex (GimpIscissorsTool *iscissors, - gdouble x, - gdouble y) + gdouble x, + gdouble y) { GSList *list; ICurve *curve; @@ -1122,12 +1122,12 @@ mouse_over_vertex (GimpIscissorsTool *iscissors, POINT_WIDTH, POINT_WIDTH, GTK_ANCHOR_CENTER, FALSE)) - { - iscissors->curve1 = curve; + { + iscissors->curve1 = curve; - if (curves_found++) - return curves_found; - } + if (curves_found++) + return curves_found; + } else if (gimp_draw_tool_on_handle (GIMP_DRAW_TOOL (iscissors), GIMP_TOOL (iscissors)->display, x, y, @@ -1136,12 +1136,12 @@ mouse_over_vertex (GimpIscissorsTool *iscissors, POINT_WIDTH, POINT_WIDTH, GTK_ANCHOR_CENTER, FALSE)) - { - iscissors->curve2 = curve; + { + iscissors->curve2 = curve; - if (curves_found++) - return curves_found; - } + if (curves_found++) + return curves_found; + } list = g_slist_next (list); } @@ -1179,8 +1179,8 @@ clicked_on_vertex (GimpTool *tool) static GSList * mouse_over_curve (GimpIscissorsTool *iscissors, - gdouble x, - gdouble y) + gdouble x, + gdouble y) { GSList *list; gpointer *pt; @@ -1200,22 +1200,22 @@ mouse_over_curve (GimpIscissorsTool *iscissors, pt = curve->points->pdata; len = curve->points->len; while (len--) - { - coords = GPOINTER_TO_INT (*pt); - pt++; - tx = coords & 0x0000ffff; - ty = coords >> 16; + { + coords = GPOINTER_TO_INT (*pt); + pt++; + tx = coords & 0x0000ffff; + ty = coords >> 16; - /* Is the specified point close enough to the curve? */ - if (gimp_draw_tool_in_radius (GIMP_DRAW_TOOL (iscissors), + /* Is the specified point close enough to the curve? */ + if (gimp_draw_tool_in_radius (GIMP_DRAW_TOOL (iscissors), GIMP_TOOL (iscissors)->display, tx, ty, x, y, POINT_HALFWIDTH)) - { - return list; - } - } + { + return list; + } + } } return NULL; @@ -1301,7 +1301,7 @@ precalculate_arrays (void) static void calculate_curve (GimpTool *tool, - ICurve *curve) + ICurve *curve) { GimpIscissorsTool *iscissors; GimpDisplay *display; @@ -1370,19 +1370,19 @@ calculate_curve (GimpTool *tool, /* Initialise the gradient map tile manager for this image if we * don't already have one. */ if (!iscissors->gradient_map) - iscissors->gradient_map = gradient_map_new (display->image); + iscissors->gradient_map = gradient_map_new (display->image); /* allocate the dynamic programming array */ iscissors->dp_buf = - temp_buf_resize (iscissors->dp_buf, 4, x1, y1, width, height); + temp_buf_resize (iscissors->dp_buf, 4, x1, y1, width, height); /* find the optimal path of pixels from (x1, y1) to (x2, y2) */ find_optimal_path (iscissors->gradient_map, iscissors->dp_buf, - x1, y1, x2, y2, xs, ys); + x1, y1, x2, y2, xs, ys); /* get a list of the pixels in the optimal path */ curve->points = plot_pixels (iscissors, iscissors->dp_buf, - x1, y1, xs, ys, xe, ye); + x1, y1, xs, ys, xe, ye); } /* If the bounding box has no width */ else if ((x2 - x1) == 0) @@ -1392,10 +1392,10 @@ calculate_curve (GimpTool *tool, dir = (ys > ye) ? -1 : 1; curve->points = g_ptr_array_new (); while (y != ye) - { - g_ptr_array_add (curve->points, GINT_TO_POINTER ((y << 16) + xs)); - y += dir; - } + { + g_ptr_array_add (curve->points, GINT_TO_POINTER ((y << 16) + xs)); + y += dir; + } } /* If the bounding box has no height */ else if ((y2 - y1) == 0) @@ -1405,10 +1405,10 @@ calculate_curve (GimpTool *tool, dir = (xs > xe) ? -1 : 1; curve->points = g_ptr_array_new (); while (x != xe) - { - g_ptr_array_add (curve->points, GINT_TO_POINTER ((ys << 16) + x)); - x += dir; - } + { + g_ptr_array_add (curve->points, GINT_TO_POINTER ((ys << 16) + x)); + x += dir; + } } } @@ -1416,10 +1416,10 @@ calculate_curve (GimpTool *tool, /* badly need to get a replacement - this is _way_ too expensive */ static gboolean gradient_map_value (TileManager *map, - gint x, - gint y, - guint8 *grad, - guint8 *dir) + gint x, + gint y, + guint8 *grad, + guint8 *dir) { static gint cur_tilex; static gint cur_tiley; @@ -1430,10 +1430,10 @@ gradient_map_value (TileManager *map, y / TILE_HEIGHT != cur_tiley) { if (cur_tile) - tile_release (cur_tile, FALSE); + tile_release (cur_tile, FALSE); cur_tile = tile_manager_get_tile (map, x, y, TRUE, FALSE); if (!cur_tile) - return FALSE; + return FALSE; cur_tilex = x / TILE_WIDTH; cur_tiley = y / TILE_HEIGHT; } @@ -1447,10 +1447,10 @@ gradient_map_value (TileManager *map, static gint calculate_link (TileManager *gradient_map, - gint x, - gint y, - guint32 pixel, - gint link) + gint x, + gint y, + guint32 pixel, + gint link) { gint value = 0; guint8 grad1, dir1, grad2, dir2; @@ -1488,13 +1488,13 @@ calculate_link (TileManager *gradient_map, static GPtrArray * plot_pixels (GimpIscissorsTool *iscissors, - TempBuf *dp_buf, - gint x1, - gint y1, - gint xs, - gint ys, - gint xe, - gint ye) + TempBuf *dp_buf, + gint x1, + gint y1, + gint xs, + gint ys, + gint xe, + gint ye) { gint x, y; guint32 coords; @@ -1520,7 +1520,7 @@ plot_pixels (GimpIscissorsTool *iscissors, link = PIXEL_DIR (*data); if (link == SEED_POINT) - return list; + return list; x += move[link][0]; y += move[link][1]; @@ -1539,13 +1539,13 @@ plot_pixels (GimpIscissorsTool *iscissors, static void find_optimal_path (TileManager *gradient_map, - TempBuf *dp_buf, - gint x1, - gint y1, - gint x2, - gint y2, - gint xs, - gint ys) + TempBuf *dp_buf, + gint x1, + gint y1, + gint x2, + gint y2, + gint xs, + gint ys) { gint i, j, k; gint x, y; @@ -1579,90 +1579,90 @@ find_optimal_path (TileManager *gradient_map, d = data + (y-y1) * dp_buf->width + (x-x1); for (j = 0; j < dp_buf->width; j++) - { - min_cost = G_MAXINT; + { + min_cost = G_MAXINT; - /* pixel[] array encodes how to get to a neigbour, if possible. - * 0 means no connection (eg edge). - * Rest packed as bottom two bytes: y offset then x offset. - * Initially, we assume we can't get anywhere. */ - for (k = 0; k < 8; k++) - pixel[k] = 0; + /* pixel[] array encodes how to get to a neigbour, if possible. + * 0 means no connection (eg edge). + * Rest packed as bottom two bytes: y offset then x offset. + * Initially, we assume we can't get anywhere. */ + for (k = 0; k < 8; k++) + pixel[k] = 0; - /* Find the valid neighboring pixels */ - /* the previous pixel */ - if (j) - pixel[((dirx == 1) ? 4 : 0)] = PACK (-dirx, 0); + /* Find the valid neighboring pixels */ + /* the previous pixel */ + if (j) + pixel[((dirx == 1) ? 4 : 0)] = PACK (-dirx, 0); - /* the previous row of pixels */ - if (i) - { - pixel[((diry == 1) ? 5 : 1)] = PACK (0, -diry); + /* the previous row of pixels */ + if (i) + { + pixel[((diry == 1) ? 5 : 1)] = PACK (0, -diry); - link = (linkdir == 1) ? 3 : 2; - if (j) - pixel[((diry == 1) ? (link + 4) : link)] = PACK(-dirx, -diry); + link = (linkdir == 1) ? 3 : 2; + if (j) + pixel[((diry == 1) ? (link + 4) : link)] = PACK(-dirx, -diry); - link = (linkdir == 1) ? 2 : 3; - if (j != dp_buf->width - 1) - pixel[((diry == 1) ? (link + 4) : link)] = PACK (dirx, -diry); - } + link = (linkdir == 1) ? 2 : 3; + if (j != dp_buf->width - 1) + pixel[((diry == 1) ? (link + 4) : link)] = PACK (dirx, -diry); + } - /* find the minimum cost of going through each neighbor to reach the - * seed point... - */ - link = -1; - for (k = 0; k < 8; k ++) - if (pixel[k]) - { - link_cost[k] = calculate_link (gradient_map, + /* find the minimum cost of going through each neighbor to reach the + * seed point... + */ + link = -1; + for (k = 0; k < 8; k ++) + if (pixel[k]) + { + link_cost[k] = calculate_link (gradient_map, xs + j*dirx, ys + i*diry, pixel [k], ((k > 3) ? k - 4 : k)); - offset = OFFSET (pixel [k]); - pixel_cost[k] = PIXEL_COST (d[offset]); - cum_cost[k] = pixel_cost[k] + link_cost[k]; - if (cum_cost[k] < min_cost) - { - min_cost = cum_cost[k]; - link = k; - } - } + offset = OFFSET (pixel [k]); + pixel_cost[k] = PIXEL_COST (d[offset]); + cum_cost[k] = pixel_cost[k] + link_cost[k]; + if (cum_cost[k] < min_cost) + { + min_cost = cum_cost[k]; + link = k; + } + } - /* If anything can be done... */ - if (link >= 0) - { - /* set the cumulative cost of this pixel and the new direction */ - *d = (cum_cost[link] << 8) + link; + /* If anything can be done... */ + if (link >= 0) + { + /* set the cumulative cost of this pixel and the new direction */ + *d = (cum_cost[link] << 8) + link; - /* possibly change the links from the other pixels to this pixel... - * these changes occur if a neighboring pixel will receive a lower - * cumulative cost by going through this pixel. - */ - for (k = 0; k < 8; k ++) - if (pixel[k] && k != link) - { - /* if the cumulative cost at the neighbor is greater than - * the cost through the link to the current pixel, change the - * neighbor's link to point to the current pixel. - */ - new_cost = link_cost[k] + cum_cost[link]; - if (pixel_cost[k] > new_cost) - { - /* reverse the link direction /-----------------------\ */ - offset = OFFSET (pixel[k]); - d[offset] = (new_cost << 8) + ((k > 3) ? k - 4 : k + 4); - } - } - } - /* Set the seed point */ - else if (!i && !j) - *d = SEED_POINT; + /* possibly change the links from the other pixels to this pixel... + * these changes occur if a neighboring pixel will receive a lower + * cumulative cost by going through this pixel. + */ + for (k = 0; k < 8; k ++) + if (pixel[k] && k != link) + { + /* if the cumulative cost at the neighbor is greater than + * the cost through the link to the current pixel, change the + * neighbor's link to point to the current pixel. + */ + new_cost = link_cost[k] + cum_cost[link]; + if (pixel_cost[k] > new_cost) + { + /* reverse the link direction /-----------------------\ */ + offset = OFFSET (pixel[k]); + d[offset] = (new_cost << 8) + ((k > 3) ? k - 4 : k + 4); + } + } + } + /* Set the seed point */ + else if (!i && !j) + *d = SEED_POINT; - /* increment the data pointer and the x counter */ - d += dirx; - x += dirx; - } + /* increment the data pointer and the x counter */ + d += dirx; + x += dirx; + } /* increment the y counter */ y += diry; @@ -1673,7 +1673,7 @@ find_optimal_path (TileManager *gradient_map, /* Called to fill in a newly referenced tile in the gradient map */ static void gradmap_tile_validate (TileManager *tm, - Tile *tile) + Tile *tile) { static gboolean first_gradient = TRUE; @@ -1700,9 +1700,9 @@ gradmap_tile_validate (TileManager *tm, /* compute the distance weights */ for (i = 0; i < GRADIENT_SEARCH; i++) - for (j = 0; j < GRADIENT_SEARCH; j++) - distance_weights[i * GRADIENT_SEARCH + j] = - 1.0 / (1 + sqrt (SQR(i - radius) + SQR(j - radius))); + for (j = 0; j < GRADIENT_SEARCH; j++) + distance_weights[i * GRADIENT_SEARCH + j] = + 1.0 / (1 + sqrt (SQR(i - radius) + SQR(j - radius))); first_gradient = FALSE; } @@ -1717,7 +1717,7 @@ gradmap_tile_validate (TileManager *tm, /* get corresponding tile in the image */ srctile = tile_manager_get_tile (gimp_pickable_get_tiles (pickable), - x, y, TRUE, FALSE); + x, y, TRUE, FALSE); if (!srctile) return; @@ -1760,49 +1760,49 @@ gradmap_tile_validate (TileManager *tm, gradmap = tiledata + tile_ewidth (tile) * COST_WIDTH * i; for (j = 0; j < srcPR.w; j++) - { - hmax = datah[0] - 128; - vmax = datav[0] - 128; - for (b = 1; b < srcPR.bytes; b++) - { - if (abs (datah[b] - 128) > abs (hmax)) hmax = datah[b] - 128; - if (abs (datav[b] - 128) > abs (vmax)) vmax = datav[b] - 128; - } + { + hmax = datah[0] - 128; + vmax = datav[0] - 128; + for (b = 1; b < srcPR.bytes; b++) + { + if (abs (datah[b] - 128) > abs (hmax)) hmax = datah[b] - 128; + if (abs (datav[b] - 128) > abs (vmax)) vmax = datav[b] - 128; + } - if (i == 0 || j == 0 || i == srcPR.h-1 || j == srcPR.w-1) - { - gradmap[j*COST_WIDTH] = 0; - gradmap[j*COST_WIDTH + 1] = 255; - goto contin; - } + if (i == 0 || j == 0 || i == srcPR.h-1 || j == srcPR.w-1) + { + gradmap[j*COST_WIDTH] = 0; + gradmap[j*COST_WIDTH + 1] = 255; + goto contin; + } - /* 1 byte absolute magitude first */ - gradient = sqrt(SQR(hmax) + SQR(vmax)); - gradmap[j*COST_WIDTH] = gradient * 255 / MAX_GRADIENT; + /* 1 byte absolute magitude first */ + gradient = sqrt(SQR(hmax) + SQR(vmax)); + gradmap[j*COST_WIDTH] = gradient * 255 / MAX_GRADIENT; - /* then 1 byte direction */ - if (gradient > MIN_GRADIENT) - { - gfloat direction; + /* then 1 byte direction */ + if (gradient > MIN_GRADIENT) + { + gfloat direction; - if (!hmax) - direction = (vmax > 0) ? G_PI_2 : -G_PI_2; - else - direction = atan ((double) vmax / (double) hmax); + if (!hmax) + direction = (vmax > 0) ? G_PI_2 : -G_PI_2; + else + direction = atan ((double) vmax / (double) hmax); - /* Scale the direction from between 0 and 254, - * corresponding to -PI/2, PI/2 255 is reserved for - * directionless pixels */ - gradmap[j*COST_WIDTH + 1] = - (guint8) (254 * (direction + G_PI_2) / G_PI); - } - else - gradmap[j*COST_WIDTH + 1] = 255; /* reserved for weak gradient */ + /* Scale the direction from between 0 and 254, + * corresponding to -PI/2, PI/2 255 is reserved for + * directionless pixels */ + gradmap[j*COST_WIDTH + 1] = + (guint8) (254 * (direction + G_PI_2) / G_PI); + } + else + gradmap[j*COST_WIDTH + 1] = 255; /* reserved for weak gradient */ contin: - datah += srcPR.bytes; - datav += srcPR.bytes; - } + datah += srcPR.bytes; + datav += srcPR.bytes; + } } tile_release (srctile, FALSE); @@ -1814,7 +1814,7 @@ gradient_map_new (GimpImage *image) TileManager *tm; tm = tile_manager_new (image->width, image->height, - sizeof (guint8) * COST_WIDTH); + sizeof (guint8) * COST_WIDTH); tile_manager_set_user_data (tm, image); tile_manager_set_validate_proc (tm, gradmap_tile_validate); @@ -1823,9 +1823,9 @@ gradient_map_new (GimpImage *image) static void find_max_gradient (GimpIscissorsTool *iscissors, - GimpImage *image, - gint *x, - gint *y) + GimpImage *image, + gint *x, + gint *y) { PixelRegion srcPR; gint radius; @@ -1861,7 +1861,7 @@ find_max_gradient (GimpIscissorsTool *iscissors, /* Find the point of max gradient */ pixel_region_init (&srcPR, iscissors->gradient_map, - x1, y1, x2 - x1, y2 - y1, FALSE); + x1, y1, x2 - x1, y2 - y1, FALSE); /* this iterates over 1, 2 or 4 tiles only */ for (pr = pixel_regions_register (1, &srcPR); @@ -1871,20 +1871,20 @@ find_max_gradient (GimpIscissorsTool *iscissors, endx = srcPR.x + srcPR.w; endy = srcPR.y + srcPR.h; for (i = srcPR.y; i < endy; i++) - { - gradient = srcPR.data + srcPR.rowstride * (i - srcPR.y); - for (j = srcPR.x; j < endx; j++) - { - g = *gradient; - gradient += COST_WIDTH; - g *= distance_weights [(i-y1) * GRADIENT_SEARCH + (j-x1)]; - if (g > max_gradient) - { - max_gradient = g; - *x = j; - *y = i; - } - } - } + { + gradient = srcPR.data + srcPR.rowstride * (i - srcPR.y); + for (j = srcPR.x; j < endx; j++) + { + g = *gradient; + gradient += COST_WIDTH; + g *= distance_weights [(i-y1) * GRADIENT_SEARCH + (j-x1)]; + if (g > max_gradient) + { + max_gradient = g; + *x = j; + *y = i; + } + } + } } } diff --git a/app/tools/gimpmagnifytool.c b/app/tools/gimpmagnifytool.c index 89958b5eab..68a2903b90 100644 --- a/app/tools/gimpmagnifytool.c +++ b/app/tools/gimpmagnifytool.c @@ -50,27 +50,27 @@ static void gimp_magnify_tool_button_press (GimpTool *tool, GimpCoords *coords, guint32 time, - GdkModifierType state, - GimpDisplay *display); + GdkModifierType state, + GimpDisplay *display); static void gimp_magnify_tool_button_release (GimpTool *tool, GimpCoords *coords, guint32 time, - GdkModifierType state, - GimpDisplay *display); + GdkModifierType state, + GimpDisplay *display); static void gimp_magnify_tool_motion (GimpTool *tool, GimpCoords *coords, guint32 time, - GdkModifierType state, - GimpDisplay *display); + GdkModifierType state, + GimpDisplay *display); static void gimp_magnify_tool_modifier_key (GimpTool *tool, GdkModifierType key, gboolean press, - GdkModifierType state, - GimpDisplay *display); + GdkModifierType state, + GimpDisplay *display); static void gimp_magnify_tool_cursor_update (GimpTool *tool, GimpCoords *coords, - GdkModifierType state, - GimpDisplay *display); + GdkModifierType state, + GimpDisplay *display); static void gimp_magnify_tool_draw (GimpDrawTool *draw_tool); @@ -140,8 +140,8 @@ static void gimp_magnify_tool_button_press (GimpTool *tool, GimpCoords *coords, guint32 time, - GdkModifierType state, - GimpDisplay *display) + GdkModifierType state, + GimpDisplay *display) { GimpMagnifyTool *magnify = GIMP_MAGNIFY_TOOL (tool); @@ -160,8 +160,8 @@ static void gimp_magnify_tool_button_release (GimpTool *tool, GimpCoords *coords, guint32 time, - GdkModifierType state, - GimpDisplay *display) + GdkModifierType state, + GimpDisplay *display) { GimpMagnifyTool *magnify = GIMP_MAGNIFY_TOOL (tool); GimpMagnifyOptions *options; @@ -248,8 +248,8 @@ static void gimp_magnify_tool_motion (GimpTool *tool, GimpCoords *coords, guint32 time, - GdkModifierType state, - GimpDisplay *display) + GdkModifierType state, + GimpDisplay *display) { GimpMagnifyTool *magnify = GIMP_MAGNIFY_TOOL (tool); @@ -265,8 +265,8 @@ static void gimp_magnify_tool_modifier_key (GimpTool *tool, GdkModifierType key, gboolean press, - GdkModifierType state, - GimpDisplay *display) + GdkModifierType state, + GimpDisplay *display) { GimpMagnifyOptions *options; @@ -293,8 +293,8 @@ gimp_magnify_tool_modifier_key (GimpTool *tool, static void gimp_magnify_tool_cursor_update (GimpTool *tool, GimpCoords *coords, - GdkModifierType state, - GimpDisplay *display) + GdkModifierType state, + GimpDisplay *display) { GimpMagnifyOptions *options; diff --git a/app/tools/gimpmeasuretool.c b/app/tools/gimpmeasuretool.c index 233d131090..1008fa6352 100644 --- a/app/tools/gimpmeasuretool.c +++ b/app/tools/gimpmeasuretool.c @@ -200,8 +200,8 @@ gimp_measure_tool_button_press (GimpTool *tool, * the new function will be moving or adding a new point or guide */ for (i = 0; i < mtool->num_points; i++) - { - if (gimp_draw_tool_on_handle (GIMP_DRAW_TOOL (tool), display, + { + if (gimp_draw_tool_on_handle (GIMP_DRAW_TOOL (tool), display, coords->x, coords->y, GIMP_HANDLE_CIRCLE, @@ -210,10 +210,10 @@ gimp_measure_tool_button_press (GimpTool *tool, TARGET, TARGET, GTK_ANCHOR_CENTER, FALSE)) - { - if (state & (GDK_CONTROL_MASK | GDK_MOD1_MASK)) - { - GimpGuide *guide; + { + if (state & (GDK_CONTROL_MASK | GDK_MOD1_MASK)) + { + GimpGuide *guide; gboolean create_hguide; gboolean create_vguide; @@ -229,42 +229,42 @@ gimp_measure_tool_button_press (GimpTool *tool, 0, display->image->width))); - if (create_hguide && create_vguide) - gimp_image_undo_group_start (display->image, + if (create_hguide && create_vguide) + gimp_image_undo_group_start (display->image, GIMP_UNDO_GROUP_IMAGE_GUIDE, _("Add Guides")); - if (create_hguide) - { - guide = gimp_image_add_hguide (display->image, + if (create_hguide) + { + guide = gimp_image_add_hguide (display->image, mtool->y[i], TRUE); - gimp_image_update_guide (display->image, guide); - } + gimp_image_update_guide (display->image, guide); + } - if (create_vguide) - { - guide = gimp_image_add_vguide (display->image, + if (create_vguide) + { + guide = gimp_image_add_vguide (display->image, mtool->x[i], TRUE); - gimp_image_update_guide (display->image, guide); - } + gimp_image_update_guide (display->image, guide); + } - if (create_hguide && create_vguide) - gimp_image_undo_group_end (display->image); + if (create_hguide && create_vguide) + gimp_image_undo_group_end (display->image); - if (create_hguide || create_vguide) + if (create_hguide || create_vguide) gimp_image_flush (display->image); - mtool->function = GUIDING; - break; - } + mtool->function = GUIDING; + break; + } - mtool->function = (state & GDK_SHIFT_MASK) ? ADDING : MOVING; - mtool->point = i; - break; - } - } + mtool->function = (state & GDK_SHIFT_MASK) ? ADDING : MOVING; + mtool->point = i; + break; + } + } /* adding to the middle point makes no sense */ if (i == 0 && @@ -276,28 +276,28 @@ gimp_measure_tool_button_press (GimpTool *tool, /* if the function is still CREATING, we are outside the handles */ if (mtool->function == CREATING) - { - if (mtool->num_points > 1 && (state & GDK_MOD1_MASK)) - { - mtool->function = MOVING_ALL; + { + if (mtool->num_points > 1 && (state & GDK_MOD1_MASK)) + { + mtool->function = MOVING_ALL; mtool->last_x = coords->x; mtool->last_y = coords->y; - } - } + } + } } if (mtool->function == CREATING) { if (gimp_tool_control_is_active (tool->control)) - { - gimp_draw_tool_stop (GIMP_DRAW_TOOL (mtool)); + { + gimp_draw_tool_stop (GIMP_DRAW_TOOL (mtool)); mtool->x[0] = mtool->x[1] = mtool->x[2] = 0.0; mtool->y[0] = mtool->y[1] = mtool->y[2] = 0.0; gimp_measure_tool_dialog_update (mtool, display); - } + } /* set the first point and go into ADDING mode */ mtool->x[0] = coords->x + 0.5; @@ -310,8 +310,8 @@ gimp_measure_tool_button_press (GimpTool *tool, tool->display = display; if (gimp_tool_control_is_active (tool->control)) - { - gimp_tool_replace_status (tool, display, " "); + { + gimp_tool_replace_status (tool, display, " "); } else { @@ -377,28 +377,28 @@ gimp_measure_tool_motion (GimpTool *tool, { case ADDING: switch (mtool->point) - { - case 0: /* we are adding to the start point */ - break; - case 1: /* we are adding to the end point, + { + case 0: /* we are adding to the start point */ + break; + case 1: /* we are adding to the end point, make it the new start point */ - tmp = mtool->x[0]; - mtool->x[0] = mtool->x[1]; - mtool->x[1] = tmp; - tmp = mtool->y[0]; - mtool->y[0] = mtool->y[1]; - mtool->y[1] = tmp; - break; - case 2: /* we are adding to the third point, + tmp = mtool->x[0]; + mtool->x[0] = mtool->x[1]; + mtool->x[1] = tmp; + tmp = mtool->y[0]; + mtool->y[0] = mtool->y[1]; + mtool->y[1] = tmp; + break; + case 2: /* we are adding to the third point, make it the new start point */ - mtool->x[1] = mtool->x[0]; - mtool->y[1] = mtool->y[0]; - mtool->x[0] = mtool->x[2]; - mtool->y[0] = mtool->y[2]; - break; - default: - break; - } + mtool->x[1] = mtool->x[0]; + mtool->y[1] = mtool->y[0]; + mtool->x[0] = mtool->x[2]; + mtool->y[0] = mtool->y[2]; + break; + default: + break; + } mtool->num_points = MIN (mtool->num_points + 1, 3); mtool->point = mtool->num_points - 1; mtool->function = MOVING; @@ -408,22 +408,22 @@ gimp_measure_tool_motion (GimpTool *tool, /* if we are moving the start point and only have two, make it the end point */ if (mtool->num_points == 2 && mtool->point == 0) - { - tmp = mtool->x[0]; - mtool->x[0] = mtool->x[1]; - mtool->x[1] = tmp; - tmp = mtool->y[0]; - mtool->y[0] = mtool->y[1]; - mtool->y[1] = tmp; - mtool->point = 1; - } + { + tmp = mtool->x[0]; + mtool->x[0] = mtool->x[1]; + mtool->x[1] = tmp; + tmp = mtool->y[0]; + mtool->y[0] = mtool->y[1]; + mtool->y[1] = tmp; + mtool->point = 1; + } i = mtool->point; mtool->x[i] = ROUND (coords->x); mtool->y[i] = ROUND (coords->y); if (state & GDK_CONTROL_MASK) - { + { gdouble x = mtool->x[i]; gdouble y = mtool->y[i]; @@ -439,10 +439,10 @@ gimp_measure_tool_motion (GimpTool *tool, dy = ROUND (coords->y) - mtool->last_y; for (i = 0; i < mtool->num_points; i++) - { - mtool->x[i] += dx; - mtool->y[i] += dy; - } + { + mtool->x[i] += dx; + mtool->y[i] += dy; + } mtool->last_x = ROUND (coords->x); mtool->last_y = ROUND (coords->y); @@ -494,8 +494,8 @@ gimp_measure_tool_cursor_update (GimpTool *tool, if (gimp_tool_control_is_active (tool->control) && tool->display == display) { for (i = 0; i < mtool->num_points; i++) - { - if (gimp_draw_tool_on_handle (GIMP_DRAW_TOOL (tool), display, + { + if (gimp_draw_tool_on_handle (GIMP_DRAW_TOOL (tool), display, coords->x, coords->y, GIMP_HANDLE_CIRCLE, @@ -504,35 +504,35 @@ gimp_measure_tool_cursor_update (GimpTool *tool, TARGET, TARGET, GTK_ANCHOR_CENTER, FALSE)) - { - in_handle = TRUE; + { + in_handle = TRUE; - if (state & GDK_CONTROL_MASK) - { - if (state & GDK_MOD1_MASK) - cursor = GDK_BOTTOM_RIGHT_CORNER; - else - cursor = GDK_BOTTOM_SIDE; - break; - } + if (state & GDK_CONTROL_MASK) + { + if (state & GDK_MOD1_MASK) + cursor = GDK_BOTTOM_RIGHT_CORNER; + else + cursor = GDK_BOTTOM_SIDE; + break; + } - if (state & GDK_MOD1_MASK) - { - cursor = GDK_RIGHT_SIDE; - break; - } + if (state & GDK_MOD1_MASK) + { + cursor = GDK_RIGHT_SIDE; + break; + } - if (state & GDK_SHIFT_MASK) - modifier = GIMP_CURSOR_MODIFIER_PLUS; - else - modifier = GIMP_CURSOR_MODIFIER_MOVE; + if (state & GDK_SHIFT_MASK) + modifier = GIMP_CURSOR_MODIFIER_PLUS; + else + modifier = GIMP_CURSOR_MODIFIER_MOVE; - if (i == 0 && mtool->num_points == 3 && - modifier == GIMP_CURSOR_MODIFIER_PLUS) - modifier = GIMP_CURSOR_MODIFIER_MOVE; - break; - } - } + if (i == 0 && mtool->num_points == 3 && + modifier == GIMP_CURSOR_MODIFIER_PLUS) + modifier = GIMP_CURSOR_MODIFIER_MOVE; + break; + } + } if (! in_handle && mtool->num_points > 1 && state & GDK_MOD1_MASK) modifier = GIMP_CURSOR_MODIFIER_MOVE; @@ -556,7 +556,7 @@ gimp_measure_tool_draw (GimpDrawTool *draw_tool) for (i = 0; i < mtool->num_points; i++) { if (i == 0 && mtool->num_points == 3) - { + { gimp_draw_tool_draw_handle (draw_tool, GIMP_HANDLE_CIRCLE, mtool->x[i], @@ -565,9 +565,9 @@ gimp_measure_tool_draw (GimpDrawTool *draw_tool) TARGET, GTK_ANCHOR_CENTER, FALSE); - } + } else - { + { gimp_draw_tool_draw_handle (draw_tool, GIMP_HANDLE_CROSS, mtool->x[i], @@ -576,10 +576,10 @@ gimp_measure_tool_draw (GimpDrawTool *draw_tool) TARGET * 2, GTK_ANCHOR_CENTER, FALSE); - } + } if (i > 0) - { + { gimp_draw_tool_draw_line (draw_tool, mtool->x[0], mtool->y[0], @@ -587,7 +587,7 @@ gimp_measure_tool_draw (GimpDrawTool *draw_tool) mtool->y[i], FALSE); - /* only draw the arc if the lines are long enough */ + /* only draw the arc if the lines are long enough */ if (gimp_draw_tool_calc_distance (draw_tool, tool->display, mtool->x[0], mtool->y[0], @@ -596,7 +596,7 @@ gimp_measure_tool_draw (GimpDrawTool *draw_tool) { draw_arc++; } - } + } } if (mtool->num_points > 1 && draw_arc == mtool->num_points - 1) @@ -605,12 +605,12 @@ gimp_measure_tool_draw (GimpDrawTool *draw_tool) angle2 = (mtool->angle1 - mtool->angle2) * 64.0; if (angle2 > 11520) - angle2 -= 23040; + angle2 -= 23040; if (angle2 < -11520) - angle2 += 23040; + angle2 += 23040; if (angle2 != 0) - { + { gimp_draw_tool_draw_arc_by_anchor (draw_tool, FALSE, mtool->x[0], @@ -621,7 +621,7 @@ gimp_measure_tool_draw (GimpDrawTool *draw_tool) GTK_ANCHOR_CENTER, FALSE); - if (mtool->num_points == 2) + if (mtool->num_points == 2) { GimpDisplayShell *shell; gdouble target; @@ -641,7 +641,7 @@ gimp_measure_tool_draw (GimpDrawTool *draw_tool) mtool->y[0], FALSE); } - } + } } } @@ -672,7 +672,7 @@ gimp_measure_tool_get_angle (gint dx, if (dx) angle = gimp_rad_to_deg (atan (((gdouble) (dy) / yres) / - ((gdouble) (dx) / xres))); + ((gdouble) (dx) / xres))); else if (dy) angle = dy > 0 ? 270.0 : 90.0; else @@ -681,9 +681,9 @@ gimp_measure_tool_get_angle (gint dx, if (dx > 0) { if (dy > 0) - angle = 360.0 - angle; + angle = 360.0 - angle; else - angle = -angle; + angle = -angle; } else { diff --git a/app/tools/gimpmovetool.c b/app/tools/gimpmovetool.c index 80c81fb45f..9d4e76ce98 100644 --- a/app/tools/gimpmovetool.c +++ b/app/tools/gimpmovetool.c @@ -178,7 +178,7 @@ gimp_move_tool_control (GimpTool *tool, case RESUME: if (move->guide && gimp_display_shell_get_show_guides (GIMP_DISPLAY_SHELL (shell))) - gimp_display_shell_draw_guide (GIMP_DISPLAY_SHELL (shell), + gimp_display_shell_draw_guide (GIMP_DISPLAY_SHELL (shell), move->guide, TRUE); break; @@ -374,31 +374,31 @@ gimp_move_tool_button_release (GimpTool *tool, gimp_display_shell_untransform_viewport (shell, &x, &y, &width, &height); switch (move->guide_orientation) - { - case GIMP_ORIENTATION_HORIZONTAL: - if ((move->guide_position < y) || + { + case GIMP_ORIENTATION_HORIZONTAL: + if ((move->guide_position < y) || (move->guide_position > (y + height))) - delete_guide = TRUE; - break; + delete_guide = TRUE; + break; - case GIMP_ORIENTATION_VERTICAL: - if ((move->guide_position < x) || + case GIMP_ORIENTATION_VERTICAL: + if ((move->guide_position < x) || (move->guide_position > (x + width))) - delete_guide = TRUE; - break; + delete_guide = TRUE; + break; - default: - break; - } + default: + break; + } if (delete_guide) - { + { if (move->guide) { gimp_image_remove_guide (display->image, move->guide, TRUE); move->guide = NULL; } - } + } else { if (move->guide) @@ -432,7 +432,7 @@ gimp_move_tool_button_release (GimpTool *tool, gimp_image_flush (display->image); if (move->guide) - gimp_display_shell_draw_guide (shell, move->guide, TRUE); + gimp_display_shell_draw_guide (shell, move->guide, TRUE); move->moving_guide = FALSE; move->guide_position = -1; @@ -459,13 +459,13 @@ gimp_move_tool_button_release (GimpTool *tool, /* Take care of the case where the user "cancels" the action */ if (! (state & GDK_BUTTON3_MASK)) - { - if (move->floating_layer) - { - floating_sel_anchor (move->floating_layer); - gimp_image_flush (display->image); - } - } + { + if (move->floating_layer) + { + floating_sel_anchor (move->floating_layer); + gimp_image_flush (display->image); + } + } } } @@ -494,11 +494,11 @@ gimp_move_tool_motion (GimpTool *tool, if (tx < 0 || tx >= shell->disp_width || ty < 0 || ty >= shell->disp_height) - { - move->guide_position = -1; + { + move->guide_position = -1; delete_guide = TRUE; - } + } else { gint x, y, width, height; @@ -555,8 +555,8 @@ static void gimp_move_tool_modifier_key (GimpTool *tool, GdkModifierType key, gboolean press, - GdkModifierType state, - GimpDisplay *display) + GdkModifierType state, + GimpDisplay *display) { GimpMoveTool *move = GIMP_MOVE_TOOL (tool); GimpMoveOptions *options = GIMP_MOVE_OPTIONS (tool->tool_info->tool_options); @@ -706,29 +706,29 @@ gimp_move_tool_cursor_update (GimpTool *tool, cursor = GIMP_CURSOR_MOUSE; tool_cursor = GIMP_TOOL_CURSOR_HAND; modifier = GIMP_CURSOR_MODIFIER_MOVE; - } + } else if ((layer = gimp_image_pick_correlate_layer (display->image, coords->x, coords->y))) - { - /* if there is a floating selection, and this aint it... */ - if (gimp_image_floating_sel (display->image) && - ! gimp_layer_is_floating_sel (layer)) - { + { + /* if there is a floating selection, and this aint it... */ + if (gimp_image_floating_sel (display->image) && + ! gimp_layer_is_floating_sel (layer)) + { cursor = GIMP_CURSOR_MOUSE; tool_cursor = GIMP_TOOL_CURSOR_MOVE; modifier = GIMP_CURSOR_MODIFIER_ANCHOR; - } - else if (layer == gimp_image_get_active_layer (display->image)) - { + } + else if (layer == gimp_image_get_active_layer (display->image)) + { cursor = GIMP_CURSOR_MOUSE; - } - else - { + } + else + { cursor = GIMP_CURSOR_MOUSE; tool_cursor = GIMP_TOOL_CURSOR_HAND; modifier = GIMP_CURSOR_MODIFIER_MOVE; - } - } + } + } } gimp_tool_control_set_cursor (tool->control, cursor); @@ -771,7 +771,7 @@ gimp_move_tool_draw (GimpDrawTool *draw_tool) void gimp_move_tool_start_hguide (GimpTool *tool, - GimpDisplay *display) + GimpDisplay *display) { g_return_if_fail (GIMP_IS_MOVE_TOOL (tool)); g_return_if_fail (GIMP_IS_DISPLAY (display)); @@ -782,7 +782,7 @@ gimp_move_tool_start_hguide (GimpTool *tool, void gimp_move_tool_start_vguide (GimpTool *tool, - GimpDisplay *display) + GimpDisplay *display) { g_return_if_fail (GIMP_IS_MOVE_TOOL (tool)); g_return_if_fail (GIMP_IS_DISPLAY (display)); diff --git a/app/tools/gimpmovetool.h b/app/tools/gimpmovetool.h index df85ae3f54..a95782f2ec 100644 --- a/app/tools/gimpmovetool.h +++ b/app/tools/gimpmovetool.h @@ -64,9 +64,9 @@ GType gimp_move_tool_get_type (void) G_GNUC_CONST; void gimp_move_tool_start_hguide (GimpTool *tool, - GimpDisplay *display); + GimpDisplay *display); void gimp_move_tool_start_vguide (GimpTool *tool, - GimpDisplay *display); + GimpDisplay *display); #endif /* __GIMP_MOVE_TOOL_H__ */ diff --git a/app/tools/gimppainttool.c b/app/tools/gimppainttool.c index b8845f1442..4f4d6690d1 100644 --- a/app/tools/gimppainttool.c +++ b/app/tools/gimppainttool.c @@ -66,7 +66,7 @@ static GObject * gimp_paint_tool_constructor (GType type, GObjectConstructParam *params); static void gimp_paint_tool_finalize (GObject *object); -static void gimp_paint_tool_control (GimpTool *tool, +static void gimp_paint_tool_control (GimpTool *tool, GimpToolAction action, GimpDisplay *display); static void gimp_paint_tool_button_press (GimpTool *tool, @@ -259,8 +259,8 @@ gimp_paint_tool_enable_color_picker (GimpPaintTool *tool, static void gimp_paint_tool_control (GimpTool *tool, - GimpToolAction action, - GimpDisplay *display) + GimpToolAction action, + GimpDisplay *display) { GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool); GimpDrawable *drawable; @@ -344,8 +344,8 @@ static void gimp_paint_tool_button_press (GimpTool *tool, GimpCoords *coords, guint32 time, - GdkModifierType state, - GimpDisplay *display) + GdkModifierType state, + GimpDisplay *display) { GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool); GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool); @@ -452,8 +452,8 @@ static void gimp_paint_tool_button_release (GimpTool *tool, GimpCoords *coords, guint32 time, - GdkModifierType state, - GimpDisplay *display) + GdkModifierType state, + GimpDisplay *display) { GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool); GimpPaintOptions *paint_options; @@ -493,8 +493,8 @@ static void gimp_paint_tool_motion (GimpTool *tool, GimpCoords *coords, guint32 time, - GdkModifierType state, - GimpDisplay *display) + GdkModifierType state, + GimpDisplay *display) { GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool); GimpPaintOptions *paint_options; @@ -756,8 +756,8 @@ gimp_paint_tool_draw (GimpDrawTool *draw_tool) { TempBuf *mask = gimp_brush_get_mask (brush_core->main_brush); PixelRegion PR = { 0, }; - BoundSeg *boundary; - gint num_groups; + BoundSeg *boundary; + gint num_groups; pixel_region_init_temp_buf (&PR, mask, 0, 0, mask->width, mask->height); @@ -771,9 +771,9 @@ gimp_paint_tool_draw (GimpDrawTool *draw_tool) boundary_sort (boundary, brush_core->n_brush_bound_segs, &num_groups); - brush_core->n_brush_bound_segs += num_groups; + brush_core->n_brush_bound_segs += num_groups; - g_free (boundary); + g_free (boundary); brush_core->brush_bound_width = mask->width; brush_core->brush_bound_height = mask->height; diff --git a/app/tools/gimpposterizetool.c b/app/tools/gimpposterizetool.c index 84b2f8a271..d44edde420 100644 --- a/app/tools/gimpposterizetool.c +++ b/app/tools/gimpposterizetool.c @@ -122,7 +122,7 @@ gimp_posterize_tool_finalize (GObject *object) static gboolean gimp_posterize_tool_initialize (GimpTool *tool, - GimpDisplay *display) + GimpDisplay *display) { GimpPosterizeTool *posterize_tool = GIMP_POSTERIZE_TOOL (tool); GimpDrawable *drawable; @@ -211,7 +211,7 @@ gimp_posterize_tool_reset (GimpImageMapTool *image_map_tool) static void posterize_levels_adjustment_update (GtkAdjustment *adjustment, - GimpPosterizeTool *posterize_tool) + GimpPosterizeTool *posterize_tool) { if (posterize_tool->levels != adjustment->value) { diff --git a/app/tools/gimprotatetool.c b/app/tools/gimprotatetool.c index 424746b24c..fcb2e7656a 100644 --- a/app/tools/gimprotatetool.c +++ b/app/tools/gimprotatetool.c @@ -142,7 +142,7 @@ gimp_rotate_tool_dialog (GimpTransformTool *tr_tool) 0.0, 0.5, button, 1, TRUE); g_signal_connect (rotate->angle_adj, "value-changed", - G_CALLBACK (rotate_angle_changed), + G_CALLBACK (rotate_angle_changed), tr_tool); scale = gtk_hscale_new (GTK_ADJUSTMENT (rotate->angle_adj)); diff --git a/app/tools/gimpsheartool.c b/app/tools/gimpsheartool.c index 17a31c0100..7b2c39f7bd 100644 --- a/app/tools/gimpsheartool.c +++ b/app/tools/gimpsheartool.c @@ -139,7 +139,7 @@ gimp_shear_tool_dialog (GimpTransformTool *tr_tool) 0.0, 0.5, button, 1, TRUE); g_signal_connect (shear->x_adj, "value-changed", - G_CALLBACK (shear_x_mag_changed), + G_CALLBACK (shear_x_mag_changed), tr_tool); button = gimp_spin_button_new (&shear->y_adj, @@ -149,7 +149,7 @@ gimp_shear_tool_dialog (GimpTransformTool *tr_tool) 0.0, 0.5, button, 1, TRUE); g_signal_connect (shear->y_adj, "value-changed", - G_CALLBACK (shear_y_mag_changed), + G_CALLBACK (shear_y_mag_changed), tr_tool); } diff --git a/app/tools/gimptexttool.c b/app/tools/gimptexttool.c index dbe64de6cc..f788286c1c 100644 --- a/app/tools/gimptexttool.c +++ b/app/tools/gimptexttool.c @@ -234,8 +234,8 @@ gimp_text_tool_finalize (GObject *object) static void gimp_text_tool_control (GimpTool *tool, - GimpToolAction action, - GimpDisplay *display) + GimpToolAction action, + GimpDisplay *display) { GimpTextTool *text_tool = GIMP_TEXT_TOOL (tool); @@ -255,10 +255,10 @@ gimp_text_tool_control (GimpTool *tool, static void gimp_text_tool_button_press (GimpTool *tool, - GimpCoords *coords, - guint32 time, - GdkModifierType state, - GimpDisplay *display) + GimpCoords *coords, + guint32 time, + GdkModifierType state, + GimpDisplay *display) { GimpTextTool *text_tool = GIMP_TEXT_TOOL (tool); GimpText *text = text_tool->text; @@ -303,9 +303,9 @@ gimp_text_tool_button_press (GimpTool *tool, static void gimp_text_tool_cursor_update (GimpTool *tool, - GimpCoords *coords, - GdkModifierType state, - GimpDisplay *display) + GimpCoords *coords, + GdkModifierType state, + GimpDisplay *display) { /* FIXME: should do something fancy here... */ @@ -757,7 +757,7 @@ gimp_text_tool_editor (GimpTextTool *text_tool) _("GIMP Text Editor")); g_object_add_weak_pointer (G_OBJECT (text_tool->editor), - (gpointer *) &text_tool->editor); + (gpointer *) &text_tool->editor); gimp_dialog_factory_add_foreign (dialog_factory, "gimp-text-tool-dialog", diff --git a/app/tools/gimpthresholdtool.c b/app/tools/gimpthresholdtool.c index 976b7aedbd..43856ee6e1 100644 --- a/app/tools/gimpthresholdtool.c +++ b/app/tools/gimpthresholdtool.c @@ -142,7 +142,7 @@ gimp_threshold_tool_finalize (GObject *object) static gboolean gimp_threshold_tool_initialize (GimpTool *tool, - GimpDisplay *display) + GimpDisplay *display) { GimpThresholdTool *t_tool = GIMP_THRESHOLD_TOOL (tool); GimpDrawable *drawable; diff --git a/app/tools/gimptool.h b/app/tools/gimptool.h index 3542ca2001..91984d3859 100644 --- a/app/tools/gimptool.h +++ b/app/tools/gimptool.h @@ -107,7 +107,7 @@ GType gimp_tool_get_type (void) G_GNUC_CONST; gboolean gimp_tool_initialize (GimpTool *tool, GimpDisplay *display); -void gimp_tool_control (GimpTool *tool, +void gimp_tool_control (GimpTool *tool, GimpToolAction action, GimpDisplay *display); diff --git a/app/tools/gimptransformtool-undo.c b/app/tools/gimptransformtool-undo.c index 3b9c1a817b..aad5090af5 100644 --- a/app/tools/gimptransformtool-undo.c +++ b/app/tools/gimptransformtool-undo.c @@ -83,7 +83,7 @@ gimp_transform_tool_push_undo (GimpImage *image, tu->tool_type = tool_type; for (i = 0; i < TRAN_INFO_SIZE; i++) - tu->trans_info[i] = trans_info[i]; + tu->trans_info[i] = trans_info[i]; if (original) tu->original = tile_manager_ref (original); diff --git a/app/tools/tool_manager.c b/app/tools/tool_manager.c index e0e31f8d72..891edeba01 100644 --- a/app/tools/tool_manager.c +++ b/app/tools/tool_manager.c @@ -88,19 +88,19 @@ tool_manager_init (Gimp *gimp) tool_manager->image_clean_handler_id = gimp_container_add_handler (gimp->images, "clean", - G_CALLBACK (tool_manager_image_clean_dirty), - tool_manager); + G_CALLBACK (tool_manager_image_clean_dirty), + tool_manager); tool_manager->image_dirty_handler_id = gimp_container_add_handler (gimp->images, "dirty", - G_CALLBACK (tool_manager_image_clean_dirty), - tool_manager); + G_CALLBACK (tool_manager_image_clean_dirty), + tool_manager); user_context = gimp_get_user_context (gimp); g_signal_connect (user_context, "tool-changed", - G_CALLBACK (tool_manager_tool_changed), - tool_manager); + G_CALLBACK (tool_manager_tool_changed), + tool_manager); } void @@ -114,9 +114,9 @@ tool_manager_exit (Gimp *gimp) tool_manager_set (gimp, NULL); gimp_container_remove_handler (gimp->images, - tool_manager->image_clean_handler_id); + tool_manager->image_clean_handler_id); gimp_container_remove_handler (gimp->images, - tool_manager->image_dirty_handler_id); + tool_manager->image_dirty_handler_id); if (tool_manager->active_tool) g_object_unref (tool_manager->active_tool); @@ -138,7 +138,7 @@ tool_manager_get_active (Gimp *gimp) void tool_manager_select_tool (Gimp *gimp, - GimpTool *tool) + GimpTool *tool) { GimpToolManager *tool_manager; @@ -167,7 +167,7 @@ tool_manager_select_tool (Gimp *gimp, void tool_manager_push_tool (Gimp *gimp, - GimpTool *tool) + GimpTool *tool) { GimpToolManager *tool_manager; @@ -179,7 +179,7 @@ tool_manager_push_tool (Gimp *gimp, if (tool_manager->active_tool) { tool_manager->tool_stack = g_slist_prepend (tool_manager->tool_stack, - tool_manager->active_tool); + tool_manager->active_tool); g_object_ref (tool_manager->tool_stack->data); } @@ -199,12 +199,12 @@ tool_manager_pop_tool (Gimp *gimp) if (tool_manager->tool_stack) { tool_manager_select_tool (gimp, - GIMP_TOOL (tool_manager->tool_stack->data)); + GIMP_TOOL (tool_manager->tool_stack->data)); g_object_unref (tool_manager->tool_stack->data); tool_manager->tool_stack = g_slist_remove (tool_manager->tool_stack, - tool_manager->active_tool); + tool_manager->active_tool); } } @@ -237,8 +237,8 @@ tool_manager_initialize_active (Gimp *gimp, void tool_manager_control_active (Gimp *gimp, - GimpToolAction action, - GimpDisplay *display) + GimpToolAction action, + GimpDisplay *display) { GimpToolManager *tool_manager; @@ -439,7 +439,7 @@ tool_manager_get (Gimp *gimp) static void tool_manager_set (Gimp *gimp, - GimpToolManager *tool_manager) + GimpToolManager *tool_manager) { if (! tool_manager_quark) tool_manager_quark = g_quark_from_static_string ("gimp-tool-manager"); @@ -449,8 +449,8 @@ tool_manager_set (Gimp *gimp, static void tool_manager_tool_changed (GimpContext *user_context, - GimpToolInfo *tool_info, - gpointer data) + GimpToolInfo *tool_info, + gpointer data) { GimpToolManager *tool_manager = data; GimpTool *new_tool = NULL; @@ -467,20 +467,20 @@ tool_manager_tool_changed (GimpContext *user_context, g_signal_stop_emission_by_name (user_context, "tool-changed"); if (G_TYPE_FROM_INSTANCE (tool_manager->active_tool) != - tool_info->tool_type) - { - g_signal_handlers_block_by_func (user_context, - tool_manager_tool_changed, - data); + tool_info->tool_type) + { + g_signal_handlers_block_by_func (user_context, + tool_manager_tool_changed, + data); - /* explicitly set the current tool */ - gimp_context_set_tool (user_context, + /* explicitly set the current tool */ + gimp_context_set_tool (user_context, tool_manager->active_tool->tool_info); - g_signal_handlers_unblock_by_func (user_context, - tool_manager_tool_changed, - data); - } + g_signal_handlers_unblock_by_func (user_context, + tool_manager_tool_changed, + data); + } return; } @@ -494,7 +494,7 @@ tool_manager_tool_changed (GimpContext *user_context, else { g_warning ("%s: tool_info->tool_type is no GimpTool subclass", - G_STRFUNC); + G_STRFUNC); return; } diff --git a/app/tools/tools-types.h b/app/tools/tools-types.h index d72c99bcba..70defa7757 100644 --- a/app/tools/tools-types.h +++ b/app/tools/tools-types.h @@ -60,7 +60,7 @@ typedef void (* GimpToolRegisterCallback) (GType tool_type, gpointer register_data); typedef void (* GimpToolRegisterFunc) (GimpToolRegisterCallback callback, - gpointer register_data); + gpointer register_data); G_END_DECLS diff --git a/app/widgets/gimpactiongroup.c b/app/widgets/gimpactiongroup.c index 896183e138..1b1a17b17b 100644 --- a/app/widgets/gimpactiongroup.c +++ b/app/widgets/gimpactiongroup.c @@ -399,7 +399,7 @@ gimp_action_group_add_toggle_actions (GimpActionGroup *group, label = gimp_strip_uline (label); action = gtk_toggle_action_new (entries[i].name, label, tooltip, - entries[i].stock_id); + entries[i].stock_id); if (! group->mnemonics) g_free (label); @@ -450,20 +450,20 @@ gimp_action_group_add_radio_actions (GimpActionGroup *group, label = gimp_strip_uline (label); action = gtk_radio_action_new (entries[i].name, label, tooltip, - entries[i].stock_id, - entries[i].value); + entries[i].stock_id, + entries[i].value); if (! group->mnemonics) g_free (label); if (i == 0) - first_action = action; + first_action = action; gtk_radio_action_set_group (action, radio_group); radio_group = gtk_radio_action_get_group (action); if (value == entries[i].value) - gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE); + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE); gtk_action_group_add_action_with_accel (GTK_ACTION_GROUP (group), GTK_ACTION (action), @@ -508,8 +508,8 @@ gimp_action_group_add_enum_actions (GimpActionGroup *group, label = gimp_strip_uline (label); action = gimp_enum_action_new (entries[i].name, label, tooltip, - entries[i].stock_id, - entries[i].value, + entries[i].stock_id, + entries[i].value, entries[i].value_variable); if (! group->mnemonics) diff --git a/app/widgets/gimpactionview.c b/app/widgets/gimpactionview.c index 5351a15d9d..0eed946d16 100644 --- a/app/widgets/gimpactionview.c +++ b/app/widgets/gimpactionview.c @@ -138,8 +138,8 @@ gimp_action_view_button_press (GtkWidget *widget, if (gtk_tree_view_get_path_at_pos (tree_view, (gint) event->x, - (gint) event->y, - &path, NULL, + (gint) event->y, + &path, NULL, NULL, NULL)) { GClosure *closure; @@ -147,9 +147,9 @@ gimp_action_view_button_press (GtkWidget *widget, if (gtk_tree_path_get_depth (path) == 1) { - gtk_tree_path_free (path); - return FALSE; - } + gtk_tree_path_free (path); + return FALSE; + } g_object_set_data_full (G_OBJECT (tree_view), "start_editing_path", path, (GDestroyNotify) gtk_tree_path_free); diff --git a/app/widgets/gimpblobeditor.c b/app/widgets/gimpblobeditor.c index ce001bf111..7b1aad255b 100644 --- a/app/widgets/gimpblobeditor.c +++ b/app/widgets/gimpblobeditor.c @@ -108,9 +108,9 @@ gimp_blob_editor_init (GimpBlobEditor *editor) editor->active = FALSE; gtk_widget_add_events (GTK_WIDGET (editor), - GDK_BUTTON_PRESS_MASK | + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | - GDK_POINTER_MOTION_MASK | + GDK_POINTER_MOTION_MASK | GDK_EXPOSURE_MASK); } @@ -202,9 +202,9 @@ gimp_blob_editor_expose (GtkWidget *widget, gdk_draw_rectangle (widget->window, widget->style->bg_gc[widget->state], - TRUE, /* filled */ - rect.x, rect.y, - rect.width, rect.height); + TRUE, /* filled */ + rect.x, rect.y, + rect.width, rect.height); gtk_paint_shadow (widget->style, widget->window, widget->state, GTK_SHADOW_OUT, NULL, widget, NULL, @@ -261,12 +261,12 @@ gimp_blob_editor_motion_notify (GtkWidget *widget, rsquare = SQR (x) + SQR (y); if (rsquare > 0) - { + { gint r0; gdouble angle; gdouble aspect; - r0 = MIN (widget->allocation.width, widget->allocation.height) / 2; + r0 = MIN (widget->allocation.width, widget->allocation.height) / 2; angle = atan2 (y, x); aspect = 10.0 * sqrt ((gdouble) rsquare / (r0 * r0)) / 0.85; @@ -277,7 +277,7 @@ gimp_blob_editor_motion_notify (GtkWidget *widget, "blob-angle", angle, "blob-aspect", aspect, NULL); - } + } } return TRUE; diff --git a/app/widgets/gimpbrushfactoryview.h b/app/widgets/gimpbrushfactoryview.h index b2fa569b96..60b1faff1e 100644 --- a/app/widgets/gimpbrushfactoryview.h +++ b/app/widgets/gimpbrushfactoryview.h @@ -55,12 +55,12 @@ struct _GimpBrushFactoryViewClass GType gimp_brush_factory_view_get_type (void) G_GNUC_CONST; GtkWidget * gimp_brush_factory_view_new (GimpViewType view_type, - GimpDataFactory *factory, - GimpContext *context, - gboolean change_brush_spacing, - gint view_size, + GimpDataFactory *factory, + GimpContext *context, + gboolean change_brush_spacing, + gint view_size, gint view_border_width, - GimpMenuFactory *menu_factory); + GimpMenuFactory *menu_factory); #endif /* __GIMP_BRUSH_FACTORY_VIEW_H__ */ diff --git a/app/widgets/gimpbrushselect.c b/app/widgets/gimpbrushselect.c index 815c9c933f..179ee9ec41 100644 --- a/app/widgets/gimpbrushselect.c +++ b/app/widgets/gimpbrushselect.c @@ -187,13 +187,13 @@ gimp_brush_select_constructor (GType type, /* Create the paint mode option menu */ select->paint_mode_menu = gimp_paint_mode_menu_new (TRUE); gimp_table_attach_aligned (GTK_TABLE (table), 0, 2, - _("Mode:"), 0.0, 0.5, - select->paint_mode_menu, 2, FALSE); + _("Mode:"), 0.0, 0.5, + select->paint_mode_menu, 2, FALSE); gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (select->paint_mode_menu), gimp_context_get_paint_mode (dialog->context), G_CALLBACK (gimp_brush_select_mode_update), - select); + select); spacing_adj = GIMP_BRUSH_FACTORY_VIEW (dialog->view)->spacing_adjustment; @@ -294,14 +294,14 @@ gimp_brush_select_opacity_changed (GimpContext *context, { g_signal_handlers_block_by_func (select->opacity_data, gimp_brush_select_opacity_update, - select); + select); gtk_adjustment_set_value (GTK_ADJUSTMENT (select->opacity_data), - opacity * 100.0); + opacity * 100.0); g_signal_handlers_unblock_by_func (select->opacity_data, - gimp_brush_select_opacity_update, - select); + gimp_brush_select_opacity_update, + select); gimp_pdb_dialog_run_callback (GIMP_PDB_DIALOG (select), FALSE); } @@ -313,7 +313,7 @@ gimp_brush_select_mode_changed (GimpContext *context, { g_signal_handlers_block_by_func (select->paint_mode_menu, gimp_brush_select_mode_update, - select); + select); gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (select->paint_mode_menu), paint_mode); diff --git a/app/widgets/gimpbufferview.h b/app/widgets/gimpbufferview.h index 5cd8fb7ba6..25ad4fa16a 100644 --- a/app/widgets/gimpbufferview.h +++ b/app/widgets/gimpbufferview.h @@ -58,11 +58,11 @@ struct _GimpBufferViewClass GType gimp_buffer_view_get_type (void) G_GNUC_CONST; GtkWidget * gimp_buffer_view_new (GimpViewType view_type, - GimpContainer *container, - GimpContext *context, - gint view_size, + GimpContainer *container, + GimpContext *context, + gint view_size, gint view_border_width, - GimpMenuFactory *menu_factory); + GimpMenuFactory *menu_factory); #endif /* __GIMP_BUFFER_VIEW_H__ */ diff --git a/app/widgets/gimpcellrendereraccel.c b/app/widgets/gimpcellrendereraccel.c index 994c90c16b..df868e119c 100644 --- a/app/widgets/gimpcellrendereraccel.c +++ b/app/widgets/gimpcellrendereraccel.c @@ -96,7 +96,7 @@ gimp_cell_renderer_accel_class_init (GimpCellRendererAccelClass *klass) accel_cell_signals[ACCEL_EDITED] = g_signal_new ("accel-edited", - G_OBJECT_CLASS_TYPE (object_class), + G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GimpCellRendererAccelClass, accel_edited), NULL, NULL, diff --git a/app/widgets/gimpcellrendererdashes.c b/app/widgets/gimpcellrendererdashes.c index 72b4e705a5..9c5f51d724 100644 --- a/app/widgets/gimpcellrendererdashes.c +++ b/app/widgets/gimpcellrendererdashes.c @@ -151,21 +151,21 @@ gimp_cell_renderer_dashes_get_size (GtkCellRenderer *cell, if (cell_area) { if (x_offset) - { + { gdouble align; align = ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ? 1.0 - cell->xalign : cell->xalign); - *x_offset = align * (cell_area->width - DASHES_WIDTH); - *x_offset = MAX (*x_offset, 0) + cell->xpad; - } + *x_offset = align * (cell_area->width - DASHES_WIDTH); + *x_offset = MAX (*x_offset, 0) + cell->xpad; + } if (y_offset) - { - *y_offset = cell->yalign * (cell_area->height - DASHES_HEIGHT); - *y_offset = MAX (*y_offset, 0) + cell->ypad; - } + { + *y_offset = cell->yalign * (cell_area->height - DASHES_HEIGHT); + *y_offset = MAX (*y_offset, 0) + cell->ypad; + } } else { @@ -201,21 +201,21 @@ gimp_cell_renderer_dashes_render (GtkCellRenderer *cell, else if ((flags & GTK_CELL_RENDERER_SELECTED) == GTK_CELL_RENDERER_SELECTED) { if (GTK_WIDGET_HAS_FOCUS (widget)) - state = GTK_STATE_SELECTED; + state = GTK_STATE_SELECTED; else - state = GTK_STATE_ACTIVE; + state = GTK_STATE_ACTIVE; } else if ((flags & GTK_CELL_RENDERER_PRELIT) == GTK_CELL_RENDERER_PRELIT && - GTK_WIDGET_STATE (widget) == GTK_STATE_PRELIGHT) + GTK_WIDGET_STATE (widget) == GTK_STATE_PRELIGHT) { state = GTK_STATE_PRELIGHT; } else { if (GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE) - state = GTK_STATE_INSENSITIVE; + state = GTK_STATE_INSENSITIVE; else - state = GTK_STATE_NORMAL; + state = GTK_STATE_NORMAL; } y = cell_area->y + (cell_area->height - DASHES_HEIGHT) / 2; diff --git a/app/widgets/gimpcellrendererviewable.c b/app/widgets/gimpcellrendererviewable.c index 198cff20ed..fe2b492c6c 100644 --- a/app/widgets/gimpcellrendererviewable.c +++ b/app/widgets/gimpcellrendererviewable.c @@ -221,18 +221,18 @@ gimp_cell_renderer_viewable_get_size (GtkCellRenderer *cell, if (cell_area && view_width > 0 && view_height > 0) { if (x_offset) - { - *x_offset = (((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ? + { + *x_offset = (((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ? 1.0 - cell->xalign : cell->xalign) * (cell_area->width - calc_width - 2 * cell->xpad)); - *x_offset = (MAX (*x_offset, 0) + cell->xpad); - } + *x_offset = (MAX (*x_offset, 0) + cell->xpad); + } if (y_offset) - { - *y_offset = (cell->yalign * + { + *y_offset = (cell->yalign * (cell_area->height - calc_height - 2 * cell->ypad)); - *y_offset = (MAX (*y_offset, 0) + cell->ypad); - } + *y_offset = (MAX (*y_offset, 0) + cell->ypad); + } } if (width) *width = calc_width; diff --git a/app/widgets/gimpchanneltreeview.c b/app/widgets/gimpchanneltreeview.c index 4a77fb4b4e..eb9dcf2422 100644 --- a/app/widgets/gimpchanneltreeview.c +++ b/app/widgets/gimpchanneltreeview.c @@ -179,10 +179,10 @@ gimp_channel_tree_view_constructor (GType type, GDK_SHIFT_MASK | GDK_CONTROL_MASK, NULL); gimp_container_view_enable_dnd (GIMP_CONTAINER_VIEW (view), - GTK_BUTTON (view->toselection_button), - GIMP_TYPE_CHANNEL); + GTK_BUTTON (view->toselection_button), + GIMP_TYPE_CHANNEL); gtk_box_reorder_child (GTK_BOX (GIMP_EDITOR (view)->button_box), - view->toselection_button, 5); + view->toselection_button, 5); return object; } @@ -280,7 +280,7 @@ gimp_channel_tree_view_drop_component (GimpContainerTreeView *tree_view, static void gimp_channel_tree_view_set_image (GimpItemTreeView *item_view, - GimpImage *image) + GimpImage *image) { GimpChannelTreeView *channel_view = GIMP_CHANNEL_TREE_VIEW (item_view); diff --git a/app/widgets/gimpcolordialog.c b/app/widgets/gimpcolordialog.c index 7b8eb45841..aa95038b5b 100644 --- a/app/widgets/gimpcolordialog.c +++ b/app/widgets/gimpcolordialog.c @@ -142,13 +142,13 @@ gimp_color_dialog_init (GimpColorDialog *dialog) button = gtk_button_new (); gtk_table_attach_defaults (GTK_TABLE (table), button, 0, 1, 0, 1); gimp_help_set_help_data (button, - _("Add the current color to the color history"), - NULL); + _("Add the current color to the color history"), + NULL); gtk_widget_show (button); g_signal_connect (button, "clicked", - G_CALLBACK (gimp_color_history_add_clicked), - dialog); + G_CALLBACK (gimp_color_history_add_clicked), + dialog); arrow = gtk_arrow_new (GTK_ARROW_RIGHT, GTK_SHADOW_OUT); gtk_container_add (GTK_CONTAINER (button), arrow); @@ -177,12 +177,12 @@ gimp_color_dialog_init (GimpColorDialog *dialog) gtk_widget_show (dialog->history[i]); g_signal_connect (button, "clicked", - G_CALLBACK (gimp_color_history_color_clicked), - dialog); + G_CALLBACK (gimp_color_history_color_clicked), + dialog); g_signal_connect (dialog->history[i], "color-changed", - G_CALLBACK (gimp_color_history_color_changed), - GINT_TO_POINTER (i)); + G_CALLBACK (gimp_color_history_color_changed), + GINT_TO_POINTER (i)); } } diff --git a/app/widgets/gimpcolordisplayeditor.c b/app/widgets/gimpcolordisplayeditor.c index 38d4bf7fb5..6e5e85b9eb 100644 --- a/app/widgets/gimpcolordisplayeditor.c +++ b/app/widgets/gimpcolordisplayeditor.c @@ -132,8 +132,8 @@ gimp_color_display_editor_init (GimpColorDisplayEditor *editor) gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), - GTK_POLICY_AUTOMATIC, - GTK_POLICY_AUTOMATIC); + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); gtk_box_pack_start (GTK_BOX (hbox), scrolled_win, TRUE, TRUE, 0); gtk_widget_show (scrolled_win); @@ -219,8 +219,8 @@ gimp_color_display_editor_init (GimpColorDisplayEditor *editor) gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), - GTK_POLICY_AUTOMATIC, - GTK_POLICY_AUTOMATIC); + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); gtk_container_add (GTK_CONTAINER (ed), scrolled_win); gtk_widget_show (scrolled_win); diff --git a/app/widgets/gimpcoloreditor.c b/app/widgets/gimpcoloreditor.c index 9ce9ffce89..0e6a687839 100644 --- a/app/widgets/gimpcoloreditor.c +++ b/app/widgets/gimpcoloreditor.c @@ -146,9 +146,9 @@ gimp_color_editor_init (GimpColorEditor *editor) gtk_widget_style_get (GTK_WIDGET (editor), "content-spacing", &content_spacing, - "button-spacing", &button_spacing, + "button-spacing", &button_spacing, "button-icon-size", &button_icon_size, - NULL); + NULL); editor->hbox = gtk_hbox_new (TRUE, button_spacing); gtk_box_pack_start (GTK_BOX (editor), editor->hbox, FALSE, FALSE, 0); @@ -201,7 +201,7 @@ gimp_color_editor_init (GimpColorEditor *editor) gtk_widget_show (image); gimp_help_set_help_data (button, - selector_class->name, selector_class->help_id); + selector_class->name, selector_class->help_id); g_object_set_data (G_OBJECT (button), "selector", selector); g_object_set_data (G_OBJECT (selector), "button", button); @@ -407,11 +407,11 @@ gimp_color_editor_set_context (GimpDocked *docked, if (editor->context) { g_signal_handlers_disconnect_by_func (editor->context, - gimp_color_editor_fg_changed, - editor); + gimp_color_editor_fg_changed, + editor); g_signal_handlers_disconnect_by_func (editor->context, - gimp_color_editor_bg_changed, - editor); + gimp_color_editor_bg_changed, + editor); g_object_unref (editor->context); editor->context = NULL; @@ -424,11 +424,11 @@ gimp_color_editor_set_context (GimpDocked *docked, editor->context = g_object_ref (context); g_signal_connect (editor->context, "foreground-changed", - G_CALLBACK (gimp_color_editor_fg_changed), - editor); + G_CALLBACK (gimp_color_editor_fg_changed), + editor); g_signal_connect (editor->context, "background-changed", - G_CALLBACK (gimp_color_editor_bg_changed), - editor); + G_CALLBACK (gimp_color_editor_bg_changed), + editor); if (editor->edit_bg) { diff --git a/app/widgets/gimpcolorpanel.c b/app/widgets/gimpcolorpanel.c index ea6495535c..7f447f7516 100644 --- a/app/widgets/gimpcolorpanel.c +++ b/app/widgets/gimpcolorpanel.c @@ -157,7 +157,7 @@ gimp_color_panel_clicked (GtkButton *button) if (! panel->color_dialog) { panel->color_dialog = - gimp_color_dialog_new (NULL, + gimp_color_dialog_new (NULL, GIMP_COLOR_BUTTON (button)->title, NULL, NULL, GTK_WIDGET (button), @@ -189,10 +189,10 @@ gimp_color_panel_get_action_type (GimpColorButton *button) GtkWidget * gimp_color_panel_new (const gchar *title, - const GimpRGB *color, - GimpColorAreaType type, - gint width, - gint height) + const GimpRGB *color, + GimpColorAreaType type, + gint width, + gint height) { GimpColorPanel *panel; diff --git a/app/widgets/gimpcontainercombobox.h b/app/widgets/gimpcontainercombobox.h index fa5ef37f08..6a0caf2e59 100644 --- a/app/widgets/gimpcontainercombobox.h +++ b/app/widgets/gimpcontainercombobox.h @@ -52,7 +52,7 @@ struct _GimpContainerComboBoxClass GType gimp_container_combo_box_get_type (void) G_GNUC_CONST; GtkWidget * gimp_container_combo_box_new (GimpContainer *container, - GimpContext *context, + GimpContext *context, gint view_size, gint view_border_width); diff --git a/app/widgets/gimpcontainereditor.h b/app/widgets/gimpcontainereditor.h index 8281108d42..b27004ae5c 100644 --- a/app/widgets/gimpcontainereditor.h +++ b/app/widgets/gimpcontainereditor.h @@ -48,11 +48,11 @@ struct _GimpContainerEditorClass GtkVBoxClass parent_class; void (* select_item) (GimpContainerEditor *editor, - GimpViewable *object); + GimpViewable *object); void (* activate_item) (GimpContainerEditor *editor, - GimpViewable *object); + GimpViewable *object); void (* context_item) (GimpContainerEditor *editor, - GimpViewable *object); + GimpViewable *object); }; diff --git a/app/widgets/gimpcontainertreeview.h b/app/widgets/gimpcontainertreeview.h index 5ad5fec123..052a205d37 100644 --- a/app/widgets/gimpcontainertreeview.h +++ b/app/widgets/gimpcontainertreeview.h @@ -113,8 +113,8 @@ struct _GimpContainerTreeViewClass GType gimp_container_tree_view_get_type (void) G_GNUC_CONST; GtkWidget * gimp_container_tree_view_new (GimpContainer *container, - GimpContext *context, - gint view_size, + GimpContext *context, + gint view_size, gint view_border_width); diff --git a/app/widgets/gimpcontrollerlist.c b/app/widgets/gimpcontrollerlist.c index 5ec1a0fb43..47ded2f6bf 100644 --- a/app/widgets/gimpcontrollerlist.c +++ b/app/widgets/gimpcontrollerlist.c @@ -164,8 +164,8 @@ gimp_controller_list_init (GimpControllerList *list) gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_IN); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), - GTK_POLICY_AUTOMATIC, - GTK_POLICY_AUTOMATIC); + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); gtk_box_pack_start (GTK_BOX (hbox), sw, TRUE, TRUE, 0); gtk_widget_show (sw); diff --git a/app/widgets/gimpcursorview.c b/app/widgets/gimpcursorview.c index 14b6466568..8c1d0a4d46 100644 --- a/app/widgets/gimpcursorview.c +++ b/app/widgets/gimpcursorview.c @@ -111,7 +111,7 @@ gimp_cursor_view_init (GimpCursorView *view) gtk_widget_style_get (GTK_WIDGET (view), "content-spacing", &content_spacing, - NULL); + NULL); /* cursor information */ @@ -321,7 +321,7 @@ gimp_cursor_view_style_set (GtkWidget *widget, gtk_widget_style_get (GTK_WIDGET (view), "content-spacing", &content_spacing, - NULL); + NULL); gtk_box_set_spacing (GTK_BOX (view->coord_hbox), content_spacing); gtk_box_set_spacing (GTK_BOX (view->color_hbox), content_spacing); diff --git a/app/widgets/gimpdasheditor.c b/app/widgets/gimpdasheditor.c index c8bb478417..97c9dd13c0 100644 --- a/app/widgets/gimpdasheditor.c +++ b/app/widgets/gimpdasheditor.c @@ -329,8 +329,8 @@ gimp_dash_editor_button_press (GtkWidget *widget, if (bevent->button == 1 && bevent->type == GDK_BUTTON_PRESS) { gdk_pointer_grab (widget->window, FALSE, - GDK_BUTTON_RELEASE_MASK | GDK_BUTTON1_MOTION_MASK, - NULL, NULL, bevent->time); + GDK_BUTTON_RELEASE_MASK | GDK_BUTTON1_MOTION_MASK, + NULL, NULL, bevent->time); index = dash_x_to_index (editor, bevent->x); editor->edit_mode = ! editor->segments [index]; diff --git a/app/widgets/gimpdataeditor.c b/app/widgets/gimpdataeditor.c index b27483d819..5767407b9a 100644 --- a/app/widgets/gimpdataeditor.c +++ b/app/widgets/gimpdataeditor.c @@ -144,13 +144,13 @@ gimp_data_editor_init (GimpDataEditor *editor) gtk_widget_set_sensitive (editor->name_entry, FALSE); g_signal_connect (editor->name_entry, "key-press-event", - G_CALLBACK (gimp_data_editor_name_key_press), + G_CALLBACK (gimp_data_editor_name_key_press), editor); g_signal_connect (editor->name_entry, "activate", - G_CALLBACK (gimp_data_editor_name_activate), + G_CALLBACK (gimp_data_editor_name_activate), editor); g_signal_connect (editor->name_entry, "focus-out-event", - G_CALLBACK (gimp_data_editor_name_focus_out), + G_CALLBACK (gimp_data_editor_name_focus_out), editor); } @@ -507,7 +507,7 @@ gimp_data_editor_data_name_changed (GimpObject *object, GimpDataEditor *editor) { gtk_entry_set_text (GTK_ENTRY (editor->name_entry), - gimp_object_get_name (object)); + gimp_object_get_name (object)); } static void diff --git a/app/widgets/gimpdatafactoryview.h b/app/widgets/gimpdatafactoryview.h index aba1a6b801..356ac550c5 100644 --- a/app/widgets/gimpdatafactoryview.h +++ b/app/widgets/gimpdatafactoryview.h @@ -58,11 +58,11 @@ struct _GimpDataFactoryViewClass GType gimp_data_factory_view_get_type (void) G_GNUC_CONST; GtkWidget * gimp_data_factory_view_new (GimpViewType view_type, - GimpDataFactory *factory, - GimpContext *context, - gint view_size, + GimpDataFactory *factory, + GimpContext *context, + gint view_size, gint view_border_width, - GimpMenuFactory *menu_factory, + GimpMenuFactory *menu_factory, const gchar *menu_identifier, const gchar *ui_identifier, const gchar *action_group); @@ -71,12 +71,12 @@ GtkWidget * gimp_data_factory_view_new (GimpViewType view_type, /* protected */ gboolean gimp_data_factory_view_construct (GimpDataFactoryView *factory_view, - GimpViewType view_type, - GimpDataFactory *factory, - GimpContext *context, - gint view_size, + GimpViewType view_type, + GimpDataFactory *factory, + GimpContext *context, + gint view_size, gint view_border_width, - GimpMenuFactory *menu_factory, + GimpMenuFactory *menu_factory, const gchar *menu_identifier, const gchar *ui_identifier, const gchar *action_group); diff --git a/app/widgets/gimpdeviceinfo.h b/app/widgets/gimpdeviceinfo.h index e02bd38c45..5f8b0b16dd 100644 --- a/app/widgets/gimpdeviceinfo.h +++ b/app/widgets/gimpdeviceinfo.h @@ -32,8 +32,8 @@ G_BEGIN_DECLS GIMP_CONTEXT_PAINT_INFO_MASK | \ GIMP_CONTEXT_FOREGROUND_MASK | \ GIMP_CONTEXT_BACKGROUND_MASK | \ - GIMP_CONTEXT_BRUSH_MASK | \ - GIMP_CONTEXT_PATTERN_MASK | \ + GIMP_CONTEXT_BRUSH_MASK | \ + GIMP_CONTEXT_PATTERN_MASK | \ GIMP_CONTEXT_GRADIENT_MASK) diff --git a/app/widgets/gimpdialogfactory.h b/app/widgets/gimpdialogfactory.h index 68f7c60d35..7119216bdb 100644 --- a/app/widgets/gimpdialogfactory.h +++ b/app/widgets/gimpdialogfactory.h @@ -100,9 +100,9 @@ struct _GimpDialogFactoryClass GType gimp_dialog_factory_get_type (void) G_GNUC_CONST; GimpDialogFactory * gimp_dialog_factory_new (const gchar *name, - GimpContext *context, - GimpMenuFactory *menu_factory, - GimpDialogNewFunc new_dock_func); + GimpContext *context, + GimpMenuFactory *menu_factory, + GimpDialogNewFunc new_dock_func); GimpDialogFactory * gimp_dialog_factory_from_name (const gchar *name); @@ -110,48 +110,48 @@ void gimp_dialog_factory_set_constructor (GimpDialogFactory *factory, GimpDialogConstructor constructor); void gimp_dialog_factory_register_entry (GimpDialogFactory *factory, - const gchar *identifier, + const gchar *identifier, const gchar *name, const gchar *blurb, const gchar *stock_id, const gchar *help_id, - GimpDialogNewFunc new_func, + GimpDialogNewFunc new_func, gint view_size, - gboolean singleton, - gboolean session_managed, - gboolean remember_size, - gboolean remember_if_open); + gboolean singleton, + gboolean session_managed, + gboolean remember_size, + gboolean remember_if_open); GimpDialogFactoryEntry * gimp_dialog_factory_find_entry (GimpDialogFactory *factory, - const gchar *identifier); + const gchar *identifier); GimpSessionInfo * gimp_dialog_factory_find_session_info (GimpDialogFactory *factory, - const gchar *identifier); + const gchar *identifier); GtkWidget * gimp_dialog_factory_dialog_new (GimpDialogFactory *factory, GdkScreen *screen, - const gchar *identifier, + const gchar *identifier, gint view_size, gboolean present); GtkWidget * gimp_dialog_factory_dialog_raise (GimpDialogFactory *factory, GdkScreen *screen, - const gchar *identifiers, + const gchar *identifiers, gint view_size); GtkWidget * gimp_dialog_factory_dockable_new (GimpDialogFactory *factory, - GimpDock *dock, - const gchar *identifier, + GimpDock *dock, + const gchar *identifier, gint view_size); GtkWidget * gimp_dialog_factory_dock_new (GimpDialogFactory *factory, GdkScreen *screen); void gimp_dialog_factory_add_dialog (GimpDialogFactory *factory, - GtkWidget *dialog); + GtkWidget *dialog); void gimp_dialog_factory_add_foreign (GimpDialogFactory *factory, const gchar *identifier, GtkWidget *dialog); void gimp_dialog_factory_remove_dialog (GimpDialogFactory *factory, - GtkWidget *dialog); + GtkWidget *dialog); void gimp_dialog_factory_show_toolbox (GimpDialogFactory *toolbox_factory); diff --git a/app/widgets/gimpdock.c b/app/widgets/gimpdock.c index 9f7026ba77..fbb1ee7310 100644 --- a/app/widgets/gimpdock.c +++ b/app/widgets/gimpdock.c @@ -78,7 +78,7 @@ static void gimp_dock_get_property (GObject *object, static void gimp_dock_destroy (GtkObject *object); static gboolean gimp_dock_delete_event (GtkWidget *widget, - GdkEventAny *event); + GdkEventAny *event); static gboolean gimp_dock_key_press_event (GtkWidget *widget, GdkEventKey *kevent); @@ -107,23 +107,23 @@ gimp_dock_class_init (GimpDockClass *klass) dock_signals[BOOK_ADDED] = g_signal_new ("book-added", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpDockClass, book_added), - NULL, NULL, - gimp_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, - GIMP_TYPE_DOCKBOOK); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpDockClass, book_added), + NULL, NULL, + gimp_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GIMP_TYPE_DOCKBOOK); dock_signals[BOOK_REMOVED] = g_signal_new ("book-removed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpDockClass, book_removed), - NULL, NULL, - gimp_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, - GIMP_TYPE_DOCKBOOK); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpDockClass, book_removed), + NULL, NULL, + gimp_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GIMP_TYPE_DOCKBOOK); object_class->constructor = gimp_dock_constructor; object_class->set_property = gimp_dock_set_property; @@ -409,9 +409,9 @@ gimp_dock_get_aux_info (GimpDock *dock) void gimp_dock_add (GimpDock *dock, - GimpDockable *dockable, - gint section, - gint position) + GimpDockable *dockable, + gint section, + gint position) { GimpDockbook *dockbook; @@ -426,7 +426,7 @@ gimp_dock_add (GimpDock *dock, void gimp_dock_remove (GimpDock *dock, - GimpDockable *dockable) + GimpDockable *dockable) { g_return_if_fail (GIMP_IS_DOCK (dock)); g_return_if_fail (GIMP_IS_DOCKABLE (dockable)); @@ -438,8 +438,8 @@ gimp_dock_remove (GimpDock *dock, void gimp_dock_add_book (GimpDock *dock, - GimpDockbook *dockbook, - gint index) + GimpDockbook *dockbook, + gint index) { gint old_length; @@ -527,7 +527,7 @@ gimp_dock_add_book (GimpDock *dock, void gimp_dock_remove_book (GimpDock *dock, - GimpDockbook *dockbook) + GimpDockbook *dockbook) { gint old_length; gint index; diff --git a/app/widgets/gimpdockbook.c b/app/widgets/gimpdockbook.c index 211df181d1..6d97750e2e 100644 --- a/app/widgets/gimpdockbook.c +++ b/app/widgets/gimpdockbook.c @@ -507,11 +507,11 @@ gimp_dockbook_drop_dockable (GimpDockbook *dockbook, "gimp-dock-drag-widget", NULL); if (dockable->dockbook == dockbook) - { - gtk_notebook_reorder_child (GTK_NOTEBOOK (dockbook), + { + gtk_notebook_reorder_child (GTK_NOTEBOOK (dockbook), GTK_WIDGET (dockable), -1); - } - else + } + else { g_object_ref (dockable); @@ -521,7 +521,7 @@ gimp_dockbook_drop_dockable (GimpDockbook *dockbook, g_object_unref (dockable); } - return TRUE; + return TRUE; } } diff --git a/app/widgets/gimpdocked.c b/app/widgets/gimpdocked.c index ef49e79340..9d02a76dad 100644 --- a/app/widgets/gimpdocked.c +++ b/app/widgets/gimpdocked.c @@ -62,8 +62,8 @@ gimp_docked_interface_get_type (void) static const GTypeInfo docked_iface_info = { sizeof (GimpDockedInterface), - (GBaseInitFunc) gimp_docked_iface_base_init, - (GBaseFinalizeFunc) NULL, + (GBaseInitFunc) gimp_docked_iface_base_init, + (GBaseFinalizeFunc) NULL, }; docked_iface_type = g_type_register_static (G_TYPE_INTERFACE, diff --git a/app/widgets/gimpdockseparator.c b/app/widgets/gimpdockseparator.c index 8a900301ed..df19198c6f 100644 --- a/app/widgets/gimpdockseparator.c +++ b/app/widgets/gimpdockseparator.c @@ -171,10 +171,10 @@ gimp_dock_separator_drag_motion (GtkWidget *widget, static gboolean gimp_dock_separator_drag_drop (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time) + GdkDragContext *context, + gint x, + gint y, + guint time) { GimpDockSeparator *separator = GIMP_DOCK_SEPARATOR (widget); GtkWidget *source; @@ -195,16 +195,16 @@ gimp_dock_separator_drag_drop (GtkWidget *widget, dockable = g_object_get_data (G_OBJECT (source), "gimp-dockable"); if (dockable) - { - GtkWidget *dockbook; - GList *children; - gint index; + { + GtkWidget *dockbook; + GList *children; + gint index; - g_object_set_data (G_OBJECT (dockable), + g_object_set_data (G_OBJECT (dockable), "gimp-dock-drag-widget", NULL); - children = gtk_container_get_children (GTK_CONTAINER (widget->parent)); - index = g_list_index (children, widget); + children = gtk_container_get_children (GTK_CONTAINER (widget->parent)); + index = g_list_index (children, widget); g_list_free (children); if (index == 0) @@ -231,19 +231,19 @@ gimp_dock_separator_drag_drop (GtkWidget *widget, return TRUE; /* successfully do nothing */ } - g_object_ref (dockable); + g_object_ref (dockable); - gimp_dockbook_remove (dockable->dockbook, dockable); + gimp_dockbook_remove (dockable->dockbook, dockable); - dockbook = gimp_dockbook_new (dock->dialog_factory->menu_factory); - gimp_dock_add_book (dock, GIMP_DOCKBOOK (dockbook), index); + dockbook = gimp_dockbook_new (dock->dialog_factory->menu_factory); + gimp_dock_add_book (dock, GIMP_DOCKBOOK (dockbook), index); - gimp_dockbook_add (GIMP_DOCKBOOK (dockbook), dockable, -1); + gimp_dockbook_add (GIMP_DOCKBOOK (dockbook), dockable, -1); - g_object_unref (dockable); + g_object_unref (dockable); - return TRUE; - } + return TRUE; + } } return FALSE; diff --git a/app/widgets/gimpdocumentview.c b/app/widgets/gimpdocumentview.c index 69352d341a..fcdd6bdf90 100644 --- a/app/widgets/gimpdocumentview.c +++ b/app/widgets/gimpdocumentview.c @@ -105,15 +105,15 @@ gimp_document_view_new (GimpViewType view_type, GDK_CONTROL_MASK, NULL); gimp_container_view_enable_dnd (editor->view, - GTK_BUTTON (document_view->open_button), - GIMP_TYPE_IMAGEFILE); + GTK_BUTTON (document_view->open_button), + GIMP_TYPE_IMAGEFILE); document_view->remove_button = gimp_editor_add_action_button (GIMP_EDITOR (editor->view), "documents", "documents-remove", NULL); gimp_container_view_enable_dnd (editor->view, - GTK_BUTTON (document_view->remove_button), - GIMP_TYPE_IMAGEFILE); + GTK_BUTTON (document_view->remove_button), + GIMP_TYPE_IMAGEFILE); gimp_editor_add_action_button (GIMP_EDITOR (editor->view), "documents", "documents-clear", NULL); diff --git a/app/widgets/gimpdrawabletreeview.c b/app/widgets/gimpdrawabletreeview.c index 3ecdbd4a85..a84f988e95 100644 --- a/app/widgets/gimpdrawabletreeview.c +++ b/app/widgets/gimpdrawabletreeview.c @@ -49,8 +49,8 @@ static GObject * gimp_drawable_tree_view_constructor (GType type, GObjectConstructParam *params); static gboolean gimp_drawable_tree_view_select_item (GimpContainerView *view, - GimpViewable *item, - gpointer insert_data); + GimpViewable *item, + gpointer insert_data); static gboolean gimp_drawable_tree_view_drop_possible(GimpContainerTreeView *view, GimpDndType src_type, @@ -139,7 +139,7 @@ gimp_drawable_tree_view_constructor (GType type, item_view = GIMP_ITEM_TREE_VIEW (object); gimp_dnd_viewable_dest_add (item_view->new_button, GIMP_TYPE_PATTERN, - gimp_drawable_tree_view_new_pattern_dropped, + gimp_drawable_tree_view_new_pattern_dropped, item_view); gimp_dnd_color_dest_add (item_view->new_button, gimp_drawable_tree_view_new_color_dropped, @@ -299,7 +299,7 @@ gimp_drawable_tree_view_set_image (GimpItemTreeView *view, static void gimp_drawable_tree_view_floating_selection_changed (GimpImage *image, - GimpDrawableTreeView *view) + GimpDrawableTreeView *view) { GimpItem *item; diff --git a/app/widgets/gimpeditor.c b/app/widgets/gimpeditor.c index a5be799637..ca31f6a7fa 100644 --- a/app/widgets/gimpeditor.c +++ b/app/widgets/gimpeditor.c @@ -479,13 +479,13 @@ gimp_editor_add_button (GimpEditor *editor, if (callback) g_signal_connect (button, "clicked", - callback, - callback_data); + callback, + callback_data); if (extended_callback) g_signal_connect (button, "extended-clicked", - extended_callback, - callback_data); + extended_callback, + callback_data); image = gtk_image_new_from_stock (stock_id, button_icon_size); gtk_container_add (GTK_CONTAINER (button), image); @@ -739,8 +739,8 @@ gimp_editor_set_box_style (GimpEditor *editor, gtk_widget_style_get (GTK_WIDGET (editor), "button-icon-size", &button_icon_size, - "button-spacing", &button_spacing, - NULL); + "button-spacing", &button_spacing, + NULL); gtk_box_set_spacing (box, button_spacing); diff --git a/app/widgets/gimpenumaction.c b/app/widgets/gimpenumaction.c index 3edc22e14d..37c75f3bd1 100644 --- a/app/widgets/gimpenumaction.c +++ b/app/widgets/gimpenumaction.c @@ -91,7 +91,7 @@ gimp_enum_action_class_init (GimpEnumActionClass *klass) G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GimpEnumActionClass, selected), - NULL, NULL, + NULL, NULL, gimp_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); diff --git a/app/widgets/gimperrorconsole.c b/app/widgets/gimperrorconsole.c index 9abca21039..aec749cc19 100644 --- a/app/widgets/gimperrorconsole.c +++ b/app/widgets/gimperrorconsole.c @@ -75,16 +75,16 @@ gimp_error_console_init (GimpErrorConsole *console) console->text_buffer = gtk_text_buffer_new (NULL); gtk_text_buffer_create_tag (console->text_buffer, "title", - "weight", PANGO_WEIGHT_BOLD, + "weight", PANGO_WEIGHT_BOLD, "scale", PANGO_SCALE_LARGE, - NULL); + NULL); gtk_text_buffer_create_tag (console->text_buffer, "message", - NULL); + NULL); scrolled_window = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), - GTK_POLICY_AUTOMATIC, - GTK_POLICY_AUTOMATIC); + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); gtk_container_add (GTK_CONTAINER (console), scrolled_window); gtk_widget_show (scrolled_window); @@ -98,8 +98,8 @@ gimp_error_console_init (GimpErrorConsole *console) gtk_widget_show (console->text_view); g_signal_connect (console->text_view, "button-press-event", - G_CALLBACK (gimp_error_console_button_press), - console); + G_CALLBACK (gimp_error_console_button_press), + console); console->file_dialog = NULL; } diff --git a/app/widgets/gimpfgbgeditor.c b/app/widgets/gimpfgbgeditor.c index eada6897a6..29ed471f67 100644 --- a/app/widgets/gimpfgbgeditor.c +++ b/app/widgets/gimpfgbgeditor.c @@ -108,12 +108,12 @@ gimp_fg_bg_editor_class_init (GimpFgBgEditorClass *klass) editor_signals[COLOR_CLICKED] = g_signal_new ("color-clicked", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpFgBgEditorClass, color_clicked), - NULL, NULL, - gimp_marshal_VOID__ENUM, - G_TYPE_NONE, 1, + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpFgBgEditorClass, color_clicked), + NULL, NULL, + gimp_marshal_VOID__ENUM, + G_TYPE_NONE, 1, GIMP_TYPE_ACTIVE_COLOR); object_class->set_property = gimp_fg_bg_editor_set_property; @@ -400,13 +400,13 @@ gimp_fg_bg_editor_target (GimpFgBgEditor *editor, if (x > 0 && x < rect_w && y > 0 && y < rect_h) return FOREGROUND_AREA; else if (x > (width - rect_w) && x < width && - y > (height - rect_h) && y < height) + y > (height - rect_h) && y < height) return BACKGROUND_AREA; else if (x > 0 && x < (width - rect_w) && - y > rect_h && y < height) + y > rect_h && y < height) return DEFAULT_AREA; else if (x > rect_w && x < width && - y > 0 && y < (height - rect_h)) + y > 0 && y < (height - rect_h)) return SWAP_AREA; return INVALID_AREA; diff --git a/app/widgets/gimpfontview.c b/app/widgets/gimpfontview.c index a508399209..bca04cedbf 100644 --- a/app/widgets/gimpfontview.c +++ b/app/widgets/gimpfontview.c @@ -102,7 +102,7 @@ gimp_font_view_new (GimpViewType view_type, static void gimp_font_view_activate_item (GimpContainerEditor *editor, - GimpViewable *viewable) + GimpViewable *viewable) { if (GIMP_CONTAINER_EDITOR_CLASS (parent_class)->activate_item) GIMP_CONTAINER_EDITOR_CLASS (parent_class)->activate_item (editor, viewable); diff --git a/app/widgets/gimpgrideditor.c b/app/widgets/gimpgrideditor.c index 94aa783126..03bfee87cc 100644 --- a/app/widgets/gimpgrideditor.c +++ b/app/widgets/gimpgrideditor.c @@ -236,11 +236,11 @@ gimp_grid_editor_constructor (GType type, gtk_table_set_row_spacings (GTK_TABLE (sizeentry), 2); gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry), - _("Width"), 0, 1, 0.0); + _("Width"), 0, 1, 0.0); gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry), - _("Height"), 0, 2, 0.0); + _("Height"), 0, 2, 0.0); gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry), - _("Pixels"), 1, 4, 0.0); + _("Pixels"), 1, 4, 0.0); gtk_box_pack_start (GTK_BOX (hbox), sizeentry, FALSE, FALSE, 0); gtk_widget_show (sizeentry); @@ -268,11 +268,11 @@ gimp_grid_editor_constructor (GType type, gtk_table_set_row_spacings (GTK_TABLE (sizeentry), 2); gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry), - _("Width"), 0, 1, 0.0); + _("Width"), 0, 1, 0.0); gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry), - _("Height"), 0, 2, 0.0); + _("Height"), 0, 2, 0.0); gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry), - _("Pixels"), 1, 4, 0.0); + _("Pixels"), 1, 4, 0.0); gtk_box_pack_start (GTK_BOX (hbox), sizeentry, FALSE, FALSE, 0); gtk_widget_show (sizeentry); diff --git a/app/widgets/gimphelp.c b/app/widgets/gimphelp.c index 5c5e0c2b65..24b64835bb 100644 --- a/app/widgets/gimphelp.c +++ b/app/widgets/gimphelp.c @@ -101,12 +101,12 @@ gimp_help_show (Gimp *gimp, idle_help->gimp = gimp; if (help_domain && strlen (help_domain)) - idle_help->help_domain = g_strdup (help_domain); + idle_help->help_domain = g_strdup (help_domain); idle_help->help_locales = gimp_help_get_locales (config); if (help_id && strlen (help_id)) - idle_help->help_id = g_strdup (help_id); + idle_help->help_id = g_strdup (help_id); g_idle_add (gimp_idle_help, idle_help); @@ -182,7 +182,7 @@ gimp_help_browser (Gimp *gimp) procedure = gimp_pdb_lookup (gimp, "extension-gimp-help-browser"); if (! procedure) - { + { gimp_help_browser_error (gimp, _("Help browser not found"), _("Could not find GIMP help browser."), @@ -190,8 +190,8 @@ gimp_help_browser (Gimp *gimp) "to be missing from your installation.")); busy = FALSE; - return FALSE; - } + return FALSE; + } args = gimp_procedure_get_arguments (procedure); gimp_value_array_truncate (args, 1); @@ -247,8 +247,8 @@ gimp_help_browser_error (Gimp *gimp, if (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK) g_object_set (gimp->config, - "help-browser", GIMP_HELP_BROWSER_WEB_BROWSER, - NULL); + "help-browser", GIMP_HELP_BROWSER_WEB_BROWSER, + NULL); gtk_widget_destroy (dialog); } diff --git a/app/widgets/gimphistogrameditor.c b/app/widgets/gimphistogrameditor.c index 13a3de9738..7f103cd488 100644 --- a/app/widgets/gimphistogrameditor.c +++ b/app/widgets/gimphistogrameditor.c @@ -172,7 +172,7 @@ gimp_histogram_editor_init (GimpHistogramEditor *editor) -1); gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); gtk_table_attach (GTK_TABLE (table), label, x, x + 1, y, y + 1, - GTK_FILL | GTK_EXPAND, GTK_FILL, 2, 2); + GTK_FILL | GTK_EXPAND, GTK_FILL, 2, 2); gtk_widget_show (label); editor->labels[i] = diff --git a/app/widgets/gimphistogramview.c b/app/widgets/gimphistogramview.c index e24dec9897..ba9b5785a8 100644 --- a/app/widgets/gimphistogramview.c +++ b/app/widgets/gimphistogramview.c @@ -237,9 +237,9 @@ gimp_histogram_view_get_maximum (GimpHistogramView *view, case GIMP_HISTOGRAM_SCALE_LOGARITHMIC: if (max > 0.0) - max = log (max); + max = log (max); else - max = 1.0; + max = 1.0; break; } @@ -432,8 +432,8 @@ gimp_histogram_view_button_press (GtkWidget *widget, gint width; gdk_pointer_grab (widget->window, FALSE, - GDK_BUTTON_RELEASE_MASK | GDK_BUTTON1_MOTION_MASK, - NULL, NULL, bevent->time); + GDK_BUTTON_RELEASE_MASK | GDK_BUTTON1_MOTION_MASK, + NULL, NULL, bevent->time); width = widget->allocation.width - 2 * view->border_width; @@ -548,7 +548,7 @@ gimp_histogram_view_get_channel (GimpHistogramView *view) void gimp_histogram_view_set_scale (GimpHistogramView *view, - GimpHistogramScale scale) + GimpHistogramScale scale) { g_return_if_fail (GIMP_IS_HISTOGRAM_VIEW (view)); diff --git a/app/widgets/gimphistogramview.h b/app/widgets/gimphistogramview.h index b60e043d35..b93ef934ff 100644 --- a/app/widgets/gimphistogramview.h +++ b/app/widgets/gimphistogramview.h @@ -55,8 +55,8 @@ struct _GimpHistogramViewClass GtkDrawingAreaClass parent_class; void (* range_changed) (GimpHistogramView *view, - gint start, - gint end); + gint start, + gint end); }; diff --git a/app/widgets/gimpimagedock.c b/app/widgets/gimpimagedock.c index b22ae4430a..375d3da8b9 100644 --- a/app/widgets/gimpimagedock.c +++ b/app/widgets/gimpimagedock.c @@ -112,13 +112,13 @@ gimp_image_dock_constructor (GType type, dock); g_signal_connect_object (GIMP_DOCK (dock)->context, "display-changed", - G_CALLBACK (gimp_image_dock_display_changed), - dock, 0); + G_CALLBACK (gimp_image_dock_display_changed), + dock, 0); g_signal_connect_object (GIMP_DOCK (dock)->context->gimp->config, "notify::transient-docks", - G_CALLBACK (gimp_image_dock_notify_transient), - dock, 0); + G_CALLBACK (gimp_image_dock_notify_transient), + dock, 0); return object; } diff --git a/app/widgets/gimpimageview.c b/app/widgets/gimpimageview.c index fcf907bbae..67ab3f8b1e 100644 --- a/app/widgets/gimpimageview.c +++ b/app/widgets/gimpimageview.c @@ -115,14 +115,14 @@ gimp_image_view_new (GimpViewType view_type, } gimp_container_view_enable_dnd (editor->view, - GTK_BUTTON (image_view->raise_button), - GIMP_TYPE_IMAGE); + GTK_BUTTON (image_view->raise_button), + GIMP_TYPE_IMAGE); gimp_container_view_enable_dnd (editor->view, - GTK_BUTTON (image_view->new_button), - GIMP_TYPE_IMAGE); + GTK_BUTTON (image_view->new_button), + GIMP_TYPE_IMAGE); gimp_container_view_enable_dnd (editor->view, - GTK_BUTTON (image_view->delete_button), - GIMP_TYPE_IMAGE); + GTK_BUTTON (image_view->delete_button), + GIMP_TYPE_IMAGE); gimp_ui_manager_update (GIMP_EDITOR (editor->view)->ui_manager, editor); diff --git a/app/widgets/gimpitemtreeview.c b/app/widgets/gimpitemtreeview.c index c060d4aaa9..05ee273457 100644 --- a/app/widgets/gimpitemtreeview.c +++ b/app/widgets/gimpitemtreeview.c @@ -172,13 +172,13 @@ gimp_item_tree_view_class_init (GimpItemTreeViewClass *klass) view_signals[SET_IMAGE] = g_signal_new ("set-image", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GimpItemTreeViewClass, set_image), - NULL, NULL, - gimp_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, - GIMP_TYPE_OBJECT); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GimpItemTreeViewClass, set_image), + NULL, NULL, + gimp_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GIMP_TYPE_OBJECT); object_class->constructor = gimp_item_tree_view_constructor; @@ -369,8 +369,8 @@ gimp_item_tree_view_constructor (GType type, gimp_editor_add_action_button (editor, item_view_class->action_group, item_view_class->edit_action, NULL); gimp_container_view_enable_dnd (GIMP_CONTAINER_VIEW (item_view), - GTK_BUTTON (item_view->edit_button), - item_view_class->item_type); + GTK_BUTTON (item_view->edit_button), + item_view_class->item_type); item_view->new_button = gimp_editor_add_action_button (editor, item_view_class->action_group, @@ -382,9 +382,9 @@ gimp_item_tree_view_constructor (GType type, * it was clicked or dropped */ gimp_dnd_viewable_dest_add (item_view->new_button, - item_view_class->item_type, - gimp_item_tree_view_new_dropped, - item_view); + item_view_class->item_type, + gimp_item_tree_view_new_dropped, + item_view); item_view->raise_button = gimp_editor_add_action_button (editor, item_view_class->action_group, @@ -404,15 +404,15 @@ gimp_item_tree_view_constructor (GType type, gimp_editor_add_action_button (editor, item_view_class->action_group, item_view_class->duplicate_action, NULL); gimp_container_view_enable_dnd (GIMP_CONTAINER_VIEW (item_view), - GTK_BUTTON (item_view->duplicate_button), - item_view_class->item_type); + GTK_BUTTON (item_view->duplicate_button), + item_view_class->item_type); item_view->delete_button = gimp_editor_add_action_button (editor, item_view_class->action_group, item_view_class->delete_action, NULL); gimp_container_view_enable_dnd (GIMP_CONTAINER_VIEW (item_view), - GTK_BUTTON (item_view->delete_button), - item_view_class->item_type); + GTK_BUTTON (item_view->delete_button), + item_view_class->item_type); return object; } @@ -441,7 +441,7 @@ gimp_item_tree_view_new (GType view_type, g_return_val_if_fail (g_type_is_a (view_type, GIMP_TYPE_ITEM_TREE_VIEW), NULL); g_return_val_if_fail (view_size > 0 && - view_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE, NULL); + view_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE, NULL); g_return_val_if_fail (view_border_width >= 0 && view_border_width <= GIMP_VIEW_MAX_BORDER_WIDTH, NULL); @@ -487,11 +487,11 @@ gimp_item_tree_view_real_set_image (GimpItemTreeView *view, if (view->image) { g_signal_handlers_disconnect_by_func (view->image, - gimp_item_tree_view_item_changed, - view); + gimp_item_tree_view_item_changed, + view); g_signal_handlers_disconnect_by_func (view->image, - gimp_item_tree_view_size_changed, - view); + gimp_item_tree_view_size_changed, + view); gimp_container_view_set_container (GIMP_CONTAINER_VIEW (view), NULL); @@ -513,11 +513,11 @@ gimp_item_tree_view_real_set_image (GimpItemTreeView *view, g_signal_connect (view->image, GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->signal_name, - G_CALLBACK (gimp_item_tree_view_item_changed), - view); + G_CALLBACK (gimp_item_tree_view_item_changed), + view); g_signal_connect (view->image, "size-changed", - G_CALLBACK (gimp_item_tree_view_size_changed), - view); + G_CALLBACK (gimp_item_tree_view_size_changed), + view); g_signal_connect (view->image, "flush", G_CALLBACK (gimp_item_tree_view_image_flush), @@ -549,9 +549,9 @@ gimp_item_tree_view_set_container (GimpContainerView *view, if (old_container) { gimp_container_remove_handler (old_container, - item_view->visible_changed_handler_id); + item_view->visible_changed_handler_id); gimp_container_remove_handler (old_container, - item_view->linked_changed_handler_id); + item_view->linked_changed_handler_id); item_view->visible_changed_handler_id = 0; item_view->linked_changed_handler_id = 0; @@ -562,13 +562,13 @@ gimp_item_tree_view_set_container (GimpContainerView *view, if (container) { item_view->visible_changed_handler_id = - gimp_container_add_handler (container, "visibility-changed", - G_CALLBACK (gimp_item_tree_view_visible_changed), - view); + gimp_container_add_handler (container, "visibility-changed", + G_CALLBACK (gimp_item_tree_view_visible_changed), + view); item_view->linked_changed_handler_id = - gimp_container_add_handler (container, "linked-changed", - G_CALLBACK (gimp_item_tree_view_linked_changed), - view); + gimp_container_add_handler (container, "linked-changed", + G_CALLBACK (gimp_item_tree_view_linked_changed), + view); } } @@ -614,12 +614,12 @@ gimp_item_tree_view_select_item (GimpContainerView *view, active_item = item_view_class->get_active_item (tree_view->image); if (active_item != (GimpItem *) item) - { - item_view_class->set_active_item (tree_view->image, + { + item_view_class->set_active_item (tree_view->image, GIMP_ITEM (item)); - gimp_image_flush (tree_view->image); - } + gimp_image_flush (tree_view->image); + } } gimp_ui_manager_update (GIMP_EDITOR (tree_view)->ui_manager, tree_view); diff --git a/app/widgets/gimpmenudock.c b/app/widgets/gimpmenudock.c index 4b53a4fd30..2fe9029f00 100644 --- a/app/widgets/gimpmenudock.c +++ b/app/widgets/gimpmenudock.c @@ -152,8 +152,8 @@ gimp_menu_dock_init (GimpMenuDock *dock) gtk_widget_show (dock->image_combo); g_signal_connect (dock->image_combo, "destroy", - G_CALLBACK (gtk_widget_destroyed), - &dock->image_combo); + G_CALLBACK (gtk_widget_destroyed), + &dock->image_combo); gimp_help_set_help_data (dock->image_combo, NULL, GIMP_HELP_DOCK_IMAGE_MENU); @@ -397,10 +397,10 @@ gimp_menu_dock_new (GimpDialogFactory *dialog_factory, GIMP_HELP_DOCK, NULL); gimp_context_define_properties (context, - GIMP_CONTEXT_ALL_PROPS_MASK & - ~(GIMP_CONTEXT_IMAGE_MASK | - GIMP_CONTEXT_DISPLAY_MASK), - FALSE); + GIMP_CONTEXT_ALL_PROPS_MASK & + ~(GIMP_CONTEXT_IMAGE_MASK | + GIMP_CONTEXT_DISPLAY_MASK), + FALSE); gimp_context_set_parent (context, dialog_factory->context); if (menu_dock->auto_follow_active) @@ -414,18 +414,18 @@ gimp_menu_dock_new (GimpDialogFactory *dialog_factory, } g_signal_connect_object (dialog_factory->context, "display-changed", - G_CALLBACK (gimp_menu_dock_factory_display_changed), - menu_dock, - 0); + G_CALLBACK (gimp_menu_dock_factory_display_changed), + menu_dock, + 0); g_signal_connect_object (dialog_factory->context, "image-changed", - G_CALLBACK (gimp_menu_dock_factory_image_changed), - menu_dock, - 0); + G_CALLBACK (gimp_menu_dock_factory_image_changed), + menu_dock, + 0); g_signal_connect_object (context, "image-changed", - G_CALLBACK (gimp_menu_dock_image_changed), - menu_dock, - 0); + G_CALLBACK (gimp_menu_dock_image_changed), + menu_dock, + 0); settings = gtk_widget_get_settings (GTK_WIDGET (menu_dock)); gtk_icon_size_lookup_for_settings (settings, @@ -448,7 +448,7 @@ gimp_menu_dock_set_auto_follow_active (GimpMenuDock *menu_dock, g_return_if_fail (GIMP_IS_MENU_DOCK (menu_dock)); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (menu_dock->auto_button), - auto_follow_active ? TRUE : FALSE); + auto_follow_active ? TRUE : FALSE); } void @@ -565,17 +565,17 @@ gimp_menu_dock_image_changed (GimpContext *context, 0)); if (image) - { - /* this invokes this function recursively but we don't enter - * the if() branch the second time - */ - gimp_context_set_image (context, image); + { + /* this invokes this function recursively but we don't enter + * the if() branch the second time + */ + gimp_context_set_image (context, image); - /* stop the emission of the original signal (the emission of - * the recursive signal is finished) - */ - g_signal_stop_emission_by_name (context, "image-changed"); - } + /* stop the emission of the original signal (the emission of + * the recursive signal is finished) + */ + g_signal_stop_emission_by_name (context, "image-changed"); + } } else if (image != NULL && ! gimp_container_is_empty (display_container)) { diff --git a/app/widgets/gimppaletteeditor.c b/app/widgets/gimppaletteeditor.c index cc2c9fdc5a..09f47409a3 100644 --- a/app/widgets/gimppaletteeditor.c +++ b/app/widgets/gimppaletteeditor.c @@ -83,8 +83,8 @@ static void palette_editor_viewport_size_allocate(GtkWidget *widget, GimpPaletteEditor *editor); static gint palette_editor_eventbox_button_press (GtkWidget *widget, - GdkEventButton *bevent, - GimpPaletteEditor *editor); + GdkEventButton *bevent, + GimpPaletteEditor *editor); static void palette_editor_drop_color (GtkWidget *widget, gint x, gint y, @@ -171,26 +171,26 @@ gimp_palette_editor_init (GimpPaletteEditor *editor) editor->scrolled_window = scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_widget_set_size_request (scrolled_win, -1, PREVIEW_HEIGHT); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), - GTK_POLICY_AUTOMATIC, - GTK_POLICY_AUTOMATIC); + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); gtk_box_pack_start (GTK_BOX (editor), scrolled_win, TRUE, TRUE, 0); gtk_widget_show (scrolled_win); eventbox = gtk_event_box_new (); gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_win), - eventbox); + eventbox); gtk_widget_show (eventbox); g_signal_connect (eventbox, "button-press-event", - G_CALLBACK (palette_editor_eventbox_button_press), - editor); + G_CALLBACK (palette_editor_eventbox_button_press), + editor); g_signal_connect (eventbox->parent, "size-allocate", G_CALLBACK (palette_editor_viewport_size_allocate), editor); gimp_dnd_color_dest_add (eventbox, palette_editor_drop_color, editor); gimp_dnd_viewable_dest_add (eventbox, GIMP_TYPE_PALETTE, - palette_editor_drop_palette, + palette_editor_drop_palette, editor); alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); @@ -209,23 +209,23 @@ gimp_palette_editor_init (GimpPaletteEditor *editor) gtk_widget_show (editor->view); g_signal_connect (editor->view, "entry-clicked", - G_CALLBACK (palette_editor_entry_clicked), - editor); + G_CALLBACK (palette_editor_entry_clicked), + editor); g_signal_connect (editor->view, "entry-selected", - G_CALLBACK (palette_editor_entry_selected), - editor); + G_CALLBACK (palette_editor_entry_selected), + editor); g_signal_connect (editor->view, "entry-activated", - G_CALLBACK (palette_editor_entry_activated), - editor); + G_CALLBACK (palette_editor_entry_activated), + editor); g_signal_connect (editor->view, "entry-context", - G_CALLBACK (palette_editor_entry_context), - editor); + G_CALLBACK (palette_editor_entry_context), + editor); g_signal_connect (editor->view, "color-dropped", - G_CALLBACK (palette_editor_color_dropped), - editor); + G_CALLBACK (palette_editor_color_dropped), + editor); gimp_dnd_viewable_dest_add (editor->view, GIMP_TYPE_PALETTE, - palette_editor_drop_palette, + palette_editor_drop_palette, editor); hbox = gtk_hbox_new (FALSE, 2); @@ -549,7 +549,7 @@ gimp_palette_editor_zoom (GimpPaletteEditor *editor, static void palette_editor_invalidate_preview (GimpPalette *palette, - GimpPaletteEditor *editor) + GimpPaletteEditor *editor) { if (palette->n_columns) editor->columns = palette->n_columns; @@ -573,8 +573,8 @@ palette_editor_viewport_size_allocate (GtkWidget *widget, static gboolean palette_editor_eventbox_button_press (GtkWidget *widget, - GdkEventButton *bevent, - GimpPaletteEditor *editor) + GdkEventButton *bevent, + GimpPaletteEditor *editor) { if (bevent->button == 3 && bevent->type == GDK_BUTTON_PRESS) { @@ -607,8 +607,8 @@ static void palette_editor_drop_palette (GtkWidget *widget, gint x, gint y, - GimpViewable *viewable, - gpointer data) + GimpViewable *viewable, + gpointer data) { gimp_data_editor_set_data (GIMP_DATA_EDITOR (data), GIMP_DATA (viewable)); } @@ -720,7 +720,7 @@ palette_editor_color_dropped (GimpPaletteView *view, static void palette_editor_color_name_changed (GtkWidget *widget, - GimpPaletteEditor *editor) + GimpPaletteEditor *editor) { if (GIMP_DATA_EDITOR (editor)->data) { diff --git a/app/widgets/gimppatternfactoryview.h b/app/widgets/gimppatternfactoryview.h index 4011330bed..e9dac8c686 100644 --- a/app/widgets/gimppatternfactoryview.h +++ b/app/widgets/gimppatternfactoryview.h @@ -49,11 +49,11 @@ struct _GimpPatternFactoryViewClass GType gimp_pattern_factory_view_get_type (void) G_GNUC_CONST; GtkWidget * gimp_pattern_factory_view_new (GimpViewType view_type, - GimpDataFactory *factory, - GimpContext *context, - gint view_size, + GimpDataFactory *factory, + GimpContext *context, + gint view_size, gint view_border_width, - GimpMenuFactory *menu_factory); + GimpMenuFactory *menu_factory); #endif /* __GIMP_PATTERN_FACTORY_VIEW_H__ */ diff --git a/app/widgets/gimppdbdialog.c b/app/widgets/gimppdbdialog.c index fb0ca01eb2..266816cd98 100644 --- a/app/widgets/gimppdbdialog.c +++ b/app/widgets/gimppdbdialog.c @@ -341,7 +341,7 @@ gimp_pdb_dialog_get_by_callback (GimpPdbDialogClass *klass, if (dialog->callback_name && ! strcmp (callback_name, dialog->callback_name)) - return dialog; + return dialog; } return NULL; diff --git a/app/widgets/gimppluginaction.c b/app/widgets/gimppluginaction.c index 46e13b7430..36fd0180b6 100644 --- a/app/widgets/gimppluginaction.c +++ b/app/widgets/gimppluginaction.c @@ -88,7 +88,7 @@ gimp_plug_in_action_class_init (GimpPlugInActionClass *klass) G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GimpPlugInActionClass, selected), - NULL, NULL, + NULL, NULL, gimp_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER); diff --git a/app/widgets/gimppropwidgets.c b/app/widgets/gimppropwidgets.c index 0411f5412c..bef170124f 100644 --- a/app/widgets/gimppropwidgets.c +++ b/app/widgets/gimppropwidgets.c @@ -220,8 +220,8 @@ gimp_prop_color_button_new (GObject *config, set_param_spec (G_OBJECT (button), button, param_spec); g_signal_connect (button, "color-changed", - G_CALLBACK (gimp_prop_color_button_callback), - config); + G_CALLBACK (gimp_prop_color_button_callback), + config); connect_notify (config, property_name, G_CALLBACK (gimp_prop_color_button_notify), diff --git a/app/widgets/gimprender.c b/app/widgets/gimprender.c index 0fd30aeb2d..f2a7cd2b3b 100644 --- a/app/widgets/gimprender.c +++ b/app/widgets/gimprender.c @@ -138,11 +138,11 @@ gimp_render_setup_notify (gpointer config, for (i = 0; i < 256; i++) for (j = 0; j < 256; j++) { - gimp_render_blend_dark_check [(i << 8) + j] = - (guchar) ((j * i + dark * (255 - i)) / 255); - gimp_render_blend_light_check [(i << 8) + j] = + gimp_render_blend_dark_check [(i << 8) + j] = + (guchar) ((j * i + dark * (255 - i)) / 255); + gimp_render_blend_light_check [(i << 8) + j] = (guchar) ((j * i + light * (255 - i)) / 255); - gimp_render_blend_white [(i << 8) + j] = + gimp_render_blend_white [(i << 8) + j] = (guchar) ((j * i + 255 * (255 - i)) / 255); } diff --git a/app/widgets/gimpsamplepointeditor.c b/app/widgets/gimpsamplepointeditor.c index df58b628c0..2ba1e5e273 100644 --- a/app/widgets/gimpsamplepointeditor.c +++ b/app/widgets/gimpsamplepointeditor.c @@ -129,7 +129,7 @@ gimp_sample_point_editor_init (GimpSamplePointEditor *editor) gtk_widget_style_get (GTK_WIDGET (editor), "content-spacing", &content_spacing, - NULL); + NULL); editor->table = gtk_table_new (2, 2, TRUE); gtk_table_set_row_spacing (GTK_TABLE (editor->table), 0, content_spacing); @@ -246,7 +246,7 @@ gimp_sample_point_editor_style_set (GtkWidget *widget, gtk_widget_style_get (widget, "content-spacing", &content_spacing, - NULL); + NULL); gtk_table_set_row_spacing (GTK_TABLE (editor->table), 0, content_spacing); gtk_table_set_col_spacing (GTK_TABLE (editor->table), 0, content_spacing); diff --git a/app/widgets/gimpselectiondata.c b/app/widgets/gimpselectiondata.c index 39369a3467..0d413221cc 100644 --- a/app/widgets/gimpselectiondata.c +++ b/app/widgets/gimpselectiondata.c @@ -138,25 +138,25 @@ gimp_selection_data_get_uri_list (GtkSelectionData *selection) while (*buffer && (buffer - (gchar *) selection->data < selection->length)) { - gchar *name = name_buffer; - gint len = 0; + gchar *name = name_buffer; + gint len = 0; - while (len < sizeof (name_buffer) && *buffer && *buffer != '\n') - { - *name++ = *buffer++; - len++; - } - if (len == 0) - break; + while (len < sizeof (name_buffer) && *buffer && *buffer != '\n') + { + *name++ = *buffer++; + len++; + } + if (len == 0) + break; - if (*(name - 1) == 0xd) /* gmc uses RETURN+NEWLINE as delimiter */ - len--; + if (*(name - 1) == 0xd) /* gmc uses RETURN+NEWLINE as delimiter */ + len--; - if (len > 2) - crap_list = g_list_prepend (crap_list, g_strndup (name_buffer, len)); + if (len > 2) + crap_list = g_list_prepend (crap_list, g_strndup (name_buffer, len)); - if (*buffer) - buffer++; + if (*buffer) + buffer++; } } @@ -330,10 +330,10 @@ gimp_selection_data_get_color (GtkSelectionData *selection, color_vals = (guint16 *) selection->data; gimp_rgba_set_uchar (color, - (guchar) (color_vals[0] >> 8), - (guchar) (color_vals[1] >> 8), - (guchar) (color_vals[2] >> 8), - (guchar) (color_vals[3] >> 8)); + (guchar) (color_vals[0] >> 8), + (guchar) (color_vals[1] >> 8), + (guchar) (color_vals[2] >> 8), + (guchar) (color_vals[3] >> 8)); return TRUE; } diff --git a/app/widgets/gimpsessioninfo.c b/app/widgets/gimpsessioninfo.c index f5356dcb46..35f5788eea 100644 --- a/app/widgets/gimpsessioninfo.c +++ b/app/widgets/gimpsessioninfo.c @@ -870,15 +870,15 @@ gimp_session_info_get_geometry (GimpSessionInfo *info) gdk_window_get_root_origin (info->widget->window, &info->x, &info->y); if (! info->toplevel_entry || info->toplevel_entry->remember_size) - { - info->width = info->widget->allocation.width; - info->height = info->widget->allocation.height; - } + { + info->width = info->widget->allocation.width; + info->height = info->widget->allocation.height; + } else - { - info->width = 0; - info->height = 0; - } + { + info->width = 0; + info->height = 0; + } } info->open = FALSE; diff --git a/app/widgets/gimpstringaction.c b/app/widgets/gimpstringaction.c index 6a1cd959bb..ecea6778ad 100644 --- a/app/widgets/gimpstringaction.c +++ b/app/widgets/gimpstringaction.c @@ -86,7 +86,7 @@ gimp_string_action_class_init (GimpStringActionClass *klass) G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GimpStringActionClass, selected), - NULL, NULL, + NULL, NULL, gimp_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); diff --git a/app/widgets/gimptemplateeditor.c b/app/widgets/gimptemplateeditor.c index a3f2569e9b..0406ebca0a 100644 --- a/app/widgets/gimptemplateeditor.c +++ b/app/widgets/gimptemplateeditor.c @@ -162,14 +162,14 @@ gimp_template_editor_constructor (GType type, gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_label_set_mnemonic_widget (GTK_LABEL (label), width); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, - GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); + GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); gtk_widget_show (label); label = gtk_label_new_with_mnemonic (_("H_eight:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_label_set_mnemonic_widget (GTK_LABEL (label), height); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, - GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); + GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); gtk_widget_show (label); /* create the sizeentry which keeps it all together */ @@ -188,12 +188,12 @@ gimp_template_editor_constructor (GType type, gtk_widget_show (editor->size_se); gimp_size_entry_add_field (GIMP_SIZE_ENTRY (editor->size_se), - GTK_SPIN_BUTTON (height), NULL); + GTK_SPIN_BUTTON (height), NULL); gtk_table_attach_defaults (GTK_TABLE (editor->size_se), height, 0, 1, 1, 2); gtk_widget_show (height); gimp_size_entry_add_field (GIMP_SIZE_ENTRY (editor->size_se), - GTK_SPIN_BUTTON (width), NULL); + GTK_SPIN_BUTTON (width), NULL); gtk_table_attach_defaults (GTK_TABLE (editor->size_se), width, 0, 1, 0, 1); gtk_widget_show (width); @@ -289,14 +289,14 @@ gimp_template_editor_constructor (GType type, gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_label_set_mnemonic_widget (GTK_LABEL (label), xres); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, - GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); + GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); gtk_widget_show (label); label = gtk_label_new_with_mnemonic (_("_Y resolution:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_label_set_mnemonic_widget (GTK_LABEL (label), yres); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, - GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); + GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); gtk_widget_show (label); /* the resolution sizeentry */ @@ -317,15 +317,15 @@ gimp_template_editor_constructor (GType type, gtk_widget_show (editor->resolution_se); gimp_size_entry_add_field (GIMP_SIZE_ENTRY (editor->resolution_se), - GTK_SPIN_BUTTON (yres), NULL); + GTK_SPIN_BUTTON (yres), NULL); gtk_table_attach_defaults (GTK_TABLE (editor->resolution_se), yres, 0, 1, 1, 2); gtk_widget_show (yres); gimp_size_entry_add_field (GIMP_SIZE_ENTRY (editor->resolution_se), - GTK_SPIN_BUTTON (xres), NULL); + GTK_SPIN_BUTTON (xres), NULL); gtk_table_attach_defaults (GTK_TABLE (editor->resolution_se), xres, - 0, 1, 0, 1); + 0, 1, 0, 1); gtk_widget_show (xres); gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (editor->size_se), 0, @@ -374,8 +374,8 @@ gimp_template_editor_constructor (GType type, gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_IN); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), - GTK_POLICY_AUTOMATIC, - GTK_POLICY_AUTOMATIC); + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); gimp_table_attach_aligned (GTK_TABLE (table), 0, 4, _("Comme_nt:"), 0.0, 0.0, scrolled_window, 1, FALSE); diff --git a/app/widgets/gimptemplateview.c b/app/widgets/gimptemplateview.c index e80faae889..5cba3e7953 100644 --- a/app/widgets/gimptemplateview.c +++ b/app/widgets/gimptemplateview.c @@ -143,17 +143,17 @@ gimp_template_view_new (GimpViewType view_type, "templates-delete", NULL); gimp_container_view_enable_dnd (editor->view, - GTK_BUTTON (template_view->create_button), - GIMP_TYPE_TEMPLATE); + GTK_BUTTON (template_view->create_button), + GIMP_TYPE_TEMPLATE); gimp_container_view_enable_dnd (editor->view, - GTK_BUTTON (template_view->duplicate_button), - GIMP_TYPE_TEMPLATE); + GTK_BUTTON (template_view->duplicate_button), + GIMP_TYPE_TEMPLATE); gimp_container_view_enable_dnd (editor->view, - GTK_BUTTON (template_view->edit_button), - GIMP_TYPE_TEMPLATE); + GTK_BUTTON (template_view->edit_button), + GIMP_TYPE_TEMPLATE); gimp_container_view_enable_dnd (editor->view, - GTK_BUTTON (template_view->delete_button), - GIMP_TYPE_TEMPLATE); + GTK_BUTTON (template_view->delete_button), + GIMP_TYPE_TEMPLATE); gimp_ui_manager_update (GIMP_EDITOR (editor->view)->ui_manager, editor); diff --git a/app/widgets/gimptexteditor.c b/app/widgets/gimptexteditor.c index 8bf5eb4c3a..f2694d7559 100644 --- a/app/widgets/gimptexteditor.c +++ b/app/widgets/gimptexteditor.c @@ -72,21 +72,21 @@ gimp_text_editor_class_init (GimpTextEditorClass *klass) text_editor_signals[TEXT_CHANGED] = g_signal_new ("text-changed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpTextEditorClass, text_changed), - NULL, NULL, - gimp_marshal_VOID__VOID, - G_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpTextEditorClass, text_changed), + NULL, NULL, + gimp_marshal_VOID__VOID, + G_TYPE_NONE, 0); text_editor_signals[DIR_CHANGED] = g_signal_new ("dir-changed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpTextEditorClass, dir_changed), - NULL, NULL, - gimp_marshal_VOID__VOID, - G_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpTextEditorClass, dir_changed), + NULL, NULL, + gimp_marshal_VOID__VOID, + G_TYPE_NONE, 0); } static void @@ -167,8 +167,8 @@ gimp_text_editor_new (const gchar *title, scrolled_window = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), - GTK_POLICY_AUTOMATIC, - GTK_POLICY_AUTOMATIC); + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); gtk_container_set_border_width (GTK_CONTAINER (scrolled_window), 2); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (editor)->vbox), scrolled_window, TRUE, TRUE, 0); @@ -181,8 +181,8 @@ gimp_text_editor_new (const gchar *title, buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (editor->view)); g_signal_connect (buffer, "changed", - G_CALLBACK (gimp_text_editor_text_changed), - editor); + G_CALLBACK (gimp_text_editor_text_changed), + editor); switch (editor->base_dir) { diff --git a/app/widgets/gimpthumbbox.c b/app/widgets/gimpthumbbox.c index d515e1b16a..0fed0b24b0 100644 --- a/app/widgets/gimpthumbbox.c +++ b/app/widgets/gimpthumbbox.c @@ -383,8 +383,8 @@ gimp_thumb_box_new (Gimp *gimp) gtk_label_set_line_wrap (GTK_LABEL (box->filename), TRUE); gtk_label_set_justify (GTK_LABEL (box->filename), GTK_JUSTIFY_CENTER); gimp_label_set_attributes (GTK_LABEL (box->filename), - PANGO_ATTR_STYLE, PANGO_STYLE_OBLIQUE, - -1); + PANGO_ATTR_STYLE, PANGO_STYLE_OBLIQUE, + -1); gtk_box_pack_start (GTK_BOX (vbox2), box->filename, FALSE, FALSE, 0); gtk_widget_show (box->filename); @@ -392,8 +392,8 @@ gimp_thumb_box_new (Gimp *gimp) gtk_misc_set_alignment (GTK_MISC (box->info), 0.5, 0.0); gtk_label_set_justify (GTK_LABEL (box->info), GTK_JUSTIFY_CENTER); gimp_label_set_attributes (GTK_LABEL (box->info), - PANGO_ATTR_SCALE, PANGO_SCALE_SMALL, - -1); + PANGO_ATTR_SCALE, PANGO_SCALE_SMALL, + -1); gtk_box_pack_start (GTK_BOX (vbox2), box->info, FALSE, FALSE, 0); gtk_widget_show (box->info); diff --git a/app/widgets/gimptoolbox-color-area.c b/app/widgets/gimptoolbox-color-area.c index 1654f236c8..ecf065ff68 100644 --- a/app/widgets/gimptoolbox-color-area.c +++ b/app/widgets/gimptoolbox-color-area.c @@ -74,11 +74,11 @@ gimp_toolbox_color_area_create (GimpToolbox *toolbox, gtk_widget_set_size_request (color_area, width, height); gtk_widget_add_events (color_area, GDK_ENTER_NOTIFY_MASK | - GDK_LEAVE_NOTIFY_MASK); + GDK_LEAVE_NOTIFY_MASK); g_signal_connect (color_area, "color-clicked", - G_CALLBACK (color_area_color_clicked), - context); + G_CALLBACK (color_area_color_clicked), + context); return color_area; } diff --git a/app/widgets/gimptoolbox-dnd.c b/app/widgets/gimptoolbox-dnd.c index 7089c581af..99cadb627b 100644 --- a/app/widgets/gimptoolbox-dnd.c +++ b/app/widgets/gimptoolbox-dnd.c @@ -101,20 +101,20 @@ gimp_toolbox_dnd_init (GimpToolbox *toolbox) dock->context); gimp_dnd_viewable_dest_add (toolbox->tool_wbox, GIMP_TYPE_LAYER, - gimp_toolbox_drop_drawable, - dock->context); + gimp_toolbox_drop_drawable, + dock->context); gimp_dnd_viewable_dest_add (toolbox->tool_wbox, GIMP_TYPE_LAYER_MASK, - gimp_toolbox_drop_drawable, - dock->context); + gimp_toolbox_drop_drawable, + dock->context); gimp_dnd_viewable_dest_add (toolbox->tool_wbox, GIMP_TYPE_CHANNEL, - gimp_toolbox_drop_drawable, - dock->context); + gimp_toolbox_drop_drawable, + dock->context); gimp_dnd_viewable_dest_add (toolbox->tool_wbox, GIMP_TYPE_TOOL_INFO, - gimp_toolbox_drop_tool, - dock->context); + gimp_toolbox_drop_tool, + dock->context); gimp_dnd_viewable_dest_add (toolbox->tool_wbox, GIMP_TYPE_BUFFER, - gimp_toolbox_drop_buffer, - dock->context); + gimp_toolbox_drop_buffer, + dock->context); gimp_dnd_component_dest_add (toolbox->tool_wbox, gimp_toolbox_drop_component, @@ -205,7 +205,7 @@ gimp_toolbox_drop_drawable (GtkWidget *widget, FALSE); gimp_image_set_resolution (new_image, - image->xresolution, image->yresolution); + image->xresolution, image->yresolution); gimp_image_set_unit (new_image, gimp_image_get_unit (image)); @@ -218,7 +218,7 @@ gimp_toolbox_drop_drawable (GtkWidget *widget, new_type, FALSE)); gimp_object_set_name (GIMP_OBJECT (new_layer), - gimp_object_get_name (GIMP_OBJECT (drawable))); + gimp_object_get_name (GIMP_OBJECT (drawable))); gimp_item_offsets (GIMP_ITEM (new_layer), &off_x, &off_y); gimp_item_translate (GIMP_ITEM (new_layer), -off_x, -off_y, FALSE); @@ -293,7 +293,7 @@ gimp_toolbox_drop_component (GtkWidget *widget, gimp_image_undo_disable (new_image); gimp_image_set_resolution (new_image, - image->xresolution, image->yresolution); + image->xresolution, image->yresolution); gimp_image_set_unit (new_image, gimp_image_get_unit (image)); channel = gimp_channel_new_from_component (image, component, NULL, NULL); diff --git a/app/widgets/gimptoolbox.c b/app/widgets/gimptoolbox.c index 2a60301af3..48eefed30f 100644 --- a/app/widgets/gimptoolbox.c +++ b/app/widgets/gimptoolbox.c @@ -239,14 +239,14 @@ gimp_toolbox_constructor (GType type, for (list = gdk_display_list_devices (display); list; list = list->next) { if (! ((GdkDevice *) (list->data))->has_cursor) - break; + break; } if (! list) /* all devices have cursor */ { g_signal_connect (toolbox, "motion-notify-event", - G_CALLBACK (toolbox_check_device), - context->gimp); + G_CALLBACK (toolbox_check_device), + context->gimp); gtk_widget_add_events (GTK_WIDGET (toolbox), GDK_POINTER_MOTION_MASK); gtk_widget_set_extension_events (GTK_WIDGET (toolbox), @@ -287,9 +287,9 @@ gimp_toolbox_constructor (GType type, toolbox->image_area, 0); g_signal_connect_object (context, "tool-changed", - G_CALLBACK (toolbox_tool_changed), - toolbox->tool_wbox, - 0); + G_CALLBACK (toolbox_tool_changed), + toolbox->tool_wbox, + 0); gimp_toolbox_dnd_init (GIMP_TOOLBOX (toolbox)); @@ -638,11 +638,11 @@ toolbox_create_tools (GimpToolbox *toolbox, gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); g_signal_connect (button, "toggled", - G_CALLBACK (toolbox_tool_button_toggled), - tool_info); + G_CALLBACK (toolbox_tool_button_toggled), + tool_info); g_signal_connect (button, "button-press-event", - G_CALLBACK (toolbox_tool_button_press), + G_CALLBACK (toolbox_tool_button_press), toolbox); if (GIMP_IMAGE_DOCK (toolbox)->ui_manager) @@ -789,8 +789,8 @@ toolbox_area_notify (GimpGuiConfig *config, static void toolbox_tool_changed (GimpContext *context, - GimpToolInfo *tool_info, - gpointer data) + GimpToolInfo *tool_info, + gpointer data) { if (tool_info) { @@ -798,18 +798,18 @@ toolbox_tool_changed (GimpContext *context, TOOL_BUTTON_DATA_KEY); if (toolbox_button && ! GTK_TOGGLE_BUTTON (toolbox_button)->active) - { - g_signal_handlers_block_by_func (toolbox_button, - toolbox_tool_button_toggled, - tool_info); + { + g_signal_handlers_block_by_func (toolbox_button, + toolbox_tool_button_toggled, + tool_info); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toolbox_button), + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toolbox_button), TRUE); - g_signal_handlers_unblock_by_func (toolbox_button, - toolbox_tool_button_toggled, - tool_info); - } + g_signal_handlers_unblock_by_func (toolbox_button, + toolbox_tool_button_toggled, + tool_info); + } } } @@ -841,7 +841,7 @@ toolbox_tool_visible_notify (GimpToolInfo *tool_info, static void toolbox_tool_button_toggled (GtkWidget *widget, - GimpToolInfo *tool_info) + GimpToolInfo *tool_info) { if (GTK_TOGGLE_BUTTON (widget)->active) gimp_context_set_tool (gimp_get_user_context (tool_info->gimp), tool_info); @@ -849,8 +849,8 @@ toolbox_tool_button_toggled (GtkWidget *widget, static gboolean toolbox_tool_button_press (GtkWidget *widget, - GdkEventButton *event, - GimpToolbox *toolbox) + GdkEventButton *event, + GimpToolbox *toolbox) { if (event->type == GDK_2BUTTON_PRESS && event->button == 1) { @@ -875,8 +875,8 @@ toolbox_tool_button_press (GtkWidget *widget, static gboolean toolbox_check_device (GtkWidget *widget, - GdkEvent *event, - Gimp *gimp) + GdkEvent *event, + Gimp *gimp) { gimp_devices_check_change (gimp, event); diff --git a/app/widgets/gimpuimanager.c b/app/widgets/gimpuimanager.c index 3652907bd2..a42f4f5ed8 100644 --- a/app/widgets/gimpuimanager.c +++ b/app/widgets/gimpuimanager.c @@ -139,32 +139,32 @@ gimp_ui_manager_class_init (GimpUIManagerClass *klass) manager_signals[UPDATE] = g_signal_new ("update", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GimpUIManagerClass, update), - NULL, NULL, - gimp_marshal_VOID__POINTER, - G_TYPE_NONE, 1, + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GimpUIManagerClass, update), + NULL, NULL, + gimp_marshal_VOID__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); manager_signals[SHOW_TOOLTIP] = g_signal_new ("show-tooltip", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GimpUIManagerClass, show_tooltip), - NULL, NULL, - gimp_marshal_VOID__STRING, - G_TYPE_NONE, 1, + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GimpUIManagerClass, show_tooltip), + NULL, NULL, + gimp_marshal_VOID__STRING, + G_TYPE_NONE, 1, G_TYPE_STRING); manager_signals[HIDE_TOOLTIP] = g_signal_new ("hide-tooltip", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GimpUIManagerClass, hide_tooltip), - NULL, NULL, - gimp_marshal_VOID__VOID, - G_TYPE_NONE, 0, + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GimpUIManagerClass, hide_tooltip), + NULL, NULL, + gimp_marshal_VOID__VOID, + G_TYPE_NONE, 0, G_TYPE_NONE); g_object_class_install_property (object_class, PROP_NAME, diff --git a/app/widgets/gimpundoeditor.c b/app/widgets/gimpundoeditor.c index 899574a561..14daf1a238 100644 --- a/app/widgets/gimpundoeditor.c +++ b/app/widgets/gimpundoeditor.c @@ -171,8 +171,8 @@ gimp_undo_editor_set_image (GimpImageEditor *image_editor, gimp_undo_editor_clear (editor); g_signal_handlers_disconnect_by_func (image_editor->image, - gimp_undo_editor_undo_event, - editor); + gimp_undo_editor_undo_event, + editor); } GIMP_IMAGE_EDITOR_CLASS (parent_class)->set_image (image_editor, image); @@ -183,8 +183,8 @@ gimp_undo_editor_set_image (GimpImageEditor *image_editor, gimp_undo_editor_fill (editor); g_signal_connect (image_editor->image, "undo-event", - G_CALLBACK (gimp_undo_editor_undo_event), - editor); + G_CALLBACK (gimp_undo_editor_undo_event), + editor); } } diff --git a/app/widgets/gimpvectorstreeview.c b/app/widgets/gimpvectorstreeview.c index aa7f2872ab..ee4d48d313 100644 --- a/app/widgets/gimpvectorstreeview.c +++ b/app/widgets/gimpvectorstreeview.c @@ -153,10 +153,10 @@ gimp_vectors_tree_view_constructor (GType type, GDK_SHIFT_MASK | GDK_CONTROL_MASK, NULL); gimp_container_view_enable_dnd (GIMP_CONTAINER_VIEW (editor), - GTK_BUTTON (view->toselection_button), - GIMP_TYPE_VECTORS); + GTK_BUTTON (view->toselection_button), + GIMP_TYPE_VECTORS); gtk_box_reorder_child (GTK_BOX (editor->button_box), - view->toselection_button, 5); + view->toselection_button, 5); view->tovectors_button = gimp_editor_add_action_button (editor, "vectors", @@ -165,7 +165,7 @@ gimp_vectors_tree_view_constructor (GType type, GDK_SHIFT_MASK, NULL); gtk_box_reorder_child (GTK_BOX (editor->button_box), - view->tovectors_button, 6); + view->tovectors_button, 6); view->stroke_button = gimp_editor_add_action_button (editor, "vectors", @@ -174,10 +174,10 @@ gimp_vectors_tree_view_constructor (GType type, GDK_SHIFT_MASK, NULL); gimp_container_view_enable_dnd (GIMP_CONTAINER_VIEW (editor), - GTK_BUTTON (view->stroke_button), - GIMP_TYPE_VECTORS); + GTK_BUTTON (view->stroke_button), + GIMP_TYPE_VECTORS); gtk_box_reorder_child (GTK_BOX (editor->button_box), - view->stroke_button, 7); + view->stroke_button, 7); gimp_dnd_svg_dest_add (GTK_WIDGET (tree_view->view), NULL, view); diff --git a/app/widgets/gimpwidgets-utils.c b/app/widgets/gimpwidgets-utils.c index 0fbb5ddee1..3f7aba441f 100644 --- a/app/widgets/gimpwidgets-utils.c +++ b/app/widgets/gimpwidgets-utils.c @@ -78,8 +78,8 @@ **/ void gimp_menu_position (GtkMenu *menu, - gint *x, - gint *y) + gint *x, + gint *y) { GtkWidget *widget; GdkScreen *screen; @@ -205,9 +205,9 @@ gimp_button_menu_position (GtkWidget *button, void gimp_table_attach_stock (GtkTable *table, gint row, - const gchar *stock_id, + const gchar *stock_id, GtkWidget *widget, - gint colspan, + gint colspan, gboolean left_align) { GtkWidget *image; @@ -219,7 +219,7 @@ gimp_table_attach_stock (GtkTable *table, image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON); gtk_misc_set_alignment (GTK_MISC (image), 1.0, 0.5); gtk_table_attach (table, image, 0, 1, row, row + 1, - GTK_FILL, GTK_FILL, 0, 0); + GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show (image); if (left_align) @@ -816,7 +816,7 @@ gimp_text_buffer_load (GtkTextBuffer *buffer, if (remaining) g_message (_("Invalid UTF-8 data in file '%s'."), - gimp_filename_to_utf8 (filename)); + gimp_filename_to_utf8 (filename)); return TRUE; } @@ -830,7 +830,7 @@ gimp_text_buffer_save (GtkTextBuffer *buffer, GtkTextIter start_iter; GtkTextIter end_iter; gint fd; - gchar *text_contents; + gchar *text_contents; g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), FALSE); g_return_val_if_fail (filename != NULL, FALSE); @@ -851,7 +851,7 @@ gimp_text_buffer_save (GtkTextBuffer *buffer, gtk_text_buffer_get_bounds (buffer, &start_iter, &end_iter); text_contents = gtk_text_buffer_get_text (buffer, - &start_iter, &end_iter, TRUE); + &start_iter, &end_iter, TRUE); if (text_contents) { diff --git a/app/widgets/gtkhwrapbox.c b/app/widgets/gtkhwrapbox.c index a02d1584c0..110d270cbf 100644 --- a/app/widgets/gtkhwrapbox.c +++ b/app/widgets/gtkhwrapbox.c @@ -31,14 +31,14 @@ static void gtk_hwrap_box_class_init (GtkHWrapBoxClass *klass); static void gtk_hwrap_box_init (GtkHWrapBox *hwbox); static void gtk_hwrap_box_size_request (GtkWidget *widget, - GtkRequisition *requisition); + GtkRequisition *requisition); static void gtk_hwrap_box_size_allocate (GtkWidget *widget, - GtkAllocation *allocation); + GtkAllocation *allocation); static GSList* reverse_list_row_children (GtkWrapBox *wbox, - GtkWrapBoxChild **child_p, - GtkAllocation *area, - guint *max_height, - gboolean *can_vexpand); + GtkWrapBoxChild **child_p, + GtkAllocation *area, + guint *max_height, + gboolean *can_vexpand); /* --- variables --- */ @@ -55,19 +55,19 @@ gtk_hwrap_box_get_type (void) { static const GTypeInfo hwrap_box_info = { - sizeof (GtkHWrapBoxClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) gtk_hwrap_box_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (GtkHWrapBox), - 0, /* n_preallocs */ - (GInstanceInitFunc) gtk_hwrap_box_init, + sizeof (GtkHWrapBoxClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gtk_hwrap_box_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GtkHWrapBox), + 0, /* n_preallocs */ + (GInstanceInitFunc) gtk_hwrap_box_init, }; hwrap_box_type = g_type_register_static (GTK_TYPE_WRAP_BOX, "GtkHWrapBox", - &hwrap_box_info, 0); + &hwrap_box_info, 0); } return hwrap_box_type; @@ -109,8 +109,8 @@ gtk_hwrap_box_new (gboolean homogeneous) static inline void get_child_requisition (GtkWrapBox *wbox, - GtkWidget *child, - GtkRequisition *child_requisition) + GtkWidget *child, + GtkRequisition *child_requisition) { if (wbox->homogeneous) { @@ -125,8 +125,8 @@ get_child_requisition (GtkWrapBox *wbox, static gfloat get_layout_size (GtkHWrapBox *this, - guint max_width, - guint *width_inc) + guint max_width, + guint *width_inc) { GtkWrapBox *wbox = GTK_WRAP_BOX (this); GtkWrapBoxChild *child; @@ -143,26 +143,26 @@ get_layout_size (GtkHWrapBox *this, guint row_width, row_height, n = 1; if (!GTK_WIDGET_VISIBLE (child->widget)) - continue; + continue; get_child_requisition (wbox, child->widget, &child_requisition); if (!last_row_filled) - *width_inc = MIN (*width_inc, child_requisition.width - left_over); + *width_inc = MIN (*width_inc, child_requisition.width - left_over); row_width = child_requisition.width; row_height = child_requisition.height; for (row_child = child->next; row_child && n < wbox->child_limit; row_child = row_child->next) - { - if (GTK_WIDGET_VISIBLE (row_child->widget)) - { - get_child_requisition (wbox, row_child->widget, &child_requisition); - if (row_width + wbox->hspacing + child_requisition.width > max_width) - break; - row_width += wbox->hspacing + child_requisition.width; - row_height = MAX (row_height, child_requisition.height); - n++; - } - child = row_child; - } + { + if (GTK_WIDGET_VISIBLE (row_child->widget)) + { + get_child_requisition (wbox, row_child->widget, &child_requisition); + if (row_width + wbox->hspacing + child_requisition.width > max_width) + break; + row_width += wbox->hspacing + child_requisition.width; + row_height = MAX (row_height, child_requisition.height); + n++; + } + child = row_child; + } last_row_filled = n >= wbox->child_limit; left_over = last_row_filled ? 0 : max_width - (row_width + wbox->hspacing); total_height += (n_rows ? wbox->vspacing : 0) + row_height; @@ -177,7 +177,7 @@ get_layout_size (GtkHWrapBox *this, static void gtk_hwrap_box_size_request (GtkWidget *widget, - GtkRequisition *requisition) + GtkRequisition *requisition) { GtkHWrapBox *this = GTK_HWRAP_BOX (widget); GtkWrapBox *wbox = GTK_WRAP_BOX (widget); @@ -196,12 +196,12 @@ gtk_hwrap_box_size_request (GtkWidget *widget, for (child = wbox->children; child; child = child->next) if (GTK_WIDGET_VISIBLE (child->widget)) { - GtkRequisition child_requisition; - - gtk_widget_size_request (child->widget, &child_requisition); + GtkRequisition child_requisition; + + gtk_widget_size_request (child->widget, &child_requisition); - this->max_child_width = MAX (this->max_child_width, child_requisition.width); - this->max_child_height = MAX (this->max_child_height, child_requisition.height); + this->max_child_width = MAX (this->max_child_width, child_requisition.width); + this->max_child_height = MAX (this->max_child_height, child_requisition.height); } /* figure all possible layouts */ @@ -214,19 +214,19 @@ gtk_hwrap_box_size_request (GtkWidget *widget, layout_width += row_inc; layout_height = get_layout_size (this, layout_width, &row_inc); - ratio = layout_width / layout_height; /**/ + ratio = layout_width / layout_height; /**/ dist = MAX (ratio, wbox->aspect_ratio) - MIN (ratio, wbox->aspect_ratio); if (dist < ratio_dist) - { - ratio_dist = dist; - requisition->width = layout_width; - requisition->height = layout_height; - } + { + ratio_dist = dist; + requisition->width = layout_width; + requisition->height = layout_height; + } /* g_print ("ratio for width %d height %d = %f\n", - (gint) layout_width, - (gint) layout_height, - ratio); + (gint) layout_width, + (gint) layout_height, + ratio); */ } while (row_inc); @@ -241,10 +241,10 @@ gtk_hwrap_box_size_request (GtkWidget *widget, static GSList* reverse_list_row_children (GtkWrapBox *wbox, - GtkWrapBoxChild **child_p, - GtkAllocation *area, - guint *max_child_size, - gboolean *expand_line) + GtkWrapBoxChild **child_p, + GtkAllocation *area, + guint *max_child_size, + gboolean *expand_line) { GSList *slist = NULL; guint width = 0, row_width = area->width; @@ -273,22 +273,22 @@ reverse_list_row_children (GtkWrapBox *wbox, child = *child_p; while (child && n < wbox->child_limit) - { - if (GTK_WIDGET_VISIBLE (child->widget)) - { - get_child_requisition (wbox, child->widget, &child_requisition); - if (width + wbox->hspacing + child_requisition.width > row_width || - child->wrapped) - break; - width += wbox->hspacing + child_requisition.width; - *max_child_size = MAX (*max_child_size, child_requisition.height); - *expand_line |= child->vexpand; - slist = g_slist_prepend (slist, child); - n++; - } - *child_p = child->next; - child = *child_p; - } + { + if (GTK_WIDGET_VISIBLE (child->widget)) + { + get_child_requisition (wbox, child->widget, &child_requisition); + if (width + wbox->hspacing + child_requisition.width > row_width || + child->wrapped) + break; + width += wbox->hspacing + child_requisition.width; + *max_child_size = MAX (*max_child_size, child_requisition.height); + *expand_line |= child->vexpand; + slist = g_slist_prepend (slist, child); + n++; + } + *child_p = child->next; + child = *child_p; + } } return slist; @@ -296,10 +296,10 @@ reverse_list_row_children (GtkWrapBox *wbox, static void layout_row (GtkWrapBox *wbox, - GtkAllocation *area, - GSList *children, - guint children_per_line, - gboolean vexpand) + GtkAllocation *area, + GSList *children, + guint children_per_line, + gboolean vexpand) { GSList *slist; guint n_children = 0, n_expand_children = 0, have_expand_children = 0; @@ -314,7 +314,7 @@ layout_row (GtkWrapBox *wbox, n_children++; if (child->hexpand) - n_expand_children++; + n_expand_children++; get_child_requisition (wbox, child->widget, &child_requisition); total_width += child_requisition.width; @@ -342,29 +342,29 @@ layout_row (GtkWrapBox *wbox, else { if (wbox->justify == GTK_JUSTIFY_FILL) - { - width = extra; - have_expand_children = TRUE; - n_expand_children = n_children; - extra /= ((gdouble) n_expand_children); - } + { + width = extra; + have_expand_children = TRUE; + n_expand_children = n_children; + extra /= ((gdouble) n_expand_children); + } else if (wbox->justify == GTK_JUSTIFY_CENTER) - { - x += extra / 2; - width = 0; - extra = 0; - } + { + x += extra / 2; + width = 0; + extra = 0; + } else if (wbox->justify == GTK_JUSTIFY_LEFT) - { - width = 0; - extra = 0; - } + { + width = 0; + extra = 0; + } else if (wbox->justify == GTK_JUSTIFY_RIGHT) - { - x += extra; - width = 0; - extra = 0; - } + { + x += extra; + width = 0; + extra = 0; + } } n_children = 0; @@ -375,61 +375,61 @@ layout_row (GtkWrapBox *wbox, child_allocation.x = x; child_allocation.y = area->y; if (wbox->homogeneous) - { - child_allocation.height = area->height; - child_allocation.width = width; - x += child_allocation.width + wbox->hspacing; - } + { + child_allocation.height = area->height; + child_allocation.width = width; + x += child_allocation.width + wbox->hspacing; + } else - { - GtkRequisition child_requisition; - - get_child_requisition (wbox, child->widget, &child_requisition); - - if (child_requisition.height >= area->height) - child_allocation.height = area->height; - else - { - child_allocation.height = child_requisition.height; - if (wbox->line_justify == GTK_JUSTIFY_FILL || child->vfill) - child_allocation.height = area->height; - else if (child->vexpand || wbox->line_justify == GTK_JUSTIFY_CENTER) - child_allocation.y += (area->height - child_requisition.height) / 2; - else if (wbox->line_justify == GTK_JUSTIFY_BOTTOM) - child_allocation.y += area->height - child_requisition.height; - } - - if (have_expand_children) - { - child_allocation.width = child_requisition.width; - if (child->hexpand || wbox->justify == GTK_JUSTIFY_FILL) - { - guint space; - - n_expand_children--; - space = extra * n_expand_children; - space = width - space; - width -= space; - if (child->hfill) - child_allocation.width += space; - else - { - child_allocation.x += space / 2; - x += space; - } - } - } - else - { - /* g_print ("child_allocation.x %d += %d * %f ", - child_allocation.x, n_children, extra); */ - child_allocation.x += n_children * extra; - /* g_print ("= %d\n", - child_allocation.x); */ - child_allocation.width = MIN (child_requisition.width, - area->width - child_allocation.x + area->x); - } - } + { + GtkRequisition child_requisition; + + get_child_requisition (wbox, child->widget, &child_requisition); + + if (child_requisition.height >= area->height) + child_allocation.height = area->height; + else + { + child_allocation.height = child_requisition.height; + if (wbox->line_justify == GTK_JUSTIFY_FILL || child->vfill) + child_allocation.height = area->height; + else if (child->vexpand || wbox->line_justify == GTK_JUSTIFY_CENTER) + child_allocation.y += (area->height - child_requisition.height) / 2; + else if (wbox->line_justify == GTK_JUSTIFY_BOTTOM) + child_allocation.y += area->height - child_requisition.height; + } + + if (have_expand_children) + { + child_allocation.width = child_requisition.width; + if (child->hexpand || wbox->justify == GTK_JUSTIFY_FILL) + { + guint space; + + n_expand_children--; + space = extra * n_expand_children; + space = width - space; + width -= space; + if (child->hfill) + child_allocation.width += space; + else + { + child_allocation.x += space / 2; + x += space; + } + } + } + else + { + /* g_print ("child_allocation.x %d += %d * %f ", + child_allocation.x, n_children, extra); */ + child_allocation.x += n_children * extra; + /* g_print ("= %d\n", + child_allocation.x); */ + child_allocation.width = MIN (child_requisition.width, + area->width - child_allocation.x + area->x); + } + } x += child_allocation.width + wbox->hspacing; gtk_widget_size_allocate (child->widget, &child_allocation); @@ -448,7 +448,7 @@ struct _Line static void layout_rows (GtkWrapBox *wbox, - GtkAllocation *area) + GtkAllocation *area) { GtkWrapBoxChild *next_child; guint min_height; @@ -461,10 +461,10 @@ layout_rows (GtkWrapBox *wbox, next_child = wbox->children; slist = GTK_WRAP_BOX_GET_CLASS (wbox)->rlist_line_children (wbox, - &next_child, - area, - &min_height, - &vexpand); + &next_child, + area, + &min_height, + &vexpand); slist = g_slist_reverse (slist); children_per_line = g_slist_length (slist); @@ -477,16 +477,16 @@ layout_rows (GtkWrapBox *wbox, total_height += min_height; line->expand = vexpand; if (vexpand) - n_expand_lines++; + n_expand_lines++; line->next = line_list; line_list = line; n_lines++; slist = GTK_WRAP_BOX_GET_CLASS (wbox)->rlist_line_children (wbox, - &next_child, - area, - &min_height, - &vexpand); + &next_child, + area, + &min_height, + &vexpand); slist = g_slist_reverse (slist); } @@ -501,32 +501,32 @@ layout_rows (GtkWrapBox *wbox, gfloat n_shrink_lines = n_lines; while (line_list) - { - Line *tmp = line_list->next; + { + Line *tmp = line_list->next; - if (shrink_height) - { - Line *line = line_list; - guint shrink_fract = shrink_height / n_shrink_lines + 0.5; + if (shrink_height) + { + Line *line = line_list; + guint shrink_fract = shrink_height / n_shrink_lines + 0.5; - if (line->min_size > shrink_fract) - { - shrink_height -= shrink_fract; - line->min_size -= shrink_fract; - } - else - { - shrink_height -= line->min_size - 1; - line->min_size = 1; - } - } - n_shrink_lines--; + if (line->min_size > shrink_fract) + { + shrink_height -= shrink_fract; + line->min_size -= shrink_fract; + } + else + { + shrink_height -= line->min_size - 1; + line->min_size = 1; + } + } + n_shrink_lines--; - last = line_list; - line_list->next = prev; - prev = line_list; - line_list = tmp; - } + last = line_list; + line_list->next = prev; + prev = line_list; + line_list = tmp; + } line_list = last; } @@ -539,53 +539,53 @@ layout_rows (GtkWrapBox *wbox, height = MAX (n_lines, height - (n_lines - 1) * wbox->vspacing); if (wbox->homogeneous) - height /= ((gdouble) n_lines); + height /= ((gdouble) n_lines); else if (n_expand_lines) - { - height = MAX (0, height - total_height); - extra = height / ((gdouble) n_expand_lines); - } + { + height = MAX (0, height - total_height); + extra = height / ((gdouble) n_expand_lines); + } else - height = 0; + height = 0; y = area->y; line = line_list; while (line) - { - GtkAllocation row_allocation; - Line *next_line = line->next; - - row_allocation.x = area->x; - row_allocation.width = area->width; - if (wbox->homogeneous) - row_allocation.height = height; - else - { - row_allocation.height = line->min_size; - - if (line->expand) - row_allocation.height += extra; - } - - row_allocation.y = y; - - y += row_allocation.height + wbox->vspacing; - layout_row (wbox, - &row_allocation, - line->children, - children_per_line, - line->expand); + { + GtkAllocation row_allocation; + Line *next_line = line->next; + + row_allocation.x = area->x; + row_allocation.width = area->width; + if (wbox->homogeneous) + row_allocation.height = height; + else + { + row_allocation.height = line->min_size; + + if (line->expand) + row_allocation.height += extra; + } + + row_allocation.y = y; + + y += row_allocation.height + wbox->vspacing; + layout_row (wbox, + &row_allocation, + line->children, + children_per_line, + line->expand); - g_slist_free (line->children); - g_free (line); - line = next_line; - } + g_slist_free (line->children); + g_free (line); + line = next_line; + } } } static void gtk_hwrap_box_size_allocate (GtkWidget *widget, - GtkAllocation *allocation) + GtkAllocation *allocation) { GtkWrapBox *wbox = GTK_WRAP_BOX (widget); GtkAllocation area; diff --git a/app/widgets/gtkhwrapbox.h b/app/widgets/gtkhwrapbox.h index 5bb0ebb6db..5a4ea943ae 100644 --- a/app/widgets/gtkhwrapbox.h +++ b/app/widgets/gtkhwrapbox.h @@ -30,10 +30,10 @@ G_BEGIN_DECLS /* --- type macros --- */ -#define GTK_TYPE_HWRAP_BOX (gtk_hwrap_box_get_type ()) -#define GTK_HWRAP_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_HWRAP_BOX, GtkHWrapBox)) +#define GTK_TYPE_HWRAP_BOX (gtk_hwrap_box_get_type ()) +#define GTK_HWRAP_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_HWRAP_BOX, GtkHWrapBox)) #define GTK_HWRAP_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_HWRAP_BOX, GtkHWrapBoxClass)) -#define GTK_IS_HWRAP_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_HWRAP_BOX)) +#define GTK_IS_HWRAP_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_HWRAP_BOX)) #define GTK_IS_HWRAP_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_HWRAP_BOX)) #define GTK_HWRAP_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_HWRAP_BOX, GtkHWrapBoxClass)) @@ -61,7 +61,7 @@ struct _GtkHWrapBoxClass /* --- prototypes --- */ -GType gtk_hwrap_box_get_type (void) G_GNUC_CONST; +GType gtk_hwrap_box_get_type (void) G_GNUC_CONST; GtkWidget * gtk_hwrap_box_new (gboolean homogeneous); diff --git a/app/widgets/gtkvwrapbox.c b/app/widgets/gtkvwrapbox.c index 0c5c1d5874..abac91a837 100644 --- a/app/widgets/gtkvwrapbox.c +++ b/app/widgets/gtkvwrapbox.c @@ -31,14 +31,14 @@ static void gtk_vwrap_box_class_init (GtkVWrapBoxClass *klass); static void gtk_vwrap_box_init (GtkVWrapBox *vwbox); static void gtk_vwrap_box_size_request (GtkWidget *widget, - GtkRequisition *requisition); + GtkRequisition *requisition); static void gtk_vwrap_box_size_allocate (GtkWidget *widget, - GtkAllocation *allocation); + GtkAllocation *allocation); static GSList* reverse_list_col_children (GtkWrapBox *wbox, - GtkWrapBoxChild **child_p, - GtkAllocation *area, - guint *max_width, - gboolean *can_hexpand); + GtkWrapBoxChild **child_p, + GtkAllocation *area, + guint *max_width, + gboolean *can_hexpand); /* --- variables --- */ @@ -55,19 +55,19 @@ gtk_vwrap_box_get_type (void) { static const GTypeInfo vwrap_box_info = { - sizeof (GtkVWrapBoxClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) gtk_vwrap_box_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (GtkVWrapBox), - 0, /* n_preallocs */ - (GInstanceInitFunc) gtk_vwrap_box_init, + sizeof (GtkVWrapBoxClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gtk_vwrap_box_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GtkVWrapBox), + 0, /* n_preallocs */ + (GInstanceInitFunc) gtk_vwrap_box_init, }; vwrap_box_type = g_type_register_static (GTK_TYPE_WRAP_BOX, "GtkVWrapBox", - &vwrap_box_info, 0); + &vwrap_box_info, 0); } return vwrap_box_type; @@ -109,8 +109,8 @@ gtk_vwrap_box_new (gboolean homogeneous) static inline void get_child_requisition (GtkWrapBox *wbox, - GtkWidget *child, - GtkRequisition *child_requisition) + GtkWidget *child, + GtkRequisition *child_requisition) { if (wbox->homogeneous) { @@ -125,8 +125,8 @@ get_child_requisition (GtkWrapBox *wbox, static gfloat get_layout_size (GtkVWrapBox *this, - guint max_height, - guint *height_inc) + guint max_height, + guint *height_inc) { GtkWrapBox *wbox = GTK_WRAP_BOX (this); GtkWrapBoxChild *child; @@ -143,26 +143,26 @@ get_layout_size (GtkVWrapBox *this, guint col_height, col_width, n = 1; if (!GTK_WIDGET_VISIBLE (child->widget)) - continue; + continue; get_child_requisition (wbox, child->widget, &child_requisition); if (!last_col_filled) - *height_inc = MIN (*height_inc, child_requisition.height - left_over); + *height_inc = MIN (*height_inc, child_requisition.height - left_over); col_height = child_requisition.height; col_width = child_requisition.width; for (col_child = child->next; col_child && n < wbox->child_limit; col_child = col_child->next) - { - if (GTK_WIDGET_VISIBLE (col_child->widget)) - { - get_child_requisition (wbox, col_child->widget, &child_requisition); - if (col_height + wbox->vspacing + child_requisition.height > max_height) - break; - col_height += wbox->vspacing + child_requisition.height; - col_width = MAX (col_width, child_requisition.width); - n++; - } - child = col_child; - } + { + if (GTK_WIDGET_VISIBLE (col_child->widget)) + { + get_child_requisition (wbox, col_child->widget, &child_requisition); + if (col_height + wbox->vspacing + child_requisition.height > max_height) + break; + col_height += wbox->vspacing + child_requisition.height; + col_width = MAX (col_width, child_requisition.width); + n++; + } + child = col_child; + } last_col_filled = n >= wbox->child_limit; left_over = last_col_filled ? 0 : max_height - (col_height + wbox->vspacing); total_width += (n_cols ? wbox->hspacing : 0) + col_width; @@ -177,7 +177,7 @@ get_layout_size (GtkVWrapBox *this, static void gtk_vwrap_box_size_request (GtkWidget *widget, - GtkRequisition *requisition) + GtkRequisition *requisition) { GtkVWrapBox *this = GTK_VWRAP_BOX (widget); GtkWrapBox *wbox = GTK_WRAP_BOX (widget); @@ -196,12 +196,12 @@ gtk_vwrap_box_size_request (GtkWidget *widget, for (child = wbox->children; child; child = child->next) if (GTK_WIDGET_VISIBLE (child->widget)) { - GtkRequisition child_requisition; - - gtk_widget_size_request (child->widget, &child_requisition); + GtkRequisition child_requisition; + + gtk_widget_size_request (child->widget, &child_requisition); - this->max_child_height = MAX (this->max_child_height, child_requisition.height); - this->max_child_width = MAX (this->max_child_width, child_requisition.width); + this->max_child_height = MAX (this->max_child_height, child_requisition.height); + this->max_child_width = MAX (this->max_child_width, child_requisition.width); } /* figure all possible layouts */ @@ -214,19 +214,19 @@ gtk_vwrap_box_size_request (GtkWidget *widget, layout_height += col_inc; layout_width = get_layout_size (this, layout_height, &col_inc); - ratio = layout_width / layout_height; /**/ + ratio = layout_width / layout_height; /**/ dist = MAX (ratio, wbox->aspect_ratio) - MIN (ratio, wbox->aspect_ratio); if (dist < ratio_dist) - { - ratio_dist = dist; - requisition->height = layout_height; - requisition->width = layout_width; - } + { + ratio_dist = dist; + requisition->height = layout_height; + requisition->width = layout_width; + } /* g_print ("ratio for height %d width %d = %f\n", - (gint) layout_height, - (gint) layout_width, - ratio); + (gint) layout_height, + (gint) layout_width, + ratio); */ } while (col_inc); @@ -241,10 +241,10 @@ gtk_vwrap_box_size_request (GtkWidget *widget, static GSList* reverse_list_col_children (GtkWrapBox *wbox, - GtkWrapBoxChild **child_p, - GtkAllocation *area, - guint *max_child_size, - gboolean *expand_line) + GtkWrapBoxChild **child_p, + GtkAllocation *area, + guint *max_child_size, + gboolean *expand_line) { GSList *slist = NULL; guint height = 0, col_height = area->height; @@ -273,22 +273,22 @@ reverse_list_col_children (GtkWrapBox *wbox, child = *child_p; while (child && n < wbox->child_limit) - { - if (GTK_WIDGET_VISIBLE (child->widget)) - { - get_child_requisition (wbox, child->widget, &child_requisition); - if (height + wbox->vspacing + child_requisition.height > col_height || - child->wrapped) - break; - height += wbox->vspacing + child_requisition.height; - *max_child_size = MAX (*max_child_size, child_requisition.width); - *expand_line |= child->hexpand; - slist = g_slist_prepend (slist, child); - n++; - } - *child_p = child->next; - child = *child_p; - } + { + if (GTK_WIDGET_VISIBLE (child->widget)) + { + get_child_requisition (wbox, child->widget, &child_requisition); + if (height + wbox->vspacing + child_requisition.height > col_height || + child->wrapped) + break; + height += wbox->vspacing + child_requisition.height; + *max_child_size = MAX (*max_child_size, child_requisition.width); + *expand_line |= child->hexpand; + slist = g_slist_prepend (slist, child); + n++; + } + *child_p = child->next; + child = *child_p; + } } return slist; @@ -296,10 +296,10 @@ reverse_list_col_children (GtkWrapBox *wbox, static void layout_col (GtkWrapBox *wbox, - GtkAllocation *area, - GSList *children, - guint children_per_line, - gboolean hexpand) + GtkAllocation *area, + GSList *children, + guint children_per_line, + gboolean hexpand) { GSList *slist; guint n_children = 0, n_expand_children = 0, have_expand_children = 0; @@ -314,7 +314,7 @@ layout_col (GtkWrapBox *wbox, n_children++; if (child->vexpand) - n_expand_children++; + n_expand_children++; get_child_requisition (wbox, child->widget, &child_requisition); total_height += child_requisition.height; @@ -342,29 +342,29 @@ layout_col (GtkWrapBox *wbox, else { if (wbox->justify == GTK_JUSTIFY_FILL) - { - height = extra; - have_expand_children = TRUE; - n_expand_children = n_children; - extra /= ((gdouble) n_expand_children); - } + { + height = extra; + have_expand_children = TRUE; + n_expand_children = n_children; + extra /= ((gdouble) n_expand_children); + } else if (wbox->justify == GTK_JUSTIFY_CENTER) - { - y += extra / 2; - height = 0; - extra = 0; - } + { + y += extra / 2; + height = 0; + extra = 0; + } else if (wbox->justify == GTK_JUSTIFY_LEFT) - { - height = 0; - extra = 0; - } + { + height = 0; + extra = 0; + } else if (wbox->justify == GTK_JUSTIFY_RIGHT) - { - y += extra; - height = 0; - extra = 0; - } + { + y += extra; + height = 0; + extra = 0; + } } n_children = 0; @@ -375,61 +375,61 @@ layout_col (GtkWrapBox *wbox, child_allocation.y = y; child_allocation.x = area->x; if (wbox->homogeneous) - { - child_allocation.width = area->width; - child_allocation.height = height; - y += child_allocation.height + wbox->vspacing; - } + { + child_allocation.width = area->width; + child_allocation.height = height; + y += child_allocation.height + wbox->vspacing; + } else - { - GtkRequisition child_requisition; - - get_child_requisition (wbox, child->widget, &child_requisition); - - if (child_requisition.width >= area->width) - child_allocation.width = area->width; - else - { - child_allocation.width = child_requisition.width; - if (wbox->line_justify == GTK_JUSTIFY_FILL || child->hfill) - child_allocation.width = area->width; - else if (child->hexpand || wbox->line_justify == GTK_JUSTIFY_CENTER) - child_allocation.x += (area->width - child_requisition.width) / 2; - else if (wbox->line_justify == GTK_JUSTIFY_BOTTOM) - child_allocation.x += area->width - child_requisition.width; - } - - if (have_expand_children) - { - child_allocation.height = child_requisition.height; - if (child->vexpand || wbox->justify == GTK_JUSTIFY_FILL) - { - guint space; - - n_expand_children--; - space = extra * n_expand_children; - space = height - space; - height -= space; - if (child->vfill) - child_allocation.height += space; - else - { - child_allocation.y += space / 2; - y += space; - } - } - } - else - { - /* g_print ("child_allocation.y %d += %d * %f ", - child_allocation.y, n_children, extra); */ - child_allocation.y += n_children * extra; - /* g_print ("= %d\n", - child_allocation.y); */ - child_allocation.height = MIN (child_requisition.height, - area->height - child_allocation.y + area->y); - } - } + { + GtkRequisition child_requisition; + + get_child_requisition (wbox, child->widget, &child_requisition); + + if (child_requisition.width >= area->width) + child_allocation.width = area->width; + else + { + child_allocation.width = child_requisition.width; + if (wbox->line_justify == GTK_JUSTIFY_FILL || child->hfill) + child_allocation.width = area->width; + else if (child->hexpand || wbox->line_justify == GTK_JUSTIFY_CENTER) + child_allocation.x += (area->width - child_requisition.width) / 2; + else if (wbox->line_justify == GTK_JUSTIFY_BOTTOM) + child_allocation.x += area->width - child_requisition.width; + } + + if (have_expand_children) + { + child_allocation.height = child_requisition.height; + if (child->vexpand || wbox->justify == GTK_JUSTIFY_FILL) + { + guint space; + + n_expand_children--; + space = extra * n_expand_children; + space = height - space; + height -= space; + if (child->vfill) + child_allocation.height += space; + else + { + child_allocation.y += space / 2; + y += space; + } + } + } + else + { + /* g_print ("child_allocation.y %d += %d * %f ", + child_allocation.y, n_children, extra); */ + child_allocation.y += n_children * extra; + /* g_print ("= %d\n", + child_allocation.y); */ + child_allocation.height = MIN (child_requisition.height, + area->height - child_allocation.y + area->y); + } + } y += child_allocation.height + wbox->vspacing; gtk_widget_size_allocate (child->widget, &child_allocation); @@ -448,7 +448,7 @@ struct _Line static void layout_cols (GtkWrapBox *wbox, - GtkAllocation *area) + GtkAllocation *area) { GtkWrapBoxChild *next_child; guint min_width; @@ -461,10 +461,10 @@ layout_cols (GtkWrapBox *wbox, next_child = wbox->children; slist = GTK_WRAP_BOX_GET_CLASS (wbox)->rlist_line_children (wbox, - &next_child, - area, - &min_width, - &hexpand); + &next_child, + area, + &min_width, + &hexpand); slist = g_slist_reverse (slist); children_per_line = g_slist_length (slist); @@ -477,16 +477,16 @@ layout_cols (GtkWrapBox *wbox, total_width += min_width; line->expand = hexpand; if (hexpand) - n_expand_lines++; + n_expand_lines++; line->next = line_list; line_list = line; n_lines++; slist = GTK_WRAP_BOX_GET_CLASS (wbox)->rlist_line_children (wbox, - &next_child, - area, - &min_width, - &hexpand); + &next_child, + area, + &min_width, + &hexpand); slist = g_slist_reverse (slist); } @@ -501,32 +501,32 @@ layout_cols (GtkWrapBox *wbox, gfloat n_shrink_lines = n_lines; while (line_list) - { - Line *tmp = line_list->next; + { + Line *tmp = line_list->next; - if (shrink_width) - { - Line *line = line_list; - guint shrink_fract = shrink_width / n_shrink_lines + 0.5; + if (shrink_width) + { + Line *line = line_list; + guint shrink_fract = shrink_width / n_shrink_lines + 0.5; - if (line->min_size > shrink_fract) - { - shrink_width -= shrink_fract; - line->min_size -= shrink_fract; - } - else - { - shrink_width -= line->min_size - 1; - line->min_size = 1; - } - } - n_shrink_lines--; + if (line->min_size > shrink_fract) + { + shrink_width -= shrink_fract; + line->min_size -= shrink_fract; + } + else + { + shrink_width -= line->min_size - 1; + line->min_size = 1; + } + } + n_shrink_lines--; - last = line_list; - line_list->next = prev; - prev = line_list; - line_list = tmp; - } + last = line_list; + line_list->next = prev; + prev = line_list; + line_list = tmp; + } line_list = last; } @@ -539,53 +539,53 @@ layout_cols (GtkWrapBox *wbox, width = MAX (n_lines, width - (n_lines - 1) * wbox->hspacing); if (wbox->homogeneous) - width /= ((gdouble) n_lines); + width /= ((gdouble) n_lines); else if (n_expand_lines) - { - width = MAX (0, width - total_width); - extra = width / ((gdouble) n_expand_lines); - } + { + width = MAX (0, width - total_width); + extra = width / ((gdouble) n_expand_lines); + } else - width = 0; + width = 0; x = area->x; line = line_list; while (line) - { - GtkAllocation col_allocation; - Line *next_line = line->next; - - col_allocation.y = area->y; - col_allocation.height = area->height; - if (wbox->homogeneous) - col_allocation.width = width; - else - { - col_allocation.width = line->min_size; - - if (line->expand) - col_allocation.width += extra; - } - - col_allocation.x = x; - - x += col_allocation.width + wbox->hspacing; - layout_col (wbox, - &col_allocation, - line->children, - children_per_line, - line->expand); + { + GtkAllocation col_allocation; + Line *next_line = line->next; + + col_allocation.y = area->y; + col_allocation.height = area->height; + if (wbox->homogeneous) + col_allocation.width = width; + else + { + col_allocation.width = line->min_size; + + if (line->expand) + col_allocation.width += extra; + } + + col_allocation.x = x; + + x += col_allocation.width + wbox->hspacing; + layout_col (wbox, + &col_allocation, + line->children, + children_per_line, + line->expand); - g_slist_free (line->children); - g_free (line); - line = next_line; - } + g_slist_free (line->children); + g_free (line); + line = next_line; + } } } static void gtk_vwrap_box_size_allocate (GtkWidget *widget, - GtkAllocation *allocation) + GtkAllocation *allocation) { GtkWrapBox *wbox = GTK_WRAP_BOX (widget); GtkAllocation area; diff --git a/app/widgets/gtkvwrapbox.h b/app/widgets/gtkvwrapbox.h index 8e07866137..7a618a630b 100644 --- a/app/widgets/gtkvwrapbox.h +++ b/app/widgets/gtkvwrapbox.h @@ -30,10 +30,10 @@ G_BEGIN_DECLS /* --- type macros --- */ -#define GTK_TYPE_VWRAP_BOX (gtk_vwrap_box_get_type ()) -#define GTK_VWRAP_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_VWRAP_BOX, GtkVWrapBox)) +#define GTK_TYPE_VWRAP_BOX (gtk_vwrap_box_get_type ()) +#define GTK_VWRAP_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_VWRAP_BOX, GtkVWrapBox)) #define GTK_VWRAP_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_VWRAP_BOX, GtkVWrapBoxClass)) -#define GTK_IS_VWRAP_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_VWRAP_BOX)) +#define GTK_IS_VWRAP_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_VWRAP_BOX)) #define GTK_IS_VWRAP_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_VWRAP_BOX)) #define GTK_VWRAP_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_VWRAP_BOX, GtkVWrapBoxClass)) @@ -61,7 +61,7 @@ struct _GtkVWrapBoxClass /* --- prototypes --- */ -GType gtk_vwrap_box_get_type (void) G_GNUC_CONST; +GType gtk_vwrap_box_get_type (void) G_GNUC_CONST; GtkWidget * gtk_vwrap_box_new (gboolean homogeneous); diff --git a/app/widgets/gtkwrapbox.c b/app/widgets/gtkwrapbox.c index a4b6a67f9d..8d20f3c8ac 100644 --- a/app/widgets/gtkwrapbox.c +++ b/app/widgets/gtkwrapbox.c @@ -53,35 +53,35 @@ enum { static void gtk_wrap_box_class_init (GtkWrapBoxClass *klass); static void gtk_wrap_box_init (GtkWrapBox *wbox); static void gtk_wrap_box_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec); + guint property_id, + const GValue *value, + GParamSpec *pspec); static void gtk_wrap_box_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec); + guint property_id, + GValue *value, + GParamSpec *pspec); static void gtk_wrap_box_set_child_property (GtkContainer *container, - GtkWidget *child, - guint property_id, - const GValue *value, - GParamSpec *pspec); + GtkWidget *child, + guint property_id, + const GValue *value, + GParamSpec *pspec); static void gtk_wrap_box_get_child_property (GtkContainer *container, - GtkWidget *child, - guint property_id, - GValue *value, - GParamSpec *pspec); + GtkWidget *child, + guint property_id, + GValue *value, + GParamSpec *pspec); static void gtk_wrap_box_map (GtkWidget *widget); static void gtk_wrap_box_unmap (GtkWidget *widget); static gint gtk_wrap_box_expose (GtkWidget *widget, - GdkEventExpose *event); + GdkEventExpose *event); static void gtk_wrap_box_add (GtkContainer *container, - GtkWidget *widget); + GtkWidget *widget); static void gtk_wrap_box_remove (GtkContainer *container, - GtkWidget *widget); + GtkWidget *widget); static void gtk_wrap_box_forall (GtkContainer *container, - gboolean include_internals, - GtkCallback callback, - gpointer callback_data); + gboolean include_internals, + GtkCallback callback, + gpointer callback_data); static GType gtk_wrap_box_child_type (GtkContainer *container); @@ -99,19 +99,19 @@ gtk_wrap_box_get_type (void) { static const GTypeInfo wrap_box_info = { - sizeof (GtkWrapBoxClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) gtk_wrap_box_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (GtkWrapBox), - 0, /* n_preallocs */ - (GInstanceInitFunc) gtk_wrap_box_init, + sizeof (GtkWrapBoxClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gtk_wrap_box_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GtkWrapBox), + 0, /* n_preallocs */ + (GInstanceInitFunc) gtk_wrap_box_init, }; wrap_box_type = g_type_register_static (GTK_TYPE_CONTAINER, "GtkWrapBox", - &wrap_box_info, 0); + &wrap_box_info, 0); } return wrap_box_type; @@ -147,121 +147,121 @@ gtk_wrap_box_class_init (GtkWrapBoxClass *class) class->rlist_line_children = NULL; g_object_class_install_property (object_class, - PROP_HOMOGENEOUS, - g_param_spec_boolean ("homogeneous", - NULL, - NULL, - FALSE, - G_PARAM_READWRITE)); + PROP_HOMOGENEOUS, + g_param_spec_boolean ("homogeneous", + NULL, + NULL, + FALSE, + G_PARAM_READWRITE)); g_object_class_install_property (object_class, - PROP_JUSTIFY, - g_param_spec_enum ("justify", - NULL, - NULL, - GTK_TYPE_JUSTIFICATION, - GTK_JUSTIFY_LEFT, - G_PARAM_READWRITE)); + PROP_JUSTIFY, + g_param_spec_enum ("justify", + NULL, + NULL, + GTK_TYPE_JUSTIFICATION, + GTK_JUSTIFY_LEFT, + G_PARAM_READWRITE)); g_object_class_install_property (object_class, - PROP_HSPACING, - g_param_spec_uint ("hspacing", - NULL, - NULL, - 0, - G_MAXINT, - 0, - G_PARAM_READWRITE)); + PROP_HSPACING, + g_param_spec_uint ("hspacing", + NULL, + NULL, + 0, + G_MAXINT, + 0, + G_PARAM_READWRITE)); g_object_class_install_property (object_class, - PROP_VSPACING, - g_param_spec_uint ("vspacing", - NULL, - NULL, - 0, - G_MAXINT, - 0, - G_PARAM_READWRITE)); + PROP_VSPACING, + g_param_spec_uint ("vspacing", + NULL, + NULL, + 0, + G_MAXINT, + 0, + G_PARAM_READWRITE)); g_object_class_install_property (object_class, - PROP_LINE_JUSTIFY, - g_param_spec_enum ("line-justify", - NULL, - NULL, - GTK_TYPE_JUSTIFICATION, - GTK_JUSTIFY_BOTTOM, - G_PARAM_READWRITE)); + PROP_LINE_JUSTIFY, + g_param_spec_enum ("line-justify", + NULL, + NULL, + GTK_TYPE_JUSTIFICATION, + GTK_JUSTIFY_BOTTOM, + G_PARAM_READWRITE)); g_object_class_install_property (object_class, - PROP_ASPECT_RATIO, - g_param_spec_float ("aspect-ratio", - NULL, - NULL, - 0.0, - G_MAXFLOAT, - 1.0, - G_PARAM_READWRITE)); + PROP_ASPECT_RATIO, + g_param_spec_float ("aspect-ratio", + NULL, + NULL, + 0.0, + G_MAXFLOAT, + 1.0, + G_PARAM_READWRITE)); g_object_class_install_property (object_class, - PROP_CURRENT_RATIO, - g_param_spec_float ("current-ratio", - NULL, - NULL, - 0.0, - G_MAXFLOAT, - 1.0, - G_PARAM_READABLE)); + PROP_CURRENT_RATIO, + g_param_spec_float ("current-ratio", + NULL, + NULL, + 0.0, + G_MAXFLOAT, + 1.0, + G_PARAM_READABLE)); g_object_class_install_property (object_class, - PROP_CHILD_LIMIT, - g_param_spec_uint ("max-children-per-line", - NULL, - NULL, - 1, - 32767, - 32767, - G_PARAM_READWRITE)); + PROP_CHILD_LIMIT, + g_param_spec_uint ("max-children-per-line", + NULL, + NULL, + 1, + 32767, + 32767, + G_PARAM_READWRITE)); gtk_container_class_install_child_property (container_class, - CHILD_PROP_POSITION, - g_param_spec_int ("position", - NULL, - NULL, - -1, G_MAXINT, 0, - G_PARAM_READWRITE)); + CHILD_PROP_POSITION, + g_param_spec_int ("position", + NULL, + NULL, + -1, G_MAXINT, 0, + G_PARAM_READWRITE)); gtk_container_class_install_child_property (container_class, - CHILD_PROP_HEXPAND, - g_param_spec_boolean ("hexpand", - NULL, - NULL, - FALSE, - G_PARAM_READWRITE)); + CHILD_PROP_HEXPAND, + g_param_spec_boolean ("hexpand", + NULL, + NULL, + FALSE, + G_PARAM_READWRITE)); gtk_container_class_install_child_property (container_class, - CHILD_PROP_HFILL, - g_param_spec_boolean ("hfill", - NULL, - NULL, - FALSE, - G_PARAM_READWRITE)); + CHILD_PROP_HFILL, + g_param_spec_boolean ("hfill", + NULL, + NULL, + FALSE, + G_PARAM_READWRITE)); gtk_container_class_install_child_property (container_class, - CHILD_PROP_VEXPAND, - g_param_spec_boolean ("vexpand", - NULL, - NULL, - FALSE, - G_PARAM_READWRITE)); + CHILD_PROP_VEXPAND, + g_param_spec_boolean ("vexpand", + NULL, + NULL, + FALSE, + G_PARAM_READWRITE)); gtk_container_class_install_child_property (container_class, - CHILD_PROP_VFILL, - g_param_spec_boolean ("vfill", - NULL, - NULL, - FALSE, - G_PARAM_READWRITE)); + CHILD_PROP_VFILL, + g_param_spec_boolean ("vfill", + NULL, + NULL, + FALSE, + G_PARAM_READWRITE)); gtk_container_class_install_child_property (container_class, - CHILD_PROP_WRAPPED, - g_param_spec_boolean ("wrapped", - NULL, - NULL, - FALSE, - G_PARAM_READWRITE)); + CHILD_PROP_WRAPPED, + g_param_spec_boolean ("wrapped", + NULL, + NULL, + FALSE, + G_PARAM_READWRITE)); } static void @@ -282,9 +282,9 @@ gtk_wrap_box_init (GtkWrapBox *wbox) static void gtk_wrap_box_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { GtkWrapBox *wbox = GTK_WRAP_BOX (object); @@ -310,7 +310,7 @@ gtk_wrap_box_set_property (GObject *object, break; case PROP_CHILD_LIMIT: if (wbox->child_limit != g_value_get_uint (value)) - gtk_widget_queue_resize (GTK_WIDGET (wbox)); + gtk_widget_queue_resize (GTK_WIDGET (wbox)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -320,9 +320,9 @@ gtk_wrap_box_set_property (GObject *object, static void gtk_wrap_box_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { GtkWrapBox *wbox = GTK_WRAP_BOX (object); GtkWidget *widget = GTK_WIDGET (object); @@ -349,7 +349,7 @@ gtk_wrap_box_get_property (GObject *object, break; case PROP_CURRENT_RATIO: g_value_set_float (value, (((gfloat) widget->allocation.width) / - ((gfloat) widget->allocation.height))); + ((gfloat) widget->allocation.height))); break; case PROP_CHILD_LIMIT: g_value_set_uint (value, wbox->child_limit); @@ -362,10 +362,10 @@ gtk_wrap_box_get_property (GObject *object, static void gtk_wrap_box_set_child_property (GtkContainer *container, - GtkWidget *child, - guint property_id, - const GValue *value, - GParamSpec *pspec) + GtkWidget *child, + guint property_id, + const GValue *value, + GParamSpec *pspec) { GtkWrapBox *wbox = GTK_WRAP_BOX (container); gboolean hexpand = FALSE, hfill = FALSE; @@ -374,9 +374,9 @@ gtk_wrap_box_set_child_property (GtkContainer *container, if (property_id != CHILD_PROP_POSITION) gtk_wrap_box_query_child_packing (wbox, child, - &hexpand, &hfill, - &vexpand, &vfill, - &wrapped); + &hexpand, &hfill, + &vexpand, &vfill, + &wrapped); switch (property_id) { @@ -385,33 +385,33 @@ gtk_wrap_box_set_child_property (GtkContainer *container, break; case CHILD_PROP_HEXPAND: gtk_wrap_box_set_child_packing (wbox, child, - g_value_get_boolean (value), hfill, - vexpand, vfill, - wrapped); + g_value_get_boolean (value), hfill, + vexpand, vfill, + wrapped); break; case CHILD_PROP_HFILL: gtk_wrap_box_set_child_packing (wbox, child, - hexpand, g_value_get_boolean (value), - vexpand, vfill, - wrapped); + hexpand, g_value_get_boolean (value), + vexpand, vfill, + wrapped); break; case CHILD_PROP_VEXPAND: gtk_wrap_box_set_child_packing (wbox, child, - hexpand, hfill, - g_value_get_boolean (value), vfill, - wrapped); + hexpand, hfill, + g_value_get_boolean (value), vfill, + wrapped); break; case CHILD_PROP_VFILL: gtk_wrap_box_set_child_packing (wbox, child, - hexpand, hfill, - vexpand, g_value_get_boolean (value), - wrapped); + hexpand, hfill, + vexpand, g_value_get_boolean (value), + wrapped); break; case CHILD_PROP_WRAPPED: gtk_wrap_box_set_child_packing (wbox, child, - hexpand, hfill, - vexpand, vfill, - g_value_get_boolean (value)); + hexpand, hfill, + vexpand, vfill, + g_value_get_boolean (value)); break; default: GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID (container, property_id, pspec); @@ -421,10 +421,10 @@ gtk_wrap_box_set_child_property (GtkContainer *container, static void gtk_wrap_box_get_child_property (GtkContainer *container, - GtkWidget *child, - guint property_id, - GValue *value, - GParamSpec *pspec) + GtkWidget *child, + guint property_id, + GValue *value, + GParamSpec *pspec) { GtkWrapBox *wbox = GTK_WRAP_BOX (container); gboolean hexpand = FALSE, hfill = FALSE; @@ -433,9 +433,9 @@ gtk_wrap_box_get_child_property (GtkContainer *container, if (property_id != CHILD_PROP_POSITION) gtk_wrap_box_query_child_packing (wbox, child, - &hexpand, &hfill, - &vexpand, &vfill, - &wrapped); + &hexpand, &hfill, + &vexpand, &vfill, + &wrapped); switch (property_id) { @@ -444,11 +444,11 @@ gtk_wrap_box_get_child_property (GtkContainer *container, case CHILD_PROP_POSITION: i = 0; for (child_info = wbox->children; child_info; child_info = child_info->next) - { - if (child_info->widget == child) - break; - i += 1; - } + { + if (child_info->widget == child) + break; + i += 1; + } g_value_set_int (value, child_info ? i : -1); break; case CHILD_PROP_HEXPAND: @@ -473,14 +473,14 @@ gtk_wrap_box_get_child_property (GtkContainer *container, } static GType -gtk_wrap_box_child_type (GtkContainer *container) +gtk_wrap_box_child_type (GtkContainer *container) { return GTK_TYPE_WIDGET; } void gtk_wrap_box_set_homogeneous (GtkWrapBox *wbox, - gboolean homogeneous) + gboolean homogeneous) { g_return_if_fail (GTK_IS_WRAP_BOX (wbox)); @@ -494,7 +494,7 @@ gtk_wrap_box_set_homogeneous (GtkWrapBox *wbox, void gtk_wrap_box_set_hspacing (GtkWrapBox *wbox, - guint hspacing) + guint hspacing) { g_return_if_fail (GTK_IS_WRAP_BOX (wbox)); @@ -507,7 +507,7 @@ gtk_wrap_box_set_hspacing (GtkWrapBox *wbox, void gtk_wrap_box_set_vspacing (GtkWrapBox *wbox, - guint vspacing) + guint vspacing) { g_return_if_fail (GTK_IS_WRAP_BOX (wbox)); @@ -520,7 +520,7 @@ gtk_wrap_box_set_vspacing (GtkWrapBox *wbox, void gtk_wrap_box_set_justify (GtkWrapBox *wbox, - GtkJustification justify) + GtkJustification justify) { g_return_if_fail (GTK_IS_WRAP_BOX (wbox)); g_return_if_fail (justify <= GTK_JUSTIFY_FILL); @@ -534,7 +534,7 @@ gtk_wrap_box_set_justify (GtkWrapBox *wbox, void gtk_wrap_box_set_line_justify (GtkWrapBox *wbox, - GtkJustification line_justify) + GtkJustification line_justify) { g_return_if_fail (GTK_IS_WRAP_BOX (wbox)); g_return_if_fail (line_justify <= GTK_JUSTIFY_FILL); @@ -548,7 +548,7 @@ gtk_wrap_box_set_line_justify (GtkWrapBox *wbox, void gtk_wrap_box_set_aspect_ratio (GtkWrapBox *wbox, - gfloat aspect_ratio) + gfloat aspect_ratio) { g_return_if_fail (GTK_IS_WRAP_BOX (wbox)); @@ -563,11 +563,11 @@ gtk_wrap_box_set_aspect_ratio (GtkWrapBox *wbox, void gtk_wrap_box_pack (GtkWrapBox *wbox, - GtkWidget *child, - gboolean hexpand, - gboolean hfill, - gboolean vexpand, - gboolean vfill) + GtkWidget *child, + gboolean hexpand, + gboolean hfill, + gboolean vexpand, + gboolean vfill) { g_return_if_fail (GTK_IS_WRAP_BOX (wbox)); g_return_if_fail (GTK_IS_WIDGET (child)); @@ -578,12 +578,12 @@ gtk_wrap_box_pack (GtkWrapBox *wbox, void gtk_wrap_box_pack_wrapped (GtkWrapBox *wbox, - GtkWidget *child, - gboolean hexpand, - gboolean hfill, - gboolean vexpand, - gboolean vfill, - gboolean wrapped) + GtkWidget *child, + gboolean hexpand, + gboolean hfill, + gboolean vexpand, + gboolean vfill, + gboolean wrapped) { GtkWrapBoxChild *child_info; @@ -604,7 +604,7 @@ gtk_wrap_box_pack_wrapped (GtkWrapBox *wbox, GtkWrapBoxChild *last = wbox->children; while (last->next) - last = last->next; + last = last->next; last->next = child_info; } else @@ -619,7 +619,7 @@ gtk_wrap_box_pack_wrapped (GtkWrapBox *wbox, if (GTK_WIDGET_VISIBLE (wbox) && GTK_WIDGET_VISIBLE (child)) { if (GTK_WIDGET_MAPPED (wbox)) - gtk_widget_map (child); + gtk_widget_map (child); gtk_widget_queue_resize (child); } @@ -627,8 +627,8 @@ gtk_wrap_box_pack_wrapped (GtkWrapBox *wbox, void gtk_wrap_box_reorder_child (GtkWrapBox *wbox, - GtkWidget *child, - gint position) + GtkWidget *child, + gint position) { GtkWrapBoxChild *child_info, *last = NULL; @@ -644,46 +644,46 @@ gtk_wrap_box_reorder_child (GtkWrapBox *wbox, GtkWrapBoxChild *tmp; if (last) - last->next = child_info->next; + last->next = child_info->next; else - wbox->children = child_info->next; + wbox->children = child_info->next; last = NULL; tmp = wbox->children; while (position && tmp->next) - { - position--; - last = tmp; - tmp = last->next; - } + { + position--; + last = tmp; + tmp = last->next; + } if (position) - { - tmp->next = child_info; - child_info->next = NULL; - } + { + tmp->next = child_info; + child_info->next = NULL; + } else - { - child_info->next = tmp; - if (last) - last->next = child_info; - else - wbox->children = child_info; - } + { + child_info->next = tmp; + if (last) + last->next = child_info; + else + wbox->children = child_info; + } if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (wbox)) - gtk_widget_queue_resize (child); + gtk_widget_queue_resize (child); } } void gtk_wrap_box_query_child_packing (GtkWrapBox *wbox, - GtkWidget *child, - gboolean *hexpand, - gboolean *hfill, - gboolean *vexpand, - gboolean *vfill, - gboolean *wrapped) + GtkWidget *child, + gboolean *hexpand, + gboolean *hfill, + gboolean *vexpand, + gboolean *vfill, + gboolean *wrapped) { GtkWrapBoxChild *child_info; @@ -697,26 +697,26 @@ gtk_wrap_box_query_child_packing (GtkWrapBox *wbox, if (child_info) { if (hexpand) - *hexpand = child_info->hexpand; + *hexpand = child_info->hexpand; if (hfill) - *hfill = child_info->hfill; + *hfill = child_info->hfill; if (vexpand) - *vexpand = child_info->vexpand; + *vexpand = child_info->vexpand; if (vfill) - *vfill = child_info->vfill; + *vfill = child_info->vfill; if (wrapped) - *wrapped = child_info->wrapped; + *wrapped = child_info->wrapped; } } void gtk_wrap_box_set_child_packing (GtkWrapBox *wbox, - GtkWidget *child, - gboolean hexpand, - gboolean hfill, - gboolean vexpand, - gboolean vfill, - gboolean wrapped) + GtkWidget *child, + gboolean hexpand, + gboolean hfill, + gboolean vexpand, + gboolean vfill, + gboolean wrapped) { GtkWrapBoxChild *child_info; @@ -745,13 +745,13 @@ gtk_wrap_box_set_child_packing (GtkWrapBox *wbox, child_info->wrapped = wrapped; if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (wbox)) - gtk_widget_queue_resize (child); + gtk_widget_queue_resize (child); } } guint* gtk_wrap_box_query_line_lengths (GtkWrapBox *wbox, - guint *_n_lines) + guint *_n_lines) { GtkWrapBoxChild *next_child = NULL; GtkAllocation area, *allocation; @@ -772,10 +772,10 @@ gtk_wrap_box_query_line_lengths (GtkWrapBox *wbox, next_child = wbox->children; slist = GTK_WRAP_BOX_GET_CLASS (wbox)->rlist_line_children (wbox, - &next_child, - &area, - &max_child_size, - &expand_line); + &next_child, + &area, + &max_child_size, + &expand_line); while (slist) { guint l = n_lines++; @@ -785,10 +785,10 @@ gtk_wrap_box_query_line_lengths (GtkWrapBox *wbox, g_slist_free (slist); slist = GTK_WRAP_BOX_GET_CLASS (wbox)->rlist_line_children (wbox, - &next_child, - &area, - &max_child_size, - &expand_line); + &next_child, + &area, + &max_child_size, + &expand_line); } if (_n_lines) @@ -807,7 +807,7 @@ gtk_wrap_box_map (GtkWidget *widget) for (child = wbox->children; child; child = child->next) if (GTK_WIDGET_VISIBLE (child->widget) && - !GTK_WIDGET_MAPPED (child->widget)) + !GTK_WIDGET_MAPPED (child->widget)) gtk_widget_map (child->widget); } @@ -821,27 +821,27 @@ gtk_wrap_box_unmap (GtkWidget *widget) for (child = wbox->children; child; child = child->next) if (GTK_WIDGET_VISIBLE (child->widget) && - GTK_WIDGET_MAPPED (child->widget)) + GTK_WIDGET_MAPPED (child->widget)) gtk_widget_unmap (child->widget); } static gint gtk_wrap_box_expose (GtkWidget *widget, - GdkEventExpose *event) + GdkEventExpose *event) { return GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event); } static void gtk_wrap_box_add (GtkContainer *container, - GtkWidget *widget) + GtkWidget *widget) { gtk_wrap_box_pack (GTK_WRAP_BOX (container), widget, FALSE, TRUE, FALSE, TRUE); } static void gtk_wrap_box_remove (GtkContainer *container, - GtkWidget *widget) + GtkWidget *widget) { GtkWrapBox *wbox = GTK_WRAP_BOX (container); GtkWrapBoxChild *child, *last = NULL; @@ -850,24 +850,24 @@ gtk_wrap_box_remove (GtkContainer *container, while (child) { if (child->widget == widget) - { - gboolean was_visible; - - was_visible = GTK_WIDGET_VISIBLE (widget); - gtk_widget_unparent (widget); - - if (last) - last->next = child->next; - else - wbox->children = child->next; - g_free (child); - wbox->n_children--; - - if (was_visible) - gtk_widget_queue_resize (GTK_WIDGET (container)); - - break; - } + { + gboolean was_visible; + + was_visible = GTK_WIDGET_VISIBLE (widget); + gtk_widget_unparent (widget); + + if (last) + last->next = child->next; + else + wbox->children = child->next; + g_free (child); + wbox->n_children--; + + if (was_visible) + gtk_widget_queue_resize (GTK_WIDGET (container)); + + break; + } last = child; child = last->next; @@ -876,9 +876,9 @@ gtk_wrap_box_remove (GtkContainer *container, static void gtk_wrap_box_forall (GtkContainer *container, - gboolean include_internals, - GtkCallback callback, - gpointer callback_data) + gboolean include_internals, + GtkCallback callback, + gpointer callback_data) { GtkWrapBox *wbox = GTK_WRAP_BOX (container); GtkWrapBoxChild *child; diff --git a/app/widgets/gtkwrapbox.h b/app/widgets/gtkwrapbox.h index fc060e1142..e557b5da79 100644 --- a/app/widgets/gtkwrapbox.h +++ b/app/widgets/gtkwrapbox.h @@ -30,10 +30,10 @@ G_BEGIN_DECLS /* --- type macros --- */ -#define GTK_TYPE_WRAP_BOX (gtk_wrap_box_get_type ()) -#define GTK_WRAP_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_WRAP_BOX, GtkWrapBox)) +#define GTK_TYPE_WRAP_BOX (gtk_wrap_box_get_type ()) +#define GTK_WRAP_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_WRAP_BOX, GtkWrapBox)) #define GTK_WRAP_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_WRAP_BOX, GtkWrapBoxClass)) -#define GTK_IS_WRAP_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_WRAP_BOX)) +#define GTK_IS_WRAP_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_WRAP_BOX)) #define GTK_IS_WRAP_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WRAP_BOX)) #define GTK_WRAP_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_WRAP_BOX, GtkWrapBoxClass)) @@ -63,10 +63,10 @@ struct _GtkWrapBoxClass GtkContainerClass parent_class; GSList* (*rlist_line_children) (GtkWrapBox *wbox, - GtkWrapBoxChild **child_p, - GtkAllocation *area, - guint *max_child_size, - gboolean *expand_line); + GtkWrapBoxChild **child_p, + GtkAllocation *area, + guint *max_child_size, + gboolean *expand_line); }; struct _GtkWrapBoxChild { @@ -84,51 +84,51 @@ struct _GtkWrapBoxChild /* --- prototypes --- */ -GType gtk_wrap_box_get_type (void) G_GNUC_CONST; -void gtk_wrap_box_set_homogeneous (GtkWrapBox *wbox, - gboolean homogeneous); -void gtk_wrap_box_set_hspacing (GtkWrapBox *wbox, - guint hspacing); -void gtk_wrap_box_set_vspacing (GtkWrapBox *wbox, - guint vspacing); -void gtk_wrap_box_set_justify (GtkWrapBox *wbox, - GtkJustification justify); -void gtk_wrap_box_set_line_justify (GtkWrapBox *wbox, - GtkJustification line_justify); -void gtk_wrap_box_set_aspect_ratio (GtkWrapBox *wbox, - gfloat aspect_ratio); -void gtk_wrap_box_pack (GtkWrapBox *wbox, - GtkWidget *child, - gboolean hexpand, - gboolean hfill, - gboolean vexpand, - gboolean vfill); -void gtk_wrap_box_pack_wrapped (GtkWrapBox *wbox, - GtkWidget *child, - gboolean hexpand, - gboolean hfill, - gboolean vexpand, - gboolean vfill, - gboolean wrapped); +GType gtk_wrap_box_get_type (void) G_GNUC_CONST; +void gtk_wrap_box_set_homogeneous (GtkWrapBox *wbox, + gboolean homogeneous); +void gtk_wrap_box_set_hspacing (GtkWrapBox *wbox, + guint hspacing); +void gtk_wrap_box_set_vspacing (GtkWrapBox *wbox, + guint vspacing); +void gtk_wrap_box_set_justify (GtkWrapBox *wbox, + GtkJustification justify); +void gtk_wrap_box_set_line_justify (GtkWrapBox *wbox, + GtkJustification line_justify); +void gtk_wrap_box_set_aspect_ratio (GtkWrapBox *wbox, + gfloat aspect_ratio); +void gtk_wrap_box_pack (GtkWrapBox *wbox, + GtkWidget *child, + gboolean hexpand, + gboolean hfill, + gboolean vexpand, + gboolean vfill); +void gtk_wrap_box_pack_wrapped (GtkWrapBox *wbox, + GtkWidget *child, + gboolean hexpand, + gboolean hfill, + gboolean vexpand, + gboolean vfill, + gboolean wrapped); void gtk_wrap_box_reorder_child (GtkWrapBox *wbox, - GtkWidget *child, - gint position); + GtkWidget *child, + gint position); void gtk_wrap_box_query_child_packing (GtkWrapBox *wbox, - GtkWidget *child, - gboolean *hexpand, - gboolean *hfill, - gboolean *vexpand, - gboolean *vfill, - gboolean *wrapped); + GtkWidget *child, + gboolean *hexpand, + gboolean *hfill, + gboolean *vexpand, + gboolean *vfill, + gboolean *wrapped); void gtk_wrap_box_set_child_packing (GtkWrapBox *wbox, - GtkWidget *child, - gboolean hexpand, - gboolean hfill, - gboolean vexpand, - gboolean vfill, - gboolean wrapped); -guint* gtk_wrap_box_query_line_lengths (GtkWrapBox *wbox, - guint *n_lines); + GtkWidget *child, + gboolean hexpand, + gboolean hfill, + gboolean vexpand, + gboolean vfill, + gboolean wrapped); +guint* gtk_wrap_box_query_line_lengths (GtkWrapBox *wbox, + guint *n_lines); G_END_DECLS diff --git a/app/xcf/xcf-load.c b/app/xcf/xcf-load.c index ae6a246697..520c7bbcf5 100644 --- a/app/xcf/xcf-load.c +++ b/app/xcf/xcf-load.c @@ -326,8 +326,8 @@ xcf_load_image_props (XcfInfo *info, } /* discard color map, if image is not indexed, this is just - * sanity checking to make sure gimp doesn't end up with an - * image state that is impossible. + * sanity checking to make sure gimp doesn't end up with an + * image state that is impossible. */ if (gimp_image_base_type (image) != GIMP_INDEXED) { diff --git a/app/xcf/xcf-load.h b/app/xcf/xcf-load.h index ff5ddd6bd4..d77c3c9150 100644 --- a/app/xcf/xcf-load.h +++ b/app/xcf/xcf-load.h @@ -21,7 +21,7 @@ GimpImage * xcf_load_image (Gimp *gimp, - XcfInfo *info); + XcfInfo *info); #endif /* __XCF_LOAD_H__ */ diff --git a/app/xcf/xcf-read.c b/app/xcf/xcf-read.c index 4e0dc4a1aa..da7f1d3d8f 100644 --- a/app/xcf/xcf-read.c +++ b/app/xcf/xcf-read.c @@ -31,8 +31,8 @@ guint xcf_read_int32 (FILE *fp, - guint32 *data, - gint count) + guint32 *data, + gint count) { guint total; @@ -53,16 +53,16 @@ xcf_read_int32 (FILE *fp, guint xcf_read_float (FILE *fp, - gfloat *data, - gint count) + gfloat *data, + gint count) { return xcf_read_int32 (fp, (guint32 *) ((void *) data), count); } guint xcf_read_int8 (FILE *fp, - guint8 *data, - gint count) + guint8 *data, + gint count) { guint total; gint bytes; @@ -82,8 +82,8 @@ xcf_read_int8 (FILE *fp, guint xcf_read_string (FILE *fp, - gchar **data, - gint count) + gchar **data, + gint count) { guint32 tmp; guint total; diff --git a/app/xcf/xcf-read.h b/app/xcf/xcf-read.h index aedc0ddd14..38917d5d36 100644 --- a/app/xcf/xcf-read.h +++ b/app/xcf/xcf-read.h @@ -21,17 +21,17 @@ guint xcf_read_int32 (FILE *fp, - guint32 *data, - gint count); + guint32 *data, + gint count); guint xcf_read_float (FILE *fp, - gfloat *data, - gint count); + gfloat *data, + gint count); guint xcf_read_int8 (FILE *fp, - guint8 *data, - gint count); + guint8 *data, + gint count); guint xcf_read_string (FILE *fp, - gchar **data, - gint count); + gchar **data, + gint count); #endif /* __XCF_READ_H__ */ diff --git a/app/xcf/xcf-save.c b/app/xcf/xcf-save.c index 5ab33e411c..b813548d87 100644 --- a/app/xcf/xcf-save.c +++ b/app/xcf/xcf-save.c @@ -253,7 +253,7 @@ xcf_save_choose_format (XcfInfo *info, gint xcf_save_image (XcfInfo *info, - GimpImage *image) + GimpImage *image) { GimpLayer *layer; GimpLayer *floating_layer; @@ -358,16 +358,16 @@ xcf_save_image (XcfInfo *info, while (list || have_selection) { if (list) - { - channel = (GimpChannel *) list->data; + { + channel = (GimpChannel *) list->data; - list = g_list_next (list); - } + list = g_list_next (list); + } else - { - channel = image->selection_mask; - have_selection = FALSE; - } + { + channel = image->selection_mask; + have_selection = FALSE; + } /* save the start offset of where we are writing * out the next channel. @@ -410,8 +410,8 @@ xcf_save_image (XcfInfo *info, static gboolean xcf_save_image_props (XcfInfo *info, - GimpImage *image, - GError **error) + GimpImage *image, + GError **error) { GimpParasite *parasite = NULL; GimpUnit unit = gimp_image_get_unit (image); @@ -430,7 +430,7 @@ xcf_save_image_props (XcfInfo *info, error, image->guides)); xcf_check_error (xcf_save_prop (info, image, PROP_RESOLUTION, error, - image->xresolution, image->yresolution)); + image->xresolution, image->yresolution)); xcf_check_error (xcf_save_prop (info, image, PROP_TATTOO, error, image->tattoo_state)); @@ -481,9 +481,9 @@ xcf_save_image_props (XcfInfo *info, static gboolean xcf_save_layer_props (XcfInfo *info, - GimpImage *image, - GimpLayer *layer, - GError **error) + GimpImage *image, + GimpLayer *layer, + GError **error) { GimpParasite *parasite = NULL; @@ -500,7 +500,7 @@ xcf_save_layer_props (XcfInfo *info, xcf_check_error (xcf_save_prop (info, image, PROP_OPACITY, error, layer->opacity)); xcf_check_error (xcf_save_prop (info, image, PROP_VISIBLE, error, - gimp_item_get_visible (GIMP_ITEM (layer)))); + gimp_item_get_visible (GIMP_ITEM (layer)))); xcf_check_error (xcf_save_prop (info, image, PROP_LINKED, error, gimp_item_get_linked (GIMP_ITEM (layer)))); xcf_check_error (xcf_save_prop (info, image, PROP_LOCK_ALPHA, @@ -526,8 +526,8 @@ xcf_save_layer_props (XcfInfo *info, } xcf_check_error (xcf_save_prop (info, image, PROP_OFFSETS, error, - GIMP_ITEM (layer)->offset_x, - GIMP_ITEM (layer)->offset_y)); + GIMP_ITEM (layer)->offset_x, + GIMP_ITEM (layer)->offset_y)); xcf_check_error (xcf_save_prop (info, image, PROP_MODE, error, layer->mode)); xcf_check_error (xcf_save_prop (info, image, PROP_TATTOO, error, @@ -566,9 +566,9 @@ xcf_save_layer_props (XcfInfo *info, static gboolean xcf_save_channel_props (XcfInfo *info, - GimpImage *image, - GimpChannel *channel, - GError **error) + GimpImage *image, + GimpChannel *channel, + GError **error) { guchar col[3]; @@ -581,7 +581,7 @@ xcf_save_channel_props (XcfInfo *info, xcf_check_error (xcf_save_prop (info, image, PROP_OPACITY, error, channel->color.a)); xcf_check_error (xcf_save_prop (info, image, PROP_VISIBLE, error, - gimp_item_get_visible (GIMP_ITEM (channel)))); + gimp_item_get_visible (GIMP_ITEM (channel)))); xcf_check_error (xcf_save_prop (info, image, PROP_LINKED, error, gimp_item_get_linked (GIMP_ITEM (channel)))); xcf_check_error (xcf_save_prop (info, image, PROP_SHOW_MASKED, error, @@ -595,7 +595,7 @@ xcf_save_channel_props (XcfInfo *info, if (gimp_parasite_list_length (GIMP_ITEM (channel)->parasites) > 0) xcf_check_error (xcf_save_prop (info, image, PROP_PARASITES, error, - GIMP_ITEM (channel)->parasites)); + GIMP_ITEM (channel)->parasites)); xcf_check_error (xcf_save_prop (info, image, PROP_END, error)); @@ -604,10 +604,10 @@ xcf_save_channel_props (XcfInfo *info, static gboolean xcf_save_prop (XcfInfo *info, - GimpImage *image, - PropType prop_type, - GError **error, - ...) + GimpImage *image, + PropType prop_type, + GError **error, + ...) { guint32 size; va_list args; @@ -627,17 +627,17 @@ xcf_save_prop (XcfInfo *info, case PROP_COLORMAP: { - guint32 ncolors; - guchar *colors; + guint32 ncolors; + guchar *colors; - ncolors = va_arg (args, guint32); - colors = va_arg (args, guchar*); - size = 4 + ncolors * 3; + ncolors = va_arg (args, guint32); + colors = va_arg (args, guchar*); + size = 4 + ncolors * 3; xcf_write_prop_type_check_error (info, prop_type); - xcf_write_int32_check_error (info, &size, 1); - xcf_write_int32_check_error (info, &ncolors, 1); - xcf_write_int8_check_error (info, colors, ncolors * 3); + xcf_write_int32_check_error (info, &size, 1); + xcf_write_int32_check_error (info, &ncolors, 1); + xcf_write_int8_check_error (info, colors, ncolors * 3); } break; @@ -652,200 +652,200 @@ xcf_save_prop (XcfInfo *info, case PROP_FLOATING_SELECTION: { - guint32 dummy; + guint32 dummy; - dummy = 0; - size = 4; + dummy = 0; + size = 4; xcf_write_prop_type_check_error (info, prop_type); - xcf_write_int32_check_error (info, &size, 1); - info->floating_sel_offset = info->cp; - xcf_write_int32_check_error (info, &dummy, 1); + xcf_write_int32_check_error (info, &size, 1); + info->floating_sel_offset = info->cp; + xcf_write_int32_check_error (info, &dummy, 1); } break; case PROP_OPACITY: { - gdouble opacity; + gdouble opacity; guint32 uint_opacity; - opacity = va_arg (args, gdouble); + opacity = va_arg (args, gdouble); uint_opacity = opacity * 255.999; - size = 4; + size = 4; xcf_write_prop_type_check_error (info, prop_type); - xcf_write_int32_check_error (info, &size, 1); - xcf_write_int32_check_error (info, &uint_opacity, 1); + xcf_write_int32_check_error (info, &size, 1); + xcf_write_int32_check_error (info, &uint_opacity, 1); } break; case PROP_MODE: { - gint32 mode; + gint32 mode; - mode = va_arg (args, gint32); - size = 4; + mode = va_arg (args, gint32); + size = 4; xcf_write_prop_type_check_error (info, prop_type); - xcf_write_int32_check_error (info, &size, 1); - xcf_write_int32_check_error (info, (guint32 *) &mode, 1); + xcf_write_int32_check_error (info, &size, 1); + xcf_write_int32_check_error (info, (guint32 *) &mode, 1); } break; case PROP_VISIBLE: { - guint32 visible; + guint32 visible; - visible = va_arg (args, guint32); - size = 4; + visible = va_arg (args, guint32); + size = 4; xcf_write_prop_type_check_error (info, prop_type); - xcf_write_int32_check_error (info, &size, 1); - xcf_write_int32_check_error (info, &visible, 1); + xcf_write_int32_check_error (info, &size, 1); + xcf_write_int32_check_error (info, &visible, 1); } break; case PROP_LINKED: { - guint32 linked; + guint32 linked; - linked = va_arg (args, guint32); - size = 4; + linked = va_arg (args, guint32); + size = 4; xcf_write_prop_type_check_error (info, prop_type); - xcf_write_int32_check_error (info, &size, 1); - xcf_write_int32_check_error (info, &linked, 1); + xcf_write_int32_check_error (info, &size, 1); + xcf_write_int32_check_error (info, &linked, 1); } break; case PROP_LOCK_ALPHA: { - guint32 lock_alpha; + guint32 lock_alpha; - lock_alpha = va_arg (args, guint32); - size = 4; + lock_alpha = va_arg (args, guint32); + size = 4; xcf_write_prop_type_check_error (info, prop_type); - xcf_write_int32_check_error (info, &size, 1); - xcf_write_int32_check_error (info, &lock_alpha, 1); + xcf_write_int32_check_error (info, &size, 1); + xcf_write_int32_check_error (info, &lock_alpha, 1); } break; case PROP_APPLY_MASK: { - guint32 apply_mask; + guint32 apply_mask; - apply_mask = va_arg (args, guint32); - size = 4; + apply_mask = va_arg (args, guint32); + size = 4; xcf_write_prop_type_check_error (info, prop_type); - xcf_write_int32_check_error (info, &size, 1); - xcf_write_int32_check_error (info, &apply_mask, 1); + xcf_write_int32_check_error (info, &size, 1); + xcf_write_int32_check_error (info, &apply_mask, 1); } break; case PROP_EDIT_MASK: { - guint32 edit_mask; + guint32 edit_mask; - edit_mask = va_arg (args, guint32); - size = 4; + edit_mask = va_arg (args, guint32); + size = 4; xcf_write_prop_type_check_error (info, prop_type); - xcf_write_int32_check_error (info, &size, 1); - xcf_write_int32_check_error (info, &edit_mask, 1); + xcf_write_int32_check_error (info, &size, 1); + xcf_write_int32_check_error (info, &edit_mask, 1); } break; case PROP_SHOW_MASK: { - guint32 show_mask; + guint32 show_mask; - show_mask = va_arg (args, guint32); - size = 4; + show_mask = va_arg (args, guint32); + size = 4; xcf_write_prop_type_check_error (info, prop_type); - xcf_write_int32_check_error (info, &size, 1); - xcf_write_int32_check_error (info, &show_mask, 1); + xcf_write_int32_check_error (info, &size, 1); + xcf_write_int32_check_error (info, &show_mask, 1); } break; case PROP_SHOW_MASKED: { - guint32 show_masked; + guint32 show_masked; - show_masked = va_arg (args, guint32); - size = 4; + show_masked = va_arg (args, guint32); + size = 4; xcf_write_prop_type_check_error (info, prop_type); - xcf_write_int32_check_error (info, &size, 1); - xcf_write_int32_check_error (info, &show_masked, 1); + xcf_write_int32_check_error (info, &size, 1); + xcf_write_int32_check_error (info, &show_masked, 1); } break; case PROP_OFFSETS: { - gint32 offsets[2]; + gint32 offsets[2]; - offsets[0] = va_arg (args, gint32); - offsets[1] = va_arg (args, gint32); - size = 8; + offsets[0] = va_arg (args, gint32); + offsets[1] = va_arg (args, gint32); + size = 8; xcf_write_prop_type_check_error (info, prop_type); - xcf_write_int32_check_error (info, &size, 1); - xcf_write_int32_check_error (info, (guint32 *) offsets, 2); + xcf_write_int32_check_error (info, &size, 1); + xcf_write_int32_check_error (info, (guint32 *) offsets, 2); } break; case PROP_COLOR: { - guchar *color; + guchar *color; - color = va_arg (args, guchar*); - size = 3; + color = va_arg (args, guchar*); + size = 3; xcf_write_prop_type_check_error (info, prop_type); - xcf_write_int32_check_error (info, &size, 1); - xcf_write_int8_check_error (info, color, 3); + xcf_write_int32_check_error (info, &size, 1); + xcf_write_int8_check_error (info, color, 3); } break; case PROP_COMPRESSION: { - guint8 compression; + guint8 compression; - compression = (guint8) va_arg (args, guint32); - size = 1; + compression = (guint8) va_arg (args, guint32); + size = 1; xcf_write_prop_type_check_error (info, prop_type); - xcf_write_int32_check_error (info, &size, 1); - xcf_write_int8_check_error (info, &compression, 1); + xcf_write_int32_check_error (info, &size, 1); + xcf_write_int8_check_error (info, &compression, 1); } break; case PROP_GUIDES: { - GList *guides; - GimpGuide *guide; - gint32 position; - gint8 orientation; - gint nguides; + GList *guides; + GimpGuide *guide; + gint32 position; + gint8 orientation; + gint nguides; - guides = va_arg (args, GList *); - nguides = g_list_length (guides); + guides = va_arg (args, GList *); + nguides = g_list_length (guides); - size = nguides * (4 + 1); + size = nguides * (4 + 1); xcf_write_prop_type_check_error (info, prop_type); - xcf_write_int32_check_error (info, &size, 1); + xcf_write_int32_check_error (info, &size, 1); - for (; guides; guides = g_list_next (guides)) - { - guide = (GimpGuide *) guides->data; + for (; guides; guides = g_list_next (guides)) + { + guide = (GimpGuide *) guides->data; - position = guide->position; + position = guide->position; switch (guide->orientation) { @@ -863,98 +863,98 @@ xcf_save_prop (XcfInfo *info, continue; } - xcf_write_int32_check_error (info, (guint32 *) &position, 1); - xcf_write_int8_check_error (info, (guint8 *) &orientation, 1); - } + xcf_write_int32_check_error (info, (guint32 *) &position, 1); + xcf_write_int8_check_error (info, (guint8 *) &orientation, 1); + } } break; case PROP_RESOLUTION: { - gfloat xresolution, yresolution; + gfloat xresolution, yresolution; - /* we pass in floats, + /* we pass in floats, but they are promoted to double by the compiler */ - xresolution = va_arg (args, double); - yresolution = va_arg (args, double); + xresolution = va_arg (args, double); + yresolution = va_arg (args, double); - size = 4*2; + size = 4*2; xcf_write_prop_type_check_error (info, prop_type); - xcf_write_int32_check_error (info, &size, 1); + xcf_write_int32_check_error (info, &size, 1); - xcf_write_float_check_error (info, &xresolution, 1); - xcf_write_float_check_error (info, &yresolution, 1); + xcf_write_float_check_error (info, &xresolution, 1); + xcf_write_float_check_error (info, &yresolution, 1); } break; case PROP_TATTOO: { - guint32 tattoo; + guint32 tattoo; - tattoo = va_arg (args, guint32); - size = 4; + tattoo = va_arg (args, guint32); + size = 4; xcf_write_prop_type_check_error (info, prop_type); - xcf_write_int32_check_error (info, &size, 1); - xcf_write_int32_check_error (info, &tattoo, 1); + xcf_write_int32_check_error (info, &size, 1); + xcf_write_int32_check_error (info, &tattoo, 1); } break; case PROP_PARASITES: { - GimpParasiteList *list; - guint32 base, length; - long pos; + GimpParasiteList *list; + guint32 base, length; + long pos; - list = va_arg (args, GimpParasiteList *); + list = va_arg (args, GimpParasiteList *); - if (gimp_parasite_list_persistent_length (list) > 0) - { + if (gimp_parasite_list_persistent_length (list) > 0) + { xcf_write_prop_type_check_error (info, prop_type); - /* because we don't know how much room the parasite list will take - * we save the file position and write the length later - */ + /* because we don't know how much room the parasite list will take + * we save the file position and write the length later + */ pos = info->cp; - xcf_write_int32_check_error (info, &length, 1); - base = info->cp; + xcf_write_int32_check_error (info, &length, 1); + base = info->cp; xcf_check_error (xcf_save_parasite_list (info, list, error)); - length = info->cp - base; - /* go back to the saved position and write the length */ + length = info->cp - base; + /* go back to the saved position and write the length */ xcf_check_error (xcf_seek_pos (info, pos, error)); - xcf_write_int32 (info->fp, &length, 1, &tmp_error); - if (tmp_error) - { - g_propagate_error (error, tmp_error); - return FALSE; - } + xcf_write_int32 (info->fp, &length, 1, &tmp_error); + if (tmp_error) + { + g_propagate_error (error, tmp_error); + return FALSE; + } xcf_check_error (xcf_seek_end (info, error)); - } + } } break; case PROP_UNIT: { - guint32 unit; + guint32 unit; - unit = va_arg (args, guint32); + unit = va_arg (args, guint32); - size = 4; + size = 4; xcf_write_prop_type_check_error (info, prop_type); - xcf_write_int32_check_error (info, &size, 1); - xcf_write_int32_check_error (info, &unit, 1); + xcf_write_int32_check_error (info, &size, 1); + xcf_write_int32_check_error (info, &unit, 1); } break; case PROP_PATHS: { - guint32 base, length; - glong pos; + guint32 base, length; + glong pos; xcf_write_prop_type_check_error (info, prop_type); @@ -985,42 +985,42 @@ xcf_save_prop (XcfInfo *info, case PROP_USER_UNIT: { - GimpUnit unit; - const gchar *unit_strings[5]; - gfloat factor; - guint32 digits; + GimpUnit unit; + const gchar *unit_strings[5]; + gfloat factor; + guint32 digits; - unit = va_arg (args, guint32); + unit = va_arg (args, guint32); - /* write the entire unit definition */ - unit_strings[0] = _gimp_unit_get_identifier (image->gimp, unit); - factor = _gimp_unit_get_factor (image->gimp, unit); - digits = _gimp_unit_get_digits (image->gimp, unit); - unit_strings[1] = _gimp_unit_get_symbol (image->gimp, unit); - unit_strings[2] = _gimp_unit_get_abbreviation (image->gimp, unit); - unit_strings[3] = _gimp_unit_get_singular (image->gimp, unit); - unit_strings[4] = _gimp_unit_get_plural (image->gimp, unit); + /* write the entire unit definition */ + unit_strings[0] = _gimp_unit_get_identifier (image->gimp, unit); + factor = _gimp_unit_get_factor (image->gimp, unit); + digits = _gimp_unit_get_digits (image->gimp, unit); + unit_strings[1] = _gimp_unit_get_symbol (image->gimp, unit); + unit_strings[2] = _gimp_unit_get_abbreviation (image->gimp, unit); + unit_strings[3] = _gimp_unit_get_singular (image->gimp, unit); + unit_strings[4] = _gimp_unit_get_plural (image->gimp, unit); - size = - 2 * 4 + - strlen (unit_strings[0]) ? strlen (unit_strings[0]) + 5 : 4 + - strlen (unit_strings[1]) ? strlen (unit_strings[1]) + 5 : 4 + - strlen (unit_strings[2]) ? strlen (unit_strings[2]) + 5 : 4 + - strlen (unit_strings[3]) ? strlen (unit_strings[3]) + 5 : 4 + - strlen (unit_strings[4]) ? strlen (unit_strings[4]) + 5 : 4; + size = + 2 * 4 + + strlen (unit_strings[0]) ? strlen (unit_strings[0]) + 5 : 4 + + strlen (unit_strings[1]) ? strlen (unit_strings[1]) + 5 : 4 + + strlen (unit_strings[2]) ? strlen (unit_strings[2]) + 5 : 4 + + strlen (unit_strings[3]) ? strlen (unit_strings[3]) + 5 : 4 + + strlen (unit_strings[4]) ? strlen (unit_strings[4]) + 5 : 4; xcf_write_prop_type_check_error (info, prop_type); - xcf_write_int32_check_error (info, &size, 1); - xcf_write_float_check_error (info, &factor, 1); - xcf_write_int32_check_error (info, &digits, 1); - xcf_write_string_check_error (info, (gchar **) unit_strings, 5); + xcf_write_int32_check_error (info, &size, 1); + xcf_write_float_check_error (info, &factor, 1); + xcf_write_int32_check_error (info, &digits, 1); + xcf_write_string_check_error (info, (gchar **) unit_strings, 5); } break; case PROP_VECTORS: { - guint32 base, length; - glong pos; + guint32 base, length; + glong pos; xcf_write_prop_type_check_error (info, prop_type); @@ -1051,14 +1051,14 @@ xcf_save_prop (XcfInfo *info, case PROP_TEXT_LAYER_FLAGS: { - guint32 flags; + guint32 flags; - flags = va_arg (args, guint32); - size = 4; + flags = va_arg (args, guint32); + size = 4; xcf_write_prop_type_check_error (info, prop_type); - xcf_write_int32_check_error (info, &size, 1); - xcf_write_int32_check_error (info, &flags, 1); + xcf_write_int32_check_error (info, &size, 1); + xcf_write_int32_check_error (info, &flags, 1); } break; } @@ -1070,9 +1070,9 @@ xcf_save_prop (XcfInfo *info, static gboolean xcf_save_layer (XcfInfo *info, - GimpImage *image, - GimpLayer *layer, - GError **error) + GimpImage *image, + GimpLayer *layer, + GError **error) { guint32 saved_pos; guint32 offset; @@ -1141,9 +1141,9 @@ xcf_save_layer (XcfInfo *info, static gboolean xcf_save_channel (XcfInfo *info, - GimpImage *image, - GimpChannel *channel, - GError **error) + GimpImage *image, + GimpChannel *channel, + GError **error) { guint32 saved_pos; guint32 offset; @@ -1194,7 +1194,7 @@ xcf_save_channel (XcfInfo *info, static gint xcf_calc_levels (gint size, - gint tile_size) + gint tile_size) { int levels; @@ -1211,8 +1211,8 @@ xcf_calc_levels (gint size, static gboolean xcf_save_hierarchy (XcfInfo *info, - TileManager *tiles, - GError **error) + TileManager *tiles, + GError **error) { guint32 saved_pos; guint32 offset; @@ -1246,20 +1246,20 @@ xcf_save_hierarchy (XcfInfo *info, offset = info->cp; if (i == 0) - { - /* write out the level. */ - xcf_check_error (xcf_save_level (info, tiles, error)); - } + { + /* write out the level. */ + xcf_check_error (xcf_save_level (info, tiles, error)); + } else - { - /* fake an empty level */ - tmp1 = 0; - width /= 2; - height /= 2; - xcf_write_int32_check_error (info, (guint32 *) &width, 1); - xcf_write_int32_check_error (info, (guint32 *) &height, 1); - xcf_write_int32_check_error (info, (guint32 *) &tmp1, 1); - } + { + /* fake an empty level */ + tmp1 = 0; + width /= 2; + height /= 2; + xcf_write_int32_check_error (info, (guint32 *) &width, 1); + xcf_write_int32_check_error (info, (guint32 *) &height, 1); + xcf_write_int32_check_error (info, (guint32 *) &tmp1, 1); + } /* seek back to where we are to write out the next * level offset and write it out. @@ -1290,8 +1290,8 @@ xcf_save_hierarchy (XcfInfo *info, static gboolean xcf_save_level (XcfInfo *info, - TileManager *level, - GError **error) + TileManager *level, + GError **error) { guint32 saved_pos; guint32 offset; @@ -1322,46 +1322,46 @@ xcf_save_level (XcfInfo *info, xcf_check_error (xcf_seek_pos (info, info->cp + (ntiles + 1) * 4, error)); for (i = 0; i < ntiles; i++) - { - /* save the start offset of where we are writing - * out the next tile. - */ - offset = info->cp; + { + /* save the start offset of where we are writing + * out the next tile. + */ + offset = info->cp; - /* write out the tile. */ - switch (info->compression) - { - case COMPRESS_NONE: - xcf_check_error(xcf_save_tile (info, level->tiles[i], error)); - break; - case COMPRESS_RLE: - xcf_check_error (xcf_save_tile_rle (info, level->tiles[i], - rlebuf, error)); - break; - case COMPRESS_ZLIB: - g_error ("xcf: zlib compression unimplemented"); - break; - case COMPRESS_FRACTAL: - g_error ("xcf: fractal compression unimplemented"); - break; - } + /* write out the tile. */ + switch (info->compression) + { + case COMPRESS_NONE: + xcf_check_error(xcf_save_tile (info, level->tiles[i], error)); + break; + case COMPRESS_RLE: + xcf_check_error (xcf_save_tile_rle (info, level->tiles[i], + rlebuf, error)); + break; + case COMPRESS_ZLIB: + g_error ("xcf: zlib compression unimplemented"); + break; + case COMPRESS_FRACTAL: + g_error ("xcf: fractal compression unimplemented"); + break; + } - /* seek back to where we are to write out the next - * tile offset and write it out. - */ - xcf_check_error (xcf_seek_pos (info, saved_pos, error)); - xcf_write_int32_check_error (info, &offset, 1); + /* seek back to where we are to write out the next + * tile offset and write it out. + */ + xcf_check_error (xcf_seek_pos (info, saved_pos, error)); + xcf_write_int32_check_error (info, &offset, 1); - /* increment the location we are to write out the - * next offset. - */ - saved_pos = info->cp; + /* increment the location we are to write out the + * next offset. + */ + saved_pos = info->cp; - /* seek to the end of the file which is where - * we will write out the next tile. - */ - xcf_check_error (xcf_seek_end (info, error)); - } + /* seek to the end of the file which is where + * we will write out the next tile. + */ + xcf_check_error (xcf_seek_end (info, error)); + } } g_free (rlebuf); @@ -1379,14 +1379,14 @@ xcf_save_level (XcfInfo *info, static gboolean xcf_save_tile (XcfInfo *info, - Tile *tile, - GError **error) + Tile *tile, + GError **error) { GError *tmp_error = NULL; tile_lock (tile); xcf_write_int8_check_error (info, tile_data_pointer (tile, 0, 0), - tile_size (tile)); + tile_size (tile)); tile_release (tile, FALSE); return TRUE; @@ -1394,9 +1394,9 @@ xcf_save_tile (XcfInfo *info, static gboolean xcf_save_tile_rle (XcfInfo *info, - Tile *tile, - guchar *rlebuf, - GError **error) + Tile *tile, + guchar *rlebuf, + GError **error) { guchar *data, *t; unsigned int last; @@ -1425,82 +1425,82 @@ xcf_save_tile_rle (XcfInfo *info, last = -1; while (size > 0) - { - switch (state) - { - case 0: - /* in state 0 we try to find a long sequence of - * matching values. - */ - if ((length == 32768) || - ((size - length) <= 0) || - ((length > 1) && (last != *data))) - { - count += length; - if (length >= 128) - { - rlebuf[len++] = 127; + { + switch (state) + { + case 0: + /* in state 0 we try to find a long sequence of + * matching values. + */ + if ((length == 32768) || + ((size - length) <= 0) || + ((length > 1) && (last != *data))) + { + count += length; + if (length >= 128) + { + rlebuf[len++] = 127; rlebuf[len++] = (length >> 8); rlebuf[len++] = length & 0x00FF; - rlebuf[len++] = last; - } - else - { - rlebuf[len++] = length - 1; - rlebuf[len++] = last; - } - size -= length; - length = 0; - } - else if ((length == 1) && (last != *data)) - state = 1; - break; + rlebuf[len++] = last; + } + else + { + rlebuf[len++] = length - 1; + rlebuf[len++] = last; + } + size -= length; + length = 0; + } + else if ((length == 1) && (last != *data)) + state = 1; + break; - case 1: - /* in state 1 we try and find a long sequence of - * non-matching values. - */ - if ((length == 32768) || - ((size - length) == 0) || - ((length > 0) && (last == *data) && - ((size - length) == 1 || last == data[bpp]))) - { - count += length; - state = 0; + case 1: + /* in state 1 we try and find a long sequence of + * non-matching values. + */ + if ((length == 32768) || + ((size - length) == 0) || + ((length > 0) && (last == *data) && + ((size - length) == 1 || last == data[bpp]))) + { + count += length; + state = 0; - if (length >= 128) - { - rlebuf[len++] = 255 - 127; + if (length >= 128) + { + rlebuf[len++] = 255 - 127; rlebuf[len++] = (length >> 8); rlebuf[len++] = length & 0x00FF; - } - else - { - rlebuf[len++] = 255 - (length - 1); - } + } + else + { + rlebuf[len++] = 255 - (length - 1); + } - t = data - length * bpp; - for (j = 0; j < length; j++) - { - rlebuf[len++] = *t; - t += bpp; - } + t = data - length * bpp; + for (j = 0; j < length; j++) + { + rlebuf[len++] = *t; + t += bpp; + } - size -= length; - length = 0; - } - break; - } + size -= length; + length = 0; + } + break; + } - if (size > 0) { - length += 1; - last = *data; - data += bpp; - } - } + if (size > 0) { + length += 1; + last = *data; + data += bpp; + } + } if (count != (tile_ewidth (tile) * tile_eheight (tile))) - g_message ("xcf: uh oh! xcf rle tile saving error: %d", count); + g_message ("xcf: uh oh! xcf rle tile saving error: %d", count); } xcf_write_int8_check_error (info, rlebuf, len); tile_release (tile, FALSE); diff --git a/app/xcf/xcf-save.h b/app/xcf/xcf-save.h index d9e13f1d17..027eda78f0 100644 --- a/app/xcf/xcf-save.h +++ b/app/xcf/xcf-save.h @@ -21,9 +21,9 @@ void xcf_save_choose_format (XcfInfo *info, - GimpImage *image); + GimpImage *image); gint xcf_save_image (XcfInfo *info, - GimpImage *image); + GimpImage *image); #endif /* __XCF_SAVE_H__ */ diff --git a/app/xcf/xcf-seek.c b/app/xcf/xcf-seek.c index eee3f2d499..055ba426c8 100644 --- a/app/xcf/xcf-seek.c +++ b/app/xcf/xcf-seek.c @@ -32,8 +32,8 @@ gboolean xcf_seek_pos (XcfInfo *info, - guint pos, - GError **error) + guint pos, + GError **error) { if (info->cp != pos) { diff --git a/app/xcf/xcf-seek.h b/app/xcf/xcf-seek.h index 6963216854..16b75a5426 100644 --- a/app/xcf/xcf-seek.h +++ b/app/xcf/xcf-seek.h @@ -21,8 +21,8 @@ gboolean xcf_seek_pos (XcfInfo *info, - guint pos, - GError **error); + guint pos, + GError **error); gboolean xcf_seek_end (XcfInfo *info, GError **error); diff --git a/app/xcf/xcf-write.c b/app/xcf/xcf-write.c index e343b62794..610b064135 100644 --- a/app/xcf/xcf-write.c +++ b/app/xcf/xcf-write.c @@ -31,9 +31,9 @@ guint xcf_write_int32 (FILE *fp, - guint32 *data, - gint count, - GError **error) + guint32 *data, + gint count, + GError **error) { GError *tmp_error = NULL; guint32 tmp; @@ -59,18 +59,18 @@ xcf_write_int32 (FILE *fp, guint xcf_write_float (FILE *fp, - gfloat *data, - gint count, - GError **error) + gfloat *data, + gint count, + GError **error) { return xcf_write_int32 (fp, (guint32 *)((void *)data), count, error); } guint xcf_write_int8 (FILE *fp, - guint8 *data, - gint count, - GError **error) + guint8 *data, + gint count, + GError **error) { guint total; gint bytes; @@ -97,9 +97,9 @@ xcf_write_int8 (FILE *fp, guint xcf_write_string (FILE *fp, - gchar **data, - gint count, - GError **error) + gchar **data, + gint count, + GError **error) { GError *tmp_error = NULL; guint32 tmp; diff --git a/app/xcf/xcf-write.h b/app/xcf/xcf-write.h index b563e377a5..9c5d06a655 100644 --- a/app/xcf/xcf-write.h +++ b/app/xcf/xcf-write.h @@ -21,21 +21,21 @@ guint xcf_write_int32 (FILE *fp, - guint32 *data, - gint count, - GError **error); + guint32 *data, + gint count, + GError **error); guint xcf_write_float (FILE *fp, - gfloat *data, - gint count, - GError **error); + gfloat *data, + gint count, + GError **error); guint xcf_write_int8 (FILE *fp, - guint8 *data, - gint count, - GError **error); + guint8 *data, + gint count, + GError **error); guint xcf_write_string (FILE *fp, - gchar **data, - gint count, - GError **error); + gchar **data, + gint count, + GError **error); #endif /* __XCF_WRITE_H__ */ diff --git a/app/xcf/xcf.c b/app/xcf/xcf.c index ffb0acde99..0a46e267ff 100644 --- a/app/xcf/xcf.c +++ b/app/xcf/xcf.c @@ -310,44 +310,44 @@ xcf_load_invoker (GimpProcedure *procedure, info.cp += xcf_read_int8 (info.fp, (guint8*) id, 14); if (strncmp (id, "gimp xcf ", 9) != 0) - { - success = FALSE; - } + { + success = FALSE; + } else if (strcmp (id+9, "file") == 0) - { - info.file_version = 0; - } + { + info.file_version = 0; + } else if (id[9] == 'v') - { - info.file_version = atoi (id + 10); - } + { + info.file_version = atoi (id + 10); + } else - { - success = FALSE; - } + { + success = FALSE; + } if (success) - { - if (info.file_version < G_N_ELEMENTS (xcf_loaders)) - { - image = (*(xcf_loaders[info.file_version])) (gimp, &info); + { + if (info.file_version < G_N_ELEMENTS (xcf_loaders)) + { + image = (*(xcf_loaders[info.file_version])) (gimp, &info); - if (! image) - success = FALSE; - } - else - { - g_message (_("XCF error: unsupported XCF file version %d " - "encountered"), info.file_version); - success = FALSE; - } - } + if (! image) + success = FALSE; + } + else + { + g_message (_("XCF error: unsupported XCF file version %d " + "encountered"), info.file_version); + success = FALSE; + } + } fclose (info.fp); } else g_message (_("Could not open '%s' for reading: %s"), - gimp_filename_to_utf8 (filename), g_strerror (errno)); + gimp_filename_to_utf8 (filename), g_strerror (errno)); return_vals = gimp_procedure_get_return_values (procedure, success); @@ -404,7 +404,7 @@ xcf_save_invoker (GimpProcedure *procedure, } else g_message (_("Could not open '%s' for writing: %s"), - gimp_filename_to_utf8 (filename), g_strerror (errno)); + gimp_filename_to_utf8 (filename), g_strerror (errno)); return_vals = gimp_procedure_get_return_values (procedure, success);