Commit Graph

513 Commits

Author SHA1 Message Date
Jehan 566e55e72e app: "Bend the text along the currently active path" multi-layer aware.
It still only requires one single path selected to work, but I updated
the internal API used.
2021-12-23 12:55:11 +01:00
Stanislav Grinkov 619cb91230 Remove unnecessary gimpmarshal.h and gimpwidgetsmarshal.h includes. 2021-08-13 18:01:13 +00:00
Jehan f6f94836c1 app, menus: get rid of custom input method menu.
The input menu added with gtk_im_multicontext_append_menuitems() mostly
provides redundant (e.g. the system defaults) or useless options
(e.g. "None" or "Simple" which basically seems to mean the keyboard
mapping straight keys, and I don't see why anyone would want this if one
set a system-wide input system). Worse it can provide unstable options
(e.g. "Wayland" which crashes GIMP when I tried it on my X11 desktop! It
crashes on _gtk_immodule_wayland_init which is probably normal as we are
not on a Wayland client).

Anyway gtk_im_multicontext_append_menuitems() is deprecated since
GTK+3.10, as well as the "gtk-show-input-method-menu" property which we
read from GTK+ settings (and is FALSE anyway nowadays by default, so we
usually never show this submenu) to determine if we should show this
additional text tool submenu or not. Furthermore there is just no reason
not to leave the defaults system input method engine does its job (which
works well as far as I can see, at the very least on my GNU/Linux X11
desktop and on Wayland also, last I tested).
2020-12-15 03:04:15 +01:00
Jehan 03af9da83b app: GimpTool multi-drawable aware.
Right now I don't change the logics of any of the tools, except that the
GimpTool class now stores a list of drawables instead of a single
drawable. This can be later used on a case-by-case basis to make various
tools actually work on multiple drawables.
2020-05-26 14:15:17 +02:00
Ell 8fa9221fb8 app: don't leak text-tool UI manager 2020-05-19 17:06:24 +03:00
Jehan 73096b9a04 app: make the text tool multi-layer aware.
Multi-drawable selection for text tool only matters for positionning the
newly created text layer, if relevant. If a single layer is selected, it
will be same as before.
With multiple selection, the new layer just ends up to the top in case
of layers from different containers.
2020-05-18 00:53:57 +02:00
Jehan 7cdf85693a app: multi-layer aware layers-mask-add and layers-mask-add-button.
These actions raise a GimpViewableDialog. For this to work, I made this
widget work with a list of GimpViewable, not a single viewable anymore
(so maybe the widget class name should change?).
When this list contains only a single GimpViewable, it will display
exactly like before, with a viewable preview. With several viewables,
the preview won't show.

This allows to add masks to all selected layers at once, with the same
basic options for all masks, as set in the dialog.
2020-05-17 18:32:16 +02:00
Jehan bcacf6e2ae app: "active item" concept => "selected items".
After much thought, tests and discussions with Aryeom, we decided adding
back an active item concept additionally to the selected items ones is a
bad idea as it makes only usage unecessarily complex.
We will just have selected layers. Some kind of operations will work
when more than one item (layers, channels, vectors) are selected while
others will require exacty one item.

In particular, let's replace instances of gimp_image_(s|g)et_active_*()
by corresponding gimp_image_(s|g)et_selected_*(). Also replace single
item in various undo classes by GList of items.
Also "active-*-changed" GimpImage signals are no more, fully replaced by
"selected-*s-changed".

This is still work-in-progress.
2020-05-17 18:32:16 +02:00
Jehan f7b86c9062 app: fix selection after a drag'n drop move.
Though it's not finished yet, I am changing "active layer" into
"selected layers" logics. Probably the "active layer" concept will be
back eventually (i.e. even in a multi-selection a specific layer could
be said "active", highlighted in the list a bit differently, hence one
could edit this specific layer only). But for simplicity, for now, it's
better to first get rid of it, otherwise it's just messy.
2020-05-17 18:32:15 +02:00
Ell cf3638391d app: add support for color picking in "show all" mode
Add a show_all parameter to gimp_image_pick_color(), which, when
TRUE, allows picking colors outside the canvas bounds in sample-
merged mode.  Forward the display's "show all" mode through this
parameter where applicable (in particular, in the color-picker tool
and the pointer dockable).
2019-09-04 20:51:43 +03:00
Michael Natterer 86e07c16b5 app: start porting away from GtkAction and friends
Step one: get rid of all those deprecation warnings that make
it hard to see any other warnings:

