Commit graph

331 commits

Author SHA1 Message Date
bunnie
fa3f349a0a bump pins as xous-rs has changed 2023-12-01 21:20:01 +08:00
bunnie
d4624124c9
Merge pull request #443 from betrusted-io/chat-status
WIP: Chat status
2023-11-03 13:54:34 +08:00
bunnie
6ab88117f6 bump xous-api-log version & fix version pins 2023-10-31 20:07:28 +08:00
bunnie
d844c4306c reduce size of chat status bar to match status bars above 2023-10-28 22:50:23 +08:00
bunnie
8f549b3031 pick a more "happens to be aesthetic" setting for the XOR op defacing
XOR op should not be usable to create fake security boxes

but it also looks really ugly to have it defaced.

This small tweak makes the XOR function look decent for the initial
purpose of the function (chat status bar wait indicator).

Eventually, this will be a controversial decision, but I'll kick
that down the road.
2023-10-28 22:48:52 +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
4e93e903a3 didn't mean to check in this flag 2023-10-19 17:45:09 +08:00
bunnie
64346522b3 make the vertical stripe smaller relative to the overall height
this ratio should be enough to spoil the XOR effect for any
forging application but small enough that it's not as visually distracting.
2023-10-18 15:08:05 +08:00
bunnie
50ef03e319 alternate XOR pattern for busy-bar
this it to avoid abusing the primitive to create inverted text
(for secure UI elements only). It does degrade from the aesthetics
of a busy bar but it is a computationally efficient way to patch
around the concern.
2023-10-18 14:13:25 +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
d63b5912b1 absorb new xous-rs version 2023-10-10 16:50:00 +08:00
bunnie
83256257e1 bump xous-rs crate to absorb Send derives on Messages
this is necessary for the smoltcp port
2023-10-03 20:54:14 +08:00
bunnie
9f57ad96fd
Merge pull request #408 from nworbnhoj/chat
mtxchat app and chat library
2023-09-19 19:09:56 +08:00
bunnie
478a612c02 commit version bump 2023-09-12 16:25:10 +08:00
Sean Cross
5dfad296ae xous: mark MemoryRange::as_slice and friends as unsafe
Mark `MemoryRange::as_slice()` and `MemoryRange::as_slice_mut()` as
unsafe.

This is due to the fact that not all representable types can be cast to
an arbitrary value. For example, if Process A sends random values to
Process B, then Process B casts the memory to a slice of `bool`, then
any values that are not 0 or 1 are undefined.

Because these functions can leak UB into the program, they are marked as
unsafe.

This patch adds `unsafe {}` blocks to all instances where this function
is called. Additionally, all instances have been checked to verify that
they do not cast to any invalid types -- most use `u8` or `u32`.

Additionally, the long-deprecated `MemoryRange::from_parts()` call was
removed, since that causes UB without being marked as unsafe.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-09-12 10:07:38 +08:00
nworbnhoj
a7d3b34563 Merge branch 'main' into chat 2023-09-08 13:48:45 +10:00
nworbnhoj
6362ff9e4d capture typesetting overflow in ComposedType and pass thru to gam.post_textview() 2023-08-26 03:42:05 +10:00
bunnie
53469a68d0 publish package updates, sync to release tag 2023-08-08 14:35:49 +08:00
bunnie
b127cd093f bump version pins for change to xous-rs 2023-08-03 13:29:39 +08:00
bunnie
51278451a0 update version pins to pull in cramium target 2023-07-19 21:07:56 +08:00
bunnie
dee4871f91 fix truncated "l" in some cases on wide fonts
minimum width should not be truncated to 0 during layout!
2023-07-06 16:15:49 +08:00
bunnie
17fb590d9a fix typsetter overflow check
got the axes inverted. oops.
2023-07-05 15:38:49 +08:00
bunnie
b2c64eb61a aesthetic cleanup; change default font for all modals
I decided to go back on the idea of not changing the modals
and now all modals use the new larger font as well.

