Commit Graph

1887 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
Ell ac8bf47fa6 libgimpwidgets: control GimpSpinButton scroll increments using modifiers
In GimpSpinButton, adjust the scroll step in response to modifiers:
normal scrolling uses the step increment, Ctrl uses the page
increment, and Shift scales the step increment down by the ratio
between the page and step increments (up to the minimal precision
of the spin button).

This applies to all spin buttons used in GIMP, including spin
scales.
2020-01-08 21:00:57 +02:00
Ell 5646e03eb3 app, icons: add 3D Transform tool
Add a new 3D Transform tool, based on GimpToolTransform3DGrid,
added in the previous commit.  The tool UI provides a notbook with
three tabs, corresponding to the three GimpToolTransform3DGrid
modes:

  Camera - allows setting the primary vanishing point, as well as
  the camera's focal length, expressed either directly, or as the
  camera's angle of view, relative to the whole image or the
  transformed item.  By default, the vanishing point is aligned
  with the item's center, and the angle of view is fixed relative
  to the item; this essentially means that each item is transformed
  using a local perspective, independent of its position and size
  relative to the image.  A global perspective can be achieved by
  using a common vanishing point and focal length (or an image-
  relative angle of view).

  Move   - allows moving the item using X, Y, and Z offsets.

  Rotate - allows rotating the item using X, Y, and Z Euler angles.
  The order of rotation of the different axes can be controlled by
  a set of numbered buttons next to the sliders, and the rotation's
  pivot can be controlled using a pivot selector.
2020-01-06 21:52:54 +02:00
Ell 46e01d37db app, icons: add GimpPivotSelector widget
GimpPivotSelector is a 3x3 grid of toggle buttons, used for
selecting a natural pivot position (e.g., for a transform) relative
to an item: its center, its corners, and the midpoints of its
edges.
2020-01-06 21:35:52 +02:00
Ell a9e357d72d libgimpwidgets: fix percentage use in size-entry arithmetic when lower-bound != 0
In GimpSizeEntry, the value corresponding to 0%, as per
gimp_size_entry_set_size(), may be non-zero.  This works correctly
when using the size entry in percentage mode, but not when using
precentage as part of arithmetic.

Fix this by adding an 'offset' parameter to eevl's unit-resolution
callback, which can be specifies a constant value to add as part
of unit conversion, after scaling the converted value by the
conversion factor.  In GimpSizeEntry, use this parameter to offset
percentages by their lower bound.
2020-01-06 21:35:52 +02:00
Michael Natterer 05896b4e2f libgimpbase: rename and reorder the values of enum GimpSelectCriterion 2019-11-19 22:25:57 +01:00
Michael Natterer c287fb6239 libgimpwidgets: reorder enum GimpIntStoreColumns
so LABEL and ABBREV are next to each other.
2019-11-19 21:06:05 +01:00
Jehan 4150bbb59f libgimpwidgets: (meson) a whole list of headers were not introspected. 2019-10-19 22:45:59 +02:00
Jehan b8d8424ae0 app, libgimp*: (meson) fix all the generated `*-enums.c`.
More of the files were wrong, or at least not absolutely identical to
the files generated by the autotools. I am not doing any code change
other than trying to make both build systems produce identical files
(except for slight differences on 2 files not worth the effort) even
though maybe some things can be improved (especially on the include
list). Maybe to be improved later.

Also fixing 2 of the previously autotools-generated files because of
space typos which should have been committed earlier.

Finally it is to be noted that there is no logics to copy the generated
files back to the source directory in the meson rules. I am not sure
anyway this is really worth it and maybe we should just stop tracking
these generated files eventually.
2019-10-19 22:32:29 +02:00
Jehan 5d79fba823 libgimpwidgets: (meson) fix gimpwidgetsenums.c generation.
Noticed by Massimo.
gimp_type_set_translation_domain() calls were missing.
Also make so that the output is exactly similar (even whitespaces) as
the autotools one, making it easier to diff, hence maintain.
2019-10-19 17:51:21 +02:00
Jehan 9dcdf37ab3 libgimpwidgets: check error return for gtk_icon_theme_load_icon().
In gimp_page_selector_add_frame(), if "gimp-frame" icon cannot be loaded
(which should not happen, but reality can always strike back!), we want
to abort from gimp_page_selector_add_frame() immediately.

Also as a consequence, its return value might be NULL, hence should be
freed with g_clear_object() instead.

This happened here because of broken meson rules (which didn't install
this icon) and ended up in forever looping errors when loading a
multi-page PDF (pages are shown in frames in a dialog):

> (file-pdf-load:12348): GdkPixbuf-CRITICAL **: 11:59:28.513: gdk_pixbuf_copy_area: assertion 'src_pixbuf != NULL' failed
2019-10-12 12:25:55 +02:00
Michael Natterer d02d97e310 libgimpwidgets: add gimp_prop_int_radio_frame,box_new() 2019-10-03 15:59:09 +02:00
Michael Natterer 1f7c823a90 libgimpwidgets: remove the gimp_radio_group_*() functions
they are antique cruft and unused.
2019-09-25 23:37:03 +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 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 dbd793d631 libgimpconfig: get rid of filenames in all config related APIs
and rename function names which say "gfile" to just "file".
2019-09-21 12:55:12 +02:00
Michael Natterer 693984e235 app, libgimpwidgets: use the new parasite (de)serialization API 2019-09-21 12:26:29 +02:00
Félix Piédallu 65eff6f150 Meson port. 2019-09-11 16:42:04 +02:00
Ell d93fefb174 Issue #3876 - The tool options of some transform tools are vertically centered ...
... in their dockable dialog

