23 #include <tqstringlist.h> 24 #include <tqptrlist.h> 30 class RandRScreenPrivate;
32 struct SingleScreenData {
33 TQString screenFriendlyName;
34 bool generic_screen_detected;
35 bool screen_connected;
37 TQStringList resolutions;
38 TQStringList refresh_rates;
39 TQStringList color_depths;
40 TQStringList rotations;
42 int current_resolution_index;
43 int current_refresh_rate_index;
44 int current_color_depth_index;
50 int current_rotation_index;
51 int current_orientation_mask;
54 bool supports_transformations;
58 int absolute_x_position;
59 int absolute_y_position;
60 int current_x_pixel_count;
61 int current_y_pixel_count;
65 unsigned int dpms_standby_delay;
66 unsigned int dpms_suspend_delay;
67 unsigned int dpms_off_delay;
70 class RandRScreen :
public TQObject
89 RandRScreen(
int screenIndex);
100 bool applyProposedAndConfirm();
104 bool showTestConfigurationDialog();
107 TQString changedMessage()
const;
109 bool changedFromOriginal()
const;
110 void proposeOriginal();
112 bool proposedChanged()
const;
114 static TQString rotationName(
int rotation,
bool pastTense =
false,
bool capitalised =
true);
115 TQPixmap rotationIcon(
int rotation)
const;
116 TQString currentRotationDescription()
const;
118 int rotationIndexToDegree(
int rotation)
const;
119 int rotationDegreeToIndex(
int degree)
const;
124 TQStringList refreshRates(
int size)
const;
126 TQString refreshRateDirectDescription(
int rate)
const;
127 TQString refreshRateIndirectDescription(
int size,
int index)
const;
128 TQString refreshRateDescription(
int size,
int index)
const;
130 int currentRefreshRate()
const;
131 TQString currentRefreshRateDescription()
const;
134 int refreshRateHzToIndex(
int size,
int hz)
const;
135 int refreshRateIndexToHz(
int size,
int index)
const;
140 int numSizes()
const;
141 const TQSize& pixelSize(
int index)
const;
142 const TQSize& mmSize(
int index)
const;
143 int pixelCount(
int index)
const;
151 int sizeIndex(TQSize pixelSize)
const;
153 int rotations()
const;
158 int currentPixelWidth()
const;
159 int currentPixelHeight()
const;
160 int currentMMWidth()
const;
161 int currentMMHeight()
const;
163 int currentRotation()
const;
164 int currentSize()
const;
169 int proposedSize()
const;
170 bool proposeSize(
int newSize);
172 int proposedRotation()
const;
173 void proposeRotation(
int newRotation);
175 int proposedRefreshRate()
const;
183 bool proposeRefreshRate(
int index);
192 RandRScreenPrivate* d;
196 TQValueList<TQSize> m_pixelSizes;
197 TQValueList<TQSize> m_mmSizes;
200 int m_originalRotation;
202 int m_originalRefreshRate;
204 int m_currentRotation;
206 int m_currentRefreshRate;
208 int m_proposedRotation;
210 int m_proposedRefreshRate;
215 void desktopResized();
216 void shownDialogDestroyed();
219 typedef TQPtrList<RandRScreen> ScreenList;
226 bool isValid()
const;
227 const TQString& errorCode()
const;
228 const TQString&
version()
const;
230 int eventBase()
const;
231 int screenChangeNotifyEvent()
const;
232 int errorBase()
const;
234 int screenIndexOfWidget(TQWidget* widget);
236 int numScreens()
const;
237 RandRScreen* screen(
int index);
239 void setCurrentScreen(
int index);
240 int currentScreenIndex()
const;
241 RandRScreen* currentScreen();
252 bool loadDisplay(
KConfig& config,
bool loadScreens =
true);
253 void saveDisplay(
KConfig& config,
bool applyOnStartup,
bool syncTrayApp);
255 static bool applyOnStartup(
KConfig& config);
256 static bool syncTrayApp(
KConfig& config);
258 void applyProposed(
bool confirm =
true);
260 bool showTestConfigurationDialog();
264 int m_currentScreenIndex;
265 RandRScreen* m_currentScreen;
266 ScreenList m_screens;
Provides a dialog that is only available for a specified amount of time, and reports the time remaini...