This creates issue #396, which I will deal with later once
I have the time to do some more testing. I'm pretty sure
some other dialog boxes are broken now too.
2023-07-05 15:13:38 +08:00
bunnie
4454dffe4e generate loader files for the new font
also sort the font files in alphabetical order now,
instead of relying on arbitrary ordering of os.listdir() :P
2023-07-05 14:44:30 +08:00
bunnie
2f54ae39d4 Merge branch 'fonts' into main 2023-07-05 13:47:26 +08:00
bunnie
dfffa48715 move default system font to gam/src/lib.rs SYSTEM_STYLE
default system font can be statically changed by modifying
the SYSTEM_STYLE constant.

This of course will lead to a request for a dynamically
configurable preference for font size. However, early
on it was decided this is a bad idea. Here's why.

We don't provide for dynamic system-wide font selection
because this adds a lot of complexity to what would otherwise
be static code: this is a deliberate choice to improve code
density and performance. If the system font were dynamically
adjustable, then every character rendered we would potentially
have to query the PDDB for the current system font setting.

The impact of this could be mitigated by caching values but
then what happens when you actually change the font? now
you need a registry to fire messages off to all dependent
crates with cached values to flush their caches and redraw
(or you punt and force a reboot if you change font sizes,
but still, you're creating a dependency on a lot of plumbing
for even the simplest crates).

Plus, with a static font selection, the compiler can take constants
like the font height and compose them with other fitting
parameters into optimized load/stores of borders and spacings
for the static case; if you make it dynamic, all those multiplies,
adds and divides now get pulled into the main rendering loop
and are recomputed all the time. For example, if you have a static
const list of items that need to be rendered, even if the code to
compute the height of the list is written as a for loop, the compiler
will know the list is constant, and the font height is constant,
and it can condense that all into a single number at compile time,
eliminating all the code for the for loop.

If you leave the option open to change that, that entire piece
of code has to be generated and executed even though in practice
nobody changes the parameter.
2023-07-05 13:39:11 +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
bunnie
aab25f2d53 add Tall font face and support for 32x32 bitmaps
Thanks to @samblenny for getting the ball rolling on this.

This commit adds a "tall" font face which is somewhere in betwee
the Regular size (12 pts) and 2x Small size (18 pts). This is
a compromise between text density and readability that has been
missing for some time from the UI.

The 32x32 glyph support is "hacked in", in that an extra flag
has been added to support this special case, rather than either
(a) making the library more generic (e.g. supporting 8x, 16x, 32x, 64x
glyphs) or (b) adding more metadata to the font libraries so that
the bitmap pattern is automatically associated with the font (right
now the parameters are set by hand in blitstr2/fonts.rs).

This is a violation of the "zero, one, many" principle in coding,
but I'm waiving that because (a) 64x glyphs don't make sense on
our system...you're not going to be creating posters and headlines
on this device (ha ha I say this today, tomorrow I will get a PR
for a poster editor app that absolutely needs 64x glyphs) and (b)
the font subsystem is, at least for now, a fairly mature and
well-tested code base so a minor futzing seems more appropriate
than ripping everything out.

The point at which things should be greatly refactored is when
we consider supporting right-to-left scripts or scripts that
require complex ligatures. But I think for now the system as
writ covers 80% of humanity's language needs acceptably
(but not perfectly).
2023-07-05 12:43:44 +08:00
bunnie
4ac979f0ab update pins, again 2023-07-04 11:20:12 +08:00
bunnie
c9f8f2681b update version pins 2023-07-04 11:09:13 +08:00
bunnie
ae1adbfedd fix template to match manual patch-ups on config flags 2023-07-04 10:32:15 +08:00
bunnie
22e0e06625 check in inital artifacts, but leave the system inert
more hacking is necessary before we can really run these scripts
2023-07-04 10:29:43 +08:00
bunnie
952ba18fba commit vesrion pin bumps 2023-06-16 01:30:18 +08:00
Jean-Pierre De Jesus DIAZ
2af737b57e
xous-rs: move LANG variable to locales
This change is made with the intention of making the xous-rs crate a bit
more freestanding without depending on the xtask build system.

Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2023-06-15 18:23:12 +02:00
bunnie
fbe3cb2a3d bump package numbers to absorb PR #388 2023-05-28 15:58:11 +08:00
bunnie
5a2df4432c technical debt: cleanup UTRA package
- make the "base" field no longer public. It is accessible, but only
through an `unsafe` method, because, it is unsafe.
- add accessors to offest/mask fields. Because, it's not at all
unsafe to access these, and it can be useful for bit-ops that are
not part of the generic set of UTRA.
- add Arc to AtomicCSR, and require `std` for AtomicCSR types.
This should not break anything, I checked inside @foundation-devices
keyOS and they don't seem to be using AtomicCSR anywhere.

