[]Struct gdk::Display

pub struct Display(_, _);

Display objects purpose are two fold:

Display objects are the GDK representation of an X Display, which can be described as a workstation consisting of a keyboard, a pointing device (such as a mouse) and one or more screens. It is used to open and keep track of various Screen objects currently instantiated by the application. It is also used to access the keyboard(s) and mouse pointer(s) of the display.

Most of the input device handling has been factored out into the separate DeviceManager object. Every display has a device manager, which you can obtain using Display::get_device_manager.

Implementations

impl Display[src]

pub fn beep(&self)[src]

Emits a short beep on self

pub fn close(&self)[src]

Closes the connection to the windowing system for the given display, and cleans up associated resources.

pub fn device_is_grabbed(&self, device: &Device) -> bool[src]

Returns true if there is an ongoing grab on device for self.

device

a Device

Returns

true if there is a grab in effect for device.

pub fn flush(&self)[src]

Flushes any requests queued for the windowing system; this happens automatically when the main loop blocks waiting for new events, but if your application is drawing without returning control to the main loop, you may need to call this function explicitly. A common case where this function needs to be called is when an application is executing drawing commands from a thread other than the thread where the main loop is running.

This is most useful for X11. On windowing systems where requests are handled synchronously, this function will do nothing.

pub fn get_app_launch_context(&self) -> Option<AppLaunchContext>[src]

Returns a AppLaunchContext suitable for launching applications on the given display.

Returns

a new AppLaunchContext for self. Free with gobject::Object::unref when done

pub fn get_default_cursor_size(&self) -> u32[src]

Returns the default size to use for cursors on self.

Returns

the default cursor size.

pub fn get_default_group(&self) -> Window[src]

Returns the default group leader window for all toplevel windows on self. This window is implicitly created by GDK. See WindowExt::set_group.

Returns

The default group leader window for self

pub fn get_default_screen(&self) -> Screen[src]

Get the default Screen for self.

Returns

the default Screen object for self

pub fn get_default_seat(&self) -> Option<Seat>[src]

Returns the default Seat for this display.

Feature: v3_20

Returns

the default seat.

pub fn get_device_manager(&self) -> Option<DeviceManager>[src]

Returns the DeviceManager associated to self.

Deprecated since 3.20

Use Display::get_default_seat and Seat operations.

Returns

A DeviceManager, or None. This memory is owned by GDK and must not be freed or unreferenced.

pub fn get_event(&self) -> Option<Event>[src]

Gets the next GdkEvent to be processed for self, fetching events from the windowing system if necessary.

Returns

the next GdkEvent to be processed, or None if no events are pending. The returned GdkEvent should be freed with gdk_event_free.

pub fn get_maximal_cursor_size(&self) -> (u32, u32)[src]

Gets the maximal size to use for cursors on self.

width

the return location for the maximal cursor width

height

the return location for the maximal cursor height

pub fn get_monitor(&self, monitor_num: i32) -> Option<Monitor>[src]

Gets a monitor associated with this display.

Feature: v3_22

monitor_num

number of the monitor

Returns

the Monitor, or None if monitor_num is not a valid monitor number

pub fn get_monitor_at_point(&self, x: i32, y: i32) -> Option<Monitor>[src]

Gets the monitor in which the point (x, y) is located, or a nearby monitor if the point is not in any monitor.

Feature: v3_22

x

the x coordinate of the point

y

the y coordinate of the point

Returns

the monitor containing the point

pub fn get_monitor_at_window<P: IsA<Window>>(
    &self,
    window: &P
) -> Option<Monitor>
[src]

Gets the monitor in which the largest area of window resides, or a monitor close to window if it is outside of all monitors.

Feature: v3_22

window

a Window

Returns

the monitor with the largest overlap with window

pub fn get_n_monitors(&self) -> i32[src]

Gets the number of monitors that belong to self.

The returned number is valid until the next emission of the Display::monitor-added or Display::monitor-removed signal.

Feature: v3_22

Returns

