XPLMCreateWindow_t

Struct XPLMCreateWindow_t 

Source
#[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_int

Used to inform XPLMCreateWindowEx() of the SDK version you compiled * against; should always be set to sizeof(XPLMCreateWindow_t)

§left: c_int

Left bound, in global desktop boxels

§top: c_int

Top bound, in global desktop boxels

§right: c_int

Right bound, in global desktop boxels

§bottom: c_int

Bottom bound, in global desktop boxels

§visible: c_int§drawWindowFunc: XPLMDrawWindow_f§handleMouseClickFunc: XPLMHandleMouseClick_f

A 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_void

A reference which will be passed into each of your window callbacks. Use * this to pass information to yourself as needed.

§decorateAsFloatingWindow: XPLMWindowDecoration

Specifies the type of X-Plane 11-style “wrapper” you want around your * window, if any

§layer: XPLMWindowLayer§handleRightClickFunc: XPLMHandleMouseClick_f

A callback to handle the user right-clicking within your window (or NULL to* ignore right clicks)

Trait Implementations§

Source§

impl Clone for XPLMCreateWindow_t

Source§

fn clone(&self) -> XPLMCreateWindow_t

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for XPLMCreateWindow_t

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for XPLMCreateWindow_t

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.