The Arc makes it a bit safer to clone the AtomicCSR base pointer
and share it between threads, but it will have an impact on performance.
The USB stack (which requires AtomicCSR) was regression testing and the
impact seems minimal.

Recall that the main purpose of AtomicCSR is to provide a CSR accessor
that does not require a mutable reference to the base object. This
can make certain Rust idioms a bit cleaner. We wrap the base accessor
in Arc+Atomic to try and improve the safety of throwing the borrow
checker under the bus, but it's still not perfect because hardware
mutable state can have side-effects within hardware itself that cannot
be modeled or checked by Rust's borrow checker.
2023-05-23 18:11:24 +08:00
bunnie
697d44de3d bump version pins to absorb changes to svd2utra etc. 2023-05-03 23:11:12 +08:00
Sean Cross
6eb6fae061 graphics-server: apply macos patch to fix build
This fixes the build of `graphics-server` on macos.
This is recommended by @bunnie in
https://github.com/betrusted-io/xous-core/issues/373#issuecomment-1526015174

Signed-off-by: Sean Cross <sean@xobs.io>
2023-04-28 00:05:28 +07:00
bunnie
9022fe6827 revert change to patch over macos 2023-04-28 00:31:48 +08:00
yvt
8504b6fc6b fix(graphics-server): convert "never" types
Fixes build failure due to a type mismatch between `Never` and `!`
in `claim_main_thread`.
2023-04-28 01:23:49 +09:00
bunnie
0522cf9c93
Merge pull request #374 from yvt/patch/fix-minifb-on-main-thread
graphics-server: Run `minifb` event loop on main thread
2023-04-28 00:05:23 +08:00
yvt
c9fd805da2 fix(graphics-server): run minifb event loop on main thread
Fixes crashes on macOS.

Some operating systems and GUI frameworks, in particular Cocoa, don't
allow creating an event loop from a thread other than the main thread
(TID 1) and will abort a program on violation.
2023-04-28 00:43:39 +09:00
bunnie
b2475e47ca provide a workaround for #373
I can't test it, but, it basically just takes the code pre #372
and provides it to macos targets.

I think the update() method is ok to just remove, but, if something
doesn't work there that would probably be the root cause.
2023-04-27 23:27:29 +08:00
bunnie
8a574f937f bump for xous-rs version pin update 2023-04-27 22:18:30 +08:00
yvt
e8aba2810a refactor(graphics-server): remove backend::XousDisplay::update
It's no longer necessary because the `minifb` backend now automatically
calls `minifb::Window::update_with_buffer` in a dedicated thread.
2023-04-26 00:13:58 +09:00
yvt
679a1b2b12 fix(graphics-server): call minifb::Window::update_with_buffer continuously in a dedicated thread
This method needs to be called continuously to pump input events. Fixes
massive keyboard input latency in hosted mode.
2023-04-26 00:13:55 +09:00
bunnie
1392fdcf33 bump pins for updated log API 2023-04-16 02:27:37 +08:00
bunnie
849c136b90 bump versions because API crate changed 2023-04-12 23:02:30 +08:00
bunnie
8357ab31a5 bump all pins because utralib got updated 2023-04-09 00:48:35 +08:00