- add a lot of dummy API to GimpAction, GimpActionGroup, GimpUIManager
  etc. which simply forwards to the deprecated GTK functions, they
  will all go away again later
- rename GimpAction to GimpActionImpl
- add interface GimpAction that is implemented by all action classes,
  creates a common interface and allows to remove some duplicated
  logic from GimpToggleAction and GimpRadioAction, and at the same
  time adds more features
2019-07-02 14:21:32 +02:00
Ell 601c213c7a app: don't change text-layer box mode after moving using text tool
When moving a text layer using the text tool (through alt+drag),
don't change the layer's box mode to "fixed", which is unnecessary,
since the layer's size isn't affected.
2018-09-06 11:46:50 -04:00
Ell 238c1035db app: fix text tool frame position when undoing move operation
While editing a text layer with the text tool, update the layer's
frame when the layer moves, which most notably happens when
undoing/redoing a move operation while the text tool is active.
2018-09-06 11:46:50 -04:00
Ell a03183b266 app: streamline text-tool drawing blocking/unblocking logic
The various functions of the text tool currently block and unblock
drawing (through gimp_text_tool_[un]block_drawing()) implicitly,
and in a non-symmetric fashion, which makes the tool's logic rather
fragile.  Instead, require blocking/unblocking to be done
symmetrically, and explicitly block/unblock drawing as necessary in
all functions.
2018-09-06 11:46:50 -04:00
Ell a1caa17531 app: fix uninitialized variable warning in gimptexttool.c 2018-09-06 11:46:50 -04:00
ONO Yoshio 5483ea88e5 app: avoid to rotate unattached vectors directory in ...
... gimp_text_tool_create_vectors_warped().
fixed commit 8dfe00fa17
2018-09-06 08:39:51 +09:00
ONO Yoshio 8dfe00fa17 Issue #2064 - text along path not working with vertical text. 2018-09-03 12:19:05 +09:00
Jehan 5c56f8cb3a app: minor coding-style cleanup.
Adding spaces between function names and parenthese.

I would normally have just amended the contributed patches and pushed,
but gitlab is making our review process over-complicated with many
roundtrips with contributors, and review quality drops. Stating it here
for the records!
See commit 70945b8960 (where this cleaning
should have directly been done).
2018-08-02 12:59:53 +02:00
ONO Yoshio 70945b8960 Fixed that anchor position of text is shifted when text direction is changed.
anchor of LTR is top-left corner.
anchor of TTB-RTL is top-right cornner.
anchor of TTB-LTR is top-left cornner.
2018-08-02 10:29:54 +00:00
ONO Yoshio 587d9bbb03 MR !19: Add support for vertical text writing.
Squashed commit of the following:

commit ee1ff7d502658cfa1248a13a3f0348495db07eda
Author: ONO Yoshio <ohtsuka.yoshio@gmail.com>
Date:   Sun Jul 29 00:31:47 2018 +0900

    Fixed that gimp-text-dir-ttb-* icons are lacked in Symbolic.

commit d87d012d697628da28fe90199cc04b95b72ba8ef
Author: ONO Yoshio <ohtsuka.yoshio@gmail.com>
Date:   Sat Jul 28 16:23:10 2018 +0900

    Fix a typo.

commit cf0238bf7df56c384cdf3b7ec69557d14740f853
Author: ONO Yoshio <ohtsuka.yoshio@gmail.com>
Date:   Sat Jul 28 15:50:57 2018 +0900

    Fixed seg fault error.

commit b07f60d06f
Author: ONO Yoshio <ohtsuka.yoshio@gmail.com>
Date:   Fri Jul 27 17:15:34 2018 +0900

    Add support for vertical text writing.

    https://gitlab.gnome.org/GNOME/gimp/issues/641
2018-07-30 19:14:49 +02:00
Ell 6b1d77b11c Issue #1874 - Critical error after selecting "Edit Text on Canvas" ...
... from layer context menu

