summaryrefslogtreecommitdiffstats
path: root/kcontrol/access/main.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit4aed2c8219774f5d797760606b8489a92ddc5163 (patch)
tree3f8c130f7d269626bf6a9447407ef6c35954426a /kcontrol/access/main.cpp
downloadtdebase-4aed2c8219774f5d797760606b8489a92ddc5163.tar.gz
tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kcontrol/access/main.cpp')
-rw-r--r--kcontrol/access/main.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/kcontrol/access/main.cpp b/kcontrol/access/main.cpp
new file mode 100644
index 000000000..a2dd0d5c7
--- /dev/null
+++ b/kcontrol/access/main.cpp
@@ -0,0 +1,49 @@
+
+#include "kaccess.h"
+#include <kaboutdata.h>
+#include <kcmdlineargs.h>
+#include <kdebug.h>
+
+extern "C" KDE_EXPORT int kdemain(int argc, char * argv[] )
+{
+ KAboutData about(I18N_NOOP("kaccess"), I18N_NOOP("KDE Accessibility Tool"),
+ 0, 0, KAboutData::License_GPL,
+ I18N_NOOP("(c) 2000, Matthias Hoelzer-Kluepfel"));
+
+ about.addAuthor("Matthias Hoelzer-Kluepfel", I18N_NOOP("Author") , "hoelzer@kde.org");
+
+ KCmdLineArgs::init( argc, argv, &about );
+
+ if (!KAccessApp::start())
+ return 0;
+
+ // verify the Xlib has matching XKB extension
+ int major = XkbMajorVersion;
+ int minor = XkbMinorVersion;
+ if (!XkbLibraryVersion(&major, &minor))
+ {
+ kdError() << "Xlib XKB extension does not match" << endl;
+ return 1;
+ }
+ kdDebug() << "Xlib XKB extension major=" << major << " minor=" << minor << endl;
+
+ // we need an application object for qt_xdisplay()
+ KAccessApp app;
+
+ // verify the X server has matching XKB extension
+ // if yes, the XKB extension is initialized
+ int opcode_rtrn;
+ int error_rtrn;
+ int xkb_opcode;
+ if (!XkbQueryExtension(qt_xdisplay(), &opcode_rtrn, &xkb_opcode, &error_rtrn,
+ &major, &minor))
+ {
+ kdError() << "X server has not matching XKB extension" << endl;
+ return 1;
+ }
+ kdDebug() << "X server XKB extension major=" << major << " minor=" << minor << endl;
+
+ app.setXkbOpcode(xkb_opcode);
+ app.disableSessionManagement();
+ return app.exec();
+}