Commit Graph

56 Commits

Author SHA1 Message Date
Niels De Graef e34c051d78 gimpintcombobox: Add (array length) annotation
So that bindings can properly use the array constructor
2020-12-25 15:04:21 +01:00
Jehan b326b68b32 libgimpwidgets: GtkComboBox "active" property must trigger…
… GimpIntComboBox "value" property.
For this, I connect to the "changed" signal, which is equivalent anyway.
Otherwise the link was not bidirectionnal, so selecting a new item in
the combo list was not actually changing the internal value, hence the
binding set by gimp_prop_int_combo_box_new() was not complete either.
Not sure how I missed that. Hopefully not missing anything else!
2020-09-29 17:02:21 +02:00
Jehan db71a8ffc7 libgimpwidgets: add a "value" property to GimpIntComboBox…
… and have gimp_prop_int_combo_box_new() bind to "value" instead of
"active".

The "active" property is defined by GtkComboBox and is the index of the
combo box, not its values, whereas with gimp_prop_int_combo_box_new(),
we want to bind an int property to the combobox value. Therefore the
commit 0828a371c2 was only properly working when we were creating a
combo box with values starting at 0 and incremented by 1.

By adding a "value" property to GimpIntComboBox, I allow binding any
property to the int value rather than the index.

See also !265 where the issue was raised as it affected our HEIF
plug-in.
2020-09-18 15:26:32 +02:00
Niels De Graef 842dc7535f gir: (skip) functions with varargs
Bindings can't handle these, so they are not introspectable.
2020-05-21 13:49:38 +02:00
Niels De Graef 4b6362c0bd gir: Mark more (out) annotations 2020-05-08 17:11:14 +02:00
Niels De Graef 7f58f2d6e5 gir: Add more missing (array) and (out) annotations 2020-05-04 21:29:42 +02:00
Michael Natterer e80c90e17d libgimpwidgets: change gimp_int_store_new()'s signature
to match gimp_int_combo_box_new(), and add gimp_int_store_new_valist().

Move the va_list of (name, value) parsing code to
gimp_int_store_new_valist() and use it from
gimp_int_combo_box_new_valist().

This makes the entire GimpIntStore/GimpIntComboBox stuff useable much
more generically for the price of an incompatible change of a public
function that is used exactly once outside of libgimpwidgets.
2019-09-24 00:20:47 +02:00
Michael Natterer 169f98f915 libgimpwidgets: add GDestroyNotify to gimp_int_combo_box_connect() 2019-08-08 00:22:15 +02:00
Niels De Graef 1dda60154c Use "Returns:" to annotate return values
To be able to annotate return values through GObject-introspection, you
need to make sure it is tagged with `Returns:` and not something else.
2019-08-03 07:53:47 +00:00
Michael Natterer 63695b4b21 libgimbase: merge gimpparam.h into gimpparamspecs.h
which means that it's now included normally via gimpbase.h
and not any longer via gimpbasetypes.h which we only did out
of lazyness. A *lot* of files in libgimp* and app/ now need to
2019-07-31 10:16:21 +02:00
Ell 846d242f30 app: revert combo-box drop-down changes
Revert the use of gtk_combo_box_set_wrap_width() to change the
combo-box drop-down style, except for the status-bar unit combo.
See https://gitlab.gnome.org/GNOME/gimp/issues/2828#note_421312 for
the rationale.

This reverts commits 1d984542e9,
68a33ab5bd, and
6dfca83c2a.
2019-03-27 20:14:10 -04:00
Jehan 1d984542e9 Issue #2828: Scrolling up with a mouse within a drop-down list.
We were doing it all the wrong way, fixing one combo box object at a
time. So this commit basically reverses commits 68a33ab5bd, 6dfca83c2a
and a9a979b2d0 and instead runs the same code in the class code. This
way, all objects based on these base classes will have the fix from
scratch.
These improved various other drop-down lists (I found some of them, and
probably not all) as I fixed all GIMP custom widgets based on
GtkComboBox.

