1
0
forked from vitrine/wmaker

Define WAppIcon struct in Rust.

This commit is contained in:
2025-09-09 22:41:10 -04:00
parent 54bd69680a
commit 02d638d1c6
5 changed files with 45 additions and 2 deletions

View File

@@ -7,4 +7,5 @@ edition = "2024"
crate-type = ["staticlib"]
[dependencies]
libc = "0.2"
x11 = "2.21.0"

View File

@@ -1,6 +1,40 @@
use std::ffi::c_void;
use std::ffi::{c_char, c_int, c_short};
pub type AppIcon = c_void;
#[repr(C)]
pub struct AppIcon {
xindex: c_short,
yindex: c_short,
next: *mut AppIcon,
prev: *mut AppIcon,
icon: *mut crate::icon::Icon,
x_pos: c_int,
y_pos: c_int,
command: *mut c_char,
dnd_command: *mut c_char,
paste_command: *mut c_char,
wm_class: *mut c_char,
wm_instance: *mut c_char,
pid: libc::pid_t,
main_window: x11::xlib::Window,
dock: *mut crate::dock::Dock,
panel: *mut crate::app_settings_panel::AppSettingsPanel,
docked: c_int,
omnipresent: c_int,
attracted: c_int,
launched: c_int,
running: c_int,
relaunching: c_int,
forced_dock: c_int,
auto_launch: c_int,
remote_start: c_int,
updated: c_int,
editing: c_int,
drop_launch: c_int,
paste_launch: c_int,
destroyed: c_int,
buggy_app: c_int,
lock: c_int,
}
pub mod ffi {
use super::AppIcon;

View File

@@ -0,0 +1,3 @@
use std::ffi::c_void;
pub type AppSettingsPanel = c_void;

View File

@@ -1,3 +1,7 @@
use std::ffi::c_void;
pub type Dock = c_void;
pub mod ffi {
unsafe extern "C" {
pub fn wDockFinishLaunch(app_icon: *mut crate::app_icon::AppIcon);

View File

@@ -1,6 +1,7 @@
pub mod application;
pub mod app_icon;
pub mod app_menu;
pub mod app_settings_panel;
pub mod defaults;
pub mod dock;
pub mod global;