wip: refactor into crates

This commit is contained in:
🪞👃🪞 2024-08-03 21:55:38 +03:00
parent 96e17e7f7c
commit 5ae99b4ada
87 changed files with 2281 additions and 2217 deletions

37
crates/suil/src/gtk.rs Normal file
View file

@ -0,0 +1,37 @@
struct SuilX11Wrapper {
socket: GtkSocket,
plug: GtkPlug,
wrapper: SuilWrapper,
instance: SuilInstance,
idle_iface: LV2UI_Idle_Interface,
idle_id: usize,
idle_ms: usize,
idle_size_req_id: usize,
initial_width: usize,
initial_height: usize,
req_width: usize,
req_height: usize,
}
struct SuilX11WrapperClass {
parent_class: GtkSocketClass,
}
impl SuilX11Wrapper {
fn x_window_is_valid (&self) {
let window: GdkWindow = gtk_widget_get_window(self.plug);
let root: X11Window = Some(0);
let parent: X11Window = Some(0);
let children: [X11Window] = None;
let child_count: usize = 0;
x_query_tree(window.xdisplay, window.xid, root, parent, children, &mut childcount);
for i in 0..child_count {
if children[i] == self.instance.ui_widget {
x_free(children);
return true;
}
}
x_free(children);
return false;
}
}