Main Page Widgets Namespaces Book

# Gdk::Screen Class Reference

Inheritance diagram for Gdk::Screen:

[legend]
List of all members.

## Public Member Functions

virtual | ~Screen ()
GdkScreen* | gobj ()
| Provides access to the underlying C GObject.
const GdkScreen* | gobj () const
| Provides access to the underlying C GObject.
GdkScreen* | gobj_copy ()
Glib::RefPtr<Colormap> | get_default_colormap ()
| Gets the default colormap for screen .
Glib::RefPtr<const Colormap> | get_default_colormap () const
| Gets the default colormap for screen .
void | set_default_colormap (const Glib::RefPtr<const Colormap>& colormap)
| Sets the default colormap for screen .
Glib::RefPtr<Colormap> | get_system_colormap ()
| Gets the system's default colormap for screen.
Glib::RefPtr<const Colormap> | get_system_colormap () const
| Gets the system's default colormap for screen.
Glib::RefPtr<Visual> | get_system_visual ()
| Get the system's default visual for screen .
Glib::RefPtr<const Visual> | get_system_visual () const
| Get the system's default visual for screen .
Glib::RefPtr<Colormap> | get_rgb_colormap ()
| Gets the preferred colormap for rendering image data on screen .
Glib::RefPtr<const Colormap> | get_rgb_colormap () const
| Gets the preferred colormap for rendering image data on screen .
Glib::RefPtr<Visual> | get_rgb_visual ()
| Gets a "preferred visual" chosen by GdkRGB for rendering image data on screen .
Glib::RefPtr<const Visual> | get_rgb_visual () const
| Gets a "preferred visual" chosen by GdkRGB for rendering image data on screen .
Glib::RefPtr<Window> | get_root_window ()
| Gets the root window of screen .
Glib::RefPtr<const Window> | get_root_window () const
| Gets the root window of screen .
Glib::RefPtr<Display> | get_display ()
| Gets the display to which the screen belongs.
Glib::RefPtr<const Display> | get_display () const
| Gets the display to which the screen belongs.
int | get_number () const
| Gets the index of screen among the screens in the display to which it belongs.
int | get_width () const
| Gets the width of screen in pixels.
int | get_height () const
| Gets the height of screen in pixels.
int | get_width_mm () const
| Gets the width of screen in millimeters.
int | get_height_mm () const
| Returns the height of screen in millimeters.
Glib::ListHandle< Glib::RefPtr< Visual > > | list_visuals ()
| Lists the available visuals for the specified screen .
Glib::ListHandle< Glib::RefPtr< Window > > | get_toplevel_windows ()
| Obtains a list of all toplevel windows known to GDK on the screen screen .
Glib::ustring | make_display_name ()
| Determines the name to pass to Gdk::Display::open() to get a Gdk::Display with this screen as the default screen.
int | get_n_monitors () const
| Returns the number of monitors being part of the virtual screen.
void | get_monitor_geometry (int monitor_num, Rectangle& dest) const
| Retrieves the Gdk::Rectangle representing the size and start coordinates of the individual monitor within the the entire virtual screen.
int | get_monitor_at_point (int x, int y) const
| Returns the monitor number in which the point ( x , y ) is located.
int | get_monitor_at_window (const Glib::RefPtr<Window>& window) const
void | broadcast_client_message (GdkEvent* event)
| Sends an X ClientMessage event to all toplevel windows on screen .
template <class ValueType> bool | get_setting (const Glib::ustring& name, ValueType& value) const
Glib::SignalProxy0<void> | signal_size_changed ()

## Static Public Member Functions

Glib::RefPtr<Screen> | get_default ()
| Gets the default screen for the default display.

## Protected Member Functions

virtual void | on_size_changed ()

## Related Functions

(Note that these are not member functions.)
Glib::RefPtr<Gdk::Screen> | wrap (GdkScreen* object, bool take_copy=false)

## Constructor & Destructor Documentation

virtual Gdk::Screen::~Screen | ( |  | ) | `[virtual]`

## Member Function Documentation

void Gdk::Screen::broadcast_client_message | ( | GdkEvent* | event | ) |

Sends an X ClientMessage event to all toplevel windows on screen .

Toplevel windows are determined by checking for the WM_STATE property, as described in the Inter-Client Communication Conventions Manual (ICCCM). If no windows are found with the WM_STATE property set, the message is sent to all children of the root window.

