Merge remote-tracking branch 'andy128k/master'
[cl-gtk2.git] / doc / gdk.ref.texi
blob2297411747277d25d96023535712a41a8dcfc30c
1 @menu
2 * Screens and displays::
3 * Gdk Objects::
4 * Gdk Structs::
5 * Gdk Enums::
6 * Gdk Flags::
7 @end menu
9 @node Screens and displays
10 @section Screens and displays
12 @menu
13 * display::
14 * screen::
15 @end menu
17 Multihead support is based around two main object types:
18 @itemize
19 @item @ref{display}
20 @item @ref{screen}
21 @end itemize
23 @ref{display} objects are the GDK representation of the X Display which
24 can be described as a workstation consisting of a keyboard a pointing
25 device (such as a mouse) and one or more screens. It is used to open and
26 keep track of various GdkScreen objects currently instanciated by the
27 application. It is also used to grab and release the keyboard and the
28 mouse pointer.
30 @ref{screen} objects are the GDK representation of a physical screen. It
31 is used throughout GDK and GTK+ to specify which screen the top level
32 windows are to be displayed on. It is also used to query the screen
33 specification and default settings such as the default colormap
34 (@code{screen-default-colormap}), the screen width
35 (@code{screen-width}), etc.
37 The following code samples demonstrate common usage of the objects
38 described above.
40 Testing the number of screen on the current display:
41 @lisp
42 (use-package :gdk)
44 (defvar *display* (default-display))
46 (display-name *display*) @result{} ":0.0"
48 (display-n-screens *display*) @result{} 1
49 @end lisp
51 Opening a second display:
52 (TODO)
53 @lisp
54 /* screen2_name needs to be initialized before calling 
55 /* gdk_display_new() */
56 second_display = gdk_display_new (&argc, &argv, second_screen_name);
57 if (second_display)
58     second_screen = gdk_display_get_default_screen (second_display);
59 else 
60   @{
61         g_print ("Can't open display :\n\t%s\n\n",
62                   second_screen_name);
63     exit (1);   
64   @}
65 /* now GdkScreen can be assigned to GtkWindows */
67 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
68 gtk_window_set_screen (window, second_screen);
69 @end lisp
71 @node display
72 @subsection display
74 @menu
75 * display-name::
76 * display-n-screens::
77 * display-default-screen::
78 @end menu
80 @Class display
81 @Superclass g-object
83 @ref{display} controls the keyboard/mouse pointer grabs and a set of @ref{screen}s.
85 @ref{display} objects purpose are two fold:
87 @itemize
88 @item To grab/ungrab keyboard focus and mouse pointer
89 @item To manage and provide information about the @ref{screen}(s) available for this @ref{display}
90 @end itemize
92 @ref{display} objects are the GDK representation of the X Display which
93 can be described as a workstation consisting of a keyboard a pointing
94 device (such as a mouse) and one or more screens. It is used to open and
95 keep track of various @ref{screen} objects currently instanciated by the
96 application. It is also used to grab and release the keyboard and the
97 mouse pointer.
99 @node display-name
100 @subsubsection display-name
101 @TypedAccessor {display-name, display, @code{string}}
102 The name of a @var{display} (e.g. @code{":0.0"})
104 @node display-n-screens
105 @subsubsection display-n-screens
106 @TypedAccessor {display-n-screens, display, @code{integer}}
107 The number of screen managed by the @var{display}.
109 @node display-default-screen
110 @subsubsection display-default-screens
111 @TypedAccessor {display-default-screen, display, @code{screen}}
112 The default screen of the @var{display}.
114 @node screen
115 @subsection screen
117 @Class screen
118 Superclass: @ref{g-object}
120 Slots:
121 @itemize
122 @item @anchor{slot.screen.active-window}active-window. Type: @ref{gdk-window}. Accessor: @anchor{fn.screen-active-window}@code{screen-active-window}. Read-only.
123 @item @anchor{slot.screen.composited-p}composited-p. Type: @code{boolean}. Accessor: @anchor{fn.screen-composited-p}@code{screen-composited-p}. Read-only.
124 @item @anchor{slot.screen.default-colormap}default-colormap. Type: @ref{gdk-colormap}. Accessor: @anchor{fn.screen-default-colormap}@code{screen-default-colormap}.
125 @item @anchor{slot.screen.display}display. Type: @ref{display}. Accessor: @anchor{fn.screen-display}@code{screen-display}. Read-only.
126 @item @anchor{slot.screen.display-name}display-name. Type: @code{string}. Accessor: @anchor{fn.screen-display-name}@code{screen-display-name}. Read-only.
127 @item @anchor{slot.screen.font-options}font-options. Type: gpointer. Accessor: @anchor{fn.screen-font-options}@code{screen-font-options}.
128 @item @anchor{slot.screen.height}height. Type: @code{integer}. Accessor: @anchor{fn.screen-height}@code{screen-height}. Read-only.
129 @item @anchor{slot.screen.height-mm}height-mm. Type: @code{integer}. Accessor: @anchor{fn.screen-height-mm}@code{screen-height-mm}. Read-only.
130 @item @anchor{slot.screen.n-monitors}n-monitors. Type: @code{integer}. Accessor: @anchor{fn.screen-n-monitors}@code{screen-n-monitors}. Read-only.
131 @item @anchor{slot.screen.number}number. Type: @code{integer}. Accessor: @anchor{fn.screen-number}@code{screen-number}. Read-only.
132 @item @anchor{slot.screen.resolution}resolution. Type: @code{double-float}. Accessor: @anchor{fn.screen-resolution}@code{screen-resolution}.
133 @item @anchor{slot.screen.rgb-colormap}rgb-colormap. Type: @ref{gdk-colormap}. Accessor: @anchor{fn.screen-rgb-colormap}@code{screen-rgb-colormap}. Read-only.
134 @item @anchor{slot.screen.rgb-visual}rgb-visual. Type: @ref{visual}. Accessor: @anchor{fn.screen-rgb-visual}@code{screen-rgb-visual}. Read-only.
135 @item @anchor{slot.screen.rgba-colormap}rgba-colormap. Type: @ref{gdk-colormap}. Accessor: @anchor{fn.screen-rgba-colormap}@code{screen-rgba-colormap}. Read-only.
136 @item @anchor{slot.screen.rgba-visual}rgba-visual. Type: @ref{visual}. Accessor: @anchor{fn.screen-rgba-visual}@code{screen-rgba-visual}. Read-only.
137 @item @anchor{slot.screen.root-window}root-window. Type: @ref{gdk-window}. Accessor: @anchor{fn.screen-root-window}@code{screen-root-window}. Read-only.
138 @item @anchor{slot.screen.system-colormap}system-colormap. Type: @ref{gdk-colormap}. Accessor: @anchor{fn.screen-system-colormap}@code{screen-system-colormap}. Read-only.
139 @item @anchor{slot.screen.system-visual}system-visual. Type: @ref{visual}. Accessor: @anchor{fn.screen-system-visual}@code{screen-system-visual}. Read-only.
140 @item @anchor{slot.screen.toplevel-windows}toplevel-windows. Type: list of @ref{gdk-window}. Accessor: @anchor{fn.screen-toplevel-windows}@code{screen-toplevel-windows}. Read-only.
141 @item @anchor{slot.screen.visuals}visuals. Type: list of @ref{visual}. Accessor: @anchor{fn.screen-visuals}@code{screen-visuals}. Read-only.
142 @item @anchor{slot.screen.width}width. Type: @code{integer}. Accessor: @anchor{fn.screen-width}@code{screen-width}. Read-only.
143 @item @anchor{slot.screen.width-mm}width-mm. Type: @code{integer}. Accessor: @anchor{fn.screen-width-mm}@code{screen-width-mm}. Read-only.
144 @item @anchor{slot.screen.window-stack}window-stack. Type: list of @ref{gdk-window}. Accessor: @anchor{fn.screen-window-stack}@code{screen-window-stack}. Read-only.
145 @end itemize
148 Signals:
149 @itemize
150 @item @anchor{signal.screen.composited-changed}\"composited-changed\". Signature: (instance @ref{screen}) @result{} void. Options: run-last.
151 @item @anchor{signal.screen.monitors-changed}\"monitors-changed\". Signature: (instance @ref{screen}) @result{} void. Options: run-last.
152 @item @anchor{signal.screen.size-changed}\"size-changed\". Signature: (instance @ref{screen}) @result{} void. Options: run-last.
153 @end itemize
155 @node Gdk Objects
156 @section Gdk Objects
158 @lowersections
159 @include gdk.objects.texi
160 @raisesections
162 @node Gdk Structs
163 @section Gdk Structs
165 @lowersections
166 @include gdk.structs.texi
167 @raisesections
169 @node Gdk Enums
170 @section Gdk Enums
172 @lowersections
173 @include gdk.enums.texi
174 @raisesections
176 @node Gdk Flags
177 @section Gdk Flags
179 @lowersections
180 @include gdk.flags.texi
181 @raisesections