use a gimp_query_boolean_box().

2000-02-23  Michael Natterer  <mitch@gimp.org>

	* app/file_new_dialog.c: use a gimp_query_boolean_box().

	* libgimp/gimpenv.c
	* libgimp/gimpquerybox.c: documentation updates.

	* libgimp/gimpwidgets.[ch]: changed the widget constructors to
	return only the container widget and added access marcos for the
	sub-widgets. Added documentation for all functions.
	Made gimp_toggle_button_sensitive_update() public so this feature
	can be properly documented.

	* plug-ins/common/blur.c
	* plug-ins/common/gauss_iir.c
	* plug-ins/common/gauss_rle.c
	* plug-ins/common/plasma.c
	* plug-ins/common/randomize.c
	* plug-ins/common/snoise.c
	* plug-ins/common/spread.c
	* plug-ins/common/tile.c
	* plug-ins/gflare/gflare.c: updated according to the
	gimpwidgets.[ch] changes.

2000-02-23  Michael Natterer  <mitch@gimp.org>

	* libgimp/libgimp-decl.txt
	* libgimp/libgimp-sections.txt
	* libgimp/tmpl/gimpenv.sgml
	* libgimp/tmpl/gimppixmap.sgml
	* libgimp/tmpl/gimpwidgets.sgml: various updates and documentation
	for all gimpwidgets.[ch] functions.
This commit is contained in:
Michael Natterer 2000-02-23 15:52:33 +00:00 committed by Michael Natterer
parent c7bacaeadb
commit 27d4717c78
27 changed files with 1906 additions and 1486 deletions

View File

@ -1,3 +1,27 @@
2000-02-23 Michael Natterer <mitch@gimp.org>
* app/file_new_dialog.c: use a gimp_query_boolean_box().
* libgimp/gimpenv.c
* libgimp/gimpquerybox.c: documentation updates.
* libgimp/gimpwidgets.[ch]: changed the widget constructors to
return only the container widget and added access marcos for the
sub-widgets. Added documentation for all functions.
Made gimp_toggle_button_sensitive_update() public so this feature
can be properly documented.
* plug-ins/common/blur.c
* plug-ins/common/gauss_iir.c
* plug-ins/common/gauss_rle.c
* plug-ins/common/plasma.c
* plug-ins/common/randomize.c
* plug-ins/common/snoise.c
* plug-ins/common/spread.c
* plug-ins/common/tile.c
* plug-ins/gflare/gflare.c: updated according to the
gimpwidgets.[ch] changes.
Wed Feb 23 14:50:09 CET 2000 Sven Neumann <sven@gimp.org> Wed Feb 23 14:50:09 CET 2000 Sven Neumann <sven@gimp.org>
* plug-ins/print/print-escp2.c * plug-ins/print/print-escp2.c

View File

@ -148,59 +148,40 @@ file_new_cancel_callback (GtkWidget *widget,
g_free (info); g_free (info);
} }
/* local callbacks of file_new_confirm_dialog() */ /* local callback of file_new_confirm_dialog() */
static void static void
file_new_confirm_dialog_ok_callback (GtkWidget *widget, file_new_confirm_dialog_callback (GtkWidget *widget,
gpointer data) gboolean create,
gpointer data)
{ {
NewImageInfo *info; NewImageInfo *info;
info = (NewImageInfo*) data; info = (NewImageInfo*) data;
gtk_widget_destroy (info->confirm_dlg);
gtk_widget_destroy (info->dlg);
image_new_create_image (info->values);
image_new_values_free (info->values);
g_free (info);
}
static void
file_new_confirm_dialog_cancel_callback (GtkWidget *widget,
gpointer data)
{
NewImageInfo *info;
info = (NewImageInfo*) data;
gtk_widget_destroy (info->confirm_dlg);
info->confirm_dlg = NULL; info->confirm_dlg = NULL;
gtk_widget_set_sensitive (info->dlg, TRUE);
if (create)
{
gtk_widget_destroy (info->dlg);
image_new_create_image (info->values);
image_new_values_free (info->values);
g_free (info);
}
else
{
gtk_widget_set_sensitive (info->dlg, TRUE);
}
} }
static void static void
file_new_confirm_dialog (NewImageInfo *info) file_new_confirm_dialog (NewImageInfo *info)
{ {
GtkWidget *label;
gchar *size; gchar *size;
gchar *max_size; gchar *max_size;
gchar *text; gchar *text;
gtk_widget_set_sensitive (info->dlg, FALSE); gtk_widget_set_sensitive (info->dlg, FALSE);
info->confirm_dlg =
gimp_dialog_new (_("Confirm Image Size"), "confirm_size",
gimp_standard_help_func,
"dialogs/file_new.html#confirm_size",
GTK_WIN_POS_MOUSE,
FALSE, FALSE, FALSE,
_("OK"), file_new_confirm_dialog_ok_callback,
info, NULL, NULL, TRUE, FALSE,
_("Cancel"), file_new_confirm_dialog_cancel_callback,
info, NULL, NULL, FALSE, TRUE,
NULL);
size = image_new_get_size_string (info->size); size = image_new_get_size_string (info->size);
max_size = image_new_get_size_string (max_new_image_size); max_size = image_new_get_size_string (max_new_image_size);
@ -216,11 +197,17 @@ file_new_confirm_dialog (NewImageInfo *info)
"setting (currently %s) in the\n" "setting (currently %s) in the\n"
"preferences dialog."), "preferences dialog."),
size, max_size); size, max_size);
label = gtk_label_new (text);
gtk_misc_set_padding (GTK_MISC (label), 6, 6); info->confirm_dlg =
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (info->confirm_dlg)->vbox), label, gimp_query_boolean_box (_("Confirm Image Size"),
TRUE, TRUE, 0); gimp_standard_help_func,
gtk_widget_show (label); "dialogs/file_new.html#confirm_size",
FALSE,
text,
_("OK"), _("Cancel"),
NULL, NULL,
file_new_confirm_dialog_callback,
info);
g_free (text); g_free (text);
g_free (max_size); g_free (max_size);

View File

@ -148,59 +148,40 @@ file_new_cancel_callback (GtkWidget *widget,
g_free (info); g_free (info);
} }
/* local callbacks of file_new_confirm_dialog() */ /* local callback of file_new_confirm_dialog() */
static void static void
file_new_confirm_dialog_ok_callback (GtkWidget *widget, file_new_confirm_dialog_callback (GtkWidget *widget,
gpointer data) gboolean create,
gpointer data)
{ {
NewImageInfo *info; NewImageInfo *info;
info = (NewImageInfo*) data; info = (NewImageInfo*) data;
gtk_widget_destroy (info->confirm_dlg);
gtk_widget_destroy (info->dlg);
image_new_create_image (info->values);
image_new_values_free (info->values);
g_free (info);
}
static void
file_new_confirm_dialog_cancel_callback (GtkWidget *widget,
gpointer data)
{
NewImageInfo *info;
info = (NewImageInfo*) data;
gtk_widget_destroy (info->confirm_dlg);
info->confirm_dlg = NULL; info->confirm_dlg = NULL;
gtk_widget_set_sensitive (info->dlg, TRUE);
if (create)
{
gtk_widget_destroy (info->dlg);
image_new_create_image (info->values);
image_new_values_free (info->values);
g_free (info);
}
else
{
gtk_widget_set_sensitive (info->dlg, TRUE);
}
} }
static void static void
file_new_confirm_dialog (NewImageInfo *info) file_new_confirm_dialog (NewImageInfo *info)
{ {
GtkWidget *label;
gchar *size; gchar *size;
gchar *max_size; gchar *max_size;
gchar *text; gchar *text;
gtk_widget_set_sensitive (info->dlg, FALSE); gtk_widget_set_sensitive (info->dlg, FALSE);
info->confirm_dlg =
gimp_dialog_new (_("Confirm Image Size"), "confirm_size",
gimp_standard_help_func,
"dialogs/file_new.html#confirm_size",
GTK_WIN_POS_MOUSE,
FALSE, FALSE, FALSE,
_("OK"), file_new_confirm_dialog_ok_callback,
info, NULL, NULL, TRUE, FALSE,
_("Cancel"), file_new_confirm_dialog_cancel_callback,
info, NULL, NULL, FALSE, TRUE,
NULL);
size = image_new_get_size_string (info->size); size = image_new_get_size_string (info->size);
max_size = image_new_get_size_string (max_new_image_size); max_size = image_new_get_size_string (max_new_image_size);
@ -216,11 +197,17 @@ file_new_confirm_dialog (NewImageInfo *info)
"setting (currently %s) in the\n" "setting (currently %s) in the\n"
"preferences dialog."), "preferences dialog."),
size, max_size); size, max_size);
label = gtk_label_new (text);
gtk_misc_set_padding (GTK_MISC (label), 6, 6); info->confirm_dlg =
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (info->confirm_dlg)->vbox), label, gimp_query_boolean_box (_("Confirm Image Size"),
TRUE, TRUE, 0); gimp_standard_help_func,
gtk_widget_show (label); "dialogs/file_new.html#confirm_size",
FALSE,
text,
_("OK"), _("Cancel"),
NULL, NULL,
file_new_confirm_dialog_callback,
info);
g_free (text); g_free (text);
g_free (max_size); g_free (max_size);

View File

@ -148,59 +148,40 @@ file_new_cancel_callback (GtkWidget *widget,
g_free (info); g_free (info);
} }
/* local callbacks of file_new_confirm_dialog() */ /* local callback of file_new_confirm_dialog() */
static void static void
file_new_confirm_dialog_ok_callback (GtkWidget *widget, file_new_confirm_dialog_callback (GtkWidget *widget,
gpointer data) gboolean create,
gpointer data)
{ {
NewImageInfo *info; NewImageInfo *info;
info = (NewImageInfo*) data; info = (NewImageInfo*) data;
gtk_widget_destroy (info->confirm_dlg);
gtk_widget_destroy (info->dlg);
image_new_create_image (info->values);
image_new_values_free (info->values);
g_free (info);
}
static void
file_new_confirm_dialog_cancel_callback (GtkWidget *widget,
gpointer data)
{
NewImageInfo *info;
info = (NewImageInfo*) data;
gtk_widget_destroy (info->confirm_dlg);
info->confirm_dlg = NULL; info->confirm_dlg = NULL;
gtk_widget_set_sensitive (info->dlg, TRUE);
if (create)
{
gtk_widget_destroy (info->dlg);
image_new_create_image (info->values);
image_new_values_free (info->values);
g_free (info);
}
else
{
gtk_widget_set_sensitive (info->dlg, TRUE);
}
} }
static void static void
file_new_confirm_dialog (NewImageInfo *info) file_new_confirm_dialog (NewImageInfo *info)
{ {
GtkWidget *label;
gchar *size; gchar *size;
gchar *max_size; gchar *max_size;
gchar *text; gchar *text;
gtk_widget_set_sensitive (info->dlg, FALSE); gtk_widget_set_sensitive (info->dlg, FALSE);
info->confirm_dlg =
gimp_dialog_new (_("Confirm Image Size"), "confirm_size",
gimp_standard_help_func,
"dialogs/file_new.html#confirm_size",
GTK_WIN_POS_MOUSE,
FALSE, FALSE, FALSE,
_("OK"), file_new_confirm_dialog_ok_callback,
info, NULL, NULL, TRUE, FALSE,
_("Cancel"), file_new_confirm_dialog_cancel_callback,
info, NULL, NULL, FALSE, TRUE,
NULL);
size = image_new_get_size_string (info->size); size = image_new_get_size_string (info->size);
max_size = image_new_get_size_string (max_new_image_size); max_size = image_new_get_size_string (max_new_image_size);
@ -216,11 +197,17 @@ file_new_confirm_dialog (NewImageInfo *info)
"setting (currently %s) in the\n" "setting (currently %s) in the\n"
"preferences dialog."), "preferences dialog."),
size, max_size); size, max_size);
label = gtk_label_new (text);
gtk_misc_set_padding (GTK_MISC (label), 6, 6); info->confirm_dlg =
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (info->confirm_dlg)->vbox), label, gimp_query_boolean_box (_("Confirm Image Size"),
TRUE, TRUE, 0); gimp_standard_help_func,
gtk_widget_show (label); "dialogs/file_new.html#confirm_size",
FALSE,
text,
_("OK"), _("Cancel"),
NULL, NULL,
file_new_confirm_dialog_callback,
info);
g_free (text); g_free (text);
g_free (max_size); g_free (max_size);

