• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tderandr
 

tderandr

  • tderandr
randr.h
1 /*
2  * Copyright (c) 2002,2003 Hamish Rodda <rodda@kde.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  */
18 
19 #ifndef __RANDR_H__
20 #define __RANDR_H__
21 
22 #include <tqobject.h>
23 #include <tqstringlist.h>
24 #include <tqptrlist.h>
25 
26 #include <tdecmodule.h>
27 #include <tdeconfig.h>
28 
29 class KTimerDialog;
30 class RandRScreenPrivate;
31 
32 class TDERANDR_EXPORT HotPlugRule {
33  public:
34  enum states {
35  AnyState = 0,
36  Connected = 1,
37  Disconnected = 2
38  };
39 
40  public:
41  HotPlugRule();
42  virtual ~HotPlugRule();
43 
44  public:
45  TQStringList outputs;
46  TQValueList< int > states;
47  TQString profileName;
48 };
49 
50 typedef TQValueList< HotPlugRule > HotPlugRulesList;
51 
52 class TDERANDR_EXPORT SingleScreenData {
53  public:
54  SingleScreenData();
55  virtual ~SingleScreenData();
56 
57  public:
58  TQString screenUniqueName;
59  TQString screenFriendlyName;
60  bool generic_screen_detected;
61  bool screen_connected;
62 
63  TQStringList resolutions;
64  TQStringList refresh_rates;
65  TQStringList color_depths;
66  TQStringList rotations;
67 
68  int current_resolution_index;
69  int current_refresh_rate_index;
70  int current_color_depth_index;
71 
72  float gamma_red;
73  float gamma_green;
74  float gamma_blue;
75 
76  int current_rotation_index;
77  int current_orientation_mask;
78  bool has_x_flip;
79  bool has_y_flip;
80  bool supports_transformations;
81 
82  bool is_primary;
83  bool is_extended;
84  int absolute_x_position;
85  int absolute_y_position;
86  int current_x_pixel_count;
87  int current_y_pixel_count;
88 
89  bool has_dpms;
90  bool enable_dpms;
91  unsigned int dpms_standby_delay;
92  unsigned int dpms_suspend_delay;
93  unsigned int dpms_off_delay;
94 };
95 
96 class RandRScreen : public TQObject
97 {
98  Q_OBJECT
99 
100 public:
101  enum orientations {
102  Rotate0 = 0x1,
103  Rotate90 = 0x2,
104  Rotate180 = 0x4,
105  Rotate270 = 0x8,
106  RotateMask = 15,
107  RotationCount = 4,
108  ReflectX = 0x10,
109  ReflectY = 0x20,
110  ReflectMask = 48,
111  OrientationMask = 63,
112  OrientationCount = 6
113  };
114 
115  RandRScreen(int screenIndex);
116  ~RandRScreen();
117 
118  void loadSettings();
119  void setOriginal();
120 
121  bool applyProposed();
122 
126  bool applyProposedAndConfirm();
127 
128 public slots:
129  bool confirm();
130  bool showTestConfigurationDialog();
131 
132 public:
133  TQString changedMessage() const;
134 
135  bool changedFromOriginal() const;
136  void proposeOriginal();
137 
138  bool proposedChanged() const;
139 
140  static TQString rotationName(int rotation, bool pastTense = false, bool capitalised = true);
141  TQPixmap rotationIcon(int rotation) const;
142  TQString currentRotationDescription() const;
143 
144  int rotationIndexToDegree(int rotation) const;
145  int rotationDegreeToIndex(int degree) const;
146 
150  TQStringList refreshRates(int size) const;
151 
152  TQString refreshRateDirectDescription(int rate) const;
153  TQString refreshRateIndirectDescription(int size, int index) const;
154  TQString refreshRateDescription(int size, int index) const;
155 
156  int currentRefreshRate() const;
157  TQString currentRefreshRateDescription() const;
158 
159  // Refresh rate hz <==> index conversion
160  int refreshRateHzToIndex(int size, int hz) const;
161  int refreshRateIndexToHz(int size, int index) const;
162 
166  int numSizes() const;
167  const TQSize& pixelSize(int index) const;
168  const TQSize& mmSize(int index) const;
169  int pixelCount(int index) const;
170 
177  int sizeIndex(TQSize pixelSize) const;
178 
179  int rotations() const;
180 
184  int currentPixelWidth() const;
185  int currentPixelHeight() const;
186  int currentMMWidth() const;
187  int currentMMHeight() const;
188 
189  int currentRotation() const;
190  int currentSize() const;
191 
195  int proposedSize() const;
196  bool proposeSize(int newSize);
197 
198  int proposedRotation() const;
199  void proposeRotation(int newRotation);
200 
201  int proposedRefreshRate() const;
209  bool proposeRefreshRate(int index);
210 
214  void load(TDEConfig& config);
215  void save(TDEConfig& config) const;
216 
217 private:
218  RandRScreenPrivate* d;
219 
220  int m_screen;
221 
222  TQValueList<TQSize> m_pixelSizes;
223  TQValueList<TQSize> m_mmSizes;
224  int m_rotations;
225 
226  int m_originalRotation;
227  int m_originalSize;
228  int m_originalRefreshRate;
229 
230  int m_currentRotation;
231  int m_currentSize;
232  int m_currentRefreshRate;
233 
234  int m_proposedRotation;
235  int m_proposedSize;
236  int m_proposedRefreshRate;
237 
238  KTimerDialog* m_shownDialog;
239 
240 private slots:
241  void desktopResized();
242  void shownDialogDestroyed();
243 };
244 
245 typedef TQPtrList<RandRScreen> ScreenList;
246 
247 class RandRDisplay
248 {
249 public:
250  RandRDisplay();
251 
252  bool isValid() const;
253  const TQString& errorCode() const;
254  const TQString& version() const;
255 
256  int eventBase() const;
257  int screenChangeNotifyEvent() const;
258  int errorBase() const;
259 
260  int screenIndexOfWidget(TQWidget* widget);
261 
262  int numScreens() const;
263  RandRScreen* screen(int index);
264 
265  void setCurrentScreen(int index);
266  int currentScreenIndex() const;
267  RandRScreen* currentScreen();
268 
269  void refresh();
270 
278  bool loadDisplay(TDEConfig& config, bool loadScreens = true);
279  void saveDisplay(TDEConfig& config, bool applyOnStartup, bool syncTrayApp);
280 
281  static bool applyOnStartup(TDEConfig& config);
282  static bool syncTrayApp(TDEConfig& config);
283 
284  void applyProposed(bool confirm = true);
285 
286  bool showTestConfigurationDialog();
287 
288 private:
289  int m_numScreens;
290  int m_currentScreenIndex;
291  RandRScreen* m_currentScreen;
292  ScreenList m_screens;
293 
294  bool m_valid;
295  QString m_errorCode;
296  QString m_version;
297 
298  int m_eventBase;
299  int m_errorBase;
300 };
301 
302 #endif

tderandr

Skip menu "tderandr"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

tderandr

Skip menu "tderandr"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tderandr by doxygen 1.8.1.2
This website is maintained by Timothy Pearson.