add more spacing
[personal-kdebase.git] / workspace / kcontrol / access / main.cpp
blobfaa30ac650025cb69f5d6f0c5fbdeb7d61e9586a
2 #include "kaccess.h"
3 #include <kdebug.h>
4 #include <kaboutdata.h>
5 #include <kcmdlineargs.h>
6 #include <klocale.h>
7 extern "C" KDE_EXPORT int kdemain(int argc, char * argv[] )
9 KAboutData about(I18N_NOOP("kaccess"), 0, ki18n("KDE Accessibility Tool"),
10 0, KLocalizedString(), KAboutData::License_GPL,
11 ki18n("(c) 2000, Matthias Hoelzer-Kluepfel"));
13 about.addAuthor(ki18n("Matthias Hoelzer-Kluepfel"), ki18n("Author") , "hoelzer@kde.org");
15 KCmdLineArgs::init( argc, argv, &about );
17 if (!KAccessApp::start())
18 return 0;
20 // verify the Xlib has matching XKB extension
21 int major = XkbMajorVersion;
22 int minor = XkbMinorVersion;
23 if (!XkbLibraryVersion(&major, &minor))
25 kError() << "Xlib XKB extension does not match" << endl;
26 return 1;
28 kDebug() << "Xlib XKB extension major=" << major << " minor=" << minor;
30 // we need an application object for QX11Info
31 KAccessApp app;
33 // verify the X server has matching XKB extension
34 // if yes, the XKB extension is initialized
35 int opcode_rtrn;
36 int error_rtrn;
37 int xkb_opcode;
38 if (!XkbQueryExtension(QX11Info::display(), &opcode_rtrn, &xkb_opcode, &error_rtrn,
39 &major, &minor))
41 kError() << "X server has not matching XKB extension" << endl;
42 return 1;
44 kDebug() << "X server XKB extension major=" << major << " minor=" << minor;
46 app.setXkbOpcode(xkb_opcode);
47 app.disableSessionManagement();
48 return app.exec();