Commit Graph

1550 Commits

Author SHA1 Message Date
Hugo Saint-Vignes
ba64458660 [ion/simulator/android] Delete JNI local references
Change-Id: Idd4d6c769786fb595a357bcc3f54e67429ed1840
2021-02-08 10:56:34 +01:00
Hugo Saint-Vignes
73172f8d0c [ion/simulator/android] Add assert, remove TODO
Change-Id: Id818d0cd9a83727171ebe675ee50e35ef64e31d0
2021-02-05 17:51:40 +01:00
Hugo Saint-Vignes
5a20d914df [ion/simulator/android] Fix haptic feedback memory leaks 2021-02-05 17:31:46 +01:00
Hugo Saint-Vignes
05e6fbbcca [ion/simulator/android] Fix haptic feddback type return 2021-02-05 17:31:27 +01:00
Émilie Feral
ed2d5e3b2d [simulator/android] Bump targetSdkVersion 2021-01-07 12:46:43 +01:00
Gabriel Ozouf
71ac56f8a7 [ion/simulator] Update calculator keyboard image
Remove the "sto" from the x^y/sto->/F key, and add the % symbol to the
Backspace key.
2020-12-01 09:37:09 -05:00
Léa Saviot
e00cb91f74 [ion/utf8_helper] Reuse strlen value 2020-11-05 13:23:21 +01:00
Léa Saviot
f96e4e92ce [ion/utf8_helper] Fix bad variable use 2020-11-05 13:23:21 +01:00
Gabriel Ozouf
6f21310e08 [ion/events] Add comment about defaultText method
Change-Id: Ief2b53395a7921d85b116ded935c9dfeb10d08fd
2020-11-04 15:58:38 +01:00
Gabriel Ozouf
993de56d59 [ion/events] Remove method defaultIsDefined
Change-Id: Ic5c057a451bfc49d99f4b2a70ec5dbff16844a86
2020-11-04 15:58:38 +01:00
Gabriel Ozouf
0185e0562c [escher/run_loop] Move kandinksy include
To check whether an ExternalText could be written with Epsilon's fonts,
UTF8Helper made a reference to Kandinsky, which is prohibited. This
check is now done in Escher, before dispatching the event.

Change-Id: I55e9db1ba43c3115775499db47b90a6bdd7cc7b3
2020-11-04 15:58:38 +01:00
Hugo Saint-Vignes
d5e810f2b8 [ion/shared] Remove contexpr array definition in header
Change-Id: I620e977b000ee53c3db97510e666dfda30f4db30
2020-11-04 15:58:38 +01:00
Hugo Saint-Vignes
f789bb156d [ion/keyboard] Fix const const array
Change-Id: I75cfc94ed36493a78bd104f8c4734f2ecd3d042d
2020-11-04 15:58:36 +01:00
Gabriel Ozouf
eb5f4b333a [ion/clipboard] Update comments 2
Change-Id: Ib628a888f6712ad6ea62ccb20192845d19e84986
2020-11-04 15:58:36 +01:00
Gabriel Ozouf
8bb0b47b9f [ion/clipboard] Update comments
Change-Id: I320f8130b7bc897b6e8e3bf7d79cfcda837a9984
2020-11-04 15:58:35 +01:00
Gabriel Ozouf
f66bde6d31 [ion/clipboard] Rework clipboard handling
Change the way the clipboard is fetched, so as to preserve the
Poincare/Python translation feature, and remove the cap on the length of
text being imported into the simulator.

Change-Id: I0f3e83c0c8aa4b64eb08d882aa6891b31f191e22
2020-11-04 15:58:35 +01:00
Gabriel Ozouf
010b474f77 [ion/clipboard] Add support for web simulator
Wrote methods for accessing the system clipboard from the web
simulator, as the methods in SDL_Clipboard do not work when the video
device uses emscripten.

