Commit Graph

21087 Commits

Author SHA1 Message Date
Michael Natterer dd8f5acd9b app: cleanup, code reordring and cruft removal in GimpDockable 2018-06-08 01:53:46 +02:00
Michael Natterer 1de4e8a697 app: remove gimp_dock_temp_add() and _temp_remove()
and some leftover CSS prider cruft.
2018-06-08 01:41:44 +02:00
Michael Natterer 58d5cd2907 app: remove most of our own dockable DND code
and use GtkNotebook's implementation instead. This is mostly moving
dockable adding and removing code to GtkNotebook::page_added() and
::page_removed() and removing lots of code.
2018-06-08 01:37:19 +02:00
Michael Natterer a4061a6b0d Issue #1291 - Non-intrusive warning when saved XCF version...
...won't work with older GIMP?

Make gimp_image_get_xcf_version() return a "reason" string which lists
all reasons why the image can't be saved with compatibility for older
GIMP versions. Display the reason as tooltip on the compat hint label
in the save dialog.
2018-06-06 23:08:33 +02:00
Michael Natterer b36205176e app, libgimp*: remove the config option to disable tooltips
Also remove all traces of it from the plug-in protocol and raise the
protocol version to 0x0100 (we now allow features and therefore
version bumps in stable, and the master protocol version should always
be higher). Fix the code that aborts plug-in startup on protocol
version mismatch, we can't use gimp_message() because we have no
protocol.
2018-06-06 19:23:30 +02:00
Ell 7c7b6eb537 app: use default new-layer mode for layer groups and text layers
When creating a layer group, or a text layer, use the image's
default new-layer mode, instead of always using (non-legacy)
NORMAL.
2018-06-06 02:39:34 -04:00
Jehan d56a8d439e app: do not stop the measurement when straightening.
Instead just transform the measurement extremities appropriately to
still map to the same points.
To do so, I also added out parameters to gimp_image_resize_to_layers()
so that calling code can get offsets from old origin (as well as new
image dimensions).
2018-06-05 23:34:30 +02:00
Michael Natterer 247cc12cec app: use a GtkFlowBox for the toolbox' color/foo/image areas
not perfect but much better than before.
2018-06-05 18:43:46 +02:00
Michael Natterer 5fa8908c61 app: add missing include in GimpProcedureAction 2018-06-05 18:43:46 +02:00
Michael Natterer 07ae01aba8 app: remove unused variables in GimpEditor 2018-06-05 18:43:46 +02:00
Jehan 3214199812 app: measure tool's "auto straighten" with progress and link-aware.
Also make so that it works for any active drawable, not layers only.
2018-06-05 16:47:49 +02:00
Jehan ba1d937dfb app: properly "auto straighten" in measure tool.
In particular, this tool should not make huge rotation where the top
ends up in the bottom and it should not depend on whether we started the
measure tool from the left, right, bottom or top. This is fixed by using
atan() instead of atan2().

Also make a proper tooltip text. Help id is unneeded most likely though.
Finally do some cleaning and alignment.
2018-06-05 16:47:49 +02:00
Massimo Valentini 9baf2b62cd Bug 526719: add easy way to set rotation angle to straighten an image 2018-06-05 16:47:49 +02:00
Ell 5139a46602 configure.ac: require babl >= 0.1.51 2018-06-05 04:39:32 -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 d5cab08215 configure.ac: require GEGL >= 0.4.3 2018-06-05 04:04:47 -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
Ell 4ef06b9922 app: add GimpToolWidgetGroup
GimpToolWidgetGroup is a tool widget acting as a container for
child widgets, multiplexing widget events and demultiplexing tool
events.  It can be used by tools to display multiple widgets
simultaneously.

The group keeps track of the current focus widget, and hover
widget.  Certain events are only dispatched to/forwarded from these
widgets.

The hover widget is determined by performing a hit test for all the
children, starting from the last child.  The first widget returning
GIMP_HIT_DIRECT, if any, is selected as the hover widget;
otherwise, if the current focus widget returns GIMP_HIT_INDIRECT,
it's selected; otherwise, if exactly one widget returns
GIMP_HIT_INDIRECT, it's selected; otherwise, there is no hover
widget.