In gimp_text_tool_set_layer(), do nothing if the input layer is the
currently-edited layer, otherwise we get a CRITICAL.
2018-07-19 02:27:07 -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
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
Ell d5bc5cad45 app: disallow editing text layers while fonts are loading
We already avoid rendering text layers while fonts are loading,
showing an appropriate message, but this will soon be replaced with
waiting for the fonts to finish loading.

Instead, don't allow the text tool to start at all while the fonts
are loading (showing an appropriate tool message, and a BAD cursor
modifier), and halt the tool when reloading fonts if it's already
started.
2018-05-29 16:04:28 -04:00
Michael Natterer f3f61379f7 app: remove the option to enable tearoff menus 2018-05-20 21:06:35 +02:00
Michael Natterer bdbec7941c Use the new macros from the last commit in all files
...and gone are the annoying warnings.
2018-05-20 21:06:34 +02:00
Ell 6be0bb1358 app: always set text-tool image when starting the editor
In GimpTextTool, when starting the editor in response to a button
press, always set the text tool's image first, so that the style
editor picks the correct resolution for the text-size entry.
Currently the image is only set when clicking inside the active
drawable's bounds.
2018-05-01 17:08:23 -04:00
Michael Natterer 8d54476457 Bug 795493 - Warning when removing a text layer
In gimp_text_tool_connect(), when auto-removing empty text layers upon
text layer or tool change, make sure we don't try to remove a layer
that has already been removed, which can happen if this function is
reached *because* somehow the layer was removed externally (e.g. by
the user in the layers dialog).
2018-04-24 02:49:03 +02:00
Michael Natterer 822a7228c4 Bug 794221 - Recently used colors on text don't get added to the color history
Add signal GimpTextBuffer::color-applied which is emitted when text is
inserted or when color is applied to a span of text.

In GimpTextTool, connect to the signal and update the global color
history.

Unrelated: rename gimp_text_tag_get_color() to get_fg_color() and add
boolean return values to get_fg_color() and get_fg_color() which
indicates if a color is set on the tag at all. This ended up unneeded
in the fix but is an improvement regardless.
2018-03-23 14:19:01 +01:00
Michael Natterer a5e1dd84fd app: implement GimpToolActiveModifiers in GimpTool
Change gimp_tool_set_active_modifier_state() to honor the new
GimpToolControlSetting. Explicitly set the mode to SEPARATE in
all tools that require modifier keys during a stroke.

And here comes the actual fix: change GimpTransformTool and
GimpToolTransformGrid to use SAME mode, and remove their
active_modifer_key() and hover_modifier() impls, so it makes no
difference whether a modifier is pressed before of after mouse button
press/release.
2017-10-29 16:42:53 +01:00
Michael Natterer 0cb3e75f79 app: use a lot of g_clear_object() and g_clear_pointer()
More than 2000 lines of code less in app/, instead of

if (instance->member)
  {
    g_object_unref/g_free/g_whatever (instance->member);
    instance->member = NULL;
  }

we now simply use

g_clear_object/pointer (&instance->member);
2017-07-15 18:42:44 +02:00
Michael Natterer a223ba8f40 Bug 707745 - Selected text is hard to read in the text tool's on-canvas editor
Change the text selection to draw an outline around each selected
glyph. It looks just as ugly as before but at least keeps the text
readable regardless of its color.
2017-07-13 12:34:54 +02:00
Michael Natterer 26b9e7a357 app: set better status title strings in crop, text, rectangle select 2017-06-29 20:38:04 +02:00
Michael Natterer f1a93f87b2 app: some cleanup in GimpTextTool
Only real change: don't set "highlight" on GimpTextOptions, it doesn't
exist any longer.
2017-06-28 19:39:52 +02:00
Michael Natterer 4ebec35a77 app: port GimpTextTool to GimpToolRectangle 2017-06-28 15:40:38 +02:00
Michael Natterer a72026820f app: rename gimpimage-pick-layer.[ch] to gimpimage-pick-item.[ch] 2017-06-22 08:17:40 +02:00
Michael Natterer dda54c1df8 Deprecate stock items for good and change all icon defines to GIMP_ICON_*
Try to sort all GIMP_ICON_* defines into FDO categories like in
https://specifications.freedesktop.org/icon-naming-spec/latest/ar01s04.html