Since: 2.2

Parameters:

  event | The Gdk::Event.

Glib::RefPtr<Screen> Gdk::Screen::get_default | ( |  | ) | `[static]`

Gets the default screen for the default display.

(See Gdk::Display::get_default()).

Returns:
  A Gdk::Screen, or `0` if there is no default display.

Since: 2.2.

Glib::RefPtr<const Colormap> Gdk::Screen::get_default_colormap | ( |  | ) | const

Gets the default colormap for screen .

Returns:
  The default Gdk::Colormap.

Since: 2.2.

Glib::RefPtr<Colormap> Gdk::Screen::get_default_colormap | ( |  | ) |

Gets the default colormap for screen .

Returns:
  The default Gdk::Colormap.

Since: 2.2.

Glib::RefPtr<const Display> Gdk::Screen::get_display | ( |  | ) | const

Gets the display to which the screen belongs.

Returns:
  The display to which screen belongs

Since: 2.2.

Glib::RefPtr<Display> Gdk::Screen::get_display | ( |  | ) |

Gets the display to which the screen belongs.

Returns:
  The display to which screen belongs

Since: 2.2.

int Gdk::Screen::get_height | ( |  | ) | const

Gets the height of screen in pixels.

Returns:
  The height of screen in pixels.

Since: 2.2.

int Gdk::Screen::get_height_mm | ( |  | ) | const

Returns the height of screen in millimeters.

Note that on some X servers this value will not be correct.

Returns:
  The heigth of screen in pixels.

Since: 2.2.

int Gdk::Screen::get_monitor_at_point | ( | int | x,
|  | int | y
| ) | const

Returns the monitor number in which the point ( x , y ) is located.

Parameters:

  x | The x coordinate in the virtual screen.
  y | The y coordinate in the virtual screen.

Returns:
  The monitor number in which the point ( x , y ) lies, or a monitor close to ( x , y ) if the point is not in any monitor.

Since: 2.2.

int Gdk::Screen::get_monitor_at_window | ( | const Glib::RefPtr<Window>& | window | ) | const

Parameters:

  window | A Gdk::Window.

Returns:
  The monitor number in which most of window is located, or if window does not intersect any monitors, a monitor, close to window . the number of the monitor in which the largest area of the bounding rectangle of window resides.

Since: 2.2.

void Gdk::Screen::get_monitor_geometry | ( | int | monitor_num,
|  | Rectangle& | dest
| ) | const

Retrieves the Gdk::Rectangle representing the size and start coordinates of the individual monitor within the the entire virtual screen.

Note that the virtual screen coordinates can be retrieved via get_width() and get_height().

Since: 2.2

Parameters:

  monitor_num | The monitor number.
  dest | A Gdk::Rectangle to be filled with the monitor geometry.

int Gdk::Screen::get_n_monitors | ( |  | ) | const

Returns the number of monitors being part of the virtual screen.

Returns:
  Number of monitors part of the virtual screen or 0 if screen is not in virtual screen mode.

Since: 2.2.

int Gdk::Screen::get_number | ( |  | ) | const

Gets the index of screen among the screens in the display to which it belongs.

(See get_display())

Returns:
  The index

Since: 2.2.

Glib::RefPtr<const Colormap> Gdk::Screen::get_rgb_colormap | ( |  | ) | const

Gets the preferred colormap for rendering image data on screen .

Not a very useful function; historically, GDK could only render RGB image data to one colormap and visual, but in the current version it can render to any colormap and visual. So there's no need to call this function.

Returns:
  The preferred colormap

Since: 2.2.

Glib::RefPtr<Colormap> Gdk::Screen::get_rgb_colormap | ( |  | ) |

Gets the preferred colormap for rendering image data on screen .

Not a very useful function; historically, GDK could only render RGB image data to one colormap and visual, but in the current version it can render to any colormap and visual. So there's no need to call this function.

Returns:
  The preferred colormap

Since: 2.2.

Glib::RefPtr<const Visual> Gdk::Screen::get_rgb_visual | ( |  | ) | const

Gets a "preferred visual" chosen by GdkRGB for rendering image data on screen .

In previous versions of GDK, this was the only visual GdkRGB could use for rendering. In current versions, it's simply the visual GdkRGB would have chosen as the optimal one in those previous versions. GdkRGB can now render to drawables with any visual.

Returns:
  The Gdk::Visual chosen by GdkRGB.

