Commit Graph

71 Commits

Author SHA1 Message Date
Jehan 7056f1b960 app, libgimpwidgets: move gimp_prop_spin_scale_new() and…
… gimp_prop_widget_set_factor() to libgimpwidgets.

Now that GimpSpinScale is in libgimpwidgets, it's time to move the
associated prop too, to make it a prop widget with such a widget easily
creatable by plug-ins.

While doing so, I update both these functions logic, binding properties
together with the g_object_bind_property*() APIs (as we do already in
some other recent prop functions) rather than connecting to signals
ourselves. It makes for much simpler code.
2022-02-19 00:14:44 +01:00
Jehan ab1fc79a07 app, libgimpwidgets: move GimpSpinScale to libgimpwidgets.
There is really nothing specific to the core application, it is quite a
generic widget, so it would be nice for plug-ins to be able to use this
widget.
2022-02-17 23:13:42 +01:00
Jehan fd9f96f174 app: get rid of a wrong return-after-free report.
Reported by Massimo, though this one is wrong, as far as I can see.

`ninja scan-build` apparently reports `result` as being returned after
being freed here. But actually since we are setting the `error` with
g_set_error() in the same time we free `result`, we would also enter the
`if (*error)` block a few lines later, which would return NULL and not
`result` anyway. I guess the static analyzer could not see that far.

Still, set the pointer to NULL with g_clear_pointer(), which should be
enough to make the static analyzer happy.
2021-10-01 12:51:48 +02:00
Jehan 49e534247a app, libgimp*, pdb, plug-ins: use g_memdup2() instead of g_memdup()
Since it appeared with GLib 2.68.0, we could not change this until we
bumped the dependency which has only become possible a few days ago
(since Debian testing is our baseline for dependency bumps). Cf.
previous commit.

As this is a drop-in replacement (just a guint parameter changed to
gsize to avoid integer overflow), search-and-replace with:

> sed -i 's/g_memdup\>/g_memdup2/g' `grep -rIl 'g_memdup\>' *`

… followed by a few manual alignment tweaks when necessary.

This gets rid of the many deprecation warnings which we had lately when
building with a recent GLib version.
2021-08-26 17:32:09 +02:00
Jehan 025cebf76f app: free an unusing allocated string when not used as a result.
Another leak reported by Massimo.
2021-08-20 21:53:41 +02:00
Thomas Manni 0d519a606f app: fix config properties / spin buttons mapping for Convolution Matrix filter
The filter's output is now correct, and rotating/flipping the matrix works as
expected.
2021-01-31 13:09:15 +01:00
Ell 552991b2d2 app: return visible widgets from a few more gimp_prop() functions
... in particular, this fixes the Rotate Colors prop-gui.
2020-07-31 20:47:05 +03:00
Ell bbc0f18953 app: fix error propagation in boolean GUM grouping subexpressions 2020-06-12 01:35:04 +03:00
Ell 5c07bcd1ff app: fix reference parsing in boolean GUM expressions 2020-06-12 01:35:04 +03:00
Ell ca351d3520 app: misc cleanup in prop-gui range creation 2020-06-03 10:16:23 +03:00
Ell c7599626f4 app: fix prop-gui static range visibility 2020-06-03 10:16:22 +03:00
Ell 4492f61df4 app: in _gimp_prop_gui_new_generic(), use "range-label" pspec key as range label
... when available
2020-06-02 23:56:16 +03:00
Ell 438babea6b app: improve gegl:focus-blur prop-gui constructor
... by grouping the geometry options, which can be controlled
through the on-canvas UI, in an expandable frame, which is
collapsed by default.  The shape option is not part of the group,
and is moved to the top.
2020-06-02 23:25:26 +03:00
Ell 8eb752b194 app: use special prop-gui widget for luminance ranges
In _gimp_prop_gui_new_generic(), when a pair of consecutive
properties have "range-start" and "range-end" roles, respectively,
and "luminance" units, use a range prop-widget for both properties,
as per the previous commits.

The range is sorted by default, unless the first property has a
"range-sorted" key of "false".
2020-06-02 23:25:25 +03:00
Ell 8139836d5d app: fix parsing of GUM cross-property references 2020-06-01 22:40:27 +03:00
Ell ae801871e5 app: in gimp_prop_eval_string(), don't leak result upon trailing tokens 2020-06-01 22:40:27 +03:00
Ell 60d4d25b93 app: add gegl:focus-blur to Filters -> Blur
gegl:focus-blur blurs the image around a focal point.  It can be
used to create fake depth-of-field effects.

