#[repr(C)]pub struct XPLMCreateWindow_t {Show 15 fields
pub structSize: c_int,
pub left: c_int,
pub top: c_int,
pub right: c_int,
pub bottom: c_int,
pub visible: c_int,
pub drawWindowFunc: XPLMDrawWindow_f,
pub handleMouseClickFunc: XPLMHandleMouseClick_f,
pub handleKeyFunc: XPLMHandleKey_f,
pub handleCursorFunc: XPLMHandleCursor_f,
pub handleMouseWheelFunc: XPLMHandleMouseWheel_f,
pub refcon: *mut c_void,
pub decorateAsFloatingWindow: XPLMWindowDecoration,
pub layer: XPLMWindowLayer,
pub handleRightClickFunc: XPLMHandleMouseClick_f,
}Expand description
XPLMCreateWindow_t
The XPMCreateWindow_t structure defines all of the parameters used to create a modern window using XPLMCreateWindowEx(). The structure will be expanded in future SDK APIs to include more features. Always set the structSize member to the size of your struct in bytes!
All windows created by this function in the XPLM300 version of the API are created with the new X-Plane 11 GUI features. This means your plugin will get to “know” about the existence of X-Plane windows other than the main window. All drawing and mouse callbacks for your window will occur in “boxels,” giving your windows automatic support for high-DPI scaling in X-Plane. In addition, your windows can opt-in to decoration with the X-Plane 11 window styling, and you can use the XPLMSetWindowPositioningMode() API to make your window “popped out” into a first-class operating system window.
Note that this requires dealing with your window’s bounds in “global desktop” positioning units, rather than the traditional panel coordinate system. In global desktop coordinates, the main X-Plane window may not have its origin at coordinate (0, 0), and your own window may have negative coordinates. Assuming you don’t implicitly assume (0, 0) as your origin, the only API change you should need is to start using XPLMGetMouseLocationGlobal() rather than XPLMGetMouseLocation(), and XPLMGetScreenBoundsGlobal() instead of XPLMGetScreenSize().
If you ask to be decorated as a floating window, you’ll get the blue window control bar and blue backing that you see in X-Plane 11’s normal “floating” windows (like the map).
Fields§
§structSize: c_intUsed to inform XPLMCreateWindowEx() of the SDK version you compiled * against; should always be set to sizeof(XPLMCreateWindow_t)
left: c_intLeft bound, in global desktop boxels
top: c_intTop bound, in global desktop boxels
right: c_intRight bound, in global desktop boxels
bottom: c_intBottom bound, in global desktop boxels
visible: c_int§drawWindowFunc: XPLMDrawWindow_f§handleMouseClickFunc: XPLMHandleMouseClick_fA callback to handle the user left-clicking within your window (or NULL to * ignore left clicks)
handleKeyFunc: XPLMHandleKey_f§handleCursorFunc: XPLMHandleCursor_f§handleMouseWheelFunc: XPLMHandleMouseWheel_f§refcon: *mut c_voidA reference which will be passed into each of your window callbacks. Use * this to pass information to yourself as needed.
decorateAsFloatingWindow: XPLMWindowDecorationSpecifies the type of X-Plane 11-style “wrapper” you want around your * window, if any
layer: XPLMWindowLayer§handleRightClickFunc: XPLMHandleMouseClick_fA callback to handle the user right-clicking within your window (or NULL to* ignore right clicks)
Trait Implementations§
Source§impl Clone for XPLMCreateWindow_t
impl Clone for XPLMCreateWindow_t
Source§fn clone(&self) -> XPLMCreateWindow_t
fn clone(&self) -> XPLMCreateWindow_t
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more