View File

@ -1,15 +1,23 @@
2000-02-23 Michael Natterer <mitch@gimp.org>
* libgimp/libgimp-decl.txt
* libgimp/libgimp-sections.txt
* libgimp/tmpl/gimpenv.sgml
* libgimp/tmpl/gimppixmap.sgml
* libgimp/tmpl/gimpwidgets.sgml: various updates and documentation
for all gimpwidgets.[ch] functions.
Mon Feb 21 11:55:18 CET 2000 Sven Neumann <sven@gimp.org> Mon Feb 21 11:55:18 CET 2000 Sven Neumann <sven@gimp.org>
* libgimp/libgimp-decl.txt * libgimp/libgimp-decl.txt
* libgimp/tmpl/gimpwidgets.sgml; updated * libgimp/tmpl/gimpwidgets.sgml: updated
2000-02-18 Michael Natterer <mitch@gimp.org> 2000-02-18 Michael Natterer <mitch@gimp.org>
* libgimp/libgimp-decl.txt * libgimp/libgimp-decl.txt
* libgimp/tmpl/gimpmatrix.sgml * libgimp/tmpl/gimpmatrix.sgml
* libgimp/tmpl/gimpvector.sgml * libgimp/tmpl/gimpvector.sgml
* libgimp/tmpl/libgimp-unused.sgml: updates and * libgimp/tmpl/libgimp-unused.sgml: updates and cleanups.
cleanups.
2000-02-18 Michael Natterer <mitch@gimp.org> 2000-02-18 Michael Natterer <mitch@gimp.org>

File diff suppressed because it is too large Load Diff

View File

@ -572,6 +572,10 @@ gimp_directory
gimp_personal_rc_file gimp_personal_rc_file
gimp_data_directory gimp_data_directory
gimp_gtkrc gimp_gtkrc
gimp_path_parse
gimp_path_free
gimp_path_to_str
gimp_path_get_user_writable_dir
</SECTION> </SECTION>
<SECTION> <SECTION>
@ -713,6 +717,7 @@ GimpPixmap
GIMP_PIXMAP GIMP_PIXMAP
<TITLE>GimpPixmap</TITLE> <TITLE>GimpPixmap</TITLE>
gimp_pixmap_new gimp_pixmap_new
gimp_pixmap_set
<SUBSECTION Standard> <SUBSECTION Standard>
GIMP_TYPE_PIXMAP GIMP_TYPE_PIXMAP
GIMP_IS_PIXMAP GIMP_IS_PIXMAP
@ -870,11 +875,16 @@ GIMP_SCALE_ENTRY_SCALE_ADJ
GIMP_SCALE_ENTRY_SPINBUTTON GIMP_SCALE_ENTRY_SPINBUTTON
GIMP_SCALE_ENTRY_SPINBUTTON_ADJ GIMP_SCALE_ENTRY_SPINBUTTON_ADJ
gimp_random_seed_new gimp_random_seed_new
GIMP_RANDOM_SEED_SPINBUTTON
GIMP_RANDOM_SEED_SPINBUTTON_ADJ
GIMP_RANDOM_SEED_TOGGLEBUTTON
gimp_coordinates_new gimp_coordinates_new
GIMP_COORDINATES_CHAINBUTTON
gimp_pixmap_button_new gimp_pixmap_button_new
gimp_toggle_button_sensitive_update
gimp_toggle_button_update gimp_toggle_button_update
gimp_menu_item_update
gimp_radio_button_update gimp_radio_button_update
gimp_menu_item_update
gimp_int_adjustment_update gimp_int_adjustment_update
gimp_float_adjustment_update gimp_float_adjustment_update
gimp_double_adjustment_update gimp_double_adjustment_update

View File

@ -48,3 +48,41 @@ configuration files.
@Returns: @Returns:
<!-- ##### FUNCTION gimp_path_parse ##### -->
<para>
</para>
@path:
@max_paths:
@check:
@check_failed:
@Returns:
<!-- ##### FUNCTION gimp_path_free ##### -->
<para>
</para>
@path:
<!-- ##### FUNCTION gimp_path_to_str ##### -->
<para>
</para>
@path:
@Returns:
<!-- ##### FUNCTION gimp_path_get_user_writable_dir ##### -->
<para>
</para>
@path:
@Returns:

View File

@ -38,3 +38,12 @@ performs the cast if valid.
@Returns: @Returns:
<!-- ##### FUNCTION gimp_pixmap_set ##### -->
<para>
</para>
@pixmap:
@xpm_data:

View File

@ -18,6 +18,46 @@ helper functions.
<!-- ##### FUNCTION gimp_option_menu_new ##### --> <!-- ##### FUNCTION gimp_option_menu_new ##### -->
<para> <para>
The @va_list describing the #GtkMenuItem's has the following format:
<informaltable pgwide=1 frame="none" role="struct">
<tgroup cols="2"><colspec colwidth="4*"><colspec colwidth="8*">
<tbody>
<row>
<entry>#gchar label,</entry>
<entry>The menu item's label.</entry>
</row>
<row>
<entry>#GtkSignalFunc callback,</entry>
<entry>The callback which will be connected to the menu item's
"activate" signal</entry>
</row>
<row>
<entry>#gpointer data,</entry>
<entry>The callback data which will be used in gtk_signal_connect().</entry>
</row>
<row>
<entry>#gpointer user_data,</entry>
<entry>The menu item's @user_data which will be set with
gtk_object_set_user_data().</entry>
</row>
<row>
<entry>#GtkWidget **widget_ptr,</entry>
<entry>A pointer to store the created menu item in.</entry>
</row>
<row>
<entry>#gboolean active,</entry>
<entry>#TRUE if this should be the initially selected menu item.</entry>
</row>
</tbody></tgroup></informaltable>
</para> </para>
@menu_only: @menu_only:
@ -28,6 +68,30 @@ helper functions.
<!-- ##### FUNCTION gimp_option_menu_new2 ##### --> <!-- ##### FUNCTION gimp_option_menu_new2 ##### -->
<para> <para>
The @va_list describing the #GtkMenuItem's has the following format:
<informaltable pgwide=1 frame="none" role="struct">
<tgroup cols="2"><colspec colwidth="4*"><colspec colwidth="8*">
<tbody>
<row>
<entry>#gchar label,</entry>
<entry>The menu item's label.</entry>
</row>
<row>
<entry>#gpointer user_data,</entry>
<entry>The menu item's @user_data which will be set with
gtk_object_set_user_data().</entry>
</row>
<row>
<entry>#GtkWidget **widget_ptr,</entry>
<entry>A pointer to store the created menu item in.</entry>
</row>
</tbody></tgroup></informaltable>
</para> </para>
@menu_only: @menu_only:
@ -50,6 +114,46 @@ helper functions.
<!-- ##### FUNCTION gimp_radio_group_new ##### --> <!-- ##### FUNCTION gimp_radio_group_new ##### -->
<para> <para>
The @va_list describing the #GtkRadioButton's has the following format:
<informaltable pgwide=1 frame="none" role="struct">
<tgroup cols="2"><colspec colwidth="4*"><colspec colwidth="8*">
<tbody>
<row>
<entry>#gchar label,</entry>
<entry>The radio button's label.</entry>
</row>
<row>
<entry>#GtkSignalFunc callback,</entry>
<entry>The callback which will be connected to the radio button's
"toggled" signal</entry>
</row>
<row>
<entry>#gpointer data,</entry>
<entry>The callback data which will be used in gtk_signal_connect().</entry>
</row>
<row>
<entry>#gpointer user_data,</entry>
<entry>The radio button's @user_data which will be set with
gtk_object_set_user_data().</entry>
</row>
<row>
<entry>#GtkWidget **widget_ptr,</entry>
<entry>A pointer to store the created radio button in.</entry>
</row>
<row>
<entry>#gboolean active,</entry>
<entry>#TRUE if this should be the initially pressed radio button.</entry>
</row>
</tbody></tgroup></informaltable>
</para> </para>
@in_frame: @in_frame:
@ -61,6 +165,30 @@ helper functions.
<!-- ##### FUNCTION gimp_radio_group_new2 ##### --> <!-- ##### FUNCTION gimp_radio_group_new2 ##### -->
<para> <para>
The @va_list describing the #GtkRadioButton's has the following format:
<informaltable pgwide=1 frame="none" role="struct">
<tgroup cols="2"><colspec colwidth="4*"><colspec colwidth="8*">
<tbody>
<row>
<entry>#gchar label,</entry>
<entry>The radio button's label.</entry>
</row>
<row>
<entry>#gpointer user_data,</entry>
<entry>The radio button's @user_data which will be set with
gtk_object_set_user_data().</entry>
</row>
<row>
<entry>#GtkWidget **widget_ptr,</entry>
<entry>A pointer to store the created radio button in.</entry>
</row>
</tbody></tgroup></informaltable>
</para> </para>
@in_frame: @in_frame:
@ -116,42 +244,42 @@ helper functions.
<!-- ##### MACRO GIMP_SCALE_ENTRY_LABEL ##### --> <!-- ##### MACRO GIMP_SCALE_ENTRY_LABEL ##### -->
<para> <para>
Returns the scale_entry's #GtkLabel.
</para> </para>
@adj: @adj: The #GtkAdjustment returned by gimp_scale_entry_new().
<!-- ##### MACRO GIMP_SCALE_ENTRY_SCALE ##### --> <!-- ##### MACRO GIMP_SCALE_ENTRY_SCALE ##### -->
<para> <para>
Returns the scale_entry's #GtkHScale.
</para> </para>
@adj: @adj: The #GtkAdjustment returned by gimp_scale_entry_new().
<!-- ##### MACRO GIMP_SCALE_ENTRY_SCALE_ADJ ##### --> <!-- ##### MACRO GIMP_SCALE_ENTRY_SCALE_ADJ ##### -->
<para> <para>
Returns the #GtkAdjustment of the scale_entry's #GtkHScale.
</para> </para>
@adj: @adj: The #GtkAdjustment returned by gimp_scale_entry_new().
<!-- ##### MACRO GIMP_SCALE_ENTRY_SPINBUTTON ##### --> <!-- ##### MACRO GIMP_SCALE_ENTRY_SPINBUTTON ##### -->
<para> <para>
Returns the scale_entry's #GtkSpinButton.
</para> </para>
@adj: @adj: The #GtkAdjustment returned by gimp_scale_entry_new().
<!-- ##### MACRO GIMP_SCALE_ENTRY_SPINBUTTON_ADJ ##### --> <!-- ##### MACRO GIMP_SCALE_ENTRY_SPINBUTTON_ADJ ##### -->
<para> <para>
Returns the #GtkAdjustment of the scale_entry's #GtkSpinButton.
</para> </para>
@adj: @adj: The #GtkAdjustment returned by gimp_scale_entry_new().
<!-- ##### FUNCTION gimp_random_seed_new ##### --> <!-- ##### FUNCTION gimp_random_seed_new ##### -->
@ -160,14 +288,36 @@ helper functions.
</para> </para>
@seed: @seed:
@seed_spinbutton:
@use_time: @use_time:
@time_button:
@time_true: @time_true:
@time_false: @time_false:
@Returns: @Returns:
<!-- ##### MACRO GIMP_RANDOM_SEED_SPINBUTTON ##### -->
<para>
Returns the random_seed's #GtkSpinButton.
</para>
@hbox: The #GtkHBox returned by gimp_random_seed_new().
<!-- ##### MACRO GIMP_RANDOM_SEED_SPINBUTTON_ADJ ##### -->
<para>
Returns the #GtkAdjustment of the random_seed's #GtkSpinButton.
</para>
@hbox: The #GtkHBox returned by gimp_random_seed_new().
<!-- ##### MACRO GIMP_RANDOM_SEED_TOGGLEBUTTON ##### -->
<para>
Returns the random_seed's #GtkToggleButton.
</para>
@hbox: The #GtkHBox returned by gimp_random_seed_new().
<!-- ##### FUNCTION gimp_coordinates_new ##### --> <!-- ##### FUNCTION gimp_coordinates_new ##### -->
<para> <para>
@ -181,7 +331,6 @@ helper functions.
@update_policy: @update_policy:
@chainbutton_active: @chainbutton_active:
@chain_constrains_ratio: @chain_constrains_ratio:
@chainbutton:
@xlabel: @xlabel:
@x: @x:
@xres: @xres:
@ -199,6 +348,14 @@ helper functions.
@Returns: @Returns:
<!-- ##### MACRO GIMP_COORDINATES_CHAINBUTTON ##### -->
<para>
Returns the #GimpChainButton which is attached to the #GimpSizeEntry.
</para>
@sizeentry: The #GimpSizeEntry returned by gimp_coordinates_new().
<!-- ##### FUNCTION gimp_pixmap_button_new ##### --> <!-- ##### FUNCTION gimp_pixmap_button_new ##### -->
<para> <para>
@ -209,6 +366,14 @@ helper functions.
@Returns: @Returns:
<!-- ##### FUNCTION gimp_toggle_button_sensitive_update ##### -->
<para>
</para>
@toggle_button:
<!-- ##### FUNCTION gimp_toggle_button_update ##### --> <!-- ##### FUNCTION gimp_toggle_button_update ##### -->
<para> <para>
@ -218,7 +383,7 @@ helper functions.
@data: @data:
<!-- ##### FUNCTION gimp_menu_item_update ##### --> <!-- ##### FUNCTION gimp_radio_button_update ##### -->
<para> <para>
</para> </para>
@ -227,7 +392,7 @@ helper functions.
@data: @data:
<!-- ##### FUNCTION gimp_radio_button_update ##### --> <!-- ##### FUNCTION gimp_menu_item_update ##### -->
<para> <para>
</para> </para>

