}
}
-pub fn window(title: &str) -> toolkit::UiObject {
+enum WindowType {
+ Standard,
+ SplitView(bool),
+ Sidebar,
+ Simple
+}
+
+fn window_create(title: &str, kind: WindowType) -> toolkit::UiObject {
unsafe {
let str = CString::new(title).unwrap();
- let objptr = ui_window(str.as_ptr());
- return toolkit::UiObject { ptr: objptr };
+
+ let objptr = match kind {
+ WindowType::SplitView(val) => ui_splitview_window(str.as_ptr(), val as c_int),
+ WindowType::Sidebar => ui_sidebar_window(str.as_ptr()),
+ WindowType::Standard => ui_window(str.as_ptr()),
+ WindowType::Simple => ui_simple_window(str.as_ptr())
+ };
+
+ toolkit::UiObject { ptr: objptr }
}
-}
\ No newline at end of file
+}
+
+pub fn window(title: &str) -> toolkit::UiObject {
+ return window_create(title, WindowType::Standard);
+}
+
+pub fn sidebar_window(title: &str) -> toolkit::UiObject {
+ return window_create(title, WindowType::Sidebar);
+}
+
+pub fn splitview_window(title: &str, sidebar: bool) -> toolkit::UiObject {
+ return window_create(title, WindowType::SplitView(sidebar));
+}
+
+pub fn simple_window(title: &str) -> toolkit::UiObject {
+ return window_create(title, WindowType::Simple);
+}
+