Commit Graph

1896 Commits

Author SHA1 Message Date
Niels De Graef 4729fc8dec Use GIMP_TYPE_RGB instead of G_TYPE_POINTER
That way, bindings can set the correct signature for callbacks.
2020-05-06 10:36:33 +00:00
Niels De Graef 97fcc8ca0f gir: Mark gimp_dialog_new() parent nullable 2020-05-05 19:14:58 +02:00
Niels De Graef 83d6764e0e gir: Add (closure) tags 2020-05-04 21:31:30 +02:00
Niels De Graef 7f58f2d6e5 gir: Add more missing (array) and (out) annotations 2020-05-04 21:29:42 +02:00
Niels De Graef 9c9e310a67 gir: Add missing annotations
Otherwise we won't be able to generate proper API for our bindings
2020-05-04 02:11:57 +02:00
Niels De Graef cf41d1fdf8 colorselector: Rename signal emitters
The GIR parser is giving warnings because both e.g. a signal, a
corresponding vfunc and a method emitting it are named
"channel_changed", which can and will give issues in some bindings.

The easiest option is to follow the general convention of starting the
signal emitters with `emit_`, which also makes clear the intention of
the method.
2020-05-03 23:23:44 +02:00
Niels De Graef db0493aa0d gir: Add more (out) annotations
This will change the API for some bindings, so we probably want to do it
before a release.
2020-05-03 17:57:23 +02:00
Ell 5dc1572b01 libgimpwidgets: fix logarithmic transform in gimp_scale_entry
Use the right GtkAdjustment in gimp_scale_entry_log_to_linear().
See merge request !49.

Thanks to MihailZenkov for spotting this!
2020-04-20 18:45:04 +03:00
Niels De Graef 878804fb01 Cleanup GObject signal marshallers
* Don't generate our own marshallers if they are available in GLib
  already
* Don't set the c_marshaller parameter in `g_signal_new()` if it's a
  default marshaller provided by GLib. See commit message of commit
  39e4aa3c57 on why this is the case.
2020-04-01 21:20:01 +00:00
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