Change-Id: Ib2e66530a6b013eca0cf69fb52372e9e3a21c8bb
2020-11-04 15:58:35 +01:00
Gabriel Ozouf
b9c34ace3a [ion/clipboard] Use system clipboard on simulator
Add methods to interface Epsilon's clipboard with the system's when
running a simulator.
Note that the clipboard still uses a buffer located in the
Escher::Clipboard class, as some features require a buffer to execute
computations on the clipboard's content.

Change-Id: I14c19615805d38735e64d481c617863db22db9bc
2020-11-04 15:58:35 +01:00
Gabriel Ozouf
aadf8f5716 [ion/events] Fix ExternalText buffer size
The size of the ExternalText events shared buffer is now defined as the
size of the SDL_TextInputEvent 'text' field, as it should.
Also fix a wrong parameter being passed to a strlcpy.

Change-Id: I6a57d49d61fec8a009c4711efce564c65544e571
2020-11-04 15:58:29 +01:00
Gabriel Ozouf
b0b6fe33c9 [ion/events] Factor includes of layout_events.h
Change-Id: Id7f68f4dfb4727453a02437a0b824492a8c94730
2020-11-04 15:58:29 +01:00
Gabriel Ozouf
4ea8263185 [ion/simulator/events_keyboard] Serve ExternalText
Generate an ExternalText event when catching a SDL_TextInputEvent whose
text cannot be boiled down to one of the regular events.

Change-Id: I036fa2a153c8351979521d7f8cba6b62aa64604b
2020-11-04 15:58:29 +01:00
Gabriel Ozouf
8181753553 [ion/utf8_helper] Method to check text compliance
Change-Id: I9683a8ba819b1a4aad18bcc4759160509e424d4e
2020-11-04 15:58:29 +01:00
Gabriel Ozouf
96b8e1859a [ion/events] Create event ExternalText
Added an event to represent the typing of text that is not on the
device's keyboard. ExternalText event's text is read from a buffer, that
will be filled when the event is generated.

ExternalText only exists on the simulator.

Change-Id: Ie78d2c7c2de91da986a1ce2130a5ecd123db48ee
2020-11-04 15:58:28 +01:00
Gabriel Ozouf
3a90ed6109 [ion/events_keyboard] Fix selection on long press
A previous fix to prevent AlphaLock from interfering with the long press
feature broke the long press selection. Revert the changes and find
another solution to the previous problem.
We compare the alpha status to both the state of the Alpha key and the
Lock, which makes sense : Lock is supposed to mimic Alpha being
continuously pressed.

Change-Id: I1349eb83f8971d3a5efcb10de020bb6c0aed64a1
2020-11-04 15:58:27 +01:00
Léa Saviot
ad80c2c4d7 [ion/keyboard] Do not define constexpr arrays in headers
They are duplicated in each compilation unit where they are called
2020-11-04 15:33:05 +01:00
Hugo Saint-Vignes
d224778330 [ion/simulator] Temporarly increase stack size on simulator
Change-Id: I0f27277ea704f81e316c7ff78fb7bed8c70ff4ae
2020-11-04 15:33:03 +01:00
Gabriel Ozouf
ab864d10d8 [ion/events] Compare event for repetition
This fixes the following bug :
  (Anywhere with a movable cursor, like a table, a text field or a curve)
  - press Alpha (once, or twice to activate the lock)
  - keep pressing a direction
--> The cursor would only move once.