the number of monitors

pub fn get_name(&self) -> GString[src]

Gets the name of the display.

Returns

a string representing the display name. This string is owned by GDK and should not be modified or freed.

pub fn get_primary_monitor(&self) -> Option<Monitor>[src]

Gets the primary monitor for the display.

The primary monitor is considered the monitor where the “main desktop” lives. While normal application windows typically allow the window manager to place the windows, specialized desktop applications such as panels should place themselves on the primary monitor.

Feature: v3_22

Returns

the primary monitor, or None if no primary monitor is configured by the user

pub fn get_screen(&self, screen_num: i32) -> Screen[src]

Returns a screen object for one of the screens of the display.

Deprecated since 3.20

There is only one screen; use Display::get_default_screen to get it.

screen_num

the screen number

Returns

the Screen object

pub fn has_pending(&self) -> bool[src]

Returns whether the display has events that are waiting to be processed.

Returns

true if there are events ready to be processed.

pub fn is_closed(&self) -> bool[src]

Finds out if the display has been closed.

Returns

true if the display is closed.

pub fn list_seats(&self) -> Vec<Seat>[src]

Returns the list of seats known to self.

Feature: v3_20

Returns

the list of seats known to the Display

pub fn notify_startup_complete(&self, startup_id: &str)[src]

Indicates to the GUI environment that the application has finished loading, using a given identifier.

GTK+ will call this function automatically for GtkWindow with custom startup-notification identifier unless gtk_window_set_auto_startup_notification is called to disable that feature.

startup_id

a startup-notification identifier, for which notification process should be completed

pub fn peek_event(&self) -> Option<Event>[src]

Gets a copy of the first GdkEvent in the self’s event queue, without removing the event from the queue. (Note that this function will not get more events from the windowing system. It only checks the events that have already been moved to the GDK event queue.)

Returns

a copy of the first GdkEvent on the event queue, or None if no events are in the queue. The returned GdkEvent should be freed with gdk_event_free.

pub fn put_event(&self, event: &Event)[src]

Appends a copy of the given event onto the front of the event queue for self.

event

a GdkEvent.

pub fn request_selection_notification(&self, selection: &Atom) -> bool[src]

Request EventOwnerChange events for ownership changes of the selection named by the given atom.

selection

the Atom naming the selection for which ownership change notification is requested

Returns

whether EventOwnerChange events will be sent.

pub fn set_double_click_distance(&self, distance: u32)[src]

Sets the double click distance (two clicks within this distance count as a double click and result in a EventType::2buttonPress event). See also Display::set_double_click_time. Applications should not set this, it is a global user-configured setting.

distance

distance in pixels

pub fn set_double_click_time(&self, msec: u32)[src]

Sets the double click time (two clicks within this time interval count as a double click and result in a EventType::2buttonPress event). Applications should not set this, it is a global user-configured setting.

msec

double click time in milliseconds (thousandths of a second)

pub fn store_clipboard<P: IsA<Window>>(
    &self,
    clipboard_window: &P,
    time_: u32,
    targets: &[&Atom]
)
[src]

Issues a request to the clipboard manager to store the clipboard data. On X11, this is a special program that works according to the FreeDesktop Clipboard Specification.

clipboard_window

a Window belonging to the clipboard owner

time_

a timestamp

targets

an array of targets that should be saved, or None if all available targets should be saved.

n_targets

length of the targets array

pub fn supports_clipboard_persistence(&self) -> bool[src]

Returns whether the speicifed display supports clipboard persistance; i.e. if it’s possible to store the clipboard data after an application has quit. On X11 this checks if a clipboard daemon is running.

Returns

true if the display supports clipboard persistance.

pub fn supports_composite(&self) -> bool[src]

Returns true if WindowExt::set_composited can be used to redirect drawing on the window using compositing.

Currently this only works on X11 with XComposite and XDamage extensions available.

Deprecated since 3.16

Compositing is an outdated technology that only ever worked on X11.

Returns

true if windows may be composited.

