Skip to content

Commit c18670a

Browse files
authored
add new apis (#77)
- `setHighContrast` - `setCustomParameters` - `isHighConstrast`
1 parent 2aaf441 commit c18670a

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/c.zig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,14 @@ pub extern fn webui_show_wv(window: usize, content: [*:0]const u8) callconv(.C)
131131
/// @example webui_set_kiosk(my_window, true);
132132
pub extern fn webui_set_kiosk(window: usize, status: bool) callconv(.C) void;
133133

134+
/// @brief Add a user-defined web browser's CLI parameters.
135+
///
136+
/// @param window The window number
137+
/// @param params Command line parameters
138+
///
139+
/// @example webui_set_custom_parameters(myWindow, "--remote-debugging-port=9222");
140+
pub extern fn webui_set_custom_parameters(window: usize, params: [*:0]const u8) callconv(.C) void;
141+
134142
/// @brief Set the window with high-contrast support. Useful when you want to
135143
/// build a better high-contrast theme with CSS.
136144
///

src/webui.zig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,20 @@ pub fn setKiosk(self: webui, status: bool) void {
106106
c.webui_set_kiosk(self.window_handle, status);
107107
}
108108

109+
/// Add a user-defined web browser's CLI parameters.
110+
pub fn setCustomParameters(self: webui, params: [:0]const u8) void {
111+
c.webui_set_custom_parameters(self.window_handle, params.ptr);
112+
}
113+
/// Set the window with high-contrast support. Useful when you want to
114+
/// build a better high-contrast theme with CSS.
115+
pub fn setHighContrast(self: webui, status: bool) void {
116+
c.webui_set_high_contrast(self.window_handle, status);
117+
}
118+
119+
pub fn isHighConstrast() bool {
120+
return c.webui_is_high_contrast();
121+
}
122+
109123
/// Check if a web browser is installed.
110124
pub fn browserExist(browser: Browser) bool {
111125
return c.webui_browser_exist(browser);

0 commit comments

Comments
 (0)