In GimpChainButton, override GtkWidget::compute_expand() to avoid
inheriting [hv]expand from the button's chain lines, so that these
propeties don't in turn propagate to the widget's ancestors,
screwing with their layout.
2019-09-09 16:53:52 +03:00
Michael Natterer ea4fe02a6d libgimpwidgets: some docs fixes 2019-08-18 14:07:17 +02:00
Jehan f22290e0a2 libgimpwidgets: fix a warning. 2019-08-17 10:53:45 +02:00
Niels De Graef 284ba5c870 libgimpconfig: Prevent GIR conflicts in GimpConfigWriter
GimpConfigWriter contains several constructors with the convention
`gimp_config_writer_new_* ()`. This will lead to problems however with
languages like Vala, where it cannot disambiguate the following:

```
// calls config_writer_new_string()
Gimp.ConfigWriter w = new ConfigWriter.string("xxx");
// calls config_writer_string()
w.string("xxx")
```

Using `from_` in constructors is general practice in GObject-bsed
libraries because of this.

This also fixes an error when trying to use vapigen on the GIMP .GIR
file.
2019-08-16 10:04:39 +00:00
luz.paz 7e99aa59f5 Add other misc. typo fixes 2019-08-13 11:50:51 -04:00
Jehan ae7dfba2c4 libgimpwidgets: fix some typos.
s/logharithmic/logarithmic/
2019-08-09 23:40:07 +02:00
Michael Natterer 31b8ea4a90 libgimpbase: add lots of const to GimpEnumDesc and GimpFlagsDesc APIs 2019-08-09 13:29:34 +02:00
Michael Natterer 55940b733b libgimpwidgets: add a GDestroyNotify for gimp_help_connect()'s user_data 2019-08-09 13:11:30 +02:00
Michael Natterer ebddecd696 libgimpwidgets: more docs and annotations 2019-08-09 12:59:41 +02:00
Michael Natterer d3d621b502 libgimpconfig: add a GimpScanner typedef and make it a boxed type
Replace _destroy() by _ref() and _unref().
2019-08-09 12:42:52 +02:00
Michael Natterer 8cfef5e60d libgimpwidgets: more docs and annotations 2019-08-09 12:32:09 +02:00
Jehan 2dde79b3e7 libgimp*: move GObject Introspection into libgimp/.
libgimp is anyway processed at the very end after all other libgimp*
were built. This way, it also fixes #3746, by removing the $(top_srcdir)
everywhere from introspected files, hence making the build work again
with older automake.
2019-08-08 15:59:44 +02:00
Michael Natterer 00bf76752c libgimpwidgets: more docs and annotations for GimpUnitComboBox 2019-08-08 00:40:03 +02:00
Michael Natterer 169f98f915 libgimpwidgets: add GDestroyNotify to gimp_int_combo_box_connect() 2019-08-08 00:22:15 +02:00
Michael Natterer 67455a4ea7 libgimpwidgets: add GDestroyNotify to all enum widgets callback_data 2019-08-08 00:01:10 +02:00
Michael Natterer 1afb7a8b32 libgimpwidgets: add GDestroyNotify to gimp_widget_track_monitor() 2019-08-07 23:44:18 +02:00
Michael Natterer cbefd8e5bb libgimpwidgets: add GDestroyNotify for gimp_query_foo_box() user_data
This is ugly shit that should go down the canal but let's just fix
these GI warnings.
2019-08-07 22:48:06 +02:00
Michael Natterer c08186e6fe libgimp*: fix some parameter inconsistencies to silence GI warnings 2019-08-07 22:05:12 +02:00
Jehan ddd726e253 libgimpwidgets: add some annotations.
Fix some (transfer) warnings.
2019-08-05 17:13:59 +02:00
Jehan 4a6b58507b libgimp, libgimpmath, libgimpwidgets: update def files.
So many things moved in the last few days, and we just didn't think of
updating these.
2019-08-05 16:55:35 +02:00
Michael Natterer cc8fc0f90f libgimp*: add GI's .dirstamp to .gitigore 2019-08-03 19:50:17 +02:00
Niels De Graef 5f92ced1f3 Add (nullable) if applicable
Basically this commit makes sure that all return values that are marked
as "Returns:" also have a `(nullable)` annotation if it is mentioned on
the same line that NULL can also be returned.

This will prevent a few problems in GObject-introspection.
2019-08-03 07:53:47 +00: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 6a1df5be31 libgimpwidgets: fix a copy-paste bug in function docs. 2019-08-03 09:38:46 +02:00
Jehan 19fbb1d9a8 libgimpwidgets: add documentation for many functions and fix...
... an annotation.
s/(transfer-none)/(transfer none)/
For the "Since:" value, I did some git log archeology. Hopefully I got
these right.
2019-08-02 11:46:39 +02:00
Michael Natterer c12c031f2d pdb, libgimp*: add (out caller-allocates) to all GimpRGB* return values 2019-08-01 15:39:13 +02:00
Michael Natterer bdac38a854 libgimpwidgets: add and fix some annotations 2019-08-01 14:10:50 +02:00
Jehan ea53089545 libgimpwidgets: add a bunch of missing (transfer) annotations. 2019-08-01 13:10:39 +02:00
Michael Natterer e7f041492a libgimpwidgets: fix a doc glitch in GimpStringComboBox 2019-08-01 12:23:05 +02:00
Michael Natterer 83ecbc8e39 libgimpwidgets: fix GimpScaleEntry annotations 2019-08-01 10:22:20 +02:00
Jehan 3016dfb347 libgimpwidgets: add many missing (transfer) annotations. 2019-08-01 02:04:28 +02:00