VulkanWindowExt

Trait VulkanWindowExt 

Source
pub trait VulkanWindowExt: IsA<VulkanWindow> + 'static {
Show 16 methods // Provided methods fn close(&self) { ... } fn display(&self) -> VulkanDisplay { ... } fn is_presentation_support( &self, device: &impl IsA<VulkanDevice>, queue_family_idx: u32, ) -> bool { ... } fn surface_dimensions(&self) -> (u32, u32) { ... } fn handle_events(&self, handle_events: bool) { ... } fn open(&self) -> Result<(), Error> { ... } fn redraw(&self) { ... } fn resize(&self, width: i32, height: i32) { ... } fn send_key_event(&self, event_type: &str, key_str: &str) { ... } fn send_mouse_event( &self, event_type: &str, button: i32, posx: f64, posy: f64, ) { ... } fn connect_close<F: Fn(&Self) -> bool + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_draw<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_key_event<F: Fn(&Self, &str, &str) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_mouse_event<F: Fn(&Self, &str, i32, f64, f64) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_resize<F: Fn(&Self, u32, u32) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_display_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all VulkanWindow methods.

§Implementors

VulkanWindow

Provided Methods§

Source

fn close(&self)

Attempt to close the window.

Source

fn display(&self) -> VulkanDisplay

§Returns

the VulkanDisplay for self

Source

fn is_presentation_support( &self, device: &impl IsA<VulkanDevice>, queue_family_idx: u32, ) -> bool

§device

a VulkanDevice

§queue_family_idx

the queue family

§Returns

whether the given combination of self, device and queue_family_idx supports presentation

Source

fn surface_dimensions(&self) -> (u32, u32)

§Returns
§width

Current width of self

§height

Current height of self

Source

fn handle_events(&self, handle_events: bool)

Tell a self that it should handle events from the window system. These events are forwarded upstream as navigation events. In some window systems events are not propagated in the window hierarchy if a client is listening for them. This method allows you to disable events handling completely from the self.

§handle_events

a gboolean indicating if events should be handled or not.

Source

fn open(&self) -> Result<(), Error>

§Returns

whether self could be successfully opened

Source

fn redraw(&self)

Ask the self to redraw its contents

Source

fn resize(&self, width: i32, height: i32)

Resize the output surface.

Currently intended for subclasses to update internal state.

§width

the new width

§height

the new height

Source

fn send_key_event(&self, event_type: &str, key_str: &str)

Source

fn send_mouse_event(&self, event_type: &str, button: i32, posx: f64, posy: f64)

Source

fn connect_close<F: Fn(&Self) -> bool + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_draw<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_key_event<F: Fn(&Self, &str, &str) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId

Will be emitted when a key event is received by the VulkanWindow.

§id

the name of the event

§key

the id of the key pressed

Source

fn connect_mouse_event<F: Fn(&Self, &str, i32, f64, f64) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId

Will be emitted when a mouse event is received by the VulkanWindow.

§id

the name of the event

§button

the id of the button

§x

the x coordinate of the mouse event

§y

the y coordinate of the mouse event

Source

fn connect_resize<F: Fn(&Self, u32, u32) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_display_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§