REFERENCE

C API

195 entries · Page 2 of 2

  1. kui_platform_set_timeout

    Schedule a one-shot callback after a millisecond delay and return its timer ID. An active event loop runs it on the main thread. KUI does not free user_data; keep it valid while waiting and during the callback. The timer needs no clearing after it fires.

  2. kui_platform_shutdown

    Shut down platform services after the event loop ends and handles have been released in the standard lifecycle.

  3. kui_platform_wait_events

    Wait for an event or timeout; a negative timeout_seconds waits indefinitely.

  4. kui_script_engine_bind_document

    Bind a document to a script engine on the main thread so scripts can operate on it. Keep the document valid while the binding is used. Returns NOT_SUPPORTED when scripting is disabled.

  5. kui_script_engine_create

    Create a Lua script engine handle to be released with kui_script_engine_release. Returns NOT_SUPPORTED when scripting is disabled in the build or an engine cannot be created.

  6. kui_script_engine_eval

    Evaluate Lua source with an optional source name; NULL uses <eval>. Check out_success for script success and read errors from the caller buffer. Retrying evaluates the source again, so a side-effecting script is not a harmless two-call query. Returns NOT_SUPPORTED when scripting is disabled.

  7. kui_script_engine_execute_scripts

    Execute scripts in the bound document on the main thread. Requires a valid engine and relevant document binding. Returns NOT_SUPPORTED when scripting is disabled.

  8. kui_script_engine_release

    Release and destroy a script engine handle exactly once. Detach any window borrowing the engine and stop further calls before destruction.

  9. kui_script_engine_set_error_handler

    Set a script error callback receiving error text, source, line number, and user_data. A NULL fn clears it. Callback text is temporarily borrowed and must be copied if needed later. Returns NOT_SUPPORTED when scripting is disabled.

  10. kui_script_engine_unbind_document

    Unbind the document from a script engine on the main thread. Returns NOT_SUPPORTED when scripting is disabled.

  11. kui_status_message

    Get a static description of a status code; the result is never NULL, allocates nothing and needs no release. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  12. kui_window_add_event_listener

    Register a named window event listener and optionally receive its ID. A nonzero once flag makes it run once. The callback event is borrowed, valid only during that callback, and must not be released or saved for later.

  13. kui_window_clear_frame_radius

    Clear the explicit window frame radius setting. Requires a valid window handle.

  14. kui_window_close

    Invoke the window close operation; the uniquely owned handle still needs release according to its lifecycle.

  15. kui_window_create

    Create a uniquely owned window from KuiWindowProps. It is already visible on return. Zero-initialize properties for defaults; opacity=0 means 1.0. Hide immediately to configure off-screen. Release the handle exactly once.

  16. kui_window_get_device_pixel_ratio

    Read the window device pixel ratio.

  17. kui_window_get_devtools_port

    Read the listening port of the window DevTools server. Returns NOT_FOUND when that window has no DevTools server.

  18. kui_window_get_devtools_url

    Read the window DevTools connection URL. 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.

  19. kui_window_get_document

    Get a counted reference to the window-owned document and release it when done. This reference can keep the document alive after window release. A window cannot attach an external document.

  20. kui_window_get_native_handle

    Get the borrowed operating-system window identifier: HWND on Windows, NSWindow* on macOS or X11 Window on Linux. This adds no ownership beyond the uniquely owned window.

  21. kui_window_get_position

    Read the window position coordinates.

  22. kui_window_get_size

    Read the window width and height.

  23. kui_window_get_title

    Read the window title. 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.

  24. kui_window_hide

    Hide the specified window.

  25. kui_window_is_maximized

    Read whether the window is maximized.

  26. kui_window_is_minimized

    Read whether the window is minimized.

  27. kui_window_is_visible

    Read whether the window is currently visible.

  28. kui_window_maximize

    Maximize the window.

  29. kui_window_minimize

    Minimize the window.

  30. kui_window_on_resize

    Replace the window resize callback; pass NULL to clear it. The callback receives width, height and user_data.

  31. kui_window_release

    Destroy the uniquely owned window; this is not a reference-count decrement. Call exactly once per window handle. Previously obtained counted document references can keep the document alive.

  32. kui_window_remove_event_listener

    Remove a window listener using its event name and listener ID. The ID must be paired with its event type.

  33. kui_window_remove_event_listeners

    Remove every listener registered under one window event name.

  34. kui_window_resize

    Resize the actual operating-system window width and height.

  35. kui_window_restore

    Restore the window to its normal state.

  36. kui_window_set_always_on_top

    Enable or disable always-on-top behavior for the window.

  37. kui_window_set_frame_radius

    Set the window frame corner radius. The radius must be nonnegative, and window must be a valid uniquely owned window handle.

  38. kui_window_set_frameless_sizeable

    Set whether a frameless window can be resized. window is uniquely owned and must remain valid; it is not a reference-counted object that can be copied and released repeatedly.

  39. kui_window_set_opacity

    Set the window opacity.

  40. kui_window_set_position

    Set the window position coordinates.

  41. kui_window_set_script_engine

    Associate a borrowed script engine with a window on the main thread. NULL detaches it. The window does not take ownership of the handle; keep the engine valid while the window uses it. Returns NOT_SUPPORTED when scripting is disabled.

  42. kui_window_set_title

    Set the window title. Input strings use UTF-8 and explicit byte lengths; length 0 means strlen. Required names, selectors, paths and source text must not be NULL.

  43. kui_window_should_close

    Read the flag indicating whether the window should close.

  44. kui_window_show

    Show the specified window.

  45. kui_window_start_devtools

    Start window DevTools on the supplied port and report whether it started through out_started.