libkrandr.h
00001 /* libkrandr.h - class KRandr that makes it easy to use XRandr in KDE 00002 This file is part of KRandr 0.9.5 00003 Copyright (C) 2010 Timothy Pearson 00004 LibKRandr's homepage : http://www.trinitydesktop.org 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 Boston, MA 02110-1301, USA. 00020 00021 Send comments and bug fixes to Timothy Pearson <kb9vqf@pearsoncomputing.net> 00022 00023 ***************************************************************************/ 00024 #ifndef _LIBKRANDR_H 00025 #define _LIBKRANDR_H 00026 00027 #include "randr.h" 00028 #include "lowlevel_randr.h" 00029 00030 #ifdef __cplusplus 00031 00032 #include <tqfile.h> 00033 00034 #include <kconfig.h> 00035 #include <ksimpleconfig.h> 00036 #include <kdelibs_export.h> 00037 00048 class KRANDR_EXPORT KRandrSimpleAPI : public RandRDisplay 00049 { 00050 private: 00051 00052 public: 00056 TQString getIccFileName(TQString profileName, TQString screenName, TQString kde_confdir); 00057 00062 TQString applyIccFile(TQString screenName, TQString fileName); 00063 00068 TQString applyIccConfiguration(TQString profileName, TQString kde_confdir); 00069 00073 TQString applySystemWideIccConfiguration(TQString kde_confdir); 00074 00078 TQString clearIccConfiguration(void); 00079 00083 TQString getCurrentProfile(void); 00084 00089 ScreenInfo* read_screen_info(Display *display); 00090 00094 void freeScreenInfoStructure(ScreenInfo* screen_info); 00095 00099 int set_screen_size (ScreenInfo *screen_info); 00100 00104 void output_auto (ScreenInfo *screen_info, OutputInfo *output_info); 00105 00109 void output_off(ScreenInfo *screen_info, OutputInfo *output); 00110 00114 CrtcInfo* auto_find_crtc (ScreenInfo *screen_info, OutputInfo *output_info); 00115 00119 XRRModeInfo *find_mode_by_xid (ScreenInfo *screen_info, RRMode mode_id); 00120 00124 int mode_height (XRRModeInfo *mode_info, Rotation rotation); 00125 00129 int mode_width (XRRModeInfo *mode_info, Rotation rotation); 00130 00134 int get_width_by_output_id (ScreenInfo *screen_info, RROutput output_id); 00135 00139 int get_height_by_output_id (ScreenInfo *screen_info, RROutput output_id); 00140 00144 char *get_output_name (ScreenInfo *screen_info, RROutput id); 00145 00149 Status crtc_apply (CrtcInfo *crtc_info); 00150 00154 Status crtc_disable (CrtcInfo *crtc); 00155 00159 int main_low_apply (ScreenInfo *screen_info); 00160 00164 TQByteArray getEDID(int card, TQString displayname); 00165 00169 TQString getEDIDMonitorName(int card, TQString displayname); 00170 00176 void saveSystemwideDisplayConfiguration(bool enable, TQString profilename, TQString kde_confdir, TQPtrList<SingleScreenData> screenInfoArray); 00177 00183 TQPtrList<SingleScreenData> loadSystemwideDisplayConfiguration(TQString profilename, TQString kde_confdir); 00184 00190 TQPoint applySystemwideDisplayConfiguration(TQString profilename, TQString kde_confdir); 00191 00197 bool applySystemwideDisplayConfiguration(TQPtrList<SingleScreenData> screenInfoArray, bool test=TRUE, TQString kde_confdir=""); 00198 00202 void applySystemwideDisplayGamma(TQPtrList<SingleScreenData> screenInfoArray); 00203 00207 void applySystemwideDisplayDPMS(TQPtrList<SingleScreenData> screenInfoArray); 00208 00212 void destroyScreenInformationObject(TQPtrList<SingleScreenData> screenInfoArray); 00213 00217 TQPoint primaryScreenOffsetFromTLC(TQPtrList<SingleScreenData> screenInfoArray); 00218 00222 void ensureMonitorDataConsistency(TQPtrList<SingleScreenData> screenInfoArray); 00223 00227 TQPtrList<SingleScreenData> readCurrentDisplayConfiguration(); 00228 00232 int getHardwareRotationFlags(SingleScreenData*); 00233 00237 bool kRandrHasRandr(); 00238 00242 static const char *kRandrVersion(void); 00243 00251 static const char *kRandrCopyright(void); 00252 00253 }; 00254 00255 00256 00257 extern "C" { 00258 00259 #else 00260 #define KRANDR_EXPORT 00261 #endif 00262 00263 // KRANDR_EXPORT ScreenInfo* read_screen_info(Display *); 00264 // KRANDR_EXPORT int set_screen_size (ScreenInfo *screen_info); 00265 // KRANDR_EXPORT void output_auto (ScreenInfo *screen_info, OutputInfo *output_info); 00266 // KRANDR_EXPORT void output_off(ScreenInfo *screen_info, OutputInfo *output); 00267 // KRANDR_EXPORT CrtcInfo* auto_find_crtc (ScreenInfo *screen_info, OutputInfo *output_info); 00268 // KRANDR_EXPORT XRRModeInfo *find_mode_by_xid (ScreenInfo *screen_info, RRMode mode_id); 00269 // KRANDR_EXPORT int mode_height (XRRModeInfo *mode_info, Rotation rotation); 00270 // KRANDR_EXPORT int mode_width (XRRModeInfo *mode_info, Rotation rotation); 00271 // KRANDR_EXPORT int get_width_by_output_id (ScreenInfo *screen_info, RROutput output_id); 00272 // KRANDR_EXPORT int get_height_by_output_id (ScreenInfo *screen_info, RROutput output_id); 00273 // KRANDR_EXPORT char *get_output_name (ScreenInfo *screen_info, RROutput id); 00274 // KRANDR_EXPORT Status crtc_apply (CrtcInfo *crtc_info); 00275 // KRANDR_EXPORT Status crtc_disable (CrtcInfo *crtc); 00276 // KRANDR_EXPORT int main_low_apply (ScreenInfo *screen_info); 00277 // KRANDR_EXPORT bool kRandrHasRandr(); 00278 00279 KRANDR_EXPORT const char *kRandrVersion(void); 00280 KRANDR_EXPORT const char *kRandrCopyright(void); 00281 00282 #ifdef __cplusplus 00283 00284 } 00285 00286 00287 #endif 00288 00289 00290 #endif