CSS text-box
https://fed.brid.gy/r/https://frontendmasters.com/blog/css-text-box/
@jhx Testing my current state in #Xephyr, without any #Xresources loaded, running #fvwm3 with no configuration ....
I guess my "ColorSet" class needs a few more values. Only one flavor of "background color" for the default state (not selected/inactive/hovered) doesn't cut it, e.g. a #TextBox should always stick out ... 🤔
If you expect users to type into textbox, it should appear empty. Do not put your branding in there!
Next step completed, my #TextBox widget now supports mouse input: click, doubleclick and drag 🥳.
Not so nice: With overall more drawing operations, I see #flicker happening more often 😒. Did some research already, it seems with #XRender, the only way to avoid it would be to render to some #pixmap (instead of the window directly) and use #XPresent to get it on the screen? @thomasadam do you know an "easier" way? 🙈
Selections: done. Rendered using a pre-colored src picture using #XRender #composite #glyphs (Still only keyboard input, mouse will be next)
That'll be a lot of work 😎
Started implementing a #TextBox widget. So far only appends what's typed and draws a (non-blinking) cursor at the end 🙈
Ok, I now have my immutable string class, featuring static const initialization and, for dynamically allocated instances, reference counting:
https://github.com/Zirias/xmoji/blob/master/src/bin/xmoji/unistr.h
... plus a mutable variation the intended #TextBox #widget should operate on, offering a "view" on its internal data to optimize passing temporaries:
https://github.com/Zirias/xmoji/blob/master/src/bin/xmoji/unistrbuilder.h
Now, I still can't start implementing this widget. First I have to implement getting #keyboard #input with #xcb. I figured I probably won't need #xkb for my purposes, processing core #X11 events should be enough. Of course this involves holding the keyboard mapping state myself 🤨
I can't use any "xcb-util" stuff as this would interfer with my async model integrating xcb with a generic event loop ... but at least I can read this code to figure out how things are supposed to work:
https://gitlab.freedesktop.org/xorg/lib/libxcb-keysyms/-/blob/master/keysyms/keysyms.c?ref_type=heads
Next thing is working on a #TextBox #widget. This will require, among other things, translating between pixel coordinates and string positions (for selections and drawing a cursor at the correct position).
Of course, #harfbuzz operates on #Unicode codepoints, stored as 32bit unsigned integers. So, yesterday, I started implementing a string class holding the value in both #utf8 and #utf32 and converting between these.
Now I realized this wasn't all to helpful, so I'll start over. What I want is some immutable string class using char32_t internally and offering functions to create mutated clones...
Ein #Issue mit #Friendica, die Höhe der #Textbox betreffend, ist gefixed. Nice. ;)
Jetzt müsste vielleicht noch nerdica.net auf Stand gebracht werden, hüstel...
@ij
Has anyone thought to publish a #website where all the text is #ASCIIArt except whatever #hashtags you want search engines to store and use?
The fun part would be, to view the page correctly a person would need to adjust the width of a #textbox till a sane page emerges. That is, there is no line breaks in the #ascii.
It would seem like a great way to mess with #searchEngines and importantly, #AI systems.