1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2 // Display.hh for Blackbox - an X11 Window manager
3 // Copyright (c) 2001 - 2005 Sean 'Shaleh' Perry <shaleh at debian.org>
4 // Copyright (c) 1997 - 2000, 2002 - 2005
5 // Bradley T Hughes <bhughes at trolltech.com>
7 // Permission is hereby granted, free of charge, to any person obtaining a
8 // copy of this software and associated documentation files (the "Software"),
9 // to deal in the Software without restriction, including without limitation
10 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 // and/or sell copies of the Software, and to permit persons to whom the
12 // Software is furnished to do so, subject to the following conditions:
14 // The above copyright notice and this permission notice shall be included in
15 // all copies or substantial portions of the Software.
17 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 // DEALINGS IN THE SOFTWARE.
35 // forward declarations
38 class Display
: public NoCopy
{
41 ScreenInfo
** screen_info_list
;
42 size_t screen_info_count
;
45 Display(const char *dpy_name
, bool multi_head
);
48 inline ::Display
* XDisplay(void) const
51 inline unsigned int screenCount(void) const
52 { return screen_info_count
; }
53 const ScreenInfo
&screenInfo(unsigned int i
) const;
56 class ScreenInfo
: public NoCopy
{
63 unsigned int _screennumber
;
64 std::string _displaystring
;
68 ScreenInfo(Display
& d
, unsigned int num
);
70 inline Display
& display(void) const
73 inline Visual
*visual(void) const
75 inline Window
rootWindow(void) const
76 { return _rootwindow
; }
77 inline Colormap
colormap(void) const
80 inline int depth(void) const
83 inline unsigned int screenNumber(void) const
84 { return _screennumber
; }
86 inline const Rect
& rect(void) const
88 inline unsigned int width(void) const
89 { return _rect
.width(); }
90 inline unsigned int height(void) const
91 { return _rect
.height(); }
93 inline const std::string
& displayString(void) const
94 { return _displaystring
; }
99 #endif // __Display_hh