aboutsummaryrefslogtreecommitdiff
path: root/src/ScreenInfo.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/ScreenInfo.hh')
-rw-r--r--src/ScreenInfo.hh84
1 files changed, 84 insertions, 0 deletions
diff --git a/src/ScreenInfo.hh b/src/ScreenInfo.hh
new file mode 100644
index 0000000..b167d47
--- /dev/null
+++ b/src/ScreenInfo.hh
@@ -0,0 +1,84 @@
1// ScreenInfo.hh for fluxbox
2// Copyright (c) 2003 Henrik Kinnunen (fluxgen<at>users.sourceforge.net)
3//
4// from BaseDisplay.hh in Blackbox 0.61.1
5// Copyright (c) 1997 - 2000 Brad Hughes (bhughes at tcac.net)
6//
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:
13//
14// The above copyright notice and this permission notice shall be included in
15// all copies or substantial portions of the Software.
16//
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.
24
25// $Id: ScreenInfo.hh,v 1.1 2003/05/10 13:54:29 fluxgen Exp $
26
27#ifndef SCREENINFO_HH
28#define SCREENINFO_HH
29
30#include <X11/Xlib.h>
31
32#ifdef HAVE_CONFIG_H
33#include "config.h"
34#endif // HAVE_CONFIG_H
35
36#ifdef XINERAMA
37extern "C" {
38#include <X11/extensions/Xinerama.h>
39}
40#endif // XINERAMA
41
42/// holds information about a screen
43class ScreenInfo {
44public:
45 explicit ScreenInfo(int screen_num);
46 ~ScreenInfo();
47
48 inline Visual *getVisual() const { return visual; }
49 inline Window getRootWindow() const { return root_window; }
50 inline Colormap colormap() const { return m_colormap; }
51
52 inline int getDepth() const { return depth; }
53 inline int getScreenNumber() const { return screen_number; }
54
55 inline unsigned int getWidth() const { return width; }
56 inline unsigned int getHeight() const { return height; }
57
58#ifdef XINERAMA
59 inline bool hasXinerama() const { return m_hasXinerama; }
60 inline int getNumHeads() const { return xineramaNumHeads; }
61 unsigned int getHead(int x, int y) const;
62 unsigned int getCurrHead() const;
63 unsigned int getHeadWidth(unsigned int head) const;
64 unsigned int getHeadHeight(unsigned int head) const;
65 int getHeadX(unsigned int head) const;
66 int getHeadY(unsigned int head) const;
67#endif // XINERAMA
68
69private:
70 Visual *visual;
71 Window root_window;
72 Colormap m_colormap;
73
74 int depth, screen_number;
75 unsigned int width, height;
76#ifdef XINERAMA
77 bool m_hasXinerama;
78 int xineramaMajor, xineramaMinor, xineramaNumHeads, xineramaLastHead;
79 XineramaScreenInfo *xineramaInfos;
80#endif // XINERAMA
81
82};
83
84#endif // SCREENINFO_HH