Note that it has to be run after filling the list apparently (I had the
problem especially with GimpIntComboBox if running in the _init() code,
then the list widget showed wrong).
2019-01-20 13:08:36 +01:00
Ell 3b0040c043 app, libgimp*, modules: don't use g_type_class_add_private() ...
... and G_TYPE_INSTANCE_GET_PRIVATE()

g_type_class_add_private() and G_TYPE_INSTANCE_GET_PRIVATE() were
deprecated in GLib 2.58.  Instead, use
G_DEFINE_[ABSTRACT_]TYPE_WITH_PRIVATE(), and
G_ADD_PRIVATE[_DYNAMIC](), and the implictly-defined
foo_get_instance_private() functions, all of which are available in
the GLib versions we depend on.

This commit only covers types registered using one of the
G_DEFINE_FOO() macros (i.e., most types), but not types with a
custom registration function, of which we still have a few -- GLib
currently only provides a (non-deprecated) public API for adding a
private struct using the G_DEFINE_FOO() macros.

Note that this commit was 99% auto-generated (because I'm not
*that* crazy :), so if there are any style mismatches... we'll have
to live with them for now.
2018-09-18 14:39:56 -04:00
Michael Natterer af44a5161d libgimpwidgets: fix GimpIntComboBox popup-shown appearance
The old hack doesn't work any longer, there is only one cell layout in
GTK+ 3.x, not separate ones for the button and the popup. Switch back
to recreating the cells in notify::popup-shown.

Also simplify the code, we only need to remember one cell renderer in
our struct, and remove manual resizing code that was only needed in
older GTK+ 2.x vrsions.
2018-07-13 14:50:06 +02:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Michael Natterer f4f106ad26 libimp*: add private pointers to all instance structs
even if we don't have private members (yet). Also make class padding 8
pointers in all headers. This commit moves nothing to private, it just
makes all headers consistent and adjusts .c files accordigly.
2018-05-20 21:06:33 +02:00
Michael Natterer 7efaf024f3 libgimpwidgets: create GimpIntComboBox' cells in constructed() not init()
Apparently this now has to happen later due to some GTK+ change.
2018-05-20 21:06:30 +02:00
Ell 0830fe8923 libgimpwidgets, app: make ABBREVIATED default GimpIntComboBox layout
There's no real reason not to do it (has no visible effect if the
model has no abbreviations to begin with), and it means less
special casing.
2017-12-01 09:22:42 -05:00
Ell 8e51e7c351 libgimpwidgets: fix return type of gimp_int_combo_box_get_layout()
... and a small cleanup.
2017-12-01 05:12:42 -05:00
Ell 47ac6111de libgimpwidgets: add "layout" property to GimpIntComboBox
The "layout" proerty controls the combo-box layout (but not its
menu layout), and can be one of:

  - ICON_ONLY:  Only show icons.

  - ABBREVIATED:  Show icons and abbreviated labels (or full
    labels, when there is no abbreviation).

  - FULL:  Show icons and full labels.  Default.

Avoid reconstructing the combo's cell-layout when the menu is
shown/hidden, by maintaining the combo's cell-layout and the menu's
cell-layout separately (probably a terrible hack, but one we already
use :P).
2017-11-30 03:10:14 -05:00
Michael Natterer 582c6edd54 libgimp*: use some g_clear_object() and g_clear_pointer() 2017-09-03 15:14:51 +02:00
Michael Natterer f9ee38ea33 libgimp: add blurbs to all object properties for the docs
and some minor doc fixes.
2017-06-06 21:19:17 +02:00
Jehan 1f4839288e Bug 648776 - fixes symmetry painting after Massimo and Mitch's reviews.
Use a GType for the PROP_SYMMETRY property of GimpImage, and create
a default "identity" symmetry for an image.
I still use a GimpIntComboBox but store the property value in the
user-data column because gpointer isn't a subset of gint.
Adds in libgimpwidgets:
- gimp_int_combo_box_set_active_by_user_data()
- gimp_int_combo_box_get_active_user_data()
- gimp_int_store_lookup_by_user_data()
- gimp_prop_pointer_combo_box_new() to create a GimpIntComboBox and
  attach it to a gpointer property.