Since: 2.2.

Glib::RefPtr<Visual> Gdk::Screen::get_rgb_visual | ( |  | ) |

Gets a "preferred visual" chosen by GdkRGB for rendering image data on screen .

In previous versions of GDK, this was the only visual GdkRGB could use for rendering. In current versions, it's simply the visual GdkRGB would have chosen as the optimal one in those previous versions. GdkRGB can now render to drawables with any visual.

Returns:
  The Gdk::Visual chosen by GdkRGB.

Since: 2.2.

Glib::RefPtr<const Window> Gdk::Screen::get_root_window | ( |  | ) | const

Gets the root window of screen .

Returns:
  The root window

Since: 2.2.

Glib::RefPtr<Window> Gdk::Screen::get_root_window | ( |  | ) |

Gets the root window of screen .

Returns:
  The root window

Since: 2.2.

template <class ValueType>
bool Gdk::Screen::get_setting | ( | const Glib::ustring& | name,
|  | ValueType& | value
| ) | const

Glib::RefPtr<const Colormap> Gdk::Screen::get_system_colormap | ( |  | ) | const

Gets the system's default colormap for screen.

Returns:
  The default colormap for screen .

Since: 2.2.

Glib::RefPtr<Colormap> Gdk::Screen::get_system_colormap | ( |  | ) |

Gets the system's default colormap for screen.

Returns:
  The default colormap for screen .

Since: 2.2.

Glib::RefPtr<const Visual> Gdk::Screen::get_system_visual | ( |  | ) | const

Get the system's default visual for screen .

This is the visual for the root window of the display. The return value should not be freed.

Returns:
  The system visual

Since: 2.2.

Glib::RefPtr<Visual> Gdk::Screen::get_system_visual | ( |  | ) |

Get the system's default visual for screen .

This is the visual for the root window of the display. The return value should not be freed.

Returns:
  The system visual

Since: 2.2.

Glib::ListHandle<Glib::RefPtr<Window>> Gdk::Screen::get_toplevel_windows | ( |  | ) |

Obtains a list of all toplevel windows known to GDK on the screen screen .

A toplevel window is a child of the root window (see gdk_get_default_root_window()).

Returns:
  List of toplevel windows.

Since: 2.2.

int Gdk::Screen::get_width | ( |  | ) | const

Gets the width of screen in pixels.

Returns:
  The width of screen in pixels.

Since: 2.2.

int Gdk::Screen::get_width_mm | ( |  | ) | const

Gets the width of screen in millimeters.

Note that on some X servers this value will not be correct.

Returns:
  The width of screen in pixels.

Since: 2.2.

const GdkScreen* Gdk::Screen::gobj | ( |  | ) | const`[inline]`

| Provides access to the underlying C GObject. Reimplemented from Glib::ObjectBase.

GdkScreen* Gdk::Screen::gobj | ( |  | ) | `[inline]`

| Provides access to the underlying C GObject. Reimplemented from Glib::ObjectBase.

GdkScreen* Gdk::Screen::gobj_copy | ( |  | ) |

Glib::ListHandle<Glib::RefPtr<Visual>> Gdk::Screen::list_visuals | ( |  | ) |

Lists the available visuals for the specified screen .

A visual describes a hardware image data format. For example, a visual might support 24-bit color, or 8-bit color, and might expect pixels to be in a certain format.

Returns:
  A list of visuals.

Since: 2.2.

Glib::ustring Gdk::Screen::make_display_name | ( |  | ) |

Determines the name to pass to Gdk::Display::open() to get a Gdk::Display with this screen as the default screen.

Returns:
  A newly allocated string, free with Glib::free()

Since: 2.2.

virtual void Gdk::Screen::on_size_changed | ( |  | ) | `[protected, virtual]`

void Gdk::Screen::set_default_colormap | ( | const Glib::RefPtr<const Colormap>& | colormap | ) |

Sets the default colormap for screen .

Since: 2.2

Parameters:

  colormap | A Gdk::Colormap.

Glib::SignalProxy0<void> Gdk::Screen::signal_size_changed | ( |  | ) |

Prototype:
  `void size_changed()`

## Friends And Related Function Documentation

Glib::RefPtr<Gdk::Screen> wrap | ( | GdkScreen* | object,
|  | bool | take_copy = false
| ) | `[related]`

The documentation for this class was generated from the following file:

- screen.h