[]Struct gdk::DisplayManager

pub struct DisplayManager(_, _);

The purpose of the DisplayManager singleton object is to offer notification when displays appear or disappear or the default display changes.

You can use DisplayManager::get to obtain the DisplayManager singleton, but that should be rarely necessary. Typically, initializing GTK+ opens a display that you can work with without ever accessing the DisplayManager.

The GDK library can be built with support for multiple backends. The DisplayManager object determines which backend is used at runtime.

When writing backend-specific code that is supposed to work with multiple GDK backends, you have to consider both compile time and runtime. At compile time, use the GDK_WINDOWING_X11, GDK_WINDOWING_WIN32 macros, etc. to find out which backends are present in the GDK library you are building your application against. At runtime, use type-check macros like GDK_IS_X11_DISPLAY() to find out which backend is in use:

Backend-specific code ## {backend-specific}

#ifdef GDK_WINDOWING_X11
  if (GDK_IS_X11_DISPLAY (display))
    {
      // make X11-specific calls here
    }
  else
#endif
#ifdef GDK_WINDOWING_QUARTZ
  if (GDK_IS_QUARTZ_DISPLAY (display))
    {
      // make Quartz-specific calls here
    }
  else
#endif
  g_error ("Unsupported GDK backend");

Implementations

impl DisplayManager[src]

pub fn get_default_display(&self) -> Option<Display>[src]

Gets the default Display.

Returns

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

pub fn list_displays(&self) -> Vec<Display>[src]

List all currently open displays.

Returns

a newly allocated glib::SList of Display objects. Free with glib::SList::free when you are done with it.

pub fn open_display(&self, name: &str) -> Option<Display>[src]

Opens a display.

name

the name of the display to open

Returns

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

pub fn set_default_display(&self, display: &Display)[src]

Sets display as the default display.

display

a Display

pub fn get() -> DisplayManager[src]

Gets the singleton DisplayManager object.

When called for the first time, this function consults the GDK_BACKEND environment variable to find out which of the supported GDK backends to use (in case GDK has been compiled with multiple backends). Applications can use gdk_set_allowed_backends to limit what backends can be used.

Returns

The global DisplayManager singleton; gdk_parse_args, gdk_init, or gdk_init_check must have been called first.

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

The ::display-opened signal is emitted when a display is opened.

display

the opened display

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

Trait Implementations

impl Clone for DisplayManager

impl Debug for DisplayManager

impl Display for DisplayManager[src]

impl Eq for DisplayManager

impl Hash for DisplayManager

impl Ord for DisplayManager

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

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

impl StaticType for DisplayManager

Auto Trait Implementations

impl RefUnwindSafe for DisplayManager

impl !Send for DisplayManager

impl !Sync for DisplayManager

impl Unpin for DisplayManager

impl UnwindSafe for DisplayManager

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.