Commit Graph
100 Commits
Author SHA1 Message Date
Alec Murphy a322c06850 Everywhere: Give stbtt its own 32MB static memory pool
At boot time, we preallocate 32MB of RAM to reuse for all malloc()
requests by stbtt_RenderText(), which should be more than enough for the
primary use case (browsing web pages).
2025-04-19 21:01:14 -04:00
Alec Murphy b40820272f System/Setup/Environment+FFI/LibC: Increase calloc/malloc mem_tasks
Give LibC malloc() and calloc() an array of 16 mem_tasks each, for now.
We will probably be removing this, in favor of giving each non-HolyC
library its own static memory pool, as we will do with stb_truetype.h in
a forthcoming commit.
2025-04-19 20:33:30 -04:00
Alec Murphy b7cab3b419 System/Libraries/Html/Renderer: Use renderer->task instead of erythros_mem_task where applicable 2025-04-19 16:28:14 -04:00
Alec Murphy d56a092dde System/FFI/LibC: Use Round-robin mem_task selection for calloc 2025-04-19 16:26:09 -04:00
Alec Murphy 15926654f8 System/Core/Compositor: Show available TrueType fonts in system log 2025-04-19 16:07:17 -04:00
Alec Murphy b9eb4cb874 System/Libraries/Graphics2D: Alloc c2d wrapper functions off of Adam task's code heap 2025-04-19 16:00:21 -04:00
Alec Murphy bf3112bdd6 Applications/Internet/Cyberia: Initialize status2 (hover) label with empty string 2025-04-19 15:57:10 -04:00
Alec Murphy 9550f24f73 System/Core/Compositor: Set TrueType font defaults from global config 2025-04-19 14:34:14 -04:00
Alec Murphy dbc6976380 Meta: Update Settings/config.json 2025-04-19 14:33:42 -04:00
Alec Murphy a15de6eb33 System/Libraries/Graphics2D: Update @get_truetype_text_width() to use @stbtt_GetTextWidth() 2025-04-19 14:18:15 -04:00
Alec Murphy 80f691385a System/Utilities/TrueType: Add @stbtt_GetTextWidth() 2025-04-19 14:17:46 -04:00
Alec Murphy 546fd54a62 System/Libraries/Graphics2D: Update @get_truetype_text_width() to include advance 2025-04-19 10:42:26 -04:00
Alec Murphy 78ba717732 System/Utilities/TrueType: Update stbtt_RenderText() API to include advance 2025-04-19 10:41:55 -04:00
Alec Murphy 33b795fa93 System/Libraries/String: Add StrLenI32() 2025-04-19 10:41:11 -04:00
Alec Murphy c54cd6ea51 System: Use Settings/config.json for debug options 2025-04-19 08:13:58 -04:00
Alec Murphy 3448acac38 System/Setup/Environment: Remove duplicate erythros_mem_task 2025-04-19 07:54:42 -04:00
Alec Murphy c214ba9552 Meta: clang-format 20 2025-04-19 07:54:18 -04:00
Alec Murphy 3e1007ca21 Meta: Update .gitignore 2025-04-19 07:36:54 -04:00
Alec Murphy 186b2d3ded src/openlibm: rm object files 2025-04-19 07:34:56 -04:00
Alec Murphy e7d8b456aa Everywhere: Update to clang-format 20 2025-04-19 07:31:54 -04:00
Alec Murphy 402d802d2f System/Libraries/Html/Renderer: Set text underline height to 2px 2025-04-16 19:43:18 -04:00
Alec Murphy f0a72aeaa5 Applications/Internet/Cyberia: Add hanbaga menu boilerplate
Not functional yet, just laying the foundation.
2025-04-16 18:56:17 -04:00
Alec Murphy d9e4c186e4 Applications/Internet/Cyberia: Press Enter to submit form with only one input element 2025-04-16 18:55:37 -04:00
Alec Murphy 5192ae34ec System/Libraries/Html/Renderer: Set focus is autofocus attribute is present 2025-04-16 18:21:31 -04:00
Alec Murphy 5ea8809a34 System/Libraries/Html/Tokenizer: Support empty attributes 2025-04-16 18:04:54 -04:00
Alec Murphy ebfaa0254c Applications/Internet/Cyberia.app: Initial support for FORM method=get
Now we can search with simple engines like Wiby and FrogFind.
2025-04-16 15:03:59 -04:00
Alec Murphy 4ef542cf32 System/Libraries/Html/Renderer: Keep track of form element widgets
Save a pointer to the corresponding Gui widget for each form element as
an attribute in the @html_dom_node.

