diff --git a/ChangeLog b/ChangeLog index 934384477e..377323284e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2005-06-26 Sven Neumann + + * tools/pdbgen/pdb/gimprc.pdb: allow to access (read-only) the + current color management configuration through the PDB. + + * libgimp/gimpgimprc_pdb.[ch] + * app/pdb/gimprc_cmds.c + * app/pdb/internal_procs.c: regenerated. + + * libgimp/Makefile.am + * libgimp/gimp.h + * libgimp/gimpgimprc.[ch]: wrap the new PDB function to make it + easier to use from plug-ins. This change adds a dependency on + libgimpconfig to libgimp. + + * gimp.pc.in: changed accordingly. + + * plug-ins/FractalExplorer/Dialogs.c + * plug-ins/gfig/gfig-dialog.c + * plug-ins/gflare/gflare.c: no need to include gimpconfig.h + explicitely any longer. + + * libgimp/gimpfontselectbutton.c: fixed gtk-doc comments. + 2005-06-26 Sven Neumann * modules/cdisplay_lcms.c: also use bold, right-aligned labels here. diff --git a/app/pdb/gimprc_cmds.c b/app/pdb/gimprc_cmds.c index 7bde46a207..1302ff5e0e 100644 --- a/app/pdb/gimprc_cmds.c +++ b/app/pdb/gimprc_cmds.c @@ -24,6 +24,7 @@ #include +#include "libgimpconfig/gimpconfig.h" #include "libgimpmodule/gimpmodule.h" #include "pdb-types.h" @@ -40,6 +41,7 @@ static ProcRecord gimprc_set_proc; static ProcRecord get_default_comment_proc; static ProcRecord get_monitor_resolution_proc; static ProcRecord get_theme_dir_proc; +static ProcRecord get_color_configuration_proc; static ProcRecord get_module_load_inhibit_proc; void @@ -50,6 +52,7 @@ register_gimprc_procs (Gimp *gimp) procedural_db_register (gimp, &get_default_comment_proc); procedural_db_register (gimp, &get_monitor_resolution_proc); procedural_db_register (gimp, &get_theme_dir_proc); + procedural_db_register (gimp, &get_color_configuration_proc); procedural_db_register (gimp, &get_module_load_inhibit_proc); } @@ -323,6 +326,49 @@ static ProcRecord get_theme_dir_proc = { { get_theme_dir_invoker } } }; +static Argument * +get_color_configuration_invoker (Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + Argument *args) +{ + Argument *return_args; + gchar *config; + + config = gimp_config_serialize_to_string (GIMP_CONFIG (gimp->config->color_management), NULL); + + return_args = procedural_db_return_args (&get_color_configuration_proc, TRUE); + return_args[1].value.pdb_pointer = config; + + return return_args; +} + +static ProcArg get_color_configuration_outargs[] = +{ + { + GIMP_PDB_STRING, + "config", + "Serialized color management configuration" + } +}; + +static ProcRecord get_color_configuration_proc = +{ + "gimp_get_color_configuration", + "Get a serialized version of the color management configuration.", + "Returns a string that can be deserialized into a GimpColorConfig object representing the current color management configuration.", + "Sven Neumann", + "Sven Neumann", + "2005", + NULL, + GIMP_INTERNAL, + 0, + NULL, + 1, + get_color_configuration_outargs, + { { get_color_configuration_invoker } } +}; + static Argument * get_module_load_inhibit_invoker (Gimp *gimp, GimpContext *context, diff --git a/app/pdb/internal_procs.c b/app/pdb/internal_procs.c index 381eef06de..8e0103b047 100644 --- a/app/pdb/internal_procs.c +++ b/app/pdb/internal_procs.c @@ -75,7 +75,7 @@ void register_undo_procs (Gimp *gimp); void register_unit_procs (Gimp *gimp); void register_vectors_procs (Gimp *gimp); -/* 462 procedures registered total */ +/* 463 procedures registered total */ void internal_procs_init (Gimp *gimp, @@ -111,13 +111,13 @@ internal_procs_init (Gimp *gimp, (* status_callback) (NULL, _("Drawable procedures"), 0.186); register_drawable_procs (gimp); - (* status_callback) (NULL, _("Transformation procedures"), 0.26); + (* status_callback) (NULL, _("Transformation procedures"), 0.259); register_drawable_transform_procs (gimp); (* status_callback) (NULL, _("Edit procedures"), 0.294); register_edit_procs (gimp); - (* status_callback) (NULL, _("File Operations"), 0.314); + (* status_callback) (NULL, _("File Operations"), 0.313); register_fileops_procs (gimp); (* status_callback) (NULL, _("Floating selections"), 0.335); @@ -126,70 +126,70 @@ internal_procs_init (Gimp *gimp, (* status_callback) (NULL, _("Font UI"), 0.348); register_font_select_procs (gimp); - (* status_callback) (NULL, _("Fonts"), 0.355); + (* status_callback) (NULL, _("Fonts"), 0.354); register_fonts_procs (gimp); (* status_callback) (NULL, _("Gimprc procedures"), 0.359); register_gimprc_procs (gimp); - (* status_callback) (NULL, _("Gradient"), 0.372); + (* status_callback) (NULL, _("Gradient"), 0.374); register_gradient_procs (gimp); - (* status_callback) (NULL, _("Gradient UI"), 0.437); + (* status_callback) (NULL, _("Gradient UI"), 0.438); register_gradient_select_procs (gimp); - (* status_callback) (NULL, _("Gradients"), 0.444); + (* status_callback) (NULL, _("Gradients"), 0.445); register_gradients_procs (gimp); - (* status_callback) (NULL, _("Guide procedures"), 0.455); + (* status_callback) (NULL, _("Guide procedures"), 0.456); register_guides_procs (gimp); - (* status_callback) (NULL, _("Help procedures"), 0.468); + (* status_callback) (NULL, _("Help procedures"), 0.469); register_help_procs (gimp); - (* status_callback) (NULL, _("Image"), 0.47); + (* status_callback) (NULL, _("Image"), 0.471); register_image_procs (gimp); - (* status_callback) (NULL, _("Layer"), 0.606); + (* status_callback) (NULL, _("Layer"), 0.607); register_layer_procs (gimp); (* status_callback) (NULL, _("Message procedures"), 0.665); register_message_procs (gimp); - (* status_callback) (NULL, _("Miscellaneous"), 0.671); + (* status_callback) (NULL, _("Miscellaneous"), 0.672); register_misc_procs (gimp); - (* status_callback) (NULL, _("Paint Tool procedures"), 0.675); + (* status_callback) (NULL, _("Paint Tool procedures"), 0.676); register_paint_tools_procs (gimp); (* status_callback) (NULL, _("Palette"), 0.708); register_palette_procs (gimp); - (* status_callback) (NULL, _("Palette UI"), 0.738); + (* status_callback) (NULL, _("Palette UI"), 0.739); register_palette_select_procs (gimp); (* status_callback) (NULL, _("Palettes"), 0.745); register_palettes_procs (gimp); - (* status_callback) (NULL, _("Parasite procedures"), 0.753); + (* status_callback) (NULL, _("Parasite procedures"), 0.754); register_parasite_procs (gimp); - (* status_callback) (NULL, _("Paths"), 0.779); + (* status_callback) (NULL, _("Paths"), 0.78); register_paths_procs (gimp); (* status_callback) (NULL, _("Pattern"), 0.814); register_pattern_procs (gimp); - (* status_callback) (NULL, _("Pattern UI"), 0.818); + (* status_callback) (NULL, _("Pattern UI"), 0.819); register_pattern_select_procs (gimp); (* status_callback) (NULL, _("Patterns"), 0.825); register_patterns_procs (gimp); - (* status_callback) (NULL, _("Plug-in"), 0.833); + (* status_callback) (NULL, _("Plug-in"), 0.834); register_plug_in_procs (gimp); - (* status_callback) (NULL, _("Procedural database"), 0.846); + (* status_callback) (NULL, _("Procedural database"), 0.847); register_procedural_db_procs (gimp); (* status_callback) (NULL, _("Progress"), 0.866); diff --git a/devel-docs/ChangeLog b/devel-docs/ChangeLog index e3f3037749..179958cac0 100644 --- a/devel-docs/ChangeLog +++ b/devel-docs/ChangeLog @@ -1,3 +1,13 @@ +2005-06-26 Sven Neumann + + * libgimp/libgimp-docs.sgml + * libgimp/libgimp-sections.txt + * libgimp/libgimp.types: updated. + + * libgimp/tmpl/gimpfontselectbutton.sgml: added new file. + + * libgimp/tmpl/gimpgimprc.sgml: regenerated. + 2005-06-25 Sven Neumann * libgimpwidgets/libgimpwidgets-docs.sgml diff --git a/devel-docs/libgimp/libgimp-docs.sgml b/devel-docs/libgimp/libgimp-docs.sgml index a4bfc7a35c..d8825b5b82 100644 --- a/devel-docs/libgimp/libgimp-docs.sgml +++ b/devel-docs/libgimp/libgimp-docs.sgml @@ -81,6 +81,7 @@ Controlling the Core's Selection Dialogs + diff --git a/devel-docs/libgimp/libgimp-sections.txt b/devel-docs/libgimp/libgimp-sections.txt index bbefde8da1..a4abddfb07 100644 --- a/devel-docs/libgimp/libgimp-sections.txt +++ b/devel-docs/libgimp/libgimp-sections.txt @@ -374,6 +374,7 @@ gimp_fonts_set_popup gimpgimprc gimp_gimprc_query gimp_gimprc_set +gimp_get_color_configuration gimp_get_default_comment gimp_get_module_load_inhibit gimp_get_monitor_resolution @@ -918,6 +919,26 @@ GIMP_IS_PROGRESS_BAR_CLASS GIMP_PROGRESS_BAR_GET_CLASS +
+gimpfontselectbutton +GimpFontSelectButton +GimpFontSelectButton +gimp_font_select_button_new +gimp_font_select_button_get_font_name +gimp_font_select_button_set_font_name +gimp_font_select_button_close_popup + +GimpFontSelectButtonPrivate +GimpFontSelectButtonClass +GIMP_FONT_SELECT_BUTTON +GIMP_IS_FONT_SELECT_BUTTON +GIMP_TYPE_FONT_SELECT_BUTTON +gimp_font_select_button_get_type +GIMP_FONT_SELECT_BUTTON_CLASS +GIMP_IS_FONT_SELECT_BUTTON_CLASS +GIMP_FONT_SELECT_BUTTON_GET_CLASS +
+
gimpmenu GimpConstraintFunc diff --git a/devel-docs/libgimp/libgimp.types b/devel-docs/libgimp/libgimp.types index 84814720a4..5f3ae5442a 100644 --- a/devel-docs/libgimp/libgimp.types +++ b/devel-docs/libgimp/libgimp.types @@ -6,6 +6,7 @@ gimp_aspect_preview_get_type gimp_channel_combo_box_get_type gimp_drawable_combo_box_get_type gimp_drawable_preview_get_type +gimp_font_select_button_get_type gimp_image_combo_box_get_type gimp_layer_combo_box_get_type gimp_progress_bar_get_type diff --git a/devel-docs/libgimp/tmpl/gimpfontselectbutton.sgml b/devel-docs/libgimp/tmpl/gimpfontselectbutton.sgml new file mode 100644 index 0000000000..7613baccbe --- /dev/null +++ b/devel-docs/libgimp/tmpl/gimpfontselectbutton.sgml @@ -0,0 +1,77 @@ + +GimpFontSelectButton + + + + + + + + + + + + + + + + + + + + + + + + + +@gimpfontselectbutton: the object which received the signal. +@arg1: +@arg2: + + + + + + + + + + + + + + + + +@title: +@font_name: +@Returns: + + + + + + + +@button: +@Returns: + + + + + + + +@button: +@font_name: + + + + + + + +@button: + + diff --git a/devel-docs/libgimp/tmpl/gimpgimprc.sgml b/devel-docs/libgimp/tmpl/gimpgimprc.sgml index 020923bafd..76f2efd4dc 100644 --- a/devel-docs/libgimp/tmpl/gimpgimprc.sgml +++ b/devel-docs/libgimp/tmpl/gimpgimprc.sgml @@ -34,6 +34,14 @@ Interactions with settings from .gimprc. @Returns: + + + + + +@Returns: + + diff --git a/gimp.pc.in b/gimp.pc.in index ec558e937d..0352da07e5 100644 --- a/gimp.pc.in +++ b/gimp.pc.in @@ -12,5 +12,5 @@ Name: GIMP Description: GIMP Library Version: @GIMP_REAL_VERSION@ Requires: glib-2.0 -Libs: -L${libdir} -lgimp-@GIMP_API_VERSION@ -lgimpmath-@GIMP_API_VERSION@ -lgimpcolor-@GIMP_API_VERSION@ -lgimpbase-@GIMP_API_VERSION@ @RT_LIBS@ +Libs: -L${libdir} -lgimp-@GIMP_API_VERSION@ -lgimpmath-@GIMP_API_VERSION@ -lgimpconfig-@GIMP_API_VERSION@ -lgimpcolor-@GIMP_API_VERSION@ -lgimpbase-@GIMP_API_VERSION@ @RT_LIBS@ Cflags: -I${includedir}/gimp-@GIMP_API_VERSION@ diff --git a/libgimp/Makefile.am b/libgimp/Makefile.am index ec4612fedc..783e49740d 100644 --- a/libgimp/Makefile.am +++ b/libgimp/Makefile.am @@ -2,6 +2,7 @@ libgimpbase = $(top_builddir)/libgimpbase/libgimpbase-$(GIMP_API_VERSION).la libgimpcolor = $(top_builddir)/libgimpcolor/libgimpcolor-$(GIMP_API_VERSION).la +libgimpconfig = $(top_builddir)/libgimpconfig/libgimpconfig-$(GIMP_API_VERSION).la libgimpmodule = $(top_builddir)/libgimpmodule/libgimpmodule-$(GIMP_API_VERSION).la libgimpwidgets = $(top_builddir)/libgimpwidgets/libgimpwidgets-$(GIMP_API_VERSION).la libgimp = ./libgimp-$(GIMP_API_VERSION).la @@ -178,6 +179,8 @@ libgimp_2_0_la_sources = \ gimpdrawable.h \ gimpfontselect.c \ gimpfontselect.h \ + gimpgimprc.c \ + gimpgimprc.h \ gimpgradients.c \ gimpgradients.h \ gimpgradientselect.c \ @@ -280,6 +283,7 @@ gimpinclude_HEADERS = \ gimpchannel.h \ gimpdrawable.h \ gimpfontselect.h \ + gimpgimprc.h \ gimpgradients.h \ gimpgradientselect.h \ gimpimage.h \ @@ -320,9 +324,9 @@ libgimp_2_0_la_LDFLAGS = \ $(no_undefined) \ $(libgimp_export_symbols) -libgimp_2_0_la_LIBADD = $(libgimpcolor) $(libgimpbase) $(GLIB_LIBS) $(RT_LIBS) +libgimp_2_0_la_LIBADD = $(libgimpconfig) $(libgimpcolor) $(libgimpbase) $(GLIB_LIBS) $(RT_LIBS) -libgimp_2_0_la_DEPENDENCIES = $(gimp_def) $(libgimpcolor) $(libgimpbase) +libgimp_2_0_la_DEPENDENCIES = $(gimp_def) $(libgimpconfig) $(libgimpcolor) $(libgimpbase) libgimpui_2_0_la_LDFLAGS = \ -version-info $(LT_VERSION_INFO) \ diff --git a/libgimp/gimp.h b/libgimp/gimp.h index 94822ff2c1..38257538b9 100644 --- a/libgimp/gimp.h +++ b/libgimp/gimp.h @@ -24,9 +24,10 @@ #include -#include -#include #include +#include +#include +#include #include #include @@ -36,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -325,7 +327,6 @@ gint gimp_monitor_number (void) G_GNUC_CONST; const gchar * gimp_get_progname (void) G_GNUC_CONST; - gboolean gimp_attach_new_parasite (const gchar *name, gint flags, gint size, diff --git a/libgimp/gimpfontselectbutton.c b/libgimp/gimpfontselectbutton.c index e1546a735d..190403070e 100644 --- a/libgimp/gimpfontselectbutton.c +++ b/libgimp/gimpfontselectbutton.c @@ -81,7 +81,7 @@ static void gimp_font_select_drag_data_received (GtkWidget *widget, guint info, guint time); -static GtkWidget * gimp_font_select_button_create_inside (GimpFontSelectButton *font_button); +static GtkWidget * gimp_font_select_button_create_inside (GimpFontSelectButton *button); static const GtkTargetEntry target = { "application/x-gimp-font-name", 0 }; @@ -97,9 +97,9 @@ static void gimp_font_select_button_class_init (GimpFontSelectButtonClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass); - GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); - GtkButtonClass *button_class = GTK_BUTTON_CLASS (klass); + GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass); + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + GtkButtonClass *button_class = GTK_BUTTON_CLASS (klass); gobject_class->set_property = gimp_font_select_button_set_property; gobject_class->get_property = gimp_font_select_button_get_property; @@ -162,19 +162,18 @@ gimp_font_select_button_class_init (GimpFontSelectButtonClass *klass) } static void -gimp_font_select_button_init (GimpFontSelectButton *font_button) +gimp_font_select_button_init (GimpFontSelectButton *button) { - font_button->priv = GIMP_FONT_SELECT_BUTTON_GET_PRIVATE (font_button); + button->priv = GIMP_FONT_SELECT_BUTTON_GET_PRIVATE (button); - font_button->priv->title = g_strdup(_("Font Selection")); - font_button->priv->font_name = g_strdup(_("Sans")); - font_button->priv->temp_font_callback = NULL; + button->priv->title = g_strdup(_("Font Selection")); + button->priv->font_name = g_strdup(_("Sans")); + button->priv->temp_font_callback = NULL; - font_button->priv->inside = - gimp_font_select_button_create_inside (font_button); - gtk_container_add (GTK_CONTAINER (font_button), font_button->priv->inside); + button->priv->inside = gimp_font_select_button_create_inside (button); + gtk_container_add (GTK_CONTAINER (button), button->priv->inside); - gtk_drag_dest_set (GTK_WIDGET (font_button), + gtk_drag_dest_set (GTK_WIDGET (button), GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP, @@ -187,8 +186,6 @@ gimp_font_select_button_init (GimpFontSelectButton *font_button) * @title: Title of the dialog to use or %NULL means to use the default * title. * @font_name: Initial font name. - * @callback: A function to call when the selected font changes. - * @data: A pointer to arbitary data to be used in the call to @callback. * * Creates a new #GtkWidget that completely controls the selection of * a font. This widget is suitable for placement in a table in a @@ -200,42 +197,42 @@ GtkWidget * gimp_font_select_button_new (const gchar *title, const gchar *font_name) { - GtkWidget *font_button; + GtkWidget *button; if (title) - font_button = g_object_new (GIMP_TYPE_FONT_SELECT_BUTTON, - "title", title, - "font-name", font_name, - NULL); + button = g_object_new (GIMP_TYPE_FONT_SELECT_BUTTON, + "title", title, + "font-name", font_name, + NULL); else - font_button = g_object_new (GIMP_TYPE_FONT_SELECT_BUTTON, - "font-name", font_name, - NULL); + button = g_object_new (GIMP_TYPE_FONT_SELECT_BUTTON, + "font-name", font_name, + NULL); - return font_button; + return button; } /** * gimp_font_select_button_close_popup: - * @font_button: A #GimpFontSelectButton + * @button: A #GimpFontSelectButton * - * Closes the popup window associated with @font_button. + * Closes the popup window associated with @button. */ void -gimp_font_select_button_close_popup (GimpFontSelectButton *font_button) +gimp_font_select_button_close_popup (GimpFontSelectButton *button) { - g_return_if_fail (GIMP_IS_FONT_SELECT_BUTTON (font_button)); + g_return_if_fail (GIMP_IS_FONT_SELECT_BUTTON (button)); - if (font_button->priv->temp_font_callback) + if (button->priv->temp_font_callback) { - gimp_font_select_destroy (font_button->priv->temp_font_callback); - font_button->priv->temp_font_callback = NULL; + gimp_font_select_destroy (button->priv->temp_font_callback); + button->priv->temp_font_callback = NULL; } } /** * gimp_font_select_button_get_font_name: - * @font_button: A #GimpFontSelectButton + * @button: A #GimpFontSelectButton * * Retrieves the name of currently selected font. * @@ -244,16 +241,16 @@ gimp_font_select_button_close_popup (GimpFontSelectButton *font_button) * Since: 2.4 */ G_CONST_RETURN gchar * -gimp_font_select_button_get_font_name (GimpFontSelectButton *font_button) +gimp_font_select_button_get_font_name (GimpFontSelectButton *button) { - g_return_val_if_fail (GIMP_IS_FONT_SELECT_BUTTON (font_button), NULL); + g_return_val_if_fail (GIMP_IS_FONT_SELECT_BUTTON (button), NULL); - return font_button->priv->font_name; + return button->priv->font_name; } /** * gimp_font_select_button_set_font_name: - * @font_button: A #GimpFontSelectButton + * @button: A #GimpFontSelectButton * @font_name: Font name to set; %NULL means no change. * * Sets the current font for the font select button. @@ -261,15 +258,15 @@ gimp_font_select_button_get_font_name (GimpFontSelectButton *font_button) * Since: 2.4 */ void -gimp_font_select_button_set_font_name (GimpFontSelectButton *font_button, +gimp_font_select_button_set_font_name (GimpFontSelectButton *button, const gchar *font_name) { - g_return_if_fail (GIMP_IS_FONT_SELECT_BUTTON (font_button)); + g_return_if_fail (GIMP_IS_FONT_SELECT_BUTTON (button)); - if (font_button->priv->temp_font_callback) - gimp_fonts_set_popup (font_button->priv->temp_font_callback, font_name); + if (button->priv->temp_font_callback) + gimp_fonts_set_popup (button->priv->temp_font_callback, font_name); else - gimp_font_select_button_callback (font_name, FALSE, font_button); + gimp_font_select_button_callback (font_name, FALSE, button); } @@ -281,19 +278,21 @@ gimp_font_select_button_set_property (GObject *object, const GValue *value, GParamSpec *pspec) { - GimpFontSelectButton *font_button = GIMP_FONT_SELECT_BUTTON (object); + GimpFontSelectButton *button = GIMP_FONT_SELECT_BUTTON (object); switch (property_id) { case PROP_TITLE: - g_free (font_button->priv->title); - font_button->priv->title = g_value_dup_string (value); + g_free (button->priv->title); + button->priv->title = g_value_dup_string (value); g_object_notify (object, "title"); break; + case PROP_FONT_NAME: - gimp_font_select_button_set_font_name (font_button, + gimp_font_select_button_set_font_name (button, g_value_get_string (value)); break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -306,16 +305,18 @@ gimp_font_select_button_get_property (GObject *object, GValue *value, GParamSpec *pspec) { - GimpFontSelectButton *font_button = GIMP_FONT_SELECT_BUTTON (object); + GimpFontSelectButton *button = GIMP_FONT_SELECT_BUTTON (object); switch (property_id) { case PROP_TITLE: - g_value_set_string (value, font_button->priv->title); + g_value_set_string (value, button->priv->title); break; + case PROP_FONT_NAME: - g_value_set_string (value, font_button->priv->font_name); + g_value_set_string (value, button->priv->font_name); break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -327,18 +328,18 @@ gimp_font_select_button_callback (const gchar *name, gboolean closing, gpointer data) { - GimpFontSelectButton *font_button = GIMP_FONT_SELECT_BUTTON (data); + GimpFontSelectButton *button = GIMP_FONT_SELECT_BUTTON (data); - g_free (font_button->priv->font_name); - font_button->priv->font_name = g_strdup (name); + g_free (button->priv->font_name); + button->priv->font_name = g_strdup (name); - gtk_label_set_text (GTK_LABEL (font_button->priv->label), name); + gtk_label_set_text (GTK_LABEL (button->priv->label), name); if (closing) - font_button->priv->temp_font_callback = NULL; + button->priv->temp_font_callback = NULL; - g_signal_emit (font_button, font_button_signals[FONT_SET], 0, name, closing); - g_object_notify (G_OBJECT (font_button), "font-name"); + g_signal_emit (button, font_button_signals[FONT_SET], 0, name, closing); + g_object_notify (G_OBJECT (button), "font-name"); } static void @@ -358,26 +359,26 @@ gimp_font_select_button_clicked (GtkButton *button) gimp_font_select_new (font_button->priv->title, font_button->priv->font_name, gimp_font_select_button_callback, - font_button); + button); } } static void gimp_font_select_button_destroy (GtkObject *object) { - GimpFontSelectButton *font_button = GIMP_FONT_SELECT_BUTTON (object); + GimpFontSelectButton *button = GIMP_FONT_SELECT_BUTTON (object); - if (font_button->priv->temp_font_callback) + if (button->priv->temp_font_callback) { - gimp_font_select_destroy (font_button->priv->temp_font_callback); - font_button->priv->temp_font_callback = NULL; + gimp_font_select_destroy (button->priv->temp_font_callback); + button->priv->temp_font_callback = NULL; } - g_free (font_button->priv->title); - font_button->priv->title = NULL; + g_free (button->priv->title); + button->priv->title = NULL; - g_free (font_button->priv->font_name); - font_button->priv->font_name = NULL; + g_free (button->priv->font_name); + button->priv->font_name = NULL; GTK_OBJECT_CLASS (gimp_font_select_button_parent_class)->destroy (object); } @@ -409,7 +410,7 @@ gimp_font_select_drag_data_received (GtkWidget *widget, } static GtkWidget * -gimp_font_select_button_create_inside (GimpFontSelectButton *font_button) +gimp_font_select_button_create_inside (GimpFontSelectButton *button) { GtkWidget *hbox; GtkWidget *image; @@ -421,8 +422,8 @@ gimp_font_select_button_create_inside (GimpFontSelectButton *font_button) image = gtk_image_new_from_stock (GIMP_STOCK_FONT, GTK_ICON_SIZE_BUTTON); gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0); - font_button->priv->label = gtk_label_new (font_button->priv->font_name); - gtk_box_pack_start (GTK_BOX (hbox), font_button->priv->label, TRUE, TRUE, 4); + button->priv->label = gtk_label_new (button->priv->font_name); + gtk_box_pack_start (GTK_BOX (hbox), button->priv->label, TRUE, TRUE, 4); gtk_widget_show_all (hbox); diff --git a/libgimp/gimpgimprc.c b/libgimp/gimpgimprc.c new file mode 100644 index 0000000000..f80b818fd6 --- /dev/null +++ b/libgimp/gimpgimprc.c @@ -0,0 +1,60 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2005 Peter Mattis and Spencer Kimball + * + * gimpgimprc.c + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include "gimp.h" + + +/** + * gimp_get_color_configuration: + * + * Retrieve a copy of the current color management configuration. + * + * Returns: A copy of the core's #GimpColorConfig. You should unref + * this copy if you don't need it any longer. + * + * Since: GIMP 2.4 + */ +GimpColorConfig * +gimp_get_color_configuration (void) +{ + GimpColorConfig *config; + gchar *text; + GError *error = NULL; + + text = _gimp_get_color_configuration (); + + g_return_val_if_fail (text != NULL, NULL); + + config = g_object_new (GIMP_TYPE_COLOR_CONFIG, NULL); + + if (! gimp_config_deserialize_string (config, text, -1, NULL, &error)) + { + g_warning ("failed to deserialize color configuration: %s", + error->message); + g_error_free (error); + } + + g_free (text); + + return config; +} diff --git a/libgimp/gimpgimprc.h b/libgimp/gimpgimprc.h new file mode 100644 index 0000000000..8b6675c558 --- /dev/null +++ b/libgimp/gimpgimprc.h @@ -0,0 +1,35 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2005 Peter Mattis and Spencer Kimball + * + * gimpgimprc.h + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GIMP_GIMPRC_H__ +#define __GIMP_GIMPRC_H__ + +G_BEGIN_DECLS + +/* For information look into the C source or the html documentation */ + + +GimpColorConfig * gimp_get_color_configuration (void); + + +G_END_DECLS + +#endif /* __GIMP_GIMPRC_H__ */ diff --git a/libgimp/gimpgimprc_pdb.c b/libgimp/gimpgimprc_pdb.c index b6e9e50ee7..3698d53cdf 100644 --- a/libgimp/gimpgimprc_pdb.c +++ b/libgimp/gimpgimprc_pdb.c @@ -197,6 +197,37 @@ gimp_get_theme_dir (void) return theme_dir; } +/** + * _gimp_get_color_configuration: + * + * Get a serialized version of the color management configuration. + * + * Returns a string that can be deserialized into a GimpColorConfig + * object representing the current color management configuration. + * + * Returns: Serialized color management configuration. + * + * Since: GIMP 2.4 + */ +gchar * +_gimp_get_color_configuration (void) +{ + GimpParam *return_vals; + gint nreturn_vals; + gchar *config = NULL; + + return_vals = gimp_run_procedure ("gimp_get_color_configuration", + &nreturn_vals, + GIMP_PDB_END); + + if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS) + config = g_strdup (return_vals[1].data.d_string); + + gimp_destroy_params (return_vals, nreturn_vals); + + return config; +} + /** * gimp_get_module_load_inhibit: * diff --git a/libgimp/gimpgimprc_pdb.h b/libgimp/gimpgimprc_pdb.h index 18a3d426c9..fc0cd35cb1 100644 --- a/libgimp/gimpgimprc_pdb.h +++ b/libgimp/gimpgimprc_pdb.h @@ -29,14 +29,15 @@ G_BEGIN_DECLS /* For information look into the C source or the html documentation */ -gchar* gimp_gimprc_query (const gchar *token); -gboolean gimp_gimprc_set (const gchar *token, - const gchar *value); -gchar* gimp_get_default_comment (void); -gboolean gimp_get_monitor_resolution (gdouble *xres, - gdouble *yres); -gchar* gimp_get_theme_dir (void); -gchar* gimp_get_module_load_inhibit (void); +gchar* gimp_gimprc_query (const gchar *token); +gboolean gimp_gimprc_set (const gchar *token, + const gchar *value); +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_module_load_inhibit (void); G_END_DECLS diff --git a/plug-ins/FractalExplorer/Dialogs.c b/plug-ins/FractalExplorer/Dialogs.c index c36133b01c..e1239f8618 100644 --- a/plug-ins/FractalExplorer/Dialogs.c +++ b/plug-ins/FractalExplorer/Dialogs.c @@ -28,8 +28,6 @@ #include #include -#include - #include "FractalExplorer.h" #include "Dialogs.h" diff --git a/plug-ins/gfig/gfig-dialog.c b/plug-ins/gfig/gfig-dialog.c index 86b285c5cb..1c975590e4 100644 --- a/plug-ins/gfig/gfig-dialog.c +++ b/plug-ins/gfig/gfig-dialog.c @@ -41,8 +41,6 @@ #include #include -#include - #include "libgimp/stdplugins-intl.h" #include "gfig.h" diff --git a/plug-ins/gflare/gflare.c b/plug-ins/gflare/gflare.c index e4a311821d..45c1295c8c 100644 --- a/plug-ins/gflare/gflare.c +++ b/plug-ins/gflare/gflare.c @@ -45,9 +45,6 @@ #include -#include -#include - #include #include diff --git a/tools/pdbgen/pdb/gimprc.pdb b/tools/pdbgen/pdb/gimprc.pdb index d64bcd61c7..5df2f4a2fe 100644 --- a/tools/pdbgen/pdb/gimprc.pdb +++ b/tools/pdbgen/pdb/gimprc.pdb @@ -182,6 +182,32 @@ CODE ); } +sub get_color_configuration { + $blurb = 'Get a serialized version of the color management configuration.'; + $help = 'Returns a string that can be deserialized into a GimpColorConfig object representing the current color management configuration.'; + + $author = $copyright = 'Sven Neumann'; + $date = '2005'; + $since = '2.4'; + + @inargs = ( ); + + @outargs = ( + { name => 'config', type => 'string', + desc => 'Serialized color management configuration', + wrap => 1 } + ); + + %invoke = ( + headers => [ qw("libgimpconfig/gimpconfig.h" "config/gimpcoreconfig.h") ], + code => <<'CODE' +{ + config = gimp_config_serialize_to_string (GIMP_CONFIG (gimp->config->color_management), NULL); +} +CODE + ); +} + sub get_module_load_inhibit { $blurb = 'Get the list of modules which should not be loaded.'; @@ -210,7 +236,7 @@ CODE @procs = qw(gimprc_query gimprc_set get_default_comment get_monitor_resolution get_theme_dir - get_module_load_inhibit); + get_color_configuration get_module_load_inhibit); %exports = (app => [@procs], lib => [@procs]); $desc = 'Gimprc procedures';