Thanks Massimo and Mitch for reviewing my code.
2016-02-02 21:15:13 +01:00
Michael Natterer 8005eea835 Remove the "GIMP" from all "Since: GIMP 2.x" API doc comments
because it confuses gtk-doc and breaks some links. Also change the
"Index of new symbols in GIMP 2.x" sections to be what seems to be the
modern standard (looked at the GLib and GTK+ docs), and update some
other stuff.
2015-05-31 21:18:09 +02:00
Michael Natterer 63c5508d4d libgimpwidgets: use the renderer's icon-name in GimpIntComboBox 2014-05-09 02:04:25 +02:00
Nils Philippsen 755861cc65 libgimpwidgets: fix typo 2013-06-04 10:41:10 +02:00
Michael Natterer 8a2474a371 libgimpwidgets: never ellipsize anything in the combo box' popup
The popup can be wider than the widget, so show the full strings.
2013-06-03 21:33:21 +02:00
Michael Natterer 34ee988a93 libgimpwidgets: only ellipsize GimpIntComboBox's text if requested 2013-06-03 16:57:42 +02:00
Michael Natterer 418a310f36 libgimpwidgets: add a "label" property and API to GimpIntComboBox
If set, the label is displayed left-aligned inside the combo box, and
the normal content moves to the right. Reconfigure the combo's
contents when the popup is shown/hidden, so the popup widget is not
affected by the label. This requires an evil hack because of a bug in
GtkCellView. The hack automatically disables itself once GTK+ 2.24.19
(which has a fix) is used.
2013-06-03 16:36:25 +02:00
Ville Skyttä 6b0d1038cc Bug 692641 - Various spelling fixes 2013-01-27 18:59:02 +01:00
Mukund Sivaraman 324ad1e426 libgimpwidgets: Drop redundant assignment 2011-10-12 17:21:23 +05:30
Massimo Valentini c39ca0f74f Initialize two GtkTreeIter
to avoid harmless, but annoying, valgrind warnings on x86_64
2011-06-17 19:02:08 +02:00
Michael Natterer 1f7ff98c45 libgimpwidgets: move docs from template files to inline comments
but leave the template file for gimpstock there because its contents
would be too much for gimpstock.h.
2010-07-05 18:01:28 +02:00
Sven Neumann a6d8c7c5c4 Revert "Make some GimpCoords* params const"
This reverts commit 063a6f03aa.
2009-05-18 00:01:34 +02:00
Michael Natterer 063a6f03aa Make some GimpCoords* params const
Add const to GimpCoords* params in GimpBrush::select_brush() and
want_null_motio().
2009-05-17 23:14:19 +02:00
Michael Natterer d9b5207aa2 Change licence to GPLv3 (and to LGPLv3 for libgimp).
2009-01-17  Michael Natterer  <mitch@gimp.org>

	* all files with a GPL header and all COPYING files:

	Change licence to GPLv3 (and to LGPLv3 for libgimp).

	Cleaned up some copyright headers and regenerated the parsers in
	the ImageMap plugin.


svn path=/trunk/; revision=27913
2009-01-17 22:28:01 +00:00
Sven Neumann 19f72e4471 use the canonical spelling for the 'stock-id' property.
2008-12-28  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpintcombobox.c (gimp_int_combo_box_init): 
use
	the canonical spelling for the 'stock-id' property.


svn path=/trunk/; revision=27839
2008-12-28 00:08:20 +00:00
Sven Neumann 6ebcf700d1 removed erroneous semicolon after G_DEFINE_TYPE macros.
2006-05-15  Sven Neumann  <sven@gimp.org>

	* app/*/*.c:
	* lib*/*.c: removed erroneous semicolon after G_DEFINE_TYPE macros.
