Commit Graph

794 Commits

Author SHA1 Message Date
Dorota Czaplejewicz 3f598086b7 Store preferred output 2022-01-30 12:43:17 +00:00
Dorota Czaplejewicz 3b0b8bea0d Save outputs state 2022-01-28 15:26:22 +00:00
Cosmin Humeniuc ba00ec86a1 Add Romanian layout 2022-01-27 20:42:17 +02:00
Dorota Czaplejewicz f15f97d4c9 outputs: Handle removal
Currrently, Squeekboard doesn't do anything with this information.

It still expects one output to be present, or it will crash.
2022-01-26 15:19:58 +00:00
Dorota Czaplejewicz d3eb68ed5a outputs: Notify the state manager about changes 2022-01-26 15:19:58 +00:00
Dorota Czaplejewicz 14a485deba outputs: Clean up for more Rust usage 2022-01-26 15:19:58 +00:00
Dorota Czaplejewicz 236f7d4daf ffi: Remove unnecessary pointers to InputMethod
InputMethod is already a pointer.
2022-01-26 15:19:58 +00:00
Dorota Czaplejewicz f4f44a49ae wayland: Move initialization to the Rust side
This will help make the init procedure safer, by limiting the number of Rust objects that need to be carried to the C side and may be mangled on the way there.

The second benefit is that it allows outputs to become part of new state management.
2022-01-26 15:19:58 +00:00
Dorota Czaplejewicz 1b72cbdfaa docstrings: Clarify the purpose of Receiver 2022-01-26 15:19:58 +00:00
Dorota Czaplejewicz ff3f7228b5 cleanup: Remove unused header lines 2022-01-26 15:19:58 +00:00
dcz 71768e27c0 Merge branch 'noreg' into 'master'
ci: Use bookworm image

See merge request World/Phosh/squeekboard!510
2022-01-19 16:49:21 +00:00
Dorota Czaplejewicz 8eb1c9b4a7 build: Remove regex crate 2021-12-17 14:04:22 +00:00
Dorota Czaplejewicz 3d60dd96af Revert "util: Add ArcWrapped"
This reverts commit 5c1b28e4ed8b046a251609e5f7db4b4df9e710f5.

It has only been needed to move Rust structure across C bridges. That's unneeded with more integration.
2021-12-12 12:49:12 +00:00
Dorota Czaplejewicz 4cc7017e1c event_loop: Separate and use for physical keyboard presence
Extra included: Change of naked Submission pointers to Wrapped.
2021-12-12 12:49:11 +00:00
Dorota Czaplejewicz 53137fd2e2 state: Connect the animation state machine to the rest
This ensures that the new state machine is fed events, as well as that its results are applied.

The old ad-hoc system is removed.

There is one regression where the last layout will be used when the panel is brought up manually.
2021-12-12 12:48:06 +00:00
Dorota Czaplejewicz 334504a5b2 animation: Prototype a way of handling state and applying it separately
Handling visibility state ad-hoc has shortcomings in testability and locality, and this module attmepts to rectify that by creating an explicit state machine, along with a loop to drive it.

Actually applying state is not implemented here.
2021-12-12 12:48:06 +00:00
Dorota Czaplejewicz f5a1d379ca util: Add ArcWrapped
This structure is necessary to wrap Send data structures which are actually moved between threads.
2021-12-12 12:48:06 +00:00
Dorota Czaplejewicz d64b8cdf1a submission: Wrap the structure in a safe wrapper 2021-12-09 12:43:36 +00:00
Dorota Czaplejewicz 81948425d8 popover: Fix reentrancy problem
Calling popover.show() returns control to the main loop, but squeekboard structures are still borrowed meanwhile. That's dangerous and forbidden in Rust. Therefore, this forces the return from the stack and release of the borrows before the glib main loop is invoked again.
2021-12-09 12:41:58 +00:00
Guido Günther 750814e050 Drop locale_config
Not used anymore.
2021-12-09 11:29:48 +01:00
Guido Günther 10ea276052 Drop custom translation handling
xkb layouts are translated fine by libgnome-desktop. If not
we should go fixing there since that makes keyboard layout
strings consistent with e.g. gnome-control-center.

There weren't any 'exotic' strings in the current translations
so what we get from libgnome-desktop should be just fine.
2021-12-09 11:29:48 +01:00
Guido Günther 72a7825c85 popover: Don't complain about missing translations
It's fine to do all via po.
2021-12-08 15:29:57 +01:00
Guido Günther da789bcb87 Remove emoji and terminal from translations
Handled via po. Remove now empty files. The match with resources.rs
shows that some of them weren't even used (e.g. fa-IR) showing why a
switch to po is useful (which allows to maintain us that outside of
code).
2021-12-08 15:29:57 +01:00
Guido Günther 2aa9cf26ee popover: Make the ui file match the code file name
UI files are usually named like the code file. Stick to that
pattern.
2021-12-08 15:29:57 +01:00
Guido Günther 9b7e065b0f popover: Move Emoji and Terminal to ui file
This allows them to be translated via po so we don't have to maintain
the translation list by hand or care about empty translation files.

The only downside is that the "overlay layouts" in OVERLAY_NAMES need to
match the ones in the ui file but since a missing one is a clean crash
when selected there's little potential for subtle breackage. We could
even ensure consistency by comparing the two at run time but they change
only slowly this is not much of an issue (compared to how e.g. new
languages can be added now).
2021-12-08 15:27:17 +01:00
dcz e776bf005e Merge branch 'email-and-url-variant' into 'master'
Add URL and email variants for US layout

Closes #65

