Work on documentation
[cl-gtk2.git] / doc / gdk.ref.texi
1 @menu
2 * Screens and displays::
3 @end menu
4
5 @node Screens and displays
6 @section Screens and displays
7
8 @menu
9 * display::
10 * screen::
11 @end menu
12
13 Multihead support is based around two main object types:
14 @itemize
15 @item @ref{display}
16 @item @ref{screen}
17 @end itemize
18
19 @ref{display} objects are the GDK representation of the X Display which
20 can be described as a workstation consisting of a keyboard a pointing
21 device (such as a mouse) and one or more screens. It is used to open and
22 keep track of various GdkScreen objects currently instanciated by the
23 application. It is also used to grab and release the keyboard and the
24 mouse pointer.
25
26 @ref{screen} objects are the GDK representation of a physical screen. It
27 is used throughout GDK and GTK+ to specify which screen the top level
28 windows are to be displayed on. It is also used to query the screen
29 specification and default settings such as the default colormap
30 (@code{screen-default-colormap}), the screen width
31 (@code{screen-width}), etc.
32
33 The following code samples demonstrate common usage of the objects
34 described above.
35
36 Testing the number of screen on the current display:
37 @lisp
38 (use-package :gdk)
39
40 (defvar *display* (default-display))
41
42 (display-name *display*) @result{} ":0.0"
43
44 (display-n-screens *display*) @result{} 1
45 @end lisp
46
47 Opening a second display:
48 (TODO)
49 @lisp
50 /* screen2_name needs to be initialized before calling 
51 /* gdk_display_new() */
52 second_display = gdk_display_new (&argc, &argv, second_screen_name);
53 if (second_display)
54     second_screen = gdk_display_get_default_screen (second_display);
55 else 
56   @{
57         g_print ("Can't open display :\n\t%s\n\n",
58                   second_screen_name);
59     exit (1);   
60   @}
61 /* now GdkScreen can be assigned to GtkWindows */
62
63 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
64 gtk_window_set_screen (window, second_screen);
65 @end lisp
66
67 @node display
68 @subsection display
69
70 @menu
71 * display-name::
72 * display-n-screens::
73 * display-default-screen::
74 @end menu
75
76 @Class display
77 @Superclass g-object
78
79 @ref{display} controls the keyboard/mouse pointer grabs and a set of @ref{screen}s.
80
81 @ref{display} objects purpose are two fold:
82
83 @itemize
84 @item To grab/ungrab keyboard focus and mouse pointer
85 @item To manage and provide information about the @ref{screen}(s) available for this @ref{display}
86 @end itemize
87
88 @ref{display} objects are the GDK representation of the X Display which
89 can be described as a workstation consisting of a keyboard a pointing
90 device (such as a mouse) and one or more screens. It is used to open and
91 keep track of various @ref{screen} objects currently instanciated by the
92 application. It is also used to grab and release the keyboard and the
93 mouse pointer.
94
95 @node display-name
96 @subsubsection display-name
97 @TypedAccessor {display-name, display, @code{string}}
98 The name of a @var{display} (e.g. @code{":0.0"})
99
100 @node display-n-screens
101 @subsubsection display-n-screens
102 @TypedAccessor {display-n-screens, display, @code{integer}}
103 The number of screen managed by the @var{display}.
104
105 @node display-default-screen
106 @subsubsection display-default-screens
107 @TypedAccessor {display-default-screen, display, @code{screen}}
108 The default screen of the @var{display}.
109
110 @node screen
111 @subsection screen
112
113 @Class screen
114 @Superclass g-object
115