Add a prop-gui constructor which uses a FOCUS controller to control
the focus geometry.
2020-05-15 00:48:39 +03:00
Ell f6f0a8a2d8 app: add FOCUS controller to gegl:vignette
Add a prop-gui constructor to gegl:vignette, using a FOCUS
controller to control the op's geometry.
2020-05-15 00:48:39 +03:00
Ell 3a62c53009 app: add FOCUS prop-gui controller
... based on GimpToolFocus.
2020-05-15 00:48:39 +03: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
Félix Piédallu 65eff6f150 Meson port. 2019-09-11 16:42:04 +02:00
Sabri Ünal 2e766f67d4 Missing mnemonics on several dialogs
paste as brush, paste as pattern, select to new brush, select to new pattern
fill selection outline, fill path, stroke selection, distort, rounded rectangle
indexed color conversion, merge visible layers, new guide, new guide (by percent)
image properties, newsprint, fractal explorer, sample colorize, new layer

metadata editor (just a button), spyroplus (only common buttons)
2019-09-05 22:41:19 +03:00
Michael Natterer ce44b04005 app: improve gegl:newsprint's GUI a lot
Add some frames, a notebook for the channels and toggles to lock all
channels' properties together.
2019-07-18 02:10:24 +02:00
Michael Natterer d718da27a8 app: add gegl:newsprint to Filters -> Distorts
and add a custom GUI constructor that does nothing special (yet).
2019-07-17 18:24:33 +02:00
Jehan 9042e85f3c app: make gimp_prop_gui_chain_toggled() less error-prone.
Don't assume that "toggled" signal means that toggle status actually
changed.

Though issue #3133 got fixed with my previous commit, let's make sure we
never create several GBinding for the same GimpChain by always checking
existence of a previous one after a "toggled" signal.
Also only create a GBinding object if one doesn't already exist.
2019-03-20 15:05:22 +01:00
Jehan af6760b3c9 app: fixes g_object_unref: assertion 'G_IS_OBJECT (object)' failed.
"binding" data can be set to NULL. Do not assume it is a proper object.

Also I was tempted to use g_object_set_data() to simply free the
GBinding object on setting a new data, but such object will also be
freed when the widget is destroyed by default. So that would also end up
in double destruction. Instead just keep current logics.

This CRITICAL was reported in #3133 but this is not the main bug.
2019-03-20 14:06:18 +01:00
Michael Natterer 39406b83d3 Issue #2136 - On-image UI for adjusting Linear Motion Blur
Add on-canvas GUI (simple lines) for circular, linear and zoom motion
blur. The restrictions in the interaction show pretty well that there
is room for improvement here, the line is just a bit too generic, but
it's better than nothing.
2019-01-04 14:38:49 +01:00
Michael Natterer 0a1ecdf4ee Issue #2540 - block width / height slider of the pixelize filter don't...
...have the same scaling

gimp_prop_widget_new_from_pspec(): when restricting the scale to the
actual op area for pixel-coordinate and pixel-distance properties,
only use the max value in the axis direction for pixel-coordinate; for
pixel-distance make sure we use the same value on both axes, simply
use MAX (area.width, area.height).
2019-01-03 22:19:48 +01:00
Ell 6976e87dac app: in prop-GUI, use "direction" UI-meta of angle props for dial
When constructing a prop-GUI widget for an angle property with a
dial, use the the property's "direction" UI-meta, if exists, to set
the direction of the dial.  Together with GEGL commit
7b0578073a0f20334b5a8a8fe57b649d9f302454, this fixes wrong dial
direction in certain ops that use clockwise angles.
2018-07-24 02:25:25 -04:00
Ell 0c477564ad app: in GimpDial, add "clockwise-angles" property ...
... and rename "clockwise" to "clockwise-delta"

Add a boolean "clockwise-angles" property to GimpDial, which, when
set, causes the dial legs' angles to be measured clockwise, rather
than counter-clockwise.  The property is FALSE by default.

Rename the "clockwise" property, which controls the direction of
the measured delta between the two angles, to "clockwise-delta", to
avoid confusion, and adapt the rest of the code.
2018-07-24 02:25:22 -04:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Ell 6d8128e3e0 app: fix filename in gimppropgui-recursive-transform.c license notice 2018-06-17 15:59:11 -04:00
Ell 56d15e83e9 app: merge back gegl:recursive-transform-plus propgui to recursive-transform
... following GEGL commit 6be0a86583f9c10c7710c96c21c261e4227c4727.