View File

@ -249,11 +249,12 @@ gimp_gtkrc (void)
/** /**
* gimp_path_parse: * gimp_path_parse:
* @path: A list of directories separated by #G_SEARCHPATH_SEPARATOR. * @path: A list of directories separated by #G_SEARCHPATH_SEPARATOR.
* @max_path: The maximum number of directories to return. * @max_paths: The maximum number of directories to return.
* @check: #TRUE if you want the directories to be checked. * @check: #TRUE if you want the directories to be checked.
* @not_found: # * @check_failed: Returns a #GList of path elements for which the
* check failed.
* *
* Return: A list of all directories in @path. * Returns: A #GList of all directories in @path.
* *
*/ */
GList * GList *

View File

@ -383,7 +383,8 @@ gimp_query_size_box (gchar *title,
* @false_button: The string to be shown in the dialog's right button. * @false_button: The string to be shown in the dialog's right button.
* @object: The object this query box is associated with. * @object: The object this query box is associated with.
* @signal: The object's signal which will cause the query box to be closed. * @signal: The object's signal which will cause the query box to be closed.
* @callback: The function which will be called when the user selects "OK". * @callback: The function which will be called when the user clicks one
* of the buttons.
* @data: The callback's user data. * @data: The callback's user data.
* *
* Returns: A pointer to the new #GtkDialog. * Returns: A pointer to the new #GtkDialog.

View File

@ -31,23 +31,16 @@
#include "libgimp-intl.h" #include "libgimp-intl.h"
/*
* Forward declarations
*/
static void gimp_toggle_button_sensitive_update (GtkToggleButton *toggle_button);
/* /*
* Widget Constructors * Widget Constructors
*/ */
/** /**
* gimp_option_menu_new: * gimp_option_menu_new:
* @menu_only: * @menu_only: #TRUE if the function should return a #GtkMenu only.
* @...: * @...: A #NULL terminated @va_list describing the menu items.
* *
* Returns: * Returns: A #GtkOptionMenu or a #GtkMenu (depending on @menu_only).
* *
*/ */
GtkWidget * GtkWidget *
@ -142,13 +135,14 @@ gimp_option_menu_new (gboolean menu_only,
/** /**
* gimp_option_menu_new2: * gimp_option_menu_new2:
* @menu_only: * @menu_only: #TRUE if the function should return a #GtkMenu only.
* @menu_item_callback: * @menu_item_callback: The callback each menu item's "activate" signal will
* @data: * be connected with.
* @initial: * @data: The data which will be passed to gtk_signal_connect().
* @...: * @initial: The @user_data of the initially selected menu item.
* @...: A #NULL terminated @va_list describing the menu items.
* *
* Returns: * Returns: A #GtkOptionMenu or a #GtkMenu (depending on @menu_only).
* *
*/ */
GtkWidget * GtkWidget *
@ -237,8 +231,9 @@ gimp_option_menu_new2 (gboolean menu_only,
/** /**
* gimp_option_menu_set_history: * gimp_option_menu_set_history:
* @option_menu: * @option_menu: A #GtkOptionMenu as returned by gimp_option_menu_new() or
* @user_data: * gimp_option_menu_new2().
* @user_data: The @user_data of the menu item you want to select.
* *
*/ */
void void
@ -273,11 +268,11 @@ gimp_option_menu_set_history (GtkOptionMenu *option_menu,
/** /**
* gimp_radio_group_new: * gimp_radio_group_new:
* @in_frame: * @in_frame: #TRUE if you want a #GtkFrame around the radio button group.
* @frame_title: * @frame_title: The title of the Frame or #NULL if you don't want a title.
* @...: * @...: A #NULL terminated @va_list describing the radio buttons.
* *
* Returns: * Returns: A #GtkFrame or #GtkVbox (depending on @in_frame).
* *
*/ */
GtkWidget * GtkWidget *
@ -368,14 +363,15 @@ gimp_radio_group_new (gboolean in_frame,
/** /**
* gimp_radio_group_new2: * gimp_radio_group_new2:
* @in_frame: * @in_frame: #TRUE if you want a #GtkFrame around the radio button group.
* @frame_title: * @frame_title: The title of the Frame or #NULL if you don't want a title.
* @radio_button_callback: * @radio_button_callback: The callback each button's "toggled" signal will
* @data: * be connected with.
* @initial: * @data: The data which will be passed to gtk_signal_connect().
* @...: * @initial: The @user_data of the initially pressed radio button.
* @...: A #NULL terminated @va_list describing the radio buttons.
* *
* Returns: * Returns: A #GtkFrame or #GtkVbox (depending on @in_frame).
* *
*/ */
GtkWidget * GtkWidget *
@ -460,17 +456,21 @@ gimp_radio_group_new2 (gboolean in_frame,
/** /**
* gimp_spin_button_new: * gimp_spin_button_new:
* @adjustment: * @adjustment: Returns the spinbutton's #GtkAdjustment.
* @value: * @value: The initial value of the spinbutton.
* @lower: * @lower: The lower boundary.
* @upper: * @upper: The uppper boundary.
* @step_increment: * @step_increment: The spinbutton's step increment.
* @page_increment: * @page_increment: The spinbutton's page increment (mouse button 2).
* @page_size: * @page_size: The spinbutton's page size.
* @climb_rate: * @climb_rate: The spinbutton's climb rate.
* @digits: * @digits: The spinbutton's number of decimal digits.
* *
* Returns: * This function is a shortcut for gtk_adjustment_new() and a subsequent
* gtk_spin_button_new() and does some more initialisation stuff like
* setting a standard minimun horizontal size.
*
* Returns: A #GtkSpinbutton and it's #GtkAdjustment.
* *
*/ */
GtkWidget * GtkWidget *
@ -512,25 +512,34 @@ gimp_scale_entry_unconstrained_adjustment_callback (GtkAdjustment *adjustment,
/** /**
* gimp_scale_entry_new: * gimp_scale_entry_new:
* @table: * @table: The #GtkTable the widgets will be attached to.
* @column: * @column: The column to start with.
* @row: * @row: The row to attach the widgets.
* @text: * @text: The text for the #GtkLabel which will appear left of the #GtkHScale.
* @scale_usize: * @scale_usize: The minimum horizontal size of the #GtkHScale.
* @spinbutton_usize: * @spinbutton_usize: The minimum horizontal size of the #GtkSpinButton.
* @value: * @value: The initial value.
* @lower: * @lower: The lower boundary.
* @upper: * @upper: The upper boundary.
* @step_increment: * @step_increment: The step increment.
* @page_increment: * @page_increment: The page increment.
* @digits: * @digits: The number of decimal digits.
* @constrain: * @constrain: #TRUE if the range of possible values of the #GtkSpinButton
* @unconstrained_lower: * should be the same as of the #GtkHScale.
* @unconstrained_upper: * @unconstrained_lower: The spinbutton's lower boundary
* @tooltip: * if @constrain == #FALSE.
* @private_tip: * @unconstrained_upper: The spinbutton's upper boundary
* if @constrain == #FALSE.
* @tooltip: A tooltip message for the scale and the spinbutton.
* @private_tip: The widgets' private_tip (see gimp_help_set_help_data()).
* *
* Returns: * This function creates a #GtkLabel, a #GtkHScale and a #GtkSpinButton and
* attaches them to a 3-column #GtkTable.
*
* Note that if you pass a @tooltip or @private_tip to this function you'll
* have to initialize GIMP's help system with gimp_help_init() before using it.
*
* Returns: The #GtkSpinButton's #GtkAdjustment.
* *
*/ */
GtkObject * GtkObject *
@ -655,21 +664,24 @@ gimp_random_seed_toggle_update (GtkWidget *widget,
/** /**
* gimp_random_seed_new: * gimp_random_seed_new:
* @seed: * @seed: A pointer to the variable which stores the random seed.
* @seed_spinbutton: * @use_time: A pointer to the variable which stores the @use_time
* @use_time: * toggle boolean.
* @time_button: * @time_true: The value to write to @use_time if the toggle button is checked.
* @time_true: * @time_false: The value to write to @use_time if the toggle button is
* @time_false: * unchecked.
* *
* Returns: * Note that this widget automatically sets tooltips with
* gimp_help_set_help_data(), so you'll have to initialize GIMP's help
* system with gimp_help_init() before using it.
*
* Returns: A #GtkHBox containing a #GtkSpinButton for the random seed and
* a #GtkToggleButton for toggling the @use_time behaviour.
* *
*/ */
GtkWidget * GtkWidget *
gimp_random_seed_new (gint *seed, gimp_random_seed_new (gint *seed,
GtkWidget **seed_spinbutton,
gint *use_time, gint *use_time,
GtkWidget **time_button,
gint time_true, gint time_true,
gint time_false) gint time_false)
{ {
@ -688,9 +700,6 @@ gimp_random_seed_new (gint *seed,
seed); seed);
gtk_widget_show (spinbutton); gtk_widget_show (spinbutton);
if (seed_spinbutton)
*seed_spinbutton = spinbutton;
gimp_help_set_help_data (spinbutton, gimp_help_set_help_data (spinbutton,
_("If the \"Time\" button is not pressed, " _("If the \"Time\" button is not pressed, "
"use this value for random number generator " "use this value for random number generator "
@ -705,9 +714,6 @@ gimp_random_seed_new (gint *seed,
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_show (button); gtk_widget_show (button);
if (time_button)
*time_button = button;
gimp_help_set_help_data (button, gimp_help_set_help_data (button,
_("Seed random number generator from the current " _("Seed random number generator from the current "
"time - this guarantees a reasonable " "time - this guarantees a reasonable "
@ -724,6 +730,9 @@ gimp_random_seed_new (gint *seed,
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
*use_time == time_true); *use_time == time_true);
gtk_object_set_data (GTK_OBJECT (hbox), "spinbutton", spinbutton);
gtk_object_set_data (GTK_OBJECT (hbox), "togglebutton", button);
return hbox; return hbox;
} }
@ -799,31 +808,38 @@ gimp_coordinates_callback (GtkWidget *widget,
/** /**
* gimp_coordinates_new: * gimp_coordinates_new:
* @unit: * @unit: The unitial unit of the #GimpUnitMenu.
* @unit_format: * @unit_format: The unit format string as passed to gimp_size_entry_new().
* @menu_show_pixels: * @menu_show_pixels: #TRUE if the #GimpUnitMenu should contain an item for
* @menu_show_percent: * GIMP_UNIT_PIXEL.
* @spinbutton_usize: * @menu_show_percent: #TRUE if the #GimpUnitMenu should contain an item for
* @update_policy: * GIMP_UNIT_PERCENT.
* @chainbutton_active: * @spinbutton_usize: The horizontal usize of the #GimpSizeEntry's
* @chain_constrains_ratio: * #GtkSpinButton's.
* @chainbutton: * @update_policy: The update policy for the #GimpSizeEntry.
* @xlabel: * @chainbutton_active: #TRUE if the attached #GimpChainButton should be
* @x: * active.
* @xres: * @chain_constrains_ratio: #TRUE if the chainbutton should constrain the
* @lower_boundary_x: * fields' aspect ratio. If #FALSE, the values will
* @upper_boundary_x: * be constrained.
* @xsize_0: * @xlabel: The label for the X coordinate.
* @xsize_100: * @x: The initial value of the X coordinate.
* @ylabel: * @xres: The horizontal resolution in DPI.
* @y: * @lower_boundary_x: The lower boundary of the X coordinate.
* @yres: * @upper_boundary_x: The upper boundary of the X coordinate.
* @lower_boundary_y: * @xsize_0: The X value which will be treated as 0%.
* @upper_boundary_y: * @xsize_100: The X value which will be treated as 100%.
* @ysize_0: * @ylabel: The label for the Y coordinate.
* @ysize_100: * @y: The initial value of the Y coordinate.
* @yres: The vertical resolution in DPI.
* @lower_boundary_y: The lower boundary of the Y coordinate.
* @upper_boundary_y: The upper boundary of the Y coordinate.
* @ysize_0: The Y value which will be treated as 0%.
* @ysize_100: The Y value which will be treated as 100%.
* *
* Returns: * Returns: A #GimpSizeEntry with two fields for x/y coordinates/sizes with
* a #GimpChainButton attached to constrain either the two fields'
* values or the ratio between them.
* *
*/ */
GtkWidget * GtkWidget *
@ -836,8 +852,6 @@ gimp_coordinates_new (GimpUnit unit,
gboolean chainbutton_active, gboolean chainbutton_active,
gboolean chain_constrains_ratio, gboolean chain_constrains_ratio,
/* return value: */
GtkWidget **chainbutton,
gchar *xlabel, gchar *xlabel,
gdouble x, gdouble x,
@ -859,7 +873,7 @@ gimp_coordinates_new (GimpUnit unit,
GtkObject *adjustment; GtkObject *adjustment;
GtkWidget *spinbutton; GtkWidget *spinbutton;
GtkWidget *sizeentry; GtkWidget *sizeentry;
GtkWidget *chainb; GtkWidget *chainbutton;
spinbutton = gimp_spin_button_new (&adjustment, 1, 0, 1, 1, 10, 1, 1, 2); spinbutton = gimp_spin_button_new (&adjustment, 1, 0, 1, 1, 10, 1, 1, 2);
sizeentry = gimp_size_entry_new (1, unit, unit_format, sizeentry = gimp_size_entry_new (1, unit, unit_format,
@ -898,18 +912,15 @@ gimp_coordinates_new (GimpUnit unit,
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry), xlabel, 0, 0, 1.0); gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry), xlabel, 0, 0, 1.0);
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry), ylabel, 1, 0, 1.0); gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry), ylabel, 1, 0, 1.0);
chainb = gimp_chain_button_new (GIMP_CHAIN_RIGHT); chainbutton = gimp_chain_button_new (GIMP_CHAIN_RIGHT);
if (chainbutton_active) if (chainbutton_active)
gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (chainb), TRUE); gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (chainbutton), TRUE);
gtk_table_attach (GTK_TABLE (sizeentry), chainb, 2, 3, 0, 2, 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 (chainb); gtk_widget_show (chainbutton);
if (chainbutton)
*chainbutton = chainb;
gcd = g_new (GimpCoordinatesData, 1); gcd = g_new (GimpCoordinatesData, 1);
gcd->chainbutton = GIMP_CHAIN_BUTTON (chainb); gcd->chainbutton = GIMP_CHAIN_BUTTON (chainbutton);
gcd->chain_constrains_ratio = chain_constrains_ratio; gcd->chain_constrains_ratio = chain_constrains_ratio;
gcd->orig_x = x; gcd->orig_x = x;
gcd->orig_y = y; gcd->orig_y = y;
@ -924,15 +935,17 @@ gimp_coordinates_new (GimpUnit unit,
GTK_SIGNAL_FUNC (gimp_coordinates_callback), GTK_SIGNAL_FUNC (gimp_coordinates_callback),
gcd); gcd);
gtk_object_set_data (GTK_OBJECT (sizeentry), "chainbutton", chainbutton);
return sizeentry; return sizeentry;
} }
/** /**
* gimp_pixmap_button_new: * gimp_pixmap_button_new:
* @xpm_data: * @xpm_data: The XPM data which will be passed to gimp_pixmap_new().
* @text: * @text: An optional text which will appear right of the pixmap.
* *
* Returns: * Returns: A #GtkButton with a #GimpPixmap and an optional #GtkLabel.
* *
*/ */
GtkWidget * GtkWidget *
@ -980,7 +993,25 @@ gimp_pixmap_button_new (gchar **xpm_data,
* Standard Callbacks * Standard Callbacks
*/ */
static void /**
* gimp_toggle_button_sensitive_update:
* @toggle_button: The #GtkToggleButton the "set_sensitive" and
* "inverse_sensitive" lists are attached to.
*
* If you attached a pointer to a #GtkWidget with gtk_object_set_data() and
* the "set_sensitive" key to the #GtkToggleButton, the sensitive state of
* the attached widget will be set according to the toggle button's
* "active" state.
*
* You can attach an arbitrary list of widgets by attaching another
* "set_sensitive" data pointer to the first widget (and so on...).
*
* This function can also set the sensitive state according to the toggle
* button's inverse "active" state by attaching widgets with the
* "inverse_sensitive" key.
*
*/
void
gimp_toggle_button_sensitive_update (GtkToggleButton *toggle_button) gimp_toggle_button_sensitive_update (GtkToggleButton *toggle_button)
{ {
GtkWidget *set_sensitive; GtkWidget *set_sensitive;
@ -1009,8 +1040,11 @@ gimp_toggle_button_sensitive_update (GtkToggleButton *toggle_button)
/** /**
* gimp_toggle_button_update: * gimp_toggle_button_update:
* @widget: * @widget: A #GtkToggleButton.
* @data: * @data: A pointer to a #gint variable which will store the value of
* gtk_toggle_button_get_active().
*
* Note that this function calls gimp_toggle_button_sensitive_update().
* *
*/ */
void void
@ -1029,27 +1063,13 @@ gimp_toggle_button_update (GtkWidget *widget,
gimp_toggle_button_sensitive_update (GTK_TOGGLE_BUTTON (widget)); gimp_toggle_button_sensitive_update (GTK_TOGGLE_BUTTON (widget));
} }
/**
* gimp_menu_item_update:
* @widget:
* @data:
*
*/
void
gimp_menu_item_update (GtkWidget *widget,
gpointer data)
{
gint *item_val;
item_val = (gint *) data;
*item_val = (gint) gtk_object_get_user_data (GTK_OBJECT (widget));
}
/** /**
* gimp_radio_button_update: * gimp_radio_button_update:
* @widget: * @widget: A #GtkRadioButton.
* @data: * @data: A pointer to a #gint variable which will store the value of
* (#gint) gtk_object_get_user_data().
*
* Note that this function calls gimp_toggle_button_sensitive_update().
* *
*/ */
void void
@ -1068,10 +1088,32 @@ gimp_radio_button_update (GtkWidget *widget,
gimp_toggle_button_sensitive_update (GTK_TOGGLE_BUTTON (widget)); gimp_toggle_button_sensitive_update (GTK_TOGGLE_BUTTON (widget));
} }
/**
* gimp_menu_item_update:
* @widget: A #GtkMenuItem.
* @data: A pointer to a #gint variable which will store the value of
* (#gint) gtk_object_get_user_data().
*
*/
void
gimp_menu_item_update (GtkWidget *widget,
gpointer data)
{
gint *item_val;
item_val = (gint *) data;
*item_val = (gint) gtk_object_get_user_data (GTK_OBJECT (widget));
}
/** /**
* gimp_int_adjustment_update: * gimp_int_adjustment_update:
* @adjustment: * @adjustment: A #GtkAdjustment.
* @data: * @data: A pointer to a #gint variable which will store the adjustment's
* value.
*
* Note that the #GtkAdjustment's value (which is a #gfloat) will be rounded
* with (#gint) (value + 0.5).
* *
*/ */
void void
@ -1086,8 +1128,9 @@ gimp_int_adjustment_update (GtkAdjustment *adjustment,
/** /**
* gimp_float_adjustment_update: * gimp_float_adjustment_update:
* @adjustment: * @adjustment: A #GtkAdjustment.
* @data: * @data: A pointer to a #gfloat varaiable which willl store the adjustment's
* value.
* *
*/ */
void void
@ -1102,8 +1145,9 @@ gimp_float_adjustment_update (GtkAdjustment *adjustment,
/** /**
* gimp_double_adjustment_update: * gimp_double_adjustment_update:
* @adjustment: * @adjustment: A #GtkAdjustment.
* @data: * @data: A pointer to a #gdouble variable which will store the adjustment's
* value.
* *
*/ */
void void
@ -1118,8 +1162,17 @@ gimp_double_adjustment_update (GtkAdjustment *adjustment,
/** /**
* gimp_unit_menu_update: * gimp_unit_menu_update:
* @widget: * @widget: A #GimpUnitMenu.
* @data: * @data: A pointer to a #GimpUnit variable which will store the unit menu's
* value.
*
* This callback can set the number of decimal digits of an arbitrary number
* of #GtkSpinButton's. To use this functionality, attach the spinbuttons
* as list of data pointers attached with gtk_object_set_data() with the
* "set_digits" key.
*
* See gimp_toggle_button_sensitive_update() for a description of how
* to set up the list.
* *
*/ */
void void
@ -1152,15 +1205,19 @@ gimp_unit_menu_update (GtkWidget *widget,
/** /**
* gimp_table_attach_aligned: * gimp_table_attach_aligned:
* @table: * @table: The #GtkTable the widgets will be attached to.
* @column: * @column: The column to start with.
* @row: * @row: The row to attach the eidgets.
* @label_text: * @label_text: The text for the #GtkLabel which will be attached left of the
* @xalign: * widget.
* @yalign: * @xalign: The horizontal alignment of the #GtkLabel.
* @widget: * @yalign: The vertival alignment of the #GtkLabel.
* @colspan: * @widget: The #GtkWidget to attach right of the label.
* @left_align: * @colspan: The number of columns the widget will use.
* @left_align: #TRUE if the widget should be left-aligned.
*
* Note that the @label_text can be #NULL and that the widget will be attached
* starting at (@column + 1) in this case, too.
* *
*/ */
void void

View File

@ -30,6 +30,8 @@
extern "C" { extern "C" {
#endif #endif
/* For information look into the C source or the html documentation */
/* /*
* Widget Constructors * Widget Constructors
*/ */
@ -110,13 +112,13 @@ GtkWidget * gimp_spin_button_new (/* return value: */
GTK_HSCALE (gtk_object_get_data (GTK_OBJECT(adj), "scale")) GTK_HSCALE (gtk_object_get_data (GTK_OBJECT(adj), "scale"))
#define GIMP_SCALE_ENTRY_SCALE_ADJ(adj) \ #define GIMP_SCALE_ENTRY_SCALE_ADJ(adj) \
gtk_range_get_adjustment \ gtk_range_get_adjustment \
(GTK_RANGE (gtk_object_get_data (GTK_OBJECT(adj), "scale"))) (GTK_RANGE (gtk_object_get_data (GTK_OBJECT (adj), "scale")))
#define GIMP_SCALE_ENTRY_SPINBUTTON(adj) \ #define GIMP_SCALE_ENTRY_SPINBUTTON(adj) \
GTK_SPIN_BUTTON (gtk_object_get_data (GTK_OBJECT(adj), "spinbutton")) GTK_SPIN_BUTTON (gtk_object_get_data (GTK_OBJECT (adj), "spinbutton"))
#define GIMP_SCALE_ENTRY_SPINBUTTON_ADJ(adj) \ #define GIMP_SCALE_ENTRY_SPINBUTTON_ADJ(adj) \
gtk_spin_button_get_adjustment \ gtk_spin_button_get_adjustment \
(GTK_SPIN_BUTTON (gtk_object_get_data (GTK_OBJECT(adj), "spinbutton"))) (GTK_SPIN_BUTTON (gtk_object_get_data (GTK_OBJECT (adj), "spinbutton")))
GtkObject * gimp_scale_entry_new (GtkTable *table, GtkObject * gimp_scale_entry_new (GtkTable *table,
gint column, gint column,
@ -136,13 +138,25 @@ GtkObject * gimp_scale_entry_new (GtkTable *table,
gchar *tooltip, gchar *tooltip,
gchar *private_tip); gchar *private_tip);
#define GIMP_RANDOM_SEED_SPINBUTTON(hbox) \
GTK_SPIN_BUTTON (gtk_object_get_data (GTK_OBJECT( hbox), "spinbutton"))
#define GIMP_RANDOM_SEED_SPINBUTTON_ADJ(hbox) \
gtk_spin_button_get_adjustment \
(GTK_SPIN_BUTTON (gtk_object_get_data (GTK_OBJECT (hbox), "spinbutton")))
#define GIMP_RANDOM_SEED_TOGGLEBUTTON(hbox) \
GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT (hbox), \
"togglebutton"))
GtkWidget * gimp_random_seed_new (gint *seed, GtkWidget * gimp_random_seed_new (gint *seed,
GtkWidget **seed_spinbutton,
gint *use_time, gint *use_time,
GtkWidget **time_button,
gint time_true, gint time_true,
gint time_false); gint time_false);
#define GIMP_COORDINATES_CHAINBUTTON(sizeentry) \
GIMP_CHAIN_BUTTON (gtk_object_get_data (GTK_OBJECT (sizeentry), \
"chainbutton"))
GtkWidget * gimp_coordinates_new (GimpUnit unit, GtkWidget * gimp_coordinates_new (GimpUnit unit,
gchar *unit_format, gchar *unit_format,
gboolean menu_show_pixels, gboolean menu_show_pixels,
@ -152,8 +166,6 @@ GtkWidget * gimp_coordinates_new (GimpUnit unit,
gboolean chainbutton_active, gboolean chainbutton_active,
gboolean chain_constrains_ratio, gboolean chain_constrains_ratio,
/* return value: */
GtkWidget **chainbutton,
gchar *xlabel, gchar *xlabel,
gdouble x, gdouble x,
@ -178,32 +190,33 @@ GtkWidget * gimp_pixmap_button_new (gchar **xpm_data,
* Standard Callbacks * Standard Callbacks
*/ */
void gimp_toggle_button_update (GtkWidget *widget, void gimp_toggle_button_sensitive_update (GtkToggleButton *toggle_button);
gpointer data);
void gimp_menu_item_update (GtkWidget *widget, void gimp_toggle_button_update (GtkWidget *widget,
gpointer data); gpointer data);
void gimp_radio_button_update (GtkWidget *widget, void gimp_radio_button_update (GtkWidget *widget,
gpointer data); gpointer data);
void gimp_int_adjustment_update (GtkAdjustment *adjustment, void gimp_menu_item_update (GtkWidget *widget,
gpointer data); gpointer data);
void gimp_float_adjustment_update (GtkAdjustment *adjustment, void gimp_int_adjustment_update (GtkAdjustment *adjustment,
gpointer data); gpointer data);
void gimp_double_adjustment_update (GtkAdjustment *adjustment, void gimp_float_adjustment_update (GtkAdjustment *adjustment,
gpointer data); gpointer data);
void gimp_unit_menu_update (GtkWidget *widget, void gimp_double_adjustment_update (GtkAdjustment *adjustment,
gpointer data); gpointer data);
void gimp_unit_menu_update (GtkWidget *widget,
gpointer data);
/* /*
* Helper Functions * Helper Functions
*/ */
/* add aligned label & widget to a table */
void gimp_table_attach_aligned (GtkTable *table, void gimp_table_attach_aligned (GtkTable *table,
gint column, gint column,
gint row, gint row,

View File

@ -249,11 +249,12 @@ gimp_gtkrc (void)
/** /**
* gimp_path_parse: * gimp_path_parse:
* @path: A list of directories separated by #G_SEARCHPATH_SEPARATOR. * @path: A list of directories separated by #G_SEARCHPATH_SEPARATOR.
* @max_path: The maximum number of directories to return. * @max_paths: The maximum number of directories to return.
* @check: #TRUE if you want the directories to be checked. * @check: #TRUE if you want the directories to be checked.
* @not_found: # * @check_failed: Returns a #GList of path elements for which the
* check failed.
* *
* Return: A list of all directories in @path. * Returns: A #GList of all directories in @path.
* *
*/ */
GList * GList *

View File

@ -383,7 +383,8 @@ gimp_query_size_box (gchar *title,
* @false_button: The string to be shown in the dialog's right button. * @false_button: The string to be shown in the dialog's right button.
* @object: The object this query box is associated with. * @object: The object this query box is associated with.
* @signal: The object's signal which will cause the query box to be closed. * @signal: The object's signal which will cause the query box to be closed.
* @callback: The function which will be called when the user selects "OK". * @callback: The function which will be called when the user clicks one
* of the buttons.
* @data: The callback's user data. * @data: The callback's user data.
* *
* Returns: A pointer to the new #GtkDialog. * Returns: A pointer to the new #GtkDialog.

View File

@ -31,23 +31,16 @@
#include "libgimp-intl.h" #include "libgimp-intl.h"
/*
* Forward declarations
*/
static void gimp_toggle_button_sensitive_update (GtkToggleButton *toggle_button);
/* /*
* Widget Constructors * Widget Constructors
*/ */
/** /**
* gimp_option_menu_new: * gimp_option_menu_new:
* @menu_only: * @menu_only: #TRUE if the function should return a #GtkMenu only.
* @...: * @...: A #NULL terminated @va_list describing the menu items.
* *
* Returns: * Returns: A #GtkOptionMenu or a #GtkMenu (depending on @menu_only).
* *
*/ */
GtkWidget * GtkWidget *
@ -142,13 +135,14 @@ gimp_option_menu_new (gboolean menu_only,
/** /**
* gimp_option_menu_new2: * gimp_option_menu_new2:
* @menu_only: * @menu_only: #TRUE if the function should return a #GtkMenu only.
* @menu_item_callback: * @menu_item_callback: The callback each menu item's "activate" signal will
* @data: * be connected with.
* @initial: * @data: The data which will be passed to gtk_signal_connect().
* @...: * @initial: The @user_data of the initially selected menu item.
* @...: A #NULL terminated @va_list describing the menu items.
* *
* Returns: * Returns: A #GtkOptionMenu or a #GtkMenu (depending on @menu_only).
* *
*/ */
GtkWidget * GtkWidget *
@ -237,8 +231,9 @@ gimp_option_menu_new2 (gboolean menu_only,
/** /**
* gimp_option_menu_set_history: * gimp_option_menu_set_history:
* @option_menu: * @option_menu: A #GtkOptionMenu as returned by gimp_option_menu_new() or
* @user_data: * gimp_option_menu_new2().
* @user_data: The @user_data of the menu item you want to select.
* *
*/ */
void void
@ -273,11 +268,11 @@ gimp_option_menu_set_history (GtkOptionMenu *option_menu,
/** /**
* gimp_radio_group_new: * gimp_radio_group_new:
* @in_frame: * @in_frame: #TRUE if you want a #GtkFrame around the radio button group.
* @frame_title: * @frame_title: The title of the Frame or #NULL if you don't want a title.
* @...: * @...: A #NULL terminated @va_list describing the radio buttons.
* *
* Returns: * Returns: A #GtkFrame or #GtkVbox (depending on @in_frame).
* *
*/ */
GtkWidget * GtkWidget *
@ -368,14 +363,15 @@ gimp_radio_group_new (gboolean in_frame,
/** /**
* gimp_radio_group_new2: * gimp_radio_group_new2:
* @in_frame: * @in_frame: #TRUE if you want a #GtkFrame around the radio button group.
* @frame_title: * @frame_title: The title of the Frame or #NULL if you don't want a title.
* @radio_button_callback: * @radio_button_callback: The callback each button's "toggled" signal will
* @data: * be connected with.
* @initial: * @data: The data which will be passed to gtk_signal_connect().
* @...: * @initial: The @user_data of the initially pressed radio button.
* @...: A #NULL terminated @va_list describing the radio buttons.
* *
* Returns: * Returns: A #GtkFrame or #GtkVbox (depending on @in_frame).
* *
*/ */
GtkWidget * GtkWidget *
@ -460,17 +456,21 @@ gimp_radio_group_new2 (gboolean in_frame,
/** /**
* gimp_spin_button_new: * gimp_spin_button_new:
* @adjustment: * @adjustment: Returns the spinbutton's #GtkAdjustment.
* @value: * @value: The initial value of the spinbutton.
* @lower: * @lower: The lower boundary.
* @upper: * @upper: The uppper boundary.
* @step_increment: * @step_increment: The spinbutton's step increment.
* @page_increment: * @page_increment: The spinbutton's page increment (mouse button 2).
* @page_size: * @page_size: The spinbutton's page size.
* @climb_rate: * @climb_rate: The spinbutton's climb rate.
* @digits: * @digits: The spinbutton's number of decimal digits.
* *
* Returns: * This function is a shortcut for gtk_adjustment_new() and a subsequent
* gtk_spin_button_new() and does some more initialisation stuff like
* setting a standard minimun horizontal size.
*
* Returns: A #GtkSpinbutton and it's #GtkAdjustment.
* *
*/ */
GtkWidget * GtkWidget *
@ -512,25 +512,34 @@ gimp_scale_entry_unconstrained_adjustment_callback (GtkAdjustment *adjustment,
/** /**
* gimp_scale_entry_new: * gimp_scale_entry_new:
* @table: * @table: The #GtkTable the widgets will be attached to.
* @column: * @column: The column to start with.
* @row: * @row: The row to attach the widgets.
* @text: * @text: The text for the #GtkLabel which will appear left of the #GtkHScale.
* @scale_usize: * @scale_usize: The minimum horizontal size of the #GtkHScale.
* @spinbutton_usize: * @spinbutton_usize: The minimum horizontal size of the #GtkSpinButton.
* @value: * @value: The initial value.
* @lower: * @lower: The lower boundary.
* @upper: * @upper: The upper boundary.
* @step_increment: * @step_increment: The step increment.
* @page_increment: * @page_increment: The page increment.
* @digits: * @digits: The number of decimal digits.
* @constrain: * @constrain: #TRUE if the range of possible values of the #GtkSpinButton
* @unconstrained_lower: * should be the same as of the #GtkHScale.
* @unconstrained_upper: * @unconstrained_lower: The spinbutton's lower boundary
* @tooltip: * if @constrain == #FALSE.
* @private_tip: * @unconstrained_upper: The spinbutton's upper boundary
* if @constrain == #FALSE.
* @tooltip: A tooltip message for the scale and the spinbutton.
* @private_tip: The widgets' private_tip (see gimp_help_set_help_data()).
* *
* Returns: * This function creates a #GtkLabel, a #GtkHScale and a #GtkSpinButton and
* attaches them to a 3-column #GtkTable.
*
* Note that if you pass a @tooltip or @private_tip to this function you'll
* have to initialize GIMP's help system with gimp_help_init() before using it.
*
* Returns: The #GtkSpinButton's #GtkAdjustment.
* *
*/ */
GtkObject * GtkObject *
@ -655,21 +664,24 @@ gimp_random_seed_toggle_update (GtkWidget *widget,
/** /**
* gimp_random_seed_new: * gimp_random_seed_new:
* @seed: * @seed: A pointer to the variable which stores the random seed.
* @seed_spinbutton: * @use_time: A pointer to the variable which stores the @use_time
* @use_time: * toggle boolean.
* @time_button: * @time_true: The value to write to @use_time if the toggle button is checked.
* @time_true: * @time_false: The value to write to @use_time if the toggle button is
* @time_false: * unchecked.
* *
* Returns: * Note that this widget automatically sets tooltips with
* gimp_help_set_help_data(), so you'll have to initialize GIMP's help
* system with gimp_help_init() before using it.
*
* Returns: A #GtkHBox containing a #GtkSpinButton for the random seed and
* a #GtkToggleButton for toggling the @use_time behaviour.
* *
*/ */
GtkWidget * GtkWidget *
gimp_random_seed_new (gint *seed, gimp_random_seed_new (gint *seed,
GtkWidget **seed_spinbutton,
gint *use_time, gint *use_time,
GtkWidget **time_button,
gint time_true, gint time_true,
gint time_false) gint time_false)
{ {
@ -688,9 +700,6 @@ gimp_random_seed_new (gint *seed,
seed); seed);
gtk_widget_show (spinbutton); gtk_widget_show (spinbutton);
if (seed_spinbutton)
*seed_spinbutton = spinbutton;
gimp_help_set_help_data (spinbutton, gimp_help_set_help_data (spinbutton,
_("If the \"Time\" button is not pressed, " _("If the \"Time\" button is not pressed, "
"use this value for random number generator " "use this value for random number generator "
@ -705,9 +714,6 @@ gimp_random_seed_new (gint *seed,
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_show (button); gtk_widget_show (button);
if (time_button)
*time_button = button;
gimp_help_set_help_data (button, gimp_help_set_help_data (button,
_("Seed random number generator from the current " _("Seed random number generator from the current "
"time - this guarantees a reasonable " "time - this guarantees a reasonable "
@ -724,6 +730,9 @@ gimp_random_seed_new (gint *seed,
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
*use_time == time_true); *use_time == time_true);
gtk_object_set_data (GTK_OBJECT (hbox), "spinbutton", spinbutton);
gtk_object_set_data (GTK_OBJECT (hbox), "togglebutton", button);
return hbox; return hbox;
} }
@ -799,31 +808,38 @@ gimp_coordinates_callback (GtkWidget *widget,
/** /**
* gimp_coordinates_new: * gimp_coordinates_new:
* @unit: * @unit: The unitial unit of the #GimpUnitMenu.
* @unit_format: * @unit_format: The unit format string as passed to gimp_size_entry_new().
* @menu_show_pixels: * @menu_show_pixels: #TRUE if the #GimpUnitMenu should contain an item for
* @menu_show_percent: * GIMP_UNIT_PIXEL.
* @spinbutton_usize: * @menu_show_percent: #TRUE if the #GimpUnitMenu should contain an item for
* @update_policy: * GIMP_UNIT_PERCENT.
* @chainbutton_active: * @spinbutton_usize: The horizontal usize of the #GimpSizeEntry's
* @chain_constrains_ratio: * #GtkSpinButton's.
* @chainbutton: * @update_policy: The update policy for the #GimpSizeEntry.
* @xlabel: * @chainbutton_active: #TRUE if the attached #GimpChainButton should be
* @x: * active.
* @xres: * @chain_constrains_ratio: #TRUE if the chainbutton should constrain the
* @lower_boundary_x: * fields' aspect ratio. If #FALSE, the values will
* @upper_boundary_x: * be constrained.
* @xsize_0: * @xlabel: The label for the X coordinate.
* @xsize_100: * @x: The initial value of the X coordinate.
* @ylabel: * @xres: The horizontal resolution in DPI.
* @y: * @lower_boundary_x: The lower boundary of the X coordinate.
* @yres: * @upper_boundary_x: The upper boundary of the X coordinate.
* @lower_boundary_y: * @xsize_0: The X value which will be treated as 0%.
* @upper_boundary_y: * @xsize_100: The X value which will be treated as 100%.
* @ysize_0: * @ylabel: The label for the Y coordinate.
* @ysize_100: * @y: The initial value of the Y coordinate.
* @yres: The vertical resolution in DPI.
* @lower_boundary_y: The lower boundary of the Y coordinate.
* @upper_boundary_y: The upper boundary of the Y coordinate.
* @ysize_0: The Y value which will be treated as 0%.
* @ysize_100: The Y value which will be treated as 100%.
* *
* Returns: * Returns: A #GimpSizeEntry with two fields for x/y coordinates/sizes with
* a #GimpChainButton attached to constrain either the two fields'
* values or the ratio between them.
* *
*/ */
GtkWidget * GtkWidget *
@ -836,8 +852,6 @@ gimp_coordinates_new (GimpUnit unit,
gboolean chainbutton_active, gboolean chainbutton_active,
gboolean chain_constrains_ratio, gboolean chain_constrains_ratio,
/* return value: */
GtkWidget **chainbutton,
gchar *xlabel, gchar *xlabel,
gdouble x, gdouble x,
@ -859,7 +873,7 @@ gimp_coordinates_new (GimpUnit unit,
GtkObject *adjustment; GtkObject *adjustment;
GtkWidget *spinbutton; GtkWidget *spinbutton;
GtkWidget *sizeentry; GtkWidget *sizeentry;
GtkWidget *chainb; GtkWidget *chainbutton;
spinbutton = gimp_spin_button_new (&adjustment, 1, 0, 1, 1, 10, 1, 1, 2); spinbutton = gimp_spin_button_new (&adjustment, 1, 0, 1, 1, 10, 1, 1, 2);
sizeentry = gimp_size_entry_new (1, unit, unit_format, sizeentry = gimp_size_entry_new (1, unit, unit_format,
@ -898,18 +912,15 @@ gimp_coordinates_new (GimpUnit unit,
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry), xlabel, 0, 0, 1.0); gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry), xlabel, 0, 0, 1.0);
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry), ylabel, 1, 0, 1.0); gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry), ylabel, 1, 0, 1.0);
chainb = gimp_chain_button_new (GIMP_CHAIN_RIGHT); chainbutton = gimp_chain_button_new (GIMP_CHAIN_RIGHT);
if (chainbutton_active) if (chainbutton_active)
gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (chainb), TRUE); gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (chainbutton), TRUE);
gtk_table_attach (GTK_TABLE (sizeentry), chainb, 2, 3, 0, 2, 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 (chainb); gtk_widget_show (chainbutton);
if (chainbutton)
*chainbutton = chainb;
gcd = g_new (GimpCoordinatesData, 1); gcd = g_new (GimpCoordinatesData, 1);
gcd->chainbutton = GIMP_CHAIN_BUTTON (chainb); gcd->chainbutton = GIMP_CHAIN_BUTTON (chainbutton);
gcd->chain_constrains_ratio = chain_constrains_ratio; gcd->chain_constrains_ratio = chain_constrains_ratio;
gcd->orig_x = x; gcd->orig_x = x;
gcd->orig_y = y; gcd->orig_y = y;
@ -924,15 +935,17 @@ gimp_coordinates_new (GimpUnit unit,
GTK_SIGNAL_FUNC (gimp_coordinates_callback), GTK_SIGNAL_FUNC (gimp_coordinates_callback),
gcd); gcd);
gtk_object_set_data (GTK_OBJECT (sizeentry), "chainbutton", chainbutton);
return sizeentry; return sizeentry;
} }
/** /**
* gimp_pixmap_button_new: * gimp_pixmap_button_new:
* @xpm_data: * @xpm_data: The XPM data which will be passed to gimp_pixmap_new().
* @text: * @text: An optional text which will appear right of the pixmap.
* *
* Returns: * Returns: A #GtkButton with a #GimpPixmap and an optional #GtkLabel.
* *
*/ */
GtkWidget * GtkWidget *
@ -980,7 +993,25 @@ gimp_pixmap_button_new (gchar **xpm_data,
* Standard Callbacks * Standard Callbacks
*/ */
static void /**
* gimp_toggle_button_sensitive_update:
* @toggle_button: The #GtkToggleButton the "set_sensitive" and
* "inverse_sensitive" lists are attached to.
*
* If you attached a pointer to a #GtkWidget with gtk_object_set_data() and
* the "set_sensitive" key to the #GtkToggleButton, the sensitive state of
* the attached widget will be set according to the toggle button's
* "active" state.
*
* You can attach an arbitrary list of widgets by attaching another
* "set_sensitive" data pointer to the first widget (and so on...).
*
* This function can also set the sensitive state according to the toggle
* button's inverse "active" state by attaching widgets with the
* "inverse_sensitive" key.
*
*/
void
gimp_toggle_button_sensitive_update (GtkToggleButton *toggle_button) gimp_toggle_button_sensitive_update (GtkToggleButton *toggle_button)
{ {
GtkWidget *set_sensitive; GtkWidget *set_sensitive;
@ -1009,8 +1040,11 @@ gimp_toggle_button_sensitive_update (GtkToggleButton *toggle_button)
/** /**
* gimp_toggle_button_update: * gimp_toggle_button_update:
* @widget: * @widget: A #GtkToggleButton.
* @data: * @data: A pointer to a #gint variable which will store the value of
* gtk_toggle_button_get_active().
*
* Note that this function calls gimp_toggle_button_sensitive_update().
* *
*/ */
void void
@ -1029,27 +1063,13 @@ gimp_toggle_button_update (GtkWidget *widget,
gimp_toggle_button_sensitive_update (GTK_TOGGLE_BUTTON (widget)); gimp_toggle_button_sensitive_update (GTK_TOGGLE_BUTTON (widget));
} }
/**
* gimp_menu_item_update:
* @widget:
* @data:
*
*/
void
gimp_menu_item_update (GtkWidget *widget,
gpointer data)
{
gint *item_val;
item_val = (gint *) data;
*item_val = (gint) gtk_object_get_user_data (GTK_OBJECT (widget));
}
/** /**
* gimp_radio_button_update: * gimp_radio_button_update:
* @widget: * @widget: A #GtkRadioButton.
* @data: * @data: A pointer to a #gint variable which will store the value of
* (#gint) gtk_object_get_user_data().
*
* Note that this function calls gimp_toggle_button_sensitive_update().
* *
*/ */
void void
@ -1068,10 +1088,32 @@ gimp_radio_button_update (GtkWidget *widget,
gimp_toggle_button_sensitive_update (GTK_TOGGLE_BUTTON (widget)); gimp_toggle_button_sensitive_update (GTK_TOGGLE_BUTTON (widget));
} }
/**
* gimp_menu_item_update:
* @widget: A #GtkMenuItem.
* @data: A pointer to a #gint variable which will store the value of
* (#gint) gtk_object_get_user_data().
*
*/
void
gimp_menu_item_update (GtkWidget *widget,
gpointer data)
{
gint *item_val;
item_val = (gint *) data;
*item_val = (gint) gtk_object_get_user_data (GTK_OBJECT (widget));
}
/** /**
* gimp_int_adjustment_update: * gimp_int_adjustment_update:
* @adjustment: * @adjustment: A #GtkAdjustment.
* @data: * @data: A pointer to a #gint variable which will store the adjustment's
* value.
*
* Note that the #GtkAdjustment's value (which is a #gfloat) will be rounded
* with (#gint) (value + 0.5).
* *
*/ */
void void
@ -1086,8 +1128,9 @@ gimp_int_adjustment_update (GtkAdjustment *adjustment,
/** /**
* gimp_float_adjustment_update: * gimp_float_adjustment_update:
* @adjustment: * @adjustment: A #GtkAdjustment.
* @data: * @data: A pointer to a #gfloat varaiable which willl store the adjustment's
* value.
* *
*/ */
void void
@ -1102,8 +1145,9 @@ gimp_float_adjustment_update (GtkAdjustment *adjustment,
/** /**
* gimp_double_adjustment_update: * gimp_double_adjustment_update:
* @adjustment: * @adjustment: A #GtkAdjustment.
* @data: * @data: A pointer to a #gdouble variable which will store the adjustment's
* value.
* *
*/ */
void void
@ -1118,8 +1162,17 @@ gimp_double_adjustment_update (GtkAdjustment *adjustment,
/** /**
* gimp_unit_menu_update: * gimp_unit_menu_update:
* @widget: * @widget: A #GimpUnitMenu.
* @data: * @data: A pointer to a #GimpUnit variable which will store the unit menu's
* value.
*
* This callback can set the number of decimal digits of an arbitrary number
* of #GtkSpinButton's. To use this functionality, attach the spinbuttons
* as list of data pointers attached with gtk_object_set_data() with the
* "set_digits" key.
*
* See gimp_toggle_button_sensitive_update() for a description of how
* to set up the list.
* *
*/ */
void void
@ -1152,15 +1205,19 @@ gimp_unit_menu_update (GtkWidget *widget,
/** /**
* gimp_table_attach_aligned: * gimp_table_attach_aligned:
* @table: * @table: The #GtkTable the widgets will be attached to.
* @column: * @column: The column to start with.
* @row: * @row: The row to attach the eidgets.
* @label_text: * @label_text: The text for the #GtkLabel which will be attached left of the
* @xalign: * widget.
* @yalign: * @xalign: The horizontal alignment of the #GtkLabel.
* @widget: * @yalign: The vertival alignment of the #GtkLabel.
* @colspan: * @widget: The #GtkWidget to attach right of the label.
* @left_align: * @colspan: The number of columns the widget will use.
* @left_align: #TRUE if the widget should be left-aligned.
*
* Note that the @label_text can be #NULL and that the widget will be attached
* starting at (@column + 1) in this case, too.
* *
*/ */
void void

View File

@ -30,6 +30,8 @@
extern "C" { extern "C" {
#endif #endif
/* For information look into the C source or the html documentation */
/* /*
* Widget Constructors * Widget Constructors
*/ */
@ -110,13 +112,13 @@ GtkWidget * gimp_spin_button_new (/* return value: */
GTK_HSCALE (gtk_object_get_data (GTK_OBJECT(adj), "scale")) GTK_HSCALE (gtk_object_get_data (GTK_OBJECT(adj), "scale"))
#define GIMP_SCALE_ENTRY_SCALE_ADJ(adj) \ #define GIMP_SCALE_ENTRY_SCALE_ADJ(adj) \
gtk_range_get_adjustment \ gtk_range_get_adjustment \
(GTK_RANGE (gtk_object_get_data (GTK_OBJECT(adj), "scale"))) (GTK_RANGE (gtk_object_get_data (GTK_OBJECT (adj), "scale")))
#define GIMP_SCALE_ENTRY_SPINBUTTON(adj) \ #define GIMP_SCALE_ENTRY_SPINBUTTON(adj) \
GTK_SPIN_BUTTON (gtk_object_get_data (GTK_OBJECT(adj), "spinbutton")) GTK_SPIN_BUTTON (gtk_object_get_data (GTK_OBJECT (adj), "spinbutton"))
#define GIMP_SCALE_ENTRY_SPINBUTTON_ADJ(adj) \ #define GIMP_SCALE_ENTRY_SPINBUTTON_ADJ(adj) \
gtk_spin_button_get_adjustment \ gtk_spin_button_get_adjustment \
(GTK_SPIN_BUTTON (gtk_object_get_data (GTK_OBJECT(adj), "spinbutton"))) (GTK_SPIN_BUTTON (gtk_object_get_data (GTK_OBJECT (adj), "spinbutton")))
GtkObject * gimp_scale_entry_new (GtkTable *table, GtkObject * gimp_scale_entry_new (GtkTable *table,
gint column, gint column,
@ -136,13 +138,25 @@ GtkObject * gimp_scale_entry_new (GtkTable *table,
gchar *tooltip, gchar *tooltip,
gchar *private_tip); gchar *private_tip);
#define GIMP_RANDOM_SEED_SPINBUTTON(hbox) \
GTK_SPIN_BUTTON (gtk_object_get_data (GTK_OBJECT( hbox), "spinbutton"))
#define GIMP_RANDOM_SEED_SPINBUTTON_ADJ(hbox) \
gtk_spin_button_get_adjustment \
(GTK_SPIN_BUTTON (gtk_object_get_data (GTK_OBJECT (hbox), "spinbutton")))
#define GIMP_RANDOM_SEED_TOGGLEBUTTON(hbox) \
GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT (hbox), \
"togglebutton"))
GtkWidget * gimp_random_seed_new (gint *seed, GtkWidget * gimp_random_seed_new (gint *seed,
GtkWidget **seed_spinbutton,
gint *use_time, gint *use_time,
GtkWidget **time_button,
gint time_true, gint time_true,
gint time_false); gint time_false);
#define GIMP_COORDINATES_CHAINBUTTON(sizeentry) \
GIMP_CHAIN_BUTTON (gtk_object_get_data (GTK_OBJECT (sizeentry), \
"chainbutton"))
GtkWidget * gimp_coordinates_new (GimpUnit unit, GtkWidget * gimp_coordinates_new (GimpUnit unit,
gchar *unit_format, gchar *unit_format,
gboolean menu_show_pixels, gboolean menu_show_pixels,
@ -152,8 +166,6 @@ GtkWidget * gimp_coordinates_new (GimpUnit unit,
gboolean chainbutton_active, gboolean chainbutton_active,
gboolean chain_constrains_ratio, gboolean chain_constrains_ratio,
/* return value: */
GtkWidget **chainbutton,
gchar *xlabel, gchar *xlabel,
gdouble x, gdouble x,
@ -178,32 +190,33 @@ GtkWidget * gimp_pixmap_button_new (gchar **xpm_data,
* Standard Callbacks * Standard Callbacks
*/ */
void gimp_toggle_button_update (GtkWidget *widget, void gimp_toggle_button_sensitive_update (GtkToggleButton *toggle_button);
gpointer data);
void gimp_menu_item_update (GtkWidget *widget, void gimp_toggle_button_update (GtkWidget *widget,
gpointer data); gpointer data);
void gimp_radio_button_update (GtkWidget *widget, void gimp_radio_button_update (GtkWidget *widget,
gpointer data); gpointer data);
void gimp_int_adjustment_update (GtkAdjustment *adjustment, void gimp_menu_item_update (GtkWidget *widget,
gpointer data); gpointer data);
void gimp_float_adjustment_update (GtkAdjustment *adjustment, void gimp_int_adjustment_update (GtkAdjustment *adjustment,
gpointer data); gpointer data);
void gimp_double_adjustment_update (GtkAdjustment *adjustment, void gimp_float_adjustment_update (GtkAdjustment *adjustment,
gpointer data); gpointer data);
void gimp_unit_menu_update (GtkWidget *widget, void gimp_double_adjustment_update (GtkAdjustment *adjustment,
gpointer data); gpointer data);
void gimp_unit_menu_update (GtkWidget *widget,
gpointer data);
/* /*
* Helper Functions * Helper Functions
*/ */
/* add aligned label & widget to a table */
void gimp_table_attach_aligned (GtkTable *table, void gimp_table_attach_aligned (GtkTable *table,
gint column, gint column,
gint row, gint row,

View File

@ -650,8 +650,8 @@ blur_dialog (void)
gtk_widget_show (table); gtk_widget_show (table);
/* Random Seed */ /* Random Seed */
seed_hbox = gimp_random_seed_new (&pivals.blur_seed, NULL, seed_hbox = gimp_random_seed_new (&pivals.blur_seed,
&pivals.seed_type, NULL, &pivals.seed_type,
SEED_TIME, SEED_USER); SEED_TIME, SEED_USER);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Random Seed:"), 1.0, 0.5, _("Random Seed:"), 1.0, 0.5,

View File

@ -464,7 +464,7 @@ gauss_iir2_dialog (gint32 image_ID,
GIMP_SIZE_ENTRY_UPDATE_SIZE, GIMP_SIZE_ENTRY_UPDATE_SIZE,
b2vals.horizontal == b2vals.vertical, b2vals.horizontal == b2vals.vertical,
FALSE, NULL, FALSE,
_("Horizontal:"), b2vals.horizontal, xres, _("Horizontal:"), b2vals.horizontal, xres,
0, 8 * MAX (drawable->width, drawable->height), 0, 8 * MAX (drawable->width, drawable->height),

View File

@ -461,7 +461,7 @@ gauss_rle2_dialog (gint32 image_ID,
GIMP_SIZE_ENTRY_UPDATE_SIZE, GIMP_SIZE_ENTRY_UPDATE_SIZE,
b2vals.horizontal == b2vals.vertical, b2vals.horizontal == b2vals.vertical,
FALSE, NULL, FALSE,
_("Horizontal:"), b2vals.horizontal, xres, _("Horizontal:"), b2vals.horizontal, xres,
0, 8 * MAX (drawable->width, drawable->height), 0, 8 * MAX (drawable->width, drawable->height),

View File

@ -317,8 +317,8 @@ plasma_dialog (void)
gtk_container_set_border_width (GTK_CONTAINER (table), 4); gtk_container_set_border_width (GTK_CONTAINER (table), 4);
gtk_container_add (GTK_CONTAINER (frame), table); gtk_container_add (GTK_CONTAINER (frame), table);
seed_hbox = gimp_random_seed_new (&pvals.seed, NULL, seed_hbox = gimp_random_seed_new (&pvals.seed,
&pvals.timeseed, NULL, &pvals.timeseed,
TRUE, FALSE); TRUE, FALSE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Random Seed:"), 1.0, 0.5, _("Random Seed:"), 1.0, 0.5,

View File

@ -738,8 +738,8 @@ randomize_dialog (void)
gtk_widget_show(table); gtk_widget_show(table);
/* Random Seed */ /* Random Seed */
seed_hbox = gimp_random_seed_new (&pivals.rndm_seed, NULL, seed_hbox = gimp_random_seed_new (&pivals.rndm_seed,
&pivals.seed_type, NULL, &pivals.seed_type,
SEED_TIME, SEED_USER); SEED_TIME, SEED_USER);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Random Seed:"), 1.0, 0.5, _("Random Seed:"), 1.0, 0.5,

View File

@ -549,8 +549,8 @@ solid_noise_dialog (void)
gtk_container_add (GTK_CONTAINER (frame), table); gtk_container_add (GTK_CONTAINER (frame), table);
/* Random Seed */ /* Random Seed */
seed_hbox = gimp_random_seed_new (&snvals.seed, NULL, seed_hbox = gimp_random_seed_new (&snvals.seed,
&snvals.timeseed, NULL, &snvals.timeseed,
TRUE, FALSE); TRUE, FALSE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Random Seed:"), 1.0, 0.5, _("Random Seed:"), 1.0, 0.5,

View File

@ -403,7 +403,7 @@ spread_dialog (gint32 image_ID,
GIMP_SIZE_ENTRY_UPDATE_SIZE, GIMP_SIZE_ENTRY_UPDATE_SIZE,
spvals.spread_amount_x == spvals.spread_amount_y, spvals.spread_amount_x == spvals.spread_amount_y,
FALSE, NULL, FALSE,
_("Horizontal:"), spvals.spread_amount_x, xres, _("Horizontal:"), spvals.spread_amount_x, xres,
0, MAX (drawable->width, drawable->height), 0, MAX (drawable->width, drawable->height),

View File

@ -415,7 +415,7 @@ tile_dialog (gint32 image_ID,
sizeentry = gimp_coordinates_new (unit, "%a", TRUE, TRUE, 75, sizeentry = gimp_coordinates_new (unit, "%a", TRUE, TRUE, 75,
GIMP_SIZE_ENTRY_UPDATE_SIZE, GIMP_SIZE_ENTRY_UPDATE_SIZE,
tvals.constrain, TRUE, &tint.chainbutton, tvals.constrain, TRUE,
_("Width:"), width, xres, _("Width:"), width, xres,
1, GIMP_MAX_IMAGE_SIZE, 1, GIMP_MAX_IMAGE_SIZE,
@ -430,6 +430,7 @@ tile_dialog (gint32 image_ID,
gtk_widget_show (sizeentry); gtk_widget_show (sizeentry);
tint.sizeentry = sizeentry; tint.sizeentry = sizeentry;
tint.chainbutton = GTK_WIDGET (GIMP_COORDINATES_CHAINBUTTON (sizeentry));
toggle = gtk_check_button_new_with_label (_("Create New Image")); toggle = gtk_check_button_new_with_label (_("Create New Image"));
gtk_table_attach (GTK_TABLE (sizeentry), toggle, 0, 4, 2, 3, gtk_table_attach (GTK_TABLE (sizeentry), toggle, 0, 4, 2, 3,

View File

@ -2864,7 +2864,7 @@ dlg_make_page_settings (GFlareDialog *dlg,
gimp_coordinates_new (gimp_image_get_unit (image_ID), "%a", gimp_coordinates_new (gimp_image_get_unit (image_ID), "%a",
TRUE, TRUE, 75, GIMP_SIZE_ENTRY_UPDATE_SIZE, TRUE, TRUE, 75, GIMP_SIZE_ENTRY_UPDATE_SIZE,
FALSE, FALSE, &chain, FALSE, FALSE,
_("X:"), pvals.xcenter, xres, _("X:"), pvals.xcenter, xres,
-GIMP_MAX_IMAGE_SIZE, GIMP_MAX_IMAGE_SIZE, -GIMP_MAX_IMAGE_SIZE, GIMP_MAX_IMAGE_SIZE,
@ -2873,6 +2873,9 @@ dlg_make_page_settings (GFlareDialog *dlg,
_("Y:"), pvals.ycenter, yres, _("Y:"), pvals.ycenter, yres,
-GIMP_MAX_IMAGE_SIZE, GIMP_MAX_IMAGE_SIZE, -GIMP_MAX_IMAGE_SIZE, GIMP_MAX_IMAGE_SIZE,
0, gimp_drawable_height (drawable->id)); 0, gimp_drawable_height (drawable->id));
chain = GTK_WIDGET (GIMP_COORDINATES_CHAINBUTTON (center));
gtk_container_set_border_width (GTK_CONTAINER (center), 4); gtk_container_set_border_width (GTK_CONTAINER (center), 4);
gtk_container_add (GTK_CONTAINER (frame), center); gtk_container_add (GTK_CONTAINER (frame), center);
gtk_signal_connect (GTK_OBJECT (center), "value_changed", gtk_signal_connect (GTK_OBJECT (center), "value_changed",
@ -4094,9 +4097,13 @@ ed_make_page_sflare (GFlareEditor *ed,
gtk_box_pack_start (GTK_BOX (seed_hbox), label, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (seed_hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label); gtk_widget_show (label);
seed = gimp_random_seed_new (&gflare->sflare_seed, &entry, seed = gimp_random_seed_new (&gflare->sflare_seed,
&gflare->sflare_seed_time, &toggle, &gflare->sflare_seed_time,
TRUE, FALSE); TRUE, FALSE);
entry = GTK_WIDGET (GIMP_RANDOM_SEED_SPINBUTTON (seed));
toggle = GTK_WIDGET (GIMP_RANDOM_SEED_TOGGLEBUTTON (seed));
gtk_box_pack_start (GTK_BOX (seed_hbox), seed, FALSE, TRUE, 0); gtk_box_pack_start (GTK_BOX (seed_hbox), seed, FALSE, TRUE, 0);
gtk_widget_show (seed); gtk_widget_show (seed);