Commit graph

55 commits

Author SHA1 Message Date
bunnie
10a1c72f35 refactor graphics-server to use new blitstr2 crate 2025-02-17 18:25:18 +08:00
bunnie
043dfd84ae update formatting to latest nightly rules 2024-09-24 01:49:45 +08:00
bunnie
921be1cf8b add bounds checking to a TextView string length
Before xous-ipc's fixed-length string guaranteed this thing
fit into a single page. Now, we can send potentially unbounded
amounts of text between servers.

I don't think it makes sense to send more than a few k of text to
render on the screen at once, given our screen sizes, so I've added
a patch that truncates the text to the previous length that things
would truncate to.

The behavior is the same as before, except that you will
over-allocate memory on the heap in the sending process
as you shove more string data into a TextView than can be rendered.
Previously, the TextView would just truncate the data and discard
the data.

The truncation happens at the point where you try to hand the
record off to another process, so, one could in theory try
to make this recoverable by adding a layer that splits the
textview into more manageable chunks or pages the data, but that
is an exercise for another day.
2024-09-23 17:35:27 +08:00
bunnie
1b0fa6e04b regex search/replace instances of xous_ipc::String to String 2024-09-22 14:24:49 +08:00
bunnie
f1e04f189c format services/graphics-server 2024-01-14 22:13:56 +08:00
bunnie
e2594a3000 fix visibility of default font 2023-10-20 00:39:03 +08:00
bunnie
006530a1f5 make the default style for the text box something API-level accessible
this allows other functions to lay out based on the default style
without having to guess it.
2023-10-19 22:39:06 +08:00
bunnie
2d13e7c2a7 implement an underlying graphics primitive for a busy bar animation
This is just the TextView primitive with a "state" variable added
that controls how far the strips should march across the screen.

Users can specify with or without a bounding box.

The exact location of the text within the bar depends on the
BoundingBox option picked.

The primitive computes the total region to animate based upon
the typesetting engine's output. Thus it is not recommended
to "compress" the amount of whitespace allocated to the animation,
because it can cause the animation to have artifacts due to
whitespace overflow of typesetting.
2023-10-16 14:25:47 +08:00
bunnie
ec3fc70a66 rework the font rendering engine and style macros to support Tall
this reworks the necessary routines on the font rendering engine
and within the style selection macros to support the new Tall font.
2023-07-05 13:37:41 +08:00
Jean-Pierre De Jesus DIAZ
136aec042b
services/graphics-server: Implement From instead of Into
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2022-10-12 15:38:40 +02:00
nworbnhoj
29925a5caa implement Dither adaptor iterator 2022-06-28 07:31:18 +10:00
bunnie
7eac66b373 add centered text layout modes
top-aligned has been tested. bottom aligned has yet to be tested.
2022-06-17 19:15:02 +08:00
bunnie
116015dff8 fixups and debug 2022-05-27 22:45:23 +08:00
bunnie
a8e7809087 fixup feature fest 2022-05-27 17:41:22 +08:00
bunnie
7d020182d4 integrate ditherpunk as a feature 2022-05-27 17:28:15 +08:00
nworbnhoj
345659be44 replace cast with try_into in graphics-server api shapes 2022-05-22 10:30:05 +10:00
nworbnhoj
7f66291a38 implement Image modal
Now you can:
let mut input = std::env::current_dir().unwrap();
input.push("../services/modals/src/tests/bunny.png");
let img = Img::<RGB<u8>>::load(&input).unwrap();
modals.show_image(img).expect("image failed");
2022-05-21 06:42:27 +10:00
nworbnhoj
61d6a4b853 implement graphics-server Tile 2022-05-18 18:27:30 +10:00
bunnie
5452fae33c harmonize blitstr2 and graphics-server to an i16 pixel representation
previously blitstr2 is using usize for x/y coords, which means that
for layout purposes points could not go to the top or left boundary
without causing arithmetic overflow. Of course, you want to render
everything on-screen, but, as we have multi-line text with overflow
possibility, it's reasonable to be able to use negative coordinates
to locate text boxes that flow into the visible region.