gegl:recursive-transform now allows applying multiple
transforamtions simultaneously, using multiple transform-grid
widgets.
2018-06-17 15:49:35 -04:00
Ell 99828a697a app: add custom GUI for gegl:recursive-transform-plus
gegl:recursive-transform-plus is an extension of
gegl:recursive-transform, allowing multiple transformations to be
applied simultaneously; it will eventually be merged back into
gegl:recursive-transform.  See GEGL commit
9829bc22e85526d789c4e80c05949d4c6202a207.

The GUI uses the new TRANSFORM_GRIDS controller, allowing adding,
duplicating, and removing transformations, and controlling them
through on-canvas transform grids.
2018-06-05 04:31:30 -04:00
Ell 5e953ece85 app: add TRANSFORM_GRIDS propgui controller
... which is similar to the TRANSFORM_GRID controller, supporting
multiple transformation matrices.

Implement the TRANSFORM_GRIDS controller in GimpFilterTool, using
the new GimpToolWidgetGroup to display multiple transform grids.
2018-06-05 04:04:47 -04:00
Michael Natterer 4cd19e6f65 app: undeprecate everything in propgui/, mostly table -> grid 2018-05-20 21:06:32 +02:00
Michael Natterer 6c8cf7876a Replace lots of deprecated gtk_menu_popup(), only GimpUIManager left 2018-05-20 21:06:30 +02:00
Michael Natterer 1b3135ca95 Get rid of using GtkMisc API globally 2018-05-20 21:06:30 +02:00
Ell 07c81abf01 app: fix propgui random seed generation
After the switch of random-seed properties from INT to UINT, their
upper bound results in a negative value when converted to a
gint32, causing a CRITICAL in the call to g_random_int_range().
Use g_random_double_range() instead, which has enough precision to
accurately represent all values in the range, and round the result.
2018-05-04 13:41:55 -04:00
Ell 5b8b33dad7 app: invert zoom mapping in gegl:panorama-projection gyro controller 2018-04-11 04:53:26 -04:00
Ell 6982533292 app: add custom GUI for gegl:panorama-projection
... which uses a gyroscope controller to control the op's rotation
angles and zoom.
2018-04-10 10:18:49 -04:00
Ell 8738d2f22b app: add a gyroscope controller to prop-gui
Add a gyroscope controller, providing a prop-gui interface to
GimpToolGyroscope.

Implement the gyroscope controller in GimpFilterTool.
2018-04-10 10:18:48 -04:00
Massimo Valentini 16b0110f72 Bug 791315: Using the Gaussian Blur filter twice (Re-Show)...
...only remembers horizontal radius, duplicates it for vertical

Keep a list of the GUI's chain buttons around. When changing the
entire config object like on reset or selecting saved settings, unlik
them all after remembering their "active" state, and after changing
the settings activate the ones that were active before, but only if
the values they link are still the same.
2018-03-18 17:39:03 +01:00
Ell 7e1fd5983c app: fix tooltip of propgui color buttons
Source/target arguments of bind_tooltip() were swapped.
2018-03-08 15:24:21 -05:00
Jehan c9d9b5535b Bug 794023 - Bad/Double free bugs found by scan-build.
In case of error in gimp_prop_eval_parse_reference(), we were obviously
freeing the string which had just been allocated by g_strdup(), not the
pointer to this string.
Thanks to Massimo for raising this issue.
2018-03-03 16:43:27 +01:00
Ell 8039582df0 app: add custom GUI for gegl:recursive-transform
gegl:recursive-transform applies a transformation recursively to
an image.  The custom GUI allows controlling the transformation
matrix using a transform-grid controller, added in the previous
commit.
2018-03-01 02:26:54 -05:00
Ell 3985651d26 app: add transform-grid controller to prop-gui
... which allows ops to create a transform-grid widget, similar to
the unified-transform tool, which can be used to control a
transformation matrix.

Implement the transform-grid controller in GimpFilterTool.
2018-03-01 02:26:54 -05:00
Jehan 264565e121 Bug 793667 - Solid noise filter (pop-up bug report dialog).
gimp_spin_scale_set_scale_limits() needs double limit values. Using
integer makes us vulnerable to rounding bugs.
2018-02-21 15:12:33 +01:00
Ell 4190f400b0 app: enable gegl:color-to-alpha custom GUI
gegl:color-to-alpha-plus was merged back to gegl:color-to-alpha in
GEGL, so we can change the custom propgui constructor to refer to
gegl:color-to-alpha.

Remove the threshold-range compression toggle and logic, since the
corresponding property was removed in GEGL.
2018-02-15 08:58:40 -05:00
Michael Natterer 5799352527 app: minor fixes in the shadows-highlights code 2018-01-05 12:23:36 +01:00