Something went wrong. Try again.
Some shell. slowshell.bushyice.com
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321#![allow(non_camel_case_types)]
use core::ffi::c_void;
pub const SL_PLUGIN_ABI_VERSION: u32 = 4;
pub const SL_PLUGIN_INIT_SYMBOL: &str = "slowshell_plugin_init";pub const SL_PLUGIN_META_SYMBOL: &str = "slowshell_plugin_meta";pub const SL_PLUGIN_SHUTDOWN_SYMBOL: &str = "slowshell_plugin_shutdown";
#[repr(C)]#[derive(Clone, Copy)]pub struct SlStr { pub ptr: *const u8, pub len: usize,}
impl Default for SlStr { fn default() -> Self { Self::EMPTY }}
impl SlStr { pub const EMPTY: SlStr = SlStr { ptr: core::ptr::null(), len: 0, };
pub const fn from_str(s: &str) -> Self { Self { ptr: s.as_ptr(), len: s.len(), } }
pub fn is_empty(&self) -> bool { self.ptr.is_null() || self.len == 0 }
pub unsafe fn as_str(&self) -> Option<&str> { if self.ptr.is_null() { return None; }
unsafe { core::str::from_utf8(core::slice::from_raw_parts(self.ptr, self.len)).ok() } }
pub unsafe fn as_bytes(&self) -> Option<&[u8]> { if self.ptr.is_null() { return None; }
Some(unsafe { core::slice::from_raw_parts(self.ptr, self.len) }) }}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlColor { pub r: f32, pub g: f32, pub b: f32, pub a: f32,}
impl SlColor { pub const TRANSPARENT: SlColor = SlColor { r: 0.0, g: 0.0, b: 0.0, a: 0.0, };}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlBorder { pub width: f32, pub radius: f32, pub color: SlColor,}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlStyle { pub background: SlColor, pub has_background: bool, pub border: SlBorder, pub has_border: bool, pub text_color: SlColor, pub has_text_color: bool,}
pub mod sl_node_kind { pub const ROW: u32 = 0; pub const COLUMN: u32 = 1; pub const ICON: u32 = 2; pub const TEXT: u32 = 3; pub const PROGRESS: u32 = 4; pub const CANVAS: u32 = 5; pub const CONTAINER: u32 = 6; pub const IMAGE: u32 = 7; pub const SCROLLABLE: u32 = 8; pub const TEXT_INPUT: u32 = 9; pub const EVENT_WRAPPER: u32 = 10;}
pub mod sl_animation_kind { pub const NONE: u32 = 0; pub const SLIDE: u32 = 1;}
pub mod sl_animation_easing { pub const LINEAR: u32 = 0; pub const EASE: u32 = 1; pub const EASE_IN: u32 = 2; pub const EASE_OUT: u32 = 3; pub const EASE_IN_OUT: u32 = 4;}
pub mod sl_align { pub const START: u32 = 0; pub const CENTER: u32 = 1; pub const END: u32 = 2; pub const FILL: u32 = 3;}
pub mod sl_length_unit { pub const SHRINK: u32 = 0; pub const FILL: u32 = 1; pub const FIXED: u32 = 2;}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlLength { pub unit: u32, pub value: f32,}
#[repr(C)]#[derive(Clone, Copy)]pub struct SlCanvas { pub width: u32, pub height: u32, pub stride: u32, pub data: *mut u8, pub cache_key: u64,}
impl Default for SlCanvas { fn default() -> Self { Self { width: 0, height: 0, stride: 0, data: core::ptr::null_mut(), cache_key: 0, } }}
pub mod sl_image_source { pub const RAW_RGBA: u32 = 0; pub const ENCODED: u32 = 1; pub const PATH: u32 = 2;}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlImage { pub source: u32, pub data: SlStr, pub width: u32, pub height: u32, pub cache_key: u64,}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlAnimation { pub kind: u32, pub easing: u32, pub duration_ms: u32, pub offset_x: f32, pub offset_y: f32, pub tween: bool,}
#[repr(C)]#[derive(Clone, Copy)]pub struct SlNode { pub kind: u32, pub style: SlStyle, pub padding: [f32; 4], pub spacing: f32, pub align_x: u32, pub align_y: u32, pub children: *const SlNode, pub child_count: usize, pub text: SlStr, pub size: f32, pub value: f32, pub canvas: SlCanvas, pub image: SlImage, pub action: SlStr, pub width: SlLength, pub height: SlLength, pub has_effect: bool, pub effect: [usize; 4], pub animation: SlAnimation, pub classes: SlStr, // input pub id: SlStr, pub placeholder: SlStr, pub secure: bool,
pub report_scroll: bool,}
impl Default for SlNode { fn default() -> Self { Self { kind: sl_node_kind::ROW, style: SlStyle::default(), padding: [0.0; 4], spacing: 0.0, align_x: sl_align::START, align_y: sl_align::START, children: core::ptr::null(), child_count: 0, text: SlStr::EMPTY, size: 0.0, value: 0.0, canvas: SlCanvas::default(), image: SlImage::default(), action: SlStr::EMPTY, width: SlLength::default(), height: SlLength::default(), has_effect: false, effect: [0; 4], animation: SlAnimation::default(), classes: SlStr::EMPTY, id: SlStr::EMPTY, placeholder: SlStr::EMPTY, secure: false, report_scroll: false, } }}
#[repr(C)]#[derive(Clone, Copy)]pub struct SlNodeList { pub nodes: *const SlNode, pub len: usize,}
impl SlNodeList { pub const EMPTY: SlNodeList = SlNodeList { nodes: core::ptr::null(), len: 0, };}
pub mod sl_event_kind { pub const NONE: u32 = 0; pub const TICK: u32 = 1; pub const CONFIG_RELOAD: u32 = 2; pub const COMPOSITOR_UPDATE: u32 = 3; pub const FD: u32 = 4; pub const FRAME: u32 = 5; pub const WIDGET: u32 = 6;}
pub mod sl_event_mask { pub const TICK: u32 = 1 << 0; pub const CONFIG_RELOAD: u32 = 1 << 1; pub const COMPOSITOR_UPDATE: u32 = 1 << 2; pub const FD: u32 = 1 << 3; pub const FRAME: u32 = 1 << 4; pub const WIDGET: u32 = 1 << 5;}
pub mod sl_widget_event { pub const NONE: u32 = 0; pub const INPUT: u32 = 1; pub const SUBMIT: u32 = 2; pub const CUSTOM: u32 = 3; pub const SCROLL: u32 = 4;}
pub mod sl_effect { pub const NONE: u32 = 0; pub const REDRAW: u32 = 1; pub const SUBSCRIBE: u32 = 2; pub const HIDE: u32 = 3; pub const SHOW: u32 = 4; pub const REALLY_HIDE: u32 = 5; pub const DESTROY: u32 = 6; pub const REALLY_DESTROY: u32 = 7; pub const CUSTOM: u32 = 8;}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlEffect { pub code: u32, pub custom: [usize; 4],}
pub mod sl_message_kind { pub const NOOP: u32 = 0; pub const EFFECT: u32 = 1; pub const ACTION: u32 = 2; pub const EFFECT_ACTION: u32 = 3;}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlItemMessage { pub kind: u32, pub effect: u32, pub custom: [usize; 4], pub name: SlStr,}
#[repr(C)]#[derive(Clone, Copy)]pub struct SlEvent { pub kind: u32, pub name: SlStr, pub bag: *mut c_void, pub action: u32, pub fd: i32, pub widget: u32, pub id: SlStr, pub value: SlStr, pub scroll: [f32; 2],}
impl Default for SlEvent { fn default() -> Self { Self { kind: sl_event_kind::NONE, name: SlStr::EMPTY, bag: core::ptr::null_mut(), action: 0, fd: -1, widget: sl_widget_event::NONE, id: SlStr::EMPTY, value: SlStr::EMPTY, scroll: [0.0, 0.0], } }}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlMonitor { pub name: SlStr, pub width: u32, pub height: u32, pub scale: f32,}
#[repr(C)]#[derive(Clone, Copy)]pub struct SlWorkspace { pub id: u64, pub idx: u8, pub output: SlStr, pub name: SlStr, pub is_active: bool, pub is_focused: bool, pub is_urgent: bool,}
#[repr(C)]#[derive(Clone, Copy)]pub struct SlWindow { pub id: u64, pub title: SlStr, pub wclass: SlStr,}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlCompositorState { pub monitors: *const SlMonitor, pub monitor_count: usize, pub workspaces: *const SlWorkspace, pub workspace_count: usize, pub active_window: *const SlWindow, pub overview_active: bool,}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlNotificationAction { pub command: SlStr, pub label: SlStr,}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlNotification { pub summary: SlStr, pub body: SlStr, pub app_name: SlStr, pub app_icon: SlStr, pub urgency: u8, pub timeout_ms: i32, pub replaces_id: u32, pub actions: *const SlNotificationAction, pub action_count: usize,}
pub type SlComponentCreateFn = unsafe extern "C" fn(ctx: *mut c_void) -> *mut c_void;pub type SlComponentDestroyFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void);pub type SlComponentEventsFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void) -> u32;pub type SlComponentWatchFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void, opts: *mut c_void);pub type SlComponentUpdateFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void, event: *const SlEvent) -> SlEffect;pub type SlComponentViewFn = unsafe extern "C" fn( ctx: *mut c_void, state: *mut c_void, opts: *mut c_void, out: *mut SlNodeList,);
pub type SlComponentCheckViewFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void, opts: *mut c_void) -> bool;pub type SlComponentStopFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void);
#[repr(C)]#[derive(Clone, Copy)]pub struct SlComponentVtable { pub size: u32, pub create: Option<SlComponentCreateFn>, pub destroy: Option<SlComponentDestroyFn>, pub events: Option<SlComponentEventsFn>, pub watch: Option<SlComponentWatchFn>, pub update: Option<SlComponentUpdateFn>, pub view: Option<SlComponentViewFn>, pub check_view: Option<SlComponentCheckViewFn>, pub stop: Option<SlComponentStopFn>, pub hoverable: bool,}
pub type SlCompositorCreateFn = unsafe extern "C" fn(ctx: *mut c_void) -> *mut c_void;pub type SlCompositorDestroyFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void);pub type SlCompositorIsActiveFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void) -> bool;pub type SlCompositorInitializeFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void);pub type SlCompositorUpdateFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void);pub type SlCompositorCommandFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void, command: u32, arg: i32);
pub type SlCompositorRegisterFdFn = unsafe extern "C" fn(ctx: *mut c_void, fd: i32, flags: u32) -> i32;
#[repr(C)]#[derive(Clone, Copy)]pub struct SlCompositorVtable { pub size: u32, pub create: Option<SlCompositorCreateFn>, pub destroy: Option<SlCompositorDestroyFn>, pub is_active: Option<SlCompositorIsActiveFn>, pub initialize: Option<SlCompositorInitializeFn>, pub update_state: Option<SlCompositorUpdateFn>, pub send_command: Option<SlCompositorCommandFn>,}
pub mod sl_compositor_command { pub const FOCUS_WORKSPACE: u32 = 0; pub const FOCUS_WINDOW: u32 = 1;}
pub mod sl_epoll { pub const IN: u32 = 1 << 0; pub const ET: u32 = 1 << 1;}
pub type SlPayloadCreateFn = unsafe extern "C" fn(ctx: *mut c_void) -> *mut c_void;pub type SlPayloadDestroyFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void);pub type SlPayloadInvokeFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void, args: *mut c_void);
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlPayloadArgs { pub count: usize, pub keys: *const SlStr, pub values: *const SlStr,}
#[repr(C)]#[derive(Clone, Copy)]pub struct SlPayloadVtable { pub size: u32, pub create: Option<SlPayloadCreateFn>, pub destroy: Option<SlPayloadDestroyFn>, pub invoke: Option<SlPayloadInvokeFn>,}
pub type SlRenderableCreateFn = unsafe extern "C" fn(ctx: *mut c_void) -> *mut c_void;pub type SlRenderableDestroyFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void);pub type SlRenderableViewFn = unsafe extern "C" fn( ctx: *mut c_void, state: *mut c_void, opts: *mut c_void, out: *mut SlNodeList,);
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlRenderableSettings { pub wrap_popup: bool, pub width: f32, pub height: f32,}
pub type SlRenderableInitializeFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void);pub type SlRenderableUpdateFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void) -> SlEffect;pub type SlRenderableHandleMessageFn = unsafe extern "C" fn( ctx: *mut c_void, state: *mut c_void, message: *const SlItemMessage,) -> SlEffect;pub type SlRenderableSettingsFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void, out: *mut SlRenderableSettings);
#[repr(C)]#[derive(Clone, Copy)]pub struct SlRenderableVtable { pub size: u32, pub create: Option<SlRenderableCreateFn>, pub destroy: Option<SlRenderableDestroyFn>, pub view: Option<SlRenderableViewFn>, pub settings: Option<SlRenderableSettingsFn>, pub initialize: Option<SlRenderableInitializeFn>, pub update: Option<SlRenderableUpdateFn>, pub handle_message: Option<SlRenderableHandleMessageFn>,}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlQuickSettingsTile { pub id: SlStr, pub icon: SlStr, pub title: SlStr, pub status: SlStr, pub detail: SlStr, pub active: bool, pub accent: SlStr, pub action_kind: u32, pub commands: *const SlStr, pub command_count: usize, pub menu: SlStr, pub order: i32,}
pub mod sl_quick_settings_action { pub const NONE: u32 = 0; pub const COMMAND: u32 = 1; pub const COMMANDS: u32 = 2; pub const MENU: u32 = 3; pub const EXPAND: u32 = 4;}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlQuickSettingsTileList { pub tiles: *const SlQuickSettingsTile, pub len: usize,}
pub type SlQuickSettingsTilesFn = unsafe extern "C" fn( ctx: *mut c_void, state: *mut c_void, expanded: SlStr, out: *mut SlQuickSettingsTileList,);
pub type SlQuickSettingsCreateFn = unsafe extern "C" fn(ctx: *mut c_void) -> *mut c_void;pub type SlQuickSettingsDestroyFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void);
#[repr(C)]#[derive(Clone, Copy)]pub struct SlQuickSettingsVtable { pub size: u32, pub create: Option<SlQuickSettingsCreateFn>, pub destroy: Option<SlQuickSettingsDestroyFn>, pub tiles: Option<SlQuickSettingsTilesFn>, pub children: Option<SlQuickSettingsTilesFn>,}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlSpotlightItem { pub icon: SlStr, pub title: SlStr, pub subtitle: SlStr, pub action_label: SlStr, pub image: SlStr, pub tags: *const SlStr, pub tag_count: usize,}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlSpotlightList { pub items: *const SlSpotlightItem, pub count: usize,}
pub type SlSpotlightCreateFn = unsafe extern "C" fn(ctx: *mut c_void) -> *mut c_void;pub type SlSpotlightDestroyFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void);
pub type SlSpotlightGenerateFn = unsafe extern "C" fn( ctx: *mut c_void, state: *mut c_void, query: SlStr, out: *mut SlSpotlightList,) -> i32;pub type SlSpotlightActivateFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void, index: usize);pub type SlSpotlightTriggerCheckFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void, query: SlStr) -> bool;
#[repr(C)]#[derive(Clone, Copy)]pub struct SlSpotlightVtable { pub size: u32, pub create: Option<SlSpotlightCreateFn>, pub destroy: Option<SlSpotlightDestroyFn>, pub generate: Option<SlSpotlightGenerateFn>, pub activate: Option<SlSpotlightActivateFn>, pub trigger_check: Option<SlSpotlightTriggerCheckFn>, pub allows_triggers: bool, pub display_styles: u32,}
pub mod sl_display_style { pub const LIST: u32 = 1; pub const GRID: u32 = 2; pub const IMAGE_LIST: u32 = 4;}
pub type SlRegistryNotifyFn = unsafe extern "C" fn(ctx: *mut c_void, key: usize, value: *mut c_void);pub type SlRegistryRegisterFn = unsafe extern "C" fn(ctx: *mut c_void, key: usize, value: *mut c_void) -> i32;pub type SlRegistryGetFn = unsafe extern "C" fn(ctx: *mut c_void, key: usize) -> *mut c_void;pub type SlRegistryRemoveFn = unsafe extern "C" fn(ctx: *mut c_void, key: usize) -> *mut c_void;pub type SlRegistrySubscribeFn = unsafe extern "C" fn(ctx: *mut c_void, key: usize, callback: SlRegistryNotifyFn) -> i32;
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlAudioSink { pub id: u32, pub name: SlStr, pub description: SlStr, pub volume: f32, pub muted: bool, pub is_default: bool,}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlMprisPlayer { pub identity: SlStr, pub title: SlStr, pub artist: SlStr, pub album: SlStr, pub art_url: SlStr, pub playback_status: SlStr, pub can_play_pause: bool, pub can_go_next: bool, pub can_go_previous: bool,}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlAudioState { pub volume: f32, pub muted: bool, pub default_sink: SlStr, pub sinks: *const SlAudioSink, pub sink_count: usize, pub has_player: bool, pub player: SlMprisPlayer,}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlBluetoothDevice { pub address: SlStr, pub name: SlStr, pub icon: SlStr, pub paired: bool, pub connected: bool, pub trusted: bool, pub battery: i32, pub rssi: i32,}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlBluetoothState { pub powered: bool, pub discovering: bool, pub adapter_name: SlStr, pub devices: *const SlBluetoothDevice, pub device_count: usize,}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlAccessPoint { pub ssid: SlStr, pub signal: u8, pub secured: bool, pub in_use: bool, pub saved: bool,}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlEthernet { pub iface: SlStr, pub speed: u32, pub carrier: bool, pub connected: bool,}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlConnectionInfo { pub label: SlStr, pub mac: SlStr, pub is_wifi: bool,}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlNetworkState { pub wifi_enabled: bool, pub wifi_hardware_enabled: bool, pub scanning: bool, pub busy: bool, pub has_wifi_connected: bool, pub wifi_connected: SlAccessPoint, pub has_ethernet: bool, pub ethernet: SlEthernet, pub networks: *const SlAccessPoint, pub network_count: usize, pub has_connected: bool, pub connected: SlConnectionInfo,}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlProcessInfo { pub pid: u32, pub name: SlStr, pub cpu_usage: f32, pub memory: u64,}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlSystemState { pub cpu_usage: f32, pub mem_usage: f32, pub mem_total: u64, pub mem_used: u64, pub has_temperature: bool, pub temperature: f32, pub load: [f32; 3], pub network_state: u16, pub network_rx: u64, pub network_tx: u64, pub top_processes: *const SlProcessInfo, pub process_count: usize,}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlTrayItem { pub address: SlStr, pub title: SlStr, pub icon_name: SlStr, pub menu_path: SlStr, pub has_pixmap: bool, pub pixmap_width: u32, pub pixmap_height: u32, pub pixmap: SlStr,}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlTrayState { pub items: *const SlTrayItem, pub item_count: usize,}
pub type SlAudioStateGetFn = unsafe extern "C" fn(ctx: *mut c_void, out: *mut SlAudioState) -> i32;pub type SlBluetoothStateGetFn = unsafe extern "C" fn(ctx: *mut c_void, out: *mut SlBluetoothState) -> i32;pub type SlNetworkStateGetFn = unsafe extern "C" fn(ctx: *mut c_void, out: *mut SlNetworkState) -> i32;pub type SlSystemStateGetFn = unsafe extern "C" fn(ctx: *mut c_void, out: *mut SlSystemState) -> i32;pub type SlTrayStateGetFn = unsafe extern "C" fn(ctx: *mut c_void, out: *mut SlTrayState) -> i32;
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlPowerState { pub has_percent: bool, pub percent: u8, pub charging: bool, pub status: SlStr, pub has_health: bool, pub health: u8, pub has_energy_now: bool, pub energy_now_wh: f32, pub has_energy_full: bool, pub energy_full_wh: f32, pub has_power: bool, pub power_w: f32, pub time_remaining: SlStr, pub has_active_profile: bool, pub active_profile: SlStr, pub available_profiles: *const SlStr, pub available_profile_count: usize, pub brightness_percent: u8, pub brightness_max: u32, pub brightness_current: u32, pub device_name: SlStr,}
pub type SlPowerStateGetFn = unsafe extern "C" fn(ctx: *mut c_void, out: *mut SlPowerState) -> i32;
pub type SlDispatchFn = unsafe extern "C" fn(ctx: *mut c_void, command: SlStr) -> i32;pub type SlDispatchWithStringFn = unsafe extern "C" fn(ctx: *mut c_void, name: SlStr, payload: SlStr) -> i32;pub type SlRegisterCommandFn = unsafe extern "C" fn(host: *mut c_void, name: SlStr, title: SlStr, description: SlStr) -> i32;
pub mod sl_anchor { pub const TOP: u32 = 1; pub const BOTTOM: u32 = 2; pub const LEFT: u32 = 4; pub const RIGHT: u32 = 8;}
pub mod sl_layer { pub const BACKGROUND: u32 = 0; pub const BOTTOM: u32 = 1; pub const TOP: u32 = 2; pub const OVERLAY: u32 = 3;}
pub mod sl_keyboard_interactivity { pub const NONE: u32 = 0; pub const ON_DEMAND: u32 = 1; pub const EXCLUSIVE: u32 = 2;}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlDesktopSettings { pub layer: u32, pub anchor: u32, pub width: u32, pub height: u32, pub margin: [i32; 4], pub exclusive_zone: i32, pub events_transparent: bool, pub keyboard_interactivity: u32, pub per_monitor: bool, pub monitor: SlStr, pub ns: SlStr, pub visibility: u32, pub visible: bool, // useless pub update_when: u32,}
pub mod sl_visibility { pub const VISIBLE: u32 = 0; pub const TRANSIENT: u32 = 1; pub const TOGGLEABLE: u32 = 2;}
pub mod sl_update_when { pub const ON_DEMAND: u32 = 0; pub const EVERY_FRAME: u32 = 1; pub const ON_EVENT: u32 = 2;}
pub type SlDesktopCreateFn = unsafe extern "C" fn(ctx: *mut c_void) -> *mut c_void;pub type SlDesktopDestroyFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void);pub type SlDesktopSettingsFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void, out: *mut SlDesktopSettings);pub type SlDesktopInitializeFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void, opts: *mut c_void);pub type SlDesktopEventsFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void) -> u32;pub type SlDesktopUpdateFn = unsafe extern "C" fn(ctx: *mut c_void, state: *mut c_void, event: *const SlEvent) -> SlEffect;pub type SlDesktopHandleMessageFn = unsafe extern "C" fn( ctx: *mut c_void, state: *mut c_void, message: *const SlItemMessage,) -> SlEffect;pub type SlDesktopViewFn = unsafe extern "C" fn( ctx: *mut c_void, state: *mut c_void, opts: *mut c_void, out: *mut SlNodeList,);
#[repr(C)]#[derive(Clone, Copy)]pub struct SlDesktopItemVtable { pub size: u32, pub create: Option<SlDesktopCreateFn>, pub destroy: Option<SlDesktopDestroyFn>, pub settings: Option<SlDesktopSettingsFn>, pub initialize: Option<SlDesktopInitializeFn>, pub events: Option<SlDesktopEventsFn>, pub update: Option<SlDesktopUpdateFn>, pub view: Option<SlDesktopViewFn>, pub handle_message: Option<SlDesktopHandleMessageFn>,}
pub type SlRegisterComponentFn = unsafe extern "C" fn( host: *mut c_void, name: SlStr, vtable: *const SlComponentVtable, userdata: *mut c_void,);pub type SlRegisterCompositorFn = unsafe extern "C" fn( host: *mut c_void, name: SlStr, vtable: *const SlCompositorVtable, userdata: *mut c_void,);pub type SlRegisterPayloadFn = unsafe extern "C" fn( host: *mut c_void, command: SlStr, vtable: *const SlPayloadVtable, userdata: *mut c_void,);pub type SlRegisterRenderableFn = unsafe extern "C" fn( host: *mut c_void, name: SlStr, vtable: *const SlRenderableVtable, userdata: *mut c_void,);pub type SlRegisterSpotlightFn = unsafe extern "C" fn( host: *mut c_void, name: SlStr, vtable: *const SlSpotlightVtable, userdata: *mut c_void,);pub type SlRegisterQuickSettingsFn = unsafe extern "C" fn( host: *mut c_void, name: SlStr, vtable: *const SlQuickSettingsVtable, userdata: *mut c_void,);pub type SlRegisterDesktopItemFn = unsafe extern "C" fn( host: *mut c_void, name: SlStr, vtable: *const SlDesktopItemVtable, userdata: *mut c_void,);pub type SlRequestRedrawFn = unsafe extern "C" fn(ctx: *mut c_void, window: u64);pub type SlRegisterFdFn = unsafe extern "C" fn(ctx: *mut c_void, fd: i32, action: u32) -> i32;pub type SlSetIntervalFn = unsafe extern "C" fn(ctx: *mut c_void, millis: u32, repeating: bool, tag: u32) -> i32;pub type SlCanvasAllocFn = unsafe extern "C" fn(ctx: *mut c_void, width: u32, height: u32) -> *mut u8;pub type SlLogFn = unsafe extern "C" fn(ctx: *mut c_void, level: i32, message: SlStr);pub type SlGetStrFn = unsafe extern "C" fn(bag: *mut c_void, key: SlStr, out: *mut SlStr) -> i32;pub type SlGetF64Fn = unsafe extern "C" fn(bag: *mut c_void, key: SlStr, out: *mut f64) -> i32;pub type SlGetI64Fn = unsafe extern "C" fn(bag: *mut c_void, key: SlStr, out: *mut i64) -> i32;pub type SlGetBoolFn = unsafe extern "C" fn(bag: *mut c_void, key: SlStr, out: *mut bool) -> i32;pub type SlSetCompositorStateFn = unsafe extern "C" fn(ctx: *mut c_void, state: *const SlCompositorState);
pub mod sl_log_level { pub const ERROR: i32 = 0; pub const WARN: i32 = 1; pub const INFO: i32 = 2; pub const DEBUG: i32 = 3;}
#[repr(C)]#[derive(Clone, Copy, Default)]pub struct SlTheme { pub base: SlColor, pub crust: SlColor, pub mantle: SlColor, pub primary: SlColor, pub secondary: SlColor, pub green: SlColor, pub red: SlColor, pub blue: SlColor, pub yellow: SlColor, pub orange: SlColor, pub text: SlColor, pub subtext: SlColor, pub overlay: SlColor,}
pub type SlStyleNumberGetFn = unsafe extern "C" fn(ctx: *mut c_void, classes: SlStr, property: SlStr, out: *mut f32) -> i32;pub type SlStyleBoolGetFn = unsafe extern "C" fn(ctx: *mut c_void, classes: SlStr, property: SlStr, out: *mut bool) -> i32;pub type SlStyleColorGetFn = unsafe extern "C" fn(ctx: *mut c_void, classes: SlStr, property: SlStr, out: *mut SlColor) -> i32;pub type SlThemeGetFn = unsafe extern "C" fn(ctx: *mut c_void, out: *mut SlTheme) -> i32;pub type SlStyleRegisterFn = unsafe extern "C" fn(ctx: *mut c_void, css: SlStr) -> i32;
pub type SlCompositorStateGetFn = unsafe extern "C" fn(ctx: *mut c_void, out: *mut SlCompositorState) -> i32;
pub type SlConfigParserFn = unsafe extern "C" fn(ctx: *mut c_void, name: SlStr, block: SlStr) -> i32;
pub type SlConfigParserRegisterFn = unsafe extern "C" fn(host: *mut c_void, name: SlStr, callback: SlConfigParserFn) -> i32;
pub type SlPersistenceGetFn = unsafe extern "C" fn(ctx: *mut c_void, key: SlStr, out: *mut SlStr) -> i32;pub type SlPersistenceSetFn = unsafe extern "C" fn(ctx: *mut c_void, key: SlStr, value: SlStr) -> i32;pub type SlPersistenceRemoveFn = unsafe extern "C" fn(ctx: *mut c_void, key: SlStr) -> i32;
pub type SlPluginErrorFn = unsafe extern "C" fn(ctx: *mut c_void, code: u32, message: SlStr);
pub type SlNotifyFn = unsafe extern "C" fn(ctx: *mut c_void, notification: *const SlNotification) -> i32;
#[repr(C)]#[derive(Clone, Copy)]pub struct SlHostApi { pub size: u32, pub register_component: Option<SlRegisterComponentFn>, pub register_compositor: Option<SlRegisterCompositorFn>, pub request_redraw: Option<SlRequestRedrawFn>, pub register_fd: Option<SlRegisterFdFn>, pub log: Option<SlLogFn>, pub get_str: Option<SlGetStrFn>, pub get_f64: Option<SlGetF64Fn>, pub get_i64: Option<SlGetI64Fn>, pub get_bool: Option<SlGetBoolFn>, pub set_compositor_state: Option<SlSetCompositorStateFn>, pub set_interval: Option<SlSetIntervalFn>, pub register_payload: Option<SlRegisterPayloadFn>, pub register_renderable: Option<SlRegisterRenderableFn>, pub register_desktop_item: Option<SlRegisterDesktopItemFn>, pub canvas: Option<SlCanvasAllocFn>, pub config_get_str: Option<SlGetStrFn>, pub config_get_f64: Option<SlGetF64Fn>, pub config_get_i64: Option<SlGetI64Fn>, pub config_get_bool: Option<SlGetBoolFn>, pub style_number: Option<SlStyleNumberGetFn>, pub style_bool: Option<SlStyleBoolGetFn>, pub style_color: Option<SlStyleColorGetFn>, pub theme_get: Option<SlThemeGetFn>, pub style_register: Option<SlStyleRegisterFn>, pub compositor_state_get: Option<SlCompositorStateGetFn>, pub config_parser_register: Option<SlConfigParserRegisterFn>, pub plugin_error: Option<SlPluginErrorFn>, pub notify: Option<SlNotifyFn>, pub compositor_register_fd: Option<SlCompositorRegisterFdFn>, pub register_spotlight: Option<SlRegisterSpotlightFn>, pub registry_register: Option<SlRegistryRegisterFn>, pub registry_get: Option<SlRegistryGetFn>, pub registry_remove: Option<SlRegistryRemoveFn>, pub registry_subscribe: Option<SlRegistrySubscribeFn>, pub dispatch: Option<SlDispatchFn>, pub audio_state_get: Option<SlAudioStateGetFn>, pub bluetooth_state_get: Option<SlBluetoothStateGetFn>, pub network_state_get: Option<SlNetworkStateGetFn>, pub system_state_get: Option<SlSystemStateGetFn>, pub tray_state_get: Option<SlTrayStateGetFn>, pub power_state_get: Option<SlPowerStateGetFn>, pub persistence_get: Option<SlPersistenceGetFn>, pub persistence_set: Option<SlPersistenceSetFn>, pub persistence_remove: Option<SlPersistenceRemoveFn>, pub dispatch_with_string: Option<SlDispatchWithStringFn>, pub register_command: Option<SlRegisterCommandFn>, pub register_quick_settings: Option<SlRegisterQuickSettingsFn>,}
#[repr(C)]#[derive(Clone, Copy)]pub struct SlPluginMeta { pub abi_version: u32, pub id: SlStr, pub version: SlStr,}
pub type SlPluginGetMetaFn = unsafe extern "C" fn() -> SlPluginMeta;pub type SlPluginInitFn = unsafe extern "C" fn( api: *const SlHostApi, host: *mut c_void, out_userdata: *mut *mut c_void,) -> i32;pub type SlPluginShutdownFn = unsafe extern "C" fn(userdata: *mut c_void);
pub const fn plugin_meta(id: &'static str, version: &'static str) -> SlPluginMeta { SlPluginMeta { abi_version: SL_PLUGIN_ABI_VERSION, id: SlStr::from_str(id), version: SlStr::from_str(version), }}
#[macro_export]macro_rules! export_plugin { ($register:path) => { #[unsafe(no_mangle)] pub extern "C" fn slowshell_plugin_meta() -> $crate::SlPluginMeta { $crate::plugin_meta(env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")) }
#[unsafe(no_mangle)] pub unsafe extern "C" fn slowshell_plugin_init( api: *const $crate::SlHostApi, host: *mut core::ffi::c_void, _userdata: *mut *mut core::ffi::c_void, ) -> i32 { unsafe { $register(api, host) }; 0 }
#[unsafe(no_mangle)] pub extern "C" fn slowshell_plugin_shutdown(_userdata: *mut core::ffi::c_void) {} };}
pub unsafe fn register_component( api: *const SlHostApi, host: *mut c_void, name: &str, vtable: &'static SlComponentVtable,) { let Some(api) = (unsafe { api.as_ref() }) else { return; }; if let Some(register) = api.register_component { unsafe { register( host, SlStr::from_str(name), vtable as *const _, core::ptr::null_mut(), ); } }}
pub unsafe fn register_compositor( api: *const SlHostApi, host: *mut c_void, name: &str, vtable: &'static SlCompositorVtable,) { let Some(api) = (unsafe { api.as_ref() }) else { return; }; if let Some(register) = api.register_compositor { unsafe { register( host, SlStr::from_str(name), vtable as *const _, core::ptr::null_mut(), ); } }}
pub unsafe fn register_payload( api: *const SlHostApi, host: *mut c_void, command: &str, vtable: &'static SlPayloadVtable,) { let Some(api) = (unsafe { api.as_ref() }) else { return; }; if let Some(register) = api.register_payload { unsafe { register( host, SlStr::from_str(command), vtable as *const _, core::ptr::null_mut(), ); } }}
pub unsafe fn register_renderable( api: *const SlHostApi, host: *mut c_void, name: &str, vtable: &'static SlRenderableVtable,) { let Some(api) = (unsafe { api.as_ref() }) else { return; }; if let Some(register) = api.register_renderable { unsafe { register( host, SlStr::from_str(name), vtable as *const _, core::ptr::null_mut(), ); } }}
pub unsafe fn register_spotlight( api: *const SlHostApi, host: *mut c_void, name: &str, vtable: &'static SlSpotlightVtable,) { let Some(api) = (unsafe { api.as_ref() }) else { return; }; if let Some(register) = api.register_spotlight { unsafe { register( host, SlStr::from_str(name), vtable as *const _, core::ptr::null_mut(), ); } }}
pub unsafe fn register_quick_settings( api: *const SlHostApi, host: *mut c_void, name: &str, vtable: &'static SlQuickSettingsVtable,) { let Some(api) = (unsafe { api.as_ref() }) else { return; }; if let Some(register) = api.register_quick_settings { unsafe { register( host, SlStr::from_str(name), vtable as *const _, core::ptr::null_mut(), ); } }}
pub unsafe fn register_desktop_item( api: *const SlHostApi, host: *mut c_void, name: &str, vtable: &'static SlDesktopItemVtable,) { let Some(api) = (unsafe { api.as_ref() }) else { return; }; if let Some(register) = api.register_desktop_item { unsafe { register( host, SlStr::from_str(name), vtable as *const _, core::ptr::null_mut(), ); } }}
pub unsafe fn register_command( api: *const SlHostApi, host: *mut c_void, name: &str, title: &str, description: &str,) { let Some(api) = (unsafe { api.as_ref() }) else { return; }; if let Some(register) = api.register_command { unsafe { register( host, SlStr::from_str(name), SlStr::from_str(title), SlStr::from_str(description), ); } }}