2005-02-05 04:51:19 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
2002-11-21 03:45:03 +08:00
|
|
|
*
|
2002-11-23 05:08:04 +08:00
|
|
|
* gimppropwidgets.h
|
|
|
|
* Copyright (C) 2002 Michael Natterer <mitch@gimp.org>
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This library is free software: you can redistribute it and/or
|
2005-02-05 04:51:19 +08:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
2009-01-18 06:28:01 +08:00
|
|
|
* version 3 of the License, or (at your option) any later version.
|
2002-11-21 03:45:03 +08:00
|
|
|
*
|
2005-02-05 04:51:19 +08:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
2002-11-21 03:45:03 +08:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2005-02-05 04:51:19 +08:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2002-11-21 03:45:03 +08:00
|
|
|
*
|
2005-02-05 04:51:19 +08:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2009-01-18 06:28:01 +08:00
|
|
|
* License along with this library. If not, see
|
2018-07-12 05:27:07 +08:00
|
|
|
* <https://www.gnu.org/licenses/>.
|
2002-11-21 03:45:03 +08:00
|
|
|
*/
|
|
|
|
|
2011-04-28 20:30:41 +08:00
|
|
|
#if !defined (__GIMP_WIDGETS_H_INSIDE__) && !defined (GIMP_WIDGETS_COMPILATION)
|
|
|
|
#error "Only <libgimpwidgets/gimpwidgets.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
2023-08-18 05:02:38 +08:00
|
|
|
#ifndef __GIMPWIDGETS_PROP_WIDGETS_H__
|
|
|
|
#define __GIMPWIDGETS_PROP_WIDGETS_H__
|
2002-11-21 03:45:03 +08:00
|
|
|
|
2007-08-12 05:52:48 +08:00
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
|
2002-11-23 05:08:04 +08:00
|
|
|
/* GParamBoolean */
|
|
|
|
|
2005-02-05 19:51:48 +08:00
|
|
|
GtkWidget * gimp_prop_check_button_new (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
const gchar *label);
|
2020-05-30 21:20:06 +08:00
|
|
|
GtkWidget * gimp_prop_switch_new (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
const gchar *label,
|
|
|
|
GtkWidget **label_out,
|
|
|
|
GtkWidget **switch_out);
|
2005-02-05 19:51:48 +08:00
|
|
|
GtkWidget * gimp_prop_boolean_combo_box_new (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
const gchar *true_text,
|
|
|
|
const gchar *false_text);
|
|
|
|
GtkWidget * gimp_prop_boolean_radio_frame_new (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
const gchar *title,
|
|
|
|
const gchar *true_text,
|
|
|
|
const gchar *false_text);
|
|
|
|
|
|
|
|
GtkWidget * gimp_prop_expander_new (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
const gchar *label);
|
2005-01-23 04:32:34 +08:00
|
|
|
|
2002-11-23 05:08:04 +08:00
|
|
|
|
2004-12-08 20:46:21 +08:00
|
|
|
/* GParamInt */
|
|
|
|
|
2005-02-05 19:51:48 +08:00
|
|
|
GtkWidget * gimp_prop_int_combo_box_new (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
GimpIntStore *store);
|
2019-10-03 21:59:09 +08:00
|
|
|
GtkWidget * gimp_prop_int_radio_frame_new (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
const gchar *title,
|
|
|
|
GimpIntStore *store);
|
2004-12-08 20:46:21 +08:00
|
|
|
|
2016-01-22 04:43:15 +08:00
|
|
|
/* GParamGType */
|
|
|
|
|
|
|
|
GtkWidget * gimp_prop_pointer_combo_box_new (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
GimpIntStore *store);
|
2004-12-08 20:46:21 +08:00
|
|
|
|
2002-11-23 05:08:04 +08:00
|
|
|
/* GParamEnum */
|
|
|
|
|
2005-02-05 19:51:48 +08:00
|
|
|
GtkWidget * gimp_prop_enum_combo_box_new (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
gint minimum,
|
|
|
|
gint maximum);
|
|
|
|
|
|
|
|
GtkWidget * gimp_prop_enum_check_button_new (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
const gchar *label,
|
|
|
|
gint false_value,
|
|
|
|
gint true_value);
|
|
|
|
|
|
|
|
GtkWidget * gimp_prop_enum_radio_frame_new (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
const gchar *title,
|
|
|
|
gint minimum,
|
|
|
|
gint maximum);
|
|
|
|
GtkWidget * gimp_prop_enum_radio_box_new (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
gint minimum,
|
|
|
|
gint maximum);
|
2014-05-08 03:27:57 +08:00
|
|
|
|
|
|
|
GtkWidget * gimp_prop_enum_icon_box_new (GObject *config,
|
2005-02-05 19:51:48 +08:00
|
|
|
const gchar *property_name,
|
2017-06-04 03:22:12 +08:00
|
|
|
const gchar *icon_prefix,
|
2005-02-05 19:51:48 +08:00
|
|
|
gint minimum,
|
|
|
|
gint maximum);
|
2003-02-05 21:03:44 +08:00
|
|
|
|
2005-06-25 06:46:42 +08:00
|
|
|
GtkWidget * gimp_prop_enum_label_new (GObject *config,
|
|
|
|
const gchar *property_name);
|
|
|
|
|
2002-11-23 05:08:04 +08:00
|
|
|
|
|
|
|
/* GParamInt, GParamUInt, GParamLong, GParamULong, GParamDouble */
|
|
|
|
|
2005-02-05 19:51:48 +08:00
|
|
|
GtkWidget * gimp_prop_spin_button_new (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
gdouble step_increment,
|
|
|
|
gdouble page_increment,
|
|
|
|
gint digits);
|
|
|
|
|
2020-11-05 08:13:49 +08:00
|
|
|
GtkWidget * gimp_prop_label_spin_new (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
gint digits);
|
|
|
|
|
2022-02-19 05:49:45 +08:00
|
|
|
GtkWidget * gimp_prop_spin_scale_new (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
gdouble step_increment,
|
|
|
|
gdouble page_increment,
|
|
|
|
gint digits);
|
|
|
|
|
|
|
|
void gimp_prop_widget_set_factor (GtkWidget *widget,
|
|
|
|
gdouble factor,
|
|
|
|
gdouble step_increment,
|
|
|
|
gdouble page_increment,
|
|
|
|
gint digits);
|
2020-11-05 08:13:49 +08:00
|
|
|
|
2005-08-06 21:03:59 +08:00
|
|
|
GtkWidget * gimp_prop_hscale_new (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
gdouble step_increment,
|
|
|
|
gdouble page_increment,
|
|
|
|
gint digits);
|
|
|
|
|
libgimpwidgets: make GimpScaleEntry into its own widget.
Instead of the gimp_scale_entry_new() which creates several bound yet
independant widgets, and in the same time pack them into an existing
grid and return a GtkAdjustment (while heavily relying on GObject data
to link widgets), let's have a proper custom widget with its own clean
API.
This also simplifies the gimp_prop_scale_entry_new() property widget
variant.
First advantage is that we don't force the usage of a grid to use this
widget (there are a few pieces of code which create a GtkGrid with only
this inside just to be able to use this feature).
Second thing is that I am creating a much simpler API.
gimp_scale_entry_new() had 17 parameters! How crazy is that? So I
removed all the grid packing related parameters. Also I moved the spin
button/scale unconstraining parameters into their separate function,
because the constrained behavior is the most common use case, so it's
stupid to add 3 permanent dummy parameters for most calls. Instead the
few times where we'll want different ranges for the spin button and the
scale, we'll call the separate API gimp_scale_entry_set_range().
Thirdly the tooltip can be set directly with gimp_help_set_help_data()
since this is now its own widget. No need to have dedicated logics
anymore, better stay generic. Similarly no need of a custom function to
switch sensitivitivy (instead of generic gtk_widget_set_sensitive()).
Fourth thing is that we should not use macros for the public API, but
proper functions, because macros are not properly introspected for
binding.
For future improvements, maybe we could even make this widget implement
GtkOrientable interface, in order to be able to use it vertically.
Note: right now, I created a separate gimp_scale_entry_new2() and only
modified the property widget API to use this new code. Eventually I will
remove fully the old gimp_scale_entry_new() function (and the new code
will replace it).
2020-10-30 07:30:03 +08:00
|
|
|
GtkWidget * gimp_prop_scale_entry_new (GObject *config,
|
2005-02-05 19:51:48 +08:00
|
|
|
const gchar *property_name,
|
|
|
|
const gchar *label,
|
2020-11-25 09:19:39 +08:00
|
|
|
gdouble factor,
|
2006-04-22 10:58:02 +08:00
|
|
|
gboolean limit_scale,
|
|
|
|
gdouble lower_limit,
|
|
|
|
gdouble upper_limit);
|
2003-02-08 01:12:21 +08:00
|
|
|
|
2002-11-23 05:08:04 +08:00
|
|
|
|
|
|
|
/* GimpParamMemsize */
|
|
|
|
|
2005-02-05 19:51:48 +08:00
|
|
|
GtkWidget * gimp_prop_memsize_entry_new (GObject *config,
|
|
|
|
const gchar *property_name);
|
2002-11-23 05:08:04 +08:00
|
|
|
|
|
|
|
|
|
|
|
/* GParamString */
|
|
|
|
|
2005-02-05 19:51:48 +08:00
|
|
|
GtkWidget * gimp_prop_label_new (GObject *config,
|
|
|
|
const gchar *property_name);
|
|
|
|
GtkWidget * gimp_prop_entry_new (GObject *config,
|
2022-02-17 04:30:33 +08:00
|
|
|
const gchar *property_name,
|
|
|
|
gint max_len);
|
|
|
|
GtkWidget * gimp_prop_label_entry_new (GObject *config,
|
2005-02-05 19:51:48 +08:00
|
|
|
const gchar *property_name,
|
|
|
|
gint max_len);
|
|
|
|
GtkTextBuffer * gimp_prop_text_buffer_new (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
gint max_len);
|
2007-02-12 23:29:45 +08:00
|
|
|
GtkWidget * gimp_prop_string_combo_box_new (GObject *config,
|
|
|
|
const gchar *property_name,
|
2007-03-08 18:06:31 +08:00
|
|
|
GtkTreeModel *model,
|
2007-02-12 23:29:45 +08:00
|
|
|
gint id_column,
|
|
|
|
gint label_column);
|
2023-08-03 05:55:33 +08:00
|
|
|
GtkWidget * gimp_prop_choice_combo_box_new (GObject *config,
|
|
|
|
const gchar *property_name);
|
2024-06-07 02:16:58 +08:00
|
|
|
GtkWidget * gimp_prop_choice_radio_frame_new (GObject *config,
|
|
|
|
const gchar *property_name);
|
2002-11-23 05:08:04 +08:00
|
|
|
|
|
|
|
|
|
|
|
/* GimpParamPath */
|
|
|
|
|
2005-03-25 08:37:16 +08:00
|
|
|
GtkWidget * gimp_prop_file_chooser_button_new (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
const gchar *title,
|
|
|
|
GtkFileChooserAction action);
|
2006-12-18 15:28:41 +08:00
|
|
|
GtkWidget * gimp_prop_file_chooser_button_new_with_dialog (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
|
|
|
|
GtkWidget *dialog);
|
2006-06-09 15:12:33 +08:00
|
|
|
GtkWidget * gimp_prop_path_editor_new (GObject *config,
|
|
|
|
const gchar *path_property_name,
|
|
|
|
const gchar *writable_property_name,
|
2019-08-09 18:32:09 +08:00
|
|
|
const gchar *filechooser_title);
|
2005-03-25 08:37:16 +08:00
|
|
|
|
2002-11-23 05:08:04 +08:00
|
|
|
|
2003-10-24 00:58:16 +08:00
|
|
|
/* GParamInt, GParamUInt, GParamDouble unit: GimpParamUnit */
|
2003-10-02 03:55:13 +08:00
|
|
|
|
2005-02-05 19:51:48 +08:00
|
|
|
GtkWidget * gimp_prop_size_entry_new (GObject *config,
|
|
|
|
const gchar *property_name,
|
2007-10-15 02:51:58 +08:00
|
|
|
gboolean property_is_pixel,
|
2005-02-05 19:51:48 +08:00
|
|
|
const gchar *unit_property_name,
|
|
|
|
const gchar *unit_format,
|
2003-10-02 03:55:13 +08:00
|
|
|
GimpSizeEntryUpdatePolicy update_policy,
|
2005-02-05 19:51:48 +08:00
|
|
|
gdouble resolution);
|
2003-10-02 03:55:13 +08:00
|
|
|
|
|
|
|
|
2002-11-23 05:08:04 +08:00
|
|
|
/* x,y: GParamInt, GParamDouble unit: GimpParamUnit */
|
|
|
|
|
2005-02-05 19:51:48 +08:00
|
|
|
GtkWidget * gimp_prop_coordinates_new (GObject *config,
|
|
|
|
const gchar *x_property_name,
|
|
|
|
const gchar *y_property_name,
|
|
|
|
const gchar *unit_property_name,
|
|
|
|
const gchar *unit_format,
|
2002-11-21 03:45:03 +08:00
|
|
|
GimpSizeEntryUpdatePolicy update_policy,
|
2005-02-05 19:51:48 +08:00
|
|
|
gdouble xresolution,
|
|
|
|
gdouble yresolution,
|
|
|
|
gboolean has_chainbutton);
|
|
|
|
gboolean gimp_prop_coordinates_connect (GObject *config,
|
|
|
|
const gchar *x_property_name,
|
|
|
|
const gchar *y_property_name,
|
|
|
|
const gchar *unit_property_name,
|
|
|
|
GtkWidget *sizeentry,
|
|
|
|
GtkWidget *chainbutton,
|
|
|
|
gdouble xresolution,
|
|
|
|
gdouble yresolution);
|
2002-11-21 03:45:03 +08:00
|
|
|
|
|
|
|
|
2002-11-24 06:22:21 +08:00
|
|
|
/* GimpParamColor */
|
|
|
|
|
2005-02-05 19:51:48 +08:00
|
|
|
GtkWidget * gimp_prop_color_area_new (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
2003-07-07 21:37:19 +08:00
|
|
|
GimpColorAreaType type);
|
2002-11-24 06:22:21 +08:00
|
|
|
|
2021-04-20 22:40:18 +08:00
|
|
|
GtkWidget * gimp_prop_color_select_new (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
GimpColorAreaType type);
|
|
|
|
|
2022-02-18 01:45:12 +08:00
|
|
|
GtkWidget * gimp_prop_label_color_new (GObject *config,
|
2022-02-18 04:29:13 +08:00
|
|
|
const gchar *property_name,
|
|
|
|
gboolean editable);
|
2022-02-18 01:45:12 +08:00
|
|
|
|
|
|
|
|
2003-02-04 07:54:19 +08:00
|
|
|
/* GimpParamUnit */
|
|
|
|
|
2010-10-15 05:03:34 +08:00
|
|
|
GtkWidget * gimp_prop_unit_combo_box_new (GObject *config,
|
|
|
|
const gchar *property_name);
|
2003-02-04 07:54:19 +08:00
|
|
|
|
|
|
|
|
2014-05-09 06:55:02 +08:00
|
|
|
/* GParamString (icon name) */
|
2003-07-07 21:37:19 +08:00
|
|
|
|
2014-05-09 06:55:02 +08:00
|
|
|
GtkWidget * gimp_prop_icon_image_new (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
GtkIconSize icon_size);
|
2003-07-07 21:37:19 +08:00
|
|
|
|
|
|
|
|
2007-08-12 05:52:48 +08:00
|
|
|
G_END_DECLS
|
|
|
|
|
2023-08-18 05:02:38 +08:00
|
|
|
#endif /* __GIMPWIDGETS_PROP_WIDGETS_H__ */
|