Expose w_global.context so it can be seen from Rust.
This commit is contained in:
@@ -504,6 +504,12 @@ extern struct WPreferences {
|
||||
/****** Global Variables ******/
|
||||
extern Display *dpy;
|
||||
|
||||
struct wmaker_global_variables_context {
|
||||
XContext client_win;
|
||||
XContext app_win;
|
||||
XContext stack;
|
||||
};
|
||||
|
||||
extern struct wmaker_global_variables {
|
||||
/* Tracking of the state of the program */
|
||||
struct {
|
||||
@@ -603,11 +609,7 @@ extern struct wmaker_global_variables {
|
||||
} atom;
|
||||
|
||||
/* X Contexts */
|
||||
struct {
|
||||
XContext client_win;
|
||||
XContext app_win;
|
||||
XContext stack;
|
||||
} context;
|
||||
struct wmaker_global_variables_context context;
|
||||
|
||||
/* X Extensions */
|
||||
struct {
|
||||
@@ -666,4 +668,9 @@ extern const char WMNWorkspaceNameChanged[];
|
||||
|
||||
extern const char WMNResetStacking[];
|
||||
|
||||
|
||||
/****** Accessors/mutators for Rust ******/
|
||||
struct wmaker_global_variables_context *wGlobalGetContext();
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -63,6 +63,12 @@
|
||||
/****** Global Variables ******/
|
||||
struct wmaker_global_variables w_global;
|
||||
|
||||
struct wmaker_global_variables_context *wGlobalGetContext()
|
||||
{
|
||||
return &w_global.context;
|
||||
}
|
||||
|
||||
|
||||
/* general info */
|
||||
|
||||
Display *dpy;
|
||||
|
||||
15
wmakerlib/src/global.rs
Normal file
15
wmakerlib/src/global.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
#[repr(C)]
|
||||
pub struct Context {
|
||||
pub client_win: x11::xlib::XContext,
|
||||
pub app_win: x11::xlib::XContext,
|
||||
pub stack: x11::xlib::XContext,
|
||||
}
|
||||
|
||||
pub mod ffi {
|
||||
use super::Context;
|
||||
|
||||
unsafe extern "C" {
|
||||
// w_global.context
|
||||
pub fn wGlobalGetContext() -> &'static Context;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user