Commit b10218ce authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

allow to access (read-only) the current color management configuration

2005-06-26  Sven Neumann  <sven@gimp.org>

	* 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.
parent 017af36f
2005-06-26 Sven Neumann <sven@gimp.org>
* 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 <sven@gimp.org>
* modules/cdisplay_lcms.c: also use bold, right-aligned labels here.
......
......@@ -24,6 +24,7 @@
#include <glib-object.h>
#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,
......
......@@ -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);
......
2005-06-26 Sven Neumann <sven@gimp.org>
* 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 <sven@gimp.org>
* libgimpwidgets/libgimpwidgets-docs.sgml
......
......@@ -81,6 +81,7 @@
<chapter id="libgimp-selectors">
<title>Controlling the Core's Selection Dialogs</title>
<xi:include href="xml/gimpbrushselect.xml" />
<xi:include href="xml/gimpfontselectbutton.xml" />
<xi:include href="xml/gimpfontselect.xml" />
<xi:include href="xml/gimpgradientselect.xml" />
<xi:include href="xml/gimppaletteselect.xml" />
......
......@@ -374,6 +374,7 @@ gimp_fonts_set_popup
<FILE>gimpgimprc</FILE>
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
</SECTION>
<SECTION>
<FILE>gimpfontselectbutton</FILE>
<TITLE>GimpFontSelectButton</TITLE>
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
<SUBSECTION Standard>
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
</SECTION>
<SECTION>
<FILE>gimpmenu</FILE>
GimpConstraintFunc
......
......@@ -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
<!-- ##### SECTION Title ##### -->
GimpFontSelectButton
<!-- ##### SECTION Short_Description ##### -->
<!-- ##### SECTION Long_Description ##### -->
<para>
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### STRUCT GimpFontSelectButton ##### -->
<para>
</para>
<!-- ##### SIGNAL GimpFontSelectButton::font-set ##### -->
<para>
</para>
@gimpfontselectbutton: the object which received the signal.
@arg1:
@arg2:
<!-- ##### ARG GimpFontSelectButton:font-name ##### -->
<para>
</para>
<!-- ##### ARG GimpFontSelectButton:title ##### -->
<para>
</para>
<!-- ##### FUNCTION gimp_font_select_button_new ##### -->
<para>
</para>
@title:
@font_name:
@Returns:
<!-- ##### FUNCTION gimp_font_select_button_get_font_name ##### -->
<para>
</para>
@button:
@Returns:
<!-- ##### FUNCTION gimp_font_select_button_set_font_name ##### -->
<para>
</para>
@button:
@font_name:
<!-- ##### FUNCTION gimp_font_select_button_close_popup ##### -->
<para>
</para>
@button:
......@@ -34,6 +34,14 @@ Interactions with settings from .gimprc.
@Returns:
<!-- ##### FUNCTION gimp_get_color_configuration ##### -->
<para>
</para>
@Returns:
<!-- ##### FUNCTION gimp_get_default_comment ##### -->
<para>
......
......@@ -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@
......@@ -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) \
......
......@@ -24,9 +24,10 @@
#include <glib-object.h>
#include <libgimpbase/gimpbase.h>
#include <libgimpcolor/gimpcolor.h>
#include <libgimpconfig/gimpconfig.h>
#include <libgimpmath/gimpmath.h>
#include <libgimpbase/gimpbase.h>
#include <libgimp/gimpenums.h>
#include <libgimp/gimptypes.h>
......@@ -36,6 +37,7 @@
#include <libgimp/gimpchannel.h>
#include <libgimp/gimpdrawable.h>
#include <libgimp/gimpfontselect.h>
#include <libgimp/gimpgimprc.h>
#include <libgimp/gimpgradients.h>
#include <libgimp/gimpgradientselect.h>
#include <libgimp/gimpimage.h>
......@@ -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,
......
......@@ -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);
......
/* 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