REFERENCE

C API

195 entries · Page 1 of 2

  1. kui_devtools_dispatch_command

    Execute a NUL-terminated CDP JSON command directly on the main thread and copy its JSON response. A short response buffer is truncated and reports the required length. Calling again executes the command again, so account for side effects.

  2. kui_devtools_dispatch_key_event

    Inject a key-down, key-up, or character event into the focused element on the main thread only. key is the semantic name, code is an optional physical code, text supplies character input, and is_auto_repeat marks a held-key repeat.

  3. kui_devtools_dispatch_mouse_event

    Inject a mouse move, press, release, or wheel event into a document on the main thread only. Coordinates are viewport-relative CSS pixels. Modifier bits are Alt=1, Ctrl=2, Meta=4, Shift=8; deltas apply to wheel events only.

  4. kui_devtools_get_box_model

    Query the box model of the element matching a selector on the main thread only. Write 32 floats: eight each for content, padding, border, and margin, plus width and height in CSS pixels. No match returns NOT_FOUND.

  5. kui_document_add_stylesheet

    Add CSS stylesheet source to the document; call on the main thread. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  6. kui_document_body

    Get a counted reference to the document body element and release it when done.

  7. kui_document_clear_stylesheets

    Clear document stylesheets; call on the main thread.

  8. kui_document_create

    Create a standalone document and return one counted reference to release when done. This does not attach the document to a window.

  9. kui_document_create_element

    Create a document element by tag name and return a counted reference to release. Creation does not itself insert it into the DOM. Call on the main thread. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  10. kui_document_custom_element_is_defined

    Check whether a tag is defined in the document custom element registry. Returns NOT_SUPPORTED when the registry is unavailable.

  11. kui_document_define_custom_element

    Define a custom element tag and connected, disconnected, and observed-attribute callbacks on the main thread. Observed attribute names are copied during registration. Callback elements and text are borrowed; retain the element or copy text before keeping them. Returns NOT_SUPPORTED without a registry.

  12. kui_document_extension_get_perf_stats

    Read an extension last, maximum, and total tick/paint times and invocation counts by tag name. Time fields are milliseconds. Returns NOT_SUPPORTED without an extension manager.

  13. kui_document_extension_invoke

    Invoke a target extension element method on the main thread with typed arguments and a maximum result count. Release the returned result handle; inspect it separately for the extension invocation status. A missing extension manager returns NOT_SUPPORTED.

  14. kui_document_extension_is_loaded

    Check whether the document has loaded a DOM element extension for a tag name. Returns NOT_SUPPORTED when no extension manager is available.

  15. kui_document_extension_reset_perf_stats

    Reset performance statistics in the document extension manager. Returns NOT_SUPPORTED without an extension manager.

  16. kui_document_get_element_by_id

    Find a document element by ID. The caller must release the returned element reference; lookup results follow the same reference-counting rule as constructors. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  17. kui_document_head

    Get a counted reference to the document head element and release it when done.

  18. kui_document_init_extensions

    Initialize document DOM element extensions from a directory on the main thread and optionally report the loaded count. Returns NOT_SUPPORTED when the extension manager is unavailable. This uses the kuiext element extension protocol.

  19. kui_document_load_html

    Load document content from an HTML source string; DOM mutation must run on the main thread. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  20. kui_document_load_html_file

    Load an HTML document from the supplied file path; DOM mutation must run on the main thread. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  21. kui_document_print_to_pdf

    Write a document to a PDF path on the main thread with metadata, page dimensions in points, font rasterization, and outline options. out_written reports whether writing succeeded. A windowless document temporarily receives a headless rendering backend; unavailable backends return NOT_SUPPORTED.

  22. kui_document_query_selector

    Find the first document element matching a CSS selector; the returned counted reference must be released. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  23. kui_document_query_selector_all

    Find all document elements matching a selector, writing handles into a caller-provided array and reporting the count. Release every element reference actually returned. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  24. kui_document_release

    Drop a document reference; only the last reference destroys the object. NULL is an error, and the released reference must not be used. Reference operations are atomic and safe from any thread.

  25. kui_document_retain

    Add a document reference. Pair each retain with release; reference operations are atomic and safe from any thread.

  26. kui_document_root

    Get a counted reference to the document root element and release it when done.

  27. kui_element_add_event_listener

    Register an event-type listener and return its ID. The callback runs during main-thread dispatch and may mutate the DOM. evt is borrowed only during the callback: never store or release it. The caller manages user_data. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  28. kui_element_append_child

    Append a child element to its parent. The caller still releases its own element references. Mutate the DOM on the main thread.

  29. kui_element_blur

    Blur the element; call on the main thread.

  30. kui_element_child_count

    Read the child-element count, excluding text and other non-element nodes.

  31. kui_element_class_list_add

    Add the supplied token to the class list; call on the main thread. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  32. kui_element_class_list_contains

    Check whether the class list contains the supplied token. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  33. kui_element_class_list_remove

    Remove the supplied token from the class list; call on the main thread. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  34. kui_element_class_list_toggle

    Toggle the presence of the supplied class token; call on the main thread. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  35. kui_element_dispatch_event

    Dispatch a synthetic event at the element through the normal capture/bubble path. The element must be attached to a document or INVALID_ARG is returned. Optional out_not_canceled is 1 if no listener prevents the default. No mouse coordinates or key state are carried. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  36. kui_element_first_child

    Get a counted reference to the first child element, skipping non-element nodes; release it when done.

  37. kui_element_focus

    Focus the element; call on the main thread.

  38. kui_element_get_attribute

    Read the value of the named element attribute. UTF-8 output uses the caller buffer: query with NULL/0, then allocate out_len+1; the length excludes NUL. Insufficient capacity returns BUFFER_TOO_SMALL and the required length; positive capacity still receives a truncated NUL-terminated result. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  39. kui_element_get_bounding_rect

    Read the bounding rectangle of a laid-out element on the main thread, preserving subpixel geometry. A document that has never been laid out may return zero sizes successfully.

  40. kui_element_get_class_name

    Read the element full class-name string. UTF-8 output uses the caller buffer: query with NULL/0, then allocate out_len+1; the length excludes NUL. Insufficient capacity returns BUFFER_TOO_SMALL and the required length; positive capacity still receives a truncated NUL-terminated result.

  41. kui_element_get_client_metrics

    Read client metrics for the padding box: left/top are border widths, and width/height exclude rendered scrollbars. All four values use floor(x+0.5). Individual outputs may be omitted, but not all of them. Read on the main thread after layout; a never-laid-out document may return zero values successfully.

  42. kui_element_get_id

    Read the element ID. UTF-8 output uses the caller buffer: query with NULL/0, then allocate out_len+1; the length excludes NUL. Insufficient capacity returns BUFFER_TOO_SMALL and the required length; positive capacity still receives a truncated NUL-terminated result.

  43. kui_element_get_inner_html

    Read the serialized element innerHTML. UTF-8 output uses the caller buffer: query with NULL/0, then allocate out_len+1; the length excludes NUL. Insufficient capacity returns BUFFER_TOO_SMALL and the required length; positive capacity still receives a truncated NUL-terminated result.

  44. kui_element_get_offset_metrics

    Read border-box position and size relative to the offset parent. All four values use floor(x+0.5); use the bounding rectangle for subpixel geometry. Outputs may be omitted individually, but not all at once. Read on the main thread after layout; a never-laid-out document may return zero values successfully.

  45. kui_element_get_scroll_metrics

    Read the current scroll offsets and full scrollable extent. left/top remain fractional, while width/height use floor(x+0.5). Individual outputs may be omitted, but not all of them. Read on the main thread after layout; a never-laid-out document may return zero values successfully.

  46. kui_element_get_style_property

    Read the serialized value of a property in the element inline declaration. An unset property returns KUI_ERR_NOT_FOUND. color:red may serialize as #ff0000; the output need not match the input text. For UTF-8 output, query the length with NULL/0, then allocate need+1. The length excludes the terminating NUL; a short buffer returns BUFFER_TOO_SMALL and reports the full required length.

  47. kui_element_get_style_property_count

    Count the properties actually set in the element inline declaration for inspection and enumeration.

  48. kui_element_get_style_property_name

    Read an inline declaration property name by index. Enumeration indices may change as soon as the declaration is modified. For UTF-8 output, query the length with NULL/0, then allocate need+1. The length excludes the terminating NUL; a short buffer returns BUFFER_TOO_SMALL and reports the full required length.

  49. kui_element_get_style_text

    Read the serialized text of the complete inline style declaration, corresponding to the style attribute value. For UTF-8 output, query the length with NULL/0, then allocate need+1. The length excludes the terminating NUL; a short buffer returns BUFFER_TOO_SMALL and reports the full required length.

  50. kui_element_get_tag_name

    Read the element tag name. UTF-8 output uses the caller buffer: query with NULL/0, then allocate out_len+1; the length excludes NUL. Insufficient capacity returns BUFFER_TOO_SMALL and the required length; positive capacity still receives a truncated NUL-terminated result.

  51. kui_element_get_text_content

    Read the element textContent. UTF-8 output uses the caller buffer: query with NULL/0, then allocate out_len+1; the length excludes NUL. Insufficient capacity returns BUFFER_TOO_SMALL and the required length; positive capacity still receives a truncated NUL-terminated result.

  52. kui_element_has_attribute

    Check whether the element has the named attribute. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  53. kui_element_last_child

    Get a counted reference to the last child element, skipping non-element nodes; release it when done.

  54. kui_element_next_sibling

    Get a counted reference to the next sibling element, skipping non-element nodes; release it when done.

  55. kui_element_parent

    Get a counted reference to the parent element and release it when done.

  56. kui_element_position_relative_to

    Position an element relative to an anchor on the main thread using placement and optional flip, viewport clamping, offset, and viewport margin settings. Both element handles must be valid.

  57. kui_element_previous_sibling

    Get a counted reference to the previous sibling element, skipping non-element nodes; release it when done.

  58. kui_element_query_selector

    Find the first matching element within this element query scope; release the returned counted reference. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  59. kui_element_query_selector_all

    Find all matching elements within this element query scope, writing to the caller handle array and reporting the count. Release each counted reference actually returned. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  60. kui_element_release

    Release one element reference. Other references can keep an element alive after DOM removal. Release each reference exactly once and do not reuse it; atomic reference operations are safe from any thread.

  61. kui_element_remove

    Remove the element from its DOM tree. Existing handles keep it alive through reference counting. Call on the main thread.

  62. kui_element_remove_attribute

    Remove a named element attribute; call on the main thread. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  63. kui_element_remove_child

    Remove a child from the supplied parent. A missing child returns NOT_FOUND; existing counted references can keep it alive. Call on the main thread.

  64. kui_element_remove_event_listener

    Remove one listener using both event name and listener ID. IDs are scoped by event type, so an ID alone is ambiguous. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  65. kui_element_remove_event_listeners

    Remove every listener registered on the element for the supplied event name. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  66. kui_element_remove_style_property

    Remove one property from the element inline style declaration on the main thread.

  67. kui_element_retain

    Add an extra element reference. Ordinary handle-returning functions already provide one, so they need no extra retain. Pair every retain with release; atomic reference operations are safe from any thread.

  68. kui_element_scroll_by

    Scroll the element by dx/dy; call on the main thread.

  69. kui_element_set_attribute

    Set a named element attribute value; call on the main thread. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  70. kui_element_set_class_name

    Replace the element class-name string; call on the main thread. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  71. kui_element_set_inner_html

    Replace the element innerHTML with HTML source; mutate the DOM on the main thread. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  72. kui_element_set_scroll_position

    Set the element absolute left/top scroll position; call on the main thread.

  73. kui_element_set_style_property

    Set one inline style declaration on the main thread. A nonzero important flag marks it !important. This changes the element own declaration.

  74. kui_element_set_style_text

    Set the complete element inline style declaration from CSS text on the main thread.

  75. kui_element_set_text_content

    Set the element textContent; mutate the DOM on the main thread. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  76. kui_element_style_property_is_important

    Check whether the specified inline declaration is marked !important and return the result as an integer.

  77. kui_event_drag_get_file

    Read a dragged file path by index. Non-drag events or missing DataTransfer return NOT_SUPPORTED; an out-of-range index returns NOT_FOUND. Copy needed information before the event callback ends. For UTF-8 output, query the length with NULL/0, then allocate need+1. The length excludes the terminating NUL; a short buffer returns BUFFER_TOO_SMALL and reports the full required length.

  78. kui_event_drag_get_file_count

    Read the file count in a drag event DataTransfer. A non-drag event or missing DataTransfer returns NOT_SUPPORTED. The event is borrowed only for its callback.

  79. kui_event_get_current_target

    Get a counted reference to the current event target element and release it when done. evt is valid only during the current callback and must not be stored or released.

  80. kui_event_get_flags

    Read the event bubbles, cancelable and defaultPrevented flags. evt is valid only during the current callback and must not be stored or released.

  81. kui_event_get_target

    Get a counted reference to the event target element and release it when done. A non-element target, such as a text node, returns NOT_FOUND. evt is valid only during the current callback and must not be stored or released.

  82. kui_event_get_type

    Read the current event type name. UTF-8 output uses the caller buffer: query with NULL/0, then allocate out_len+1; the length excludes NUL. Insufficient capacity returns BUFFER_TOO_SMALL and the required length; positive capacity still receives a truncated NUL-terminated result. evt is valid only during the current callback and must not be stored or released.

  83. kui_event_get_type_tag

    Read the runtime tag of a borrowed event to distinguish base, mouse, wheel, pointer, keyboard, focus, input, and drag events. Access the event only while its callback remains active.

  84. kui_event_key_get_code

    Read the physical key code of a keyboard event, such as KeyA. Non-keyboard events return KUI_ERR_NOT_SUPPORTED. For UTF-8 output, query the length with NULL/0, then allocate need+1. The length excludes the terminating NUL; a short buffer returns BUFFER_TOO_SMALL and reports the full required length. The event is borrowed only within its callback; do not save or release it.

  85. kui_event_key_get_key

    Read the semantic key name of a keyboard event, such as a, Enter, or ArrowUp. Non-keyboard events return KUI_ERR_NOT_SUPPORTED. For UTF-8 output, query the length with NULL/0, then allocate need+1. The length excludes the terminating NUL; a short buffer returns BUFFER_TOO_SMALL and reports the full required length. The event is borrowed only within its callback; do not save or release it.

  86. kui_event_key_get_modifiers

    Read Ctrl, Shift, Alt, and Meta states from a keyboard event. Unneeded outputs may be NULL. Non-keyboard events return KUI_ERR_NOT_SUPPORTED. The event is borrowed only within its callback; do not save or release it.

  87. kui_event_mouse_get_button

    Read the KuiCMouseButton value of a mouse event. Non-mouse events return KUI_ERR_NOT_SUPPORTED. The event is borrowed for the current callback only; do not retain or release it.

  88. kui_event_mouse_get_client_xy

    Read mouse client coordinates relative to the viewport; a non-mouse event returns NOT_SUPPORTED. evt is valid only during the current callback and must not be stored or released.

  89. kui_event_mouse_get_offset_xy

    Read mouse offset coordinates relative to the target padding box; a non-mouse event returns NOT_SUPPORTED. evt is valid only during the current callback and must not be stored or released.

  90. kui_event_mouse_get_page_xy

    Read mouse page coordinates including scroll offsets; a non-mouse event returns NOT_SUPPORTED. evt is valid only during the current callback and must not be stored or released.

  91. kui_event_prevent_default

    Prevent the default action during the current event callback. evt is valid only during the current callback and must not be stored or released.

  92. kui_event_stop_propagation

    Stop further propagation during the current event callback. evt is valid only during the current callback and must not be stored or released.

  93. kui_extension_result_get_count

    Read the number of values actually returned by an extension invocation for indexed access.

  94. kui_extension_result_get_error

    Read the error text stored in an extension invocation result. For UTF-8 output, query the length with NULL/0, then allocate need+1. The length excludes the terminating NUL; a short buffer returns BUFFER_TOO_SMALL and reports the full required length.

  95. kui_extension_result_get_status

    Read the extension method invocation status code. It is distinct from the KuiStatus returned by the result accessor itself.

  96. kui_extension_result_get_string

    Copy an extension string result by index. An out-of-range index returns NOT_FOUND; a non-string result returns NOT_SUPPORTED. For UTF-8 output, query the length with NULL/0, then allocate need+1. The length excludes the terminating NUL; a short buffer returns BUFFER_TOO_SMALL and reports the full required length.

  97. kui_extension_result_get_value

    Read an extension result type and scalar fields by index. An out-of-range index returns NOT_FOUND. For strings, string_len reports the length and string_value is NULL; copy the text with get_string.

  98. kui_extension_result_release

    Release an extension invocation result handle exactly once. Read any needed values and error text before release.

  99. kui_get_version

    Read the loaded library runtime version, which can differ from the compile-time version macros.

  100. kui_http_client_cancel_all

    Cancel all pending asynchronous requests belonging to this client.

  101. kui_http_client_create

    Create an HTTP client handle for synchronous or asynchronous requests. Release it with kui_http_client_release when finished.

  102. kui_http_client_fetch_async

    Fetch a URL asynchronously and call back on completion. The callback may run on a worker thread and must not mutate the DOM directly. It owns and must release the response handle. Allocation failure may pass NULL; the callback must not throw.

  103. kui_http_client_fetch_sync

    Fetch a URL synchronously, blocking until completion or timeout. Release the returned response handle separately. KUI_OK means the ABI call completed; inspect the response for HTTP status and network errors.

  104. kui_http_client_release

    Release and destroy an HTTP client handle exactly once. Do not start further requests through the released handle.

  105. kui_http_client_set_user_agent

    Set the HTTP client User-Agent string. The UTF-8 pointer must be non-NULL; zero len reads through the NUL terminator.

  106. kui_http_response_get_body

    Copy raw response body bytes, which may contain NUL. Query the required byte count, then allocate need+1 bytes. The current bridge also writes a terminating NUL; the body length excludes that terminator.

  107. kui_http_response_get_content_type

    Read the HTTP response Content-Type string. For UTF-8 output, query the length with NULL/0, then allocate need+1. The length excludes the terminating NUL; a short buffer returns BUFFER_TOO_SMALL and reports the full required length.

  108. kui_http_response_get_error

    Read the HTTP response network error string to inspect and display the reason for a failed request. For UTF-8 output, query the length with NULL/0, then allocate need+1. The length excludes the terminating NUL; a short buffer returns BUFFER_TOO_SMALL and reports the full required length.

  109. kui_http_response_get_status

    Read the HTTP response status code. Check the error text separately for transport failures.

  110. kui_http_response_release

    Release an HTTP response handle exactly once. The caller owns responses returned synchronously and responses received by asynchronous callbacks.

  111. kui_lottie_get_complete

    Query whether a Lottie resource has finished loading as 0 or 1. complete checks LoadState::Complete, not whether playback has ended. Non-Lottie elements return NOT_SUPPORTED.

  112. kui_lottie_get_natural_size

    Read a Lottie animation natural width and height. One output may be omitted, but not both. Non-Lottie elements return NOT_SUPPORTED.

  113. kui_lottie_pause

    Pause animation of a Lottie element on the main thread. Non-Lottie elements return NOT_SUPPORTED.

  114. kui_lottie_play

    Request playback of a Lottie element on the main thread. Non-Lottie elements return NOT_SUPPORTED.

  115. kui_lottie_set_src

    Set a Lottie element source on the main thread. src must be non-NULL; non-Lottie elements return NOT_SUPPORTED.

  116. kui_media_get_current_time

    Read a media element current playback time in seconds. Non-media elements return NOT_SUPPORTED.

  117. kui_media_get_duration

    Read the media resource duration in seconds. Non-media elements return NOT_SUPPORTED.

  118. kui_media_get_muted

    Read whether a media element is muted as 0 or 1. Non-media elements return NOT_SUPPORTED.

  119. kui_media_get_network_state

    Read the integer network-state enum value of a media element. Non-media elements return NOT_SUPPORTED.

  120. kui_media_get_paused

    Read whether a media element is paused as 0 or 1. Non-media elements return NOT_SUPPORTED.

  121. kui_media_get_ready_state

    Read the integer ready-state enum value of a media element. Non-media elements return NOT_SUPPORTED.

  122. kui_media_get_volume

    Read a media element current volume. Non-media elements return NOT_SUPPORTED.

  123. kui_media_is_available

    Query whether media capability is available for a media element, returning 0 or 1. Non-media elements return NOT_SUPPORTED. Availability does not establish successful resource playback.

  124. kui_media_pause

    Pause a media element on the main thread. Non-media elements return NOT_SUPPORTED.

  125. kui_media_play

    Request playback of a media element on the main thread. A non-media element returns NOT_SUPPORTED; actual playback also depends on the media backend and resource state.

  126. kui_media_set_controls

    Set whether a media element displays playback controls on the main thread. A nonzero enabled flag enables them. Non-media elements return NOT_SUPPORTED.

  127. kui_media_set_current_time

    Set a media element playback position in seconds on the main thread. Non-media elements return NOT_SUPPORTED.

  128. kui_media_set_muted

    Set a media element muted state on the main thread. A nonzero muted flag mutes it. Non-media elements return NOT_SUPPORTED.

  129. kui_media_set_src

    Set a media element source on the main thread. src must be non-NULL, and non-media elements return NOT_SUPPORTED.

  130. kui_media_set_volume

    Set a media element volume on the main thread. Non-media elements return NOT_SUPPORTED. Value handling follows the media element implementation.

  131. kui_platform_clear_timer

    Clear a timeout or interval task by timer ID.

  132. kui_platform_get_clipboard_text

    Copy text from the system clipboard into a caller-owned buffer. For UTF-8 output, query the length with NULL/0, then allocate need+1. The length excludes the terminating NUL; a short buffer returns BUFFER_TOO_SMALL and reports the full required length.

  133. kui_platform_get_monitor

    Read a monitor bounds, work area, scale, and primary flag by index. Write its name into a caller-owned UTF-8 buffer. A missing index returns NOT_FOUND. For UTF-8 output, query the length with NULL/0, then allocate need+1. The length excludes the terminating NUL; a short buffer returns BUFFER_TOO_SMALL and reports the full required length.

  134. kui_platform_get_monitor_count

    Read the current monitor count to determine the range for indexed monitor queries.

  135. kui_platform_get_os_name

    Read the current operating system name into a caller-owned buffer. For UTF-8 output, query the length with NULL/0, then allocate need+1. The length excludes the terminating NUL; a short buffer returns BUFFER_TOO_SMALL and reports the full required length.

  136. kui_platform_get_os_version

    Read the current operating system version string into a caller-owned buffer. For UTF-8 output, query the length with NULL/0, then allocate need+1. The length excludes the terminating NUL; a short buffer returns BUFFER_TOO_SMALL and reports the full required length.

  137. kui_platform_get_primary_monitor

    Read the primary monitor bounds, work area, scale and primary flag.

  138. kui_platform_get_primary_monitor_physical_size

    Read the primary monitor physical size. Either width or height may be omitted, but both outputs cannot be NULL.

  139. kui_platform_has_clipboard_text

    Check whether the system clipboard currently contains text and return the result as an integer.

  140. kui_platform_init

    Initialize process-wide platform services before creating GUI windows and running the event loop.

  141. kui_platform_open_file_dialog

    Open a file picker with title, default path, filters, and multiple-selection options. Supply a valid output buffer for this one-shot operation; the header recommends 32768 bytes on Windows. Cancellation returns NOT_FOUND. Do not probe with an empty buffer and then reopen.

  142. kui_platform_poll_events

    Process pending events and return immediately, for embedding in a host that owns its event loop.

  143. kui_platform_quit

    Request that the platform event loop quit with the supplied exit code.

  144. kui_platform_request_idle

    Schedule a callback once when the event loop next becomes idle. It runs on the main thread; KUI does not free user_data.

  145. kui_platform_run

    Run the blocking platform event loop until quit is requested, returning the exit code through the output parameter.

  146. kui_platform_save_file_dialog

    Open a save-file dialog and return the chosen path. Supply a valid output buffer in this one-shot operation; 32768 bytes is recommended on Windows. Cancellation returns NOT_FOUND. The returned path does not itself save file contents.

  147. kui_platform_select_folder_dialog

    Open a folder picker with a title and copy the selected path. Provide a valid buffer for the one-shot operation; 32768 bytes is recommended on Windows. Cancellation returns NOT_FOUND.

  148. kui_platform_set_clipboard_text

    Write UTF-8 text to the system clipboard. text must be non-NULL; a zero len reads through the NUL terminator.

  149. kui_platform_set_f12_devtools_enabled

    Enable or disable the platform behavior that opens DevTools with F12.

  150. kui_platform_set_interval

    Schedule a repeating callback at a millisecond interval and return its ID; clear it explicitly. Callbacks run on the main thread only while the event loop is active. The caller owns user_data and must keep it alive at least until the timer is cleared.