This of course means that occassionally you can come out with
things like "negative widths", but even then, there can be reasonable
uses for this as an intermediate in calculations that ultimately
arrive at a positive result.
2022-03-28 23:17:18 +08:00
bunnie
2b46f21ae8 remove dependency on blitstr v1 entirely 2022-01-23 04:08:32 +08:00
bunnie
0cafd10e28 refactor status bar to take advantage of the new fonts 2022-01-22 18:25:39 +08:00
bunnie
9455f11ff1 incorporate 2x blitstr fonts and sizes; fix some corner cases 2022-01-21 17:28:23 +08:00
bunnie
7277b7bc1d start to refactor out the old blitstr v1 apis 2022-01-21 15:01:56 +08:00
bunnie
13b7d73ce9 word wrapping seems to work and is tested now. 2022-01-21 02:30:58 +08:00
bunnie
a46c07b4be initial attempt to integrate blitstr2
this just grafts in the new crate, while leaving the old crate
unscathed. once this is somewhat functional we'll excise the old
crate and reformat the loader for the "hard binary" image of
the fonts.
2022-01-19 03:29:53 +08:00
Sean Cross
88b63916e4 graphics-server: run rustfmt
Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-16 22:52:06 +08:00
bunnie
1a65cd3389 password dialog box basic layout is kind of there
a little ugly, but...this has already taken too long.
2021-07-27 04:40:12 +08:00
bunnie
62c9737bbc tenuous addition of a menu object
things don't crash, but...haven't really validated if they work, either!
2021-06-18 04:10:41 +08:00
Sean Cross
fdce58d06e ipc: convert project to use xous-ipc
This rewrites the entire project so that most runnable projects now use
`xous-ipc` instead of `xous::String` where possible.

This also removes `rkyv` from the list of dependencies in `xous-rs`.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-26 20:22:33 +08:00
bunnie
db5e56fd1a futzing with structures to try and figure out a threading issue 2021-03-18 16:21:43 +08:00
bunnie
d68e3e8cf4 an attempt to refactor to rkyv 0.4.1
unfortunately, it looks like deserialize requires an alloc??
2021-03-16 02:02:53 +08:00
bunnie
685f36af41 commit that shows the bug fixed 2021-03-11 22:35:57 +08:00
bunnie
307df04e8b a commit that exhibits the string bug 2021-03-11 22:33:57 +08:00
bunnie
d2ef03b7e2 intermediate commit to try and lock in a bug 2021-03-11 22:32:05 +08:00
bunnie
443e4a1444 remove draw_order from TextView
We can't support this anyways, because the textviews are
immediately drawn on call by the calling app
2021-03-11 18:52:10 +08:00
bunnie
a9a7ac435f add support for rounded rectangle text bubbles and dynamic sizing
this makes more more natural chat-style text bubble interactions
2021-03-10 00:25:14 +08:00
bunnie
a4a96c9c56 add ellpsis support to textview 2021-03-09 02:23:49 +08:00
bunnie
f495b40fd8 insertion/deletion of text with back/forward buttons working now 2021-03-07 03:43:46 +08:00
bunnie
49d6018e5e new feature: backspace (*gasp* iknowrite?)
harder than it looks with utf8 and variable-width characters
2021-03-06 19:37:22 +08:00
bunnie
0cc1f9f5fb it doesn't look that impressive, but there's a lot of plumbing now. 2021-03-06 01:10:18 +08:00
bunnie
5d1fba4015 fix intersects algorithm
"duh"
2021-03-05 17:15:14 +08:00
bunnie
470abb3e7d fix rectangle intersection missing case 2021-03-05 00:56:22 +08:00
bunnie
313f12acbb clean up warnings 2021-03-03 22:38:20 +08:00
bunnie
5917ff4664 add object drawing to the GAM abstraction layer 2021-03-01 04:01:33 +08:00
bunnie
bee1f796ee add rounded rectangle drawing 2021-03-01 01:49:22 +08:00
bunnie
6528bc77d4 refactor GAM to use rkyv 2021-02-19 04:02:29 +08:00
bunnie
c5e6391e22 remove mention of Sendable and the ipc.rs module 2021-02-18 02:01:11 +08:00
Sean Cross
f962be1f3c services: graphics: text: fix unused import warnings
Signed-off-by: Sean Cross <sean@xobs.io>
2021-02-17 20:51:59 +08:00
bunnie
af012c48dc getting a little further with the port, but still crashing on a borrow message 2021-02-15 04:42:30 +08:00
bunnie
75cd321175 great usize extinction event - graphics-server 2021-01-22 00:33:49 +08:00