pub fn supports_cursor_alpha(&self) -> bool[src]

Returns true if cursors can use an 8bit alpha channel on self. Otherwise, cursors are restricted to bilevel alpha (i.e. a mask).

Returns

whether cursors can have alpha channels.

pub fn supports_cursor_color(&self) -> bool[src]

Returns true if multicolored cursors are supported on self. Otherwise, cursors have only a forground and a background color.

Returns

whether cursors can have multiple colors.

pub fn supports_input_shapes(&self) -> bool[src]

Returns true if gdk_window_input_shape_combine_mask can be used to modify the input shape of windows on self.

Returns

true if windows with modified input shape are supported

pub fn supports_selection_notification(&self) -> bool[src]

Returns whether EventOwnerChange events will be sent when the owner of a selection changes.

Returns

whether EventOwnerChange events will be sent.

pub fn supports_shapes(&self) -> bool[src]

Returns true if gdk_window_shape_combine_mask can be used to create shaped windows on self.

Returns

true if shaped windows are supported

pub fn sync(&self)[src]

Flushes any requests queued for the windowing system and waits until all requests have been handled. This is often used for making sure that the display is synchronized with the current state of the program. Calling Display::sync before gdk_error_trap_pop makes sure that any errors generated from earlier requests are handled before the error trap is removed.

This is most useful for X11. On windowing systems where requests are handled synchronously, this function will do nothing.

pub fn get_default() -> Option<Display>[src]

Gets the default Display. This is a convenience function for: gdk_display_manager_get_default_display (gdk_display_manager_get ()).

Returns

a Display, or None if there is no default display.

pub fn open(display_name: &str) -> Option<Display>[src]

Opens a display.

display_name

the name of the display to open

Returns

a Display, or None if the display could not be opened

pub fn open_default_libgtk_only() -> Option<Display>[src]

Opens the default display specified by command line arguments or environment variables, sets it as the default display, and returns it. gdk_parse_args must have been called first. If the default display has previously been set, simply returns that. An internal function that should not be used by applications.

Deprecated since 3.16

This symbol was never meant to be used outside of GTK+

Returns

the default display, if it could be opened, otherwise None.

pub fn connect_closed<F: Fn(&Display, bool) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

The ::closed signal is emitted when the connection to the windowing system for display is closed.

is_error

true if the display was closed due to an error

pub fn connect_monitor_added<F: Fn(&Display, &Monitor) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

The ::monitor-added signal is emitted whenever a monitor is added.

Feature: v3_22

monitor

the monitor that was just added

pub fn connect_monitor_removed<F: Fn(&Display, &Monitor) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

The ::monitor-removed signal is emitted whenever a monitor is removed.

Feature: v3_22

monitor

the monitor that was just removed

pub fn connect_opened<F: Fn(&Display) + 'static>(&self, f: F) -> SignalHandlerId[src]

The ::opened signal is emitted when the connection to the windowing system for display is opened.

pub fn connect_seat_added<F: Fn(&Display, &Seat) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

The ::seat-added signal is emitted whenever a new seat is made known to the windowing system.

Feature: v3_20

seat

the seat that was just added

pub fn connect_seat_removed<F: Fn(&Display, &Seat) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

The ::seat-removed signal is emitted whenever a seat is removed by the windowing system.

Feature: v3_20

seat

the seat that was just removed

Trait Implementations

impl Clone for Display

impl Debug for Display

impl Display for Display[src]

impl Eq for Display

impl Hash for Display

impl Ord for Display

impl<T: ObjectType> PartialEq<T> for Display

impl<T: ObjectType> PartialOrd<T> for Display

impl StaticType for Display

Auto Trait Implementations

impl RefUnwindSafe for Display

impl !Send for Display

impl !Sync for Display

impl Unpin for Display

impl UnwindSafe for Display

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 

impl<T> Cast for T where
    T: ObjectType, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType, 

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<Array>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToSendValue for T where
    T: ToValue + SetValue + Send + ?Sized

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.