See merge request World/Phosh/squeekboard!495
2021-12-08 11:52:17 +00:00
Guido Günther 12cf628c71 Add URL and EMail keyboard variants for us
Closes: #65
2021-12-05 21:26:44 +01:00
Guido Günther 16dd4f9753 server-context-servide: Don't translate application name 2021-12-05 21:04:43 +01:00
dcz 5054f4c9de Merge branch 'pin-keyboard' into 'master'
Use special pin keyboard

See merge request World/Phosh/squeekboard!492
2021-12-05 18:23:35 +00:00
dcz 6eb3914ab3 Merge branch 'po' into 'master'
Add initial po support

Closes #315

See merge request World/Phosh/squeekboard!497
2021-12-05 18:02:55 +00:00
Guido Günther 4903f3d1a0 layout: Keep content purpose around
This allows to add proper CSS style classes based on that
2021-12-05 17:31:12 +01:00
Guido Günther 3513bf8de4 Use special pin keyboard
This helps muscle memory
2021-12-05 17:31:12 +01:00
Guido Günther 5f40c31cab layout: Drop trailing whitespace
Otherwise sane editor setup is basically impossible since
we want to trim that by default (and not manually like here)
in the future.
2021-12-05 17:31:12 +01:00
Guido Günther 964f1da305 Initialize gettext 2021-12-03 18:58:12 +01:00
Guido Günther 06b17907bf imservice: Invoke eekboard_context_service_set_hint_purpose unconditionally
Since eekboard_context_service_set_hint_purpose() checks if the
hint or purpose changed this doesn't cause unwanted layout reloads.

Closes: #311
2021-12-02 09:19:50 +01:00
dcz 9fbb974ce4 Merge branch 'have-more-fun-developing-squeekboard' into 'master'
main: Add debug flags to always show squeekboard on start and to activate GTK inspector

See merge request World/Phosh/squeekboard!485
2021-11-30 14:16:08 +00:00
Guido Günther 0d7fab2ef4 Honor input-purpose PIN
Otherwise e.g. SIM pins are requested with a numerical keyboard.
2021-11-30 13:29:11 +01:00
Arnaud Ferraris f225a34d70 resources: add wide FR terminal keyboard
The layout for this keyboard exists, however it isn't present in
`resources.rs`, making it unavailable.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2021-11-23 14:17:52 +01:00
Guido Günther 03aa04d6d8 main: Add debug flag to show GTK inspector
Since squeekboard doesn't ever get input focus and hence we can't
activate it via keybinding add a debug flag.
2021-11-23 11:36:37 +01:00
Guido Günther 1c875cda6c main: Add debug flag to always show squeekboard on start
This makes debugging way fun since there's no need to mess
with the running DBus, gsettings or anything else.
2021-11-22 17:10:43 +01:00
Guido Günther c3337b05b6 main: Use dark theme when run in a Phosh session
Downstreams either don't restyle making us divert from the designs or
use squeekboard-restyled adding extra complexity.

Closes: #242
2021-11-22 11:02:10 +01:00
Guido Günther 28a48635b3 main: Avoid two error variables in the same function
This also fixes a superfluous additional `NULL` assignment right
after declaring error and setting it to NULL.
2021-11-22 11:01:06 +01:00
Guido Günther 475761ec73 main: Drop broken support G_BUS_TYPE_SYSTEM
Fliping opt_system would still use opt_session so drop that.
While at that remove G_BUS_TYPE_NONE which can't be set by
an option either.
2021-11-22 11:01:06 +01:00
Guido Günther 359376041d main: Honor --help and -h
Use a GOptionContext to display command line options (that are already
handled by e.g. gtk_init anyway).

This turns:

  $ squeekboard -h
  Debug: Tried file "/home/agx/.local/share/squeekboard/keyboards/us.yaml", but it's missing: No such file or directory (os error 2)
  Info: Loaded layout Resource: us
  Debug: Tried file "/home/agx/.local/share/squeekboard/keyboards/us.yaml", but it's missing: No such file or directory (os error 2)
  Info: Loaded layout Resource: us

** (squeekboard:8015): WARNING **: 19:03:13.125: DBus unavailable, unclear how to continue. Is Squeekboard already running?

into the more useful

  $ squeekboard -h
  Usage:
    squeekboard [OPTION…] - A on screen keyboard

  Help Options:
    -h, --help               Show help options
    --help-all               Show all help options
    --help-gtk               Show GTK+ Options

  Application Options:
    --display=DISPLAY        X display to use

...
2021-11-21 20:45:58 +01:00
Guido Günther 6e1faafa2f main: Remove trailing whitespace 2021-11-21 20:37:51 +01:00
dcz 5d6a9556ae Merge branch 'keyboard-layout-armenian' into 'master'
armenian typewriter and phonetic keyboards.

See merge request World/Phosh/squeekboard!478
2021-11-19 18:27:54 +00:00
Dorota Czaplejewicz dc7e84810b dbus: Hint that maybe squeekboard is running
It seems that is Squeekboard is already running, the next instance will not fail to acquire a bus name, but instead lose it immediately. This message has been reported by users who experiment with Squeekboard for the first time, so let's make it easier for them to find the solution without having to reach out.
2021-10-31 14:39:43 +00:00
Norayr Chilingarian 9f8df6f8cb armenian layout also added to meson.build etc. 2021-10-26 04:39:53 +04:00
Dorota Czaplejewicz 5db16f63ea Merge remote-tracking branch 'petrisch/master' into HEAD 2021-08-19 11:58:17 +00:00
Patrick Jörg cce1f6b817 Added ch_wide 2021-06-27 19:04:07 +02:00