Change-Id: I46115d1a31ced244615bfdfe08f37dfe7e918d6e
2020-11-04 15:33:03 +01:00
Émilie Feral
7168188a44 [ion] Simulator apple: fix rule_label for assets 2020-11-04 15:33:03 +01:00
Gabriel Ozouf
4d0950fa1e [ion/simulator] Handle typing % on simulator
Change-Id: Ib47786659e710e473f75d1c6887a9794fad0a75f
2020-11-04 15:33:01 +01:00
Gabriel Ozouf
28d18dd6a5 [ion/utf8_helper] Signedness and capitalization
Change-Id: I3451a206fbd45a490eea0115621c07abb868344a
2020-11-04 15:33:00 +01:00
Gabriel Ozouf
67e6e38825 [poincare/parsing] Parse degree sign ° in units
Change-Id: I518aba17214b049dfa8fd3b89f4ce124dbd6b41a
2020-11-04 15:33:00 +01:00
Arthur Camouseigt
8f97a332f6 [Python] Modified the paste effect in script and shell area
When a formula is pasted in a script or in the shell, some symbols are
replaced by their equivalent in python :
x turns into *
^ turns into **
√ turns into sqrt
etc
Change-Id: If6f2a22d4f3c148c2655e0892023b0e28058a9a6
2020-11-04 15:32:59 +01:00
Hugo Saint-Vignes
b92c819ea2 [escher/src/text_area] Add char limit in text_area line
Change-Id: I9284936f0202d788edc785aa3f7c82b45ab34cf5
2020-11-04 15:32:59 +01:00
Hugo Saint-Vignes
688394abce [ion] Set stack pointer when testing as well
Change-Id: Ibeae7961535208c224f9ac51f4cf33e3978665b3
2020-11-04 15:32:58 +01:00
Hugo Saint-Vignes
70a628f2c8 [apps] Fix Python assert crash on malloc free
Change-Id: I48f86422f7d6af5227e2556e6ef531dfad696da4
2020-11-04 15:30:53 +01:00
Hugo Saint-Vignes
d937bc692b [apps/code] Fix crashes on full buffer
Change-Id: If9297f1ca29015cad0cc1cdda3ad610fd1493392
2020-11-04 15:11:45 +01:00
Hugo Saint-Vignes
53e204db3a [liba] Add abs function for int
Change-Id: Ic133ff2f34c7ff24ecbec69d5f31e447a72ae4fe
2020-11-04 15:11:43 +01:00
Hugo Saint-Vignes
433639c471 [ion] Implement dynamic scroll speed profile
Change-Id: Ib3ec2ef63d19bfb88b627f06bcc185fa1b232223
2020-11-04 15:07:19 +01:00
Hugo Saint-Vignes
af32f33141 [ion] Remove unused function and rename longRepetitionScrollSpeed
Change-Id: I11268eb34060c74eb8770ba0eb999f84737c76d8
2020-11-04 14:45:34 +01:00
Hugo Saint-Vignes
b60c67ff88 [apps] Factorize scrolling speed for long repetition
Change-Id: I5fcfaf04e418942664641c4b1cd044cda7f5aebb
2020-11-04 14:45:34 +01:00
Hugo Saint-Vignes
1879eb36d8 [ion/test] Typo Fix
Change-Id: I49d041dea6333a7f7f1a179e2ffcff2391dbaa28
2020-11-04 14:45:34 +01:00
Gabriel Ozouf
e8505d79e7 [ion/device/exam_mode] Fixed missing parentheses in assertion
Change-Id: If10b6ea98ed224d79cfa50f38f9e229331d0f9f9
2020-11-04 14:45:34 +01:00
Gabriel Ozouf
0454b65a94 [ion/device/usb] Fixed missing static member definitions
Change-Id: Iedf6ce51d3213f9265fec247c7bdfda4e3304d3a
2020-11-04 14:45:34 +01:00
Émilie Feral
1f81c97371 [ion] USB::DFU takes an argument specifying if the DFU mode should be
leavable from keyboard
2020-10-27 08:50:05 +01:00
Émilie Feral
2d71e98b52 [ion] n0100 Console: fix pin alternate function 2020-10-27 08:45:41 +01:00
Émilie Feral
17fd1aea29 [ion] Haptics implementation are on all simulators but
Ion::Haptics::isEnabled is per platform.
2020-09-30 17:30:34 +02:00
Émilie Feral
0c0510599d [ion] Simulator: haptics feedback are only implemented on Android and
depends on the System settings
2020-09-30 17:30:34 +02:00
Émilie Feral
9786db308a [ion] Haptics events don't depend on SCREEN_ONLY 2020-09-30 17:30:34 +02:00
Émilie Feral
979c227d54 [ion] web: improve key highlight positions 2020-09-30 17:30:34 +02:00
Émilie Feral
595532e0a5 [ion] Remove useless variables 2020-09-30 17:30:34 +02:00