2006-05-15 09:46:31 +00:00
Sven Neumann f2df31a50e converted tabs to spaces.
2006-04-12  Sven Neumann  <sven@gimp.org>

	* libgimp*/gimp*.[ch]: converted tabs to spaces.
2006-04-12 10:53:28 +00:00
Sven Neumann 7b24dd8e36 moved GIMP_PARAM defines from here ...
2006-01-30  Sven Neumann  <sven@gimp.org>

	* app/config/config-types.h: moved GIMP_PARAM defines from here ...

	* libgimpbase/gimpparam.h: ... to this new files.

	* libgimpbase/Makefile.am
	* libgimpbase/gimpbasetypes.h: include the new header file.

	* libgimp/gimpfontselectbutton.c
	* libgimpconfig/gimpcolorconfig.c
	* libgimpthumb/gimpthumbnail.c
	* libgimpwidgets/gimpcellrenderercolor.c
	* libgimpwidgets/gimpcellrenderertoggle.c
	* libgimpwidgets/gimpcolorarea.c
	* libgimpwidgets/gimpcolorbutton.c
	* libgimpwidgets/gimpcolordisplay.c
	* libgimpwidgets/gimpcontroller.c
	* libgimpwidgets/gimpdialog.c
	* libgimpwidgets/gimpenumcombobox.c
	* libgimpwidgets/gimpintcombobox.c
	* libgimpwidgets/gimppageselector.c
	* libgimpwidgets/gimppreview.c
	* libgimpwidgets/gimppreviewarea.c
	* libgimpwidgets/gimpzoommodel.c
	* modules/cdisplay_colorblind.c
	* modules/cdisplay_gamma.c
	* modules/cdisplay_highcontrast.c
	* modules/cdisplay_lcms.c
	* modules/cdisplay_proof.c
	* modules/controller_linux_input.c
	* modules/controller_midi.c: use the GIMP_PARAM defines to avoid
	unnecessary string allocations.
2006-01-30 16:10:56 +00:00
Sven Neumann b614bf5e85 libgimpwidgets/gimpintcombobox.[ch] libgimpwidgets/gimppageselector.[ch]
2006-01-25  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpintcombobox.[ch]
	* libgimpwidgets/gimppageselector.[ch]
	* libgimpwidgets/gimpzoommodel.[ch]: added a priv pointer to the
	instance struct and changed the GET_PRIVATE() macro to access the
	private data via that pointer.

	* libgimpwidgets/gimpscrolledpreview.[ch]
	* libgimpwidgets/gimpwidgets.def: added a priv pointer to the
	instance struct and moved all private data to the
	GimpScrolledPreviewPrivate struct. Added freeze/thaw methods so
	that derived widgets can be implemented without accessing private
	data.

	* libgimp/gimpzoompreview.c: changed accordingly.

	* libgimp/gimpfontselectbutton.[ch]: let the priv pointer be an
	anonymous void pointer.
