From f2df31a50eb85c78c63b2b6195f2af3cd28c31e6 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Wed, 12 Apr 2006 10:53:28 +0000 Subject: [PATCH] converted tabs to spaces. 2006-04-12 Sven Neumann * libgimp*/gimp*.[ch]: converted tabs to spaces. --- ChangeLog | 4 + libgimp/gimpaspectpreview.c | 44 +- libgimp/gimpbrushmenu.c | 48 +- libgimp/gimpbrushselect.c | 22 +- libgimp/gimpchannel.c | 20 +- libgimp/gimpchannel.h | 10 +- libgimp/gimpdrawable.c | 40 +- libgimp/gimpdrawablecombobox.c | 4 +- libgimp/gimpdrawablepreview.c | 64 +-- libgimp/gimpdrawablepreview.h | 14 +- libgimp/gimpexport.c | 206 ++++---- libgimp/gimpfontselect.c | 22 +- libgimp/gimpgradientmenu.c | 20 +- libgimp/gimpgradientselect.c | 24 +- libgimp/gimpimage.c | 34 +- libgimp/gimpimage.h | 2 +- libgimp/gimpitemcombobox.c | 4 +- libgimp/gimplayer.c | 24 +- libgimp/gimpmenu.c | 176 +++---- libgimp/gimpmenu.h | 24 +- libgimp/gimppaletteselect.c | 22 +- libgimp/gimppatternmenu.c | 42 +- libgimp/gimppatternselect.c | 22 +- libgimp/gimppixelrgn.h | 90 ++-- libgimp/gimpproceduraldb.c | 66 +-- libgimp/gimpproceduraldb.h | 26 +- libgimp/gimpprogress.c | 22 +- libgimp/gimpselection.c | 10 +- libgimp/gimptile.c | 16 +- libgimp/gimptile.h | 2 +- libgimp/gimpui.c | 2 +- libgimp/gimpunitcache.c | 14 +- libgimpbase/gimpdatafiles.c | 74 +-- libgimpbase/gimpdatafiles.h | 8 +- libgimpbase/gimpenv.h | 10 +- libgimpbase/gimpparasite.c | 20 +- libgimpbase/gimpparasite.h | 2 +- libgimpbase/gimpparasiteio.c | 110 ++-- libgimpbase/gimpparasiteio.h | 2 +- libgimpbase/gimpprotocol.c | 652 ++++++++++++------------ libgimpbase/gimpprotocol.h | 18 +- libgimpbase/gimpsignal.c | 12 +- libgimpbase/gimpsignal.h | 4 +- libgimpbase/gimputils.c | 4 +- libgimpbase/gimpwin32-io.h | 6 +- libgimpbase/gimpwire.h | 8 +- libgimpcolor/gimpadaptivesupersample.c | 196 +++---- libgimpcolor/gimpbilinear.c | 24 +- libgimpcolor/gimpcolorspace.c | 232 ++++----- libgimpcolor/gimpcolorspace.h | 56 +- libgimpcolor/gimphsv.c | 14 +- libgimpcolor/gimphsv.h | 14 +- libgimpcolor/gimprgb.c | 104 ++-- libgimpcolor/gimprgb.h | 12 +- libgimpconfig/gimpconfig-deserialize.c | 34 +- libgimpconfig/gimpconfig-iface.c | 26 +- libgimpconfig/gimpconfig-iface.h | 2 +- libgimpconfig/gimpconfig-path.c | 30 +- libgimpconfig/gimpconfig-serialize.c | 12 +- libgimpconfig/gimpconfig-serialize.h | 8 +- libgimpconfig/gimpconfigwriter.c | 114 ++--- libgimpconfig/gimpconfigwriter.h | 6 +- libgimpconfig/gimpscanner.c | 6 +- libgimpmath/gimpmatrix.c | 4 +- libgimpmodule/gimpmodule.h | 2 +- libgimpthumb/gimpthumbnail.c | 42 +- libgimpwidgets/gimpbutton.h | 2 +- libgimpwidgets/gimpcellrenderercolor.c | 16 +- libgimpwidgets/gimpcellrenderertoggle.c | 36 +- libgimpwidgets/gimpchainbutton.c | 58 +-- libgimpwidgets/gimpchainbutton.h | 2 +- libgimpwidgets/gimpcolorarea.c | 32 +- libgimpwidgets/gimpcolorbutton.h | 14 +- libgimpwidgets/gimpcolornotebook.c | 2 +- libgimpwidgets/gimpcolorscale.c | 2 +- libgimpwidgets/gimpcolorscales.c | 34 +- libgimpwidgets/gimpcolorselection.c | 20 +- libgimpwidgets/gimpfileentry.c | 16 +- libgimpwidgets/gimphelpui.h | 8 +- libgimpwidgets/gimpintcombobox.c | 6 +- libgimpwidgets/gimpintstore.c | 4 +- libgimpwidgets/gimpmemsizeentry.c | 26 +- libgimpwidgets/gimpmemsizeentry.h | 6 +- libgimpwidgets/gimpoffsetarea.c | 54 +- libgimpwidgets/gimpoldwidgets.c | 152 +++--- libgimpwidgets/gimppageselector.c | 12 +- libgimpwidgets/gimppatheditor.c | 60 +-- libgimpwidgets/gimppickbutton.c | 12 +- libgimpwidgets/gimppixmap.c | 36 +- libgimpwidgets/gimppixmap.h | 2 +- libgimpwidgets/gimppropwidgets.c | 112 ++-- libgimpwidgets/gimpquerybox.c | 226 ++++---- libgimpwidgets/gimpquerybox.h | 128 ++--- libgimpwidgets/gimpresolutionentry.h | 10 +- libgimpwidgets/gimpscrolledpreview.c | 8 +- libgimpwidgets/gimpsizeentry.c | 412 +++++++-------- libgimpwidgets/gimpsizeentry.h | 68 +-- libgimpwidgets/gimpstock.c | 32 +- libgimpwidgets/gimpunitmenu.c | 284 +++++------ libgimpwidgets/gimpwidgets.c | 382 +++++++------- libgimpwidgets/gimpwidgets.h | 154 +++--- 101 files changed, 2720 insertions(+), 2716 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0f0647b617..8e92bda5df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-04-12 Sven Neumann + + * libgimp*/gimp*.[ch]: converted tabs to spaces. + 2006-04-12 Sven Neumann * tools/pdbgen/lib.pl: create code with spaces instead of tabs. diff --git a/libgimp/gimpaspectpreview.c b/libgimp/gimpaspectpreview.c index d0b39d248c..5791c92f5d 100644 --- a/libgimp/gimpaspectpreview.c +++ b/libgimp/gimpaspectpreview.c @@ -42,13 +42,13 @@ enum static void gimp_aspect_preview_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec); + guint property_id, + GValue *value, + GParamSpec *pspec); static void gimp_aspect_preview_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec); + guint property_id, + const GValue *value, + GParamSpec *pspec); static void gimp_aspect_preview_style_set (GtkWidget *widget, GtkStyle *prev_style); static void gimp_aspect_preview_draw (GimpPreview *preview); @@ -57,7 +57,7 @@ static void gimp_aspect_preview_draw_buffer (GimpPreview *preview, gint rowstride); static void gimp_aspect_preview_set_drawable (GimpAspectPreview *preview, - GimpDrawable *drawable); + GimpDrawable *drawable); G_DEFINE_TYPE (GimpAspectPreview, gimp_aspect_preview, GIMP_TYPE_PREVIEW); @@ -87,8 +87,8 @@ gimp_aspect_preview_class_init (GimpAspectPreviewClass *klass) */ g_object_class_install_property (object_class, PROP_DRAWABLE, g_param_spec_pointer ("drawable", NULL, NULL, - GIMP_PARAM_READWRITE | - G_PARAM_CONSTRUCT_ONLY)); + GIMP_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY)); } static void @@ -102,9 +102,9 @@ gimp_aspect_preview_init (GimpAspectPreview *preview) static void gimp_aspect_preview_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { GimpAspectPreview *preview = GIMP_ASPECT_PREVIEW (object); @@ -122,9 +122,9 @@ gimp_aspect_preview_get_property (GObject *object, static void gimp_aspect_preview_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { GimpAspectPreview *preview = GIMP_ASPECT_PREVIEW (object); @@ -132,7 +132,7 @@ gimp_aspect_preview_set_property (GObject *object, { case PROP_DRAWABLE: gimp_aspect_preview_set_drawable (preview, - g_value_get_pointer (value)); + g_value_get_pointer (value)); break; default: @@ -238,7 +238,7 @@ gimp_aspect_preview_draw_buffer (GimpPreview *preview, static void gimp_aspect_preview_set_drawable (GimpAspectPreview *preview, - GimpDrawable *drawable) + GimpDrawable *drawable) { gint width, height; gint max_width, max_height; @@ -259,12 +259,12 @@ gimp_aspect_preview_set_drawable (GimpAspectPreview *preview, max_width = (width * max_height) / height; } gimp_preview_set_bounds (GIMP_PREVIEW (preview), - 0, 0, max_width, max_height); + 0, 0, max_width, max_height); if (height > 0) g_object_set (GIMP_PREVIEW (preview)->frame, - "ratio", (gdouble) width / (gdouble) height, - NULL); + "ratio", (gdouble) width / (gdouble) height, + NULL); } static void @@ -295,8 +295,8 @@ gimp_aspect_preview_new (GimpDrawable *drawable, g_return_val_if_fail (drawable != NULL, NULL); preview = g_object_new (GIMP_TYPE_ASPECT_PREVIEW, - "drawable", drawable, - NULL); + "drawable", drawable, + NULL); if (toggle) { diff --git a/libgimp/gimpbrushmenu.c b/libgimp/gimpbrushmenu.c index 4dc1cc7de2..127b2de272 100644 --- a/libgimp/gimpbrushmenu.c +++ b/libgimp/gimpbrushmenu.c @@ -376,10 +376,10 @@ gimp_brush_select_widget_clicked (GtkWidget *widget, { /* calling gimp_brushes_set_popup() raises the dialog */ gimp_brushes_set_popup (brush_sel->temp_brush_callback, - brush_sel->brush_name, - brush_sel->opacity, - brush_sel->spacing, - brush_sel->paint_mode); + brush_sel->brush_name, + brush_sel->opacity, + brush_sel->spacing, + brush_sel->paint_mode); } else { @@ -433,30 +433,30 @@ gimp_brush_select_preview_events (GtkWidget *widget, if (brush_sel->mask_data) { switch (event->type) - { - case GDK_BUTTON_PRESS: - bevent = (GdkEventButton *) event; + { + case GDK_BUTTON_PRESS: + bevent = (GdkEventButton *) event; - if (bevent->button == 1) - { - gtk_grab_add (widget); - gimp_brush_select_popup_open (brush_sel, bevent->x, bevent->y); - } - break; + if (bevent->button == 1) + { + gtk_grab_add (widget); + gimp_brush_select_popup_open (brush_sel, bevent->x, bevent->y); + } + break; - case GDK_BUTTON_RELEASE: - bevent = (GdkEventButton *) event; + case GDK_BUTTON_RELEASE: + bevent = (GdkEventButton *) event; - if (bevent->button == 1) - { - gtk_grab_remove (widget); - gimp_brush_select_popup_close (brush_sel); - } - break; + if (bevent->button == 1) + { + gtk_grab_remove (widget); + gimp_brush_select_popup_close (brush_sel); + } + break; - default: - break; - } + default: + break; + } } return FALSE; diff --git a/libgimp/gimpbrushselect.c b/libgimp/gimpbrushselect.c index f2607f7ca7..b091309e78 100644 --- a/libgimp/gimpbrushselect.c +++ b/libgimp/gimpbrushselect.c @@ -86,17 +86,17 @@ gimp_brush_select_new (const gchar *title, gchar *brush_callback = gimp_procedural_db_temp_name (); gimp_install_temp_proc (brush_callback, - "Temporary brush popup callback procedure", - "", - "Andy Thomas", - "Andy Thomas", - "1997", - NULL, - "RGB*, GRAY*", - GIMP_TEMPORARY, - G_N_ELEMENTS (args), 0, - args, NULL, - gimp_temp_brush_run); + "Temporary brush popup callback procedure", + "", + "Andy Thomas", + "Andy Thomas", + "1997", + NULL, + "RGB*, GRAY*", + GIMP_TEMPORARY, + G_N_ELEMENTS (args), 0, + args, NULL, + gimp_temp_brush_run); if (gimp_brushes_popup (brush_callback, title, brush_name, opacity, spacing, paint_mode)) diff --git a/libgimp/gimpchannel.c b/libgimp/gimpchannel.c index 18bb914e8c..a4e0894700 100644 --- a/libgimp/gimpchannel.c +++ b/libgimp/gimpchannel.c @@ -47,16 +47,16 @@ */ gint32 gimp_channel_new (gint32 image_ID, - const gchar *name, - guint width, - guint height, - gdouble opacity, - const GimpRGB *color) + const gchar *name, + guint width, + guint height, + gdouble opacity, + const GimpRGB *color) { return _gimp_channel_new (image_ID, - width, - height, - name, - opacity, - color); + width, + height, + name, + opacity, + color); } diff --git a/libgimp/gimpchannel.h b/libgimp/gimpchannel.h index 5e1a2ef158..36071a5384 100644 --- a/libgimp/gimpchannel.h +++ b/libgimp/gimpchannel.h @@ -28,11 +28,11 @@ G_BEGIN_DECLS gint32 gimp_channel_new (gint32 image_ID, - const gchar *name, - guint width, - guint height, - gdouble opacity, - const GimpRGB *color); + const gchar *name, + guint width, + guint height, + gdouble opacity, + const GimpRGB *color); G_END_DECLS diff --git a/libgimp/gimpdrawable.c b/libgimp/gimpdrawable.c index da74a063d0..06a8e5422b 100644 --- a/libgimp/gimpdrawable.c +++ b/libgimp/gimpdrawable.c @@ -145,9 +145,9 @@ gimp_drawable_flush (GimpDrawable *drawable) GimpTile * gimp_drawable_get_tile (GimpDrawable *drawable, - gboolean shadow, - gint row, - gint col) + gboolean shadow, + gint row, + gint col) { GimpTile *tiles; guint right_tile; @@ -210,9 +210,9 @@ gimp_drawable_get_tile (GimpDrawable *drawable, GimpTile * gimp_drawable_get_tile2 (GimpDrawable *drawable, - gboolean shadow, - gint x, - gint y) + gboolean shadow, + gint x, + gint y) { gint row; gint col; @@ -264,9 +264,9 @@ gimp_drawable_get_color_uchar (gint32 drawable_ID, guchar * gimp_drawable_get_thumbnail_data (gint32 drawable_ID, - gint *width, - gint *height, - gint *bpp) + gint *width, + gint *height, + gint *bpp) { gint ret_width; gint ret_height; @@ -274,13 +274,13 @@ gimp_drawable_get_thumbnail_data (gint32 drawable_ID, gint data_size; _gimp_drawable_thumbnail (drawable_ID, - *width, - *height, - &ret_width, - &ret_height, - bpp, - &data_size, - &image_data); + *width, + *height, + &ret_width, + &ret_height, + bpp, + &data_size, + &image_data); *width = ret_width; *height = ret_height; @@ -338,10 +338,10 @@ gimp_drawable_get_sub_thumbnail_data (gint32 drawable_ID, */ gboolean gimp_drawable_attach_new_parasite (gint32 drawable_ID, - const gchar *name, - gint flags, - gint size, - gconstpointer data) + const gchar *name, + gint flags, + gint size, + gconstpointer data) { GimpParasite *parasite = gimp_parasite_new (name, flags, size, data); gboolean success; diff --git a/libgimp/gimpdrawablecombobox.c b/libgimp/gimpdrawablecombobox.c index ce33e7d992..ede60139f1 100644 --- a/libgimp/gimpdrawablecombobox.c +++ b/libgimp/gimpdrawablecombobox.c @@ -190,7 +190,7 @@ gimp_drawable_combo_box_new (GimpDrawableConstraintFunc constraint, G_DEFINE_TYPE(GimpChannelComboBox, gimp_channel_combo_box, - GIMP_TYPE_INT_COMBO_BOX); + GIMP_TYPE_INT_COMBO_BOX); static void gimp_channel_combo_box_class_init (GimpChannelComboBoxClass *klass) @@ -269,7 +269,7 @@ gimp_channel_combo_box_new (GimpDrawableConstraintFunc constraint, G_DEFINE_TYPE(GimpLayerComboBox, gimp_layer_combo_box, - GIMP_TYPE_INT_COMBO_BOX); + GIMP_TYPE_INT_COMBO_BOX); static void gimp_layer_combo_box_class_init (GimpLayerComboBoxClass *klass) diff --git a/libgimp/gimpdrawablepreview.c b/libgimp/gimpdrawablepreview.c index fd16b8e053..23268a46e6 100644 --- a/libgimp/gimpdrawablepreview.c +++ b/libgimp/gimpdrawablepreview.c @@ -48,17 +48,17 @@ typedef struct static GObject * gimp_drawable_preview_constructor (GType type, - guint n_params, - GObjectConstructParam *params); + guint n_params, + GObjectConstructParam *params); static void gimp_drawable_preview_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec); + guint property_id, + GValue *value, + GParamSpec *pspec); static void gimp_drawable_preview_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec); + guint property_id, + const GValue *value, + GParamSpec *pspec); static void gimp_drawable_preview_destroy (GtkObject *object); static void gimp_drawable_preview_style_set (GtkWidget *widget, @@ -74,7 +74,7 @@ static void gimp_drawable_preview_draw_buffer (GimpPreview *preview, gint rowstride); static void gimp_drawable_preview_set_drawable (GimpDrawablePreview *preview, - GimpDrawable *drawable); + GimpDrawable *drawable); G_DEFINE_TYPE (GimpDrawablePreview, gimp_drawable_preview, @@ -110,8 +110,8 @@ gimp_drawable_preview_class_init (GimpDrawablePreviewClass *klass) */ g_object_class_install_property (object_class, PROP_DRAWABLE, g_param_spec_pointer ("drawable", NULL, NULL, - GIMP_PARAM_READWRITE | - G_PARAM_CONSTRUCT_ONLY)); + GIMP_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY)); } static void @@ -125,8 +125,8 @@ gimp_drawable_preview_init (GimpDrawablePreview *preview) static GObject * gimp_drawable_preview_constructor (GType type, - guint n_params, - GObjectConstructParam *params) + guint n_params, + GObjectConstructParam *params) { GObject *object; PreviewSettings settings; @@ -145,9 +145,9 @@ gimp_drawable_preview_constructor (GType type, static void gimp_drawable_preview_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { GimpDrawablePreview *preview = GIMP_DRAWABLE_PREVIEW (object); @@ -155,7 +155,7 @@ gimp_drawable_preview_get_property (GObject *object, { case PROP_DRAWABLE: g_value_set_pointer (value, - gimp_drawable_preview_get_drawable (preview)); + gimp_drawable_preview_get_drawable (preview)); break; default: @@ -166,9 +166,9 @@ gimp_drawable_preview_get_property (GObject *object, static void gimp_drawable_preview_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { GimpDrawablePreview *preview = GIMP_DRAWABLE_PREVIEW (object); @@ -176,7 +176,7 @@ gimp_drawable_preview_set_property (GObject *object, { case PROP_DRAWABLE: gimp_drawable_preview_set_drawable (preview, - g_value_get_pointer (value)); + g_value_get_pointer (value)); break; default: @@ -277,9 +277,9 @@ gimp_drawable_preview_draw_thumb (GimpPreview *preview, void _gimp_drawable_preview_area_draw_thumb (GimpPreviewArea *area, - GimpDrawable *drawable, - gint width, - gint height) + GimpDrawable *drawable, + gint width, + gint height) { guchar *buffer; gint x1, y1, x2, y2; @@ -317,13 +317,13 @@ _gimp_drawable_preview_area_draw_thumb (GimpPreviewArea *area, buffer = gimp_drawable_get_sub_thumbnail_data (drawable->drawable_id, x1, y1, x2 - x1, y2 - y1, &nav_width, &nav_height, - &bpp); + &bpp); } else { buffer = gimp_drawable_get_thumbnail_data (drawable->drawable_id, &nav_width, &nav_height, - &bpp); + &bpp); } if (buffer) @@ -467,10 +467,10 @@ gimp_drawable_preview_set_drawable (GimpDrawablePreview *drawable_preview, gboolean _gimp_drawable_preview_get_bounds (GimpDrawable *drawable, - gint *xmin, - gint *ymin, - gint *xmax, - gint *ymax) + gint *xmin, + gint *ymin, + gint *xmax, + gint *ymax) { gint width; gint height; @@ -533,8 +533,8 @@ gimp_drawable_preview_new (GimpDrawable *drawable, g_return_val_if_fail (drawable != NULL, NULL); preview = g_object_new (GIMP_TYPE_DRAWABLE_PREVIEW, - "drawable", drawable, - NULL); + "drawable", drawable, + NULL); if (toggle) { diff --git a/libgimp/gimpdrawablepreview.h b/libgimp/gimpdrawablepreview.h index e4a777add0..b25a05a30b 100644 --- a/libgimp/gimpdrawablepreview.h +++ b/libgimp/gimpdrawablepreview.h @@ -70,14 +70,14 @@ void gimp_drawable_preview_draw_region (GimpDrawablePreview *preview, /* for internal use only */ void _gimp_drawable_preview_area_draw_thumb (GimpPreviewArea *area, - GimpDrawable *drawable, - gint width, - gint height) G_GNUC_INTERNAL; + GimpDrawable *drawable, + gint width, + gint height) G_GNUC_INTERNAL; gboolean _gimp_drawable_preview_get_bounds (GimpDrawable *drawable, - gint *xmin, - gint *ymin, - gint *xmax, - gint *ymax) G_GNUC_INTERNAL; + gint *xmin, + gint *ymin, + gint *xmax, + gint *ymax) G_GNUC_INTERNAL; G_END_DECLS diff --git a/libgimp/gimpexport.c b/libgimp/gimpexport.c index e671c4b227..379f2b60be 100644 --- a/libgimp/gimpexport.c +++ b/libgimp/gimpexport.c @@ -31,7 +31,7 @@ typedef void (* ExportFunc) (gint32 imageID, - gint32 *drawable_ID); + gint32 *drawable_ID); /* the export action structure */ @@ -49,7 +49,7 @@ typedef struct static void export_merge (gint32 image_ID, - gint32 *drawable_ID) + gint32 *drawable_ID) { gint32 nlayers; gint32 nvisible = 0; @@ -62,19 +62,19 @@ export_merge (gint32 image_ID, for (i = 0; i < nlayers; i++) { if (gimp_drawable_get_visible (layers[i])) - nvisible++; + nvisible++; } if (nvisible <= 1) { /* if there is only one (or zero) visible layer, add a new transparent - layer that has the same size as the canvas. The merge that follows - will ensure that the offset, opacity and size are correct */ + layer that has the same size as the canvas. The merge that follows + will ensure that the offset, opacity and size are correct */ transp = gimp_layer_new (image_ID, "-", - gimp_image_width (image_ID), - gimp_image_height (image_ID), - gimp_drawable_type (*drawable_ID) | 1, - 100.0, GIMP_NORMAL_MODE); + gimp_image_width (image_ID), + gimp_image_height (image_ID), + gimp_drawable_type (*drawable_ID) | 1, + 100.0, GIMP_NORMAL_MODE); gimp_image_add_layer (image_ID, transp, 1); gimp_selection_none (image_ID); gimp_edit_clear (transp); @@ -87,9 +87,9 @@ export_merge (gint32 image_ID, merged = gimp_image_merge_visible_layers (image_ID, GIMP_CLIP_TO_IMAGE); if (merged != -1) - *drawable_ID = merged; + *drawable_ID = merged; else - return; /* shouldn't happen */ + return; /* shouldn't happen */ layers = gimp_image_get_layers (image_ID, &nlayers); @@ -111,14 +111,14 @@ export_merge (gint32 image_ID, for (i = 0; i < nlayers; i++) { if (layers[i] != *drawable_ID) - gimp_image_remove_layer (image_ID, layers[i]); + gimp_image_remove_layer (image_ID, layers[i]); } g_free (layers); } static void export_flatten (gint32 image_ID, - gint32 *drawable_ID) + gint32 *drawable_ID) { gint32 flattened; @@ -149,21 +149,21 @@ export_apply_masks (gint32 image_ID, static void export_convert_rgb (gint32 image_ID, - gint32 *drawable_ID) + gint32 *drawable_ID) { gimp_image_convert_rgb (image_ID); } static void export_convert_grayscale (gint32 image_ID, - gint32 *drawable_ID) + gint32 *drawable_ID) { gimp_image_convert_grayscale (image_ID); } static void export_convert_indexed (gint32 image_ID, - gint32 *drawable_ID) + gint32 *drawable_ID) { gint32 nlayers; @@ -190,7 +190,7 @@ export_convert_bitmap (gint32 image_ID, static void export_add_alpha (gint32 image_ID, - gint32 *drawable_ID) + gint32 *drawable_ID) { gint32 nlayers; gint32 i; @@ -200,7 +200,7 @@ export_add_alpha (gint32 image_ID, for (i = 0; i < nlayers; i++) { if (!gimp_drawable_has_alpha (layers[i])) - gimp_layer_add_alpha (layers[i]); + gimp_layer_add_alpha (layers[i]); } g_free (layers); } @@ -324,7 +324,7 @@ static ExportAction export_action_convert_rgb_or_indexed = export_convert_indexed, N_("%s can only handle RGB or indexed images"), { N_("Convert to RGB"), N_("Convert to Indexed using default settings\n" - "(Do it manually to tune the result)")}, + "(Do it manually to tune the result)")}, 0 }; @@ -353,7 +353,7 @@ static ExportAction export_action_add_alpha = static void export_toggle_callback (GtkWidget *widget, - gpointer data) + gpointer data) { gint *choice = (gint *) data; @@ -365,7 +365,7 @@ export_toggle_callback (GtkWidget *widget, static GimpExportReturn confirm_save_dialog (const gchar *message, - const gchar *format_name) + const gchar *format_name) { GtkWidget *dialog; GtkWidget *hbox; @@ -380,13 +380,13 @@ confirm_save_dialog (const gchar *message, dialog = gimp_dialog_new (_("Confirm Save"), "gimp-export-image-confirm", NULL, 0, - gimp_standard_help_func, + gimp_standard_help_func, "gimp-export-confirm-dialog", - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - _("Confirm"), GTK_RESPONSE_OK, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + _("Confirm"), GTK_RESPONSE_OK, - NULL); + NULL); gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog), GTK_RESPONSE_OK, @@ -445,7 +445,7 @@ confirm_save_dialog (const gchar *message, static GimpExportReturn export_dialog (GSList *actions, - const gchar *format_name) + const gchar *format_name) { GtkWidget *dialog; GtkWidget *hbox; @@ -463,11 +463,11 @@ export_dialog (GSList *actions, NULL, 0, gimp_standard_help_func, "gimp-export-dialog", - _("_Ignore"), GTK_RESPONSE_NO, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - _("_Export"), GTK_RESPONSE_OK, + _("_Ignore"), GTK_RESPONSE_NO, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + _("_Export"), GTK_RESPONSE_OK, - NULL); + NULL); gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog), GTK_RESPONSE_NO, @@ -526,43 +526,43 @@ export_dialog (GSList *actions, gtk_container_add (GTK_CONTAINER (frame), vbox); if (action->possibilities[0] && action->possibilities[1]) - { + { GtkWidget *button; - GSList *radio_group = NULL; + GSList *radio_group = NULL; - button = gtk_radio_button_new_with_label (radio_group, - gettext (action->possibilities[0])); - gtk_label_set_justify (GTK_LABEL (GTK_BIN (button)->child), + button = gtk_radio_button_new_with_label (radio_group, + gettext (action->possibilities[0])); + gtk_label_set_justify (GTK_LABEL (GTK_BIN (button)->child), GTK_JUSTIFY_LEFT); - radio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)); - gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); - g_signal_connect (button, "toggled", + radio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + g_signal_connect (button, "toggled", G_CALLBACK (export_toggle_callback), &action->choice); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), (action->choice == 0)); - gtk_widget_show (button); + gtk_widget_show (button); - button = gtk_radio_button_new_with_label (radio_group, - gettext (action->possibilities[1])); - gtk_label_set_justify (GTK_LABEL (GTK_BIN (button)->child), + button = gtk_radio_button_new_with_label (radio_group, + gettext (action->possibilities[1])); + gtk_label_set_justify (GTK_LABEL (GTK_BIN (button)->child), GTK_JUSTIFY_LEFT); - radio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)); - gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), + radio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), (action->choice == 1)); - gtk_widget_show (button); - } + gtk_widget_show (button); + } else if (action->possibilities[0]) - { - label = gtk_label_new (gettext (action->possibilities[0])); + { + label = gtk_label_new (gettext (action->possibilities[0])); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0); gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); - gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); - gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); - gtk_widget_show (label); - action->choice = 0; - } + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); + gtk_widget_show (label); + action->choice = 0; + } gtk_widget_show (vbox); } @@ -630,9 +630,9 @@ export_dialog (GSList *actions, **/ GimpExportReturn gimp_export_image (gint32 *image_ID, - gint32 *drawable_ID, - const gchar *format_name, - GimpExportCapabilities capabilities) + gint32 *drawable_ID, + const gchar *format_name, + GimpExportCapabilities capabilities) { GSList *actions = NULL; GSList *list; @@ -685,7 +685,7 @@ gimp_export_image (gint32 *image_ID, /* cancel - the user can then select an appropriate layer to save */ if (retval == GIMP_EXPORT_CANCEL) - return GIMP_EXPORT_CANCEL; + return GIMP_EXPORT_CANCEL; } @@ -695,28 +695,28 @@ gimp_export_image (gint32 *image_ID, for (i = 0; i < n_layers; i++) { if (gimp_drawable_has_alpha (layers[i])) - { - if (! (capabilities & GIMP_EXPORT_CAN_HANDLE_ALPHA)) - { - actions = g_slist_prepend (actions, &export_action_flatten); - added_flatten = TRUE; + { + if (! (capabilities & GIMP_EXPORT_CAN_HANDLE_ALPHA)) + { + actions = g_slist_prepend (actions, &export_action_flatten); + added_flatten = TRUE; break; - } - } + } + } else - { + { /* If this is the last layer, it's visible and has no alpha * channel, then the image has a "flat" background */ - if (i == n_layers - 1 && gimp_drawable_get_visible (layers[i])) - background_has_alpha = FALSE; + if (i == n_layers - 1 && gimp_drawable_get_visible (layers[i])) + background_has_alpha = FALSE; - if (capabilities & GIMP_EXPORT_NEEDS_ALPHA) - { - actions = g_slist_prepend (actions, &export_action_add_alpha); - break; - } - } + if (capabilities & GIMP_EXPORT_NEEDS_ALPHA) + { + actions = g_slist_prepend (actions, &export_action_add_alpha); + break; + } + } } if (! added_flatten) @@ -798,40 +798,40 @@ gimp_export_image (gint32 *image_ID, { case GIMP_RGB: if (! (capabilities & GIMP_EXPORT_CAN_HANDLE_RGB)) - { - if ((capabilities & GIMP_EXPORT_CAN_HANDLE_INDEXED) && + { + if ((capabilities & GIMP_EXPORT_CAN_HANDLE_INDEXED) && (capabilities & GIMP_EXPORT_CAN_HANDLE_GRAY)) - actions = g_slist_prepend (actions, + actions = g_slist_prepend (actions, &export_action_convert_indexed_or_grayscale); - else if (capabilities & GIMP_EXPORT_CAN_HANDLE_INDEXED) - actions = g_slist_prepend (actions, + else if (capabilities & GIMP_EXPORT_CAN_HANDLE_INDEXED) + actions = g_slist_prepend (actions, &export_action_convert_indexed); - else if (capabilities & GIMP_EXPORT_CAN_HANDLE_GRAY) - actions = g_slist_prepend (actions, + else if (capabilities & GIMP_EXPORT_CAN_HANDLE_GRAY) + actions = g_slist_prepend (actions, &export_action_convert_grayscale); - else if (capabilities & GIMP_EXPORT_CAN_HANDLE_BITMAP) - actions = g_slist_prepend (actions, + else if (capabilities & GIMP_EXPORT_CAN_HANDLE_BITMAP) + actions = g_slist_prepend (actions, &export_action_convert_bitmap); - } + } break; case GIMP_GRAY: if (! (capabilities & GIMP_EXPORT_CAN_HANDLE_GRAY)) - { - if ((capabilities & GIMP_EXPORT_CAN_HANDLE_RGB) && + { + if ((capabilities & GIMP_EXPORT_CAN_HANDLE_RGB) && (capabilities & GIMP_EXPORT_CAN_HANDLE_INDEXED)) - actions = g_slist_prepend (actions, + actions = g_slist_prepend (actions, &export_action_convert_rgb_or_indexed); - else if (capabilities & GIMP_EXPORT_CAN_HANDLE_RGB) - actions = g_slist_prepend (actions, + else if (capabilities & GIMP_EXPORT_CAN_HANDLE_RGB) + actions = g_slist_prepend (actions, &export_action_convert_rgb); - else if (capabilities & GIMP_EXPORT_CAN_HANDLE_INDEXED) - actions = g_slist_prepend (actions, + else if (capabilities & GIMP_EXPORT_CAN_HANDLE_INDEXED) + actions = g_slist_prepend (actions, &export_action_convert_indexed); - else if (capabilities & GIMP_EXPORT_CAN_HANDLE_BITMAP) - actions = g_slist_prepend (actions, + else if (capabilities & GIMP_EXPORT_CAN_HANDLE_BITMAP) + actions = g_slist_prepend (actions, &export_action_convert_bitmap); - } + } break; case GIMP_INDEXED: @@ -847,7 +847,7 @@ gimp_export_image (gint32 *image_ID, else if (capabilities & GIMP_EXPORT_CAN_HANDLE_GRAY) actions = g_slist_prepend (actions, &export_action_convert_grayscale); - else if (capabilities & GIMP_EXPORT_CAN_HANDLE_BITMAP) + else if (capabilities & GIMP_EXPORT_CAN_HANDLE_BITMAP) { gint n_colors; @@ -879,14 +879,14 @@ gimp_export_image (gint32 *image_ID, gimp_image_undo_disable (*image_ID); for (list = actions; list; list = list->next) - { - action = (ExportAction *) list->data; + { + action = (ExportAction *) list->data; - if (action->choice == 0 && action->default_action) - action->default_action (*image_ID, drawable_ID); - else if (action->choice == 1 && action->alt_action) - action->alt_action (*image_ID, drawable_ID); - } + if (action->choice == 0 && action->default_action) + action->default_action (*image_ID, drawable_ID); + else if (action->choice == 1 && action->alt_action) + action->alt_action (*image_ID, drawable_ID); + } } g_slist_free (actions); diff --git a/libgimp/gimpfontselect.c b/libgimp/gimpfontselect.c index 2f7a079990..3b16d0e331 100644 --- a/libgimp/gimpfontselect.c +++ b/libgimp/gimpfontselect.c @@ -70,17 +70,17 @@ gimp_font_select_new (const gchar *title, gchar *font_callback = gimp_procedural_db_temp_name (); gimp_install_temp_proc (font_callback, - "Temporary font popup callback procedure", - "", - "Andy Thomas", - "Andy Thomas", - "1997", - NULL, - "RGB*, GRAY*", - GIMP_TEMPORARY, - G_N_ELEMENTS (args), 0, - args, NULL, - gimp_temp_font_run); + "Temporary font popup callback procedure", + "", + "Andy Thomas", + "Andy Thomas", + "1997", + NULL, + "RGB*, GRAY*", + GIMP_TEMPORARY, + G_N_ELEMENTS (args), 0, + args, NULL, + gimp_temp_font_run); if (gimp_fonts_popup (font_callback, title, font_name)) { diff --git a/libgimp/gimpgradientmenu.c b/libgimp/gimpgradientmenu.c index 6a9bf2309e..fcf8705bb4 100644 --- a/libgimp/gimpgradientmenu.c +++ b/libgimp/gimpgradientmenu.c @@ -234,12 +234,12 @@ gimp_gradient_select_widget_set (GtkWidget *widget, &n_samples, &samples)) { - gimp_gradient_select_widget_callback (name, + gimp_gradient_select_widget_callback (name, n_samples, samples, FALSE, gradient_sel); g_free (samples); - } + } g_free (name); } @@ -368,15 +368,15 @@ gimp_gradient_select_preview_expose (GtkWidget *widget, a = src[x * 4 + 3]; if ((x / GIMP_CHECK_SIZE_SM) & 1) - { - c0 = GIMP_CHECK_LIGHT; - c1 = GIMP_CHECK_DARK; - } + { + c0 = GIMP_CHECK_LIGHT; + c1 = GIMP_CHECK_DARK; + } else - { - c0 = GIMP_CHECK_DARK; - c1 = GIMP_CHECK_LIGHT; - } + { + c0 = GIMP_CHECK_DARK; + c1 = GIMP_CHECK_LIGHT; + } *p0++ = (c0 + (r - c0) * a) * 255.0; *p0++ = (c0 + (g - c0) * a) * 255.0; diff --git a/libgimp/gimpgradientselect.c b/libgimp/gimpgradientselect.c index 33fcf41ad0..98d5343e5d 100644 --- a/libgimp/gimpgradientselect.c +++ b/libgimp/gimpgradientselect.c @@ -75,17 +75,17 @@ gimp_gradient_select_new (const gchar *title, gchar *gradient_callback = gimp_procedural_db_temp_name (); gimp_install_temp_proc (gradient_callback, - "Temporary gradient popup callback procedure", - "", - "Andy Thomas", - "Andy Thomas", - "1997", - NULL, - "RGB*, GRAY*", - GIMP_TEMPORARY, - G_N_ELEMENTS (args), 0, - args, NULL, - gimp_temp_gradient_run); + "Temporary gradient popup callback procedure", + "", + "Andy Thomas", + "Andy Thomas", + "1997", + NULL, + "RGB*, GRAY*", + GIMP_TEMPORARY, + G_N_ELEMENTS (args), 0, + args, NULL, + gimp_temp_gradient_run); if (gimp_gradients_popup (gradient_callback, title, gradient_name, sample_size)) @@ -97,7 +97,7 @@ gimp_gradient_select_new (const gchar *title, /* Now add to hash table so we can find it again */ if (! gimp_gradient_select_ht) gimp_gradient_select_ht = g_hash_table_new_full (g_str_hash, - g_str_equal, + g_str_equal, g_free, g_free); gradient_data = g_new0 (GimpGradientData, 1); diff --git a/libgimp/gimpimage.c b/libgimp/gimpimage.c index 4922788d44..93a5ca5eb1 100644 --- a/libgimp/gimpimage.c +++ b/libgimp/gimpimage.c @@ -35,7 +35,7 @@ */ guchar * gimp_image_get_cmap (gint32 image_ID, - gint *num_colors) + gint *num_colors) { return gimp_image_get_colormap (image_ID, num_colors); } @@ -52,8 +52,8 @@ gimp_image_get_cmap (gint32 image_ID, */ gboolean gimp_image_set_cmap (gint32 image_ID, - const guchar *cmap, - gint num_colors) + const guchar *cmap, + gint num_colors) { return gimp_image_set_colormap (image_ID, cmap, num_colors); } @@ -110,9 +110,9 @@ gimp_image_set_colormap (gint32 image_ID, guchar * gimp_image_get_thumbnail_data (gint32 image_ID, - gint *width, - gint *height, - gint *bpp) + gint *width, + gint *height, + gint *bpp) { gint ret_width; gint ret_height; @@ -120,13 +120,13 @@ gimp_image_get_thumbnail_data (gint32 image_ID, gint data_size; _gimp_image_thumbnail (image_ID, - *width, - *height, - &ret_width, - &ret_height, - bpp, - &data_size, - &image_data); + *width, + *height, + &ret_width, + &ret_height, + bpp, + &data_size, + &image_data); *width = ret_width; *height = ret_height; @@ -152,10 +152,10 @@ gimp_image_get_thumbnail_data (gint32 image_ID, */ gboolean gimp_image_attach_new_parasite (gint32 image_ID, - const gchar *name, - gint flags, - gint size, - gconstpointer data) + const gchar *name, + gint flags, + gint size, + gconstpointer data) { GimpParasite *parasite = gimp_parasite_new (name, flags, size, data); gboolean success; diff --git a/libgimp/gimpimage.h b/libgimp/gimpimage.h index 3c10d6d11f..5ea5671ac5 100644 --- a/libgimp/gimpimage.h +++ b/libgimp/gimpimage.h @@ -32,7 +32,7 @@ guchar * gimp_image_get_cmap (gint32 image_ID, gint *num_colors); gboolean gimp_image_set_cmap (gint32 image_ID, const guchar *cmap, - gint num_colors); + gint num_colors); #endif /* GIMP_DISABLE_DEPRECATED */ guchar * gimp_image_get_colormap (gint32 image_ID, diff --git a/libgimp/gimpitemcombobox.c b/libgimp/gimpitemcombobox.c index ce33e7d992..ede60139f1 100644 --- a/libgimp/gimpitemcombobox.c +++ b/libgimp/gimpitemcombobox.c @@ -190,7 +190,7 @@ gimp_drawable_combo_box_new (GimpDrawableConstraintFunc constraint, G_DEFINE_TYPE(GimpChannelComboBox, gimp_channel_combo_box, - GIMP_TYPE_INT_COMBO_BOX); + GIMP_TYPE_INT_COMBO_BOX); static void gimp_channel_combo_box_class_init (GimpChannelComboBoxClass *klass) @@ -269,7 +269,7 @@ gimp_channel_combo_box_new (GimpDrawableConstraintFunc constraint, G_DEFINE_TYPE(GimpLayerComboBox, gimp_layer_combo_box, - GIMP_TYPE_INT_COMBO_BOX); + GIMP_TYPE_INT_COMBO_BOX); static void gimp_layer_combo_box_class_init (GimpLayerComboBoxClass *klass) diff --git a/libgimp/gimplayer.c b/libgimp/gimplayer.c index 45d58d69f4..766fc4d5ca 100644 --- a/libgimp/gimplayer.c +++ b/libgimp/gimplayer.c @@ -47,20 +47,20 @@ */ gint32 gimp_layer_new (gint32 image_ID, - const gchar *name, - gint width, - gint height, - GimpImageType type, - gdouble opacity, - GimpLayerModeEffects mode) + const gchar *name, + gint width, + gint height, + GimpImageType type, + gdouble opacity, + GimpLayerModeEffects mode) { return _gimp_layer_new (image_ID, - width, - height, - type, - name, - opacity, - mode); + width, + height, + type, + name, + opacity, + mode); } /** diff --git a/libgimp/gimpmenu.c b/libgimp/gimpmenu.c index ba68694319..e31e5de170 100644 --- a/libgimp/gimpmenu.c +++ b/libgimp/gimpmenu.c @@ -69,9 +69,9 @@ static void gimp_menu_callback (GtkWidget *widget, */ GtkWidget * gimp_image_menu_new (GimpConstraintFunc constraint, - GimpMenuCallback callback, - gpointer data, - gint32 active_image) + GimpMenuCallback callback, + gpointer data, + gint32 active_image) { GtkWidget *menu; gchar *name; @@ -90,15 +90,15 @@ gimp_image_menu_new (GimpConstraintFunc constraint, for (i = 0, k = 0; i < n_images; i++) if (! constraint || (* constraint) (images[i], -1, data)) { - name = gimp_image_get_name (images[i]); - label = g_strdup_printf ("%s-%d", name, images[i]); - g_free (name); + name = gimp_image_get_name (images[i]); + label = g_strdup_printf ("%s-%d", name, images[i]); + g_free (name); - gimp_menu_add_item (menu, label, NULL, images[i]); + gimp_menu_add_item (menu, label, NULL, images[i]); g_free (label); - if (images[i] == active_image) + if (images[i] == active_image) { image = active_image; gtk_menu_set_active (GTK_MENU (menu), k); @@ -108,7 +108,7 @@ gimp_image_menu_new (GimpConstraintFunc constraint, image = images[i]; } - k += 1; + k += 1; } if (k == 0) @@ -134,9 +134,9 @@ gimp_image_menu_new (GimpConstraintFunc constraint, */ GtkWidget * gimp_layer_menu_new (GimpConstraintFunc constraint, - GimpMenuCallback callback, - gpointer data, - gint32 active_layer) + GimpMenuCallback callback, + gpointer data, + gint32 active_layer) { GtkWidget *menu; gchar *image_label; @@ -158,33 +158,33 @@ gimp_layer_menu_new (GimpConstraintFunc constraint, { gchar *name; - name = gimp_image_get_name (images[i]); - image_label = g_strdup_printf ("%s-%d", name, images[i]); - g_free (name); + name = gimp_image_get_name (images[i]); + image_label = g_strdup_printf ("%s-%d", name, images[i]); + g_free (name); - layers = gimp_image_get_layers (images[i], &n_layers); + layers = gimp_image_get_layers (images[i], &n_layers); - for (j = 0; j < n_layers; j++) - if (! constraint || (* constraint) (images[i], layers[j], data)) - { - name = gimp_drawable_get_name (layers[j]); + for (j = 0; j < n_layers; j++) + if (! constraint || (* constraint) (images[i], layers[j], data)) + { + name = gimp_drawable_get_name (layers[j]); gimp_menu_add_item (menu, image_label, name, layers[j]); - g_free (name); + g_free (name); - if (layers[j] == active_layer) - { - layer = active_layer; - gtk_menu_set_active (GTK_MENU (menu), k); - } - else if (layer == -1) + if (layers[j] == active_layer) + { + layer = active_layer; + gtk_menu_set_active (GTK_MENU (menu), k); + } + else if (layer == -1) { layer = layers[j]; } - k += 1; - } + k += 1; + } - g_free (image_label); + g_free (image_label); g_free (layers); } @@ -211,9 +211,9 @@ gimp_layer_menu_new (GimpConstraintFunc constraint, */ GtkWidget * gimp_channel_menu_new (GimpConstraintFunc constraint, - GimpMenuCallback callback, - gpointer data, - gint32 active_channel) + GimpMenuCallback callback, + gpointer data, + gint32 active_channel) { GtkWidget *menu; gchar *image_label; @@ -237,33 +237,33 @@ gimp_channel_menu_new (GimpConstraintFunc constraint, { gchar *name; - name = gimp_image_get_name (images[i]); - image_label = g_strdup_printf ("%s-%d", name, images[i]); - g_free (name); + name = gimp_image_get_name (images[i]); + image_label = g_strdup_printf ("%s-%d", name, images[i]); + g_free (name); - channels = gimp_image_get_channels (images[i], &n_channels); + channels = gimp_image_get_channels (images[i], &n_channels); - for (j = 0; j < n_channels; j++) - if (! constraint || (* constraint) (images[i], channels[j], data)) - { - name = gimp_drawable_get_name (channels[j]); + for (j = 0; j < n_channels; j++) + if (! constraint || (* constraint) (images[i], channels[j], data)) + { + name = gimp_drawable_get_name (channels[j]); gimp_menu_add_item (menu, image_label, name, channels[j]); - g_free (name); + g_free (name); - if (channels[j] == active_channel) - { - channel = active_channel; - gtk_menu_set_active (GTK_MENU (menu), k); - } - else if (channel == -1) + if (channels[j] == active_channel) + { + channel = active_channel; + gtk_menu_set_active (GTK_MENU (menu), k); + } + else if (channel == -1) { channel = channels[j]; } - k += 1; - } + k += 1; + } - g_free (image_label); + g_free (image_label); g_free (channels); } @@ -290,9 +290,9 @@ gimp_channel_menu_new (GimpConstraintFunc constraint, */ GtkWidget * gimp_drawable_menu_new (GimpConstraintFunc constraint, - GimpMenuCallback callback, - gpointer data, - gint32 active_drawable) + GimpMenuCallback callback, + gpointer data, + gint32 active_drawable) { GtkWidget *menu; gchar *name; @@ -315,54 +315,54 @@ gimp_drawable_menu_new (GimpConstraintFunc constraint, for (i = 0, k = 0; i < n_images; i++) if (! constraint || (* constraint) (images[i], -1, data)) { - name = gimp_image_get_name (images[i]); - image_label = g_strdup_printf ("%s-%d", name, images[i]); - g_free (name); + name = gimp_image_get_name (images[i]); + image_label = g_strdup_printf ("%s-%d", name, images[i]); + g_free (name); - layers = gimp_image_get_layers (images[i], &n_layers); - channels = gimp_image_get_channels (images[i], &n_channels); + layers = gimp_image_get_layers (images[i], &n_layers); + channels = gimp_image_get_channels (images[i], &n_channels); - for (j = 0; j < n_layers; j++) - if (! constraint || (* constraint) (images[i], layers[j], data)) - { - name = gimp_drawable_get_name (layers[j]); + for (j = 0; j < n_layers; j++) + if (! constraint || (* constraint) (images[i], layers[j], data)) + { + name = gimp_drawable_get_name (layers[j]); gimp_menu_add_item (menu, image_label, name, layers[j]); - g_free (name); + g_free (name); - if (layers[j] == active_drawable) - { - drawable = active_drawable; - gtk_menu_set_active (GTK_MENU (menu), k); - } - else if (drawable == -1) + if (layers[j] == active_drawable) + { + drawable = active_drawable; + gtk_menu_set_active (GTK_MENU (menu), k); + } + else if (drawable == -1) { drawable = layers[j]; } - k += 1; - } + k += 1; + } - for (j = 0; j < n_channels; j++) - if (! constraint || (* constraint) (images[i], channels[j], data)) - { - name = gimp_drawable_get_name (channels[j]); + for (j = 0; j < n_channels; j++) + if (! constraint || (* constraint) (images[i], channels[j], data)) + { + name = gimp_drawable_get_name (channels[j]); gimp_menu_add_item (menu, image_label, name, channels[j]); - g_free (name); + g_free (name); - if (channels[j] == active_drawable) - { - drawable = active_drawable; - gtk_menu_set_active (GTK_MENU (menu), k); - } - else if (drawable == -1) + if (channels[j] == active_drawable) + { + drawable = active_drawable; + gtk_menu_set_active (GTK_MENU (menu), k); + } + else if (drawable == -1) { drawable = channels[j]; } - k += 1; - } + k += 1; + } - g_free (image_label); + g_free (image_label); g_free (layers); g_free (channels); } @@ -382,7 +382,7 @@ gimp_drawable_menu_new (GimpConstraintFunc constraint, static GtkWidget * gimp_menu_make_menu (GimpMenuCallback callback, - gpointer data) + gpointer data) { GtkWidget *menu; @@ -482,7 +482,7 @@ gimp_menu_make_preview (gint32 any_ID, static void gimp_menu_callback (GtkWidget *widget, - gpointer any_ID) + gpointer any_ID) { GimpMenuCallback callback; gpointer callback_data; diff --git a/libgimp/gimpmenu.h b/libgimp/gimpmenu.h index 4013a41198..5a1171ab2c 100644 --- a/libgimp/gimpmenu.h +++ b/libgimp/gimpmenu.h @@ -40,21 +40,21 @@ typedef void (* GimpMenuCallback) (gint32 any_id, GtkWidget * gimp_image_menu_new (GimpConstraintFunc constraint, - GimpMenuCallback callback, - gpointer data, - gint32 active_image); + GimpMenuCallback callback, + gpointer data, + gint32 active_image); GtkWidget * gimp_layer_menu_new (GimpConstraintFunc constraint, - GimpMenuCallback callback, - gpointer data, - gint32 active_layer); + GimpMenuCallback callback, + gpointer data, + gint32 active_layer); GtkWidget * gimp_channel_menu_new (GimpConstraintFunc constraint, - GimpMenuCallback callback, - gpointer data, - gint32 active_channel); + GimpMenuCallback callback, + gpointer data, + gint32 active_channel); GtkWidget * gimp_drawable_menu_new (GimpConstraintFunc constraint, - GimpMenuCallback callback, - gpointer data, - gint32 active_drawable); + GimpMenuCallback callback, + gpointer data, + gint32 active_drawable); G_END_DECLS diff --git a/libgimp/gimppaletteselect.c b/libgimp/gimppaletteselect.c index 4ed54dce8d..8a383a4fe8 100644 --- a/libgimp/gimppaletteselect.c +++ b/libgimp/gimppaletteselect.c @@ -70,17 +70,17 @@ gimp_palette_select_new (const gchar *title, gchar *palette_callback = gimp_procedural_db_temp_name (); gimp_install_temp_proc (palette_callback, - "Temporary palette popup callback procedure", - "", - "Michael Natterer", - "Michael Natterer", - "2004", - NULL, - "RGB*, GRAY*", - GIMP_TEMPORARY, - G_N_ELEMENTS (args), 0, - args, NULL, - gimp_temp_palette_run); + "Temporary palette popup callback procedure", + "", + "Michael Natterer", + "Michael Natterer", + "2004", + NULL, + "RGB*, GRAY*", + GIMP_TEMPORARY, + G_N_ELEMENTS (args), 0, + args, NULL, + gimp_temp_palette_run); if (gimp_palettes_popup (palette_callback, title, palette_name)) { diff --git a/libgimp/gimppatternmenu.c b/libgimp/gimppatternmenu.c index 7721e8b3b7..5e47221637 100644 --- a/libgimp/gimppatternmenu.c +++ b/libgimp/gimppatternmenu.c @@ -319,7 +319,7 @@ gimp_pattern_select_widget_clicked (GtkWidget *widget, else { pattern_sel->temp_pattern_callback = - gimp_pattern_select_new (pattern_sel->title, + gimp_pattern_select_new (pattern_sel->title, pattern_sel->pattern_name, gimp_pattern_select_widget_callback, pattern_sel); @@ -364,31 +364,31 @@ gimp_pattern_select_preview_events (GtkWidget *widget, if (pattern_sel->mask_data) { switch (event->type) - { - case GDK_BUTTON_PRESS: - bevent = (GdkEventButton *) event; + { + case GDK_BUTTON_PRESS: + bevent = (GdkEventButton *) event; - if (bevent->button == 1) - { - gtk_grab_add (widget); - gimp_pattern_select_popup_open (pattern_sel, + if (bevent->button == 1) + { + gtk_grab_add (widget); + gimp_pattern_select_popup_open (pattern_sel, bevent->x, bevent->y); - } - break; + } + break; - case GDK_BUTTON_RELEASE: - bevent = (GdkEventButton *) event; + case GDK_BUTTON_RELEASE: + bevent = (GdkEventButton *) event; - if (bevent->button == 1) - { - gtk_grab_remove (widget); - gimp_pattern_select_popup_close (pattern_sel); - } - break; + if (bevent->button == 1) + { + gtk_grab_remove (widget); + gimp_pattern_select_popup_close (pattern_sel); + } + break; - default: - break; - } + default: + break; + } } return FALSE; diff --git a/libgimp/gimppatternselect.c b/libgimp/gimppatternselect.c index 001fc51a4d..d1d191271b 100644 --- a/libgimp/gimppatternselect.c +++ b/libgimp/gimppatternselect.c @@ -79,17 +79,17 @@ gimp_pattern_select_new (const gchar *title, gchar *pattern_callback = gimp_procedural_db_temp_name (); gimp_install_temp_proc (pattern_callback, - "Temporary pattern popup callback procedure", - "", - "Andy Thomas", - "Andy Thomas", - "1997", - NULL, - "RGB*, GRAY*", - GIMP_TEMPORARY, - G_N_ELEMENTS (args), 0, - args, NULL, - gimp_temp_pattern_run); + "Temporary pattern popup callback procedure", + "", + "Andy Thomas", + "Andy Thomas", + "1997", + NULL, + "RGB*, GRAY*", + GIMP_TEMPORARY, + G_N_ELEMENTS (args), 0, + args, NULL, + gimp_temp_pattern_run); if (gimp_patterns_popup (pattern_callback, title, pattern_name)) { diff --git a/libgimp/gimppixelrgn.h b/libgimp/gimppixelrgn.h index 12c98d680f..84a8e51e23 100644 --- a/libgimp/gimppixelrgn.h +++ b/libgimp/gimppixelrgn.h @@ -42,62 +42,62 @@ struct _GimpPixelRgn void gimp_pixel_rgn_init (GimpPixelRgn *pr, - GimpDrawable *drawable, - gint x, - gint y, - gint width, - gint height, - gint dirty, - gint shadow); + GimpDrawable *drawable, + gint x, + gint y, + gint width, + gint height, + gint dirty, + gint shadow); void gimp_pixel_rgn_resize (GimpPixelRgn *pr, - gint x, - gint y, - gint width, - gint height); + gint x, + gint y, + gint width, + gint height); void gimp_pixel_rgn_get_pixel (GimpPixelRgn *pr, - guchar *buf, - gint x, - gint y); + guchar *buf, + gint x, + gint y); void gimp_pixel_rgn_get_row (GimpPixelRgn *pr, - guchar *buf, - gint x, - gint y, - gint width); + guchar *buf, + gint x, + gint y, + gint width); void gimp_pixel_rgn_get_col (GimpPixelRgn *pr, - guchar *buf, - gint x, - gint y, - gint height); + guchar *buf, + gint x, + gint y, + gint height); void gimp_pixel_rgn_get_rect (GimpPixelRgn *pr, - guchar *buf, - gint x, - gint y, - gint width, - gint height); + guchar *buf, + gint x, + gint y, + gint width, + gint height); void gimp_pixel_rgn_set_pixel (GimpPixelRgn *pr, - const guchar *buf, - gint x, - gint y); + const guchar *buf, + gint x, + gint y); void gimp_pixel_rgn_set_row (GimpPixelRgn *pr, - const guchar *buf, - gint x, - gint y, - gint width); + const guchar *buf, + gint x, + gint y, + gint width); void gimp_pixel_rgn_set_col (GimpPixelRgn *pr, - const guchar *buf, - gint x, - gint y, - gint height); + const guchar *buf, + gint x, + gint y, + gint height); void gimp_pixel_rgn_set_rect (GimpPixelRgn *pr, - const guchar *buf, - gint x, - gint y, - gint width, - gint height); + const guchar *buf, + gint x, + gint y, + gint width, + gint height); gpointer gimp_pixel_rgns_register (gint nrgns, - ...); + ...); gpointer gimp_pixel_rgns_register2 (gint nrgns, - GimpPixelRgn **prs); + GimpPixelRgn **prs); gpointer gimp_pixel_rgns_process (gpointer pri_ptr); diff --git a/libgimp/gimpproceduraldb.c b/libgimp/gimpproceduraldb.c index 53d00ba23e..12426210a8 100644 --- a/libgimp/gimpproceduraldb.c +++ b/libgimp/gimpproceduraldb.c @@ -52,29 +52,29 @@ */ gboolean gimp_procedural_db_proc_info (const gchar *procedure, - gchar **blurb, - gchar **help, - gchar **author, - gchar **copyright, - gchar **date, - GimpPDBProcType *proc_type, - gint *num_args, - gint *num_values, - GimpParamDef **args, - GimpParamDef **return_vals) + gchar **blurb, + gchar **help, + gchar **author, + gchar **copyright, + gchar **date, + GimpPDBProcType *proc_type, + gint *num_args, + gint *num_values, + GimpParamDef **args, + GimpParamDef **return_vals) { gint i; gboolean success = TRUE; success = _gimp_procedural_db_proc_info (procedure, - blurb, - help, - author, - copyright, - date, - proc_type, - num_args, - num_values); + blurb, + help, + author, + copyright, + date, + proc_type, + num_args, + num_values); if (success) { @@ -84,10 +84,10 @@ gimp_procedural_db_proc_info (const gchar *procedure, for (i = 0; i < *num_args; i++) { if (! gimp_procedural_db_proc_arg (procedure, - i, - &(*args)[i].type, - &(*args)[i].name, - &(*args)[i].description)) + i, + &(*args)[i].type, + &(*args)[i].name, + &(*args)[i].description)) { g_free (*args); g_free (*return_vals); @@ -99,10 +99,10 @@ gimp_procedural_db_proc_info (const gchar *procedure, for (i = 0; i < *num_values; i++) { if (! gimp_procedural_db_proc_val (procedure, - i, - &(*return_vals)[i].type, - &(*return_vals)[i].name, - &(*return_vals)[i].description)) + i, + &(*return_vals)[i].type, + &(*return_vals)[i].name, + &(*return_vals)[i].description)) { g_free (*args); g_free (*return_vals); @@ -131,15 +131,15 @@ gimp_procedural_db_proc_info (const gchar *procedure, */ gboolean gimp_procedural_db_get_data (const gchar *identifier, - gpointer data) + gpointer data) { gint size; guint8 *hack; gboolean success; success = _gimp_procedural_db_get_data (identifier, - &size, - &hack); + &size, + &hack); if (hack) { memcpy (data, (gpointer) hack, size * sizeof (guint8)); @@ -165,10 +165,10 @@ gimp_procedural_db_get_data (const gchar *identifier, */ gboolean gimp_procedural_db_set_data (const gchar *identifier, - gpointer data, - guint32 bytes) + gpointer data, + guint32 bytes) { return _gimp_procedural_db_set_data (identifier, - bytes, - data); + bytes, + data); } diff --git a/libgimp/gimpproceduraldb.h b/libgimp/gimpproceduraldb.h index 9ad4c8746e..075335a485 100644 --- a/libgimp/gimpproceduraldb.h +++ b/libgimp/gimpproceduraldb.h @@ -28,21 +28,21 @@ G_BEGIN_DECLS gboolean gimp_procedural_db_proc_info (const gchar *procedure, - gchar **blurb, - gchar **help, - gchar **author, - gchar **copyright, - gchar **date, - GimpPDBProcType *proc_type, - gint *num_args, - gint *num_values, - GimpParamDef **args, - GimpParamDef **return_vals); + gchar **blurb, + gchar **help, + gchar **author, + gchar **copyright, + gchar **date, + GimpPDBProcType *proc_type, + gint *num_args, + gint *num_values, + GimpParamDef **args, + GimpParamDef **return_vals); gboolean gimp_procedural_db_get_data (const gchar *identifier, - gpointer data); + gpointer data); gboolean gimp_procedural_db_set_data (const gchar *identifier, - gpointer data, - guint32 bytes); + gpointer data, + guint32 bytes); G_END_DECLS diff --git a/libgimp/gimpprogress.c b/libgimp/gimpprogress.c index 0869866a5f..bd59904be1 100644 --- a/libgimp/gimpprogress.c +++ b/libgimp/gimpprogress.c @@ -134,17 +134,17 @@ gimp_progress_install_vtable (const GimpProgressVtable *vtable, progress_callback = gimp_procedural_db_temp_name (); gimp_install_temp_proc (progress_callback, - "Temporary progress callback procedure", - "", - "Michael Natterer ", - "Michael Natterer", - "2004", - NULL, - "RGB*, GRAY*, INDEXED*", - GIMP_TEMPORARY, - G_N_ELEMENTS (args), G_N_ELEMENTS (values), - args, values, - gimp_temp_progress_run); + "Temporary progress callback procedure", + "", + "Michael Natterer ", + "Michael Natterer", + "2004", + NULL, + "RGB*, GRAY*, INDEXED*", + GIMP_TEMPORARY, + G_N_ELEMENTS (args), G_N_ELEMENTS (values), + args, values, + gimp_temp_progress_run); if (_gimp_progress_install (progress_callback)) { diff --git a/libgimp/gimpselection.c b/libgimp/gimpselection.c index be44fdbc65..9f950d4c32 100644 --- a/libgimp/gimpselection.c +++ b/libgimp/gimpselection.c @@ -43,13 +43,13 @@ */ gint32 gimp_selection_float (gint32 image_ID, - gint32 drawable_ID, - gint offx, - gint offy) + gint32 drawable_ID, + gint offx, + gint offy) { return _gimp_selection_float (drawable_ID, - offx, - offy); + offx, + offy); } /** diff --git a/libgimp/gimptile.c b/libgimp/gimptile.c index b99a9fb74b..3fa1660df8 100644 --- a/libgimp/gimptile.c +++ b/libgimp/gimptile.c @@ -40,7 +40,7 @@ void gimp_read_expect_msg (GimpWireMessage *msg, - gint type); + gint type); static void gimp_tile_get (GimpTile *tile); static void gimp_tile_put (GimpTile *tile); @@ -91,7 +91,7 @@ gimp_tile_ref_zero (GimpTile *tile) void gimp_tile_unref (GimpTile *tile, - gboolean dirty) + gboolean dirty) { g_return_if_fail (tile != NULL); g_return_if_fail (tile->ref_count > 0); @@ -318,24 +318,24 @@ gimp_tile_cache_insert (GimpTile *tile) */ if ((cur_cache_size + max_tile_size) > max_cache_size) - { - while (tile_list_head && + { + while (tile_list_head && (cur_cache_size + max_cache_size * FREE_QUANTUM) > max_cache_size) { gimp_tile_cache_flush ((GimpTile *) tile_list_head->data); } - if ((cur_cache_size + max_tile_size) > max_cache_size) - return; - } + if ((cur_cache_size + max_tile_size) > max_cache_size) + return; + } /* Place the tile at the end of the tile list. */ tile_list_tail = g_list_append (tile_list_tail, tile); if (! tile_list_head) - tile_list_head = tile_list_tail; + tile_list_head = tile_list_tail; tile_list_tail = g_list_last (tile_list_tail); diff --git a/libgimp/gimptile.h b/libgimp/gimptile.h index fa43c5dd3d..5031b3ffc5 100644 --- a/libgimp/gimptile.h +++ b/libgimp/gimptile.h @@ -44,7 +44,7 @@ struct _GimpTile void gimp_tile_ref (GimpTile *tile); void gimp_tile_ref_zero (GimpTile *tile); void gimp_tile_unref (GimpTile *tile, - gboolean dirty); + gboolean dirty); void gimp_tile_flush (GimpTile *tile); void gimp_tile_cache_size (gulong kilobytes); diff --git a/libgimp/gimpui.c b/libgimp/gimpui.c index 56e12d6580..fc17424f7a 100644 --- a/libgimp/gimpui.c +++ b/libgimp/gimpui.c @@ -65,7 +65,7 @@ static gboolean gimp_ui_initialized = FALSE; **/ void gimp_ui_init (const gchar *prog_name, - gboolean preview) + gboolean preview) { const gchar *display_name; gint argc; diff --git a/libgimp/gimpunitcache.c b/libgimp/gimpunitcache.c index db719071a7..1bffb7add8 100644 --- a/libgimp/gimpunitcache.c +++ b/libgimp/gimpunitcache.c @@ -122,12 +122,12 @@ _gimp_unit_cache_new (gchar *identifier, gchar *plural) { return _gimp_unit_new (identifier, - factor, - digits, - symbol, - abbreviation, - singular, - plural); + factor, + digits, + symbol, + abbreviation, + singular, + plural); } gboolean @@ -151,7 +151,7 @@ _gimp_unit_cache_set_deletion_flag (GimpUnit unit, return; _gimp_unit_set_deletion_flag (unit, - deletion_flag); + deletion_flag); } gdouble diff --git a/libgimpbase/gimpdatafiles.c b/libgimpbase/gimpdatafiles.c index d883674878..88b0aa0f41 100644 --- a/libgimpbase/gimpdatafiles.c +++ b/libgimpbase/gimpdatafiles.c @@ -64,21 +64,21 @@ is_script (const gchar *filename) { pathext = g_getenv ("PATHEXT"); if (pathext != NULL) - { - exts = g_strsplit (pathext, G_SEARCHPATH_SEPARATOR_S, 100); - } + { + exts = g_strsplit (pathext, G_SEARCHPATH_SEPARATOR_S, 100); + } else - { - exts = g_new (gchar *, 1); - exts[0] = NULL; - } + { + exts = g_new (gchar *, 1); + exts[0] = NULL; + } } i = 0; while (exts[i] != NULL) { if (g_ascii_strcasecmp (ext, exts[i]) == 0) - return TRUE; + return TRUE; i++; } @@ -90,7 +90,7 @@ is_script (const gchar *filename) gboolean gimp_datafiles_check_extension (const gchar *filename, - const gchar *extension) + const gchar *extension) { gint name_len; gint ext_len; @@ -109,9 +109,9 @@ gimp_datafiles_check_extension (const gchar *filename, void gimp_datafiles_read_directories (const gchar *path_str, - GFileTest flags, - GimpDatafileLoaderFunc loader_func, - gpointer user_data) + GFileTest flags, + GimpDatafileLoaderFunc loader_func, + gpointer user_data) { GimpDatafileData file_data; struct stat filestat; @@ -137,12 +137,12 @@ gimp_datafiles_read_directories (const gchar *path_str, dir = g_dir_open (dirname, 0, NULL); if (dir) - { - while ((dir_ent = g_dir_read_name (dir))) - { - filename = g_build_filename (dirname, dir_ent, NULL); + { + while ((dir_ent = g_dir_read_name (dir))) + { + filename = g_build_filename (dirname, dir_ent, NULL); - err = g_stat (filename, &filestat); + err = g_stat (filename, &filestat); file_data.filename = filename; file_data.dirname = dirname; @@ -151,8 +151,8 @@ gimp_datafiles_read_directories (const gchar *path_str, file_data.mtime = filestat.st_mtime; file_data.ctime = filestat.st_ctime; - if (! err) - { + if (! err) + { if (flags & G_FILE_TEST_EXISTS) { (* loader_func) (&file_data, user_data); @@ -162,33 +162,33 @@ gimp_datafiles_read_directories (const gchar *path_str, { (* loader_func) (&file_data, user_data); } - else if ((flags & G_FILE_TEST_IS_DIR) && + else if ((flags & G_FILE_TEST_IS_DIR) && S_ISDIR (filestat.st_mode)) - { - (* loader_func) (&file_data, user_data); - } + { + (* loader_func) (&file_data, user_data); + } #ifndef G_OS_WIN32 - else if ((flags & G_FILE_TEST_IS_SYMLINK) && + else if ((flags & G_FILE_TEST_IS_SYMLINK) && S_ISLNK (filestat.st_mode)) - { - (* loader_func) (&file_data, user_data); - } + { + (* loader_func) (&file_data, user_data); + } #endif - else if ((flags & G_FILE_TEST_IS_EXECUTABLE) && + else if ((flags & G_FILE_TEST_IS_EXECUTABLE) && (((filestat.st_mode & S_IXUSR) && - !S_ISDIR (filestat.st_mode)) || + !S_ISDIR (filestat.st_mode)) || (S_ISREG (filestat.st_mode) && is_script (filename)))) - { - (* loader_func) (&file_data, user_data); - } - } + { + (* loader_func) (&file_data, user_data); + } + } - g_free (filename); - } + g_free (filename); + } - g_dir_close (dir); - } + g_dir_close (dir); + } } gimp_path_free (path); diff --git a/libgimpbase/gimpdatafiles.h b/libgimpbase/gimpdatafiles.h index b4a6d78b93..153a1cc9e2 100644 --- a/libgimpbase/gimpdatafiles.h +++ b/libgimpbase/gimpdatafiles.h @@ -41,12 +41,12 @@ struct _GimpDatafileData gboolean gimp_datafiles_check_extension (const gchar *filename, - const gchar *extension); + const gchar *extension); void gimp_datafiles_read_directories (const gchar *path_str, - GFileTest flags, - GimpDatafileLoaderFunc loader_func, - gpointer user_data); + GFileTest flags, + GimpDatafileLoaderFunc loader_func, + gpointer user_data); G_END_DECLS diff --git a/libgimpbase/gimpenv.h b/libgimpbase/gimpenv.h index 9cf6ae68e4..73eb5dcf6c 100644 --- a/libgimpbase/gimpenv.h +++ b/libgimpbase/gimpenv.h @@ -31,16 +31,16 @@ G_BEGIN_DECLS const gchar * gimp_directory (void) G_GNUC_CONST; const gchar * gimp_data_directory (void) G_GNUC_CONST; -const gchar * gimp_locale_directory (void) G_GNUC_CONST; -const gchar * gimp_sysconf_directory (void) G_GNUC_CONST; +const gchar * gimp_locale_directory (void) G_GNUC_CONST; +const gchar * gimp_sysconf_directory (void) G_GNUC_CONST; const gchar * gimp_plug_in_directory (void) G_GNUC_CONST; const gchar * gimp_gtkrc (void) G_GNUC_CONST; gchar * gimp_personal_rc_file (const gchar *basename); GList * gimp_path_parse (const gchar *path, - gint max_paths, - gboolean check, - GList **check_failed); + gint max_paths, + gboolean check, + GList **check_failed); gchar * gimp_path_to_str (GList *path); void gimp_path_free (GList *path); diff --git a/libgimpbase/gimpparasite.c b/libgimpbase/gimpparasite.c index 494a044fbc..17297dad6f 100644 --- a/libgimpbase/gimpparasite.c +++ b/libgimpbase/gimpparasite.c @@ -31,7 +31,7 @@ #include #ifdef G_OS_WIN32 -#include /* For _getpid() */ +#include /* For _getpid() */ #endif #include "gimpbasetypes.h" @@ -189,9 +189,9 @@ gimp_parasite_print (GimpParasite *parasite) GimpParasite * gimp_parasite_new (const gchar *name, - guint32 flags, - guint32 size, - gconstpointer data) + guint32 flags, + guint32 size, + gconstpointer data) { GimpParasite *parasite; @@ -226,7 +226,7 @@ gimp_parasite_free (GimpParasite *parasite) gboolean gimp_parasite_is_type (const GimpParasite *parasite, - const gchar *name) + const gchar *name) { if (!parasite || !parasite->name) return FALSE; @@ -241,12 +241,12 @@ gimp_parasite_copy (const GimpParasite *parasite) return NULL; return gimp_parasite_new (parasite->name, parasite->flags, - parasite->size, parasite->data); + parasite->size, parasite->data); } gboolean gimp_parasite_compare (const GimpParasite *a, - const GimpParasite *b) + const GimpParasite *b) { if (a && b && a->name && b->name && @@ -255,9 +255,9 @@ gimp_parasite_compare (const GimpParasite *a, a->size == b->size) { if (a->data == NULL && b->data == NULL) - return TRUE; + return TRUE; else if (a->data && b->data && memcmp (a->data, b->data, a->size) == 0) - return TRUE; + return TRUE; } return FALSE; @@ -292,7 +292,7 @@ gimp_parasite_is_undoable (const GimpParasite *parasite) gboolean gimp_parasite_has_flag (const GimpParasite *parasite, - gulong flag) + gulong flag) { if (parasite == NULL) return FALSE; diff --git a/libgimpbase/gimpparasite.h b/libgimpbase/gimpparasite.h index 44139f5bf3..a36dac902d 100644 --- a/libgimpbase/gimpparasite.h +++ b/libgimpbase/gimpparasite.h @@ -79,7 +79,7 @@ struct _GimpParasite guint32 flags; /* save Parasite in XCF file, etc. */ guint32 size; /* amount of data */ gpointer data; /* a pointer to the data. plugin is * - * responsible for tracking byte order */ + * responsible for tracking byte order */ }; diff --git a/libgimpbase/gimpparasiteio.c b/libgimpbase/gimpparasiteio.c index 1674b636f7..d5dce2431e 100644 --- a/libgimpbase/gimpparasiteio.c +++ b/libgimpbase/gimpparasiteio.c @@ -64,7 +64,7 @@ gimp_pixpipe_params_init (GimpPixPipeParams *params) void gimp_pixpipe_params_parse (const gchar *string, - GimpPixPipeParams *params) + GimpPixPipeParams *params) { gchar *copy; gchar *p, *q, *r; @@ -81,77 +81,77 @@ gimp_pixpipe_params_parse (const gchar *string, q = NULL; r = strchr (p, ':'); if (r) - *r = 0; + *r = 0; if (strcmp (p, "ncells") == 0) - { - if (r) - params->ncells = atoi (r + 1); - } + { + if (r) + params->ncells = atoi (r + 1); + } else if (strcmp (p, "step") == 0) - { - if (r) - params->step = atoi (r + 1); - } + { + if (r) + params->step = atoi (r + 1); + } else if (strcmp (p, "dim") == 0) - { - if (r) + { + if (r) { params->dim = atoi (r + 1); params->dim = CLAMP (params->dim, 1, GIMP_PIXPIPE_MAXDIM); } } else if (strcmp (p, "cols") == 0) - { - if (r) - params->cols = atoi (r + 1); - } + { + if (r) + params->cols = atoi (r + 1); + } else if (strcmp (p, "rows") == 0) - { - if (r) - params->rows = atoi (r + 1); - } + { + if (r) + params->rows = atoi (r + 1); + } else if (strcmp (p, "cellwidth") == 0) - { - if (r) - params->cellwidth = atoi (r + 1); - } + { + if (r) + params->cellwidth = atoi (r + 1); + } else if (strcmp (p, "cellheight") == 0) - { - if (r) - params->cellheight = atoi (r + 1); - } + { + if (r) + params->cellheight = atoi (r + 1); + } else if (strcmp (p, "placement") == 0) - { - if (r) - { - params->placement = g_strdup (r + 1); - params->free_placement_string = TRUE; - } - } + { + if (r) + { + params->placement = g_strdup (r + 1); + params->free_placement_string = TRUE; + } + } else if (strncmp (p, "rank", strlen ("rank")) == 0 && r) - { - if (r) - { - i = atoi (p + strlen ("rank")); - if (i >= 0 && i < params->dim) - params->rank[i] = atoi (r + 1); - } - } + { + if (r) + { + i = atoi (p + strlen ("rank")); + if (i >= 0 && i < params->dim) + params->rank[i] = atoi (r + 1); + } + } else if (strncmp (p, "sel", strlen ("sel")) == 0 && r) - { - if (r) - { - i = atoi (p + strlen ("sel")); - if (i >= 0 && i < params->dim) - { - params->selection[i] = g_strdup (r + 1); - params->free_selection_string = TRUE; - } - } - } + { + if (r) + { + i = atoi (p + strlen ("sel")); + if (i >= 0 && i < params->dim) + { + params->selection[i] = g_strdup (r + 1); + params->free_selection_string = TRUE; + } + } + } if (r) - *r = ':'; + *r = ':'; } g_free (copy); diff --git a/libgimpbase/gimpparasiteio.h b/libgimpbase/gimpparasiteio.h index 721d484967..88036bece2 100644 --- a/libgimpbase/gimpparasiteio.h +++ b/libgimpbase/gimpparasiteio.h @@ -60,7 +60,7 @@ void gimp_pixpipe_params_init (GimpPixPipeParams *params); /* Parse a string into a GimpPixPipeParams */ void gimp_pixpipe_params_parse (const gchar *parameters, - GimpPixPipeParams *params); + GimpPixPipeParams *params); /* Build a string representation of GimpPixPipeParams */ gchar * gimp_pixpipe_params_build (GimpPixPipeParams *params); diff --git a/libgimpbase/gimpprotocol.c b/libgimpbase/gimpprotocol.c index fe4d21c8fc..2a599a3dd6 100644 --- a/libgimpbase/gimpprotocol.c +++ b/libgimpbase/gimpprotocol.c @@ -29,115 +29,115 @@ static void _gp_quit_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_quit_write (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_quit_destroy (GimpWireMessage *msg); static void _gp_config_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_config_write (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_config_destroy (GimpWireMessage *msg); static void _gp_tile_req_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_tile_req_write (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_tile_req_destroy (GimpWireMessage *msg); static void _gp_tile_ack_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_tile_ack_write (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_tile_ack_destroy (GimpWireMessage *msg); static void _gp_tile_data_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_tile_data_write (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_tile_data_destroy (GimpWireMessage *msg); static void _gp_proc_run_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_proc_run_write (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_proc_run_destroy (GimpWireMessage *msg); static void _gp_proc_return_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_proc_return_write (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_proc_return_destroy (GimpWireMessage *msg); static void _gp_temp_proc_run_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_temp_proc_run_write (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_temp_proc_run_destroy (GimpWireMessage *msg); static void _gp_temp_proc_return_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_temp_proc_return_write (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_temp_proc_return_destroy (GimpWireMessage *msg); static void _gp_proc_install_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_proc_install_write (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_proc_install_destroy (GimpWireMessage *msg); static void _gp_proc_uninstall_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_proc_uninstall_write (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_proc_uninstall_destroy (GimpWireMessage *msg); static void _gp_extension_ack_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_extension_ack_write (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_extension_ack_destroy (GimpWireMessage *msg); static void _gp_params_read (GIOChannel *channel, - GPParam **params, - guint *nparams, + GPParam **params, + guint *nparams, gpointer user_data); static void _gp_params_write (GIOChannel *channel, - GPParam *params, - gint nparams, + GPParam *params, + gint nparams, gpointer user_data); static void _gp_has_init_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_has_init_write (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data); static void _gp_has_init_destroy (GimpWireMessage *msg); @@ -220,7 +220,7 @@ gp_quit_write (GIOChannel *channel, gboolean gp_config_write (GIOChannel *channel, - GPConfig *config, + GPConfig *config, gpointer user_data) { GimpWireMessage msg; @@ -239,7 +239,7 @@ gp_config_write (GIOChannel *channel, gboolean gp_tile_req_write (GIOChannel *channel, - GPTileReq *tile_req, + GPTileReq *tile_req, gpointer user_data) { GimpWireMessage msg; @@ -276,7 +276,7 @@ gp_tile_ack_write (GIOChannel *channel, gboolean gp_tile_data_write (GIOChannel *channel, - GPTileData *tile_data, + GPTileData *tile_data, gpointer user_data) { GimpWireMessage msg; @@ -295,7 +295,7 @@ gp_tile_data_write (GIOChannel *channel, gboolean gp_proc_run_write (GIOChannel *channel, - GPProcRun *proc_run, + GPProcRun *proc_run, gpointer user_data) { GimpWireMessage msg; @@ -314,7 +314,7 @@ gp_proc_run_write (GIOChannel *channel, gboolean gp_proc_return_write (GIOChannel *channel, - GPProcReturn *proc_return, + GPProcReturn *proc_return, gpointer user_data) { GimpWireMessage msg; @@ -333,7 +333,7 @@ gp_proc_return_write (GIOChannel *channel, gboolean gp_temp_proc_run_write (GIOChannel *channel, - GPProcRun *proc_run, + GPProcRun *proc_run, gpointer user_data) { GimpWireMessage msg; @@ -352,7 +352,7 @@ gp_temp_proc_run_write (GIOChannel *channel, gboolean gp_temp_proc_return_write (GIOChannel *channel, - GPProcReturn *proc_return, + GPProcReturn *proc_return, gpointer user_data) { GimpWireMessage msg; @@ -371,7 +371,7 @@ gp_temp_proc_return_write (GIOChannel *channel, gboolean gp_proc_install_write (GIOChannel *channel, - GPProcInstall *proc_install, + GPProcInstall *proc_install, gpointer user_data) { GimpWireMessage msg; @@ -390,7 +390,7 @@ gp_proc_install_write (GIOChannel *channel, gboolean gp_proc_uninstall_write (GIOChannel *channel, - GPProcUninstall *proc_uninstall, + GPProcUninstall *proc_uninstall, gpointer user_data) { GimpWireMessage msg; @@ -447,14 +447,14 @@ gp_has_init_write (GIOChannel *channel, static void _gp_quit_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data) { } static void _gp_quit_write (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data) { } @@ -468,7 +468,7 @@ _gp_quit_destroy (GimpWireMessage *msg) static void _gp_config_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data) { GPConfig *config = g_new0 (GPConfig, 1); @@ -554,7 +554,7 @@ _gp_config_read (GIOChannel *channel, static void _gp_config_write (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data) { GPConfig *config = msg->data; @@ -650,7 +650,7 @@ _gp_config_destroy (GimpWireMessage *msg) static void _gp_tile_req_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data) { GPTileReq *tile_req = g_new0 (GPTileReq, 1); @@ -675,7 +675,7 @@ _gp_tile_req_read (GIOChannel *channel, static void _gp_tile_req_write (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data) { GPTileReq *tile_req = msg->data; @@ -702,14 +702,14 @@ _gp_tile_req_destroy (GimpWireMessage *msg) static void _gp_tile_ack_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data) { } static void _gp_tile_ack_write (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data) { } @@ -723,7 +723,7 @@ _gp_tile_ack_destroy (GimpWireMessage *msg) static void _gp_tile_data_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data) { GPTileData *tile_data = g_new0 (GPTileData, 1); @@ -760,7 +760,7 @@ _gp_tile_data_read (GIOChannel *channel, if (! _gimp_wire_read_int8 (channel, (guint8 *) tile_data->data, length, user_data)) - goto cleanup; + goto cleanup; } msg->data = tile_data; @@ -773,7 +773,7 @@ _gp_tile_data_read (GIOChannel *channel, static void _gp_tile_data_write (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data) { GPTileData *tile_data = msg->data; @@ -808,7 +808,7 @@ _gp_tile_data_write (GIOChannel *channel, if (! _gimp_wire_write_int8 (channel, (const guint8 *) tile_data->data, length, user_data)) - return; + return; } } @@ -825,7 +825,7 @@ _gp_tile_data_destroy (GimpWireMessage *msg) static void _gp_proc_run_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data) { GPProcRun *proc_run = g_new0 (GPProcRun, 1); @@ -846,7 +846,7 @@ _gp_proc_run_read (GIOChannel *channel, static void _gp_proc_run_write (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data) { GPProcRun *proc_run = msg->data; @@ -872,7 +872,7 @@ _gp_proc_run_destroy (GimpWireMessage *msg) static void _gp_proc_return_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data) { GPProcReturn *proc_return = g_new0 (GPProcReturn, 1); @@ -893,7 +893,7 @@ _gp_proc_return_read (GIOChannel *channel, static void _gp_proc_return_write (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data) { GPProcReturn *proc_return = msg->data; @@ -920,7 +920,7 @@ _gp_proc_return_destroy (GimpWireMessage *msg) static void _gp_temp_proc_run_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data) { _gp_proc_run_read (channel, msg, user_data); @@ -928,7 +928,7 @@ _gp_temp_proc_run_read (GIOChannel *channel, static void _gp_temp_proc_run_write (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data) { _gp_proc_run_write (channel, msg, user_data); @@ -944,7 +944,7 @@ _gp_temp_proc_run_destroy (GimpWireMessage *msg) static void _gp_temp_proc_return_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data) { _gp_proc_return_read (channel, msg, user_data); @@ -952,7 +952,7 @@ _gp_temp_proc_return_read (GIOChannel *channel, static void _gp_temp_proc_return_write (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data) { _gp_proc_return_write (channel, msg, user_data); @@ -968,7 +968,7 @@ _gp_temp_proc_return_destroy (GimpWireMessage *msg) static void _gp_proc_install_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data) { GPProcInstall *proc_install = g_new0 (GPProcInstall, 1); @@ -1016,15 +1016,15 @@ _gp_proc_install_read (GIOChannel *channel, if (! _gimp_wire_read_int32 (channel, (guint32 *) &proc_install->params[i].type, 1, user_data)) - goto cleanup; + goto cleanup; if (! _gimp_wire_read_string (channel, &proc_install->params[i].name, 1, user_data)) - goto cleanup; + goto cleanup; if (! _gimp_wire_read_string (channel, &proc_install->params[i].description, 1, user_data)) - goto cleanup; + goto cleanup; } proc_install->return_vals = g_new0 (GPParamDef, proc_install->nreturn_vals); @@ -1034,15 +1034,15 @@ _gp_proc_install_read (GIOChannel *channel, if (! _gimp_wire_read_int32 (channel, (guint32 *) &proc_install->return_vals[i].type, 1, user_data)) - goto cleanup; + goto cleanup; if (! _gimp_wire_read_string (channel, &proc_install->return_vals[i].name, 1, user_data)) - goto cleanup; + goto cleanup; if (! _gimp_wire_read_string (channel, &proc_install->return_vals[i].description, 1, user_data)) - goto cleanup; + goto cleanup; } msg->data = proc_install; @@ -1061,13 +1061,13 @@ _gp_proc_install_read (GIOChannel *channel, if (proc_install->params) { for (i = 0; i < proc_install->nparams; i++) - { - if (!proc_install->params[i].name) - break; + { + if (!proc_install->params[i].name) + break; - g_free (proc_install->params[i].name); - g_free (proc_install->params[i].description); - } + g_free (proc_install->params[i].name); + g_free (proc_install->params[i].description); + } g_free (proc_install->params); } @@ -1075,13 +1075,13 @@ _gp_proc_install_read (GIOChannel *channel, if (proc_install->return_vals) { for (i = 0; i < proc_install->nreturn_vals; i++) - { - if (!proc_install->return_vals[i].name) - break; + { + if (!proc_install->return_vals[i].name) + break; - g_free (proc_install->return_vals[i].name); - g_free (proc_install->return_vals[i].description); - } + g_free (proc_install->return_vals[i].name); + g_free (proc_install->return_vals[i].description); + } g_free (proc_install->return_vals); } @@ -1091,7 +1091,7 @@ _gp_proc_install_read (GIOChannel *channel, static void _gp_proc_install_write (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data) { GPProcInstall *proc_install = msg->data; @@ -1137,15 +1137,15 @@ _gp_proc_install_write (GIOChannel *channel, if (! _gimp_wire_write_int32 (channel, (guint32 *) &proc_install->params[i].type, 1, user_data)) - return; + return; if (! _gimp_wire_write_string (channel, &proc_install->params[i].name, 1, user_data)) - return; + return; if (! _gimp_wire_write_string (channel, &proc_install->params[i].description, 1, user_data)) - return; + return; } for (i = 0; i < proc_install->nreturn_vals; i++) @@ -1153,15 +1153,15 @@ _gp_proc_install_write (GIOChannel *channel, if (! _gimp_wire_write_int32 (channel, (guint32 *) &proc_install->return_vals[i].type, 1, user_data)) - return; + return; if (! _gimp_wire_write_string (channel, &proc_install->return_vals[i].name, 1, user_data)) - return; + return; if (! _gimp_wire_write_string (channel, &proc_install->return_vals[i].description, 1, user_data)) - return; + return; } } @@ -1201,7 +1201,7 @@ _gp_proc_install_destroy (GimpWireMessage *msg) static void _gp_proc_uninstall_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data) { GPProcUninstall *proc_uninstall = g_new0 (GPProcUninstall, 1); @@ -1240,14 +1240,14 @@ _gp_proc_uninstall_destroy (GimpWireMessage *msg) static void _gp_extension_ack_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data) { } static void _gp_extension_ack_write (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data) { } @@ -1261,8 +1261,8 @@ _gp_extension_ack_destroy (GimpWireMessage *msg) static void _gp_params_read (GIOChannel *channel, - GPParam **params, - guint *nparams, + GPParam **params, + guint *nparams, gpointer user_data) { gint i, j; @@ -1283,230 +1283,230 @@ _gp_params_read (GIOChannel *channel, if (! _gimp_wire_read_int32 (channel, (guint32 *) &(*params)[i].type, 1, user_data)) - goto cleanup; + goto cleanup; switch ((*params)[i].type) - { - case GIMP_PDB_INT32: - if (! _gimp_wire_read_int32 (channel, + { + case GIMP_PDB_INT32: + if (! _gimp_wire_read_int32 (channel, (guint32 *) &(*params)[i].data.d_int32, 1, user_data)) - goto cleanup; - break; + goto cleanup; + break; - case GIMP_PDB_INT16: - if (! _gimp_wire_read_int16 (channel, + case GIMP_PDB_INT16: + if (! _gimp_wire_read_int16 (channel, (guint16 *) &(*params)[i].data.d_int16, 1, user_data)) - goto cleanup; - break; + goto cleanup; + break; - case GIMP_PDB_INT8: - if (! _gimp_wire_read_int8 (channel, + case GIMP_PDB_INT8: + if (! _gimp_wire_read_int8 (channel, (guint8 *) &(*params)[i].data.d_int8, 1, user_data)) - goto cleanup; - break; + goto cleanup; + break; case GIMP_PDB_FLOAT: - if (! _gimp_wire_read_double (channel, + if (! _gimp_wire_read_double (channel, &(*params)[i].data.d_float, 1, user_data)) - goto cleanup; + goto cleanup; break; case GIMP_PDB_STRING: - if (! _gimp_wire_read_string (channel, + if (! _gimp_wire_read_string (channel, &(*params)[i].data.d_string, 1, user_data)) - goto cleanup; + goto cleanup; break; case GIMP_PDB_INT32ARRAY: - (*params)[i-1].data.d_int32 = MAX (0, (*params)[i-1].data.d_int32); - (*params)[i].data.d_int32array = g_new (gint32, + (*params)[i-1].data.d_int32 = MAX (0, (*params)[i-1].data.d_int32); + (*params)[i].data.d_int32array = g_new (gint32, (*params)[i-1].data.d_int32); - if (! _gimp_wire_read_int32 (channel, + if (! _gimp_wire_read_int32 (channel, (guint32 *) (*params)[i].data.d_int32array, (*params)[i-1].data.d_int32, user_data)) - { - g_free ((*params)[i].data.d_int32array); - goto cleanup; - } + { + g_free ((*params)[i].data.d_int32array); + goto cleanup; + } break; case GIMP_PDB_INT16ARRAY: - (*params)[i-1].data.d_int32 = MAX (0, (*params)[i-1].data.d_int32); - (*params)[i].data.d_int16array = g_new (gint16, + (*params)[i-1].data.d_int32 = MAX (0, (*params)[i-1].data.d_int32); + (*params)[i].data.d_int16array = g_new (gint16, (*params)[i-1].data.d_int32); - if (! _gimp_wire_read_int16 (channel, + if (! _gimp_wire_read_int16 (channel, (guint16 *) (*params)[i].data.d_int16array, (*params)[i-1].data.d_int32, user_data)) - { - g_free ((*params)[i].data.d_int16array); - goto cleanup; - } + { + g_free ((*params)[i].data.d_int16array); + goto cleanup; + } break; case GIMP_PDB_INT8ARRAY: - (*params)[i-1].data.d_int32 = MAX (0, (*params)[i-1].data.d_int32); - (*params)[i].data.d_int8array = g_new (gint8, + (*params)[i-1].data.d_int32 = MAX (0, (*params)[i-1].data.d_int32); + (*params)[i].data.d_int8array = g_new (gint8, (*params)[i-1].data.d_int32); - if (! _gimp_wire_read_int8 (channel, + if (! _gimp_wire_read_int8 (channel, (guint8 *) (*params)[i].data.d_int8array, (*params)[i-1].data.d_int32, user_data)) - { - g_free ((*params)[i].data.d_int8array); - goto cleanup; - } + { + g_free ((*params)[i].data.d_int8array); + goto cleanup; + } break; case GIMP_PDB_FLOATARRAY: - (*params)[i-1].data.d_int32 = MAX (0, (*params)[i-1].data.d_int32); - (*params)[i].data.d_floatarray = g_new (gdouble, + (*params)[i-1].data.d_int32 = MAX (0, (*params)[i-1].data.d_int32); + (*params)[i].data.d_floatarray = g_new (gdouble, (*params)[i-1].data.d_int32); - if (! _gimp_wire_read_double (channel, + if (! _gimp_wire_read_double (channel, (*params)[i].data.d_floatarray, (*params)[i-1].data.d_int32, user_data)) - { - g_free ((*params)[i].data.d_floatarray); - goto cleanup; - } + { + g_free ((*params)[i].data.d_floatarray); + goto cleanup; + } break; case GIMP_PDB_STRINGARRAY: - (*params)[i-1].data.d_int32 = MAX (0, (*params)[i-1].data.d_int32); - (*params)[i].data.d_stringarray = g_new0 (gchar *, + (*params)[i-1].data.d_int32 = MAX (0, (*params)[i-1].data.d_int32); + (*params)[i].data.d_stringarray = g_new0 (gchar *, (*params)[i-1].data.d_int32); - if (! _gimp_wire_read_string (channel, + if (! _gimp_wire_read_string (channel, (*params)[i].data.d_stringarray, (*params)[i-1].data.d_int32, user_data)) - { - for (j = 0; j < (*params)[i-1].data.d_int32; j++) - g_free (((*params)[i].data.d_stringarray)[j]); - g_free ((*params)[i].data.d_stringarray); - goto cleanup; - } + { + for (j = 0; j < (*params)[i-1].data.d_int32; j++) + g_free (((*params)[i].data.d_stringarray)[j]); + g_free ((*params)[i].data.d_stringarray); + goto cleanup; + } break; case GIMP_PDB_COLOR: - if (! _gimp_wire_read_color (channel, + if (! _gimp_wire_read_color (channel, &(*params)[i].data.d_color, 1, user_data)) - goto cleanup; - break; + goto cleanup; + break; case GIMP_PDB_REGION: break; case GIMP_PDB_DISPLAY: - if (! _gimp_wire_read_int32 (channel, + if (! _gimp_wire_read_int32 (channel, (guint32 *) &(*params)[i].data.d_display, 1, user_data)) - goto cleanup; + goto cleanup; break; case GIMP_PDB_IMAGE: - if (! _gimp_wire_read_int32 (channel, + if (! _gimp_wire_read_int32 (channel, (guint32 *) &(*params)[i].data.d_image, 1, user_data)) - goto cleanup; + goto cleanup; break; case GIMP_PDB_LAYER: - if (! _gimp_wire_read_int32 (channel, + if (! _gimp_wire_read_int32 (channel, (guint32 *) &(*params)[i].data.d_layer, 1, user_data)) - goto cleanup; + goto cleanup; break; case GIMP_PDB_CHANNEL: - if (! _gimp_wire_read_int32 (channel, + if (! _gimp_wire_read_int32 (channel, (guint32 *) &(*params)[i].data.d_channel, 1, user_data)) - goto cleanup; + goto cleanup; break; case GIMP_PDB_DRAWABLE: - if (! _gimp_wire_read_int32 (channel, + if (! _gimp_wire_read_int32 (channel, (guint32 *) &(*params)[i].data.d_drawable, 1, user_data)) - goto cleanup; + goto cleanup; break; case GIMP_PDB_SELECTION: - if (! _gimp_wire_read_int32 (channel, + if (! _gimp_wire_read_int32 (channel, (guint32 *) &(*params)[i].data.d_selection, 1, user_data)) - goto cleanup; + goto cleanup; break; case GIMP_PDB_BOUNDARY: - if (! _gimp_wire_read_int32 (channel, + if (! _gimp_wire_read_int32 (channel, (guint32 *) &(*params)[i].data.d_boundary, 1, user_data)) - goto cleanup; + goto cleanup; break; case GIMP_PDB_VECTORS: - if (! _gimp_wire_read_int32 (channel, + if (! _gimp_wire_read_int32 (channel, (guint32 *) &(*params)[i].data.d_vectors, 1, user_data)) - goto cleanup; + goto cleanup; break; case GIMP_PDB_PARASITE: - if (! _gimp_wire_read_string (channel, + if (! _gimp_wire_read_string (channel, &(*params)[i].data.d_parasite.name, 1, user_data)) - goto cleanup; - if ((*params)[i].data.d_parasite.name == NULL) - { - /* we have a null parasite */ - (*params)[i].data.d_parasite.data = NULL; - break; - } - if (! _gimp_wire_read_int32 (channel, + goto cleanup; + if ((*params)[i].data.d_parasite.name == NULL) + { + /* we have a null parasite */ + (*params)[i].data.d_parasite.data = NULL; + break; + } + if (! _gimp_wire_read_int32 (channel, &((*params)[i].data.d_parasite.flags), 1, user_data)) - goto cleanup; - if (! _gimp_wire_read_int32 (channel, + goto cleanup; + if (! _gimp_wire_read_int32 (channel, &((*params)[i].data.d_parasite.size), 1, user_data)) - goto cleanup; - if ((*params)[i].data.d_parasite.size > 0) - { - (*params)[i].data.d_parasite.data = + goto cleanup; + if ((*params)[i].data.d_parasite.size > 0) + { + (*params)[i].data.d_parasite.data = g_malloc ((*params)[i].data.d_parasite.size); - if (! _gimp_wire_read_int8 (channel, + if (! _gimp_wire_read_int8 (channel, (*params)[i].data.d_parasite.data, (*params)[i].data.d_parasite.size, user_data)) - { - g_free ((*params)[i].data.d_parasite.data); - goto cleanup; - } - } - else - (*params)[i].data.d_parasite.data = NULL; - break; - - case GIMP_PDB_STATUS: - if (! _gimp_wire_read_int32 (channel, - (guint32 *) &(*params)[i].data.d_status, 1, - user_data)) - goto cleanup; + { + g_free ((*params)[i].data.d_parasite.data); + goto cleanup; + } + } + else + (*params)[i].data.d_parasite.data = NULL; break; - case GIMP_PDB_END: - break; - } + case GIMP_PDB_STATUS: + if (! _gimp_wire_read_int32 (channel, + (guint32 *) &(*params)[i].data.d_status, 1, + user_data)) + goto cleanup; + break; + + case GIMP_PDB_END: + break; + } } return; @@ -1519,8 +1519,8 @@ _gp_params_read (GIOChannel *channel, static void _gp_params_write (GIOChannel *channel, - GPParam *params, - gint nparams, + GPParam *params, + gint nparams, gpointer user_data) { gint i; @@ -1534,87 +1534,87 @@ _gp_params_write (GIOChannel *channel, if (! _gimp_wire_write_int32 (channel, (const guint32 *) ¶ms[i].type, 1, user_data)) - return; + return; switch (params[i].type) - { - case GIMP_PDB_INT32: - if (! _gimp_wire_write_int32 (channel, + { + case GIMP_PDB_INT32: + if (! _gimp_wire_write_int32 (channel, (const guint32 *) ¶ms[i].data.d_int32, 1, user_data)) - return; - break; + return; + break; - case GIMP_PDB_INT16: - if (! _gimp_wire_write_int16 (channel, + case GIMP_PDB_INT16: + if (! _gimp_wire_write_int16 (channel, (const guint16 *) ¶ms[i].data.d_int16, 1, user_data)) - return; - break; + return; + break; - case GIMP_PDB_INT8: - if (! _gimp_wire_write_int8 (channel, + case GIMP_PDB_INT8: + if (! _gimp_wire_write_int8 (channel, (const guint8 *) ¶ms[i].data.d_int8, 1, user_data)) - return; - break; + return; + break; case GIMP_PDB_FLOAT: - if (! _gimp_wire_write_double (channel, + if (! _gimp_wire_write_double (channel, ¶ms[i].data.d_float, 1, user_data)) - return; + return; break; case GIMP_PDB_STRING: - if (! _gimp_wire_write_string (channel, + if (! _gimp_wire_write_string (channel, ¶ms[i].data.d_string, 1, user_data)) - return; + return; break; case GIMP_PDB_INT32ARRAY: - if (! _gimp_wire_write_int32 (channel, + if (! _gimp_wire_write_int32 (channel, (const guint32 *) params[i].data.d_int32array, params[i-1].data.d_int32, user_data)) - return; + return; break; case GIMP_PDB_INT16ARRAY: - if (! _gimp_wire_write_int16 (channel, + if (! _gimp_wire_write_int16 (channel, (const guint16 *) params[i].data.d_int16array, params[i-1].data.d_int32, user_data)) - return; + return; break; case GIMP_PDB_INT8ARRAY: - if (! _gimp_wire_write_int8 (channel, + if (! _gimp_wire_write_int8 (channel, (const guint8 *) params[i].data.d_int8array, params[i-1].data.d_int32, user_data)) - return; + return; break; case GIMP_PDB_FLOATARRAY: - if (! _gimp_wire_write_double (channel, + if (! _gimp_wire_write_double (channel, params[i].data.d_floatarray, params[i-1].data.d_int32, user_data)) - return; + return; break; case GIMP_PDB_STRINGARRAY: - if (! _gimp_wire_write_string (channel, + if (! _gimp_wire_write_string (channel, params[i].data.d_stringarray, params[i-1].data.d_int32, user_data)) - return; + return; break; case GIMP_PDB_COLOR: - if (! _gimp_wire_write_color (channel, + if (! _gimp_wire_write_color (channel, ¶ms[i].data.d_color, 1, user_data)) return; break; @@ -1623,97 +1623,97 @@ _gp_params_write (GIOChannel *channel, break; case GIMP_PDB_DISPLAY: - if (! _gimp_wire_write_int32 (channel, + if (! _gimp_wire_write_int32 (channel, (const guint32 *) ¶ms[i].data.d_display, 1, user_data)) - return; + return; break; case GIMP_PDB_IMAGE: - if (! _gimp_wire_write_int32 (channel, + if (! _gimp_wire_write_int32 (channel, (const guint32 *) ¶ms[i].data.d_image, 1, user_data)) - return; + return; break; case GIMP_PDB_LAYER: - if (! _gimp_wire_write_int32 (channel, + if (! _gimp_wire_write_int32 (channel, (const guint32 *) ¶ms[i].data.d_layer, 1, user_data)) - return; + return; break; case GIMP_PDB_CHANNEL: - if (! _gimp_wire_write_int32 (channel, + if (! _gimp_wire_write_int32 (channel, (const guint32 *) ¶ms[i].data.d_channel, 1, user_data)) - return; + return; break; case GIMP_PDB_DRAWABLE: - if (! _gimp_wire_write_int32 (channel, + if (! _gimp_wire_write_int32 (channel, (const guint32 *) ¶ms[i].data.d_drawable, 1, user_data)) - return; + return; break; case GIMP_PDB_SELECTION: - if (! _gimp_wire_write_int32 (channel, + if (! _gimp_wire_write_int32 (channel, (const guint32 *) ¶ms[i].data.d_selection, 1, user_data)) - return; + return; break; case GIMP_PDB_BOUNDARY: - if (! _gimp_wire_write_int32 (channel, + if (! _gimp_wire_write_int32 (channel, (const guint32 *) ¶ms[i].data.d_boundary, 1, user_data)) - return; + return; break; case GIMP_PDB_VECTORS: - if (! _gimp_wire_write_int32 (channel, + if (! _gimp_wire_write_int32 (channel, (const guint32 *) ¶ms[i].data.d_vectors, 1, user_data)) - return; + return; break; case GIMP_PDB_PARASITE: - { - GimpParasite *p = (GimpParasite *) ¶ms[i].data.d_parasite; + { + GimpParasite *p = (GimpParasite *) ¶ms[i].data.d_parasite; - if (p->name == NULL) - { - /* write a null string to signal a null parasite */ - _gimp_wire_write_string (channel, &p->name, 1, user_data); - break; - } + if (p->name == NULL) + { + /* write a null string to signal a null parasite */ + _gimp_wire_write_string (channel, &p->name, 1, user_data); + break; + } - if (! _gimp_wire_write_string (channel, &p->name, 1, user_data)) - return; - if (! _gimp_wire_write_int32 (channel, &p->flags, 1, user_data)) - return; - if (! _gimp_wire_write_int32 (channel, &p->size, 1, user_data)) - return; - if (p->size > 0) - { - if (! _gimp_wire_write_int8 (channel, + if (! _gimp_wire_write_string (channel, &p->name, 1, user_data)) + return; + if (! _gimp_wire_write_int32 (channel, &p->flags, 1, user_data)) + return; + if (! _gimp_wire_write_int32 (channel, &p->size, 1, user_data)) + return; + if (p->size > 0) + { + if (! _gimp_wire_write_int8 (channel, p->data, p->size, user_data)) - return; - } - } - break; - - case GIMP_PDB_STATUS: - if (! _gimp_wire_write_int32 (channel, - (const guint32 *) ¶ms[i].data.d_status, 1, - user_data)) - return; + return; + } + } break; - case GIMP_PDB_END: - break; - } + case GIMP_PDB_STATUS: + if (! _gimp_wire_write_int32 (channel, + (const guint32 *) ¶ms[i].data.d_status, 1, + user_data)) + return; + break; + + case GIMP_PDB_END: + break; + } } } @@ -1726,67 +1726,67 @@ gp_params_destroy (GPParam *params, for (i = 0; i < nparams; i++) { switch (params[i].type) - { - case GIMP_PDB_INT32: - case GIMP_PDB_INT16: - case GIMP_PDB_INT8: - case GIMP_PDB_FLOAT: - case GIMP_PDB_COLOR: - case GIMP_PDB_REGION: - case GIMP_PDB_DISPLAY: - case GIMP_PDB_IMAGE: - case GIMP_PDB_LAYER: - case GIMP_PDB_CHANNEL: - case GIMP_PDB_DRAWABLE: - case GIMP_PDB_SELECTION: - case GIMP_PDB_BOUNDARY: - case GIMP_PDB_VECTORS: - case GIMP_PDB_STATUS: - break; + { + case GIMP_PDB_INT32: + case GIMP_PDB_INT16: + case GIMP_PDB_INT8: + case GIMP_PDB_FLOAT: + case GIMP_PDB_COLOR: + case GIMP_PDB_REGION: + case GIMP_PDB_DISPLAY: + case GIMP_PDB_IMAGE: + case GIMP_PDB_LAYER: + case GIMP_PDB_CHANNEL: + case GIMP_PDB_DRAWABLE: + case GIMP_PDB_SELECTION: + case GIMP_PDB_BOUNDARY: + case GIMP_PDB_VECTORS: + case GIMP_PDB_STATUS: + break; - case GIMP_PDB_STRING: - g_free (params[i].data.d_string); - break; + case GIMP_PDB_STRING: + g_free (params[i].data.d_string); + break; - case GIMP_PDB_INT32ARRAY: - g_free (params[i].data.d_int32array); - break; + case GIMP_PDB_INT32ARRAY: + g_free (params[i].data.d_int32array); + break; - case GIMP_PDB_INT16ARRAY: - g_free (params[i].data.d_int16array); - break; + case GIMP_PDB_INT16ARRAY: + g_free (params[i].data.d_int16array); + break; - case GIMP_PDB_INT8ARRAY: - g_free (params[i].data.d_int8array); - break; + case GIMP_PDB_INT8ARRAY: + g_free (params[i].data.d_int8array); + break; - case GIMP_PDB_FLOATARRAY: - g_free (params[i].data.d_floatarray); - break; + case GIMP_PDB_FLOATARRAY: + g_free (params[i].data.d_floatarray); + break; - case GIMP_PDB_STRINGARRAY: - if ((i > 0) && (params[i-1].type == GIMP_PDB_INT32)) - { - gint count = params[i-1].data.d_int32; + case GIMP_PDB_STRINGARRAY: + if ((i > 0) && (params[i-1].type == GIMP_PDB_INT32)) + { + gint count = params[i-1].data.d_int32; gint j; - for (j = 0; j < count; j++) - g_free (params[i].data.d_stringarray[j]); + for (j = 0; j < count; j++) + g_free (params[i].data.d_stringarray[j]); - g_free (params[i].data.d_stringarray); - } - break; + g_free (params[i].data.d_stringarray); + } + break; - case GIMP_PDB_PARASITE: - if (params[i].data.d_parasite.name) - g_free(params[i].data.d_parasite.name); - if (params[i].data.d_parasite.data) - g_free(params[i].data.d_parasite.data); - break; + case GIMP_PDB_PARASITE: + if (params[i].data.d_parasite.name) + g_free(params[i].data.d_parasite.name); + if (params[i].data.d_parasite.data) + g_free(params[i].data.d_parasite.data); + break; - case GIMP_PDB_END: - break; - } + case GIMP_PDB_END: + break; + } } g_free (params); @@ -1796,14 +1796,14 @@ gp_params_destroy (GPParam *params, static void _gp_has_init_read (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data) { } static void _gp_has_init_write (GIOChannel *channel, - GimpWireMessage *msg, + GimpWireMessage *msg, gpointer user_data) { } diff --git a/libgimpbase/gimpprotocol.h b/libgimpbase/gimpprotocol.h index 6438ab19d4..96064afa9a 100644 --- a/libgimpbase/gimpprotocol.h +++ b/libgimpbase/gimpprotocol.h @@ -196,33 +196,33 @@ void gp_init (void); gboolean gp_quit_write (GIOChannel *channel, gpointer user_data); gboolean gp_config_write (GIOChannel *channel, - GPConfig *config, + GPConfig *config, gpointer user_data); gboolean gp_tile_req_write (GIOChannel *channel, - GPTileReq *tile_req, + GPTileReq *tile_req, gpointer user_data); gboolean gp_tile_ack_write (GIOChannel *channel, gpointer user_data); gboolean gp_tile_data_write (GIOChannel *channel, - GPTileData *tile_data, + GPTileData *tile_data, gpointer user_data); gboolean gp_proc_run_write (GIOChannel *channel, - GPProcRun *proc_run, + GPProcRun *proc_run, gpointer user_data); gboolean gp_proc_return_write (GIOChannel *channel, - GPProcReturn *proc_return, + GPProcReturn *proc_return, gpointer user_data); gboolean gp_temp_proc_run_write (GIOChannel *channel, - GPProcRun *proc_run, + GPProcRun *proc_run, gpointer user_data); gboolean gp_temp_proc_return_write (GIOChannel *channel, - GPProcReturn *proc_return, + GPProcReturn *proc_return, gpointer user_data); gboolean gp_proc_install_write (GIOChannel *channel, - GPProcInstall *proc_install, + GPProcInstall *proc_install, gpointer user_data); gboolean gp_proc_uninstall_write (GIOChannel *channel, - GPProcUninstall *proc_uninstall, + GPProcUninstall *proc_uninstall, gpointer user_data); gboolean gp_extension_ack_write (GIOChannel *channel, gpointer user_data); diff --git a/libgimpbase/gimpsignal.c b/libgimpbase/gimpsignal.c index 6085e597f2..9c99a77106 100644 --- a/libgimpbase/gimpsignal.c +++ b/libgimpbase/gimpsignal.c @@ -53,8 +53,8 @@ */ GimpSignalHandlerFunc gimp_signal_private (gint signum, - GimpSignalHandlerFunc handler, - gint flags) + GimpSignalHandlerFunc handler, + gint flags) { #ifndef G_OS_WIN32 gint ret; @@ -89,9 +89,9 @@ gimp_signal_private (gint signum, return (GimpSignalHandlerFunc) osa.sa_handler; #else - return NULL; /* Or g_error()? Should all calls to - * this function really be inside - * #ifdef G_OS_UNIX? - */ + return NULL; /* Or g_error()? Should all calls to + * this function really be inside + * #ifdef G_OS_UNIX? + */ #endif } diff --git a/libgimpbase/gimpsignal.h b/libgimpbase/gimpsignal.h index 5f0e445be6..b105115737 100644 --- a/libgimpbase/gimpsignal.h +++ b/libgimpbase/gimpsignal.h @@ -34,8 +34,8 @@ G_BEGIN_DECLS typedef void (* GimpSignalHandlerFunc) (gint signum); GimpSignalHandlerFunc gimp_signal_private (gint signum, - GimpSignalHandlerFunc handler, - gint flags); + GimpSignalHandlerFunc handler, + gint flags); G_END_DECLS diff --git a/libgimpbase/gimputils.c b/libgimpbase/gimputils.c index bb8cd9163b..e665ead829 100644 --- a/libgimpbase/gimputils.c +++ b/libgimpbase/gimputils.c @@ -47,7 +47,7 @@ **/ gchar * gimp_utf8_strtrim (const gchar *str, - gint max_chars) + gint max_chars) { /* FIXME: should we make this translatable? */ static const gchar *ellipsis = "..."; @@ -77,7 +77,7 @@ gimp_utf8_strtrim (const gchar *str, continue; } - break; + break; } if (*p) diff --git a/libgimpbase/gimpwin32-io.h b/libgimpbase/gimpwin32-io.h index fd990d6fce..956b3564e7 100644 --- a/libgimpbase/gimpwin32-io.h +++ b/libgimpbase/gimpwin32-io.h @@ -86,9 +86,9 @@ G_BEGIN_DECLS /* 2004-09-15 Tor Lillqvist - * glib/gwin32.h: Don't define ftruncate as a macro. Was never a - good idea, and it clashes with newest mingw headers, which have a - ftruncate implementation as an inline function. Thanks to Dominik R. + * glib/gwin32.h: Don't define ftruncate as a macro. Was never a + good idea, and it clashes with newest mingw headers, which have a + ftruncate implementation as an inline function. Thanks to Dominik R. */ /* needs coorection for msvc though ;( */ #ifdef _MSC_VER diff --git a/libgimpbase/gimpwire.h b/libgimpbase/gimpwire.h index 4a96beaa26..92e91e398a 100644 --- a/libgimpbase/gimpwire.h +++ b/libgimpbase/gimpwire.h @@ -58,7 +58,7 @@ void gimp_wire_set_reader (GimpWireIOFunc read_func); void gimp_wire_set_writer (GimpWireIOFunc write_func); void gimp_wire_set_flusher (GimpWireFlushFunc flush_func); -gboolean gimp_wire_read (GIOChannel *channel, +gboolean gimp_wire_read (GIOChannel *channel, guint8 *buf, gsize count, gpointer user_data); @@ -72,10 +72,10 @@ gboolean gimp_wire_flush (GIOChannel *channel, gboolean gimp_wire_error (void); void gimp_wire_clear_error (void); -gboolean gimp_wire_read_msg (GIOChannel *channel, +gboolean gimp_wire_read_msg (GIOChannel *channel, GimpWireMessage *msg, gpointer user_data); -gboolean gimp_wire_write_msg (GIOChannel *channel, +gboolean gimp_wire_write_msg (GIOChannel *channel, GimpWireMessage *msg, gpointer user_data); @@ -85,7 +85,7 @@ gboolean _gimp_wire_read_int32 (GIOChannel *channel, guint32 *data, gint count, gpointer user_data) G_GNUC_INTERNAL; -gboolean _gimp_wire_read_int16 (GIOChannel *channel, +gboolean _gimp_wire_read_int16 (GIOChannel *channel, guint16 *data, gint count, gpointer user_data) G_GNUC_INTERNAL; diff --git a/libgimpcolor/gimpadaptivesupersample.c b/libgimpcolor/gimpadaptivesupersample.c index bc79f6eda0..5e8bf798f8 100644 --- a/libgimpcolor/gimpadaptivesupersample.c +++ b/libgimpcolor/gimpadaptivesupersample.c @@ -50,19 +50,19 @@ struct _GimpSampleType static gulong gimp_render_sub_pixel (gint max_depth, - gint depth, - GimpSampleType **block, - gint x, - gint y, - gint x1, - gint y1, - gint x3, - gint y3, - gdouble threshold, - gint sub_pixel_size, - GimpRGB *color, - GimpRenderFunc render_func, - gpointer render_data) + gint depth, + GimpSampleType **block, + gint x, + gint y, + gint x1, + gint y1, + gint x3, + gint y3, + gdouble threshold, + gint sub_pixel_size, + GimpRGB *color, + GimpRenderFunc render_func, + gpointer render_data) { gint x2, y2; /* Coords of center sample */ gdouble dx1, dy1; /* Delta to upper left sample */ @@ -86,7 +86,7 @@ gimp_render_sub_pixel (gint max_depth, num_samples++; if (render_func) - (* render_func) (x + dx1, y + dy1, &c[0], render_data); + (* render_func) (x + dx1, y + dy1, &c[0], render_data); block[y1][x1].ready = TRUE; block[y1][x1].color = c[0]; @@ -103,7 +103,7 @@ gimp_render_sub_pixel (gint max_depth, num_samples++; if (render_func) - (* render_func) (x + dx3, y + dy1, &c[1], render_data); + (* render_func) (x + dx3, y + dy1, &c[1], render_data); block[y1][x3].ready = TRUE; block[y1][x3].color = c[1]; @@ -120,7 +120,7 @@ gimp_render_sub_pixel (gint max_depth, num_samples++; if (render_func) - (* render_func) (x + dx1, y + dy3, &c[2], render_data); + (* render_func) (x + dx1, y + dy3, &c[2], render_data); block[y3][x1].ready = TRUE; block[y3][x1].color = c[2]; @@ -137,7 +137,7 @@ gimp_render_sub_pixel (gint max_depth, num_samples++; if (render_func) - (* render_func) (x + dx3, y + dy3, &c[3], render_data); + (* render_func) (x + dx3, y + dy3, &c[3], render_data); block[y3][x3].ready = TRUE; block[y3][x3].color = c[3]; @@ -154,43 +154,43 @@ gimp_render_sub_pixel (gint max_depth, /* Check whether we have to supersample */ if ((gimp_rgba_distance (&c[0], &c[1]) >= threshold) || - (gimp_rgba_distance (&c[0], &c[2]) >= threshold) || - (gimp_rgba_distance (&c[0], &c[3]) >= threshold) || - (gimp_rgba_distance (&c[1], &c[2]) >= threshold) || - (gimp_rgba_distance (&c[1], &c[3]) >= threshold) || - (gimp_rgba_distance (&c[2], &c[3]) >= threshold)) - { - /* Calc coordinates of center subsample */ + (gimp_rgba_distance (&c[0], &c[2]) >= threshold) || + (gimp_rgba_distance (&c[0], &c[3]) >= threshold) || + (gimp_rgba_distance (&c[1], &c[2]) >= threshold) || + (gimp_rgba_distance (&c[1], &c[3]) >= threshold) || + (gimp_rgba_distance (&c[2], &c[3]) >= threshold)) + { + /* Calc coordinates of center subsample */ - x2 = (x1 + x3) / 2; - y2 = (y1 + y3) / 2; + x2 = (x1 + x3) / 2; + y2 = (y1 + y3) / 2; - /* Render sub-blocks */ + /* Render sub-blocks */ - num_samples += gimp_render_sub_pixel (max_depth, depth + 1, block, - x, y, x1, y1, x2, y2, - threshold, sub_pixel_size, - &c[0], - render_func, render_data); + num_samples += gimp_render_sub_pixel (max_depth, depth + 1, block, + x, y, x1, y1, x2, y2, + threshold, sub_pixel_size, + &c[0], + render_func, render_data); - num_samples += gimp_render_sub_pixel (max_depth, depth + 1, block, - x, y, x2, y1, x3, y2, - threshold, sub_pixel_size, - &c[1], - render_func, render_data); + num_samples += gimp_render_sub_pixel (max_depth, depth + 1, block, + x, y, x2, y1, x3, y2, + threshold, sub_pixel_size, + &c[1], + render_func, render_data); - num_samples += gimp_render_sub_pixel (max_depth, depth + 1, block, - x, y, x1, y2, x2, y3, - threshold, sub_pixel_size, - &c[2], - render_func, render_data); + num_samples += gimp_render_sub_pixel (max_depth, depth + 1, block, + x, y, x1, y2, x2, y3, + threshold, sub_pixel_size, + &c[2], + render_func, render_data); - num_samples += gimp_render_sub_pixel (max_depth, depth + 1, block, - x, y, x2, y2, x3, y3, - threshold, sub_pixel_size, - &c[3], - render_func, render_data); - } + num_samples += gimp_render_sub_pixel (max_depth, depth + 1, block, + x, y, x2, y2, x3, y3, + threshold, sub_pixel_size, + &c[3], + render_func, render_data); + } } if (c[0].a == 0.0 || c[1].a == 0.0 || c[2].a == 0.0 || c[3].a == 0.0) @@ -232,17 +232,17 @@ gimp_render_sub_pixel (gint max_depth, gulong gimp_adaptive_supersample_area (gint x1, - gint y1, - gint x2, - gint y2, - gint max_depth, - gdouble threshold, - GimpRenderFunc render_func, - gpointer render_data, - GimpPutPixelFunc put_pixel_func, - gpointer put_pixel_data, - GimpProgressFunc progress_func, - gpointer progress_data) + gint y1, + gint x2, + gint y2, + gint max_depth, + gdouble threshold, + GimpRenderFunc render_func, + gpointer render_data, + GimpPutPixelFunc put_pixel_func, + gpointer put_pixel_data, + GimpProgressFunc progress_func, + gpointer progress_data) { gint x, y, width; /* Counters, width of region */ gint xt, xtt, yt; /* Temporary counters */ @@ -288,11 +288,11 @@ gimp_adaptive_supersample_area (gint x1, block[y] = g_new (GimpSampleType, sub_pixel_size + 1); /* Columns */ for (x = 0; x < (sub_pixel_size + 1); x++) - { - block[y][x].ready = FALSE; + { + block[y][x].ready = FALSE; - gimp_rgba_set (&block[y][x].color, 0.0, 0.0, 0.0, 0.0); - } + gimp_rgba_set (&block[y][x].color, 0.0, 0.0, 0.0, 0.0); + } } /* Render region */ @@ -304,59 +304,59 @@ gimp_adaptive_supersample_area (gint x1, /* Clear the bottom row */ for (xt = 0; xt < (sub_pixel_size * width + 1); xt++) - bot_row[xt].ready = FALSE; + bot_row[xt].ready = FALSE; /* Clear first column */ for (yt = 0; yt < (sub_pixel_size + 1); yt++) - block[yt][0].ready = FALSE; + block[yt][0].ready = FALSE; /* Render row */ for (x = x1; x <= x2; x++) - { - /* Initialize block by clearing all but first row/column */ + { + /* Initialize block by clearing all but first row/column */ - for (yt = 1; yt < (sub_pixel_size + 1); yt++) - for (xt = 1; xt < (sub_pixel_size + 1); xt++) - block[yt][xt].ready = FALSE; + for (yt = 1; yt < (sub_pixel_size + 1); yt++) + for (xt = 1; xt < (sub_pixel_size + 1); xt++) + block[yt][xt].ready = FALSE; - /* Copy samples from top row to block */ + /* Copy samples from top row to block */ - for (xtt = 0, xt = (x - x1) * sub_pixel_size; - xtt < (sub_pixel_size + 1); - xtt++, xt++) - block[0][xtt] = top_row[xt]; + for (xtt = 0, xt = (x - x1) * sub_pixel_size; + xtt < (sub_pixel_size + 1); + xtt++, xt++) + block[0][xtt] = top_row[xt]; - /* Render pixel on (x, y) */ + /* Render pixel on (x, y) */ - num_samples += gimp_render_sub_pixel (max_depth, 1, block, x, y, 0, 0, - sub_pixel_size, sub_pixel_size, - threshold, sub_pixel_size, - &color, - render_func, render_data); + num_samples += gimp_render_sub_pixel (max_depth, 1, block, x, y, 0, 0, + sub_pixel_size, sub_pixel_size, + threshold, sub_pixel_size, + &color, + render_func, render_data); - if (put_pixel_func) - (* put_pixel_func) (x, y, &color, put_pixel_data); + if (put_pixel_func) + (* put_pixel_func) (x, y, &color, put_pixel_data); - /* Copy block information to rows */ + /* Copy block information to rows */ - top_row[(x - x1 + 1) * sub_pixel_size] = block[0][sub_pixel_size]; + top_row[(x - x1 + 1) * sub_pixel_size] = block[0][sub_pixel_size]; - for (xtt = 0, xt = (x - x1) * sub_pixel_size; - xtt < (sub_pixel_size + 1); - xtt++, xt++) - bot_row[xt] = block[sub_pixel_size][xtt]; + for (xtt = 0, xt = (x - x1) * sub_pixel_size; + xtt < (sub_pixel_size + 1); + xtt++, xt++) + bot_row[xt] = block[sub_pixel_size][xtt]; - /* Swap first and last columns */ + /* Swap first and last columns */ - for (yt = 0; yt < (sub_pixel_size + 1); yt++) - { - tmp_sample = block[yt][0]; - block[yt][0] = block[yt][sub_pixel_size]; - block[yt][sub_pixel_size] = tmp_sample; - } - } + for (yt = 0; yt < (sub_pixel_size + 1); yt++) + { + tmp_sample = block[yt][0]; + block[yt][0] = block[yt][sub_pixel_size]; + block[yt][sub_pixel_size] = tmp_sample; + } + } /* Swap rows */ @@ -367,7 +367,7 @@ gimp_adaptive_supersample_area (gint x1, /* Call progress display function (if any) */ if (progress_func != NULL) - (* progress_func) (y1, y2, y, progress_data); + (* progress_func) (y1, y2, y, progress_data); } /* Free memory */ diff --git a/libgimpcolor/gimpbilinear.c b/libgimpcolor/gimpbilinear.c index 6aaab653ae..0fb07fcb0d 100644 --- a/libgimpcolor/gimpbilinear.c +++ b/libgimpcolor/gimpbilinear.c @@ -30,8 +30,8 @@ gdouble gimp_bilinear (gdouble x, - gdouble y, - gdouble *values) + gdouble y, + gdouble *values) { gdouble m0, m1; @@ -53,8 +53,8 @@ gimp_bilinear (gdouble x, guchar gimp_bilinear_8 (gdouble x, - gdouble y, - guchar *values) + gdouble y, + guchar *values) { gdouble m0, m1; @@ -76,8 +76,8 @@ gimp_bilinear_8 (gdouble x, guint16 gimp_bilinear_16 (gdouble x, - gdouble y, - guint16 *values) + gdouble y, + guint16 *values) { gdouble m0, m1; @@ -99,8 +99,8 @@ gimp_bilinear_16 (gdouble x, guint32 gimp_bilinear_32 (gdouble x, - gdouble y, - guint32 *values) + gdouble y, + guint32 *values) { gdouble m0, m1; @@ -122,8 +122,8 @@ gimp_bilinear_32 (gdouble x, GimpRGB gimp_bilinear_rgb (gdouble x, - gdouble y, - GimpRGB *values) + gdouble y, + GimpRGB *values) { gdouble m0, m1; gdouble ix, iy; @@ -168,8 +168,8 @@ gimp_bilinear_rgb (gdouble x, GimpRGB gimp_bilinear_rgba (gdouble x, - gdouble y, - GimpRGB *values) + gdouble y, + GimpRGB *values) { gdouble m0, m1; gdouble ix, iy; diff --git a/libgimpcolor/gimpcolorspace.c b/libgimpcolor/gimpcolorspace.c index 21841e1272..94d9fc1a85 100644 --- a/libgimpcolor/gimpcolorspace.c +++ b/libgimpcolor/gimpcolorspace.c @@ -52,7 +52,7 @@ **/ void gimp_rgb_to_hsv (const GimpRGB *rgb, - GimpHSV *hsv) + GimpHSV *hsv) { gdouble max, min, delta; @@ -72,8 +72,8 @@ gimp_rgb_to_hsv (const GimpRGB *rgb, if (rgb->r == max) { hsv->h = (rgb->g - rgb->b) / delta; - if (hsv->h < 0.0) - hsv->h += 6.0; + if (hsv->h < 0.0) + hsv->h += 6.0; } else if (rgb->g == max) { @@ -104,7 +104,7 @@ gimp_rgb_to_hsv (const GimpRGB *rgb, **/ void gimp_hsv_to_rgb (const GimpHSV *hsv, - GimpRGB *rgb) + GimpRGB *rgb) { gint i; gdouble f, w, q, t; @@ -211,7 +211,7 @@ gimp_rgb_to_hsl (const GimpRGB *rgb, delta = max - min; if (delta == 0.0) - delta = 1.0; + delta = 1.0; if (rgb->r == max) { @@ -269,7 +269,7 @@ gimp_hsl_value (gdouble n1, **/ void gimp_hsl_to_rgb (const GimpHSL *hsl, - GimpRGB *rgb) + GimpRGB *rgb) { g_return_if_fail (hsl != NULL); g_return_if_fail (rgb != NULL); @@ -416,9 +416,9 @@ gimp_cmyk_to_rgb (const GimpCMYK *cmyk, **/ void gimp_rgb_to_hwb (const GimpRGB *rgb, - gdouble *hue, - gdouble *whiteness, - gdouble *blackness) + gdouble *hue, + gdouble *whiteness, + gdouble *blackness) { /* RGB are each on [0, 1]. W and B are returned on [0, 1] and H is */ /* returned on [0, 6]. Exception: H is returned UNDEFINED if W == 1 - B. */ @@ -460,9 +460,9 @@ gimp_rgb_to_hwb (const GimpRGB *rgb, **/ void gimp_hwb_to_rgb (gdouble hue, - gdouble whiteness, - gdouble blackness, - GimpRGB *rgb) + gdouble whiteness, + gdouble blackness, + GimpRGB *rgb) { /* H is given on [0, 6] or UNDEFINED. whiteness and * blackness are given on [0, 1]. @@ -487,7 +487,7 @@ gimp_hwb_to_rgb (gdouble hue, f = h - i; if (i & 1) - f = 1.0 - f; /* if i is odd */ + f = 1.0 - f; /* if i is odd */ n = w + f * (v - w); /* linear interpolation between w and v */ @@ -530,8 +530,8 @@ gimp_hwb_to_rgb (gdouble hue, **/ void gimp_rgb_to_hsv_int (gint *red, - gint *green, - gint *blue) + gint *green, + gint *blue) { gdouble r, g, b; gdouble h, s, v; @@ -565,16 +565,16 @@ gimp_rgb_to_hsv_int (gint *red, else { if (r == v) - h = 60.0 * (g - b) / delta; + h = 60.0 * (g - b) / delta; else if (g == v) - h = 120 + 60.0 * (b - r) / delta; + h = 120 + 60.0 * (b - r) / delta; else - h = 240 + 60.0 * (r - g) / delta; + h = 240 + 60.0 * (r - g) / delta; if (h < 0.0) - h += 360.0; + h += 360.0; if (h > 360.0) - h -= 360.0; + h -= 360.0; } *red = ROUND (h); @@ -596,8 +596,8 @@ gimp_rgb_to_hsv_int (gint *red, **/ void gimp_hsv_to_rgb_int (gint *hue, - gint *saturation, - gint *value) + gint *saturation, + gint *value) { gdouble h, s, v, h_temp; gdouble f, p, q, t; @@ -628,43 +628,43 @@ gimp_hsv_to_rgb_int (gint *hue, t = v * (1.0 - (s * (1.0 - f))); switch (i) - { - case 0: - *hue = ROUND (v * 255.0); - *saturation = ROUND (t * 255.0); - *value = ROUND (p * 255.0); - break; + { + case 0: + *hue = ROUND (v * 255.0); + *saturation = ROUND (t * 255.0); + *value = ROUND (p * 255.0); + break; - case 1: - *hue = ROUND (q * 255.0); - *saturation = ROUND (v * 255.0); - *value = ROUND (p * 255.0); - break; + case 1: + *hue = ROUND (q * 255.0); + *saturation = ROUND (v * 255.0); + *value = ROUND (p * 255.0); + break; - case 2: - *hue = ROUND (p * 255.0); - *saturation = ROUND (v * 255.0); - *value = ROUND (t * 255.0); - break; + case 2: + *hue = ROUND (p * 255.0); + *saturation = ROUND (v * 255.0); + *value = ROUND (t * 255.0); + break; - case 3: - *hue = ROUND (p * 255.0); - *saturation = ROUND (q * 255.0); - *value = ROUND (v * 255.0); - break; + case 3: + *hue = ROUND (p * 255.0); + *saturation = ROUND (q * 255.0); + *value = ROUND (v * 255.0); + break; - case 4: - *hue = ROUND (t * 255.0); - *saturation = ROUND (p * 255.0); - *value = ROUND (v * 255.0); - break; + case 4: + *hue = ROUND (t * 255.0); + *saturation = ROUND (p * 255.0); + *value = ROUND (v * 255.0); + break; - case 5: - *hue = ROUND (v * 255.0); - *saturation = ROUND (p * 255.0); - *value = ROUND (q * 255.0); - break; - } + case 5: + *hue = ROUND (v * 255.0); + *saturation = ROUND (p * 255.0); + *value = ROUND (q * 255.0); + break; + } } } @@ -683,8 +683,8 @@ gimp_hsv_to_rgb_int (gint *hue, **/ void gimp_rgb_to_hsl_int (gint *red, - gint *green, - gint *blue) + gint *green, + gint *blue) { gint r, g, b; gdouble h, s, l; @@ -718,23 +718,23 @@ gimp_rgb_to_hsl_int (gint *red, delta = (max - min); if (l < 128) - s = 255 * (gdouble) delta / (gdouble) (max + min); + s = 255 * (gdouble) delta / (gdouble) (max + min); else - s = 255 * (gdouble) delta / (gdouble) (511 - max - min); + s = 255 * (gdouble) delta / (gdouble) (511 - max - min); if (r == max) - h = (g - b) / (gdouble) delta; + h = (g - b) / (gdouble) delta; else if (g == max) - h = 2 + (b - r) / (gdouble) delta; + h = 2 + (b - r) / (gdouble) delta; else - h = 4 + (r - g) / (gdouble) delta; + h = 4 + (r - g) / (gdouble) delta; h = h * 42.5; if (h < 0) - h += 255; + h += 255; else if (h > 255) - h -= 255; + h -= 255; } *red = ROUND (h); @@ -755,8 +755,8 @@ gimp_rgb_to_hsl_int (gint *red, **/ gint gimp_rgb_to_l_int (gint red, - gint green, - gint blue) + gint green, + gint blue) { gint min, max; @@ -776,8 +776,8 @@ gimp_rgb_to_l_int (gint red, static gint gimp_hsl_value_int (gdouble n1, - gdouble n2, - gdouble hue) + gdouble n2, + gdouble hue) { gdouble value; @@ -812,8 +812,8 @@ gimp_hsl_value_int (gdouble n1, **/ void gimp_hsl_to_rgb_int (gint *hue, - gint *saturation, - gint *lightness) + gint *saturation, + gint *lightness) { gdouble h, s, l; @@ -833,9 +833,9 @@ gimp_hsl_to_rgb_int (gint *hue, gdouble m1, m2; if (l < 128) - m2 = (l * (255 + s)) / 65025.0; + m2 = (l * (255 + s)) / 65025.0; else - m2 = (l + s - (l * s) / 255.0) / 255.0; + m2 = (l + s - (l * s) / 255.0) / 255.0; m1 = (l / 127.5) - m2; @@ -941,9 +941,9 @@ gimp_cmyk_to_rgb_int (gint *cyan, void gimp_rgb_to_hsv4 (guchar *rgb, - gdouble *hue, - gdouble *saturation, - gdouble *value) + gdouble *hue, + gdouble *saturation, + gdouble *value) { gdouble red, green, blue; gdouble h, s, v; @@ -981,21 +981,21 @@ gimp_rgb_to_hsv4 (guchar *rgb, delta = max - min; if (delta == 0.0) - delta = 1.0; + delta = 1.0; if (red == max) - h = (green - blue) / delta; + h = (green - blue) / delta; else if (green == max) - h = 2 + (blue - red) / delta; + h = 2 + (blue - red) / delta; else if (blue == max) - h = 4 + (red - green) / delta; + h = 4 + (red - green) / delta; h /= 6.0; if (h < 0.0) - h += 1.0; + h += 1.0; else if (h > 1.0) - h -= 1.0; + h -= 1.0; } *hue = h; @@ -1014,9 +1014,9 @@ gimp_rgb_to_hsv4 (guchar *rgb, void gimp_hsv_to_rgb4 (guchar *rgb, - gdouble hue, - gdouble saturation, - gdouble value) + gdouble hue, + gdouble saturation, + gdouble value) { gdouble h, s, v; gdouble f, p, q, t; @@ -1034,7 +1034,7 @@ gimp_hsv_to_rgb4 (guchar *rgb, v = value; if (h == 6.0) - h = 0.0; + h = 0.0; f = h - (gint) h; p = v * (1.0 - s); @@ -1042,43 +1042,43 @@ gimp_hsv_to_rgb4 (guchar *rgb, t = v * (1.0 - s * (1.0 - f)); switch ((int) h) - { - case 0: - hue = v; - saturation = t; - value = p; - break; + { + case 0: + hue = v; + saturation = t; + value = p; + break; - case 1: - hue = q; - saturation = v; - value = p; - break; + case 1: + hue = q; + saturation = v; + value = p; + break; - case 2: - hue = p; - saturation = v; - value = t; - break; + case 2: + hue = p; + saturation = v; + value = t; + break; - case 3: - hue = p; - saturation = q; - value = v; - break; + case 3: + hue = p; + saturation = q; + value = v; + break; - case 4: - hue = t; - saturation = p; - value = v; - break; + case 4: + hue = t; + saturation = p; + value = v; + break; - case 5: - hue = v; - saturation = p; - value = q; - break; - } + case 5: + hue = v; + saturation = p; + value = q; + break; + } } rgb[0] = ROUND (hue * 255.0); diff --git a/libgimpcolor/gimpcolorspace.h b/libgimpcolor/gimpcolorspace.h index 6784327e44..ea67bdb3c0 100644 --- a/libgimpcolor/gimpcolorspace.h +++ b/libgimpcolor/gimpcolorspace.h @@ -31,38 +31,38 @@ G_BEGIN_DECLS /* GimpRGB function */ void gimp_rgb_to_hsv (const GimpRGB *rgb, - GimpHSV *hsv); + GimpHSV *hsv); void gimp_rgb_to_hsl (const GimpRGB *rgb, - GimpHSL *hsl); + GimpHSL *hsl); void gimp_rgb_to_cmyk (const GimpRGB *rgb, gdouble pullout, GimpCMYK *cmyk); void gimp_hsv_to_rgb (const GimpHSV *hsv, - GimpRGB *rgb); + GimpRGB *rgb); void gimp_hsl_to_rgb (const GimpHSL *hsl, - GimpRGB *rgb); + GimpRGB *rgb); void gimp_cmyk_to_rgb (const GimpCMYK *cmyk, GimpRGB *rgb); void gimp_rgb_to_hwb (const GimpRGB *rgb, - gdouble *hue, - gdouble *whiteness, - gdouble *blackness); + gdouble *hue, + gdouble *whiteness, + gdouble *blackness); void gimp_hwb_to_rgb (gdouble hue, - gdouble whiteness, - gdouble blackness, - GimpRGB *rgb); + gdouble whiteness, + gdouble blackness, + GimpRGB *rgb); /* gint functions */ -void gimp_rgb_to_hsv_int (gint *red /* returns hue */, - gint *green /* returns saturation */, - gint *blue /* returns value */); -void gimp_hsv_to_rgb_int (gint *hue /* returns red */, - gint *saturation /* returns green */, - gint *value /* returns blue */); +void gimp_rgb_to_hsv_int (gint *red /* returns hue */, + gint *green /* returns saturation */, + gint *blue /* returns value */); +void gimp_hsv_to_rgb_int (gint *hue /* returns red */, + gint *saturation /* returns green */, + gint *value /* returns blue */); void gimp_rgb_to_cmyk_int (gint *red /* returns cyan */, gint *green /* returns magenta */, @@ -73,15 +73,15 @@ void gimp_cmyk_to_rgb_int (gint *cyan /* returns red */, gint *yellow /* returns blue */, gint *black /* not changed */); -void gimp_rgb_to_hsl_int (gint *red /* returns hue */, - gint *green /* returns saturation */, - gint *blue /* returns lightness */); -gint gimp_rgb_to_l_int (gint red, - gint green, - gint blue); -void gimp_hsl_to_rgb_int (gint *hue /* returns red */, - gint *saturation /* returns green */, - gint *lightness /* returns blue */); +void gimp_rgb_to_hsl_int (gint *red /* returns hue */, + gint *green /* returns saturation */, + gint *blue /* returns lightness */); +gint gimp_rgb_to_l_int (gint red, + gint green, + gint blue); +void gimp_hsl_to_rgb_int (gint *hue /* returns red */, + gint *saturation /* returns green */, + gint *lightness /* returns blue */); /* gdouble functions */ @@ -91,9 +91,9 @@ void gimp_rgb_to_hsv4 (guchar *rgb, gdouble *saturation, gdouble *value); void gimp_hsv_to_rgb4 (guchar *rgb, - gdouble hue, - gdouble saturation, - gdouble value); + gdouble hue, + gdouble saturation, + gdouble value); G_END_DECLS diff --git a/libgimpcolor/gimphsv.c b/libgimpcolor/gimphsv.c index 4cf81ff8de..8e8e7688f1 100644 --- a/libgimpcolor/gimphsv.c +++ b/libgimpcolor/gimphsv.c @@ -30,9 +30,9 @@ void gimp_hsv_set (GimpHSV *hsv, - gdouble h, - gdouble s, - gdouble v) + gdouble h, + gdouble s, + gdouble v) { g_return_if_fail (hsv != NULL); @@ -58,10 +58,10 @@ gimp_hsv_clamp (GimpHSV *hsv) void gimp_hsva_set (GimpHSV *hsva, - gdouble h, - gdouble s, - gdouble v, - gdouble a) + gdouble h, + gdouble s, + gdouble v, + gdouble a) { g_return_if_fail (hsva != NULL); diff --git a/libgimpcolor/gimphsv.h b/libgimpcolor/gimphsv.h index a05bfebfe8..c0ce0d9d0e 100644 --- a/libgimpcolor/gimphsv.h +++ b/libgimpcolor/gimphsv.h @@ -26,16 +26,16 @@ G_BEGIN_DECLS void gimp_hsv_set (GimpHSV *hsv, - gdouble hue, - gdouble saturation, - gdouble value); + gdouble hue, + gdouble saturation, + gdouble value); void gimp_hsv_clamp (GimpHSV *hsv); void gimp_hsva_set (GimpHSV *hsva, - gdouble hue, - gdouble saturation, - gdouble value, - gdouble alpha); + gdouble hue, + gdouble saturation, + gdouble value, + gdouble alpha); G_END_DECLS diff --git a/libgimpcolor/gimprgb.c b/libgimpcolor/gimprgb.c index e598e3448c..3283e5eb88 100644 --- a/libgimpcolor/gimprgb.c +++ b/libgimpcolor/gimprgb.c @@ -95,9 +95,9 @@ gimp_rgb_copy (const GimpRGB *rgb) **/ void gimp_rgb_set (GimpRGB *rgb, - gdouble r, - gdouble g, - gdouble b) + gdouble r, + gdouble g, + gdouble b) { g_return_if_fail (rgb != NULL); @@ -115,7 +115,7 @@ gimp_rgb_set (GimpRGB *rgb, **/ void gimp_rgb_set_alpha (GimpRGB *rgb, - gdouble a) + gdouble a) { g_return_if_fail (rgb != NULL); @@ -134,9 +134,9 @@ gimp_rgb_set_alpha (GimpRGB *rgb, **/ void gimp_rgb_set_uchar (GimpRGB *rgb, - guchar r, - guchar g, - guchar b) + guchar r, + guchar g, + guchar b) { g_return_if_fail (rgb != NULL); @@ -147,9 +147,9 @@ gimp_rgb_set_uchar (GimpRGB *rgb, void gimp_rgb_get_uchar (const GimpRGB *rgb, - guchar *r, - guchar *g, - guchar *b) + guchar *r, + guchar *g, + guchar *b) { g_return_if_fail (rgb != NULL); @@ -160,7 +160,7 @@ gimp_rgb_get_uchar (const GimpRGB *rgb, void gimp_rgb_add (GimpRGB *rgb1, - const GimpRGB *rgb2) + const GimpRGB *rgb2) { g_return_if_fail (rgb1 != NULL); g_return_if_fail (rgb2 != NULL); @@ -172,7 +172,7 @@ gimp_rgb_add (GimpRGB *rgb1, void gimp_rgb_subtract (GimpRGB *rgb1, - const GimpRGB *rgb2) + const GimpRGB *rgb2) { g_return_if_fail (rgb1 != NULL); g_return_if_fail (rgb2 != NULL); @@ -184,7 +184,7 @@ gimp_rgb_subtract (GimpRGB *rgb1, void gimp_rgb_multiply (GimpRGB *rgb, - gdouble factor) + gdouble factor) { g_return_if_fail (rgb != NULL); @@ -195,14 +195,14 @@ gimp_rgb_multiply (GimpRGB *rgb, gdouble gimp_rgb_distance (const GimpRGB *rgb1, - const GimpRGB *rgb2) + const GimpRGB *rgb2) { g_return_val_if_fail (rgb1 != NULL, 0.0); g_return_val_if_fail (rgb2 != NULL, 0.0); return (fabs (rgb1->r - rgb2->r) + - fabs (rgb1->g - rgb2->g) + - fabs (rgb1->b - rgb2->b)); + fabs (rgb1->g - rgb2->g) + + fabs (rgb1->b - rgb2->b)); } gdouble @@ -238,7 +238,7 @@ gimp_rgb_clamp (GimpRGB *rgb) void gimp_rgb_gamma (GimpRGB *rgb, - gdouble gamma) + gdouble gamma) { gdouble ig; @@ -328,8 +328,8 @@ gimp_rgb_intensity_uchar (const GimpRGB *rgb) void gimp_rgb_composite (GimpRGB *color1, - const GimpRGB *color2, - GimpRGBCompositeMode mode) + const GimpRGB *color2, + GimpRGBCompositeMode mode) { gdouble factor; @@ -344,29 +344,29 @@ gimp_rgb_composite (GimpRGB *color1, case GIMP_RGB_COMPOSITE_NORMAL: /* put color2 on top of color1 */ if (color2->a == 1.0) - { - *color1 = *color2; - } + { + *color1 = *color2; + } else - { - factor = color1->a * (1.0 - color2->a); - color1->r = color1->r * factor + color2->r * color2->a; - color1->g = color1->g * factor + color2->g * color2->a; - color1->b = color1->b * factor + color2->b * color2->a; - color1->a = factor + color2->a; - } + { + factor = color1->a * (1.0 - color2->a); + color1->r = color1->r * factor + color2->r * color2->a; + color1->g = color1->g * factor + color2->g * color2->a; + color1->b = color1->b * factor + color2->b * color2->a; + color1->a = factor + color2->a; + } break; case GIMP_RGB_COMPOSITE_BEHIND: /* put color2 below color1 */ if (color1->a < 1.0) - { - factor = color2->a * (1.0 - color1->a); - color1->r = color2->r * factor + color1->r * color1->a; - color1->g = color2->g * factor + color1->g * color1->a; - color1->b = color2->b * factor + color1->b * color1->a; - color1->a = factor + color1->a; - } + { + factor = color2->a * (1.0 - color1->a); + color1->r = color2->r * factor + color1->r * color1->a; + color1->g = color2->g * factor + color1->g * color1->a; + color1->b = color2->b * factor + color1->b * color1->a; + color1->a = factor + color1->a; + } break; } } @@ -387,10 +387,10 @@ gimp_rgb_composite (GimpRGB *color1, **/ void gimp_rgba_set (GimpRGB *rgba, - gdouble r, - gdouble g, - gdouble b, - gdouble a) + gdouble r, + gdouble g, + gdouble b, + gdouble a) { g_return_if_fail (rgba != NULL); @@ -413,10 +413,10 @@ gimp_rgba_set (GimpRGB *rgba, **/ void gimp_rgba_set_uchar (GimpRGB *rgba, - guchar r, - guchar g, - guchar b, - guchar a) + guchar r, + guchar g, + guchar b, + guchar a) { g_return_if_fail (rgba != NULL); @@ -428,10 +428,10 @@ gimp_rgba_set_uchar (GimpRGB *rgba, void gimp_rgba_get_uchar (const GimpRGB *rgba, - guchar *r, - guchar *g, - guchar *b, - guchar *a) + guchar *r, + guchar *g, + guchar *b, + guchar *a) { g_return_if_fail (rgba != NULL); @@ -443,7 +443,7 @@ gimp_rgba_get_uchar (const GimpRGB *rgba, void gimp_rgba_add (GimpRGB *rgba1, - const GimpRGB *rgba2) + const GimpRGB *rgba2) { g_return_if_fail (rgba1 != NULL); g_return_if_fail (rgba2 != NULL); @@ -456,7 +456,7 @@ gimp_rgba_add (GimpRGB *rgba1, void gimp_rgba_subtract (GimpRGB *rgba1, - const GimpRGB *rgba2) + const GimpRGB *rgba2) { g_return_if_fail (rgba1 != NULL); g_return_if_fail (rgba2 != NULL); @@ -469,7 +469,7 @@ gimp_rgba_subtract (GimpRGB *rgba1, void gimp_rgba_multiply (GimpRGB *rgba, - gdouble factor) + gdouble factor) { g_return_if_fail (rgba != NULL); @@ -481,7 +481,7 @@ gimp_rgba_multiply (GimpRGB *rgba, gdouble gimp_rgba_distance (const GimpRGB *rgba1, - const GimpRGB *rgba2) + const GimpRGB *rgba2) { g_return_val_if_fail (rgba1 != NULL, 0.0); g_return_val_if_fail (rgba2 != NULL, 0.0); diff --git a/libgimpcolor/gimprgb.h b/libgimpcolor/gimprgb.h index 9235ddc661..d9dc972745 100644 --- a/libgimpcolor/gimprgb.h +++ b/libgimpcolor/gimprgb.h @@ -106,7 +106,7 @@ gdouble gimp_rgb_min (const GimpRGB *rgb); void gimp_rgb_clamp (GimpRGB *rgb); void gimp_rgb_gamma (GimpRGB *rgb, - gdouble gamma); + gdouble gamma); gdouble gimp_rgb_luminance (const GimpRGB *rgb); guchar gimp_rgb_luminance_uchar (const GimpRGB *rgb); @@ -154,7 +154,7 @@ void gimp_rgba_multiply (GimpRGB *rgba, gdouble factor); gdouble gimp_rgba_distance (const GimpRGB *rgba1, - const GimpRGB *rgba2); + const GimpRGB *rgba2); @@ -173,8 +173,8 @@ gdouble gimp_rgba_distance (const GimpRGB *rgba1, #define GIMP_RGB_LUMINANCE_BLUE (0.0722) #define GIMP_RGB_LUMINANCE(r,g,b) ((r) * GIMP_RGB_LUMINANCE_RED + \ - (g) * GIMP_RGB_LUMINANCE_GREEN + \ - (b) * GIMP_RGB_LUMINANCE_BLUE) + (g) * GIMP_RGB_LUMINANCE_GREEN + \ + (b) * GIMP_RGB_LUMINANCE_BLUE) #ifndef GIMP_DISABLE_DEPRECATED @@ -193,8 +193,8 @@ gdouble gimp_rgba_distance (const GimpRGB *rgba1, #define GIMP_RGB_INTENSITY_BLUE (0.11) #define GIMP_RGB_INTENSITY(r,g,b) ((r) * GIMP_RGB_INTENSITY_RED + \ - (g) * GIMP_RGB_INTENSITY_GREEN + \ - (b) * GIMP_RGB_INTENSITY_BLUE) + (g) * GIMP_RGB_INTENSITY_GREEN + \ + (b) * GIMP_RGB_INTENSITY_BLUE) #endif diff --git a/libgimpconfig/gimpconfig-deserialize.c b/libgimpconfig/gimpconfig-deserialize.c index 06127c5c10..3f62c0dad4 100644 --- a/libgimpconfig/gimpconfig-deserialize.c +++ b/libgimpconfig/gimpconfig-deserialize.c @@ -121,8 +121,8 @@ gimp_config_deserialize_properties (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); @@ -486,18 +486,18 @@ gimp_config_deserialize_enum (GValue *value, g_scanner_get_next_token (scanner); enum_value = g_enum_get_value_by_nick (enum_class, - scanner->value.v_identifier); + scanner->value.v_identifier); if (!enum_value) - enum_value = g_enum_get_value_by_name (enum_class, - scanner->value.v_identifier); + enum_value = g_enum_get_value_by_name (enum_class, + scanner->value.v_identifier); if (!enum_value) - { - g_scanner_error (scanner, - _("invalid value '%s' for token %s"), - scanner->value.v_identifier, prop_spec->name); - return G_TOKEN_NONE; - } + { + g_scanner_error (scanner, + _("invalid value '%s' for token %s"), + scanner->value.v_identifier, prop_spec->name); + return G_TOKEN_NONE; + } break; case G_TOKEN_INT: @@ -507,12 +507,12 @@ gimp_config_deserialize_enum (GValue *value, (gint) scanner->value.v_int64); if (!enum_value) - { - g_scanner_error (scanner, - _("invalid value '%ld' for token %s"), - (glong) scanner->value.v_int64, prop_spec->name); - return G_TOKEN_NONE; - } + { + g_scanner_error (scanner, + _("invalid value '%ld' for token %s"), + (glong) scanner->value.v_int64, prop_spec->name); + return G_TOKEN_NONE; + } break; default: diff --git a/libgimpconfig/gimpconfig-iface.c b/libgimpconfig/gimpconfig-iface.c index 5942639bb4..7cef7d11bb 100644 --- a/libgimpconfig/gimpconfig-iface.c +++ b/libgimpconfig/gimpconfig-iface.c @@ -69,8 +69,8 @@ gimp_config_interface_get_type (void) static const GTypeInfo config_iface_info = { sizeof (GimpConfigInterface), - (GBaseInitFunc) gimp_config_iface_base_init, - (GBaseFinalizeFunc) NULL, + (GBaseInitFunc) gimp_config_iface_base_init, + (GBaseFinalizeFunc) NULL, }; config_iface_type = g_type_register_static (G_TYPE_INTERFACE, @@ -105,7 +105,7 @@ gimp_config_iface_base_init (GimpConfigInterface *config_iface) static gboolean gimp_config_iface_serialize (GimpConfig *config, - GimpConfigWriter *writer, + GimpConfigWriter *writer, gpointer data) { return gimp_config_serialize_properties (config, writer); @@ -255,11 +255,11 @@ gimp_config_iface_reset (GimpConfig *config) **/ gboolean gimp_config_serialize_to_file (GimpConfig *config, - const gchar *filename, - const gchar *header, - const gchar *footer, - gpointer data, - GError **error) + const gchar *filename, + const gchar *header, + const gchar *footer, + gpointer data, + GError **error) { GimpConfigWriter *writer; @@ -321,7 +321,7 @@ gimp_config_serialize_to_fd (GimpConfig *config, **/ gchar * gimp_config_serialize_to_string (GimpConfig *config, - gpointer data) + gpointer data) { GimpConfigWriter *writer; GString *str; @@ -356,9 +356,9 @@ gimp_config_serialize_to_string (GimpConfig *config, **/ gboolean gimp_config_deserialize_file (GimpConfig *config, - const gchar *filename, - gpointer data, - GError **error) + const gchar *filename, + gpointer data, + GError **error) { GScanner *scanner; gboolean success; @@ -402,7 +402,7 @@ gboolean gimp_config_deserialize_string (GimpConfig *config, const gchar *text, gint text_len, - gpointer data, + gpointer data, GError **error) { GScanner *scanner; diff --git a/libgimpconfig/gimpconfig-iface.h b/libgimpconfig/gimpconfig-iface.h index da977785a8..2fc5d7ceeb 100644 --- a/libgimpconfig/gimpconfig-iface.h +++ b/libgimpconfig/gimpconfig-iface.h @@ -77,7 +77,7 @@ gboolean gimp_config_serialize_to_fd (GimpConfig *config, gint fd, gpointer data); gchar * gimp_config_serialize_to_string (GimpConfig *config, - gpointer data); + gpointer data); gboolean gimp_config_deserialize_file (GimpConfig *config, const gchar *filename, gpointer data, diff --git a/libgimpconfig/gimpconfig-path.c b/libgimpconfig/gimpconfig-path.c index 8681c817d4..1e1e613df0 100644 --- a/libgimpconfig/gimpconfig-path.c +++ b/libgimpconfig/gimpconfig-path.c @@ -329,10 +329,10 @@ gimp_config_path_expand_only (const gchar *path, while (*p) { if (*p == '~' && home) - { + { length += strlen (home); p += 1; - } + } else if ((token = gimp_config_path_extract_token (&p)) != NULL) { for (i = 0; i < n_substs; i++) @@ -352,7 +352,7 @@ gimp_config_path_expand_only (const gchar *path, else if (strcmp (token, "gimp_data_dir") == 0) s = gimp_data_directory (); else if (strcmp (token, "gimp_plug_in_dir") == 0 || - strcmp (token, "gimp_plugin_dir") == 0) + strcmp (token, "gimp_plugin_dir") == 0) s = gimp_plug_in_directory (); else if (strcmp (token, "gimp_sysconf_dir") == 0) s = gimp_sysconf_directory (); @@ -389,10 +389,10 @@ gimp_config_path_expand_only (const gchar *path, n_substs++; } else - { + { length += g_utf8_skip[(const guchar) *p]; p = g_utf8_next_char (p); - } + } } if (n_substs == 0) @@ -406,12 +406,12 @@ gimp_config_path_expand_only (const gchar *path, while (*p) { if (*p == '~' && home) - { - *n = '\0'; - strcat (n, home); - n += strlen (home); - p += 1; - } + { + *n = '\0'; + strcat (n, home); + n += strlen (home); + p += 1; + } else if ((token = gimp_config_path_extract_token (&p)) != NULL) { for (i = 0; i < n_substs; i++) @@ -429,11 +429,11 @@ gimp_config_path_expand_only (const gchar *path, } g_free (token); - } + } else - { - *n++ = *p++; - } + { + *n++ = *p++; + } } *n = '\0'; diff --git a/libgimpconfig/gimpconfig-serialize.c b/libgimpconfig/gimpconfig-serialize.c index 4b8be30232..cf7bf381f8 100644 --- a/libgimpconfig/gimpconfig-serialize.c +++ b/libgimpconfig/gimpconfig-serialize.c @@ -253,19 +253,19 @@ gimp_config_serialize_property (GimpConfig *config, } else if (! G_VALUE_HOLDS_OBJECT (&value)) { - GString *str = g_string_new (NULL); + GString *str = g_string_new (NULL); success = gimp_config_serialize_value (&value, str, TRUE); - if (success) + if (success) { gimp_config_writer_open (writer, param_spec->name); gimp_config_writer_print (writer, str->str, str->len); gimp_config_writer_close (writer); } - g_string_free (str, TRUE); - } + g_string_free (str, TRUE); + } if (! success) { @@ -395,7 +395,7 @@ gimp_config_serialize_value (const GValue *value, G_ASCII_DTOSTR_BUF_SIZE, "%f", trafo->coeff[i][j]); g_string_append_printf (str, "(matrix %s %s %s %s)", - buf[0], buf[1], buf[2], buf[3]); + buf[0], buf[1], buf[2], buf[3]); return TRUE; } @@ -416,7 +416,7 @@ gimp_config_serialize_value (const GValue *value, g_string_append (str, " "); if (! gimp_config_serialize_value (g_value_array_get_nth (array, - i), + i), str, TRUE)) return FALSE; } diff --git a/libgimpconfig/gimpconfig-serialize.h b/libgimpconfig/gimpconfig-serialize.h index 6bad45a971..5f62417dc0 100644 --- a/libgimpconfig/gimpconfig-serialize.h +++ b/libgimpconfig/gimpconfig-serialize.h @@ -29,13 +29,13 @@ G_BEGIN_DECLS gboolean gimp_config_serialize_properties (GimpConfig *config, - GimpConfigWriter *writer); + GimpConfigWriter *writer); gboolean gimp_config_serialize_changed_properties (GimpConfig *config, - GimpConfigWriter *writer); + GimpConfigWriter *writer); gboolean gimp_config_serialize_property (GimpConfig *config, - GParamSpec *param_spec, - GimpConfigWriter *writer); + GParamSpec *param_spec, + GimpConfigWriter *writer); gboolean gimp_config_serialize_value (const GValue *value, GString *str, gboolean escaped); diff --git a/libgimpconfig/gimpconfigwriter.c b/libgimpconfig/gimpconfigwriter.c index 39cd698571..4ec8340dc3 100644 --- a/libgimpconfig/gimpconfigwriter.c +++ b/libgimpconfig/gimpconfigwriter.c @@ -75,7 +75,7 @@ gimp_config_writer_flush (GimpConfigWriter *writer) { if (write (writer->fd, writer->buffer->str, writer->buffer->len) < 0) g_set_error (&writer->error, GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_WRITE, - g_strerror (errno)); + g_strerror (errno)); g_string_truncate (writer->buffer, 0); } @@ -112,9 +112,9 @@ gimp_config_writer_newline (GimpConfigWriter *writer) **/ GimpConfigWriter * gimp_config_writer_new_file (const gchar *filename, - gboolean atomic, - const gchar *header, - GError **error) + gboolean atomic, + const gchar *header, + GError **error) { GimpConfigWriter *writer; gchar *tmpname = NULL; @@ -130,25 +130,25 @@ gimp_config_writer_new_file (const gchar *filename, fd = g_mkstemp (tmpname); if (fd == -1) - { - g_set_error (error, GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_WRITE, - _("Could not create temporary file for '%s': %s"), - gimp_filename_to_utf8 (filename), g_strerror (errno)); - g_free (tmpname); - return NULL; - } + { + g_set_error (error, GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_WRITE, + _("Could not create temporary file for '%s': %s"), + gimp_filename_to_utf8 (filename), g_strerror (errno)); + g_free (tmpname); + return NULL; + } } else { fd = g_creat (filename, 0644); if (fd == -1) - { - g_set_error (error, GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_WRITE, - _("Could not open '%s' for writing: %s"), - gimp_filename_to_utf8 (filename), g_strerror (errno)); - return NULL; - } + { + g_set_error (error, GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_WRITE, + _("Could not open '%s' for writing: %s"), + gimp_filename_to_utf8 (filename), g_strerror (errno)); + return NULL; + } } writer = g_new0 (GimpConfigWriter, 1); @@ -265,7 +265,7 @@ gimp_config_writer_comment_mode (GimpConfigWriter *writer, **/ void gimp_config_writer_open (GimpConfigWriter *writer, - const gchar *name) + const gchar *name) { g_return_if_fail (writer != NULL); g_return_if_fail (name != NULL); @@ -297,8 +297,8 @@ gimp_config_writer_open (GimpConfigWriter *writer, **/ void gimp_config_writer_print (GimpConfigWriter *writer, - const gchar *string, - gint len) + const gchar *string, + gint len) { g_return_if_fail (writer != NULL); g_return_if_fail (len == 0 || string != NULL); @@ -328,8 +328,8 @@ gimp_config_writer_print (GimpConfigWriter *writer, **/ void gimp_config_writer_printf (GimpConfigWriter *writer, - const gchar *format, - ...) + const gchar *format, + ...) { gchar *buffer; va_list args; @@ -506,8 +506,8 @@ gimp_config_writer_close (GimpConfigWriter *writer) **/ gboolean gimp_config_writer_finish (GimpConfigWriter *writer, - const gchar *footer, - GError **error) + const gchar *footer, + GError **error) { gboolean success = TRUE; @@ -521,7 +521,7 @@ gimp_config_writer_finish (GimpConfigWriter *writer, else { while (writer->depth) - gimp_config_writer_close (writer); + gimp_config_writer_close (writer); } if (footer) @@ -582,7 +582,7 @@ gimp_config_writer_linefeed (GimpConfigWriter *writer) **/ void gimp_config_writer_comment (GimpConfigWriter *writer, - const gchar *comment) + const gchar *comment) { const gchar *s; gboolean comment_mode; @@ -640,7 +640,7 @@ gimp_config_writer_comment (GimpConfigWriter *writer, static gboolean gimp_config_writer_close_file (GimpConfigWriter *writer, - GError **error) + GError **error) { g_return_val_if_fail (writer->fd != 0, FALSE); @@ -652,7 +652,7 @@ gimp_config_writer_close_file (GimpConfigWriter *writer, close (writer->fd); if (writer->tmpname) - g_unlink (writer->tmpname); + g_unlink (writer->tmpname); return TRUE; } @@ -660,33 +660,33 @@ gimp_config_writer_close_file (GimpConfigWriter *writer, if (close (writer->fd) != 0) { if (writer->tmpname) - { - if (g_file_test (writer->filename, G_FILE_TEST_EXISTS)) - { - g_set_error (error, GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_WRITE, - _("Error writing to temporary file for '%s': %s\n" - "The original file has not been touched."), - gimp_filename_to_utf8 (writer->filename), + { + if (g_file_test (writer->filename, G_FILE_TEST_EXISTS)) + { + g_set_error (error, GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_WRITE, + _("Error writing to temporary file for '%s': %s\n" + "The original file has not been touched."), + gimp_filename_to_utf8 (writer->filename), g_strerror (errno)); - } - else - { - g_set_error (error, GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_WRITE, - _("Error writing to temporary file for '%s': %s\n" - "No file has been created."), - gimp_filename_to_utf8 (writer->filename), + } + else + { + g_set_error (error, GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_WRITE, + _("Error writing to temporary file for '%s': %s\n" + "No file has been created."), + gimp_filename_to_utf8 (writer->filename), g_strerror (errno)); - } + } - g_unlink (writer->tmpname); - } + g_unlink (writer->tmpname); + } else - { - g_set_error (error, GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_WRITE, - _("Error writing to '%s': %s"), - gimp_filename_to_utf8 (writer->filename), + { + g_set_error (error, GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_WRITE, + _("Error writing to '%s': %s"), + gimp_filename_to_utf8 (writer->filename), g_strerror (errno)); - } + } return FALSE; } @@ -699,15 +699,15 @@ gimp_config_writer_close_file (GimpConfigWriter *writer, #endif if (g_rename (writer->tmpname, writer->filename) == -1) - { - g_set_error (error, GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_WRITE, - _("Could not create '%s': %s"), - gimp_filename_to_utf8 (writer->filename), + { + g_set_error (error, GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_WRITE, + _("Could not create '%s': %s"), + gimp_filename_to_utf8 (writer->filename), g_strerror (errno)); - g_unlink (writer->tmpname); - return FALSE; - } + g_unlink (writer->tmpname); + return FALSE; + } } return TRUE; diff --git a/libgimpconfig/gimpconfigwriter.h b/libgimpconfig/gimpconfigwriter.h index 98a2413162..f98ae95ef1 100644 --- a/libgimpconfig/gimpconfigwriter.h +++ b/libgimpconfig/gimpconfigwriter.h @@ -50,15 +50,15 @@ void gimp_config_writer_data (GimpConfigWriter *writer, gint length, const guint8 *data); void gimp_config_writer_comment (GimpConfigWriter *writer, - const gchar *comment); + const gchar *comment); void gimp_config_writer_linefeed (GimpConfigWriter *writer); void gimp_config_writer_revert (GimpConfigWriter *writer); void gimp_config_writer_close (GimpConfigWriter *writer); gboolean gimp_config_writer_finish (GimpConfigWriter *writer, - const gchar *footer, - GError **error); + const gchar *footer, + GError **error); #endif /* __GIMP_CONFIG_WRITER_H__ */ diff --git a/libgimpconfig/gimpscanner.c b/libgimpconfig/gimpscanner.c index 6ef842062b..9dd804a0b6 100644 --- a/libgimpconfig/gimpscanner.c +++ b/libgimpconfig/gimpscanner.c @@ -69,7 +69,7 @@ static void gimp_scanner_message (GScanner *scanner, **/ GScanner * gimp_scanner_new_file (const gchar *filename, - GError **error) + GError **error) { GScanner *scanner; GMappedFile *file; @@ -114,8 +114,8 @@ gimp_scanner_new_file (const gchar *filename, **/ GScanner * gimp_scanner_new_string (const gchar *text, - gint text_len, - GError **error) + gint text_len, + GError **error) { GScanner *scanner; diff --git a/libgimpmath/gimpmatrix.c b/libgimpmath/gimpmatrix.c index bed800e49d..fbf846d4c3 100644 --- a/libgimpmath/gimpmatrix.c +++ b/libgimpmath/gimpmatrix.c @@ -48,8 +48,8 @@ gimp_matrix2_get_type (void) if (!matrix_type) matrix_type = g_boxed_type_register_static ("GimpMatrix2", - (GBoxedCopyFunc) matrix2_copy, - (GBoxedFreeFunc) g_free); + (GBoxedCopyFunc) matrix2_copy, + (GBoxedFreeFunc) g_free); return matrix_type; } diff --git a/libgimpmodule/gimpmodule.h b/libgimpmodule/gimpmodule.h index 9167dfa061..586232aa7a 100644 --- a/libgimpmodule/gimpmodule.h +++ b/libgimpmodule/gimpmodule.h @@ -137,7 +137,7 @@ const gchar * gimp_module_state_name (GimpModuleState state); #ifndef GIMP_DISABLE_DEPRECATED GType gimp_module_register_enum (GTypeModule *module, - const gchar *name, + const gchar *name, const GEnumValue *const_static_values); #endif /* GIMP_DISABLE_DEPRECATED */ diff --git a/libgimpthumb/gimpthumbnail.c b/libgimpthumb/gimpthumbnail.c index 15dfe72fdc..c3eced7038 100644 --- a/libgimpthumb/gimpthumbnail.c +++ b/libgimpthumb/gimpthumbnail.c @@ -133,27 +133,27 @@ gimp_thumbnail_class_init (GimpThumbnailClass *klass) object_class->get_property = gimp_thumbnail_get_property; g_object_class_install_property (object_class, - PROP_IMAGE_STATE, - g_param_spec_enum ("image-state", NULL, + PROP_IMAGE_STATE, + g_param_spec_enum ("image-state", NULL, "State of the image associated to the thumbnail object", GIMP_TYPE_THUMB_STATE, GIMP_THUMB_STATE_UNKNOWN, GIMP_PARAM_READWRITE)); g_object_class_install_property (object_class, - PROP_IMAGE_URI, - g_param_spec_string ("image-uri", NULL, + PROP_IMAGE_URI, + g_param_spec_string ("image-uri", NULL, "URI of the image file", - NULL, - GIMP_PARAM_READWRITE)); + NULL, + GIMP_PARAM_READWRITE)); g_object_class_install_property (object_class, - PROP_IMAGE_MTIME, - g_param_spec_int64 ("image-mtime", NULL, + PROP_IMAGE_MTIME, + g_param_spec_int64 ("image-mtime", NULL, "Modification time of the image file in seconds since the Epoch", 0, G_MAXINT64, 0, GIMP_PARAM_READWRITE)); g_object_class_install_property (object_class, - PROP_IMAGE_FILESIZE, - g_param_spec_int64 ("image-filesize", NULL, + PROP_IMAGE_FILESIZE, + g_param_spec_int64 ("image-filesize", NULL, "Size of the image file in bytes", 0, G_MAXINT64, 0, GIMP_PARAM_READWRITE)); @@ -163,20 +163,20 @@ gimp_thumbnail_class_init (GimpThumbnailClass *klass) * Since: GIMP 2.2 **/ g_object_class_install_property (object_class, - PROP_IMAGE_MIMETYPE, - g_param_spec_string ("image-mimetype", NULL, + PROP_IMAGE_MIMETYPE, + g_param_spec_string ("image-mimetype", NULL, "Image mimetype", NULL, GIMP_PARAM_READWRITE)); g_object_class_install_property (object_class, - PROP_IMAGE_WIDTH, - g_param_spec_int ("image-width", NULL, + PROP_IMAGE_WIDTH, + g_param_spec_int ("image-width", NULL, "Width of the image in pixels", 0, G_MAXINT, 0, GIMP_PARAM_READWRITE)); g_object_class_install_property (object_class, - PROP_IMAGE_HEIGHT, - g_param_spec_int ("image-height", NULL, + PROP_IMAGE_HEIGHT, + g_param_spec_int ("image-height", NULL, "Height of the image in pixels", 0, G_MAXINT, 0, GIMP_PARAM_READWRITE)); @@ -193,8 +193,8 @@ gimp_thumbnail_class_init (GimpThumbnailClass *klass) 0, G_MAXINT, 0, GIMP_PARAM_READWRITE)); g_object_class_install_property (object_class, - PROP_THUMB_STATE, - g_param_spec_enum ("thumb-state", NULL, + PROP_THUMB_STATE, + g_param_spec_enum ("thumb-state", NULL, "State of the thumbnail file", GIMP_TYPE_THUMB_STATE, GIMP_THUMB_STATE_UNKNOWN, @@ -884,10 +884,10 @@ gimp_thumbnail_save (GimpThumbnail *thumbnail, #endif if (g_rename (tmpname, filename) == -1) - { - 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), _("Could not create thumbnail for %s: %s"), - thumbnail->image_uri, g_strerror (errno)); + thumbnail->image_uri, g_strerror (errno)); success = FALSE; } diff --git a/libgimpwidgets/gimpbutton.h b/libgimpwidgets/gimpbutton.h index 85820a77f3..c772b3eabd 100644 --- a/libgimpwidgets/gimpbutton.h +++ b/libgimpwidgets/gimpbutton.h @@ -53,7 +53,7 @@ struct _GimpButtonClass GtkButtonClass parent_class; void (* extended_clicked) (GimpButton *preview, - GdkModifierType modifier_state); + GdkModifierType modifier_state); /* Padding for future expansion */ void (* _gimp_reserved1) (void); diff --git a/libgimpwidgets/gimpcellrenderercolor.c b/libgimpwidgets/gimpcellrenderercolor.c index 0f27fef726..864a4d8ddb 100644 --- a/libgimpwidgets/gimpcellrenderercolor.c +++ b/libgimpwidgets/gimpcellrenderercolor.c @@ -98,7 +98,7 @@ gimp_cell_renderer_color_class_init (GimpCellRendererColorClass *klass) GIMP_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property (object_class, - PROP_SIZE, + PROP_SIZE, g_param_spec_int ("icon-size", NULL, NULL, 0, G_MAXINT, DEFAULT_ICON_SIZE, @@ -183,18 +183,18 @@ gimp_cell_renderer_color_get_size (GtkCellRenderer *cell, if (cell_area && calc_width > 0 && calc_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)); - *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)); *y_offset = MAX (*y_offset, 0) + cell->ypad; - } + } } else { diff --git a/libgimpwidgets/gimpcellrenderertoggle.c b/libgimpwidgets/gimpcellrenderertoggle.c index ea0e3c3c50..72d72fd05d 100644 --- a/libgimpwidgets/gimpcellrenderertoggle.c +++ b/libgimpwidgets/gimpcellrenderertoggle.c @@ -97,13 +97,13 @@ gimp_cell_renderer_toggle_class_init (GimpCellRendererToggleClass *klass) toggle_cell_signals[CLICKED] = g_signal_new ("clicked", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GimpCellRendererToggleClass, clicked), - NULL, NULL, - _gimp_widgets_marshal_VOID__STRING_FLAGS, - G_TYPE_NONE, 2, - G_TYPE_STRING, + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GimpCellRendererToggleClass, clicked), + NULL, NULL, + _gimp_widgets_marshal_VOID__STRING_FLAGS, + G_TYPE_NONE, 2, + G_TYPE_STRING, GDK_TYPE_MODIFIER_TYPE); object_class->finalize = gimp_cell_renderer_toggle_finalize; @@ -192,7 +192,7 @@ gimp_cell_renderer_toggle_set_property (GObject *object, { case PROP_STOCK_ID: if (toggle->stock_id) - g_free (toggle->stock_id); + g_free (toggle->stock_id); toggle->stock_id = g_value_dup_string (value); break; case PROP_STOCK_SIZE: @@ -256,17 +256,17 @@ gimp_cell_renderer_toggle_get_size (GtkCellRenderer *cell, if (cell_area) { 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)); - *x_offset = MAX (*x_offset, 0); - } + *x_offset = MAX (*x_offset, 0); + } if (y_offset) - { - *y_offset = cell->yalign * (cell_area->height - calc_height); - *y_offset = MAX (*y_offset, 0); - } + { + *y_offset = cell->yalign * (cell_area->height - calc_height); + *y_offset = MAX (*y_offset, 0); + } } } @@ -314,9 +314,9 @@ gimp_cell_renderer_toggle_render (GtkCellRenderer *cell, 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 { diff --git a/libgimpwidgets/gimpchainbutton.c b/libgimpwidgets/gimpchainbutton.c index 106a80e0e1..bbce9bd6a1 100644 --- a/libgimpwidgets/gimpchainbutton.c +++ b/libgimpwidgets/gimpchainbutton.c @@ -36,10 +36,10 @@ enum static void gimp_chain_button_clicked_callback (GtkWidget *widget, - GimpChainButton *button); + GimpChainButton *button); static gboolean gimp_chain_button_draw_lines (GtkWidget *widget, - GdkEventExpose *eevent, - GimpChainButton *button); + GdkEventExpose *eevent, + GimpChainButton *button); G_DEFINE_TYPE (GimpChainButton, gimp_chain_button, GTK_TYPE_TABLE); @@ -62,12 +62,12 @@ gimp_chain_button_class_init (GimpChainButtonClass *klass) { gimp_chain_button_signals[TOGGLED] = g_signal_new ("toggled", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpChainButtonClass, toggled), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpChainButtonClass, toggled), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); klass->toggled = NULL; } @@ -136,21 +136,21 @@ gimp_chain_button_new (GimpChainPosition position) { gtk_table_resize (GTK_TABLE (button), 3, 1); gtk_table_attach (GTK_TABLE (button), button->button, 0, 1, 1, 2, - GTK_SHRINK, GTK_SHRINK, 0, 0); + GTK_SHRINK, GTK_SHRINK, 0, 0); gtk_table_attach_defaults (GTK_TABLE (button), - button->line1, 0, 1, 0, 1); + button->line1, 0, 1, 0, 1); gtk_table_attach_defaults (GTK_TABLE (button), - button->line2, 0, 1, 2, 3); + button->line2, 0, 1, 2, 3); } else { gtk_table_resize (GTK_TABLE (button), 1, 3); gtk_table_attach (GTK_TABLE (button), button->button, 1, 2, 0, 1, - GTK_SHRINK, GTK_SHRINK, 0, 0); + GTK_SHRINK, GTK_SHRINK, 0, 0); gtk_table_attach_defaults (GTK_TABLE (button), - button->line1, 0, 1, 0, 1); + button->line1, 0, 1, 0, 1); gtk_table_attach_defaults (GTK_TABLE (button), - button->line2, 2, 3, 0, 1); + button->line2, 2, 3, 0, 1); } gtk_widget_show (button->button); @@ -170,7 +170,7 @@ gimp_chain_button_new (GimpChainPosition position) */ void gimp_chain_button_set_active (GimpChainButton *button, - gboolean active) + gboolean active) { g_return_if_fail (GIMP_IS_CHAIN_BUTTON (button)); @@ -206,7 +206,7 @@ gimp_chain_button_get_active (GimpChainButton *button) static void gimp_chain_button_clicked_callback (GtkWidget *widget, - GimpChainButton *button) + GimpChainButton *button) { g_return_if_fail (GIMP_IS_CHAIN_BUTTON (button)); @@ -217,12 +217,12 @@ gimp_chain_button_clicked_callback (GtkWidget *widget, static gboolean gimp_chain_button_draw_lines (GtkWidget *widget, - GdkEventExpose *eevent, - GimpChainButton *button) + GdkEventExpose *eevent, + GimpChainButton *button) { GdkPoint points[3]; GdkPoint buf; - GtkShadowType shadow; + GtkShadowType shadow; GimpChainPosition position; gint which_line; @@ -299,15 +299,15 @@ gimp_chain_button_draw_lines (GtkWidget *widget, } gtk_paint_polygon (widget->style, - widget->window, - GTK_STATE_NORMAL, - shadow, - &eevent->area, - widget, - "chainbutton", - points, - 3, - FALSE); + widget->window, + GTK_STATE_NORMAL, + shadow, + &eevent->area, + widget, + "chainbutton", + points, + 3, + FALSE); return TRUE; } diff --git a/libgimpwidgets/gimpchainbutton.h b/libgimpwidgets/gimpchainbutton.h index 743476f740..db2426046e 100644 --- a/libgimpwidgets/gimpchainbutton.h +++ b/libgimpwidgets/gimpchainbutton.h @@ -78,7 +78,7 @@ GType gimp_chain_button_get_type (void) G_GNUC_CONST; GtkWidget * gimp_chain_button_new (GimpChainPosition position); void gimp_chain_button_set_active (GimpChainButton *button, - gboolean active); + gboolean active); gboolean gimp_chain_button_get_active (GimpChainButton *button); diff --git a/libgimpwidgets/gimpcolorarea.c b/libgimpwidgets/gimpcolorarea.c index b76a104780..665f0c1296 100644 --- a/libgimpwidgets/gimpcolorarea.c +++ b/libgimpwidgets/gimpcolorarea.c @@ -71,21 +71,21 @@ static gboolean gimp_color_area_expose (GtkWidget *widget, static void gimp_color_area_render (GimpColorArea *area); static void gimp_color_area_drag_begin (GtkWidget *widget, - GdkDragContext *context); + GdkDragContext *context); static void gimp_color_area_drag_end (GtkWidget *widget, - GdkDragContext *context); + GdkDragContext *context); static void gimp_color_area_drag_data_received (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - GtkSelectionData *selection_data, - guint info, - guint time); + GdkDragContext *context, + gint x, + gint y, + GtkSelectionData *selection_data, + guint info, + guint time); static void gimp_color_area_drag_data_get (GtkWidget *widget, - GdkDragContext *context, - GtkSelectionData *selection_data, - guint info, - guint time); + GdkDragContext *context, + GtkSelectionData *selection_data, + guint info, + guint time); G_DEFINE_TYPE (GimpColorArea, gimp_color_area, GTK_TYPE_DRAWING_AREA); @@ -283,7 +283,7 @@ gimp_color_area_set_property (GObject *object, static void gimp_color_area_size_allocate (GtkWidget *widget, - GtkAllocation *allocation) + GtkAllocation *allocation) { GimpColorArea *area = GIMP_COLOR_AREA (widget); @@ -371,8 +371,8 @@ gimp_color_area_expose (GtkWidget *widget, **/ GtkWidget * gimp_color_area_new (const GimpRGB *color, - GimpColorAreaType type, - GdkModifierType drag_mask) + GimpColorAreaType type, + GdkModifierType drag_mask) { return g_object_new (GIMP_TYPE_COLOR_AREA, "color", color, @@ -653,7 +653,7 @@ gimp_color_area_render (GimpColorArea *area) static void gimp_color_area_drag_begin (GtkWidget *widget, - GdkDragContext *context) + GdkDragContext *context) { GimpRGB color; GtkWidget *window; diff --git a/libgimpwidgets/gimpcolorbutton.h b/libgimpwidgets/gimpcolorbutton.h index 1f8327d66e..251b423bcf 100644 --- a/libgimpwidgets/gimpcolorbutton.h +++ b/libgimpwidgets/gimpcolorbutton.h @@ -78,19 +78,19 @@ struct _GimpColorButtonClass GType gimp_color_button_get_type (void) G_GNUC_CONST; GtkWidget * gimp_color_button_new (const gchar *title, - gint width, - gint height, - const GimpRGB *color, - GimpColorAreaType type); + gint width, + gint height, + const GimpRGB *color, + GimpColorAreaType type); void gimp_color_button_set_color (GimpColorButton *button, - const GimpRGB *color); + const GimpRGB *color); void gimp_color_button_get_color (GimpColorButton *button, - GimpRGB *color); + GimpRGB *color); gboolean gimp_color_button_has_alpha (GimpColorButton *button); void gimp_color_button_set_type (GimpColorButton *button, - GimpColorAreaType type); + GimpColorAreaType type); gboolean gimp_color_button_get_update (GimpColorButton *button); void gimp_color_button_set_update (GimpColorButton *button, diff --git a/libgimpwidgets/gimpcolornotebook.c b/libgimpwidgets/gimpcolornotebook.c index b1d967c420..e6f1569c6b 100644 --- a/libgimpwidgets/gimpcolornotebook.c +++ b/libgimpwidgets/gimpcolornotebook.c @@ -134,7 +134,7 @@ gimp_color_notebook_init (GimpColorNotebook *notebook) notebook); selector_types = g_type_children (GIMP_TYPE_COLOR_SELECTOR, - &n_selector_types); + &n_selector_types); if (n_selector_types == 2) { diff --git a/libgimpwidgets/gimpcolorscale.c b/libgimpwidgets/gimpcolorscale.c index 9f935f2894..625479cfb8 100644 --- a/libgimpwidgets/gimpcolorscale.c +++ b/libgimpwidgets/gimpcolorscale.c @@ -181,7 +181,7 @@ gimp_color_scale_expose (GtkWidget *widget, { GimpColorScale *scale = GIMP_COLOR_SCALE (widget); GtkRange *range; - GdkRectangle expose_area; /* Relative to widget->allocation */ + GdkRectangle expose_area; /* Relative to widget->allocation */ GdkRectangle area; gint focus = 0; gint slider_size; diff --git a/libgimpwidgets/gimpcolorscales.c b/libgimpwidgets/gimpcolorscales.c index 2395ac1dc9..befaac808c 100644 --- a/libgimpwidgets/gimpcolorscales.c +++ b/libgimpwidgets/gimpcolorscales.c @@ -144,27 +144,27 @@ gimp_color_scales_init (GimpColorScales *scales) enum_desc = gimp_enum_get_desc (enum_class, i); if (i == GIMP_COLOR_SELECTOR_ALPHA) - { - scales->toggles[i] = NULL; - } + { + scales->toggles[i] = NULL; + } else - { - scales->toggles[i] = gtk_radio_button_new (group); - group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (scales->toggles[i])); - gtk_table_attach (GTK_TABLE (table), scales->toggles[i], - 0, 1, i, i + 1, - GTK_SHRINK, GTK_EXPAND, 0, 0); + { + scales->toggles[i] = gtk_radio_button_new (group); + group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (scales->toggles[i])); + gtk_table_attach (GTK_TABLE (table), scales->toggles[i], + 0, 1, i, i + 1, + GTK_SHRINK, GTK_EXPAND, 0, 0); if (selector->toggles_visible) gtk_widget_show (scales->toggles[i]); - gimp_help_set_help_data (scales->toggles[i], - gettext (enum_desc->value_help), NULL); + gimp_help_set_help_data (scales->toggles[i], + gettext (enum_desc->value_help), NULL); - g_signal_connect (scales->toggles[i], "toggled", - G_CALLBACK (gimp_color_scales_toggle_update), - scales); - } + g_signal_connect (scales->toggles[i], "toggled", + G_CALLBACK (gimp_color_scales_toggle_update), + scales); + } scales->slider_data[i] = gimp_color_scale_entry_new (GTK_TABLE (table), 1, i, @@ -182,8 +182,8 @@ gimp_color_scales_init (GimpColorScales *scales) gimp_color_scale_set_channel (GIMP_COLOR_SCALE (scales->sliders[i]), i); g_signal_connect (scales->slider_data[i], "value-changed", - G_CALLBACK (gimp_color_scales_scale_update), - scales); + G_CALLBACK (gimp_color_scales_scale_update), + scales); } g_type_class_unref (enum_class); diff --git a/libgimpwidgets/gimpcolorselection.c b/libgimpwidgets/gimpcolorselection.c index e6bd5aa45a..3a0699e759 100644 --- a/libgimpwidgets/gimpcolorselection.c +++ b/libgimpwidgets/gimpcolorselection.c @@ -184,8 +184,8 @@ gimp_color_selection_init (GimpColorSelection *selection) gtk_widget_set_size_request (frame, -1, COLOR_AREA_SIZE); gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, - _("Current:"), 1.0, 0.5, - frame, 1, FALSE); + _("Current:"), 1.0, 0.5, + frame, 1, FALSE); selection->new_color = gimp_color_area_new (&selection->rgb, selection->show_alpha ? @@ -197,8 +197,8 @@ gimp_color_selection_init (GimpColorSelection *selection) gtk_widget_show (selection->new_color); g_signal_connect (selection->new_color, "color-changed", - G_CALLBACK (gimp_color_selection_new_color_changed), - selection); + G_CALLBACK (gimp_color_selection_new_color_changed), + selection); /* The old color area */ frame = gtk_frame_new (NULL); @@ -206,8 +206,8 @@ gimp_color_selection_init (GimpColorSelection *selection) gtk_widget_set_size_request (frame, -1, COLOR_AREA_SIZE); gimp_table_attach_aligned (GTK_TABLE (table), 0, 1, - _("Old:"), 1.0, 0.5, - frame, 1, FALSE); + _("Old:"), 1.0, 0.5, + frame, 1, FALSE); selection->old_color = gimp_color_area_new (&selection->rgb, selection->show_alpha ? @@ -589,13 +589,13 @@ gimp_color_selection_update (GimpColorSelection *selection, { g_signal_handlers_block_by_func (selection->new_color, gimp_color_selection_new_color_changed, - selection); + selection); gimp_color_area_set_color (GIMP_COLOR_AREA (selection->new_color), - &selection->rgb); + &selection->rgb); g_signal_handlers_unblock_by_func (selection->new_color, - gimp_color_selection_new_color_changed, - selection); + gimp_color_selection_new_color_changed, + selection); } } diff --git a/libgimpwidgets/gimpfileentry.c b/libgimpwidgets/gimpfileentry.c index 88702a83d2..b25dee93a3 100644 --- a/libgimpwidgets/gimpfileentry.c +++ b/libgimpwidgets/gimpfileentry.c @@ -71,12 +71,12 @@ gimp_file_entry_class_init (GimpFileEntryClass *klass) **/ gimp_file_entry_signals[FILENAME_CHANGED] = g_signal_new ("filename-changed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpFileEntryClass, filename_changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpFileEntryClass, filename_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); object_class->destroy = gimp_file_entry_destroy; @@ -243,7 +243,7 @@ gimp_file_entry_entry_activate (GtkWidget *widget, utf8 = g_strstrip (utf8); while (((len = strlen (utf8)) > 1) && - (utf8[len - 1] == G_DIR_SEPARATOR)) + (utf8[len - 1] == G_DIR_SEPARATOR)) utf8[len - 1] = '\0'; filename = g_filename_from_utf8 (utf8, -1, NULL, NULL, NULL); @@ -333,7 +333,7 @@ gimp_file_entry_browse_clicked (GtkWidget *widget, NULL); - gtk_dialog_set_alternative_button_order (GTK_DIALOG (entry->file_dialog), + gtk_dialog_set_alternative_button_order (GTK_DIALOG (entry->file_dialog), GTK_RESPONSE_OK, GTK_RESPONSE_CANCEL, -1); diff --git a/libgimpwidgets/gimphelpui.h b/libgimpwidgets/gimphelpui.h index 325fccb118..51d61f9211 100644 --- a/libgimpwidgets/gimphelpui.h +++ b/libgimpwidgets/gimphelpui.h @@ -40,14 +40,14 @@ void gimp_standard_help_func (const gchar *help_id, /* connect the help callback of a window */ void gimp_help_connect (GtkWidget *widget, - GimpHelpFunc help_func, - const gchar *help_id, + GimpHelpFunc help_func, + const gchar *help_id, gpointer help_data); /* set help data for non-window widgets */ void gimp_help_set_help_data (GtkWidget *widget, - const gchar *tooltip, - const gchar *help_id); + const gchar *tooltip, + const gchar *help_id); /* activate the context help inspector */ void gimp_context_help (GtkWidget *widget); diff --git a/libgimpwidgets/gimpintcombobox.c b/libgimpwidgets/gimpintcombobox.c index 1764d7d1a5..76c70c6e74 100644 --- a/libgimpwidgets/gimpintcombobox.c +++ b/libgimpwidgets/gimpintcombobox.c @@ -96,9 +96,9 @@ gimp_int_combo_box_class_init (GimpIntComboBoxClass *klass) g_object_class_install_property (object_class, PROP_ELLIPSIZE, g_param_spec_enum ("ellipsize", NULL, NULL, - PANGO_TYPE_ELLIPSIZE_MODE, - PANGO_ELLIPSIZE_NONE, - GIMP_PARAM_READWRITE)); + PANGO_TYPE_ELLIPSIZE_MODE, + PANGO_ELLIPSIZE_NONE, + GIMP_PARAM_READWRITE)); g_type_class_add_private (object_class, sizeof (GimpIntComboBoxPrivate)); } diff --git a/libgimpwidgets/gimpintstore.c b/libgimpwidgets/gimpintstore.c index a83e46bb2b..2ffd392008 100644 --- a/libgimpwidgets/gimpintstore.c +++ b/libgimpwidgets/gimpintstore.c @@ -101,8 +101,8 @@ gimp_int_store_finalize (GObject *object) static void gimp_int_store_row_inserted (GtkTreeModel *model, - GtkTreePath *path, - GtkTreeIter *iter) + GtkTreePath *path, + GtkTreeIter *iter) { GimpIntStore *store = GIMP_INT_STORE (model); diff --git a/libgimpwidgets/gimpmemsizeentry.c b/libgimpwidgets/gimpmemsizeentry.c index f46777f795..8733733e8c 100644 --- a/libgimpwidgets/gimpmemsizeentry.c +++ b/libgimpwidgets/gimpmemsizeentry.c @@ -42,9 +42,9 @@ enum static void gimp_memsize_entry_finalize (GObject *object); static void gimp_memsize_entry_adj_callback (GtkAdjustment *adj, - GimpMemsizeEntry *entry); + GimpMemsizeEntry *entry); static void gimp_memsize_entry_unit_callback (GtkWidget *widget, - GimpMemsizeEntry *entry); + GimpMemsizeEntry *entry); G_DEFINE_TYPE (GimpMemsizeEntry, gimp_memsize_entry, GTK_TYPE_HBOX); @@ -65,12 +65,12 @@ gimp_memsize_entry_class_init (GimpMemsizeEntryClass *klass) gimp_memsize_entry_signals[VALUE_CHANGED] = g_signal_new ("value-changed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpMemsizeEntryClass, value_changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpMemsizeEntryClass, value_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); } static void @@ -102,7 +102,7 @@ gimp_memsize_entry_finalize (GObject *object) static void gimp_memsize_entry_adj_callback (GtkAdjustment *adj, - GimpMemsizeEntry *entry) + GimpMemsizeEntry *entry) { guint64 size = gtk_adjustment_get_value (adj); @@ -113,7 +113,7 @@ gimp_memsize_entry_adj_callback (GtkAdjustment *adj, static void gimp_memsize_entry_unit_callback (GtkWidget *widget, - GimpMemsizeEntry *entry) + GimpMemsizeEntry *entry) { guint shift; @@ -153,8 +153,8 @@ gimp_memsize_entry_unit_callback (GtkWidget *widget, **/ GtkWidget * gimp_memsize_entry_new (guint64 value, - guint64 lower, - guint64 upper) + guint64 lower, + guint64 upper) { GimpMemsizeEntry *entry; guint shift; @@ -227,7 +227,7 @@ gimp_memsize_entry_new (guint64 value, **/ void gimp_memsize_entry_set_value (GimpMemsizeEntry *entry, - guint64 value) + guint64 value) { guint shift; diff --git a/libgimpwidgets/gimpmemsizeentry.h b/libgimpwidgets/gimpmemsizeentry.h index 06f721f111..1682031763 100644 --- a/libgimpwidgets/gimpmemsizeentry.h +++ b/libgimpwidgets/gimpmemsizeentry.h @@ -70,10 +70,10 @@ struct _GimpMemsizeEntryClass GType gimp_memsize_entry_get_type (void) G_GNUC_CONST; GtkWidget * gimp_memsize_entry_new (guint64 value, - guint64 lower, - guint64 upper); + guint64 lower, + guint64 upper); void gimp_memsize_entry_set_value (GimpMemsizeEntry *entry, - guint64 value); + guint64 value); guint64 gimp_memsize_entry_get_value (GimpMemsizeEntry *entry); diff --git a/libgimpwidgets/gimpoffsetarea.c b/libgimpwidgets/gimpoffsetarea.c index 91b4c59643..78b431bacb 100644 --- a/libgimpwidgets/gimpoffsetarea.c +++ b/libgimpwidgets/gimpoffsetarea.c @@ -63,14 +63,14 @@ gimp_offset_area_class_init (GimpOffsetAreaClass *klass) gimp_offset_area_signals[OFFSETS_CHANGED] = g_signal_new ("offsets-changed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpOffsetAreaClass, offsets_changed), - NULL, NULL, - _gimp_widgets_marshal_VOID__INT_INT, - G_TYPE_NONE, 2, - G_TYPE_INT, - G_TYPE_INT); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpOffsetAreaClass, offsets_changed), + NULL, NULL, + _gimp_widgets_marshal_VOID__INT_INT, + G_TYPE_NONE, 2, + G_TYPE_INT, + G_TYPE_INT); widget_class->event = gimp_offset_area_event; widget_class->expose_event = gimp_offset_area_expose_event; @@ -328,9 +328,9 @@ gimp_offset_area_event (GtkWidget *widget, { case GDK_BUTTON_PRESS: gdk_pointer_grab (widget->window, FALSE, - (GDK_BUTTON1_MOTION_MASK | - GDK_BUTTON_RELEASE_MASK), - NULL, NULL, event->button.time); + (GDK_BUTTON1_MOTION_MASK | + GDK_BUTTON_RELEASE_MASK), + NULL, NULL, event->button.time); orig_offset_x = area->offset_x; orig_offset_y = area->offset_y; @@ -409,26 +409,26 @@ gimp_offset_area_expose_event (GtkWidget *widget, if (area->orig_width > area->width || area->orig_height > area->height) { if (area->orig_width > area->width) - { - x = area->display_ratio_x * (area->orig_width - area->width); - w = area->display_ratio_x * area->width; - } + { + x = area->display_ratio_x * (area->orig_width - area->width); + w = area->display_ratio_x * area->width; + } else - { - x = -1; - w = widget->allocation.width + 2; - } + { + x = -1; + w = widget->allocation.width + 2; + } if (area->orig_height > area->height) - { - y = area->display_ratio_y * (area->orig_height - area->height); - h = area->display_ratio_y * area->height; - } + { + y = area->display_ratio_y * (area->orig_height - area->height); + h = area->display_ratio_y * area->height; + } else - { - y = -1; - h = widget->allocation.height + 2; - } + { + y = -1; + h = widget->allocation.height + 2; + } w = MAX (w, 1); h = MAX (h, 1); diff --git a/libgimpwidgets/gimpoldwidgets.c b/libgimpwidgets/gimpoldwidgets.c index 9ed9b93a19..e197e50e91 100644 --- a/libgimpwidgets/gimpoldwidgets.c +++ b/libgimpwidgets/gimpoldwidgets.c @@ -49,16 +49,16 @@ GtkWidget * gimp_option_menu_new (gboolean menu_only, - /* specify menu items as va_list: - * const gchar *label, - * GCallback callback, - * gpointer callback_data, - * gpointer item_data, - * GtkWidget **widget_ptr, - * gboolean active - */ + /* specify menu items as va_list: + * const gchar *label, + * GCallback callback, + * gpointer callback_data, + * gpointer item_data, + * GtkWidget **widget_ptr, + * gboolean active + */ - ...) + ...) { GtkWidget *menu; GtkWidget *menuitem; @@ -92,14 +92,14 @@ gimp_option_menu_new (gboolean menu_only, active = va_arg (args, gboolean); if (strcmp (label, "---")) - { - menuitem = gtk_menu_item_new_with_label (label); + { + menuitem = gtk_menu_item_new_with_label (label); - g_signal_connect (menuitem, "activate", - callback, - callback_data); + g_signal_connect (menuitem, "activate", + callback, + callback_data); - if (item_data) + if (item_data) { g_object_set_data (G_OBJECT (menuitem), "gimp-item-data", item_data); @@ -107,24 +107,24 @@ gimp_option_menu_new (gboolean menu_only, /* backward compat */ g_object_set_data (G_OBJECT (menuitem), "user_data", item_data); } - } + } else - { - menuitem = gtk_menu_item_new (); + { + menuitem = gtk_menu_item_new (); - gtk_widget_set_sensitive (menuitem, FALSE); - } + gtk_widget_set_sensitive (menuitem, FALSE); + } gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); if (widget_ptr) - *widget_ptr = menuitem; + *widget_ptr = menuitem; gtk_widget_show (menuitem); /* remember the initial menu item */ if (active) - initial_index = i; + initial_index = i; label = va_arg (args, const gchar *); } @@ -162,17 +162,17 @@ gimp_option_menu_new (gboolean menu_only, **/ GtkWidget * gimp_option_menu_new2 (gboolean menu_only, - GCallback menu_item_callback, - gpointer callback_data, - gpointer initial, /* item_data */ + GCallback menu_item_callback, + gpointer callback_data, + gpointer initial, /* item_data */ - /* specify menu items as va_list: - * const gchar *label, - * gpointer item_data, - * GtkWidget **widget_ptr, - */ + /* specify menu items as va_list: + * const gchar *label, + * gpointer item_data, + * GtkWidget **widget_ptr, + */ - ...) + ...) { GtkWidget *menu; GtkWidget *menuitem; @@ -200,14 +200,14 @@ gimp_option_menu_new2 (gboolean menu_only, widget_ptr = va_arg (args, GtkWidget **); if (strcmp (label, "---")) - { - menuitem = gtk_menu_item_new_with_label (label); + { + menuitem = gtk_menu_item_new_with_label (label); - g_signal_connect (menuitem, "activate", - menu_item_callback, - callback_data); + g_signal_connect (menuitem, "activate", + menu_item_callback, + callback_data); - if (item_data) + if (item_data) { g_object_set_data (G_OBJECT (menuitem), "gimp-item-data", item_data); @@ -215,24 +215,24 @@ gimp_option_menu_new2 (gboolean menu_only, /* backward compat */ g_object_set_data (G_OBJECT (menuitem), "user_data", item_data); } - } + } else - { - menuitem = gtk_menu_item_new (); + { + menuitem = gtk_menu_item_new (); - gtk_widget_set_sensitive (menuitem, FALSE); - } + gtk_widget_set_sensitive (menuitem, FALSE); + } gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); if (widget_ptr) - *widget_ptr = menuitem; + *widget_ptr = menuitem; gtk_widget_show (menuitem); /* remember the initial menu item */ if (item_data == initial) - initial_index = i; + initial_index = i; label = va_arg (args, const gchar *); } @@ -274,17 +274,17 @@ gimp_option_menu_new2 (gboolean menu_only, **/ GtkWidget * gimp_int_option_menu_new (gboolean menu_only, - GCallback menu_item_callback, - gpointer callback_data, - gint initial, /* item_data */ + GCallback menu_item_callback, + gpointer callback_data, + gint initial, /* item_data */ - /* specify menu items as va_list: - * const gchar *label, - * gint item_data, - * GtkWidget **widget_ptr, - */ + /* specify menu items as va_list: + * const gchar *label, + * gint item_data, + * GtkWidget **widget_ptr, + */ - ...) + ...) { GtkWidget *menu; GtkWidget *menuitem; @@ -315,14 +315,14 @@ gimp_int_option_menu_new (gboolean menu_only, item_ptr = GINT_TO_POINTER (item_data); if (strcmp (label, "---")) - { - menuitem = gtk_menu_item_new_with_label (label); + { + menuitem = gtk_menu_item_new_with_label (label); - g_signal_connect (menuitem, "activate", - menu_item_callback, - callback_data); + g_signal_connect (menuitem, "activate", + menu_item_callback, + callback_data); - if (item_data) + if (item_data) { g_object_set_data (G_OBJECT (menuitem), "gimp-item-data", item_ptr); @@ -330,24 +330,24 @@ gimp_int_option_menu_new (gboolean menu_only, /* backward compat */ g_object_set_data (G_OBJECT (menuitem), "user_data", item_ptr); } - } + } else - { - menuitem = gtk_menu_item_new (); + { + menuitem = gtk_menu_item_new (); - gtk_widget_set_sensitive (menuitem, FALSE); - } + gtk_widget_set_sensitive (menuitem, FALSE); + } gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); if (widget_ptr) - *widget_ptr = menuitem; + *widget_ptr = menuitem; gtk_widget_show (menuitem); /* remember the initial menu item */ if (item_data == initial) - initial_index = i; + initial_index = i; label = va_arg (args, const gchar *); } @@ -382,7 +382,7 @@ gimp_int_option_menu_new (gboolean menu_only, **/ void gimp_option_menu_set_history (GtkOptionMenu *option_menu, - gpointer item_data) + gpointer item_data) { GtkWidget *menu_item; GList *list; @@ -397,11 +397,11 @@ gimp_option_menu_set_history (GtkOptionMenu *option_menu, menu_item = GTK_WIDGET (list->data); if (GTK_IS_LABEL (GTK_BIN (menu_item)->child) && - g_object_get_data (G_OBJECT (menu_item), + g_object_get_data (G_OBJECT (menu_item), "gimp-item-data") == item_data) - { - break; - } + { + break; + } history++; } @@ -423,7 +423,7 @@ gimp_option_menu_set_history (GtkOptionMenu *option_menu, **/ void gimp_int_option_menu_set_history (GtkOptionMenu *option_menu, - gint item_data) + gint item_data) { g_return_if_fail (GTK_IS_OPTION_MENU (option_menu)); @@ -467,7 +467,7 @@ gimp_option_menu_set_sensitive (GtkOptionMenu *option_menu, "gimp-item-data"); sensitive = callback (item_data, callback_data); gtk_widget_set_sensitive (menu_item, sensitive); - } + } } } @@ -510,7 +510,7 @@ gimp_int_option_menu_set_sensitive (GtkOptionMenu *option "gimp-item-data")); sensitive = callback (item_data, callback_data); gtk_widget_set_sensitive (menu_item, sensitive); - } + } } } @@ -523,12 +523,12 @@ gimp_int_option_menu_set_sensitive (GtkOptionMenu *option **/ void gimp_menu_item_update (GtkWidget *widget, - gpointer data) + gpointer data) { gint *item_val; item_val = (gint *) data; *item_val = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), - "gimp-item-data")); + "gimp-item-data")); } diff --git a/libgimpwidgets/gimppageselector.c b/libgimpwidgets/gimppageselector.c index eb9d9f7d95..8606b6c52f 100644 --- a/libgimpwidgets/gimppageselector.c +++ b/libgimpwidgets/gimppageselector.c @@ -169,12 +169,12 @@ gimp_page_selector_class_init (GimpPageSelectorClass *klass) */ selector_signals[ACTIVATE] = g_signal_new ("activate", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, - G_STRUCT_OFFSET (GimpPageSelectorClass, activate), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GimpPageSelectorClass, activate), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); widget_class->activate_signal = selector_signals[ACTIVATE]; /** diff --git a/libgimpwidgets/gimppatheditor.c b/libgimpwidgets/gimppatheditor.c index 77d06a9395..a78af9b24c 100644 --- a/libgimpwidgets/gimppatheditor.c +++ b/libgimpwidgets/gimppatheditor.c @@ -85,12 +85,12 @@ gimp_path_editor_class_init (GimpPathEditorClass *klass) **/ gimp_path_editor_signals[PATH_CHANGED] = g_signal_new ("path-changed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpPathEditorClass, path_changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpPathEditorClass, path_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); /** * GimpPathEditor::writable-changed: @@ -101,12 +101,12 @@ gimp_path_editor_class_init (GimpPathEditorClass *klass) **/ gimp_path_editor_signals[WRITABLE_CHANGED] = g_signal_new ("writable-changed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpPathEditorClass, writable_changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpPathEditorClass, writable_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); klass->path_changed = NULL; klass->writable_changed = NULL; @@ -145,7 +145,7 @@ gimp_path_editor_init (GimpPathEditor *editor) g_signal_connect (button, "clicked", G_CALLBACK (gimp_path_editor_new_clicked), - editor); + editor); editor->up_button = button = gtk_button_new (); gtk_widget_set_sensitive (button, FALSE); @@ -158,7 +158,7 @@ gimp_path_editor_init (GimpPathEditor *editor) g_signal_connect (button, "clicked", G_CALLBACK (gimp_path_editor_move_clicked), - editor); + editor); editor->down_button = button = gtk_button_new (); gtk_widget_set_sensitive (button, FALSE); @@ -171,7 +171,7 @@ gimp_path_editor_init (GimpPathEditor *editor) g_signal_connect (button, "clicked", G_CALLBACK (gimp_path_editor_move_clicked), - editor); + editor); editor->delete_button = button = gtk_button_new (); gtk_widget_set_sensitive (button, FALSE); @@ -184,11 +184,11 @@ gimp_path_editor_init (GimpPathEditor *editor) g_signal_connect (button, "clicked", G_CALLBACK (gimp_path_editor_delete_clicked), - editor); + editor); scrolled_window = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window), - GTK_SHADOW_IN); + GTK_SHADOW_IN); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); @@ -218,10 +218,10 @@ gimp_path_editor_init (GimpPathEditor *editor) gtk_tree_view_column_set_visible (col, FALSE); gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tv), - -1, _("Folder"), - gtk_cell_renderer_text_new (), - "text", COLUMN_UTF8, - NULL); + -1, _("Folder"), + gtk_cell_renderer_text_new (), + "text", COLUMN_UTF8, + NULL); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tv), TRUE); @@ -230,8 +230,8 @@ gimp_path_editor_init (GimpPathEditor *editor) editor->sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tv)); g_signal_connect (editor->sel, "changed", - G_CALLBACK (gimp_path_editor_selection_changed), - editor); + G_CALLBACK (gimp_path_editor_selection_changed), + editor); } /** @@ -249,7 +249,7 @@ gimp_path_editor_init (GimpPathEditor *editor) **/ GtkWidget * gimp_path_editor_new (const gchar *filesel_title, - const gchar *path) + const gchar *path) { GimpPathEditor *editor; @@ -265,7 +265,7 @@ gimp_path_editor_new (const gchar *filesel_title, g_signal_connect (editor->file_entry, "filename-changed", G_CALLBACK (gimp_path_editor_file_entry_changed), - editor); + editor); if (path) gimp_path_editor_set_path (editor, path); @@ -558,13 +558,13 @@ gimp_path_editor_new_clicked (GtkWidget *widget, if (editor->sel_path) { g_signal_handlers_block_by_func (editor->sel, - gimp_path_editor_selection_changed, + gimp_path_editor_selection_changed, editor); gtk_tree_selection_unselect_path (editor->sel, editor->sel_path); g_signal_handlers_unblock_by_func (editor->sel, - gimp_path_editor_selection_changed, + gimp_path_editor_selection_changed, editor); gtk_tree_path_free (editor->sel_path); @@ -652,7 +652,7 @@ gimp_path_editor_delete_clicked (GtkWidget *widget, return; gtk_tree_model_get_iter (GTK_TREE_MODEL (editor->dir_list), &iter, - editor->sel_path); + editor->sel_path); gtk_tree_model_get (GTK_TREE_MODEL (editor->dir_list), &iter, COLUMN_WRITABLE, &dir_writable, @@ -731,7 +731,7 @@ gimp_path_editor_file_entry_changed (GtkWidget *widget, else { gtk_tree_model_get_iter (GTK_TREE_MODEL (editor->dir_list), &iter, - editor->sel_path); + editor->sel_path); gtk_list_store_set (editor->dir_list, &iter, COLUMN_UTF8, utf8, COLUMN_DIRECTORY, dir, @@ -772,7 +772,7 @@ gimp_path_editor_selection_changed (GtkTreeSelection *sel, g_free (directory); if (editor->sel_path) - gtk_tree_path_free (editor->sel_path); + gtk_tree_path_free (editor->sel_path); editor->sel_path = gtk_tree_model_get_path (GTK_TREE_MODEL (editor->dir_list), &iter); diff --git a/libgimpwidgets/gimppickbutton.c b/libgimpwidgets/gimppickbutton.c index e01594f282..598fb01f09 100644 --- a/libgimpwidgets/gimppickbutton.c +++ b/libgimpwidgets/gimppickbutton.c @@ -78,12 +78,12 @@ gimp_pick_button_class_init (GimpPickButtonClass* klass) pick_button_signals[COLOR_PICKED] = g_signal_new ("color-picked", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpPickButtonClass, color_picked), - NULL, NULL, - g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpPickButtonClass, color_picked), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); object_class->destroy = gimp_pick_button_destroy; diff --git a/libgimpwidgets/gimppixmap.c b/libgimpwidgets/gimppixmap.c index 049a9a77b2..c439092533 100644 --- a/libgimpwidgets/gimppixmap.c +++ b/libgimpwidgets/gimppixmap.c @@ -80,7 +80,7 @@ gimp_pixmap_new (gchar **xpm_data) **/ void gimp_pixmap_set (GimpPixmap *pixmap, - gchar **xpm_data) + gchar **xpm_data) { g_return_if_fail (GIMP_IS_PIXMAP (pixmap)); @@ -92,21 +92,21 @@ gimp_pixmap_set (GimpPixmap *pixmap, if (! GTK_WIDGET_REALIZED (GTK_WIDGET (pixmap))) { if (xpm_data) - { - gint width, height; + { + gint width, height; - if (sscanf (xpm_data[0], "%d %d", &width, &height) != 2) - { - g_warning ("%s: passed pointer is no XPM data", G_STRFUNC); - } - else - { - GTK_WIDGET (pixmap)->requisition.width = - width + GTK_MISC (pixmap)->xpad * 2; - GTK_WIDGET (pixmap)->requisition.height = - height + GTK_MISC (pixmap)->ypad * 2; - } - } + if (sscanf (xpm_data[0], "%d %d", &width, &height) != 2) + { + g_warning ("%s: passed pointer is no XPM data", G_STRFUNC); + } + else + { + GTK_WIDGET (pixmap)->requisition.width = + width + GTK_MISC (pixmap)->xpad * 2; + GTK_WIDGET (pixmap)->requisition.height = + height + GTK_MISC (pixmap)->ypad * 2; + } + } } else { @@ -139,9 +139,9 @@ gimp_pixmap_create_from_xpm_d (GimpPixmap *pixmap) style = gtk_widget_get_style (widget); gdk_pixmap = gdk_pixmap_create_from_xpm_d (widget->window, - &mask, - &style->bg[GTK_STATE_NORMAL], - pixmap->xpm_data); + &mask, + &style->bg[GTK_STATE_NORMAL], + pixmap->xpm_data); } gtk_image_set_from_pixmap (GTK_IMAGE (pixmap), gdk_pixmap, mask); diff --git a/libgimpwidgets/gimppixmap.h b/libgimpwidgets/gimppixmap.h index 882593ef73..9c16c0f6d9 100644 --- a/libgimpwidgets/gimppixmap.h +++ b/libgimpwidgets/gimppixmap.h @@ -66,7 +66,7 @@ GType gimp_pixmap_get_type (void) G_GNUC_CONST; GtkWidget * gimp_pixmap_new (gchar **xpm_data); void gimp_pixmap_set (GimpPixmap *pixmap, - gchar **xpm_data); + gchar **xpm_data); G_END_DECLS diff --git a/libgimpwidgets/gimppropwidgets.c b/libgimpwidgets/gimppropwidgets.c index cbca20f77b..f711ef11a2 100644 --- a/libgimpwidgets/gimppropwidgets.c +++ b/libgimpwidgets/gimppropwidgets.c @@ -112,8 +112,8 @@ gimp_prop_check_button_new (GObject *config, set_param_spec (G_OBJECT (button), button, param_spec); g_signal_connect (button, "toggled", - G_CALLBACK (gimp_prop_check_button_callback), - config); + G_CALLBACK (gimp_prop_check_button_callback), + config); connect_notify (config, property_name, G_CALLBACK (gimp_prop_check_button_notify), @@ -227,8 +227,8 @@ gimp_prop_enum_check_button_new (GObject *config, GINT_TO_POINTER (true_value)); g_signal_connect (button, "toggled", - G_CALLBACK (gimp_prop_enum_check_button_callback), - config); + G_CALLBACK (gimp_prop_enum_check_button_callback), + config); connect_notify (config, property_name, G_CALLBACK (gimp_prop_enum_check_button_notify), @@ -1083,8 +1083,8 @@ gimp_prop_spin_button_new (GObject *config, set_param_spec (G_OBJECT (adjustment), spinbutton, param_spec); g_signal_connect (adjustment, "value-changed", - G_CALLBACK (gimp_prop_adjustment_callback), - config); + G_CALLBACK (gimp_prop_adjustment_callback), + config); connect_notify (config, property_name, G_CALLBACK (gimp_prop_adjustment_notify), @@ -1144,8 +1144,8 @@ gimp_prop_hscale_new (GObject *config, set_param_spec (G_OBJECT (adjustment), scale, param_spec); g_signal_connect (adjustment, "value-changed", - G_CALLBACK (gimp_prop_adjustment_callback), - config); + G_CALLBACK (gimp_prop_adjustment_callback), + config); connect_notify (config, property_name, G_CALLBACK (gimp_prop_adjustment_notify), @@ -1240,8 +1240,8 @@ gimp_prop_scale_entry_new (GObject *config, set_param_spec (G_OBJECT (adjustment), NULL, param_spec); g_signal_connect (adjustment, "value-changed", - G_CALLBACK (gimp_prop_adjustment_callback), - config); + G_CALLBACK (gimp_prop_adjustment_callback), + config); connect_notify (config, property_name, G_CALLBACK (gimp_prop_adjustment_notify), @@ -1314,8 +1314,8 @@ gimp_prop_opacity_entry_new (GObject *config, "opacity-scale", GINT_TO_POINTER (TRUE)); g_signal_connect (adjustment, "value-changed", - G_CALLBACK (gimp_prop_adjustment_callback), - config); + G_CALLBACK (gimp_prop_adjustment_callback), + config); connect_notify (config, property_name, G_CALLBACK (gimp_prop_adjustment_notify), @@ -1479,10 +1479,10 @@ gimp_prop_adjustment_notify (GObject *config, /*************/ static void gimp_prop_memsize_callback (GimpMemsizeEntry *entry, - GObject *config); + GObject *config); static void gimp_prop_memsize_notify (GObject *config, - GParamSpec *param_spec, - GimpMemsizeEntry *entry); + GParamSpec *param_spec, + GimpMemsizeEntry *entry); /** * gimp_prop_memsize_entry_new: @@ -1524,16 +1524,16 @@ gimp_prop_memsize_entry_new (GObject *config, g_return_val_if_fail (uint64_spec->maximum <= GIMP_MAX_MEMSIZE, NULL); entry = gimp_memsize_entry_new (value, - uint64_spec->minimum, - uint64_spec->maximum); + uint64_spec->minimum, + uint64_spec->maximum); set_param_spec (G_OBJECT (entry), GIMP_MEMSIZE_ENTRY (entry)->spinbutton, param_spec); g_signal_connect (entry, "value-changed", - G_CALLBACK (gimp_prop_memsize_callback), - config); + G_CALLBACK (gimp_prop_memsize_callback), + config); connect_notify (config, property_name, G_CALLBACK (gimp_prop_memsize_notify), @@ -1545,7 +1545,7 @@ gimp_prop_memsize_entry_new (GObject *config, static void gimp_prop_memsize_callback (GimpMemsizeEntry *entry, - GObject *config) + GObject *config) { GParamSpec *param_spec; @@ -1556,22 +1556,22 @@ gimp_prop_memsize_callback (GimpMemsizeEntry *entry, g_return_if_fail (G_IS_PARAM_SPEC_UINT64 (param_spec)); g_object_set (config, - param_spec->name, gimp_memsize_entry_get_value (entry), - NULL); + param_spec->name, gimp_memsize_entry_get_value (entry), + NULL); } static void gimp_prop_memsize_notify (GObject *config, - GParamSpec *param_spec, - GimpMemsizeEntry *entry) + GParamSpec *param_spec, + GimpMemsizeEntry *entry) { guint64 value; g_return_if_fail (G_IS_PARAM_SPEC_UINT64 (param_spec)); g_object_get (config, - param_spec->name, &value, - NULL); + param_spec->name, &value, + NULL); if (entry->value != value) { @@ -1713,8 +1713,8 @@ gimp_prop_entry_new (GObject *config, set_param_spec (G_OBJECT (entry), entry, param_spec); g_signal_connect (entry, "changed", - G_CALLBACK (gimp_prop_entry_callback), - config); + G_CALLBACK (gimp_prop_entry_callback), + config); connect_notify (config, property_name, G_CALLBACK (gimp_prop_entry_notify), @@ -1836,8 +1836,8 @@ gimp_prop_text_buffer_new (GObject *config, set_param_spec (G_OBJECT (text_buffer), NULL, param_spec); g_signal_connect (text_buffer, "changed", - G_CALLBACK (gimp_prop_text_buffer_callback), - config); + G_CALLBACK (gimp_prop_text_buffer_callback), + config); connect_notify (config, property_name, G_CALLBACK (gimp_prop_text_buffer_notify), @@ -1984,8 +1984,8 @@ gimp_prop_file_entry_new (GObject *config, param_spec); g_signal_connect (entry, "filename-changed", - G_CALLBACK (gimp_prop_file_entry_callback), - config); + G_CALLBACK (gimp_prop_file_entry_callback), + config); connect_notify (config, property_name, G_CALLBACK (gimp_prop_file_entry_notify), @@ -2131,8 +2131,8 @@ gimp_prop_file_chooser_button_new (GObject *config, set_param_spec (G_OBJECT (button), widget, param_spec); g_signal_connect (button, "selection-changed", - G_CALLBACK (gimp_prop_file_chooser_button_callback), - config); + G_CALLBACK (gimp_prop_file_chooser_button_callback), + config); connect_notify (config, property_name, G_CALLBACK (gimp_prop_file_chooser_button_notify), @@ -2280,8 +2280,8 @@ gimp_prop_path_editor_new (GObject *config, path_param_spec); g_signal_connect (editor, "path-changed", - G_CALLBACK (gimp_prop_path_editor_path_callback), - config); + G_CALLBACK (gimp_prop_path_editor_path_callback), + config); connect_notify (config, path_property_name, G_CALLBACK (gimp_prop_path_editor_path_notify), @@ -2565,8 +2565,8 @@ gimp_prop_size_entry_new (GObject *config, param_spec); g_signal_connect (sizeentry, "value-changed", - G_CALLBACK (gimp_prop_size_entry_callback), - config); + G_CALLBACK (gimp_prop_size_entry_callback), + config); connect_notify (config, property_name, G_CALLBACK (gimp_prop_size_entry_notify), @@ -2914,11 +2914,11 @@ gimp_prop_coordinates_connect (GObject *config, } g_signal_connect (sizeentry, "value-changed", - G_CALLBACK (gimp_prop_coordinates_callback), - config); + G_CALLBACK (gimp_prop_coordinates_callback), + config); g_signal_connect (sizeentry, "refval-changed", - G_CALLBACK (gimp_prop_coordinates_callback), - config); + G_CALLBACK (gimp_prop_coordinates_callback), + config); connect_notify (config, x_property_name, G_CALLBACK (gimp_prop_coordinates_notify_x), @@ -3214,8 +3214,8 @@ gimp_prop_color_area_new (GObject *config, set_param_spec (G_OBJECT (area), area, param_spec); g_signal_connect (area, "color-changed", - G_CALLBACK (gimp_prop_color_area_callback), - config); + G_CALLBACK (gimp_prop_color_area_callback), + config); connect_notify (config, property_name, G_CALLBACK (gimp_prop_color_area_notify), @@ -3280,10 +3280,10 @@ gimp_prop_color_area_notify (GObject *config, /***************/ static void gimp_prop_unit_menu_callback (GtkWidget *menu, - GObject *config); + GObject *config); static void gimp_prop_unit_menu_notify (GObject *config, - GParamSpec *param_spec, - GtkWidget *menu); + GParamSpec *param_spec, + GtkWidget *menu); /** * gimp_prop_unit_menu_new: @@ -3301,8 +3301,8 @@ static void gimp_prop_unit_menu_notify (GObject *config, */ GtkWidget * gimp_prop_unit_menu_new (GObject *config, - const gchar *property_name, - const gchar *unit_format) + const gchar *property_name, + const gchar *unit_format) { GParamSpec *param_spec; GtkWidget *menu; @@ -3336,8 +3336,8 @@ gimp_prop_unit_menu_new (GObject *config, set_param_spec (G_OBJECT (menu), menu, param_spec); g_signal_connect (menu, "unit-changed", - G_CALLBACK (gimp_prop_unit_menu_callback), - config); + G_CALLBACK (gimp_prop_unit_menu_callback), + config); connect_notify (config, property_name, G_CALLBACK (gimp_prop_unit_menu_notify), @@ -3348,7 +3348,7 @@ gimp_prop_unit_menu_new (GObject *config, static void gimp_prop_unit_menu_callback (GtkWidget *menu, - GObject *config) + GObject *config) { GParamSpec *param_spec; GimpUnit unit; @@ -3374,8 +3374,8 @@ gimp_prop_unit_menu_callback (GtkWidget *menu, static void gimp_prop_unit_menu_notify (GObject *config, - GParamSpec *param_spec, - GtkWidget *menu) + GParamSpec *param_spec, + GtkWidget *menu) { GimpUnit unit; @@ -3521,8 +3521,8 @@ gimp_prop_expander_new (GObject *config, set_param_spec (G_OBJECT (expander), expander, param_spec); g_signal_connect (expander, "notify::expanded", - G_CALLBACK (gimp_prop_expanded_notify), - config); + G_CALLBACK (gimp_prop_expanded_notify), + config); connect_notify (config, property_name, G_CALLBACK (gimp_prop_expander_notify), diff --git a/libgimpwidgets/gimpquerybox.c b/libgimpwidgets/gimpquerybox.c index 1b587f22f7..aa3710ca61 100644 --- a/libgimpwidgets/gimpquerybox.c +++ b/libgimpwidgets/gimpquerybox.c @@ -57,17 +57,17 @@ struct _QueryBox static QueryBox * create_query_box (const gchar *title, GtkWidget *parent, - GimpHelpFunc help_func, - const gchar *help_id, - GCallback response_callback, + GimpHelpFunc help_func, + const gchar *help_id, + GCallback response_callback, const gchar *stock_id, - const gchar *message, - const gchar *ok_button, - const gchar *cancel_button, - GObject *object, - const gchar *signal, - GCallback callback, - gpointer callback_data); + const gchar *message, + const gchar *ok_button, + const gchar *cancel_button, + GObject *object, + const gchar *signal, + GCallback callback, + gpointer callback_data); static void query_box_disconnect (QueryBox *query_box); @@ -96,17 +96,17 @@ static void query_box_cancel_callback (QueryBox *query_box); static QueryBox * create_query_box (const gchar *title, GtkWidget *parent, - GimpHelpFunc help_func, - const gchar *help_id, - GCallback response_callback, + GimpHelpFunc help_func, + const gchar *help_id, + GCallback response_callback, const gchar *stock_id, - const gchar *message, - const gchar *ok_button, - const gchar *cancel_button, - GObject *object, - const gchar *signal, - GCallback callback, - gpointer callback_data) + const gchar *message, + const gchar *ok_button, + const gchar *cancel_button, + GObject *object, + const gchar *signal, + GCallback callback, + gpointer callback_data) { QueryBox *query_box; GtkWidget *hbox = NULL; @@ -122,12 +122,12 @@ create_query_box (const gchar *title, query_box->qbox = gimp_dialog_new (title, "gimp-query-box", parent, 0, - help_func, help_id, + help_func, help_id, - cancel_button, GTK_RESPONSE_CANCEL, - ok_button, GTK_RESPONSE_OK, + cancel_button, GTK_RESPONSE_CANCEL, + ok_button, GTK_RESPONSE_OK, - NULL); + NULL); gtk_dialog_set_alternative_button_order (GTK_DIALOG (query_box->qbox), GTK_RESPONSE_OK, @@ -140,8 +140,8 @@ create_query_box (const gchar *title, query_box); g_signal_connect (query_box->qbox, "destroy", - G_CALLBACK (gtk_widget_destroyed), - &query_box->qbox); + G_CALLBACK (gtk_widget_destroyed), + &query_box->qbox); /* if we are associated with an object, connect to the provided signal */ @@ -227,25 +227,25 @@ create_query_box (const gchar *title, GtkWidget * gimp_query_string_box (const gchar *title, GtkWidget *parent, - GimpHelpFunc help_func, - const gchar *help_id, - const gchar *message, - const gchar *initial, - GObject *object, - const gchar *signal, - GimpQueryStringCallback callback, - gpointer data) + GimpHelpFunc help_func, + const gchar *help_id, + const gchar *message, + const gchar *initial, + GObject *object, + const gchar *signal, + GimpQueryStringCallback callback, + gpointer data) { QueryBox *query_box; GtkWidget *entry; query_box = create_query_box (title, parent, help_func, help_id, - G_CALLBACK (string_query_box_response), + G_CALLBACK (string_query_box_response), GTK_STOCK_DIALOG_QUESTION, - message, - GTK_STOCK_OK, GTK_STOCK_CANCEL, - object, signal, - G_CALLBACK (callback), data); + message, + GTK_STOCK_OK, GTK_STOCK_CANCEL, + object, signal, + G_CALLBACK (callback), data); if (! query_box) return NULL; @@ -284,35 +284,35 @@ gimp_query_string_box (const gchar *title, GtkWidget * gimp_query_int_box (const gchar *title, GtkWidget *parent, - GimpHelpFunc help_func, - const gchar *help_id, - const gchar *message, - gint initial, - gint lower, - gint upper, - GObject *object, - const gchar *signal, - GimpQueryIntCallback callback, - gpointer data) + GimpHelpFunc help_func, + const gchar *help_id, + const gchar *message, + gint initial, + gint lower, + gint upper, + GObject *object, + const gchar *signal, + GimpQueryIntCallback callback, + gpointer data) { QueryBox *query_box; GtkWidget *spinbutton; GtkObject *adjustment; query_box = create_query_box (title, parent, help_func, help_id, - G_CALLBACK (int_query_box_response), + G_CALLBACK (int_query_box_response), GTK_STOCK_DIALOG_QUESTION, - message, - GTK_STOCK_OK, GTK_STOCK_CANCEL, - object, signal, - G_CALLBACK (callback), data); + message, + GTK_STOCK_OK, GTK_STOCK_CANCEL, + object, signal, + G_CALLBACK (callback), data); if (! query_box) return NULL; spinbutton = gimp_spin_button_new (&adjustment, - initial, lower, upper, 1, 10, 0, - 1, 0); + initial, lower, upper, 1, 10, 0, + 1, 0); gtk_entry_set_activates_default (GTK_ENTRY (spinbutton), TRUE); gtk_box_pack_start (GTK_BOX (query_box->vbox), spinbutton, FALSE, FALSE, 0); gtk_widget_grab_focus (spinbutton); @@ -346,36 +346,36 @@ gimp_query_int_box (const gchar *title, GtkWidget * gimp_query_double_box (const gchar *title, GtkWidget *parent, - GimpHelpFunc help_func, - const gchar *help_id, - const gchar *message, - gdouble initial, - gdouble lower, - gdouble upper, - gint digits, - GObject *object, - const gchar *signal, - GimpQueryDoubleCallback callback, - gpointer data) + GimpHelpFunc help_func, + const gchar *help_id, + const gchar *message, + gdouble initial, + gdouble lower, + gdouble upper, + gint digits, + GObject *object, + const gchar *signal, + GimpQueryDoubleCallback callback, + gpointer data) { QueryBox *query_box; GtkWidget *spinbutton; GtkObject *adjustment; query_box = create_query_box (title, parent, help_func, help_id, - G_CALLBACK (double_query_box_response), + G_CALLBACK (double_query_box_response), GTK_STOCK_DIALOG_QUESTION, - message, - GTK_STOCK_OK, GTK_STOCK_CANCEL, - object, signal, - G_CALLBACK (callback), data); + message, + GTK_STOCK_OK, GTK_STOCK_CANCEL, + object, signal, + G_CALLBACK (callback), data); if (! query_box) return NULL; spinbutton = gimp_spin_button_new (&adjustment, - initial, lower, upper, 1, 10, 0, - 1, digits); + initial, lower, upper, 1, 10, 0, + 1, digits); gtk_entry_set_activates_default (GTK_ENTRY (spinbutton), TRUE); gtk_box_pack_start (GTK_BOX (query_box->vbox), spinbutton, FALSE, FALSE, 0); gtk_widget_grab_focus (spinbutton); @@ -416,45 +416,45 @@ gimp_query_double_box (const gchar *title, GtkWidget * gimp_query_size_box (const gchar *title, GtkWidget *parent, - GimpHelpFunc help_func, - const gchar *help_id, - const gchar *message, - gdouble initial, - gdouble lower, - gdouble upper, - gint digits, - GimpUnit unit, - gdouble resolution, - gboolean dot_for_dot, - GObject *object, - const gchar *signal, - GimpQuerySizeCallback callback, - gpointer data) + GimpHelpFunc help_func, + const gchar *help_id, + const gchar *message, + gdouble initial, + gdouble lower, + gdouble upper, + gint digits, + GimpUnit unit, + gdouble resolution, + gboolean dot_for_dot, + GObject *object, + const gchar *signal, + GimpQuerySizeCallback callback, + gpointer data) { QueryBox *query_box; GtkWidget *sizeentry; GtkWidget *spinbutton; query_box = create_query_box (title, parent, help_func, help_id, - G_CALLBACK (size_query_box_response), + G_CALLBACK (size_query_box_response), GTK_STOCK_DIALOG_QUESTION, - message, - GTK_STOCK_OK, GTK_STOCK_CANCEL, - object, signal, - G_CALLBACK (callback), data); + message, + GTK_STOCK_OK, GTK_STOCK_CANCEL, + object, signal, + G_CALLBACK (callback), data); if (! query_box) return NULL; sizeentry = gimp_size_entry_new (1, unit, "%p", TRUE, FALSE, FALSE, 12, - GIMP_SIZE_ENTRY_UPDATE_SIZE); + GIMP_SIZE_ENTRY_UPDATE_SIZE); if (dot_for_dot) gimp_size_entry_set_unit (GIMP_SIZE_ENTRY (sizeentry), GIMP_UNIT_PIXEL); gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (sizeentry), 0, - resolution, FALSE); + resolution, FALSE); gimp_size_entry_set_refval_digits (GIMP_SIZE_ENTRY (sizeentry), 0, digits); gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (sizeentry), 0, - lower, upper); + lower, upper); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 0, initial); spinbutton = gimp_size_entry_get_help_widget (GIMP_SIZE_ENTRY (sizeentry), 0); @@ -494,26 +494,26 @@ gimp_query_size_box (const gchar *title, GtkWidget * gimp_query_boolean_box (const gchar *title, GtkWidget *parent, - GimpHelpFunc help_func, - const gchar *help_id, - const gchar *stock_id, - const gchar *message, - const gchar *true_button, - const gchar *false_button, - GObject *object, - const gchar *signal, - GimpQueryBooleanCallback callback, - gpointer data) + GimpHelpFunc help_func, + const gchar *help_id, + const gchar *stock_id, + const gchar *message, + const gchar *true_button, + const gchar *false_button, + GObject *object, + const gchar *signal, + GimpQueryBooleanCallback callback, + gpointer data) { QueryBox *query_box; query_box = create_query_box (title, parent, help_func, help_id, - G_CALLBACK (boolean_query_box_response), + G_CALLBACK (boolean_query_box_response), stock_id, - message, - true_button, false_button, - object, signal, - G_CALLBACK (callback), data); + message, + true_button, false_button, + object, signal, + G_CALLBACK (callback), data); if (! query_box) return NULL; @@ -659,9 +659,9 @@ boolean_query_box_response (GtkWidget *widget, /* Call the user defined callback */ (* (GimpQueryBooleanCallback) query_box->callback) (query_box->qbox, - (response_id == + (response_id == GTK_RESPONSE_OK), - query_box->callback_data); + query_box->callback_data); /* Destroy the box */ if (query_box->qbox) diff --git a/libgimpwidgets/gimpquerybox.h b/libgimpwidgets/gimpquerybox.h index 22b35cc433..abaad95fa6 100644 --- a/libgimpwidgets/gimpquerybox.h +++ b/libgimpwidgets/gimpquerybox.h @@ -30,25 +30,25 @@ G_BEGIN_DECLS /* query box callback prototypes */ typedef void (* GimpQueryStringCallback) (GtkWidget *query_box, - const gchar *string, - gpointer data); + const gchar *string, + gpointer data); typedef void (* GimpQueryIntCallback) (GtkWidget *query_box, - gint value, - gpointer data); + gint value, + gpointer data); typedef void (* GimpQueryDoubleCallback) (GtkWidget *query_box, - gdouble value, - gpointer data); + gdouble value, + gpointer data); typedef void (* GimpQuerySizeCallback) (GtkWidget *query_box, - gdouble size, - GimpUnit unit, - gpointer data); + gdouble size, + GimpUnit unit, + gpointer data); typedef void (* GimpQueryBooleanCallback) (GtkWidget *query_box, - gboolean value, - gpointer data); + gboolean value, + gpointer data); #define GIMP_QUERY_BOX_VBOX(qbox) g_object_get_data (G_OBJECT (qbox), \ @@ -58,71 +58,71 @@ typedef void (* GimpQueryBooleanCallback) (GtkWidget *query_box, /* some simple query dialogs */ GtkWidget * gimp_query_string_box (const gchar *title, GtkWidget *parent, - GimpHelpFunc help_func, - const gchar *help_id, - const gchar *message, - const gchar *initial, - GObject *object, - const gchar *signal, - GimpQueryStringCallback callback, - gpointer data); + GimpHelpFunc help_func, + const gchar *help_id, + const gchar *message, + const gchar *initial, + GObject *object, + const gchar *signal, + GimpQueryStringCallback callback, + gpointer data); GtkWidget * gimp_query_int_box (const gchar *title, GtkWidget *parent, - GimpHelpFunc help_func, - const gchar *help_id, - const gchar *message, - gint initial, - gint lower, - gint upper, - GObject *object, - const gchar *signal, - GimpQueryIntCallback callback, - gpointer data); + GimpHelpFunc help_func, + const gchar *help_id, + const gchar *message, + gint initial, + gint lower, + gint upper, + GObject *object, + const gchar *signal, + GimpQueryIntCallback callback, + gpointer data); GtkWidget * gimp_query_double_box (const gchar *title, GtkWidget *parent, - GimpHelpFunc help_func, - const gchar *help_id, - const gchar *message, - gdouble initial, - gdouble lower, - gdouble upper, - gint digits, - GObject *object, - const gchar *signal, - GimpQueryDoubleCallback callback, - gpointer data); + GimpHelpFunc help_func, + const gchar *help_id, + const gchar *message, + gdouble initial, + gdouble lower, + gdouble upper, + gint digits, + GObject *object, + const gchar *signal, + GimpQueryDoubleCallback callback, + gpointer data); GtkWidget * gimp_query_size_box (const gchar *title, GtkWidget *parent, - GimpHelpFunc help_func, - const gchar *help_id, - const gchar *message, - gdouble initial, - gdouble lower, - gdouble upper, - gint digits, - GimpUnit unit, - gdouble resolution, - gboolean dot_for_dot, - GObject *object, - const gchar *signal, - GimpQuerySizeCallback callback, - gpointer data); + GimpHelpFunc help_func, + const gchar *help_id, + const gchar *message, + gdouble initial, + gdouble lower, + gdouble upper, + gint digits, + GimpUnit unit, + gdouble resolution, + gboolean dot_for_dot, + GObject *object, + const gchar *signal, + GimpQuerySizeCallback callback, + gpointer data); GtkWidget * gimp_query_boolean_box (const gchar *title, GtkWidget *parent, - GimpHelpFunc help_func, - const gchar *help_id, - const gchar *stock_id, - const gchar *message, - const gchar *true_button, - const gchar *false_button, - GObject *object, - const gchar *signal, - GimpQueryBooleanCallback callback, - gpointer data); + GimpHelpFunc help_func, + const gchar *help_id, + const gchar *stock_id, + const gchar *message, + const gchar *true_button, + const gchar *false_button, + GObject *object, + const gchar *signal, + GimpQueryBooleanCallback callback, + gpointer data); G_END_DECLS diff --git a/libgimpwidgets/gimpresolutionentry.h b/libgimpwidgets/gimpresolutionentry.h index ed26abc1ec..40c0d5ee10 100644 --- a/libgimpwidgets/gimpresolutionentry.h +++ b/libgimpwidgets/gimpresolutionentry.h @@ -106,13 +106,13 @@ struct _GimpResolutionEntryClass GType gimp_resolution_entry_get_type (void) G_GNUC_CONST; GtkWidget * gimp_resolution_entry_new (const gchar *width_label, - gdouble width, - const gchar *height_label, + gdouble width, + const gchar *height_label, gdouble height, - GimpUnit size_unit, - const gchar *x_label, + GimpUnit size_unit, + const gchar *x_label, gdouble initial_x, - const gchar *y_label, + const gchar *y_label, gdouble initial_y, GimpUnit intial_unit, gboolean independent, diff --git a/libgimpwidgets/gimpscrolledpreview.c b/libgimpwidgets/gimpscrolledpreview.c index 5554bbd891..f50cb77774 100644 --- a/libgimpwidgets/gimpscrolledpreview.c +++ b/libgimpwidgets/gimpscrolledpreview.c @@ -401,12 +401,12 @@ gimp_scrolled_preview_area_event (GtkWidget *area, case GDK_MOTION_NOTIFY: if (priv->in_drag) { - GtkAdjustment *hadj; - GtkAdjustment *vadj; + GtkAdjustment *hadj; + GtkAdjustment *vadj; gint x, y; - hadj = gtk_range_get_adjustment (GTK_RANGE (preview->hscr)); - vadj = gtk_range_get_adjustment (GTK_RANGE (preview->vscr)); + hadj = gtk_range_get_adjustment (GTK_RANGE (preview->hscr)); + vadj = gtk_range_get_adjustment (GTK_RANGE (preview->vscr)); gtk_widget_get_pointer (area, &x, &y); diff --git a/libgimpwidgets/gimpsizeentry.c b/libgimpwidgets/gimpsizeentry.c index 613ae74d37..fa9ea2406b 100644 --- a/libgimpwidgets/gimpsizeentry.c +++ b/libgimpwidgets/gimpsizeentry.c @@ -74,17 +74,17 @@ struct _GimpSizeEntryField static void gimp_size_entry_finalize (GObject *object); static void gimp_size_entry_update_value (GimpSizeEntryField *gsef, - gdouble value); + gdouble value); static void gimp_size_entry_value_callback (GtkWidget *widget, - gpointer data); + gpointer data); static void gimp_size_entry_update_refval (GimpSizeEntryField *gsef, - gdouble refval); + gdouble refval); static void gimp_size_entry_refval_callback (GtkWidget *widget, - gpointer data); + gpointer data); static void gimp_size_entry_update_unit (GimpSizeEntry *gse, - GimpUnit unit); + GimpUnit unit); static void gimp_size_entry_unit_callback (GtkWidget *widget, - GimpSizeEntry *sizeentry); + GimpSizeEntry *sizeentry); G_DEFINE_TYPE (GimpSizeEntry, gimp_size_entry, GTK_TYPE_TABLE); @@ -101,30 +101,30 @@ gimp_size_entry_class_init (GimpSizeEntryClass *klass) gimp_size_entry_signals[VALUE_CHANGED] = g_signal_new ("value-changed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpSizeEntryClass, value_changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpSizeEntryClass, value_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); gimp_size_entry_signals[REFVAL_CHANGED] = g_signal_new ("refval-changed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpSizeEntryClass, refval_changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpSizeEntryClass, refval_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); gimp_size_entry_signals[UNIT_CHANGED] = g_signal_new ("unit-changed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpSizeEntryClass, unit_changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpSizeEntryClass, unit_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); object_class->finalize = gimp_size_entry_finalize; @@ -209,19 +209,19 @@ gimp_size_entry_finalize (GObject *object) **/ GtkWidget * gimp_size_entry_new (gint number_of_fields, - GimpUnit unit, - const gchar *unit_format, - gboolean menu_show_pixels, - gboolean menu_show_percent, - gboolean show_refval, - gint spinbutton_width, - GimpSizeEntryUpdatePolicy update_policy) + GimpUnit unit, + const gchar *unit_format, + gboolean menu_show_pixels, + gboolean menu_show_percent, + gboolean show_refval, + gint spinbutton_width, + GimpSizeEntryUpdatePolicy update_policy) { GimpSizeEntry *gse; gint i; g_return_val_if_fail ((number_of_fields >= 0) && (number_of_fields <= 16), - NULL); + NULL); gse = g_object_new (GIMP_TYPE_SIZE_ENTRY, NULL); @@ -231,8 +231,8 @@ gimp_size_entry_new (gint number_of_fields, gse->update_policy = update_policy; gtk_table_resize (GTK_TABLE (gse), - 1 + gse->show_refval + 2, - number_of_fields + 1 + 3); + 1 + gse->show_refval + 2, + number_of_fields + 1 + 3); /* show the 'pixels' menu entry only if we are a 'size' sizeentry and * don't have the reference value spinbutton @@ -271,7 +271,7 @@ gimp_size_entry_new (gint number_of_fields, gsef->min_refval = 0; gsef->max_refval = SIZE_MAX_VALUE; gsef->refval_digits = - (update_policy == GIMP_SIZE_ENTRY_UPDATE_SIZE) ? 0 : 3; + (update_policy == GIMP_SIZE_ENTRY_UPDATE_SIZE) ? 0 : 3; gsef->stop_recursion = 0; digits = ((unit == GIMP_UNIT_PIXEL) ? @@ -296,8 +296,8 @@ gimp_size_entry_new (gint number_of_fields, } gtk_table_attach_defaults (GTK_TABLE (gse), gsef->value_spinbutton, - i+1, i+2, - gse->show_refval+1, gse->show_refval+2); + i+1, i+2, + gse->show_refval+1, gse->show_refval+2); g_signal_connect (gsef->value_adjustment, "value-changed", G_CALLBACK (gimp_size_entry_value_callback), gsef); @@ -305,38 +305,38 @@ gimp_size_entry_new (gint number_of_fields, gtk_widget_show (gsef->value_spinbutton); if (gse->show_refval) - { + { gsef->refval_spinbutton = gimp_spin_button_new (&gsef->refval_adjustment, gsef->refval, gsef->min_refval, gsef->max_refval, 1.0, 10.0, 0.0, 1.0, gsef->refval_digits); - gtk_widget_set_size_request (gsef->refval_spinbutton, - spinbutton_width, -1); - gtk_table_attach_defaults (GTK_TABLE (gse), gsef->refval_spinbutton, - i + 1, i + 2, 1, 2); - g_signal_connect (gsef->refval_adjustment, + gtk_widget_set_size_request (gsef->refval_spinbutton, + spinbutton_width, -1); + gtk_table_attach_defaults (GTK_TABLE (gse), gsef->refval_spinbutton, + i + 1, i + 2, 1, 2); + g_signal_connect (gsef->refval_adjustment, "value-changed", G_CALLBACK (gimp_size_entry_refval_callback), gsef); - gtk_widget_show (gsef->refval_spinbutton); - } + gtk_widget_show (gsef->refval_spinbutton); + } if (gse->menu_show_pixels && (unit == GIMP_UNIT_PIXEL) && ! gse->show_refval) - gtk_spin_button_set_digits (GTK_SPIN_BUTTON (gsef->value_spinbutton), - gsef->refval_digits); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON (gsef->value_spinbutton), + gsef->refval_digits); } gse->unitmenu = gimp_unit_menu_new (unit_format, unit, - gse->menu_show_pixels, - gse->menu_show_percent, TRUE); + gse->menu_show_pixels, + gse->menu_show_percent, TRUE); gtk_table_attach (GTK_TABLE (gse), gse->unitmenu, - i+2, i+3, - gse->show_refval+1, gse->show_refval+2, - GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); + i+2, i+3, + gse->show_refval+1, gse->show_refval+2, + GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); g_signal_connect (gse->unitmenu, "unit-changed", G_CALLBACK (gimp_size_entry_unit_callback), gse); @@ -361,8 +361,8 @@ gimp_size_entry_new (gint number_of_fields, **/ void gimp_size_entry_add_field (GimpSizeEntry *gse, - GtkSpinButton *value_spinbutton, - GtkSpinButton *refval_spinbutton) + GtkSpinButton *value_spinbutton, + GtkSpinButton *refval_spinbutton) { GimpSizeEntryField *gsef; gint digits; @@ -404,7 +404,7 @@ gimp_size_entry_add_field (GimpSizeEntry *gse, if (gse->show_refval) { gsef->refval_adjustment = - GTK_OBJECT (gtk_spin_button_get_adjustment (refval_spinbutton)); + GTK_OBJECT (gtk_spin_button_get_adjustment (refval_spinbutton)); gsef->refval_spinbutton = GTK_WIDGET (refval_spinbutton); g_signal_connect (gsef->refval_adjustment, "value-changed", G_CALLBACK (gimp_size_entry_refval_callback), @@ -422,7 +422,7 @@ gimp_size_entry_add_field (GimpSizeEntry *gse, (gse->unit == GIMP_UNIT_PIXEL)) { gtk_spin_button_set_digits (GTK_SPIN_BUTTON (gsef->value_spinbutton), - gsef->refval_digits); + gsef->refval_digits); } } @@ -440,10 +440,10 @@ gimp_size_entry_add_field (GimpSizeEntry *gse, **/ GtkWidget * gimp_size_entry_attach_label (GimpSizeEntry *gse, - const gchar *text, - gint row, - gint column, - gfloat alignment) + const gchar *text, + gint row, + gint column, + gfloat alignment) { GtkWidget *label; @@ -473,7 +473,7 @@ gimp_size_entry_attach_label (GimpSizeEntry *gse, gtk_misc_set_alignment (GTK_MISC (label), alignment, 0.5); gtk_table_attach (GTK_TABLE (gse), label, column, column+1, row, row+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); return label; @@ -498,9 +498,9 @@ gimp_size_entry_attach_label (GimpSizeEntry *gse, **/ void gimp_size_entry_set_resolution (GimpSizeEntry *gse, - gint field, - gdouble resolution, - gboolean keep_size) + gint field, + gdouble resolution, + gboolean keep_size) { GimpSizeEntryField *gsef; gfloat val; @@ -517,7 +517,7 @@ gimp_size_entry_set_resolution (GimpSizeEntry *gse, gsef->stop_recursion = 0; gimp_size_entry_set_refval_boundaries (gse, field, - gsef->min_refval, gsef->max_refval); + gsef->min_refval, gsef->max_refval); if (! keep_size) gimp_size_entry_set_value (gse, field, val); @@ -543,9 +543,9 @@ gimp_size_entry_set_resolution (GimpSizeEntry *gse, **/ void gimp_size_entry_set_size (GimpSizeEntry *gse, - gint field, - gdouble lower, - gdouble upper) + gint field, + gdouble lower, + gdouble upper) { GimpSizeEntryField *gsef; @@ -582,9 +582,9 @@ gimp_size_entry_set_size (GimpSizeEntry *gse, **/ void gimp_size_entry_set_value_boundaries (GimpSizeEntry *gse, - gint field, - gdouble lower, - gdouble upper) + gint field, + gdouble lower, + gdouble upper) { GimpSizeEntryField *gsef; @@ -610,39 +610,39 @@ gimp_size_entry_set_value_boundaries (GimpSizeEntry *gse, case GIMP_SIZE_ENTRY_UPDATE_SIZE: switch (gse->unit) - { - case GIMP_UNIT_PIXEL: - gimp_size_entry_set_refval_boundaries (gse, field, - gsef->min_value, - gsef->max_value); - break; - case GIMP_UNIT_PERCENT: - gimp_size_entry_set_refval_boundaries (gse, field, - gsef->lower + - (gsef->upper - gsef->lower) * - gsef->min_value / 100, - gsef->lower + - (gsef->upper - gsef->lower) * - gsef->max_value / 100); - break; - default: - gimp_size_entry_set_refval_boundaries (gse, field, - gsef->min_value * - gsef->resolution / - gimp_unit_get_factor (gse->unit), - gsef->max_value * - gsef->resolution / - gimp_unit_get_factor (gse->unit)); - break; - } + { + case GIMP_UNIT_PIXEL: + gimp_size_entry_set_refval_boundaries (gse, field, + gsef->min_value, + gsef->max_value); + break; + case GIMP_UNIT_PERCENT: + gimp_size_entry_set_refval_boundaries (gse, field, + gsef->lower + + (gsef->upper - gsef->lower) * + gsef->min_value / 100, + gsef->lower + + (gsef->upper - gsef->lower) * + gsef->max_value / 100); + break; + default: + gimp_size_entry_set_refval_boundaries (gse, field, + gsef->min_value * + gsef->resolution / + gimp_unit_get_factor (gse->unit), + gsef->max_value * + gsef->resolution / + gimp_unit_get_factor (gse->unit)); + break; + } break; case GIMP_SIZE_ENTRY_UPDATE_RESOLUTION: gimp_size_entry_set_refval_boundaries (gse, field, - gsef->min_value * - gimp_unit_get_factor (gse->unit), - gsef->max_value * - gimp_unit_get_factor (gse->unit)); + gsef->min_value * + gimp_unit_get_factor (gse->unit), + gsef->max_value * + gimp_unit_get_factor (gse->unit)); break; default: @@ -672,7 +672,7 @@ gimp_size_entry_set_value_boundaries (GimpSizeEntry *gse, **/ gdouble gimp_size_entry_get_value (GimpSizeEntry *gse, - gint field) + gint field) { GimpSizeEntryField *gsef; @@ -685,7 +685,7 @@ gimp_size_entry_get_value (GimpSizeEntry *gse, static void gimp_size_entry_update_value (GimpSizeEntryField *gsef, - gdouble value) + gdouble value) { if (gsef->stop_recursion > 1) return; @@ -699,34 +699,34 @@ gimp_size_entry_update_value (GimpSizeEntryField *gsef, case GIMP_SIZE_ENTRY_UPDATE_SIZE: switch (gsef->gse->unit) - { - case GIMP_UNIT_PIXEL: - gsef->refval = value; - break; - case GIMP_UNIT_PERCENT: - gsef->refval = - CLAMP (gsef->lower + (gsef->upper - gsef->lower) * value / 100, - gsef->min_refval, gsef->max_refval); - break; - default: - gsef->refval = - CLAMP (value * gsef->resolution / - gimp_unit_get_factor (gsef->gse->unit), - gsef->min_refval, gsef->max_refval); - break; - } + { + case GIMP_UNIT_PIXEL: + gsef->refval = value; + break; + case GIMP_UNIT_PERCENT: + gsef->refval = + CLAMP (gsef->lower + (gsef->upper - gsef->lower) * value / 100, + gsef->min_refval, gsef->max_refval); + break; + default: + gsef->refval = + CLAMP (value * gsef->resolution / + gimp_unit_get_factor (gsef->gse->unit), + gsef->min_refval, gsef->max_refval); + break; + } if (gsef->gse->show_refval) - gtk_adjustment_set_value (GTK_ADJUSTMENT (gsef->refval_adjustment), - gsef->refval); + gtk_adjustment_set_value (GTK_ADJUSTMENT (gsef->refval_adjustment), + gsef->refval); break; case GIMP_SIZE_ENTRY_UPDATE_RESOLUTION: gsef->refval = - CLAMP (value * gimp_unit_get_factor (gsef->gse->unit), - gsef->min_refval, gsef->max_refval); + CLAMP (value * gimp_unit_get_factor (gsef->gse->unit), + gsef->min_refval, gsef->max_refval); if (gsef->gse->show_refval) - gtk_adjustment_set_value (GTK_ADJUSTMENT (gsef->refval_adjustment), - gsef->refval); + gtk_adjustment_set_value (GTK_ADJUSTMENT (gsef->refval_adjustment), + gsef->refval); break; default: @@ -754,8 +754,8 @@ gimp_size_entry_update_value (GimpSizeEntryField *gsef, **/ void gimp_size_entry_set_value (GimpSizeEntry *gse, - gint field, - gdouble value) + gint field, + gdouble value) { GimpSizeEntryField *gsef; @@ -773,7 +773,7 @@ gimp_size_entry_set_value (GimpSizeEntry *gse, static void gimp_size_entry_value_callback (GtkWidget *widget, - gpointer data) + gpointer data) { GimpSizeEntryField *gsef; gdouble new_value; @@ -834,39 +834,39 @@ gimp_size_entry_set_refval_boundaries (GimpSizeEntry *gse, case GIMP_SIZE_ENTRY_UPDATE_SIZE: switch (gse->unit) - { - case GIMP_UNIT_PIXEL: - gimp_size_entry_set_value_boundaries (gse, field, - gsef->min_refval, - gsef->max_refval); - break; - case GIMP_UNIT_PERCENT: - gimp_size_entry_set_value_boundaries (gse, field, - 100 * (gsef->min_refval - - gsef->lower) / - (gsef->upper - gsef->lower), - 100 * (gsef->max_refval - - gsef->lower) / - (gsef->upper - gsef->lower)); - break; - default: - gimp_size_entry_set_value_boundaries (gse, field, - gsef->min_refval * - gimp_unit_get_factor (gse->unit) / - gsef->resolution, - gsef->max_refval * - gimp_unit_get_factor (gse->unit) / - gsef->resolution); - break; - } + { + case GIMP_UNIT_PIXEL: + gimp_size_entry_set_value_boundaries (gse, field, + gsef->min_refval, + gsef->max_refval); + break; + case GIMP_UNIT_PERCENT: + gimp_size_entry_set_value_boundaries (gse, field, + 100 * (gsef->min_refval - + gsef->lower) / + (gsef->upper - gsef->lower), + 100 * (gsef->max_refval - + gsef->lower) / + (gsef->upper - gsef->lower)); + break; + default: + gimp_size_entry_set_value_boundaries (gse, field, + gsef->min_refval * + gimp_unit_get_factor (gse->unit) / + gsef->resolution, + gsef->max_refval * + gimp_unit_get_factor (gse->unit) / + gsef->resolution); + break; + } break; case GIMP_SIZE_ENTRY_UPDATE_RESOLUTION: gimp_size_entry_set_value_boundaries (gse, field, - gsef->min_refval / - gimp_unit_get_factor (gse->unit), - gsef->max_refval / - gimp_unit_get_factor (gse->unit)); + gsef->min_refval / + gimp_unit_get_factor (gse->unit), + gsef->max_refval / + gimp_unit_get_factor (gse->unit)); break; default: @@ -893,8 +893,8 @@ gimp_size_entry_set_refval_boundaries (GimpSizeEntry *gse, **/ void gimp_size_entry_set_refval_digits (GimpSizeEntry *gse, - gint field, - gint digits) + gint field, + gint digits) { GimpSizeEntryField *gsef; @@ -908,11 +908,11 @@ gimp_size_entry_set_refval_digits (GimpSizeEntry *gse, if (gse->update_policy == GIMP_SIZE_ENTRY_UPDATE_SIZE) { if (gse->show_refval) - gtk_spin_button_set_digits (GTK_SPIN_BUTTON (gsef->refval_spinbutton), - gsef->refval_digits); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON (gsef->refval_spinbutton), + gsef->refval_digits); else if (gse->unit == GIMP_UNIT_PIXEL) - gtk_spin_button_set_digits (GTK_SPIN_BUTTON (gsef->value_spinbutton), - gsef->refval_digits); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON (gsef->value_spinbutton), + gsef->refval_digits); } } @@ -931,7 +931,7 @@ gimp_size_entry_set_refval_digits (GimpSizeEntry *gse, **/ gdouble gimp_size_entry_get_refval (GimpSizeEntry *gse, - gint field) + gint field) { GimpSizeEntryField *gsef; @@ -945,7 +945,7 @@ gimp_size_entry_get_refval (GimpSizeEntry *gse, static void gimp_size_entry_update_refval (GimpSizeEntryField *gsef, - gdouble refval) + gdouble refval) { if (gsef->stop_recursion > 1) return; @@ -959,32 +959,32 @@ gimp_size_entry_update_refval (GimpSizeEntryField *gsef, case GIMP_SIZE_ENTRY_UPDATE_SIZE: switch (gsef->gse->unit) - { - case GIMP_UNIT_PIXEL: - gsef->value = refval; - break; - case GIMP_UNIT_PERCENT: - gsef->value = - CLAMP (100 * (refval - gsef->lower) / (gsef->upper - gsef->lower), - gsef->min_value, gsef->max_value); - break; - default: - gsef->value = - CLAMP (refval * gimp_unit_get_factor (gsef->gse->unit) / - gsef->resolution, - gsef->min_value, gsef->max_value); - break; - } + { + case GIMP_UNIT_PIXEL: + gsef->value = refval; + break; + case GIMP_UNIT_PERCENT: + gsef->value = + CLAMP (100 * (refval - gsef->lower) / (gsef->upper - gsef->lower), + gsef->min_value, gsef->max_value); + break; + default: + gsef->value = + CLAMP (refval * gimp_unit_get_factor (gsef->gse->unit) / + gsef->resolution, + gsef->min_value, gsef->max_value); + break; + } gtk_adjustment_set_value (GTK_ADJUSTMENT (gsef->value_adjustment), - gsef->value); + gsef->value); break; case GIMP_SIZE_ENTRY_UPDATE_RESOLUTION: gsef->value = - CLAMP (refval / gimp_unit_get_factor (gsef->gse->unit), - gsef->min_value, gsef->max_value); + CLAMP (refval / gimp_unit_get_factor (gsef->gse->unit), + gsef->min_value, gsef->max_value); gtk_adjustment_set_value (GTK_ADJUSTMENT (gsef->value_adjustment), - gsef->value); + gsef->value); break; default: @@ -1008,8 +1008,8 @@ gimp_size_entry_update_refval (GimpSizeEntryField *gsef, **/ void gimp_size_entry_set_refval (GimpSizeEntry *gse, - gint field, - gdouble refval) + gint field, + gdouble refval) { GimpSizeEntryField *gsef; @@ -1029,7 +1029,7 @@ gimp_size_entry_set_refval (GimpSizeEntry *gse, static void gimp_size_entry_refval_callback (GtkWidget *widget, - gpointer data) + gpointer data) { GimpSizeEntryField *gsef; gdouble new_refval; @@ -1062,7 +1062,7 @@ gimp_size_entry_get_unit (GimpSizeEntry *gse) static void gimp_size_entry_update_unit (GimpSizeEntry *gse, - GimpUnit unit) + GimpUnit unit) { GimpSizeEntryField *gsef; gint i; @@ -1077,24 +1077,24 @@ gimp_size_entry_update_unit (GimpSizeEntry *gse, gsef = (GimpSizeEntryField *) g_slist_nth_data (gse->fields, i); if (gse->update_policy == GIMP_SIZE_ENTRY_UPDATE_SIZE) - { - if (unit == GIMP_UNIT_PIXEL) - gtk_spin_button_set_digits (GTK_SPIN_BUTTON (gsef->value_spinbutton), - gsef->refval_digits + digits); - else if (unit == GIMP_UNIT_PERCENT) - gtk_spin_button_set_digits (GTK_SPIN_BUTTON (gsef->value_spinbutton), - 2 + digits); - else - gtk_spin_button_set_digits (GTK_SPIN_BUTTON (gsef->value_spinbutton), - GIMP_SIZE_ENTRY_DIGITS (unit) + digits); - } + { + if (unit == GIMP_UNIT_PIXEL) + gtk_spin_button_set_digits (GTK_SPIN_BUTTON (gsef->value_spinbutton), + gsef->refval_digits + digits); + else if (unit == GIMP_UNIT_PERCENT) + gtk_spin_button_set_digits (GTK_SPIN_BUTTON (gsef->value_spinbutton), + 2 + digits); + else + gtk_spin_button_set_digits (GTK_SPIN_BUTTON (gsef->value_spinbutton), + GIMP_SIZE_ENTRY_DIGITS (unit) + digits); + } else if (gse->update_policy == GIMP_SIZE_ENTRY_UPDATE_RESOLUTION) - { - digits = (gimp_unit_get_digits (GIMP_UNIT_INCH) - + { + digits = (gimp_unit_get_digits (GIMP_UNIT_INCH) - gimp_unit_get_digits (unit)); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON (gsef->value_spinbutton), - MAX (3 + digits, 3)); - } + gtk_spin_button_set_digits (GTK_SPIN_BUTTON (gsef->value_spinbutton), + MAX (3 + digits, 3)); + } gsef->stop_recursion = 0; /* hack !!! */ @@ -1119,7 +1119,7 @@ gimp_size_entry_update_unit (GimpSizeEntry *gse, **/ void gimp_size_entry_set_unit (GimpSizeEntry *gse, - GimpUnit unit) + GimpUnit unit) { g_return_if_fail (GIMP_IS_SIZE_ENTRY (gse)); g_return_if_fail (gse->menu_show_pixels || (unit != GIMP_UNIT_PIXEL)); @@ -1131,7 +1131,7 @@ gimp_size_entry_set_unit (GimpSizeEntry *gse, static void gimp_size_entry_unit_callback (GtkWidget *widget, - GimpSizeEntry *gse) + GimpSizeEntry *gse) { GimpUnit new_unit; diff --git a/libgimpwidgets/gimpsizeentry.h b/libgimpwidgets/gimpsizeentry.h index ebb0295dbb..5d4b2ee151 100644 --- a/libgimpwidgets/gimpsizeentry.h +++ b/libgimpwidgets/gimpsizeentry.h @@ -78,62 +78,62 @@ struct _GimpSizeEntryClass GType gimp_size_entry_get_type (void) G_GNUC_CONST; GtkWidget * gimp_size_entry_new (gint number_of_fields, - GimpUnit unit, - const gchar *unit_format, - gboolean menu_show_pixels, - gboolean menu_show_percent, - gboolean show_refval, - gint spinbutton_width, - GimpSizeEntryUpdatePolicy update_policy); + GimpUnit unit, + const gchar *unit_format, + gboolean menu_show_pixels, + gboolean menu_show_percent, + gboolean show_refval, + gint spinbutton_width, + GimpSizeEntryUpdatePolicy update_policy); void gimp_size_entry_add_field (GimpSizeEntry *gse, - GtkSpinButton *value_spinbutton, - GtkSpinButton *refval_spinbutton); + GtkSpinButton *value_spinbutton, + GtkSpinButton *refval_spinbutton); GtkWidget * gimp_size_entry_attach_label (GimpSizeEntry *gse, - const gchar *text, - gint row, - gint column, - gfloat alignment); + const gchar *text, + gint row, + gint column, + gfloat alignment); void gimp_size_entry_set_resolution (GimpSizeEntry *gse, - gint field, - gdouble resolution, - gboolean keep_size); + gint field, + gdouble resolution, + gboolean keep_size); void gimp_size_entry_set_size (GimpSizeEntry *gse, - gint field, - gdouble lower, - gdouble upper); + gint field, + gdouble lower, + gdouble upper); void gimp_size_entry_set_value_boundaries (GimpSizeEntry *gse, - gint field, - gdouble lower, - gdouble upper); + gint field, + gdouble lower, + gdouble upper); gdouble gimp_size_entry_get_value (GimpSizeEntry *gse, - gint field); + gint field); void gimp_size_entry_set_value (GimpSizeEntry *gse, - gint field, - gdouble value); + gint field, + gdouble value); void gimp_size_entry_set_refval_boundaries (GimpSizeEntry *gse, - gint field, - gdouble lower, - gdouble upper); + gint field, + gdouble lower, + gdouble upper); void gimp_size_entry_set_refval_digits (GimpSizeEntry *gse, - gint field, - gint digits); + gint field, + gint digits); gdouble gimp_size_entry_get_refval (GimpSizeEntry *gse, - gint field); + gint field); void gimp_size_entry_set_refval (GimpSizeEntry *gse, - gint field, - gdouble refval); + gint field, + gdouble refval); GimpUnit gimp_size_entry_get_unit (GimpSizeEntry *gse); void gimp_size_entry_set_unit (GimpSizeEntry *gse, - GimpUnit unit); + GimpUnit unit); void gimp_size_entry_show_unit_menu (GimpSizeEntry *gse, gboolean show); diff --git a/libgimpwidgets/gimpstock.c b/libgimpwidgets/gimpstock.c index 03e89d5303..e883361159 100644 --- a/libgimpwidgets/gimpstock.c +++ b/libgimpwidgets/gimpstock.c @@ -81,10 +81,10 @@ icon_set_from_inline (GtkIconSet *set, static void add_sized_with_same_fallback (GtkIconFactory *factory, - const guchar *inline_data, - const guchar *inline_data_rtl, - GtkIconSize size, - const gchar *stock_id) + const guchar *inline_data, + const guchar *inline_data_rtl, + GtkIconSize size, + const gchar *stock_id) { GtkIconSet *set; gboolean fallback = FALSE; @@ -688,37 +688,37 @@ gimp_stock_init (void) for (i = 0; i < G_N_ELEMENTS (gimp_stock_dialog_pixbufs); i++) { add_sized_with_same_fallback (gimp_stock_factory, - gimp_stock_dialog_pixbufs[i].inline_data, + gimp_stock_dialog_pixbufs[i].inline_data, NULL, - GTK_ICON_SIZE_DIALOG, - gimp_stock_dialog_pixbufs[i].stock_id); + GTK_ICON_SIZE_DIALOG, + gimp_stock_dialog_pixbufs[i].stock_id); } for (i = 0; i < G_N_ELEMENTS (gimp_stock_dnd_pixbufs); i++) { add_sized_with_same_fallback (gimp_stock_factory, - gimp_stock_dnd_pixbufs[i].inline_data, + gimp_stock_dnd_pixbufs[i].inline_data, NULL, - GTK_ICON_SIZE_DND, - gimp_stock_dnd_pixbufs[i].stock_id); + GTK_ICON_SIZE_DND, + gimp_stock_dnd_pixbufs[i].stock_id); } for (i = 0; i < G_N_ELEMENTS (gimp_stock_button_pixbufs); i++) { add_sized_with_same_fallback (gimp_stock_factory, - gimp_stock_button_pixbufs[i].inline_data, + gimp_stock_button_pixbufs[i].inline_data, NULL, - GTK_ICON_SIZE_BUTTON, - gimp_stock_button_pixbufs[i].stock_id); + GTK_ICON_SIZE_BUTTON, + gimp_stock_button_pixbufs[i].stock_id); } for (i = 0; i < G_N_ELEMENTS (gimp_stock_menu_pixbufs); i++) { add_sized_with_same_fallback (gimp_stock_factory, - gimp_stock_menu_pixbufs[i].inline_data, + gimp_stock_menu_pixbufs[i].inline_data, NULL, - GTK_ICON_SIZE_MENU, - gimp_stock_menu_pixbufs[i].stock_id); + GTK_ICON_SIZE_MENU, + gimp_stock_menu_pixbufs[i].stock_id); } for (i = 0; i < G_N_ELEMENTS (gimp_stock_direction_pixbufs); i++) diff --git a/libgimpwidgets/gimpunitmenu.c b/libgimpwidgets/gimpunitmenu.c index f9d6ff8fd3..63224ed285 100644 --- a/libgimpwidgets/gimpunitmenu.c +++ b/libgimpwidgets/gimpunitmenu.c @@ -54,9 +54,9 @@ enum static void gimp_unit_menu_finalize (GObject *object); static const gchar * gimp_unit_menu_build_string (const gchar *format, - GimpUnit unit); + GimpUnit unit); static void gimp_unit_menu_callback (GtkWidget *widget, - gpointer data); + gpointer data); G_DEFINE_TYPE (GimpUnitMenu, gimp_unit_menu, GTK_TYPE_OPTION_MENU); @@ -79,12 +79,12 @@ gimp_unit_menu_class_init (GimpUnitMenuClass *klass) **/ gimp_unit_menu_signals[UNIT_CHANGED] = g_signal_new ("unit-changed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GimpUnitMenuClass, unit_changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpUnitMenuClass, unit_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); object_class->finalize = gimp_unit_menu_finalize; @@ -167,10 +167,10 @@ gimp_unit_menu_finalize (GObject *object) **/ GtkWidget * gimp_unit_menu_new (const gchar *format, - GimpUnit unit, - gboolean show_pixels, - gboolean show_percent, - gboolean show_custom) + GimpUnit unit, + gboolean show_pixels, + gboolean show_percent, + gboolean show_custom) { GimpUnitMenu *unit_menu; GtkWidget *menu; @@ -178,8 +178,8 @@ gimp_unit_menu_new (const gchar *format, GimpUnit u; g_return_val_if_fail (((unit >= GIMP_UNIT_PIXEL) && - (unit < gimp_unit_get_number_of_units ())) || - (unit == GIMP_UNIT_PERCENT), NULL); + (unit < gimp_unit_get_number_of_units ())) || + (unit == GIMP_UNIT_PERCENT), NULL); if ((unit >= gimp_unit_get_number_of_built_in_units ()) && (unit != GIMP_UNIT_PERCENT)) @@ -198,33 +198,33 @@ gimp_unit_menu_new (const gchar *format, { /* special cases "pixels" and "percent" */ if (u == GIMP_UNIT_INCH) - { - if (show_percent) - { - menuitem = - gtk_menu_item_new_with_label - (gimp_unit_menu_build_string (format, GIMP_UNIT_PERCENT)); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); - g_object_set_data (G_OBJECT (menuitem), "gimp_unit_menu", + { + if (show_percent) + { + menuitem = + gtk_menu_item_new_with_label + (gimp_unit_menu_build_string (format, GIMP_UNIT_PERCENT)); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); + g_object_set_data (G_OBJECT (menuitem), "gimp_unit_menu", GINT_TO_POINTER (GIMP_UNIT_PERCENT)); - gtk_widget_show (menuitem); + gtk_widget_show (menuitem); - g_signal_connect (menuitem, "activate", + g_signal_connect (menuitem, "activate", G_CALLBACK (gimp_unit_menu_callback), unit_menu); - } + } - if (show_pixels || show_percent) - { - menuitem = gtk_menu_item_new (); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); - gtk_widget_set_sensitive (menuitem, FALSE); - gtk_widget_show (menuitem); - } - } + if (show_pixels || show_percent) + { + menuitem = gtk_menu_item_new (); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); + gtk_widget_set_sensitive (menuitem, FALSE); + gtk_widget_show (menuitem); + } + } menuitem = - gtk_menu_item_new_with_label (gimp_unit_menu_build_string (format, u)); + gtk_menu_item_new_with_label (gimp_unit_menu_build_string (format, u)); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); g_object_set_data (G_OBJECT (menuitem), "gimp_unit_menu", GINT_TO_POINTER (u)); @@ -244,7 +244,7 @@ gimp_unit_menu_new (const gchar *format, gtk_widget_show (menuitem); menuitem = - gtk_menu_item_new_with_label (gimp_unit_menu_build_string (format, + gtk_menu_item_new_with_label (gimp_unit_menu_build_string (format, unit)); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); g_object_set_data (G_OBJECT (menuitem), "gimp_unit_menu", @@ -264,7 +264,7 @@ gimp_unit_menu_new (const gchar *format, gtk_widget_show (menuitem); menuitem = - gtk_menu_item_new_with_label (_("More...")); + gtk_menu_item_new_with_label (_("More...")); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); g_object_set_data (G_OBJECT (menuitem), "gimp_unit_menu", GINT_TO_POINTER (GIMP_UNIT_PERCENT + 1)); @@ -279,13 +279,13 @@ gimp_unit_menu_new (const gchar *format, unit_menu->unit = unit; gtk_option_menu_set_history (GTK_OPTION_MENU (unit_menu), - (unit == GIMP_UNIT_PIXEL) ? 0 : - ((unit == GIMP_UNIT_PERCENT) ? - (show_pixels ? 1 : 0) : - (((show_pixels || show_percent) ? 2 : 0) + - ((show_pixels && show_percent) ? 1 : 0) + - ((unit < GIMP_UNIT_END) ? - (unit - 1) : GIMP_UNIT_END)))); + (unit == GIMP_UNIT_PIXEL) ? 0 : + ((unit == GIMP_UNIT_PERCENT) ? + (show_pixels ? 1 : 0) : + (((show_pixels || show_percent) ? 2 : 0) + + ((show_pixels && show_percent) ? 1 : 0) + + ((unit < GIMP_UNIT_END) ? + (unit - 1) : GIMP_UNIT_END)))); return GTK_WIDGET (unit_menu); } @@ -299,7 +299,7 @@ gimp_unit_menu_new (const gchar *format, **/ void gimp_unit_menu_set_unit (GimpUnitMenu *menu, - GimpUnit unit) + GimpUnit unit) { GtkWidget *menuitem = NULL; GList *items; @@ -307,45 +307,45 @@ gimp_unit_menu_set_unit (GimpUnitMenu *menu, g_return_if_fail (GIMP_IS_UNIT_MENU (menu)); g_return_if_fail (((unit >= GIMP_UNIT_PIXEL) && - ((unit > GIMP_UNIT_PIXEL) || menu->show_pixels) && - (unit < gimp_unit_get_number_of_units ())) || - ((unit == GIMP_UNIT_PERCENT) && menu->show_percent)); + ((unit > GIMP_UNIT_PIXEL) || menu->show_pixels) && + (unit < gimp_unit_get_number_of_units ())) || + ((unit == GIMP_UNIT_PERCENT) && menu->show_percent)); if (unit == menu->unit) return; items = GTK_MENU_SHELL (GTK_OPTION_MENU (menu)->menu)->children; user_unit = (GIMP_UNIT_END + - (((menu->show_pixels || menu->show_percent) ? 2 : 0) + - ((menu->show_pixels && menu->show_percent) ? 1 : 0))); + (((menu->show_pixels || menu->show_percent) ? 2 : 0) + + ((menu->show_pixels && menu->show_percent) ? 1 : 0))); if ((unit >= GIMP_UNIT_END) && (unit != GIMP_UNIT_PERCENT)) { if ((g_list_length (items) - 3) >= user_unit) - { - gtk_widget_destroy (GTK_WIDGET (g_list_nth_data (items, - user_unit - 1))); - gtk_widget_destroy (GTK_WIDGET (g_list_nth_data (items, - user_unit - 1))); - } + { + gtk_widget_destroy (GTK_WIDGET (g_list_nth_data (items, + user_unit - 1))); + gtk_widget_destroy (GTK_WIDGET (g_list_nth_data (items, + user_unit - 1))); + } menuitem = gtk_menu_item_new (); gtk_menu_shell_append (GTK_MENU_SHELL (GTK_OPTION_MENU (menu)->menu), - menuitem); + menuitem); gtk_widget_set_sensitive (menuitem, FALSE); gtk_menu_reorder_child (GTK_MENU (GTK_OPTION_MENU (menu)->menu), - menuitem, user_unit - 1); + menuitem, user_unit - 1); gtk_widget_show (menuitem); menuitem = - gtk_menu_item_new_with_label (gimp_unit_menu_build_string (menu->format, - unit)); + gtk_menu_item_new_with_label (gimp_unit_menu_build_string (menu->format, + unit)); gtk_menu_shell_append (GTK_MENU_SHELL (GTK_OPTION_MENU (menu)->menu), - menuitem); + menuitem); g_object_set_data (G_OBJECT (menuitem), "gimp_unit_menu", GINT_TO_POINTER (unit)); gtk_menu_reorder_child (GTK_MENU (GTK_OPTION_MENU (menu)->menu), - menuitem, user_unit); + menuitem, user_unit); gtk_widget_show (menuitem); g_signal_connect (menuitem, "activate", @@ -355,15 +355,15 @@ gimp_unit_menu_set_unit (GimpUnitMenu *menu, menu->unit = unit; gtk_option_menu_set_history (GTK_OPTION_MENU (menu), - (unit == GIMP_UNIT_PIXEL) ? 0 : - ((unit == GIMP_UNIT_PERCENT) ? - (menu->show_pixels ? 1 : 0) : - (((menu->show_pixels || - menu->show_percent) ? 2 : 0) + - ((menu->show_pixels && - menu->show_percent) ? 1 : 0) + - ((unit < GIMP_UNIT_END) ? - (unit - 1) : GIMP_UNIT_END)))); + (unit == GIMP_UNIT_PIXEL) ? 0 : + ((unit == GIMP_UNIT_PERCENT) ? + (menu->show_pixels ? 1 : 0) : + (((menu->show_pixels || + menu->show_percent) ? 2 : 0) + + ((menu->show_pixels && + menu->show_percent) ? 1 : 0) + + ((unit < GIMP_UNIT_END) ? + (unit - 1) : GIMP_UNIT_END)))); g_signal_emit (menu, gimp_unit_menu_signals[UNIT_CHANGED], 0); } @@ -455,7 +455,7 @@ print (gchar *buf, static const gchar * gimp_unit_menu_build_string (const gchar *format, - GimpUnit unit) + GimpUnit unit) { static gchar buffer[64]; gint i = 0; @@ -463,56 +463,56 @@ gimp_unit_menu_build_string (const gchar *format, while (i < (sizeof (buffer) - 1) && *format) { switch (*format) - { - case '%': - format++; - switch (*format) - { - case 0: - g_warning ("%s: unit-menu-format string ended within %%-sequence", + { + case '%': + format++; + switch (*format) + { + case 0: + g_warning ("%s: unit-menu-format string ended within %%-sequence", G_STRFUNC); - break; + break; - case '%': - buffer[i++] = '%'; - break; + case '%': + buffer[i++] = '%'; + break; - case 'f': /* factor (how many units make up an inch) */ - i += print (buffer, sizeof (buffer), i, "%f", - gimp_unit_get_factor (unit)); - break; + case 'f': /* factor (how many units make up an inch) */ + i += print (buffer, sizeof (buffer), i, "%f", + gimp_unit_get_factor (unit)); + break; - case 'y': /* symbol ("''" for inch) */ - i += print (buffer, sizeof (buffer), i, "%s", - gimp_unit_get_symbol (unit)); - break; + case 'y': /* symbol ("''" for inch) */ + i += print (buffer, sizeof (buffer), i, "%s", + gimp_unit_get_symbol (unit)); + break; - case 'a': /* abbreviation */ - i += print (buffer, sizeof (buffer), i, "%s", - gimp_unit_get_abbreviation (unit)); - break; + case 'a': /* abbreviation */ + i += print (buffer, sizeof (buffer), i, "%s", + gimp_unit_get_abbreviation (unit)); + break; - case 's': /* singular */ - i += print (buffer, sizeof (buffer), i, "%s", - gimp_unit_get_singular (unit)); - break; + case 's': /* singular */ + i += print (buffer, sizeof (buffer), i, "%s", + gimp_unit_get_singular (unit)); + break; - case 'p': /* plural */ - i += print (buffer, sizeof (buffer), i, "%s", - gimp_unit_get_plural (unit)); - break; + case 'p': /* plural */ + i += print (buffer, sizeof (buffer), i, "%s", + gimp_unit_get_plural (unit)); + break; - default: - g_warning ("%s: unit-menu-format contains unknown format " + default: + g_warning ("%s: unit-menu-format contains unknown format " "sequence '%%%c'", G_STRFUNC, *format); - break; - } - break; + break; + } + break; - default: - buffer[i++] = *format; - break; - } + default: + buffer[i++] = *format; + break; + } format++; } @@ -554,9 +554,9 @@ gimp_unit_menu_selection_response (GtkWidget *widget, static void gimp_unit_menu_selection_row_activated_callback (GtkTreeView *tv, - GtkTreePath *path, - GtkTreeViewColumn *column, - GimpUnitMenu *menu) + GtkTreePath *path, + GtkTreeViewColumn *column, + GimpUnitMenu *menu) { gtk_dialog_response (GTK_DIALOG (menu->selection), GTK_RESPONSE_OK); } @@ -609,26 +609,26 @@ gimp_unit_menu_create_selection (GimpUnitMenu *menu) /* the selection list */ scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), - GTK_SHADOW_ETCHED_IN); + GTK_SHADOW_ETCHED_IN); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), - GTK_POLICY_NEVER, - GTK_POLICY_ALWAYS); + GTK_POLICY_NEVER, + GTK_POLICY_ALWAYS); gtk_container_add (GTK_CONTAINER (vbox), scrolled_win); gtk_widget_show (scrolled_win); list = gtk_list_store_new (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, - G_TYPE_INT); + G_TYPE_INT); menu->tv = gtk_tree_view_new_with_model (GTK_TREE_MODEL (list)); g_object_unref (list); gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (menu->tv), - -1, _("Unit"), - gtk_cell_renderer_text_new (), - "text", UNIT_COLUMN, NULL); + -1, _("Unit"), + gtk_cell_renderer_text_new (), + "text", UNIT_COLUMN, NULL); gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (menu->tv), - -1, _("Factor"), - gtk_cell_renderer_text_new (), - "text", FACTOR_COLUMN, NULL); + -1, _("Factor"), + gtk_cell_renderer_text_new (), + "text", FACTOR_COLUMN, NULL); /* the unit lines */ num_units = gimp_unit_get_number_of_units (); @@ -636,13 +636,13 @@ gimp_unit_menu_create_selection (GimpUnitMenu *menu) { gtk_list_store_append (list, &iter); gtk_list_store_set (list, &iter, - UNIT_COLUMN, - gimp_unit_menu_build_string (menu->format, unit), - -1); + UNIT_COLUMN, + gimp_unit_menu_build_string (menu->format, unit), + -1); gtk_list_store_set (list, &iter, - FACTOR_COLUMN, - gimp_unit_menu_build_string ("(%f)", unit), - -1); + FACTOR_COLUMN, + gimp_unit_menu_build_string ("(%f)", unit), + -1); gtk_list_store_set (list, &iter, DATA_COLUMN, unit, -1); } @@ -672,13 +672,13 @@ gimp_unit_menu_create_selection (GimpUnitMenu *menu) gtk_tree_selection_select_path (sel, path); gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (menu->tv), path, NULL, - FALSE, 0.0, 0.0); + FALSE, 0.0, 0.0); } } static void gimp_unit_menu_callback (GtkWidget *widget, - gpointer data) + gpointer data) { GimpUnitMenu *menu = data; GimpUnit new_unit; @@ -693,17 +693,17 @@ gimp_unit_menu_callback (GtkWidget *widget, if (new_unit == (GIMP_UNIT_PERCENT + 1)) { gtk_option_menu_set_history (GTK_OPTION_MENU (menu), - (menu->unit == GIMP_UNIT_PIXEL) ? 0 : - ((menu->unit == GIMP_UNIT_PERCENT) ? - (menu->show_pixels ? 1 : 0) : - ((menu->show_pixels || - menu->show_percent ? 2 : 0) + - (menu->show_pixels && - menu->show_percent ? 1 : 0) + - ((menu->unit < GIMP_UNIT_END) ? - menu->unit - 1 : GIMP_UNIT_END)))); + (menu->unit == GIMP_UNIT_PIXEL) ? 0 : + ((menu->unit == GIMP_UNIT_PERCENT) ? + (menu->show_pixels ? 1 : 0) : + ((menu->show_pixels || + menu->show_percent ? 2 : 0) + + (menu->show_pixels && + menu->show_percent ? 1 : 0) + + ((menu->unit < GIMP_UNIT_END) ? + menu->unit - 1 : GIMP_UNIT_END)))); if (! menu->selection) - gimp_unit_menu_create_selection (menu); + gimp_unit_menu_create_selection (menu); return; } else if (menu->selection) diff --git a/libgimpwidgets/gimpwidgets.c b/libgimpwidgets/gimpwidgets.c index ff66ca2e8c..756f58c860 100644 --- a/libgimpwidgets/gimpwidgets.c +++ b/libgimpwidgets/gimpwidgets.c @@ -55,18 +55,18 @@ **/ GtkWidget * gimp_radio_group_new (gboolean in_frame, - const gchar *frame_title, + const gchar *frame_title, - /* specify radio buttons as va_list: - * const gchar *label, - * GCallback callback, - * gpointer callback_data, - * gpointer item_data, - * GtkWidget **widget_ptr, - * gboolean active, - */ + /* specify radio buttons as va_list: + * const gchar *label, + * GCallback callback, + * gpointer callback_data, + * gpointer item_data, + * GtkWidget **widget_ptr, + * gboolean active, + */ - ...) + ...) { GtkWidget *vbox; GtkWidget *button; @@ -98,9 +98,9 @@ gimp_radio_group_new (gboolean in_frame, active = va_arg (args, gboolean); if (label != (gpointer) 1) - button = gtk_radio_button_new_with_mnemonic (group, label); + button = gtk_radio_button_new_with_mnemonic (group, label); else - button = gtk_radio_button_new (group); + button = gtk_radio_button_new (group); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); @@ -114,14 +114,14 @@ gimp_radio_group_new (gboolean in_frame, } if (widget_ptr) - *widget_ptr = button; + *widget_ptr = button; if (active) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); g_signal_connect (button, "toggled", - callback, - callback_data); + callback, + callback_data); gtk_widget_show (button); @@ -164,18 +164,18 @@ gimp_radio_group_new (gboolean in_frame, **/ GtkWidget * gimp_radio_group_new2 (gboolean in_frame, - const gchar *frame_title, - GCallback radio_button_callback, - gpointer callback_data, - gpointer initial, /* item_data */ + const gchar *frame_title, + GCallback radio_button_callback, + gpointer callback_data, + gpointer initial, /* item_data */ - /* specify radio buttons as va_list: - * const gchar *label, - * gpointer item_data, - * GtkWidget **widget_ptr, - */ + /* specify radio buttons as va_list: + * const gchar *label, + * gpointer item_data, + * GtkWidget **widget_ptr, + */ - ...) + ...) { GtkWidget *vbox; GtkWidget *button; @@ -202,9 +202,9 @@ gimp_radio_group_new2 (gboolean in_frame, widget_ptr = va_arg (args, GtkWidget **); if (label != (gpointer) 1) - button = gtk_radio_button_new_with_mnemonic (group, label); + button = gtk_radio_button_new_with_mnemonic (group, label); else - button = gtk_radio_button_new (group); + button = gtk_radio_button_new (group); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); @@ -218,14 +218,14 @@ gimp_radio_group_new2 (gboolean in_frame, } if (widget_ptr) - *widget_ptr = button; + *widget_ptr = button; if (initial == item_data) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); g_signal_connect (button, "toggled", - radio_button_callback, - callback_data); + radio_button_callback, + callback_data); gtk_widget_show (button); @@ -271,18 +271,18 @@ gimp_radio_group_new2 (gboolean in_frame, **/ GtkWidget * gimp_int_radio_group_new (gboolean in_frame, - const gchar *frame_title, - GCallback radio_button_callback, - gpointer callback_data, - gint initial, /* item_data */ + const gchar *frame_title, + GCallback radio_button_callback, + gpointer callback_data, + gint initial, /* item_data */ - /* specify radio buttons as va_list: - * const gchar *label, - * gint item_data, - * GtkWidget **widget_ptr, - */ + /* specify radio buttons as va_list: + * const gchar *label, + * gint item_data, + * GtkWidget **widget_ptr, + */ - ...) + ...) { GtkWidget *vbox; GtkWidget *button; @@ -312,9 +312,9 @@ gimp_int_radio_group_new (gboolean in_frame, item_ptr = GINT_TO_POINTER (item_data); if (label != GINT_TO_POINTER (1)) - button = gtk_radio_button_new_with_mnemonic (group, label); + button = gtk_radio_button_new_with_mnemonic (group, label); else - button = gtk_radio_button_new (group); + button = gtk_radio_button_new (group); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); @@ -328,14 +328,14 @@ gimp_int_radio_group_new (gboolean in_frame, } if (widget_ptr) - *widget_ptr = button; + *widget_ptr = button; if (initial == item_data) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); g_signal_connect (button, "toggled", - radio_button_callback, - callback_data); + radio_button_callback, + callback_data); gtk_widget_show (button); @@ -428,22 +428,22 @@ gimp_int_radio_group_set_active (GtkRadioButton *radio_button, **/ GtkWidget * gimp_spin_button_new (GtkObject **adjustment, /* return value */ - gdouble value, - gdouble lower, - gdouble upper, - gdouble step_increment, - gdouble page_increment, - gdouble page_size, - gdouble climb_rate, - guint digits) + gdouble value, + gdouble lower, + gdouble upper, + gdouble step_increment, + gdouble page_increment, + gdouble page_size, + gdouble climb_rate, + guint digits) { GtkWidget *spinbutton; *adjustment = gtk_adjustment_new (value, lower, upper, - step_increment, page_increment, page_size); + step_increment, page_increment, page_size); spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (*adjustment), - climb_rate, digits); + climb_rate, digits); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); @@ -452,17 +452,17 @@ gimp_spin_button_new (GtkObject **adjustment, /* return value */ static void gimp_scale_entry_unconstrained_adjustment_callback (GtkAdjustment *adjustment, - GtkAdjustment *other_adj) + GtkAdjustment *other_adj) { g_signal_handlers_block_by_func (other_adj, - gimp_scale_entry_unconstrained_adjustment_callback, - adjustment); + gimp_scale_entry_unconstrained_adjustment_callback, + adjustment); gtk_adjustment_set_value (other_adj, adjustment->value); g_signal_handlers_unblock_by_func (other_adj, - gimp_scale_entry_unconstrained_adjustment_callback, - adjustment); + gimp_scale_entry_unconstrained_adjustment_callback, + adjustment); } static void @@ -567,24 +567,24 @@ gimp_scale_entry_new_internal (gboolean color_scale, GtkObject *constrained_adj; constrained_adj = gtk_adjustment_new (value, lower, upper, - step_increment, page_increment, - 0.0); + step_increment, page_increment, + 0.0); spinbutton = gimp_spin_button_new (&adjustment, value, - unconstrained_lower, - unconstrained_upper, - step_increment, page_increment, 0.0, - 1.0, digits); + unconstrained_lower, + unconstrained_upper, + step_increment, page_increment, 0.0, + 1.0, digits); g_signal_connect - (G_OBJECT (constrained_adj), "value-changed", - G_CALLBACK (gimp_scale_entry_unconstrained_adjustment_callback), - adjustment); + (G_OBJECT (constrained_adj), "value-changed", + G_CALLBACK (gimp_scale_entry_unconstrained_adjustment_callback), + adjustment); g_signal_connect - (G_OBJECT (adjustment), "value-changed", - G_CALLBACK (gimp_scale_entry_unconstrained_adjustment_callback), - constrained_adj); + (G_OBJECT (adjustment), "value-changed", + G_CALLBACK (gimp_scale_entry_unconstrained_adjustment_callback), + constrained_adj); return_adj = adjustment; @@ -593,8 +593,8 @@ gimp_scale_entry_new_internal (gboolean color_scale, else { spinbutton = gimp_spin_button_new (&adjustment, value, lower, upper, - step_increment, page_increment, 0.0, - 1.0, digits); + step_increment, page_increment, 0.0, + 1.0, digits); return_adj = adjustment; } @@ -627,13 +627,13 @@ gimp_scale_entry_new_internal (gboolean color_scale, gtk_scale_set_digits (GTK_SCALE (scale), digits); gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE); gtk_table_attach (GTK_TABLE (table), scale, - column + 1, column + 2, row, row + 1, - GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0); + column + 1, column + 2, row, row + 1, + GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0); gtk_widget_show (scale); gtk_table_attach (GTK_TABLE (table), spinbutton, - column + 2, column + 3, row, row + 1, - GTK_SHRINK, GTK_SHRINK, 0, 0); + column + 2, column + 3, row, row + 1, + GTK_SHRINK, GTK_SHRINK, 0, 0); gtk_widget_show (spinbutton); if (tooltip || help_id) @@ -685,22 +685,22 @@ gimp_scale_entry_new_internal (gboolean color_scale, **/ GtkObject * gimp_scale_entry_new (GtkTable *table, - gint column, - gint row, - const gchar *text, - gint scale_width, - gint spinbutton_width, - gdouble value, - gdouble lower, - gdouble upper, - gdouble step_increment, - gdouble page_increment, - guint digits, - gboolean constrain, - gdouble unconstrained_lower, - gdouble unconstrained_upper, - const gchar *tooltip, - const gchar *help_id) + gint column, + gint row, + const gchar *text, + gint scale_width, + gint spinbutton_width, + gdouble value, + gdouble lower, + gdouble upper, + gdouble step_increment, + gdouble page_increment, + guint digits, + gboolean constrain, + gdouble unconstrained_lower, + gdouble unconstrained_upper, + const gchar *tooltip, + const gchar *help_id) { return gimp_scale_entry_new_internal (FALSE, table, column, row, @@ -944,7 +944,7 @@ gimp_scale_entry_set_sensitive (GtkObject *adjustment, static void gimp_random_seed_update (GtkWidget *widget, - gpointer data) + gpointer data) { GtkWidget *spinbutton = data; @@ -1063,7 +1063,7 @@ typedef struct static void gimp_coordinates_callback (GtkWidget *widget, - GimpCoordinatesData *gcd) + GimpCoordinatesData *gcd) { gdouble new_x; gdouble new_y; @@ -1074,54 +1074,54 @@ gimp_coordinates_callback (GtkWidget *widget, if (gimp_chain_button_get_active (gcd->chainbutton)) { if (gcd->chain_constrains_ratio) - { - if ((gcd->orig_x != 0) && (gcd->orig_y != 0)) - { - if (new_x != gcd->last_x) - { - gcd->last_x = new_x; - new_y = (new_x * gcd->orig_y) / gcd->orig_x; + { + if ((gcd->orig_x != 0) && (gcd->orig_y != 0)) + { + if (new_x != gcd->last_x) + { + gcd->last_x = new_x; + new_y = (new_x * gcd->orig_y) / gcd->orig_x; g_signal_stop_emission_by_name (widget, "value-changed"); - gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (widget), 1, + gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (widget), 1, new_y); - gcd->last_y + gcd->last_y = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1); - } - else if (new_y != gcd->last_y) - { - gcd->last_y = new_y; - new_x = (new_y * gcd->orig_x) / gcd->orig_y; + } + else if (new_y != gcd->last_y) + { + gcd->last_y = new_y; + new_x = (new_y * gcd->orig_x) / gcd->orig_y; g_signal_stop_emission_by_name (widget, "value-changed"); - gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (widget), 0, + gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (widget), 0, new_x); gcd->last_x = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0); - } - } - } + } + } + } else - { - if (new_x != gcd->last_x) - { - new_y = new_x; + { + if (new_x != gcd->last_x) + { + new_y = new_x; g_signal_stop_emission_by_name (widget, "value-changed"); - gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (widget), 1, new_x); + gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (widget), 1, new_x); gcd->last_y = gcd->last_x = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1); - } - else if (new_y != gcd->last_y) - { - new_x = new_y; + } + else if (new_y != gcd->last_y) + { + new_x = new_y; g_signal_stop_emission_by_name (widget, "value-changed"); - gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (widget), 0, new_y); + gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (widget), 0, new_y); gcd->last_x = gcd->last_y = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0); - } - } + } + } } else { @@ -1172,30 +1172,30 @@ gimp_coordinates_callback (GtkWidget *widget, **/ GtkWidget * gimp_coordinates_new (GimpUnit unit, - const gchar *unit_format, - gboolean menu_show_pixels, - gboolean menu_show_percent, - gint spinbutton_width, - GimpSizeEntryUpdatePolicy update_policy, + const gchar *unit_format, + gboolean menu_show_pixels, + gboolean menu_show_percent, + gint spinbutton_width, + GimpSizeEntryUpdatePolicy update_policy, - gboolean chainbutton_active, - gboolean chain_constrains_ratio, + gboolean chainbutton_active, + gboolean chain_constrains_ratio, - const gchar *xlabel, - gdouble x, - gdouble xres, - gdouble lower_boundary_x, - gdouble upper_boundary_x, - gdouble xsize_0, /* % */ - gdouble xsize_100, /* % */ + const gchar *xlabel, + gdouble x, + gdouble xres, + gdouble lower_boundary_x, + gdouble upper_boundary_x, + gdouble xsize_0, /* % */ + gdouble xsize_100, /* % */ - const gchar *ylabel, - gdouble y, - gdouble yres, - gdouble lower_boundary_y, - gdouble upper_boundary_y, - gdouble ysize_0, /* % */ - gdouble ysize_100 /* % */) + const gchar *ylabel, + gdouble y, + gdouble yres, + gdouble lower_boundary_y, + gdouble upper_boundary_y, + gdouble ysize_0, /* % */ + gdouble ysize_100 /* % */) { GimpCoordinatesData *gcd; GtkObject *adjustment; @@ -1214,11 +1214,11 @@ gimp_coordinates_new (GimpUnit unit, } sizeentry = gimp_size_entry_new (1, unit, unit_format, - menu_show_pixels, - menu_show_percent, - FALSE, - spinbutton_width, - update_policy); + menu_show_pixels, + menu_show_percent, + FALSE, + spinbutton_width, + update_policy); gtk_table_set_col_spacing (GTK_TABLE (sizeentry), 0, 4); gtk_table_set_col_spacing (GTK_TABLE (sizeentry), 2, 4); gimp_size_entry_add_field (GIMP_SIZE_ENTRY (sizeentry), @@ -1227,23 +1227,23 @@ gimp_coordinates_new (GimpUnit unit, gtk_widget_show (spinbutton); gimp_size_entry_set_unit (GIMP_SIZE_ENTRY (sizeentry), - (update_policy == GIMP_SIZE_ENTRY_UPDATE_RESOLUTION) || + (update_policy == GIMP_SIZE_ENTRY_UPDATE_RESOLUTION) || (menu_show_pixels == FALSE) ? - GIMP_UNIT_INCH : GIMP_UNIT_PIXEL); + GIMP_UNIT_INCH : GIMP_UNIT_PIXEL); gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (sizeentry), 0, xres, TRUE); gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (sizeentry), 1, yres, TRUE); gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (sizeentry), 0, - lower_boundary_x, upper_boundary_x); + lower_boundary_x, upper_boundary_x); gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (sizeentry), 1, - lower_boundary_y, upper_boundary_y); + lower_boundary_y, upper_boundary_y); if (menu_show_percent) { gimp_size_entry_set_size (GIMP_SIZE_ENTRY (sizeentry), 0, - xsize_0, xsize_100); + xsize_0, xsize_100); gimp_size_entry_set_size (GIMP_SIZE_ENTRY (sizeentry), 1, - ysize_0, ysize_100); + ysize_0, ysize_100); } gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 0, x); @@ -1258,7 +1258,7 @@ gimp_coordinates_new (GimpUnit unit, if (chainbutton_active) gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (chainbutton), TRUE); gtk_table_attach (GTK_TABLE (sizeentry), chainbutton, 2, 3, 0, 2, - GTK_SHRINK | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + GTK_SHRINK | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_show (chainbutton); gcd = g_new (GimpCoordinatesData, 1); @@ -1270,12 +1270,12 @@ gimp_coordinates_new (GimpUnit unit, gcd->last_y = y; g_signal_connect_swapped (sizeentry, "destroy", - G_CALLBACK (g_free), - gcd); + G_CALLBACK (g_free), + gcd); g_signal_connect (sizeentry, "value-changed", - G_CALLBACK (gimp_coordinates_callback), - gcd); + G_CALLBACK (gimp_coordinates_callback), + gcd); g_object_set_data (G_OBJECT (sizeentry), "chainbutton", chainbutton); @@ -1295,7 +1295,7 @@ gimp_coordinates_new (GimpUnit unit, **/ GtkWidget * gimp_pixmap_button_new (gchar **xpm_data, - const gchar *text) + const gchar *text) { GtkWidget *button; GtkWidget *pixmap; @@ -1393,7 +1393,7 @@ gimp_toggle_button_sensitive_update (GtkToggleButton *toggle_button) **/ void gimp_toggle_button_update (GtkWidget *widget, - gpointer data) + gpointer data) { gint *toggle_val; @@ -1417,7 +1417,7 @@ gimp_toggle_button_update (GtkWidget *widget, **/ void gimp_radio_button_update (GtkWidget *widget, - gpointer data) + gpointer data) { gint *toggle_val; @@ -1426,7 +1426,7 @@ gimp_radio_button_update (GtkWidget *widget, toggle_val = (gint *) data; *toggle_val = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), - "gimp-item-data")); + "gimp-item-data")); } gimp_toggle_button_sensitive_update (GTK_TOGGLE_BUTTON (widget)); @@ -1443,7 +1443,7 @@ gimp_radio_button_update (GtkWidget *widget, **/ void gimp_int_adjustment_update (GtkAdjustment *adjustment, - gpointer data) + gpointer data) { gint *val; @@ -1462,7 +1462,7 @@ gimp_int_adjustment_update (GtkAdjustment *adjustment, **/ void gimp_uint_adjustment_update (GtkAdjustment *adjustment, - gpointer data) + gpointer data) { guint *val; @@ -1478,7 +1478,7 @@ gimp_uint_adjustment_update (GtkAdjustment *adjustment, **/ void gimp_float_adjustment_update (GtkAdjustment *adjustment, - gpointer data) + gpointer data) { gfloat *val; @@ -1494,7 +1494,7 @@ gimp_float_adjustment_update (GtkAdjustment *adjustment, **/ void gimp_double_adjustment_update (GtkAdjustment *adjustment, - gpointer data) + gpointer data) { gdouble *val; @@ -1518,7 +1518,7 @@ gimp_double_adjustment_update (GtkAdjustment *adjustment, **/ void gimp_unit_menu_update (GtkWidget *widget, - gpointer data) + gpointer data) { GimpUnit *val; GtkWidget *spinbutton; @@ -1528,8 +1528,8 @@ gimp_unit_menu_update (GtkWidget *widget, *val = gimp_unit_menu_get_unit (GIMP_UNIT_MENU (widget)); digits = ((*val == GIMP_UNIT_PIXEL) ? 0 : - ((*val == GIMP_UNIT_PERCENT) ? 2 : - (MIN (6, MAX (3, gimp_unit_get_digits (*val)))))); + ((*val == GIMP_UNIT_PERCENT) ? 2 : + (MIN (6, MAX (3, gimp_unit_get_digits (*val)))))); digits += gimp_unit_menu_get_pixel_digits (GIMP_UNIT_MENU (widget)); @@ -1600,14 +1600,14 @@ find_mnemonic_widget (GtkWidget *widget, **/ GtkWidget * gimp_table_attach_aligned (GtkTable *table, - gint column, - gint row, - const gchar *label_text, - gfloat xalign, - gfloat yalign, - GtkWidget *widget, - gint colspan, - gboolean left_align) + gint column, + gint row, + const gchar *label_text, + gfloat xalign, + gfloat yalign, + GtkWidget *widget, + gint colspan, + gboolean left_align) { GtkWidget *label = NULL; @@ -1619,9 +1619,9 @@ gimp_table_attach_aligned (GtkTable *table, gtk_misc_set_alignment (GTK_MISC (label), xalign, yalign); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); gtk_table_attach (table, label, - column, column + 1, - row, row + 1, - GTK_FILL, GTK_FILL, 0, 0); + column, column + 1, + row, row + 1, + GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show (label); mnemonic_widget = find_mnemonic_widget (widget, 0); @@ -1641,9 +1641,9 @@ gimp_table_attach_aligned (GtkTable *table, } gtk_table_attach (table, widget, - column + 1, column + 1 + colspan, - row, row + 1, - GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + column + 1, column + 1 + colspan, + row, row + 1, + GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_show (widget); diff --git a/libgimpwidgets/gimpwidgets.h b/libgimpwidgets/gimpwidgets.h index fcc77d517c..8c249b5e91 100644 --- a/libgimpwidgets/gimpwidgets.h +++ b/libgimpwidgets/gimpwidgets.h @@ -82,65 +82,65 @@ G_BEGIN_DECLS */ GtkWidget * gimp_int_radio_group_new (gboolean in_frame, - const gchar *frame_title, - GCallback radio_button_callback, - gpointer radio_button_callback_data, - gint initial, /* item_data */ + const gchar *frame_title, + GCallback radio_button_callback, + gpointer radio_button_callback_data, + gint initial, /* item_data */ - /* specify radio buttons as va_list: - * const gchar *label, - * gint item_data, - * GtkWidget **widget_ptr, - */ + /* specify radio buttons as va_list: + * const gchar *label, + * gint item_data, + * GtkWidget **widget_ptr, + */ - ...) G_GNUC_NULL_TERMINATED; + ...) G_GNUC_NULL_TERMINATED; void gimp_int_radio_group_set_active (GtkRadioButton *radio_button, gint item_data); GtkWidget * gimp_radio_group_new (gboolean in_frame, - const gchar *frame_title, + const gchar *frame_title, - /* specify radio buttons as va_list: - * const gchar *label, - * GCallback callback, - * gpointer callback_data, - * gpointer item_data, - * GtkWidget **widget_ptr, - * gboolean active, - */ + /* specify radio buttons as va_list: + * const gchar *label, + * GCallback callback, + * gpointer callback_data, + * gpointer item_data, + * GtkWidget **widget_ptr, + * gboolean active, + */ - ...) G_GNUC_NULL_TERMINATED; + ...) G_GNUC_NULL_TERMINATED; GtkWidget * gimp_radio_group_new2 (gboolean in_frame, - const gchar *frame_title, - GCallback radio_button_callback, - gpointer radio_button_callback_data, - gpointer initial, /* item_data */ + const gchar *frame_title, + GCallback radio_button_callback, + gpointer radio_button_callback_data, + gpointer initial, /* item_data */ - /* specify radio buttons as va_list: - * const gchar *label, - * gpointer item_data, - * GtkWidget **widget_ptr, - */ + /* specify radio buttons as va_list: + * const gchar *label, + * gpointer item_data, + * GtkWidget **widget_ptr, + */ - ...) G_GNUC_NULL_TERMINATED; + ...) G_GNUC_NULL_TERMINATED; void gimp_radio_group_set_active (GtkRadioButton *radio_button, gpointer item_data); GtkWidget * gimp_spin_button_new (/* return value: */ - GtkObject **adjustment, + GtkObject **adjustment, - gdouble value, - gdouble lower, - gdouble upper, - gdouble step_increment, - gdouble page_increment, - gdouble page_size, - gdouble climb_rate, - guint digits); + gdouble value, + gdouble lower, + gdouble upper, + gdouble step_increment, + gdouble page_increment, + gdouble page_size, + gdouble climb_rate, + guint digits); #define GIMP_SCALE_ENTRY_LABEL(adj) \ (g_object_get_data (G_OBJECT (adj), "label")) @@ -208,42 +208,42 @@ gboolean gimp_scale_entry_get_logarithmic (GtkObject *adjustment); (g_object_get_data (G_OBJECT(hbox), "toggle")) GtkWidget * gimp_random_seed_new (guint32 *seed, - gboolean *random_seed); + gboolean *random_seed); #define GIMP_COORDINATES_CHAINBUTTON(sizeentry) \ (g_object_get_data (G_OBJECT (sizeentry), "chainbutton")) GtkWidget * gimp_coordinates_new (GimpUnit unit, - const gchar *unit_format, - gboolean menu_show_pixels, - gboolean menu_show_percent, - gint spinbutton_width, - GimpSizeEntryUpdatePolicy update_policy, + const gchar *unit_format, + gboolean menu_show_pixels, + gboolean menu_show_percent, + gint spinbutton_width, + GimpSizeEntryUpdatePolicy update_policy, - gboolean chainbutton_active, - gboolean chain_constrains_ratio, + gboolean chainbutton_active, + gboolean chain_constrains_ratio, - const gchar *xlabel, - gdouble x, - gdouble xres, - gdouble lower_boundary_x, - gdouble upper_boundary_x, - gdouble xsize_0, /* % */ - gdouble xsize_100, /* % */ + const gchar *xlabel, + gdouble x, + gdouble xres, + gdouble lower_boundary_x, + gdouble upper_boundary_x, + gdouble xsize_0, /* % */ + gdouble xsize_100, /* % */ - const gchar *ylabel, - gdouble y, - gdouble yres, - gdouble lower_boundary_y, - gdouble upper_boundary_y, - gdouble ysize_0, /* % */ - gdouble ysize_100 /* % */); + const gchar *ylabel, + gdouble y, + gdouble yres, + gdouble lower_boundary_y, + gdouble upper_boundary_y, + gdouble ysize_0, /* % */ + gdouble ysize_100 /* % */); #ifndef GIMP_DISABLE_DEPRECATED GtkWidget * gimp_pixmap_button_new (gchar **xpm_data, - const gchar *text); + const gchar *text); #endif @@ -255,25 +255,25 @@ GtkWidget * gimp_pixmap_button_new (gchar **xpm_data, void gimp_toggle_button_sensitive_update (GtkToggleButton *toggle_button); void gimp_toggle_button_update (GtkWidget *widget, - gpointer data); + gpointer data); void gimp_radio_button_update (GtkWidget *widget, - gpointer data); + gpointer data); void gimp_int_adjustment_update (GtkAdjustment *adjustment, - gpointer data); + gpointer data); void gimp_uint_adjustment_update (GtkAdjustment *adjustment, - gpointer data); + gpointer data); void gimp_float_adjustment_update (GtkAdjustment *adjustment, - gpointer data); + gpointer data); void gimp_double_adjustment_update (GtkAdjustment *adjustment, - gpointer data); + gpointer data); void gimp_unit_menu_update (GtkWidget *widget, - gpointer data); + gpointer data); /* @@ -281,14 +281,14 @@ void gimp_unit_menu_update (GtkWidget *widget, */ GtkWidget * gimp_table_attach_aligned (GtkTable *table, - gint column, - gint row, - const gchar *label_text, - gfloat xalign, - gfloat yalign, - GtkWidget *widget, - gint colspan, - gboolean left_align); + gint column, + gint row, + const gchar *label_text, + gfloat xalign, + gfloat yalign, + GtkWidget *widget, + gint colspan, + gboolean left_align); void gimp_label_set_attributes (GtkLabel *label,