XPLMCreateAvionics_t

Struct XPLMCreateAvionics_t 

Source
#[repr(C)]
pub struct XPLMCreateAvionics_t {
Show 23 fields pub structSize: c_int, pub screenWidth: c_int, pub screenHeight: c_int, pub bezelWidth: c_int, pub bezelHeight: c_int, pub screenOffsetX: c_int, pub screenOffsetY: c_int, pub drawOnDemand: c_int, pub bezelDrawCallback: XPLMAvionicsBezelCallback_f, pub drawCallback: XPLMAvionicsScreenCallback_f, pub bezelClickCallback: XPLMAvionicsMouse_f, pub bezelRightClickCallback: XPLMAvionicsMouse_f, pub bezelScrollCallback: XPLMAvionicsMouseWheel_f, pub bezelCursorCallback: XPLMAvionicsCursor_f, pub screenTouchCallback: XPLMAvionicsMouse_f, pub screenRightTouchCallback: XPLMAvionicsMouse_f, pub screenScrollCallback: XPLMAvionicsMouseWheel_f, pub screenCursorCallback: XPLMAvionicsCursor_f, pub keyboardCallback: XPLMAvionicsKeyboard_f, pub brightnessCallback: XPLMAvionicsBrightness_f, pub deviceID: *mut c_char, pub deviceName: *mut c_char, pub refcon: *mut c_void,
}
Expand description

XPLMCreateAvionics_t

The XPLMCreateAvionics_t structure defines all of the parameters used to generate your own glass cockpit device by using XPLMCreateAvionicsEx(). 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!

Fields§

§structSize: c_int

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

§screenWidth: c_int

Width of the device’s screen in pixels.

§screenHeight: c_int

Height of the device’s screen in pixels.

§bezelWidth: c_int

Width of the bezel around your device’s screen for 2D pop-ups.

§bezelHeight: c_int

Height of the bezel around your device’s screen for 2D pop-ups.

§screenOffsetX: c_int

The screen’s lateral offset into the bezel for 2D pop-ups.

§screenOffsetY: c_int

The screen’s vertical offset into the bezel for 2D pop-ups.

§drawOnDemand: c_int

If set to true (1), X-Plane won’t call your plugin to re-render the * device’s screen every frame. Instead, you should tell X-Plane you want to * refresh your screen with XPLMAvionicsNeedsDrawing(), and X-Plane will call * you before rendering the next simulator frame.

§bezelDrawCallback: XPLMAvionicsBezelCallback_f

The draw callback you will use to draw the 2D-popup bezel. This is called * only when the popup window is visible, and X-Plane is about to draw the * bezel in it.

§drawCallback: XPLMAvionicsScreenCallback_f

The draw callback you will be using to draw into the device’s screen * framebuffer.

§bezelClickCallback: XPLMAvionicsMouse_f

The mouse click callback that is called when the user clicks onto your * bezel.

§bezelRightClickCallback: XPLMAvionicsMouse_f

The mouse click callback that is called when the user clicks onto your * bezel.

§bezelScrollCallback: XPLMAvionicsMouseWheel_f

The callback that is called when the users uses the scroll wheel over your * avionics’ bezel.

§bezelCursorCallback: XPLMAvionicsCursor_f

The callback that lets you determine what cursor should be shown when the * mouse is over your device’s bezel.

§screenTouchCallback: XPLMAvionicsMouse_f

The mouse click callback that is called when the user clicks onto your * screen.

§screenRightTouchCallback: XPLMAvionicsMouse_f

The right mouse click callback that is called when the user clicks onto * your screen.

§screenScrollCallback: XPLMAvionicsMouseWheel_f

The callback that is called when the users uses the scroll wheel over your * avionics’ screen.

§screenCursorCallback: XPLMAvionicsCursor_f

The callback that lets you determine what cursor should be shown when the * mouse is over your device’s screen.

§keyboardCallback: XPLMAvionicsKeyboard_f

The key callback that is called when the user types in your popup.

§brightnessCallback: XPLMAvionicsBrightness_f

The callback that is called to determine the absolute brightness of the * device’s screen. Set to NULL to use X-Plane’s default behaviour.

§deviceID: *mut c_char

A null-terminated string of maximum 64 characters to uniquely identify your* cockpit device. This must be unique (you cannot re-use an ID that X-Plane * or another plugin provides), and it must not contain spaces. This is the * string the OBJ file must reference when marking polygons with * ATTR_cockpit_device. The string is copied when you call * XPLMCreateAvionicsEx, so you don’t need to hold this string in memory after* the call.

§deviceName: *mut c_char

A null-terminated string to give a user-readable name to your device, which* can be presented in UI dialogs.

§refcon: *mut c_void

A reference which will be passed into your draw and mouse callbacks. Use * this to pass information to yourself as needed.

Trait Implementations§

Source§

impl Clone for XPLMCreateAvionics_t

Source§

fn clone(&self) -> XPLMCreateAvionics_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 XPLMCreateAvionics_t

Source§

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

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

impl Copy for XPLMCreateAvionics_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.