GdkScreen

GdkScreen — Object representing a physical screen

Functions

Properties

gdouble resolution Read / Write

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── GdkScreen

Includes

#include <gdk/gdk.h>

Description

GdkScreen objects are the GDK representation of the screen on which windows can be displayed and on which the pointer moves. X originally identified screens with physical screens, but nowadays it is more common to have a single GdkScreen which combines several physical monitors (see gdk_screen_get_n_monitors()).

GdkScreen is used throughout GDK and GTK+ to specify which screen the top level windows are to be displayed on.

Functions

gdk_screen_get_default ()

GdkScreen *
gdk_screen_get_default (void);

Gets the default screen for the default display. (See gdk_display_get_default()).

Returns

a GdkScreen, or NULL if there is no default display.

[nullable][transfer none]

Since: 2.2

gdk_screen_get_display ()

GdkDisplay *
gdk_screen_get_display (GdkScreen *screen);

Gets the display to which the screen belongs.

Parameters

screen

a GdkScreen

 

Returns

the display to which screen belongs.

[transfer none]

Since: 2.2

gdk_screen_get_toplevel_windows ()

GList *
gdk_screen_get_toplevel_windows (GdkScreen *screen);

Obtains a list of all toplevel windows known to GDK on the screen screen . A toplevel window has no parent window.

The returned list should be freed with g_list_free(), but its elements need not be freed.

Parameters

screen

The GdkScreen where the toplevels are located.

 

Returns

list of toplevel windows, free with g_list_free().

[transfer container][element-type GdkWindow]

Since: 2.2

gdk_screen_get_setting ()

gboolean
gdk_screen_get_setting (GdkScreen *screen,
                        const gchar *name,
                        GValue *value);

Retrieves a desktop-wide setting such as double-click time for the GdkScreen screen .

FIXME needs a list of valid settings here, or a link to more information.

Parameters

screen

the GdkScreen where the setting is located

 

name

the name of the setting

 

value

location to store the value of the setting

 

Returns

TRUE if the setting existed and a value was stored in value , FALSE otherwise.

Since: 2.2

gdk_screen_get_resolution ()

gdouble
gdk_screen_get_resolution (GdkScreen *screen);

Gets the resolution for font handling on the screen; see gdk_screen_set_resolution() for full details.

Parameters

screen

a GdkScreen

 

Returns

the current resolution, or -1 if no resolution has been set.

Since: 2.10

gdk_screen_set_resolution ()

void
gdk_screen_set_resolution (GdkScreen *screen,
                           gdouble dpi);

Sets the resolution for font handling on the screen. This is a scale factor between points specified in a PangoFontDescription and cairo units. The default value is 96, meaning that a 10 point font will be 13 units high. (10 * 96. / 72. = 13.3).

Parameters

screen

a GdkScreen

 

dpi

the resolution in “dots per inch”. (Physical inches aren’t actually involved; the terminology is conventional.)

 

Since: 2.10

Types and Values

GdkScreen

typedef struct _GdkScreen GdkScreen;

Property Details

The “resolution” property

  “resolution”               gdouble

The resolution for fonts on the screen.

Flags: Read / Write

Allowed values: [-1,10000]

Default value: -1

Signal Details

The “monitors-changed” signal

void
user_function (GdkScreen *screen,
               gpointer   user_data)

The ::monitors-changed signal is emitted when the number, size or position of the monitors attached to the screen change.

Only for X11 and OS X for now. A future implementation for Win32 may be a possibility.

Parameters

screen

the object on which the signal is emitted

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 2.14