Commit Graph

16 Commits

Author SHA1 Message Date
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 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
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 7ee69c3053 Bug 737583 - Fix static placement of Chinese IME window
Call gtk_im_context_set_cursor_location() whenever we draw the text
tool cursor or start a preedit sequence.
2014-10-03 00:04:24 +02:00
Michael Natterer 852196eb3d app: fix insert and overwrite cursors for RTL text
by using the right function to figure the location of both kinds of
cursors. Also fix crash in my last cursor movement commit: check for
error values returned by pango_layout_move_cursor_visually() and don't
try to move the cursor beyond the buffer boundaries.
2010-10-14 02:45:32 +02:00
Michael Natterer 2934095816 app: use gimp_text_layout_get_offsets()
instead of duplicating GimpTextLayout's positioning logic in two
different incomplete ways. Also gets rid of the unrelated offset
return values of gimp_text_tool_editor_get_cursor_rect().
2010-03-07 00:11:05 +01:00
Michael Natterer ebfbc5a030 app: make sure the style editor moves with the text layer 2010-02-26 02:10:03 +01:00
Michael Natterer 0b4bdc5613 app: add GimpTextBuffer, a GtkTextBuffer subclass
Pull all text buffer utility functions as methods and use
GimpTextBuffer all over the place instead of GtkTextBuffer.
Some actually usefuly features coming soon...
2010-02-25 17:41:10 +01:00
Michael Natterer 97db8b9b42 app: add function gimp_text_tool_editor_get_iter_index()
which returns the byte index at a GtkTextIter, and use it all over the
place.
2010-02-24 00:18:50 +01:00
Michael Natterer b5b6d37742 app: move the entire mouse-selection apparatus to gimptexttool-editor.[ch] 2010-02-20 23:20:18 +01:00
Michael Natterer c91b026384 app: re-add gimp_text_tool_editor_get_text()
Return the entire buffer and use it in even more places than before to
get rid code duplication.
2010-02-20 19:25:07 +01:00
Michael Natterer 4704c18739 app: implement IM preedit using an overlay widget
This has several advantages:

- it's always readable, no matter how sick font/colors are.
- it does not mess up the buffer, which is a model that should not
  contain temporary edit states.
- preediting does not clutter undo.
- it fixes the remaining bugs in the old preediting code because that
  code is completely gone now.
2010-02-20 15:15:53 +01:00
Michael Natterer a8a732f753 app: fix IM context reset
- Reset the IM context in much more situations, like on button_press
  and when the text editor is initialized and halted (pretty much what
  GtkTextView does).
- As a consequence, halt the rectangle text tool after the text tool
  in control() because cancelling the IM preedit might cause a
  re-framing of the layer because it resized.
- pause()/resume() the draw tool around gimp_text_tool_halt() so we
  definitely avoid drawing atrifacts when the text tool is shut down
  in the middle of an IM preedit. That pause/resume pair should have
  been there from the beginning actually.
2010-02-19 20:13:25 +01:00
Michael Natterer 7e3b090c32 app: request and process key_release events
Feed them into the text editor's IM context and into the proxy text
view's key bindings. Fixes input methods (e.g. entering of unicode
sequences seems to work flawlessly now).
2010-02-18 20:50:37 +01:00
Michael Natterer 838f2d567d app: cleanup 2010-02-17 21:39:33 +01:00
Michael Natterer 8f27ec48c6 app: split the text editor code out to a separate file 2010-02-17 21:24:09 +01:00