Index

Package: Screen

Description

package Gdk.Screen is

Gdk.Screen.Gdk_Screen 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 Gdk.Screen.Gdk_Screen 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. it is also used to query the screen specification and default settings such as the default visual (gdk_screen_get_system_visual), the dimensions of the physical monitors (gdk_screen_get_monitor_geometry), etc.

Classes

Gdk_Screen_Record

type Gdk_Screen_Record is new GObject_Record with null record;

Ancestors:

Primitive operations:

Get_Active_Window
Get_Font_Options
Get_Height_Mm
Get_Monitor_At_Point
Get_Monitor_At_Window
Get_Monitor_Geometry
Get_Monitor_Height_Mm
Get_Monitor_Plug_Name
Get_Monitor_Width_Mm
Get_Monitor_Workarea
Get_N_Monitors
Get_Primary_Monitor
Get_Resolution
Get_Rgba_Visual
Get_Root_Window
Get_System_Visual
Get_Width_Mm
Glib.Object.Deallocate (Inherited)
Glib.Object.Get_Type (Inherited)
Glib.Object.Notify (Inherited)
Glib.Object.Ref (Inherited)
Glib.Object.Ref_Sink (Inherited)
Glib.Object.Unref (Inherited)
Is_Composited
Make_Display_Name
Set_Font_Options
Set_Resolution
Warp_Pointer

Types

Gdk_Screen

type Gdk_Screen is access all Gdk_Screen_Record'Class;

Constants & Global variables

Font_Options_Property (Glib.Properties.Property_String)

Font_Options_Property : constant Glib.Properties.Property_String :=
   Glib.Properties.Build ("font-options");

Resolution_Property (Glib.Properties.Property_Double)

Resolution_Property : constant Glib.Properties.Property_Double;
Type: Gdouble

Signal_Composited_Changed (Glib.Signal_Name)

