Commit Graph

1575 Commits

Author SHA1 Message Date
Romain Goyet
a4213dcca8 [ion/simulator] Allow "-" to designate stdin 2021-03-03 15:37:48 +01:00
Romain Goyet
2cf6f15dde [ion/simulator] Allow CTRL or GUI for common shortcuts 2021-03-03 15:37:48 +01:00
Romain Goyet
f37008d8d7 [ion/simulator] Ignore empty cli arguments 2021-03-03 15:37:48 +01:00
Romain Goyet
3740e0f135 [ion/simulator] Support headless msleep 2021-03-03 15:37:48 +01:00
Romain Goyet
cb3a6694a5 [ion/simulator/macos] Register the nws file extension 2021-03-03 15:37:48 +01:00
Romain Goyet
cba596dde7 [ion/simulator] Add actions 2021-03-03 15:37:48 +01:00
Romain Goyet
11f2b92e5d [ion/simulator/windows] Add an icon 2021-03-03 15:37:48 +01:00
Romain Goyet
a69fc679a9 [ion/simulator] Add StateFile support 2021-03-03 15:37:48 +01:00
Romain Goyet
f4905c59a2 [ion] Events::Journal has isEmpty 2021-03-03 15:37:47 +01:00
Romain Goyet
22b6990e63 [ion/simulator/android] Get the language directly
Without using the "--language" command-line option
2021-03-03 15:37:47 +01:00
Romain Goyet
09a7b9daca [ion/simulator] Sort the platform functions 2021-03-03 15:37:47 +01:00
Romain Goyet
0116dc2e07 [ion/simulator] Add a runtime "--headless" option
We probably can ditch the static headless version
2021-03-03 15:37:47 +01:00
Romain Goyet
37b8c56b3d [ion/simulator] Clean the callbacks 2021-03-03 15:37:47 +01:00
Romain Goyet
1a4cb3ad37 [ion/simulator] Add a Journal implementation 2021-03-03 15:37:47 +01:00
Romain Goyet
d4984722cf [ion/simulator] Rename the events_platform file 2021-03-03 15:37:47 +01:00
Romain Goyet
cbc3951ab1 [ion] Add an event journal
It's pretty much just two callbacks that one can hook into to get some
events in or out of Ion.

It adds a couple useless checks and pointers to any build and could be
hidden behind a feature flag, but the extra weight is minimal.
2021-03-03 15:37:47 +01:00
Romain Goyet
62aafa7597 [ion] Fix a comment 2021-03-03 15:37:47 +01:00
Romain Goyet
baf8b8cbf0 [ion/simulator] Clean the Keyboard implementation 2021-03-03 15:37:47 +01:00
Romain Goyet
90b25ecf51 [ion] Clean some dummy files 2021-03-03 15:37:47 +01:00
Romain Goyet
d02ce2dd16 [ion] Sort dummy functions
Dummy Ion-level functions should be in the top-level shared folder. And
dummy functions for simulator headers should be in the simulator folder.
2021-03-03 15:37:47 +01:00
Romain Goyet
79985a0199 [ion/simulator] Proper argument parsing 2021-03-03 15:37:47 +01:00
Romain Goyet
f10cd19616 [ion/simulator] Factorize the main function 2021-03-03 15:37:47 +01:00
Romain Goyet
945a7b8d56 [ion/simulator] Add a Window namespace 2021-03-03 15:37:47 +01:00
Romain Goyet
784234690c [ion/simulator] Sort Ion::Timing::msleep implementations 2021-03-03 15:37:47 +01:00
Hugo Saint-Vignes
bef8719ce0 [simulator/android] Handle getSerialNumber exception
Based on SDL commit :
85c1d40792

Change-Id: Ie6810dae48f5944a515ee016f228ecf33edd8fc4
2021-02-08 10:56:34 +01:00
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