2006-01-25 14:35:56 +00:00
Michael Natterer 33ae55f873 libgimp/*.c libgimpconfig/*.c libgimpmodule/*.c libgimpthumb/*.c port to
2005-12-20  Michael Natterer  <mitch@gimp.org>

	* libgimp/*.c
	* libgimpconfig/*.c
	* libgimpmodule/*.c
	* libgimpthumb/*.c
	* libgimpwidgets/*.c: port to G_DEFINE_TYPE() and friends. Some
	related cleanup.
2005-12-20 20:35:23 +00:00
Sven Neumann 66217ce840 document how to construct an empty GimpIntComboBox using g_object_new().
2005-09-27  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpintcombobox.c: document how to construct an
	empty GimpIntComboBox using g_object_new().

	* plug-ins/common/aa.c
	* plug-ins/common/channel_mixer.c
	* plug-ins/common/compose.c
	* plug-ins/common/decompose.c
	* plug-ins/common/newsprint.c
	* plug-ins/common/spheredesigner.c
	* plug-ins/gflare/gflare.c
	* plug-ins/pagecurl/pagecurl.c: use g_object_new() to construct an
	empty GimpIntComboBox. The old way of doing it caused warnings.
2005-09-27 20:51:29 +00:00
Sven Neumann 8911164564 no need to create a new list store; gimp_int_combo_box_init() already did
2005-06-23  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpintcombobox.c (gimp_int_combo_box_new_valist)
	(gimp_int_combo_box_new_array): no need to create a new list store;
	gimp_int_combo_box_init() already did that for us.
2005-06-23 18:02:21 +00:00
Sven Neumann 49005d9bfd removed gimp_enum_combo_box_set_visible().
2005-03-01  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpenumcombobox.[ch]: removed
	gimp_enum_combo_box_set_visible().

	* libgimpwidgets/gimpintcombobox.[ch]: added
	gimp_int_combo_box_set_sensitivity() instead.

	* app/tools/gimpcurvestool.c
	* app/tools/gimplevelstool.c
	* app/widgets/gimphistogrameditor.c: changed accordingly.

	* libgimpwidgets/gimpenumstore.h: added padding for future expansion.

	* libgimpwidgets/gimpwidgets.def: updated.
2005-02-28 23:27:12 +00:00
Sven Neumann b42df335e2 moved a few lines of code around 2005-02-27 20:18:45 +00:00
Sven Neumann de69e05da3 added an "ellipsize" construct property and changed the default behaviour
2005-02-27  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpintcombobox.c: added an "ellipsize" construct
	property and changed the default behaviour back to not doing
	ellipsation on the text.

	* libgimp/gimpimagecombobox.c
	* libgimp/gimpdrawablecombobox.c: set "ellipsize" to middle for
	drawable and image combo boxes.
2005-02-27 19:41:42 +00:00
Sven Neumann d0e6a44640 app/widgets/gimpcontainercombobox.c set the "ellipsize" property on the
2005-02-17  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpcontainercombobox.c
	* libgimpwidgets/gimpintcombobox.c: set the "ellipsize" property
	on the text cell-renderer. Not sure if it's a good idea to
	hardcode this for GimpIntComboBox, but let's give it a try. Fixes
	bug #136676.
2005-02-16 23:55:53 +00:00
Sven Neumann 53b00093cb removed the check for first_label != NULL. Passing a NULL label makes a
2004-04-22  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpintcombobox.c (gimp_int_combo_box_new):
	removed the check for first_label != NULL. Passing a NULL label
	makes a perfect empty combo_box.

	* plug-ins/common/newsprint.c
	* plug-ins/common/spheredesigner.c: ported from GtkOptioMenu to
	GimpIntComboBox.
2004-04-22 01:27:30 +00:00
Sven Neumann 36dc39becb libgimp/gimpdrawablecombobox.c libgimp/gimpimagecombobox.c changed the
2004-04-21  Sven Neumann  <sven@gimp.org>

	* libgimp/gimpdrawablecombobox.c
	* libgimp/gimpimagecombobox.c
	* libgimp/gimpmenu.c: changed the label for the empty menu from
	"None" to "Empty" since that's what GTK+ uses.

	* libgimpwidgets/gimpintcombobox.[ch]: added convenience function
	gimp_int_combo_box_connect().

	* plug-ins/common/bumpmap.c
	* plug-ins/common/compose.c
	* plug-ins/common/depthmerge.c
	* plug-ins/common/displace.c
	* plug-ins/common/lic.c
	* plug-ins/common/warp.c: ported to GimpDrawableComboBox.

	* plug-ins/Lighting/lighting_ui.c
	* plug-ins/MapObject/mapobject_ui.c
	* plug-ins/common/sample_colorize.c: use
	gimp_int_combo_box_connect(). This restores the correct behaviour
	of setting the drawable_ID to the first drawable from the list if
	it's invalid.
2004-04-21 16:50:13 +00:00