I'm not a fan of doing this, but it is probably one of the better
options considering the way things are currently implemented, and the
remaining work to be done.
2025-04-16 14:57:33 -04:00
Alec Murphy 34a5985cf0 Meta: Update Default.css 2025-04-16 14:56:46 -04:00
Alec Murphy 99268200f4 System/Libraries/Html/Renderer: Fix BGR/RGB flip in background
This is no longer needed and breaks things, so let's revert it.
2025-04-16 14:55:31 -04:00
Alec Murphy 24500f52a3 System/Libraries/(Css,Graphics2D,Html): Support underlined text
This commit adds the necessary functions to minimally implement support
for CSS text-decoration: underline.
2025-04-16 14:53:16 -04:00
Alec Murphy 622c35e038 System/Libraries/Html/Renderer: Apply CSS and HTML Element attribute width/height values to form elements 2025-04-16 10:36:51 -04:00
Alec Murphy e60ffee006 System/Libraries/Html/Renderer: Unset node->display_block based on CSS value 2025-04-16 10:19:50 -04:00
Alec Murphy e3d6121fe3 System/Libraries/Css/Tokenizer: Include single/double quoted tokens in CSS value 2025-04-16 10:09:29 -04:00
Alec Murphy 58f2243bf1 System/Core/Compositor: Update defaults for TrueType fonts 2025-04-15 16:22:12 -04:00
Alec Murphy 0a579a4f09 System/Libraries/Html/Renderer: Handle italic/oblique text 2025-04-15 16:21:52 -04:00
Alec Murphy 97187728e8 System/Libraries/Html/Tokenizer: Add italic property to @html_dom_node 2025-04-15 16:21:07 -04:00
Alec Murphy 3b83397e60 System/Libraries/Html/Renderer: Render STRONG 2025-04-15 15:35:20 -04:00
Alec Murphy 60606317b2 System/Libraries/Html/Renderer: Render LI ordered/unordered items 2025-04-15 15:34:54 -04:00
Alec Murphy 0b381bf119 Meta: Update Default.css 2025-04-15 15:33:22 -04:00
Alec Murphy 49b1e82e55 System/Core/Compositor: Update defaults for TrueType fonts 2025-04-15 11:54:53 -04:00
Alec Murphy 2f73813694 Applications/Internet/Cyberia: Remove initial CSS testing values 2025-04-15 11:53:34 -04:00
Alec Murphy d6ff8beb9f System/Libraries/Html/Renderer: Initial support for CSS font-weight 2025-04-15 11:52:43 -04:00
Alec Murphy d60fc53798 System/Libraries/Graphics2D: Chop 16px off X2 max pos in @get_truetype_text_width()
This is a quick and dirty hack to compensate for artifacts at the far
right edge of the font rasterization buffer. Chopping off 16px allows us
to get the proper width of the rasterized text.
2025-04-15 11:45:47 -04:00
Alec Murphy 0d303b0134 System/Libraries/Html/Tokenizer: Add fontWeight property to @html_dom_node 2025-04-15 11:28:07 -04:00
Alec Murphy 06813f3524 Meta: Update Default.css 2025-04-15 11:27:43 -04:00
Alec Murphy ae42db0be5 System/Libraries/Html/Renderer: Implement some CSS default rules 2025-04-15 10:40:28 -04:00
Alec Murphy def7d53101 System/Libraries/Html/Renderer: Increase background_ctx to max size before fill() 2025-04-15 10:03:04 -04:00
Alec Murphy dfb73f029c Applications/Internet/Cyberia: Create background ctx and fill #ffffff when a new Renderer is created 2025-04-15 07:50:11 -04:00
Alec Murphy c998d040ed System/Libraries/Html/Renderer: Create background_ctx for each HtmlRenderer instance 2025-04-14 21:16:04 -04:00
Alec Murphy b57101b9f2 Applications/Internet/Cyberia: Initial support for history items
Just a simple back/fwd navigation for browsing, for now.
2025-04-14 20:45:15 -04:00
Alec Murphy 26e88ffd52 Media/Themes/Umami/Theme: Handle ButtonWidget disabled status 2025-04-14 20:42:51 -04:00
Alec Murphy f2a078e1d5 Media/Themes/Umami: Add disabled icons for back, forward, reload 2025-04-14 20:42:17 -04:00
Alec Murphy b5d27214a1 System/Libraries/Widget: Add disabled_image property to ButtonWidget class 2025-04-14 20:41:28 -04:00
Alec Murphy 96e0009173 System/Libraries/Gui: Add disabled property to Widget class 2025-04-14 20:41:03 -04:00
Alec Murphy b30759c12e System/Libraries/Html/Renderer: Always return DEFAULT_FAVICON instead of NULL 2025-04-14 17:26:22 -04:00
Alec Murphy 100b54a9cd Applications/Internet/Cyberia: Delta scroll by line 2025-04-14 16:53:08 -04:00
Alec Murphy d17e79315e Applications/Internet/Cyberia: Initial favicon support 2025-04-14 16:50:50 -04:00
Alec Murphy 10309b6b18 System/Libraries/Html/Renderer: Initial favicon support
This only supports RGBx color depths at the moment, but it's good enough
for most modern sites.
2025-04-14 16:45:51 -04:00
Alec Murphy 02cbb32459 Applications/Internet/Cyberia: Handle vscroll a bit better
The entire scroll handling needs to be rewritten, but that is a project
for another day...
2025-04-14 10:55:20 -04:00
Alec Murphy 6532218883 System/Libraries/Html/Renderer: Handle node->textAlign a bit better
Just a few QoL tweaks for now, until we properly handle CSS, layout,
and everything else.
2025-04-14 10:53:05 -04:00
Alec Murphy 72d626c0f1 Meta: Update scripts/build-all 2025-04-14 10:34:37 -04:00
Alec Murphy dd86ef6a44 Meta: Add some layout debugging stuff 2025-04-13 14:40:44 -04:00
Alec Murphy 08313be27f System/Libraries/Html/Renderer: Refactor @render_node_list 2025-04-13 14:39:24 -04:00
Alec Murphy 3a55fce26a Meta: Update scripts/build-all 2025-04-13 06:35:07 -04:00
Alec Murphy 7ae844cf9a Meta: Update .gitignore 2025-04-13 05:57:35 -04:00
Alec Murphy ce80c184e7 Meta: Debug stuff 2025-04-12 20:19:59 -04:00
Alec Murphy fc0c98ee2b System/Libraries/Html/Renderer: Add debug options 2025-04-12 20:12:43 -04:00
Alec Murphy 9e0668d0e0 System/Libraries/Html/Renderer: Initial support for node->textAlign
This only works for very simple cases, but it is enough for centering
and right-align text on sites like Wiby, and a centered Google logo. :^)
2025-04-12 19:57:49 -04:00
Alec Murphy e8bc19b444 System/Libraries/Html/Renderer: Fix an oopsie woopsie (advance by code point, rather than byte) 2025-04-12 18:48:58 -04:00
Alec Murphy d068f46bc6 Meta: Remove debugging stuff 2025-04-12 18:26:43 -04:00
Alec Murphy 3201b187ec System/Api/Dns: Remove some old Slon debugging stuff that breaks Catbox DNS lookup 2025-04-12 18:16:29 -04:00
Alec Murphy df0adc0a15 Everywhere: Changes to @html_dom_node and TrueType API
CSS properties fontFamily and fontSize are part of @html_dom_node now,
and the TrueType API only accepts I32 code point streams, so we have
to preprocess UTF-8 streams before rendering text.
2025-04-12 18:09:26 -04:00
Alec Murphy bef1c78c5d System/Utilities/TrueType: Change pointer type to I32* for @stbtt_RenderText() 2025-04-12 18:04:40 -04:00
Alec Murphy b01e1171a3 System/Core/Compositor: Set defaults for TrueType font categories 2025-04-12 16:23:51 -04:00
Alec Murphy 6b09ccabb6 System/Libraries/Html: Add fontFamily attribute to @html_dom_node 2025-04-11 20:11:25 -04:00
Alec Murphy 8143d59620 System/Libraries/Css/Tokenizer: Split values on comma 2025-04-11 20:10:52 -04:00
Alec Murphy 6a394f8a86 Applications/Internet/Cyberia: Set default colors for root node
Until we have a default style sheet implemented, set the default colors
to black text on white background for the root node, so that we don't
end up with unreadable black bars everywhere.
2025-04-11 17:23:01 -04:00
Alec Murphy 603e1d15ab System/Libraries/Html/Renderer: Apply bgcolor/color element attribute values to CSS 2025-04-11 17:22:29 -04:00
Alec Murphy 17910faac2 System/Libraries/Html/Renderer: Match rules in accordance with CSS Specificity 2025-04-11 16:58:48 -04:00
Alec Murphy 3e8d126fbe System/Libraries/Html/Renderer: Add NULL check to @reflow_node_list() 2025-04-10 19:48:11 -04:00
Alec Murphy 61c287f446 Applications/Internet/Cyberia: Echo window mouse wheel events
Now, we can (kind of) scroll the page from anywhere in the viewport :^)
2025-04-10 19:37:23 -04:00
Alec Murphy 7878e28027 Applications/Internet/Cyberia: Fully resolve URLs in redirect 2025-04-10 15:41:02 -04:00
Alec Murphy e3c7350a96 Applications/Internet/Cyberia: Familiarize address bar onclick behavior
We match the following address bar behavior from Chrome and Firefox:

