UniversalUI_Native/
lib.rs

1//  UniversalUI_Native - lib.rs
2//  created by sebhall on 28/07/2023
3//  
4//  UniversalUI_Native contains native platform functionality
5//  for the UniversalUI framework, such as windowing, events
6//  and file management.
7//
8//  lib.rs declares the crate submodules and init function.
9
10extern crate UniversalUI_Base;
11extern crate libc;
12
13use UniversalUI_Base::debug::*;
14
15// Conditionally include the platform-specific modules
16#[cfg(target_os = "windows")]
17mod init {
18    include!("win32/init.rs");
19}
20
21#[cfg(target_os = "linux")]
22mod init {
23    include!("./x11/init.rs");
24}
25
26pub mod window;
27pub mod event;
28
29#[no_mangle]
30pub extern "C" fn native_init() -> bool { 
31
32    debug_info("Initialising UniversalUI_Native");
33
34    if !init::init() {
35        return false;
36    }
37    
38    return true;
39}