Commit Graph

175 Commits

Author SHA1 Message Date
Jehan ec9dbd8115 libgimpwidgets, app, plug-ins: fix last GIR warnings.
gimp_int_radio_group_new() was still complaining about the scope of
radio_button_callback(). Make it (scope notified) because it needs to
stay alive after the function returns and may be called multiple times.

Also adding a GDestroyNotify to free the callback data once the widget
is destroyed (additionally it will also serve as a notifier for bindings
to properly free the callback closure itself, not only it's data).

With this last one done, GObject Introspection generation now happens
without any warning output.
2020-01-15 14:00:19 +01:00
Michael Natterer 05896b4e2f libgimpbase: rename and reorder the values of enum GimpSelectCriterion 2019-11-19 22:25:57 +01:00
Michael Natterer d02d97e310 libgimpwidgets: add gimp_prop_int_radio_frame,box_new() 2019-10-03 15:59:09 +02:00
Michael Natterer 9593121431 app, libgimpwidgets: return visible widgets from all gimp_prop_foo_new()
and remove a gazillion gtk_widget_show() all over the place, some
places need a gtk_widget_hide() now, and I'm pretty sure I broke at
least one thing in all those files...
2019-09-25 20:24:06 +02:00
Michael Natterer 8cfef5e60d libgimpwidgets: more docs and annotations 2019-08-09 12:32:09 +02:00
Michael Natterer 67455a4ea7 libgimpwidgets: add GDestroyNotify to all enum widgets callback_data 2019-08-08 00:01:10 +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
Niels De Graef 746a72b956 Make sure to use % for constants
Documentation-wise in C, this doesn't matter a lot, but it allows
GObject-Introspection based bindings to use their built-in versions when
they want to render any kind of documentation (for example, docs for
Python plugins can render `%NULL` as `None`).
2019-08-03 07:53:47 +00:00
Jehan ea53089545 libgimpwidgets: add a bunch of missing (transfer) annotations. 2019-08-01 13:10:39 +02:00
Jehan 3016dfb347 libgimpwidgets: add many missing (transfer) annotations. 2019-08-01 02:04:28 +02:00
Ell 8954d1f386 libgimpwidgets, app, plug-ins: use GimpSpinButton everywhere
Replace all direct uses of GtkSpinButton with GimpSpinButton, so
that its modified behavior extends to all our spin buttons.
2019-03-09 07:28:52 -05:00
Jehan cd924f453a app: do not make line art bucket fill a GimpSelectCriterion anymore.
This was my initial choice, but the more I think about it, the less I am
sure this was the right choice. There was some common code (as I was
making a common composite bucket fill once the line art was generated),
but there is also a lot of different code and the functions were filled
of exception when we were doing a line art fill. Also though there is a
bit of color works (the way we decide whether a pixel is part of a
stroke or not, though currently this is basic grayscale threshold), this
is really not the same as other criterions. In particular this was made
obvious on the Select by Color tool where the line art criterion was
completely meaningless and would have had to be opted-out!

This commit split a bit the code. Instead of finding the line art in the
criterion list, I add a third choice to the "Fill whole selection"/"Fill
similar colors" radio. In turn I create a new GimpBucketFillArea type
with the 3 choices, and remove line art value from GimpSelectCriterion.

I am not fully happy yet of this code, as it creates a bit of duplicate
code, and I would appreciate to move some code away from gimpdrawable-*
and gimppickable-* files. This may happen later. I break the work in
pieces to not get too messy.
Also this removes access to the smart colorization from the API, but
that's probably ok as I prefer to not freeze options too early in the
process since API needs to be stable. Probably we should get a concept
of experimental API.
2018-12-12 15:27:48 +01:00
Jehan 8ed12b1b98 app, libgimpbase: add GIMP_SELECT_CRITERION_LINE_ART selection type.
This commit implements part of the research paper "A Fast and Efficient
Semi-guided Algorithm for Flat Coloring Line-arts" from the GREYC (the
people from G'Mic). It is meant to select regions from drawn sketchs in
a "smart" way, in particular it tries to close non-perfectly closed
regions, which is a common headache for digital painters and colorists.

The implementation is not finished as it needs some watersheding as well
so that the selected area does not leave "holes" near stroke borders.
The research paper proposes a new watersheding algorithm, but I may not
have to implement it, as it is more focused on automatic colorization
with prepared spots (instead of bucket fill-type interaction).

This will be used in particular with the fuzzy select and bucket fill
tools.

Note that this first version is a bit slow once we get to big images,
but I hope to be able to optimize this.
Also no options from the algorithm are made available in the GUI yet.
2018-11-14 13:37:42 +01: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 80997a8646 Remove most GTK_ADJUSTMENT() and (GtkAdjutment *) casts
they are obsolete in GTK+ 3.x because GtkAdjustment cannot be passed
around as GtkObject any longer, GtkObject is gone.
2018-06-24 18:15:16 +02:00
Michael Natterer d57ab7faf2 libgimpwidgets: move all GimpSizeEntry members to private 2018-05-25 19:15:00 +02:00
Michael Natterer 0b7aad66ed libgimpwidgets: left-align gimp_prop_enum_label_new()
just like gimp_prop_label_new().
2018-05-20 21:06:35 +02:00
Simon Budig 7d64cf62c6 libgimpwidgets: rename the _grid()-Variants of gimp_scale_entry_*
Adjust all plugins to follow accordingly.

This concludes the GtkTable'ocide.
2018-05-20 21:06:35 +02:00
Simon Budig 9cb67fa992 app: kill the last GtkTables. 2018-05-20 21:06:33 +02:00
Simon Budig 9954030487 app/widgets: port the gimpstrokeeditor to GtkGrid 2018-05-20 21:06:33 +02:00
Simon Budig 72e63887ba libgimpwidgets: convert GimpSizeEntry to a GtkGrid. 2018-05-20 21:06:32 +02:00
Michael Natterer 1f0d296eb6 libgimpwidgets: remove most deprecated cruft 2018-05-20 21:06:29 +02:00
Michael Natterer d9171ef627 libgimpwidgets: move all GimpMemsizeEntry members to a private struct 2018-05-20 21:06:28 +02:00
Michael Natterer 4ae7d4c825 libgimpwidgets: remove deprecated files completely 2018-05-20 21:06:26 +02:00
Michael Natterer e4ae1faf06 libgimpwidgets: remove deprecated functions and s/GtkObject/GtkAdjustment/ 2018-05-20 21:06:26 +02:00
luz.paz 147c09f19e Bug 795161 - Misc. typo fixes in source comments and doxygen
Found via `codespell`
Follow-up to  commit 7fdb963e01
2018-04-18 21:06:57 +02:00
Michael Natterer cc97a87257 libgimpwidgets: propwidgets: don't g_object_set() the same value again
Normally, the model would try to avoid notifications when a set()
doesn't change anything, but with g_object_set() that's not possible.

Do the same in the propwidgets' callbacks and avoid potentially
expensive notifications at the cost of a cheap g_object_get().

Also fix the syntax of "Since:" and "Deprecated:" annotations.
2018-02-04 19:56:55 +01:00
Michael Natterer caef6d0deb libgimp*: various doc fixes 2017-06-03 21:22:12 +02:00
Michael Natterer c61500066c libgimpwidgets: a bit of s/GtkObject/GtkAdjustment/
only the GtkObjects in the public API left now, can't change these until 3.x
2017-05-22 22:39:28 +02:00
Michael Natterer 89641ec5ea libgimpwidgets: gimp_prop_enum_combo_box_new(): reorder GimpSelectCriterion
so Alpha is not between the HSV and LCH group; put it after R, G, B.
2017-05-10 11:48:31 +02:00
Michael Natterer db4e120b8b libgimpwidgets: fix code duplication in gimp_prop_enum_combo_box_new() 2017-05-09 19:07:39 +02:00
Michael Natterer ecb346a945 libgimpwidgets: gimp_prop_boolean_combo_box_new(): use a GimpIntComboBox
so we can set its "ellipsize" property. Except that this doesn't seem
to work, no idea why.
2017-05-01 00:41:28 +02:00
Jehan f861585051 libgimpwidgets: entry width of gimp_prop_size_entry_new() is too small.
One cannot just use the min/max values since the precision digits must
also be accounted for (as well as one additional character for the
decimal separator).
Current implementation is not perfect yet because GimpSizeEntry code
itself does not yet use gimp_unit_get_scaled_digits(). Moreover the
entry size could be updated when changing units (or the original size
be actually based of the bigger width considering every possible unit).
2017-03-23 02:45:47 +01:00
Michael Natterer 461d807b05 libgimpwidgets: order enum combos of GimpDesaturateMode more logically
This is a bad hack that hardcodes a special case for
GIMP_TYPE_DESATURATE_MODE right into gimp_prop_enum_combo_box_new(),
we should think of something better if we get more special cases.
2017-03-17 22:50:12 +01:00
Michael Natterer e8309826b7 app, libgimpwidgets: use the new config path <-> GFile functions
Gets rid of temporary variables to hold both expanded and unexpanded
paths.
2016-09-30 22:07:00 +02:00
Michael Natterer 57d0c89818 libgimpwidgets: stop using GTK_TYPE_HSCALE
Use GTK_TYPE_SCALE with orientation = HORIZONTAL instead.
2016-09-09 21:52:09 +02:00
Michael Natterer 44010beaed libgimpwidgets: use gimp_config_path_unexpand() in gimp_prop_file_choose_button
instead of a plain g_filename_to_utf8(), so special paths like
${gimp_dir}, ${gimp_plug_in_dir} etc get substituted correctly.
2016-09-02 20:47:51 +02:00
Richard Kreckel dd9b0fc55b Bug 768044 - Fix many typos
This fixes many typos in comments and one in a user-visible string (msgid
"center abscisse" changed to "center abscissa" in affected po files. too).
2016-06-26 00:35:24 +02:00
Michael Natterer 47ef3be145 Initialize GValues with G_VALUE_INIT instead of { 0, } 2016-03-26 15:59:26 +01:00
Jehan 30e4826473 app, libgimpwidgets: update gimp_prop_foo_new() documentation comments.
Explains what happens when NULL labels are used.
2016-02-11 16:35:45 +01:00
Michael Natterer 9c4dd960a0 app, libgimpwidgets: allow NULL labels in some gimp_prop_foo_new() functions
and fall back to the GParamSpec's nick.
2016-02-09 23:35:06 +01: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 eaea58f5e3 libgimpwidgets: deprecate gimp_spin_button_new()
it should have never been added in the first place. Port all users
to using gtk_spin_button_new() directly.
2014-06-21 22:35:39 +02:00
Michael Natterer 77a515dd0f app, libgimpwidgets: don't set unchanged object properties again
gimp_prop_adjustment_callback(): compare the property's current value
before setting it.
2014-06-19 02:01:10 +02:00
Michael Natterer 8be52f6aa7 app, libgimp*: pass translated blurbs to GIMP_CONFIG_INSTALL_PROP_FOO()
instead of passing N_()-strings; and remove gettext() calls on these
strings when using them. Reduces complexitx, and fixes double- and
untranslated strings. Also enables to treat properties of GIMP and
GEGL objects the same way, which was totally broken before.
2014-05-14 23:34:01 +02:00
Michael Natterer ed7cdba5b6 libgimpwidgets: add gimp_prop_icon_image_new()
and deprecate gimp_prop_stock_image_new().
2014-05-09 00:56:24 +02:00
Michael Natterer 79bd9c60de libgimpwidgets: mostly port from stock IDs to icon names
Add some new API and deprecate old one.
2014-05-07 21:32:09 +02:00
Michael Natterer 7385e030dd app, libgimp: add increment parameters to gimp_prop_widget_set_factor()
Step and page increments can't be reasonable calculated or guessed
based on the GUI widget's factor, so pass them each time we call
set_factor(). This change reintroduces sane ranges for the levels tool
for != u8 images again.
2014-02-03 22:57:51 +01:00
Michael Natterer fb01bb37d2 Bug 721067 - Opacity slider broken in "Edit/Fade [plugin]..." dialog
gimp_prop_opacity_entry_new(): need to pass FALSE not TRUE to
gimp_prop_scale_entry_new()'s limit_scale parameter, it has the
inverse meaning than the same boolean in gimp_scale_entry_new().

This is perhaps a bug, but we can't change that now; instead, fix the
argument names and docs of gimp_prop_scale_entry_new() to point out
the difference.
2013-12-26 14:01:34 +01:00
Michael Natterer ad2a577606 libgimpwidgets: support the same "factor" logic as in app's prop widgets 2013-06-17 02:14:17 +02:00