The focus widget is set when clicking on a widget (or
programatically, using gimp_tool_widget_set_focus()).
Additionally, the group can raise the clicked widget to the top of
the stack (see gimp_tool_widget_group_set_auto_raise().)
2018-06-05 04:04:47 -04:00
Ell 614cdcc0a8 app: add gimp_tool_widget_changed()
... which emits the "changed" signal, for use in subclasses to
notify the tool about widget changes not resulting from property
changes.
2018-06-05 04:04:47 -04:00
Ell 52a92a34d8 app: implement GimpToolWidget::hit() in all tool widgets
... and move the common functionality of their hit() and hover()
implementation to a separate function.
2018-06-05 04:04:47 -04:00
Ell 385203f4d6 app: add GimpToolWidget::hit() virtual function
... which takes the same arguments as GimpToolWidget::hover(), and
performs a hit-test, returning one of the following values:

  - GIMP_HIT_DIRECT:  The point corresponds to one of the widget's
    elements directly.

  - GIMP_HIT_INDIRECT:  The point does not correspond to one of the
    widget's elements directly, but the widget otherwise responds
    to press events at this point.

  - GIMP_HIT_NONE:  The widget does not respond to press events at
    this point.

Unlike hover(), hit() should not have any side effects.
2018-06-05 04:04:47 -04:00
Ell 5e736c697f app: implement GimpToolWidget::leave_notify() in various tool widgets
... by having them disable item highlights, and any other proximity
indication, when the cursor leaves the widget.
2018-06-05 04:04:47 -04:00
Ell be7eff980e app: add GimpToolWidget::leave_notify() vfunc
... which should be called on a widget when the cursor leaves the
widget, i.e., when it stops receiving hover events.

Have the default implementation clear the tool status.
2018-06-05 04:04:47 -04:00
Ell 322599836c app: in GimpDrawTool, set widget focus when setting widget
In gimp_draw_tool_set_widget(), make the new tool widget focused,
and unset the focus of the old widget.
2018-06-05 04:04:47 -04:00
Ell 49089fc427 app: respond to "focus-changed" signal in various tool widgets
... by disabling persistent item highlights when unfocused.
2018-06-05 04:04:47 -04:00
Ell eeed9c413b app: add gimp_tool_widget_{set,get}_focus(); "focus-changed" signal
The next few commits are going to add support for using multiple
tool widgets simultaneously.  As a first step, add a notion of a
focused tool widget, by adding gimp_tool_widget_{set,get}_focus(),
which tools/subclasses can use to control focus, and a
corresponding "focus-changed" signal, which tools/subclasses can
use to respond to focus changes.
2018-06-05 04:04:47 -04:00
Michael Natterer a20e926630 app: undeprecate styling of GimpComboTagEntry and GimpTagPopup
this looks correct now, but I doubt it still works 100% as with GTK+
2.x when the tag popup starts scrolling, we still measure the popup
size wrongly imo.
2018-06-04 21:10:12 +02:00
Michael Natterer 1806b66c5a Issue #1560 - invisible canvas flip/rotation buttons...
...at the bottom of image window

