summaryrefslogtreecommitdiff
path: root/src/common/utf8.c
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-13 23:41:31 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-13 23:41:31 +0300
commit76073fe5fad8799e5850805f2f090af2cb62c741 (patch)
tree9658019babe4760a3634bdab4da0731a10e42e68 /src/common/utf8.c
parentdd1775a9927922c14f8679ccbc4d3ca8d5917e20 (diff)
Simplify the public event and CPU API
Applications now need far less ceremony: hello.c is a 20-line loop that handles REFRESH, CLOSE and QUIT and draws into the surface's own pixels. - Fold GEOMETRY, STATE and FOCUS into one WINDOW event carrying size, scale and state; unchanged values send nothing. - Guarantee REFRESH once a window has a size and after every resize, never at size zero. - Merge DROP_HOVER into DROP with over/leave/data actions and give drag and drop actions enums. - Keep event strings valid until the next wait and drop yasl_event_release; empty or failed waits report NONE. - Replace copy-in presentation with a lent pixel buffer: yasl_cpu_pixels and yasl_cpu_present. - Remove yasl_poll_event, yasl_cpu_read_pixels, unused event fields and comments that restated names. - Wayland: resize floating windows in request_size instead of reporting it unsupported, and stop marking new GPU surfaces as Vulkan so yasl_vulkan_create_surface no longer fails with NATIVE_WINDOW_IN_USE. Also includes the in-progress public API refactor that was uncommitted in the tree (removal of the app/loop layer, new surface, GL and Vulkan entry points). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'src/common/utf8.c')
-rw-r--r--src/common/utf8.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/utf8.c b/src/common/utf8.c
index 78a5d8e..2fb737a 100644
--- a/src/common/utf8.c
+++ b/src/common/utf8.c
@@ -11,7 +11,7 @@
#define unlikely(x) __builtin_expect(!!(x), 0)
#endif
-bool yasl_utf8_validate(const char *str, size_t len)
+bool yasl_private_utf8_validate(const char *str, size_t len)
{
if (!str) return len == 0;
const unsigned char *p = (const unsigned char *)str;
@@ -54,7 +54,7 @@ bool yasl_utf8_validate(const char *str, size_t len)
return true;
}
-char *yasl_utf8_from_latin1(const char *str, size_t len, size_t *out_len)
+char *yasl_private_utf8_from_latin1(const char *str, size_t len, size_t *out_len)
{
if (len > (SIZE_MAX - 1) / 2) return NULL;
char *out = malloc(len * 2 + 1);
@@ -73,7 +73,7 @@ char *yasl_utf8_from_latin1(const char *str, size_t len, size_t *out_len)
return out;
}
-char *yasl_utf8_to_latin1(const char *str, size_t *out_len)
+char *yasl_private_utf8_to_latin1(const char *str, size_t *out_len)
{
char *out = malloc(strlen(str) + 1);
if (!out) return NULL;
@@ -94,11 +94,11 @@ char *yasl_utf8_to_latin1(const char *str, size_t *out_len)
return out;
}
-char *yasl_utf8_sanitize_dup(const char *str)
+char *yasl_private_utf8_sanitize_dup(const char *str)
{
if (unlikely(!str)) return NULL;
size_t len = strlen(str);
- if (likely(yasl_utf8_validate(str, len))) {
+ if (likely(yasl_private_utf8_validate(str, len))) {
char *out = malloc(len + 1);
if (unlikely(!out)) return NULL;
memcpy(out, str, len + 1);