Add defines for all icons we override, rename some icons to their FDO
standard names, and mark the ones we duplicate with a comment so we
don't forget to rename those to standard names in 3.0.
2017-03-05 16:01:59 +01:00
Michael Natterer 7da7bab09c app: get rid of icons in dialog buttons (use labels not stock IDs)
Nobody has them anymore, and they are deprecated in GTK+ 3.x. This
also fixes all conflicting mnemonics except those I missed, but we can
fix them now.
2017-02-12 16:18:54 +01:00
Michael Natterer 2e63533602 app: add GimpDockContainer::get_dialog_factory()
and use it where possible instead of gimp_dialog_factory_get_singleton().
Also reduce using this function in some other places.
2016-11-25 13:26:08 +01:00
Jehan 3e85121eb9 Bug 774733 - segmentation fault when discarding text information.
Always check pointer before dereferencing it, when it can be NULL.
2016-11-21 20:42:56 +01:00
Michael Natterer 4df9a1d568 Get rid of gtk_misc_set_alignment(label) and use gtk_label_set_x,yalign() 2016-09-08 19:11:20 +02:00
Massimo Valentini 1e07de1858 app: remove empty text layer when it becomes inactive
only if auto_rename is TRUE and text->box_mode is not
FIXED
2016-06-27 16:48:19 +02:00
Jehan acc570d929 app: code reorganization in gimptexttool.c.
Since commit b593462, gimp_text_tool_apply() is a semi-public function
(only to be used from gimptexttool-editor.c). Therefore move it to the
"public functions" section.
2016-06-05 21:06:29 +02:00
Jehan b5934625de Bug 751333 - Crash when moving cursor with ibus "Hangul" input method.
Commit cd147a4 reintroduced the crash. The culprit was the idle function
gimp_text_tool_apply_idle() which may not have been processed when
gimp_text_tool_move_cursor() is called, resulting in inconsistencies
between the text in the text tool's pango layout and its buffer.
Force any pending text commits to be applied before moving the cursor.
2016-06-05 21:04:18 +02:00
Michael Natterer cd147a4a48 app: fix various undo- and preedit-related text tool issues
In the text tool editor code, connect to GtkIMContext::preedit-start
and introduce a boolean text_tool->preedit_active which indicates that
a preedit is going on.

Remove the new preedit-removal code from gimp_text_tool_reset_im_context()
because it was not reflecting the IM's internal state and made things
worse. Instead, added gimp_text_tool_abort_im_context() which really
gets rid of any ongoing preedit by force.

In the main text tool code, check for preedit_active and if TRUE,
apply any edits directly widhout pushing undo steps. Factored out
gimp_text_tool_apply_list() for that purpose in order not do
duplicate a lot of code.

On undo and on button_press, force-abort any ongoing preedit. This is
the right thing to do on undo, but not really on button_press, but I
don't see another way to keep states consistent.
2016-06-05 16:36:56 +02:00
Michael Natterer 2ef8719cbe app: rename more stuff from "floating sel" to "floating selection" 2016-05-20 16:46:26 +02:00
Jehan 0fcfd4f7b7 Bug 751333 - Crash when moving cursor with ibus "Hangul" input method...
... and improve input method UI. IM should not use some floating overlay
frame to display the preedit text. Instead it is now directly inserted
into the text tool box, as selected text. It permits redimensionning of
the text box while typing, and push the rest of the text when inserting
in the middle (instead of superimposing an overlay box over the current
text box, making everything unreadable).
Input methods still have a few more issues, but this fixes the main UI
weirdness as well as the crash with Hangul IM.
2016-04-16 14:24:54 +01:00
Michael Natterer 47ef3be145 Initialize GValues with G_VALUE_INIT instead of { 0, } 2016-03-26 15:59:26 +01:00
Michael Natterer 22fc50c279 app: rename all values of enum GimpContextPropMask
from GIMP_CONTEXT_FOO_MASK to GIMP_CONTEXT_PROP_MASK_FOO.
Also rename the FIRST and LAST values of enum GimpContextPropType.
2015-09-08 21:18:49 +02:00
Kristian Rietveld cea42c73d8 app: fix implicit enum casting
Silences clang.
2015-01-10 00:02:28 +01:00