Commit Graph

70 Commits

Author SHA1 Message Date
Émilie Feral
8b926612a2 Revert "[ion] Namespace Ion::UTF8Helper and Ion::UTF8Decoder"
This reverts commit 23da0d3f2c.
2019-05-03 16:29:28 +02:00
Émilie Feral
23da0d3f2c [ion] Namespace Ion::UTF8Helper and Ion::UTF8Decoder 2019-04-29 18:01:30 +02:00
Léa Saviot
2d83c2994c [escher] Fix TextArea::handleEventWithText
It did not handle properly a new line (placed the cursor wrongly).
2019-04-12 15:16:52 +02:00
Léa Saviot
b1d18416e8 [escher] Fix buffer choice in TextField::glyphFrameAtPosition 2019-04-12 15:16:52 +02:00
Léa Saviot
7b5636f298 [unicode] Clean decoder use 2019-04-12 15:16:52 +02:00
Léa Saviot
a214bbdc5a [unicode] Use unicode when dealing with chars - Part 2 2019-04-12 15:16:51 +02:00
Léa Saviot
68db4620ba [escher/text_area] Fix rect dirtying after Clear event 2019-04-12 15:16:51 +02:00
Léa Saviot
c9feec7cd7 [unicode] Fix stop condition in TextArea::Text::removeRemainingLine 2019-04-12 15:16:51 +02:00
Léa Saviot
3bc9a390bf [escher/ion] Fix wrong assertions 2019-04-12 15:16:51 +02:00
Léa Saviot
646931b3b5 [text_area] Fix Text::Position use with unicode
A glyph offset is not equivalent to a code point offset since a code
point can be several glyphs long.
2019-04-12 15:16:51 +02:00
Léa Saviot
5be803ac45 [unicode] Fix python area 2019-04-12 15:16:51 +02:00
Léa Saviot
0ebfab773e [escher/ion] Factorize code for removing a code point in text field/area 2019-04-12 15:16:51 +02:00
Léa Saviot
aac78ca32a [escher/ion] Standard methods in UTF8Helper used in text_area
String manipulations need to be done using an UTF8 decoder, but some
manipulations can be optimized if the code points we manipulate are only
one char long. These optimizations are done inside UTF8Helper methods.
2019-04-12 15:16:51 +02:00
Léa Saviot
e6051fae42 [unicode] Methods optimized when code points are one char long 2019-04-12 15:16:51 +02:00
Léa Saviot
7020ecef57 [apps/escher] Rename cursorTextLocation as cursorLocation 2019-04-12 15:16:51 +02:00
Léa Saviot
b6eb663f53 [ion/kandinsky] Move unicode to ion 2019-04-12 15:16:51 +02:00
Léa Saviot
4316f2c29c [escher] Fix text field and text area navigation 2019-04-12 15:16:51 +02:00
Léa Saviot
5142c071df [escher] Fix text inputs so they use UTF8 2019-04-12 15:16:51 +02:00
Léa Saviot
8d759c0b3b [unicode] Use the UTF8Decoder to scan const char * 2019-04-12 15:16:51 +02:00
Léa Saviot
63d7155376 Remove Ion::Charset 2019-04-12 15:16:50 +02:00
Émilie Feral
0a823da78c [escher] Variable box pop-up is handle as Toolbox pop-up by asking
InputEventHandlerDelegate
2018-11-23 12:04:03 +01:00
Émilie Feral
698332c355 [escher] InputTextDelegate and LayoutFieldDelegate don't inherit from
InputTextDelegate to avoid diamond inheritance
2018-11-23 12:04:03 +01:00
Émilie Feral
7778c694d1 [escher] Create an InputEventHandlerDelegate that gives the toolbox to
be used by an InputEventHandler
2018-11-23 12:04:02 +01:00
Émilie Feral
01e433a9f2 [escher] Clean Field and Input class hierarchy:
Class hierarchy:
- InputEventHandler
- TextInput
- EditableField derives from InputEventHandler
- LayoutField, TextField and ExpressioField derives from EditableField
- TextArea and TextField derives from TextInput
2018-11-23 12:04:02 +01:00
Romain Goyet
f8beae3b86 [kandinsky] Move to KDFont 2018-10-11 16:44:02 +02:00
Émilie Feral
466c44781a [escher] Fix buffer overflow in TextArea 2018-10-08 11:56:14 +02:00
Émilie Feral
f8f0813485 [escher] TextInput: get rid of variable-size tables 2018-09-17 17:14:43 +02:00
Romain Goyet
a514f2a6be [escher] TextArea now uses clearRect and drawLine 2018-06-04 16:08:11 +02:00
Romain Goyet
9e4a1c7d54 [escher] TextArea cleanup 2018-06-04 16:08:11 +02:00
Romain Goyet
d2b2705d2d [escher] TextInput doesn't use colors anymore 2018-06-04 16:08:11 +02:00
Léa Saviot
b752ab0389 [escher] Add bool forceCursorRightOfText in handleEventWithText
Change-Id: I9124a1bacfce821fc761ddefc4d8b43de82dbc21
2018-05-17 13:42:20 +02:00
Léa Saviot
0294ebc448 [escher] Fix signed/unsigned int comparison
Change-Id: I72b6dc3f46ee585814a540fc999001e113db0ea1
2018-05-16 17:34:34 +02:00
Léa Saviot
99f6d73e19 [apps/code] Put cursor inside parentheses when inserting function
In Code::VariableBoxController.

