main.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002                           Kwin4  -  Four in a Row for KDE
00003                              -------------------
00004     begin                : March 2000 
00005     copyright            : (C) 1995-2007 by Martin Heni
00006     email                : kde@heni-online.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
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 // DEbug level for the program
00056 int global_debug;
00057 
00058 
00059 // Main function
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 ); // Add our own options.
00073 
00074   /* command line handling */
00075   KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
00076 
00077   // Check for debug command line option
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   // Start application
00085   KApplication application(true);
00086   KGlobal::locale()->insertCatalog("libkdegames");
00087 
00088   // Start session
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 

Generated on Sun Mar 4 10:56:43 2007 for KWin4 by  doxygen 1.4.6