Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * Version: MPL 1.1 / GPLv3+ / LGPLv3+
4 : *
5 : * The contents of this file are subject to the Mozilla Public License Version
6 : * 1.1 (the "License"); you may not use this file except in compliance with
7 : * the License or as specified alternatively below. You may obtain a copy of
8 : * the License at http://www.mozilla.org/MPL/
9 : *
10 : * Software distributed under the License is distributed on an "AS IS" basis,
11 : * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 : * for the specific language governing rights and limitations under the
13 : * License.
14 : *
15 : * The Initial Developer of the Original Code is
16 : * Michael Meeks <michael.meeks@novell.com>
17 : * Portions created by the Initial Developer are Copyright (C) 2010 the
18 : * Initial Developer. All Rights Reserved.
19 : *
20 : * Major Contributor(s):
21 : *
22 : * For minor contributions see the git repository.
23 : *
24 : * Alternatively, the contents of this file may be used under the terms of
25 : * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
26 : * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
27 : * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
28 : * instead of those above.
29 : */
30 : #ifndef _VCL_GTKSYS_HXX_
31 : #define _VCL_GTKSYS_HXX_
32 :
33 : #include "generic/gensys.h"
34 : #include <gtk/gtk.h>
35 : #include <unx/saltype.h>
36 : #include <deque>
37 :
38 : class GtkSalSystem : public SalGenericSystem
39 : {
40 : typedef std::deque<std::pair<GdkScreen*, int> > ScreenMonitors_t;
41 :
42 : GdkDisplay *mpDisplay;
43 : // Number of monitors for every active screen.
44 : ScreenMonitors_t maScreenMonitors;
45 : public:
46 : GtkSalSystem();
47 : virtual ~GtkSalSystem();
48 : static GtkSalSystem *GetSingleton();
49 :
50 : virtual bool IsUnifiedDisplay();
51 : virtual unsigned int GetDisplayScreenCount();
52 : virtual unsigned int GetDisplayBuiltInScreen();
53 : virtual rtl::OUString GetDisplayScreenName (unsigned int nScreen);
54 : virtual Rectangle GetDisplayScreenPosSizePixel (unsigned int nScreen);
55 : virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel (unsigned int nScreen);
56 : virtual int ShowNativeDialog (const rtl::OUString& rTitle,
57 : const rtl::OUString& rMessage,
58 : const std::list< rtl::OUString >& rButtons,
59 : int nDefButton);
60 0 : SalX11Screen GetDisplayDefaultXScreen()
61 0 : { return getXScreenFromDisplayScreen( GetDisplayBuiltInScreen() ); }
62 : int GetDisplayXScreenCount();
63 : SalX11Screen getXScreenFromDisplayScreen(unsigned int nDisplayScreen);
64 : void countScreenMonitors();
65 : // We have a 'screen' number that is combined from screen-idx + monitor-idx
66 : int getScreenIdxFromPtr (GdkScreen *pScreen);
67 : int getScreenMonitorIdx (GdkScreen *pScreen, int nX, int nY);
68 : GdkScreen *getScreenMonitorFromIdx (int nIdx, gint &nMonitor);
69 : };
70 :
71 : #endif // _VCL_GTKSYS_HXX_
72 :
73 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|