- When the address bar is clicked, select all text on mouse up if no
  selection currently exists.

- On address bar blur, clear the selection.
2025-04-10 15:11:40 -04:00
Alec Murphy c45b862b2b System/Libraries/Html/Renderer: Render INPUT type=checkbox 2025-04-10 14:49:35 -04:00
Alec Murphy 4992c222d7 System/Libraries/Html/Renderer: Render INPUT type=password 2025-04-10 11:41:13 -04:00
Alec Murphy 42e4f89b8b System/Libraries/Html/Renderer: Render INPUT type=text 2025-04-10 11:35:43 -04:00
Alec Murphy 5fb71f80ca System/Libraries/Widget: Eager repaint on widget->SetText() unless otherwise specified 2025-04-10 10:58:30 -04:00
Alec Murphy d3048f31e5 Applications/Internet/Cyberia: Add web browser
This is the initial commit of the Cyberia web browser, Html and Css
libraries.
2025-04-10 10:51:59 -04:00
Alec Murphy 3545113247 System/Libraries/Gui: Add data attribute to Widget class 2025-04-10 10:47:37 -04:00
Alec Murphy 86190d4576 System/Core/Compositor: Hold F12 to display debug info 2025-04-10 10:08:38 -04:00
Alec Murphy 3e85af48d6 Meta: Cleanup removed files 2025-04-10 10:05:54 -04:00
Alec Murphy 96226e6211 System/Libraries/Ipc: Add msg->timestamp to IpcMessage class 2025-04-10 08:37:57 -04:00
Alec Murphy 4fa0873123 Include/Gui: Set GUI_EVENT_WIN_REPAINT_TIMEOUT to 100ms
If an Ipc Message that will trigger a window repaint is received by a
Client, and the message is older than GUI_EVENT_WIN_REPAINT_TIMEOUT,
discard the repaint request.
2025-04-10 08:30:16 -04:00
Alec Murphy ebacbeafca System/Core/Compositor: Update menubar title in @compositor_refresh(win) 2025-04-10 08:28:49 -04:00
Alec Murphy c4f25e63c1 Applications/OS/TaskSwitcher: NULL check for win->close() keypress callback 2025-04-10 08:27:36 -04:00
Alec Murphy e0d6102d60 Include/Gui: Add @gui_event_loop_handle_msg() to event loop
At the moment, this implementation may look a bit unnecessarily verbose,
but eventually it will allow us to be more specific in our message
handling.
2025-04-09 09:09:37 -04:00
Alec Murphy d242f5c395 Media/Themes/Umami/Theme: Separate focus/hover logic from repaint
We shouldn't be doing this in the Theme routines to begin with, but
that's another issue altogether.
2025-04-09 09:07:50 -04:00
Alec Murphy 940e7b230c System/Libraries/Gui: Add Bool explicit_repaint to Window class 2025-04-09 09:03:18 -04:00
Alec Murphy 2b8092f418 System/Libraries/Graphics2D: Add @get_truetype_text_width() 2025-04-09 08:59:06 -04:00
Alec Murphy 5f10e5f86d Applications/Accessories/Calculator: Debounce numerical input
The Calculator isn't functional yet, but when it eventually does work,
it will be helpful to not duplicate every number keypress when the
result input widget is focused. :^)
2025-04-09 08:52:23 -04:00