From dc4757cedce49378437a537e7a6e73b3143208c0 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Tue, 25 Oct 2005 12:08:32 +0000 Subject: [PATCH] add G_GNUC_INTERNAL to declaration of wrapped PDB functions. 2005-10-25 Sven Neumann * tools/pdbgen/lib.pl: add G_GNUC_INTERNAL to declaration of wrapped PDB functions. * libgimp/gimpchannel_pdb.h * libgimp/gimpdrawable_pdb.h * libgimp/gimpgimprc_pdb.h * libgimp/gimpimage_pdb.h * libgimp/gimplayer_pdb.h * libgimp/gimpplugin_pdb.h * libgimp/gimpproceduraldb_pdb.h * libgimp/gimpprogress_pdb.h * libgimp/gimpselection_pdb.h * libgimp/gimpunit_pdb.h: regenerated. * libgimp/gimptile.h * libgimp/gimpunitcache.h * libgimpthumb/gimpthumb-utils.h * libgimpwidgets/gimpcolorarea.h * libgimpwidgets/gimphelpui.h: declare internal functions as such using G_GNUC_INTERNAL. --- ChangeLog | 23 +++++++++++++++++++++++ NEWS | 3 +++ libgimp/gimpchannel_pdb.h | 2 +- libgimp/gimpdrawable_pdb.h | 4 ++-- libgimp/gimpgimprc_pdb.h | 2 +- libgimp/gimpimage_pdb.h | 6 +++--- libgimp/gimplayer_pdb.h | 4 ++-- libgimp/gimpplugin_pdb.h | 2 +- libgimp/gimpproceduraldb_pdb.h | 6 +++--- libgimp/gimpprogress_pdb.h | 4 ++-- libgimp/gimpselection_pdb.h | 2 +- libgimp/gimptile.h | 2 +- libgimp/gimpunit_pdb.h | 24 ++++++++++++------------ libgimp/gimpunitcache.h | 24 ++++++++++++------------ libgimpthumb/gimpthumb-utils.h | 4 ++-- libgimpwidgets/gimpcolorarea.h | 3 ++- libgimpwidgets/gimphelpui.h | 2 +- tools/pdbgen/lib.pl | 10 ++++++++-- 18 files changed, 80 insertions(+), 47 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8d6da41888..de90ae9968 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +2005-10-25 Sven Neumann + + * tools/pdbgen/lib.pl: add G_GNUC_INTERNAL to declaration of + wrapped PDB functions. + + * libgimp/gimpchannel_pdb.h + * libgimp/gimpdrawable_pdb.h + * libgimp/gimpgimprc_pdb.h + * libgimp/gimpimage_pdb.h + * libgimp/gimplayer_pdb.h + * libgimp/gimpplugin_pdb.h + * libgimp/gimpproceduraldb_pdb.h + * libgimp/gimpprogress_pdb.h + * libgimp/gimpselection_pdb.h + * libgimp/gimpunit_pdb.h: regenerated. + + * libgimp/gimptile.h + * libgimp/gimpunitcache.h + * libgimpthumb/gimpthumb-utils.h + * libgimpwidgets/gimpcolorarea.h + * libgimpwidgets/gimphelpui.h: declare internal functions as such + using G_GNUC_INTERNAL. + 2005-10-25 Sven Neumann * tools/pdbgen/pdb/paths.pdb: added getter and setter for path diff --git a/NEWS b/NEWS index 9772717d3d..07694edee6 100644 --- a/NEWS +++ b/NEWS @@ -21,6 +21,9 @@ Changes in GIMP 2.3.5 - menu reorganisation in the Toolbox menu - export "Open As Layer" to the PDB as file-load-layer - added keyboard control for the Curves tool +- load and save embedded ICC profiles from/to PNG images +- improved appearance of some tool icons on dark background +- added PDB API to get and set path visibility - bug fixes and code cleanup diff --git a/libgimp/gimpchannel_pdb.h b/libgimp/gimpchannel_pdb.h index 99ab2c2a19..b4c14614d7 100644 --- a/libgimp/gimpchannel_pdb.h +++ b/libgimp/gimpchannel_pdb.h @@ -34,7 +34,7 @@ gint32 _gimp_channel_new (gint32 image_ID, gint height, const gchar *name, gdouble opacity, - const GimpRGB *color); + const GimpRGB *color) G_GNUC_INTERNAL; gint32 gimp_channel_new_from_component (gint32 image_ID, GimpChannelType component, const gchar *name); diff --git a/libgimp/gimpdrawable_pdb.h b/libgimp/gimpdrawable_pdb.h index 79376c03ad..45a7f2d8c9 100644 --- a/libgimp/gimpdrawable_pdb.h +++ b/libgimp/gimpdrawable_pdb.h @@ -102,7 +102,7 @@ gboolean _gimp_drawable_thumbnail (gint32 draw gint *ret_height, gint *bpp, gint *thumbnail_data_count, - guint8 **thumbnail_data); + guint8 **thumbnail_data) G_GNUC_INTERNAL; gboolean _gimp_drawable_sub_thumbnail (gint32 drawable_ID, gint src_x, gint src_y, @@ -114,7 +114,7 @@ gboolean _gimp_drawable_sub_thumbnail (gint32 draw gint *height, gint *bpp, gint *thumbnail_data_count, - guint8 **thumbnail_data); + guint8 **thumbnail_data) G_GNUC_INTERNAL; gboolean gimp_drawable_foreground_extract (gint32 drawable_ID, GimpForegroundExtractMode mode, gint32 mask_ID); diff --git a/libgimp/gimpgimprc_pdb.h b/libgimp/gimpgimprc_pdb.h index fc0cd35cb1..5256980ce6 100644 --- a/libgimp/gimpgimprc_pdb.h +++ b/libgimp/gimpgimprc_pdb.h @@ -36,7 +36,7 @@ gchar* gimp_get_default_comment (void); gboolean gimp_get_monitor_resolution (gdouble *xres, gdouble *yres); gchar* gimp_get_theme_dir (void); -gchar* _gimp_get_color_configuration (void); +gchar* _gimp_get_color_configuration (void) G_GNUC_INTERNAL; gchar* gimp_get_module_load_inhibit (void); diff --git a/libgimp/gimpimage_pdb.h b/libgimp/gimpimage_pdb.h index 5d1e3b6a68..0f42a1ba90 100644 --- a/libgimp/gimpimage_pdb.h +++ b/libgimp/gimpimage_pdb.h @@ -107,10 +107,10 @@ gint32 gimp_image_merge_down (gint32 ima gint32 merge_layer_ID, GimpMergeType merge_type); guint8* _gimp_image_get_colormap (gint32 image_ID, - gint *num_bytes); + gint *num_bytes) G_GNUC_INTERNAL; gboolean _gimp_image_set_colormap (gint32 image_ID, gint num_bytes, - const guint8 *colormap); + const guint8 *colormap) G_GNUC_INTERNAL; gboolean gimp_image_clean_all (gint32 image_ID); gboolean gimp_image_is_dirty (gint32 image_ID); gboolean _gimp_image_thumbnail (gint32 image_ID, @@ -120,7 +120,7 @@ gboolean _gimp_image_thumbnail (gint32 ima gint *ret_height, gint *bpp, gint *thumbnail_data_count, - guint8 **thumbnail_data); + guint8 **thumbnail_data) G_GNUC_INTERNAL; gint32 gimp_image_get_active_layer (gint32 image_ID); gboolean gimp_image_set_active_layer (gint32 image_ID, gint32 active_layer_ID); diff --git a/libgimp/gimplayer_pdb.h b/libgimp/gimplayer_pdb.h index f969145d0d..c914c03826 100644 --- a/libgimp/gimplayer_pdb.h +++ b/libgimp/gimplayer_pdb.h @@ -35,11 +35,11 @@ gint32 _gimp_layer_new (gint32 imag GimpImageType type, const gchar *name, gdouble opacity, - GimpLayerModeEffects mode); + GimpLayerModeEffects mode) G_GNUC_INTERNAL; gint32 gimp_layer_new_from_drawable (gint32 drawable_ID, gint32 dest_image_ID); gint32 _gimp_layer_copy (gint32 layer_ID, - gboolean add_alpha); + gboolean add_alpha) G_GNUC_INTERNAL; gboolean gimp_layer_add_alpha (gint32 layer_ID); gboolean gimp_layer_scale (gint32 layer_ID, gint new_width, diff --git a/libgimp/gimpplugin_pdb.h b/libgimp/gimpplugin_pdb.h index de72022d5a..fb02371262 100644 --- a/libgimp/gimpplugin_pdb.h +++ b/libgimp/gimpplugin_pdb.h @@ -40,7 +40,7 @@ gboolean gimp_plugin_menu_branch_register (const gchar *menu_path, gboolean _gimp_plugin_icon_register (const gchar *procedure_name, GimpIconType icon_type, gint icon_data_length, - const guint8 *icon_data); + const guint8 *icon_data) G_GNUC_INTERNAL; G_END_DECLS diff --git a/libgimp/gimpproceduraldb_pdb.h b/libgimp/gimpproceduraldb_pdb.h index 42a631dc82..e3ea1d2737 100644 --- a/libgimp/gimpproceduraldb_pdb.h +++ b/libgimp/gimpproceduraldb_pdb.h @@ -48,7 +48,7 @@ gboolean _gimp_procedural_db_proc_info (const gchar *procedure, gchar **date, GimpPDBProcType *proc_type, gint *num_args, - gint *num_values); + gint *num_values) G_GNUC_INTERNAL; gboolean gimp_procedural_db_proc_arg (const gchar *procedure, gint arg_num, GimpPDBArgType *arg_type, @@ -61,11 +61,11 @@ gboolean gimp_procedural_db_proc_val (const gchar *procedure, gchar **val_desc); gboolean _gimp_procedural_db_get_data (const gchar *identifier, gint *bytes, - guint8 **data); + guint8 **data) G_GNUC_INTERNAL; gint gimp_procedural_db_get_data_size (const gchar *identifier); gboolean _gimp_procedural_db_set_data (const gchar *identifier, gint bytes, - const guint8 *data); + const guint8 *data) G_GNUC_INTERNAL; G_END_DECLS diff --git a/libgimp/gimpprogress_pdb.h b/libgimp/gimpprogress_pdb.h index f6d954662a..533794cf7f 100644 --- a/libgimp/gimpprogress_pdb.h +++ b/libgimp/gimpprogress_pdb.h @@ -34,8 +34,8 @@ gboolean gimp_progress_update (gdouble percentage); gboolean gimp_progress_pulse (void); gboolean gimp_progress_set_text (const gchar *message); gint gimp_progress_get_window_handle (void); -gboolean _gimp_progress_install (const gchar *progress_callback); -gboolean _gimp_progress_uninstall (const gchar *progress_callback); +gboolean _gimp_progress_install (const gchar *progress_callback) G_GNUC_INTERNAL; +gboolean _gimp_progress_uninstall (const gchar *progress_callback) G_GNUC_INTERNAL; gboolean gimp_progress_cancel (const gchar *progress_callback); diff --git a/libgimp/gimpselection_pdb.h b/libgimp/gimpselection_pdb.h index 93eda5a7d4..5a61aed2cc 100644 --- a/libgimp/gimpselection_pdb.h +++ b/libgimp/gimpselection_pdb.h @@ -44,7 +44,7 @@ gboolean gimp_selection_translate (gint32 image_ID, gint offy); gint32 _gimp_selection_float (gint32 drawable_ID, gint offx, - gint offy); + gint offy) G_GNUC_INTERNAL; gboolean gimp_selection_invert (gint32 image_ID); gboolean gimp_selection_sharpen (gint32 image_ID); gboolean gimp_selection_all (gint32 image_ID); diff --git a/libgimp/gimptile.h b/libgimp/gimptile.h index a1fed31372..fa43c5dd3d 100644 --- a/libgimp/gimptile.h +++ b/libgimp/gimptile.h @@ -53,7 +53,7 @@ void gimp_tile_cache_ntiles (gulong ntiles); /* private function */ -void _gimp_tile_cache_flush_drawable (GimpDrawable *drawable); +void _gimp_tile_cache_flush_drawable (GimpDrawable *drawable) G_GNUC_INTERNAL; G_END_DECLS diff --git a/libgimp/gimpunit_pdb.h b/libgimp/gimpunit_pdb.h index b0af1ef9ef..2241fe2e4b 100644 --- a/libgimp/gimpunit_pdb.h +++ b/libgimp/gimpunit_pdb.h @@ -29,25 +29,25 @@ G_BEGIN_DECLS /* For information look into the C source or the html documentation */ -gint _gimp_unit_get_number_of_units (void); -gint _gimp_unit_get_number_of_built_in_units (void); +gint _gimp_unit_get_number_of_units (void) G_GNUC_INTERNAL; +gint _gimp_unit_get_number_of_built_in_units (void) G_GNUC_INTERNAL; GimpUnit _gimp_unit_new (const gchar *identifier, gdouble factor, gint digits, const gchar *symbol, const gchar *abbreviation, const gchar *singular, - const gchar *plural); -gboolean _gimp_unit_get_deletion_flag (GimpUnit unit_id); + const gchar *plural) G_GNUC_INTERNAL; +gboolean _gimp_unit_get_deletion_flag (GimpUnit unit_id) G_GNUC_INTERNAL; gboolean _gimp_unit_set_deletion_flag (GimpUnit unit_id, - gboolean deletion_flag); -gchar* _gimp_unit_get_identifier (GimpUnit unit_id); -gdouble _gimp_unit_get_factor (GimpUnit unit_id); -gint _gimp_unit_get_digits (GimpUnit unit_id); -gchar* _gimp_unit_get_symbol (GimpUnit unit_id); -gchar* _gimp_unit_get_abbreviation (GimpUnit unit_id); -gchar* _gimp_unit_get_singular (GimpUnit unit_id); -gchar* _gimp_unit_get_plural (GimpUnit unit_id); + gboolean deletion_flag) G_GNUC_INTERNAL; +gchar* _gimp_unit_get_identifier (GimpUnit unit_id) G_GNUC_INTERNAL; +gdouble _gimp_unit_get_factor (GimpUnit unit_id) G_GNUC_INTERNAL; +gint _gimp_unit_get_digits (GimpUnit unit_id) G_GNUC_INTERNAL; +gchar* _gimp_unit_get_symbol (GimpUnit unit_id) G_GNUC_INTERNAL; +gchar* _gimp_unit_get_abbreviation (GimpUnit unit_id) G_GNUC_INTERNAL; +gchar* _gimp_unit_get_singular (GimpUnit unit_id) G_GNUC_INTERNAL; +gchar* _gimp_unit_get_plural (GimpUnit unit_id) G_GNUC_INTERNAL; G_END_DECLS diff --git a/libgimp/gimpunitcache.h b/libgimp/gimpunitcache.h index 6368172cbb..cfbf4d6222 100644 --- a/libgimp/gimpunitcache.h +++ b/libgimp/gimpunitcache.h @@ -26,8 +26,8 @@ G_BEGIN_DECLS -gint _gimp_unit_cache_get_number_of_units (void); -gint _gimp_unit_cache_get_number_of_built_in_units (void); +gint _gimp_unit_cache_get_number_of_units (void) G_GNUC_INTERNAL; +gint _gimp_unit_cache_get_number_of_built_in_units (void) G_GNUC_INTERNAL; GimpUnit _gimp_unit_cache_new (gchar *identifier, gdouble factor, @@ -35,17 +35,17 @@ GimpUnit _gimp_unit_cache_new (gchar *identifier, gchar *symbol, gchar *abbreviation, gchar *singular, - gchar *plural); -gboolean _gimp_unit_cache_get_deletion_flag (GimpUnit unit); + gchar *plural) G_GNUC_INTERNAL; +gboolean _gimp_unit_cache_get_deletion_flag (GimpUnit unit) G_GNUC_INTERNAL; void _gimp_unit_cache_set_deletion_flag (GimpUnit unit, - gboolean deletion_flag); -gdouble _gimp_unit_cache_get_factor (GimpUnit unit); -gint _gimp_unit_cache_get_digits (GimpUnit unit); -const gchar * _gimp_unit_cache_get_identifier (GimpUnit unit); -const gchar * _gimp_unit_cache_get_symbol (GimpUnit unit); -const gchar * _gimp_unit_cache_get_abbreviation (GimpUnit unit); -const gchar * _gimp_unit_cache_get_singular (GimpUnit unit); -const gchar * _gimp_unit_cache_get_plural (GimpUnit unit); + gboolean deletion_flag) G_GNUC_INTERNAL; +gdouble _gimp_unit_cache_get_factor (GimpUnit unit) G_GNUC_INTERNAL; +gint _gimp_unit_cache_get_digits (GimpUnit unit) G_GNUC_INTERNAL; +const gchar * _gimp_unit_cache_get_identifier (GimpUnit unit) G_GNUC_INTERNAL; +const gchar * _gimp_unit_cache_get_symbol (GimpUnit unit) G_GNUC_INTERNAL; +const gchar * _gimp_unit_cache_get_abbreviation (GimpUnit unit) G_GNUC_INTERNAL; +const gchar * _gimp_unit_cache_get_singular (GimpUnit unit) G_GNUC_INTERNAL; +const gchar * _gimp_unit_cache_get_plural (GimpUnit unit) G_GNUC_INTERNAL; G_END_DECLS diff --git a/libgimpthumb/gimpthumb-utils.h b/libgimpthumb/gimpthumb-utils.h index 94eddc1b8a..b4d385d1b8 100644 --- a/libgimpthumb/gimpthumb-utils.h +++ b/libgimpthumb/gimpthumb-utils.h @@ -59,8 +59,8 @@ void gimp_thumbs_delete_for_uri_local (const gchar *uri); /* for internal use only */ void _gimp_thumbs_delete_others (const gchar *uri, - GimpThumbSize size); -gchar * _gimp_thumb_filename_from_uri (const gchar *uri); + GimpThumbSize size) G_GNUC_INTERNAL; +gchar * _gimp_thumb_filename_from_uri (const gchar *uri) G_GNUC_INTERNAL; G_END_DECLS diff --git a/libgimpwidgets/gimpcolorarea.h b/libgimpwidgets/gimpcolorarea.h index a69df08242..3ed3c7fc88 100644 --- a/libgimpwidgets/gimpcolorarea.h +++ b/libgimpwidgets/gimpcolorarea.h @@ -97,7 +97,8 @@ void _gimp_color_area_render_buf (GtkWidget *widget, guint width, guint height, guint rowstride, - GimpRGB *color); + GimpRGB *color) G_GNUC_INTERNAL; + G_END_DECLS diff --git a/libgimpwidgets/gimphelpui.h b/libgimpwidgets/gimphelpui.h index 5eee690208..325fccb118 100644 --- a/libgimpwidgets/gimphelpui.h +++ b/libgimpwidgets/gimphelpui.h @@ -28,7 +28,7 @@ G_BEGIN_DECLS /* For information look into the C source or the html documentation */ -void _gimp_help_init (void); +void _gimp_help_init (void) G_GNUC_INTERNAL; void gimp_help_enable_tooltips (void); void gimp_help_disable_tooltips (void); diff --git a/tools/pdbgen/lib.pl b/tools/pdbgen/lib.pl index c139818dd8..182f202e3b 100644 --- a/tools/pdbgen/lib.pl +++ b/tools/pdbgen/lib.pl @@ -81,7 +81,8 @@ sub generate { my @inargs = @{$proc->{inargs}} if exists $proc->{inargs}; my @outargs = @{$proc->{outargs}} if exists $proc->{outargs}; - my $funcname = "gimp_$name"; my $wrapped = ""; my %usednames; + my $funcname = "gimp_$name"; my $wrapped = ""; my $attribute = ""; + my %usednames; my $retdesc = ""; if ($proc->{deprecated} && !$out->{deprecated}) { @@ -133,6 +134,7 @@ sub generate { my $id = exists $arg->{id_func} || $_->{type} =~ /guide/; $wrapped = "_" if exists $_->{wrap}; + $attribute = " G_GNUC_INTERNAL" if exists $_->{wrap}; $usednames{$_->{name}}++; @@ -198,6 +200,7 @@ sub generate { $return_marshal = "" unless $once++; $wrapped = "_" if exists $_->{wrap}; + $attribute = " G_GNUC_INTERNAL" if exists $_->{wrap}; $_->{libname} = exists $usednames{$_->{name}} ? "ret_$_->{name}" : $_->{name}; @@ -439,7 +442,7 @@ CODE # Our function prototype for the headers (my $hrettype = $rettype) =~ s/ //g; - my $proto = "$hrettype $wrapped$funcname ($arglist);\n"; + my $proto = "$hrettype $wrapped$funcname ($arglist)$attribute;\n"; $proto =~ s/ +/ /g; push @{$out->{protos}}, $proto; @@ -605,6 +608,9 @@ LGPL foreach (@args) { $space = rindex($_, ' '); + if ($space > 0 && substr($_, $space - 1, 1) eq ')') { + $space = rindex($_, ' ', $space - 1) + } my $len = $longest[2] - $space + 1; $len -= scalar @{[ /\*/g ]};