Need to show/hide the event box, not just the labels/icons inside.
2018-06-04 15:13:23 +02:00
Michael Natterer 73da7c9a54 app: add GimpDataLoaderFactory which loads data from an array of formats
specified by GimpDataLoaderEntry structs. Remove the same code from
GimpDataFactory and make it an abstract base class that only serves as
an interface for actual implementations. Also move around some stuff
in GimpDataFactory and remove virtual functions that were a bad idea
in the first place.
2018-06-04 13:49:07 +02:00
Michael Natterer 0b4677ec58 app: make gimp_data_factory_data_foreach() public
...this time without additional shit.
2018-06-04 12:45:41 +02:00
Michael Natterer 6e19413d21 Revert "app: make gimp_data_factory_data_foreach() public"
This reverts commit f521e92d35.
2018-06-04 12:34:41 +02:00
Michael Natterer f521e92d35 app: make gimp_data_factory_data_foreach() public 2018-06-04 12:33:09 +02:00
Michael Natterer 2ca408d146 app: add "new-func" and "get-standard-func" properties to GimpDataFactory
to make it behave better, and as preparation for further subclassing.
2018-06-04 12:18:13 +02:00
Michael Natterer 792cd581a2 Issue #1531 - Zooming with mouse movement should keep track of original point
When Control-Button2-Zooming, remember the start point, pass it to
gimp_display_shell_scale_drag() and force gimp_display_shell_scale()
to zoom around that point by passing GIMP_ZOOM_FOCUS_POINTER and
faking the point using gimp_display_shell_push_zoom_focus_pointer_pos().
2018-06-04 11:42:02 +02:00
Michael Natterer d1b9f74c6f app: we always need to freeze/thaw around gimp_font_factory_data_init()
so pull it to the parent class. Also remove the "no_data" parameter
from the data_init() virtual function and handle it in
gimp_font_factory_data_init() itself.
2018-06-03 23:16:29 +02:00
Michael Natterer 1d2ff6aa1b app: handle fonts more correctly in gimp_context_deserialize_property()
The "no_data" case for fonts is gimp->no_fonts, not gimp->no_data.
2018-06-03 23:15:37 +02:00
Michael Natterer 6b5fd27943 app: call the standard font "Standard" not "Sans-serif"
Sans-serif is also an actual font from the list and the standard font
is being used when there is really no font at all.
2018-06-03 23:13:55 +02:00
Michael Natterer 40b95227af app: make gimp_font_get_standard() return a GimpData
like all other GimpData sublasses.
2018-06-03 22:46:48 +02:00
Michael Natterer f23958407c app: don't leak the identifier if gimp_data_make_internal() is called again 2018-06-03 22:43:55 +02:00
Michael Natterer c563659ed8 app: move the GimpAsyncSet and the waiting code to GimpDataFactory
it's potentially useful for all data factories.
2018-06-03 22:28:00 +02:00
Michael Natterer 3f954350d9 app: don't let gtk_tree_store_clear() mess with our selected item
gimp_container_tree_view_clear_items(): GTK+ 3.x always keeps the row
with the cursor selected, so we get a gazillion selection changed
during gtk_tree_store_clear(), block our selection changed handler
during the clear.
2018-06-03 21:45:16 +02:00
Michael Natterer 1b1739bb06 app: use gimp_data_factory_get_data_path() in GimpFontFactory
Also, make sure we freeze() and thaw() the font container correctly,
so that all places keep their fonts across a refresh.

The only thing to make this actually work seems to be a bug in the
list views, grid views work perfectly.
2018-06-03 20:44:28 +02:00
Michael Natterer 68cf2641f8 app: add gimp_data_factory_get_data_path[_writable]()
which return GLists of GFiles. Use the new API in GimpDataFactory's
default implementations.
2018-06-03 20:42:21 +02:00
Ell ec5f4d03fa app: strengthen gimp_async_set_{wait,cancel}()
Make sure gimp_async_set_wait() and gimp_async_set_cancel() work
correctly, even if the set changes in nontrivial ways as a result
of waiting-on/canceling individual operations.  This is purely
theoretic right now, but why not.
2018-06-03 10:05:02 -04:00
Michael Natterer e88fb8e9c7 app: remove all old font management code, switch to GimpFontFactory[View]
Biggest change in this commit is reordering stuff in GimpContext
because GimpFont is now a first class citizen.
2018-06-03 01:27:06 +02:00
Michael Natterer d153c7489e app: add GimpFontFactoryView as replacement for GimpFontView 2018-06-03 01:25:25 +02:00
Michael Natterer 9dc5c7767d app: GimpDataFactoryView: don't add buttons for actions which don't exist 2018-06-03 01:25:25 +02:00
Michael Natterer 0763ea2a69 app: add new GimpDataFactory subclass GimpFontFactory
which contains all the font loading and refreshing including all async
stuff and is a complete replacement for gimp-fonts.c and GimpFontList.
2018-06-03 01:25:25 +02:00
Michael Natterer 4d3c715990 app: derive GimpFont from GimpData 2018-06-03 00:45:06 +02:00
Michael Natterer 5280d7a277 app: change all GimpCoreConfig data paths to GIMP_CONFIG_PARAM_CONFIRM
so they can be changed without restart (see previous commit).
2018-06-03 00:45:06 +02:00