Change-Id: Ib129781d46159c017bcb02e97c6667b6084f5b67
2018-05-16 16:00:24 +02:00
Émilie Feral
bb8ab2a42e Merge branch 'saisie-jolie' into master-merge-saisie-jolie 2018-05-16 11:28:07 +02:00
Léa Saviot
40d9fc4c42 [escher] Fix signed/unsigned comparison warning
Change-Id: I3278e2e1a951475f96adae4f0c6ba6b6b52a170e
2018-05-16 11:22:47 +02:00
Léa Saviot
13ae1d2545 [apps/escher/toolbox] handleEventWithText for all responders.
This makes the code in the various toolbox more generic. The arguments
of the text to insert are each replaced by a Ion::Charset::Empty.
These Empty chars are used to create layouts in ExpressionLayoutFields,
and to compute the position of the cursor in other fields, before being
removed.

Change-Id: Ie81c1e394b06fef2ab801ccff919d6550f70ec30
2018-04-23 17:18:48 +02:00
Léa Saviot
c97c1b6231 Remove debug comment.
Change-Id: I2bd6731e8045606fb0132d29e2aea353f0518380
2018-04-16 11:42:32 +02:00
Émilie Feral
aade7cb2fe [escher] Create a class TextInput (from which derived TextField,
TextArea)
2018-03-22 13:12:12 +01:00
Émilie Feral
576caa039f [apps][escher] Add methods 'handleEventWithText' in TextField and
TextArea to fix bug in probability (adding a toolbox text from the
calculations controller)
2018-03-22 13:12:12 +01:00
Émilie Feral
975f54c7b2 [ion] Change events name: Origin->ShiftLeft, End->ShiftRight 2017-12-07 17:42:39 +01:00
Émilie Feral
15610064fa Coverity: fix unitialized pointer fields, out of bounds reads ...
Change-Id: Iae0656ffe667692dfb3bebf9bb7913b5872175c6
2017-12-06 14:50:26 +01:00
Léa Saviot
5bfc482e62 [escher] textArea now returns a bool when inserting text.
Change-Id: I79111148e8e8b30abb24a6aecea0c187dbd7e2f6
2017-11-21 17:37:48 +01:00
Léa Saviot
ce30428306 [escher] TextArea handles Paste event.
Change-Id: I33c0d21093f94edd987d7f4d2f7fd7363a1ee525
2017-11-17 14:05:23 +01:00
Léa Saviot
59c840ef9a [code] Auto-indentation when inserting Toolbox items in scripts.
Change-Id: Id444ab91965999a3d322dee2fa58f73c86aa6992
2017-11-17 14:05:23 +01:00
Léa Saviot
42e6435973 [code] Fixed Script edition cursor bugs.
The scroll is now reloaded when text is inserted or a new line is
entered. When opening a script, the cursor moves to the end of the
script.

Change-Id: I027ea80db485916fc3fc962cfa9e032ca0bbc81e
2017-11-17 11:59:50 +01:00
Léa Saviot
13bf8c2d62 [code] Python toolbox.
Change-Id: I4028b05c662cae04a5ac3af5021f3438bb22dcd0
2017-11-17 11:59:50 +01:00
Léa Saviot
b7baec4a40 [code] Keyboard events translation, for script or command edition.
For instance, the "power" event should insert "**" in the text, not "^".
Added a universal i18n file in apps/code.

Change-Id: I5d067b0c5b86590af95aa98856522d54e42acba6
2017-11-17 11:59:50 +01:00
Léa Saviot
681be23c30 [code] Auto indentation in the script editor.
Change-Id: I7066c41fa53068e6f18a5ad226b5e72f591f02e2
2017-11-17 11:59:50 +01:00
Léa Saviot
fbb5c70339 [code] Cleaned Script and ScriptStore classes, created accordion.h
A Script object now contains its AutoImport marker, its name and its
content. The ScripStore methods have better names and the optimization
is cleaner.

Change-Id: I1b21af2d23f1c9a34f984309512b0c01b2f1c320
2017-11-17 11:59:50 +01:00
Léa Saviot
f3200fe2e9 [code] Program store that uses an accordeon buffer to store the
programs. The user can now add scripts.
A contextual menu displays various options when clicking on a script,
such as editing.

Change-Id: I124a17f7584b0beedb897e8499ca0a1bb6c13cbe
2017-11-17 11:59:50 +01:00