summaryrefslogtreecommitdiffstats
path: root/krandr/libkrandr.cc
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-04-28 01:27:24 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-04-28 01:27:24 +0000
commit3be8f38c8216094c12a7910ab09be94394a5e2db (patch)
tree70ce28e837483ef1169acdbd739d0882a3aa5b04 /krandr/libkrandr.cc
parent9f2307382d4acc636b621570ed7770dcab0d652a (diff)
downloadtdelibs-3be8f38c8216094c12a7910ab09be94394a5e2db.tar.gz
tdelibs-3be8f38c8216094c12a7910ab09be94394a5e2db.zip
Added new central krandr library to handle everything related to dynamic screen configuration
In the future this will probably handle ICC profiles as well This will allow easy integration of screen configuration into other KDE programs and control center modules git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1119941 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'krandr/libkrandr.cc')
-rw-r--r--krandr/libkrandr.cc126
1 files changed, 126 insertions, 0 deletions
diff --git a/krandr/libkrandr.cc b/krandr/libkrandr.cc
new file mode 100644
index 000000000..214e7e7b0
--- /dev/null
+++ b/krandr/libkrandr.cc
@@ -0,0 +1,126 @@
+/* libkrandr.cc - class KRandr that makes it easy to use XRandr in KDE
+ This file is part of KRandr 0.9.5
+ Copyright (C) 2010 Timothy Pearson
+ LibKMid's homepage : http://trinity.pearsoncomputing.net
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+ Send comments and bug fixes to Timothy Pearson <kb9vqf@pearsoncomputing.net>
+
+***************************************************************************/
+
+#include "libkrandr.h"
+
+ScreenInfo* KRandrSimpleAPI::read_screen_info (Display *display)
+{
+ return read_screen_info(display);
+}
+
+int KRandrSimpleAPI::set_screen_size (ScreenInfo *screen_info)
+{
+ return set_screen_size(screen_info);
+}
+
+void KRandrSimpleAPI::output_auto (ScreenInfo *screen_info, OutputInfo *output_info)
+{
+ output_auto (screen_info, output_info);
+}
+
+void KRandrSimpleAPI::output_off(ScreenInfo *screen_info, OutputInfo *output)
+{
+ output_off(screen_info, output);
+}
+
+CrtcInfo* KRandrSimpleAPI::auto_find_crtc (ScreenInfo *screen_info, OutputInfo *output_info)
+{
+ return auto_find_crtc (screen_info, output_info);
+}
+
+XRRModeInfo *KRandrSimpleAPI::find_mode_by_xid (ScreenInfo *screen_info, RRMode mode_id)
+{
+ return find_mode_by_xid (screen_info, mode_id);
+}
+
+int KRandrSimpleAPI::mode_height (XRRModeInfo *mode_info, Rotation rotation)
+{
+ return mode_height (mode_info, rotation);
+}
+
+int KRandrSimpleAPI::mode_width (XRRModeInfo *mode_info, Rotation rotation)
+{
+ return mode_width (mode_info, rotation);
+}
+
+int KRandrSimpleAPI::get_width_by_output_id (ScreenInfo *screen_info, RROutput output_id)
+{
+ return get_width_by_output_id (screen_info, output_id);
+}
+
+int KRandrSimpleAPI::get_height_by_output_id (ScreenInfo *screen_info, RROutput output_id)
+{
+ return get_height_by_output_id (screen_info, output_id);
+}
+
+char *KRandrSimpleAPI::get_output_name (ScreenInfo *screen_info, RROutput id)
+{
+ return get_output_name (screen_info, id);
+}
+
+Status KRandrSimpleAPI::crtc_apply (CrtcInfo *crtc_info)
+{
+ return crtc_apply (crtc_info);
+}
+
+Status KRandrSimpleAPI::crtc_disable (CrtcInfo *crtc)
+{
+ return crtc_disable (crtc);
+}
+
+int KRandrSimpleAPI::main_low_apply (ScreenInfo *screen_info)
+{
+ return main_low_apply (screen_info);
+}
+
+bool KRandrSimpleAPI::kRandrHasRandr(void)
+{
+ return isValid();
+}
+
+const char *KRandrSimpleAPI::kRandrVersion(void)
+{
+ return "0.9.5";
+}
+
+const char *KRandrSimpleAPI::kRandrCopyright(void)
+{
+ return "LibKRandr 0.9.5 (C)2010 Timothy Pearson <kb9vqf@pearsoncomputing.net>. U.S.A.";
+}
+
+/* * * * * *
+
+ Under this line (------) there's only a C wrapper for the KRandrSimpleAPI class
+
+* * * * * */
+const char *kRandrVersion(void)
+{
+ return KRandrSimpleAPI::kRandrVersion();
+}
+
+const char *kRandrCopyright(void)
+{
+ return KRandrSimpleAPI::kRandrCopyright();
+}
+