Signal_Composited_Changed : constant Glib.Signal_Name := "composited-changed";
The ::composited-changed signal is emitted when the composited status of the screen changes procedure Handler (Self : access Gdk_Screen_Record'Class)

Signal_Monitors_Changed (Glib.Signal_Name)

Signal_Monitors_Changed : constant Glib.Signal_Name := "monitors-changed";
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. procedure Handler (Self : access Gdk_Screen_Record'Class)

Signal_Size_Changed (Glib.Signal_Name)

Signal_Size_Changed : constant Glib.Signal_Name := "size-changed";
The ::size-changed signal is emitted when the pixel width or height of a screen changes. procedure Handler (Self : access Gdk_Screen_Record'Class)

Subprograms & Entries

Get_Type

function Get_Type return Glib.GType;

Get_Active_Window

function Get_Active_Window 
(Screen: not null access Gdk_Screen_Record) return Gdk.Gdk_Window;
Returns the screen's currently active window. On X11, this is done by inspecting the _NET_ACTIVE_WINDOW property on the root window, as described in the <ulink url="http://www.freedesktop.org/Standards/wm-spec">Extended Window Manager Hints</ulink>. If there is no currently currently active window, or the window manager does not support the _NET_ACTIVE_WINDOW hint, this function returns null. On other platforms, this function may return null, depending on whether it is implementable on that platform. The returned window should be unrefed using g_object_unref when no longer needed. Since: gtk+ 2.10

Get_Display

function Get_Display 
(Screen: not null access Gdk_Screen_Record) return Gdk.Display.Gdk_Display;
Gets the display to which the Screen belongs. Since: gtk+ 2.2

Get_Font_Options

function Get_Font_Options 
(Screen: not null access Gdk_Screen_Record) return Cairo.Cairo_Font_Options;
Gets any options previously set with Gdk.Screen.Set_Font_Options. Since: gtk+ 2.10

Set_Font_Options

procedure Set_Font_Options 
(Screen: not null access Gdk_Screen_Record;
Options: in out Cairo.Cairo_Font_Options);
Sets the default font options for the screen. These options will be set on any Pango.Context.Pango_Context's newly created with gdk_pango_context_get_for_screen. Changing the default set of font options does not affect contexts that have already been created. Since: gtk+ 2.10 "options": a Cairo.Cairo_Font_Options, or null to unset any previously set default font options.

Get_Height

function Get_Height 
(Screen: not null access Gdk_Screen_Record) return Gint;
Gets the height of Screen in pixels Since: gtk+ 2.2

Get_Height_Mm

function Get_Height_Mm 
(Screen: not null access Gdk_Screen_Record) return Gint;
Returns the height of Screen in millimeters. Note that on some X servers this value will not be correct. Since: gtk+ 2.2

Get_Monitor_At_Point

function Get_Monitor_At_Point 
(Screen: not null access Gdk_Screen_Record;
X: Gint;
Y: Gint) return Gint;
Returns the monitor number in which the point (X,Y) is located. Since: gtk+ 2.2 "x": the x coordinate in the virtual screen. "y": the y coordinate in the virtual screen.

Get_Monitor_At_Window

function Get_Monitor_At_Window 
(Screen: not null access Gdk_Screen_Record;
Window: Gdk.Gdk_Window) return Gint;
Returns the number of the monitor in which the largest area of the bounding rectangle of Window resides. Since: gtk+ 2.2 "window": a Gdk.Gdk_Window

Get_Monitor_Geometry

procedure Get_Monitor_Geometry 
(Screen: not null access Gdk_Screen_Record;
Monitor_Num: Gint;
Dest: out Gdk.Rectangle.Gdk_Rectangle);
Retrieves the Gdk.Rectangle.Gdk_Rectangle representing the size and position of the individual monitor within the entire screen area. Monitor numbers start at 0. To obtain the number of monitors of Screen, use Gdk.Screen.Get_N_Monitors. Note that the size of the entire screen area can be retrieved via Gdk.Screen.Get_Width and Gdk.Screen.Get_Height. Since: gtk+ 2.2 "monitor_num": the monitor number "dest": a Gdk.Rectangle.Gdk_Rectangle to be filled with the monitor geometry

Get_Monitor_Height_Mm

function Get_Monitor_Height_Mm 
(Screen: not null access Gdk_Screen_Record;
Monitor_Num: Gint) return Gint;
Gets the height in millimeters of the specified monitor. Since: gtk+ 2.14 "monitor_num": number of the monitor, between 0 and gdk_screen_get_n_monitors (screen)

Get_Monitor_Plug_Name

function Get_Monitor_Plug_Name 
(Screen: not null access Gdk_Screen_Record;
Monitor_Num: Gint) return UTF8_String;
Returns the output name of the specified monitor. Usually something like VGA, DVI, or TV, not the actual product name of the display device. Since: gtk+ 2.14 "monitor_num": number of the monitor, between 0 and gdk_screen_get_n_monitors (screen)

Get_Monitor_Width_Mm

function Get_Monitor_Width_Mm 
(Screen: not null access Gdk_Screen_Record;
Monitor_Num: Gint) return Gint;
Gets the width in millimeters of the specified monitor, if available. Since: gtk+ 2.14 "monitor_num": number of the monitor, between 0 and gdk_screen_get_n_monitors (screen)

Get_Monitor_Workarea

procedure Get_Monitor_Workarea 
(Screen: not null access Gdk_Screen_Record;
Monitor_Num: Gint;
Dest: out Gdk.Rectangle.Gdk_Rectangle);
Retrieves the Gdk.Rectangle.Gdk_Rectangle representing the size and position of the "work area" on a monitor within the entire screen area. The work area should be considered when positioning menus and similar popups, to avoid placing them below panels, docks or other desktop components. Monitor numbers start at 0. To obtain the number of monitors of Screen, use Gdk.Screen.Get_N_Monitors. Since: gtk+ 3.4 "monitor_num": the monitor number "dest": a Gdk.Rectangle.Gdk_Rectangle to be filled with the monitor workarea

Get_N_Monitors

function Get_N_Monitors 
(Screen: not null access Gdk_Screen_Record) return Gint;
Returns the number of monitors which Screen consists of. Since: gtk+ 2.2

Get_Number

function Get_Number 
(Screen: not null access Gdk_Screen_Record) return Gint;
Gets the index of Screen among the screens in the display to which it belongs. (See Gdk.Screen.Get_Display) Since: gtk+ 2.2

Get_Primary_Monitor

function Get_Primary_Monitor 
(Screen: not null access Gdk_Screen_Record) return Gint;
Gets the primary monitor for Screen. 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. If no primary monitor is configured by the user, the return value will be 0, defaulting to the first monitor. Since: gtk+ 2.20

Get_Resolution

function Get_Resolution 
(Screen: not null access Gdk_Screen_Record) return Gdouble;
Gets the resolution for font handling on the screen; see Gdk.Screen.Set_Resolution for full details. Since: gtk+ 2.10

Set_Resolution

procedure Set_Resolution 
(Screen: not null access Gdk_Screen_Record;
Dpi: Gdouble);
Sets the resolution for font handling on the screen. This is a scale factor between points specified in a Pango.Font.Pango_Font_Description and cairo units. The default value is 96, meaning that a 10 point font will be 13 units high. (10 * 96. / 72. = 13.3). Since: gtk+ 2.10 "dpi": the resolution in "dots per inch". (Physical inches aren't actually involved; the terminology is conventional.)

Get_Rgba_Visual

function Get_Rgba_Visual 
(Screen: not null access Gdk_Screen_Record) return Gdk.Visual.Gdk_Visual;
Gets a visual to use for creating windows with an alpha channel. The windowing system on which GTK+ is running may not support this capability, in which case null will be returned. Even if a non-null value is returned, its possible that the window's alpha channel won't be honored when displaying the window on the screen: in particular, for X an appropriate windowing manager and compositing manager must be running to provide appropriate display. This functionality is not implemented in the Windows backend. For setting an overall opacity for a top-level window, see Gdk.Window.Set_Opacity. Since: gtk+ 2.8

Get_Root_Window

function Get_Root_Window 
(Screen: not null access Gdk_Screen_Record) return Gdk.Gdk_Window;
Gets the root window of Screen. Since: gtk+ 2.2

Get_System_Visual

function Get_System_Visual 
(Screen: not null access Gdk_Screen_Record) return Gdk.Visual.Gdk_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. Since: gtk+ 2.2

Get_Width

function Get_Width 
(Screen: not null access Gdk_Screen_Record) return Gint;
Gets the width of Screen in pixels Since: gtk+ 2.2

Get_Width_Mm

function Get_Width_Mm 
(Screen: not null access Gdk_Screen_Record) return Gint;
Gets the width of Screen in millimeters. Note that on some X servers this value will not be correct. Since: gtk+ 2.2

Is_Composited

function Is_Composited 
(Screen: not null access Gdk_Screen_Record) return Boolean;
Returns whether windows with an RGBA visual can reasonably be expected to have their alpha channel drawn correctly on the screen. On X11 this function returns whether a compositing manager is compositing Screen. Since: gtk+ 2.10

Make_Display_Name

function Make_Display_Name 
(Screen: not null access Gdk_Screen_Record) return UTF8_String;
Determines the name to pass to Gdk.Display.Open to get a Gdk.Display.Gdk_Display with this screen as the default screen. Since: gtk+ 2.2

Get_Screen

function Get_Screen 
(Display: access Gdk.Display.Gdk_Display_Record'Class;
Screen_Num: Glib.Gint) return Gdk_Screen;
Returns a screen object for one of the screens of the display.

Get_Default_Screen

function Get_Default_Screen 
(Display: access Gdk.Display.Gdk_Display_Record'Class) return Gdk_Screen;
Get the default Gdk_Screen for display.

Get_Pointer

procedure Get_Pointer 
(Display: access Gdk.Display.Gdk_Display_Record'Class;
Screen: out Gdk_Screen;
X: out Glib.Gint;
Y: out Glib.Gint;
Mask: out Gdk.Types.Gdk_Modifier_Type);
Gets the current location of the pointer and the current modifier mask for a given display. (X, Y) are coordinates relative to the root window on the display

Warp_Pointer

procedure Warp_Pointer 
(Display: access Gdk.Display.Gdk_Display_Record'Class;
Screen: access Gdk_Screen_Record;
X: Glib.Gint;
Y: Glib.Gint);
Warps the pointer of display to the point x,y on the screen screen, unless the pointer is confined to a window by a grab, in which case it will be moved as far as allowed by the grab. Warping the pointer creates events as if the user had moved the mouse instantaneously to the destination. Note that the pointer should normally be under the control of the user. This function was added to cover some rare use cases like keyboard navigation support for the color picker in the GtkColorSelectionDialog.

Get_Default

function Get_Default return Gdk_Screen;
Gets the default screen for the default display. (See gdk_display_get_default ()). Since: gtk+ 2.2

Height

function Height return Gint;
Returns the height of the default screen in pixels.

Height_Mm

function Height_Mm return Gint;
Returns the height of the default screen in millimeters. Note that on many X servers this value will not be correct.

Width

function Width return Gint;
Returns the width of the default screen in pixels.

Width_Mm

function Width_Mm return Gint;
Returns the width of the default screen in millimeters. Note that on many X servers this value will not be correct.