00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _LIBTDERANDR_H
00025 #define _LIBTDERANDR_H
00026
00027 #include "randr.h"
00028 #include "lowlevel_randr.h"
00029
00030 #ifdef __cplusplus
00031
00032 #include <tqfile.h>
00033
00034 #include <tdeconfig.h>
00035 #include <ksimpleconfig.h>
00036 #include <tdelibs_export.h>
00037
00038 #define ROTATION_0_DEGREES_STRING "0 degrees"
00039 #define ROTATION_90_DEGREES_STRING "90 degrees"
00040 #define ROTATION_180_DEGREES_STRING "180 degrees"
00041 #define ROTATION_270_DEGREES_STRING "270 degrees"
00042
00053 class TDERANDR_EXPORT KRandrSimpleAPI : public RandRDisplay
00054 {
00055 private:
00056
00057 public:
00061 TQString getIccFileName(TQString profileName, TQString screenName, TQString kde_confdir);
00062
00067 TQString applyIccFile(TQString screenName, TQString fileName);
00068
00073 TQString applyIccConfiguration(TQString profileName, TQString kde_confdir);
00074
00078 TQString applySystemWideIccConfiguration(TQString kde_confdir);
00079
00083 TQString clearIccConfiguration(void);
00084
00088 TQString getCurrentProfile(void);
00089
00094 ScreenInfo* read_screen_info(Display *display);
00095
00099 void freeScreenInfoStructure(ScreenInfo* screen_info);
00100
00104 int set_screen_size (ScreenInfo *screen_info);
00105
00109 void output_auto (ScreenInfo *screen_info, OutputInfo *output_info);
00110
00114 void output_off(ScreenInfo *screen_info, OutputInfo *output);
00115
00119 CrtcInfo* auto_find_crtc (ScreenInfo *screen_info, OutputInfo *output_info);
00120
00124 XRRModeInfo *find_mode_by_xid (ScreenInfo *screen_info, RRMode mode_id);
00125
00129 int mode_height (XRRModeInfo *mode_info, Rotation rotation);
00130
00134 int mode_width (XRRModeInfo *mode_info, Rotation rotation);
00135
00139 int get_width_by_output_id (ScreenInfo *screen_info, RROutput output_id);
00140
00144 int get_height_by_output_id (ScreenInfo *screen_info, RROutput output_id);
00145
00149 char *get_output_name (ScreenInfo *screen_info, RROutput id);
00150
00154 Status crtc_apply (CrtcInfo *crtc_info);
00155
00159 Status crtc_disable (CrtcInfo *crtc);
00160
00164 int main_low_apply (ScreenInfo *screen_info);
00165
00169 void set_primary_output (ScreenInfo *screen_info, RROutput output_id);
00170
00174 TQByteArray getEDID(int card, TQString displayname);
00175
00179 TQString getEDIDMonitorName(int card, TQString displayname);
00180
00184 bool getDisplayConfigurationEnabled(TQString kde_confdir);
00185
00189 bool getDisplayConfigurationStartupAutoApplyEnabled(TQString kde_confdir);
00190
00194 TQString getDisplayConfigurationStartupAutoApplyName(TQString kde_confdir);
00195
00199 HotPlugRulesList getHotplugRules(TQString kde_confdir);
00200
00204 void saveHotplugRules(HotPlugRulesList rules, TQString kde_confdir);
00205
00209 void applyHotplugRules(TQString kde_confdir);
00210
00215 TQStringList getDisplayConfigurationProfiles(TQString kde_confdir);
00216
00221 bool deleteDisplayConfiguration(TQString profilename, TQString kde_confdir);
00222
00227 bool renameDisplayConfiguration(TQString profilename, TQString newprofilename, TQString kde_confdir);
00228
00234 void saveDisplayConfiguration(bool enable, bool applyonstart, TQString profilename, TQString defaultprofilename, TQString kde_confdir, TQPtrList<SingleScreenData> screenInfoArray);
00235
00241 TQPtrList<SingleScreenData> loadDisplayConfiguration(TQString profilename, TQString kde_confdir);
00242
00247 TQPoint applyStartupDisplayConfiguration(TQString kde_confdir);
00248
00254 TQPoint applyDisplayConfiguration(TQString profilename, TQString kde_confdir);
00255
00261 bool applyDisplayConfiguration(TQPtrList<SingleScreenData> screenInfoArray, bool test=TRUE, TQString kde_confdir="");
00262
00266 void applyDisplayGamma(TQPtrList<SingleScreenData> screenInfoArray);
00267
00271 void applyDisplayDPMS(TQPtrList<SingleScreenData> screenInfoArray);
00272
00276 TQPtrList<SingleScreenData> copyScreenInformationObject(TQPtrList<SingleScreenData> screenInfoArray);
00277
00281 void destroyScreenInformationObject(TQPtrList<SingleScreenData> screenInfoArray);
00282
00286 TQPoint primaryScreenOffsetFromTLC(TQPtrList<SingleScreenData> screenInfoArray);
00287
00291 void ensureMonitorDataConsistency(TQPtrList<SingleScreenData> screenInfoArray);
00292
00296 TQPtrList<SingleScreenData> readCurrentDisplayConfiguration();
00297
00301 int getHardwareRotationFlags(SingleScreenData*);
00302
00306 bool kRandrHasRandr();
00307
00311 static const char *kRandrVersion(void);
00312
00320 static const char *kRandrCopyright(void);
00321
00322 };
00323
00324
00325
00326 extern "C" {
00327
00328 #else
00329 #define TDERANDR_EXPORT
00330 #endif
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348 TDERANDR_EXPORT const char *kRandrVersion(void);
00349 TDERANDR_EXPORT const char *kRandrCopyright(void);
00350
00351 #ifdef __cplusplus
00352
00353 }
00354
00355
00356 #endif
00357
00358
00359 #endif