/// FFI declarations for the window-manager C runtime (`wm_*` bindings).
///
/// The raw `webview.h` bindings (handle type, bind/unbind, background thread,
/// string copy, return and terminate) live in the smaller
/// `lepus-apps/lepus/webview/ffi/webview_sys` package, imported here as
/// `@webview_sys`.
///
/// Ownership rules (moonbit-c-binding skill):
///   #borrow(param) — C only reads the value during the call, does not store it.
///   #owned(param)  — ownership transfers to C; C must moonbit_decref when done.
/// Primitives (Int, Int64, Bool, …) are passed by value — no annotation needed.
///
/// see: https://github.com/webview/webview/blob/master/webview.h

///|
/// Set managed window size.
pub extern "C" fn wm_set_size(
  window_id : Int,
  width : Int,
  height : Int,
  hints : SizeHint,
) -> Int = "moonbit_wm_set_size"

///|
/// Apply native custom-window style flags (Tauri-2 `WindowConfig` aligned).
///
/// `mask` carries one presence bit per option (see the `wm_set_bit_*` helpers
/// in `window_manager.mbt`): a set bit means "the caller supplied this value,
/// apply it", a clear bit means "leave that native property alone".
/// `mask == 0` is a no-op in C, so callers skip the FFI call entirely when
/// nothing was configured.
pub extern "C" fn wm_set_window_customization(
  window_id : Int,
  mask : Int,
  decorations : Int,
  resizable : Int,
  closeable : Int,
  minimizable : Int,
  maximizable : Int,
  always_on_top : Int,
  always_on_bottom : Int,
  transparent : Int,
  shadow : Int,
  skip_taskbar : Int,
  visible_on_all_workspaces : Int,
  title_bar_style : TitleBarStyle,
  title_bar_overlay : Int,
  hidden_title : Int,
) -> Int = "moonbit_wm_set_window_customization"