Struct orbclient::Window

source ·
pub struct Window { /* private fields */ }
Expand description

A window

Implementations§

source§

impl Window

source

pub fn new(x: i32, y: i32, w: u32, h: u32, title: &str) -> Option<Self>

Create a new window

source

pub fn new_flags( x: i32, y: i32, w: u32, h: u32, title: &str, flags: &[WindowFlag] ) -> Option<Self>

Create a new window with flags

source

pub fn event_sender(&self) -> EventSender

source

pub fn clipboard(&self) -> String

source

pub fn set_clipboard(&mut self, text: &str)

source

pub fn pop_drop_content(&self) -> Option<String>

Pops the content of the last drop event from the window.

source

pub fn sync_path(&mut self)

source

pub fn x(&self) -> i32

Get x

source

pub fn y(&self) -> i32

Get y

source

pub fn title(&self) -> String

Get title

source

pub fn is_async(&self) -> bool

Get async

source

pub fn set_async(&mut self, is_async: bool)

Set async

source

pub fn set_mouse_cursor(&mut self, visible: bool)

Set cursor visibility

source

pub fn set_mouse_grab(&mut self, grab: bool)

Set mouse grabbing

source

pub fn set_mouse_relative(&mut self, relative: bool)

Set mouse relative mode

source

pub fn set_pos(&mut self, x: i32, y: i32)

Set position

source

pub fn set_size(&mut self, width: u32, height: u32)

Set size

source

pub fn set_title(&mut self, title: &str)

Set title

source

pub fn events(&mut self) -> EventIter

Blocking iterator over events

source

pub fn id(&self) -> u32

Returns the id

Trait Implementations§

source§

impl Drop for Window

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Renderer for Window

source§

fn width(&self) -> u32

Get width

source§

fn height(&self) -> u32

Get height

source§

fn data(&self) -> &[Color]

Access pixel buffer

source§

fn data_mut(&mut self) -> &mut [Color]

Access pixel buffer mutably

source§

fn sync(&mut self) -> bool

Flip the window buffer

source§

fn mode(&self) -> &Cell<Mode>

Set/get mode

source§

fn pixel(&mut self, x: i32, y: i32, color: Color)

Draw a pixel
source§

fn arc(&mut self, x0: i32, y0: i32, radius: i32, parts: u8, color: Color)

Draw a piece of an arc. Negative radius will fill in the inside
source§

fn circle(&mut self, x0: i32, y0: i32, radius: i32, color: Color)

Draw a circle. Negative radius will fill in the inside
source§

fn line4points(&mut self, x0: i32, y0: i32, x: i32, y: i32, color: Color)

source§

fn line(&mut self, argx1: i32, argy1: i32, argx2: i32, argy2: i32, color: Color)

Draw a line
source§

fn lines(&mut self, points: &[[i32; 2]], color: Color)

source§

fn draw_path_stroke(&mut self, graphicspath: GraphicsPath, color: Color)

Draw a path (GraphicsPath)
source§

fn char(&mut self, x: i32, y: i32, c: char, color: Color)

Draw a character, using the loaded font
source§

fn set(&mut self, color: Color)

Set entire window to a color
source§

fn clear(&mut self)

Sets the whole window to black
source§

fn rect(&mut self, x: i32, y: i32, w: u32, h: u32, color: Color)

source§

fn box_blur(&mut self, x: i32, y: i32, w: u32, h: u32, r: i32)

source§

fn box_shadow( &mut self, x: i32, y: i32, w: u32, h: u32, offset_x: i32, offset_y: i32, r: i32, color: Color )

source§

fn image(&mut self, start_x: i32, start_y: i32, w: u32, h: u32, data: &[Color])

Display an image
source§

fn image_legacy( &mut self, start_x: i32, start_y: i32, w: u32, h: u32, data: &[Color] )

source§

fn image_over(&mut self, start: i32, image_data: &[Color])

Display an image overwriting a portion of window starting at given line : very quick!!
source§

fn image_opaque( &mut self, start_x: i32, start_y: i32, w: u32, h: u32, image_data: &[Color] )

Display an image using non transparent method
source§

fn image_fast( &mut self, start_x: i32, start_y: i32, w: u32, h: u32, image_data: &[Color] )

source§

fn linear_gradient( &mut self, rect_x: i32, rect_y: i32, rect_width: u32, rect_height: u32, start_x: i32, start_y: i32, end_x: i32, end_y: i32, start_color: Color, end_color: Color )

Draw a linear gradient in a rectangular region
source§

fn rounded_rect( &mut self, x: i32, y: i32, w: u32, h: u32, radius: u32, filled: bool, color: Color )

Draw a rect with rounded corners
source§

fn wu_line(&mut self, x0: i32, y0: i32, x1: i32, y1: i32, color: Color)

Draws antialiased line
source§

fn wu_circle(&mut self, x0: i32, y0: i32, radius: i32, color: Color)

Draws antialiased circle
source§

fn getpixel(&self, x: i32, y: i32) -> Color

Gets pixel color at x,y position

Auto Trait Implementations§

§

impl !RefUnwindSafe for Window

§

impl !Send for Window

§

impl !Sync for Window

§

impl Unpin for Window

§

impl UnwindSafe for Window

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.