00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00036 #include <kaboutdata.h>
00037 #include <kapplication.h>
00038 #include <kcmdlineargs.h>
00039 #include <kdebug.h>
00040 #include <kglobal.h>
00041 #include <klocale.h>
00042
00043 #include "kwin4.h"
00044
00045 #define KWIN4_VERSION "v1.40"
00046
00047 static KCmdLineOptions options[] =
00048 {
00049 { "d", 0, 0},
00050 { "debug <level>", I18N_NOOP("Enter debug level"), 0 },
00051 KCmdLineLastOption
00052 };
00053
00054
00055
00056 int global_debug;
00057
00058
00059
00060 int main(int argc, char *argv[])
00061 {
00062 global_debug = 0;
00063 KAboutData aboutData( "kwin4", I18N_NOOP("KWin4"),
00064 KWIN4_VERSION,
00065 I18N_NOOP("KWin4: Two player board game"),
00066 KAboutData::License_GPL,
00067 "(c) 1995-2007, Martin Heni");
00068 aboutData.addAuthor("Martin Heni",I18N_NOOP("Game design and code"), "kde@heni-online.de");
00069 aboutData.addAuthor("Johann Ollivier Lapeyre",I18N_NOOP("Graphics"), "johann.ollivierlapeyre@gmail.com");
00070 aboutData.addAuthor("Benjamin Meyer", I18N_NOOP("Code Improvements"), 0);
00071 KCmdLineArgs::init( argc, argv, &aboutData );
00072 KCmdLineArgs::addCmdLineOptions( options );
00073
00074
00075 KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
00076
00077
00078 if (args->isSet("debug"))
00079 {
00080 global_debug=QString(args->getOption("debug")).toInt();
00081 kDebug(12010) << "Debug level set to " << global_debug << endl;
00082 }
00083
00084
00085 KApplication application(true);
00086 KGlobal::locale()->insertCatalog("libkdegames");
00087
00088
00089 if (application.isSessionRestored())
00090 {
00091 RESTORE(KWin4App);
00092 }
00093 else
00094 {
00095 KWin4App *kwin4 = new KWin4App();
00096 kwin4->show();
00097 }
00098
00099 return application.exec();
00100 }
00101