kate Library API Documentation

katemain.cpp

00001 /* This file is part of the KDE project
00002    Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
00003    Copyright (C) 2002 Joseph Wenninger <jowenn@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License version 2 as published by the Free Software Foundation.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017    Boston, MA 02111-1307, USA.
00018 */
00019 
00020 #include <kstandarddirs.h>
00021 #include <klocale.h>
00022 #include <kcmdlineargs.h>
00023 #include <kaboutdata.h>
00024 #include <kglobal.h>
00025 #include <kconfig.h>
00026 #include <kinstance.h>
00027 
00028 #include "kateapp.h"
00029 
00030 static KCmdLineOptions options[] =
00031 {
00032     { "n", I18N_NOOP("Start a new Kate process (off by default)"), 0 },
00033     { "w", I18N_NOOP("Open a new Kate window"), 0 },
00034     { "initplugin <argument>",  I18N_NOOP("Allow Kate to be initialized by a plugin. You most probably have to specify a file too."),0},
00035     { "line <argument>",      I18N_NOOP("Navigate to this line"), 0 },
00036     { "column <argument>",      I18N_NOOP("Navigate to this column"), 0 },
00037     { "+file(s)",          I18N_NOOP("Files to load"), 0 },
00038     KCmdLineLastOption
00039 };
00040 
00041 extern "C" int kdemain( int argc, char **argv )
00042 {
00043   Kate::Document::setFileChangedDialogsActivated (true);
00044 
00045   KAboutData aboutData ("kate", I18N_NOOP("Kate"), KATE_VERSION,
00046                         I18N_NOOP( "Kate - Advanced Text Editor" ), KAboutData::License_LGPL_V2,
00047                         I18N_NOOP( "(c) 2000-2004 The Kate Authors" ), 0, "http://kate.kde.org");
00048 
00049   aboutData.addAuthor ("Christoph Cullmann", I18N_NOOP("Maintainer"), "cullmann@kde.org", "http://www.babylon2k.de");
00050   aboutData.addAuthor ("Anders Lund", I18N_NOOP("Core Developer"), "anders@alweb.dk", "http://www.alweb.dk");
00051   aboutData.addAuthor ("Joseph Wenninger", I18N_NOOP("Core Developer"), "jowenn@kde.org","http://stud3.tuwien.ac.at/~e9925371");
00052   aboutData.addAuthor ("Hamish Rodda",I18N_NOOP("Core Developer"), "rodda@kde.org");
00053   aboutData.addAuthor ("Waldo Bastian", I18N_NOOP( "The cool buffersystem" ), "bastian@kde.org" );
00054   aboutData.addAuthor ("Charles Samuels", I18N_NOOP("The Editing Commands"), "charles@kde.org");
00055   aboutData.addAuthor ("Matt Newell", I18N_NOOP("Testing, ..."), "newellm@proaxis.com");
00056   aboutData.addAuthor ("Michael Bartl", I18N_NOOP("Former Core Developer"), "michael.bartl1@chello.at");
00057   aboutData.addAuthor ("Michael McCallum", I18N_NOOP("Core Developer"), "gholam@xtra.co.nz");
00058   aboutData.addAuthor ("Jochen Wilhemly", I18N_NOOP( "KWrite Author" ), "digisnap@cs.tu-berlin.de" );
00059   aboutData.addAuthor ("Michael Koch",I18N_NOOP("KWrite port to KParts"), "koch@kde.org");
00060   aboutData.addAuthor ("Christian Gebauer", 0, "gebauer@kde.org" );
00061   aboutData.addAuthor ("Simon Hausmann", 0, "hausmann@kde.org" );
00062   aboutData.addAuthor ("Glen Parker",I18N_NOOP("KWrite Undo History, Kspell integration"), "glenebob@nwlink.com");
00063   aboutData.addAuthor ("Scott Manson",I18N_NOOP("KWrite XML Syntax highlighting support"), "sdmanson@alltel.net");
00064   aboutData.addAuthor ("John Firebaugh",I18N_NOOP("Patches and more"), "jfirebaugh@kde.org");
00065   aboutData.addAuthor ("Dominik Haumann", I18N_NOOP("Developer & Highlight wizard"), "dhdev@gmx.de");
00066 
00067   aboutData.addCredit ("Matteo Merli",I18N_NOOP("Highlighting for RPM Spec-Files, Perl, Diff and more"), "merlim@libero.it");
00068   aboutData.addCredit ("Rocky Scaletta",I18N_NOOP("Highlighting for VHDL"), "rocky@purdue.edu");
00069   aboutData.addCredit ("Yury Lebedev",I18N_NOOP("Highlighting for SQL"),"");
00070   aboutData.addCredit ("Chris Ross",I18N_NOOP("Highlighting for Ferite"),"");
00071   aboutData.addCredit ("Nick Roux",I18N_NOOP("Highlighting for ILERPG"),"");
00072   aboutData.addCredit ("Carsten Niehaus", I18N_NOOP("Highlighting for LaTeX"),"");
00073   aboutData.addCredit ("Per Wigren", I18N_NOOP("Highlighting for Makefiles, Python"),"");
00074   aboutData.addCredit ("Jan Fritz", I18N_NOOP("Highlighting for Python"),"");
00075   aboutData.addCredit ("Daniel Naber","","");
00076   aboutData.addCredit ("Roland Pabel",I18N_NOOP("Highlighting for Scheme"),"");
00077   aboutData.addCredit ("Cristi Dumitrescu",I18N_NOOP("PHP Keyword/Datatype list"),"");
00078   aboutData.addCredit ("Carsten Pfeiffer", I18N_NOOP("Very nice help"), "");
00079   aboutData.addCredit (I18N_NOOP("All people who have contributed and I have forgotten to mention"),"","");
00080   
00081   aboutData.setTranslator(I18N_NOOP("_: NAME OF TRANSLATORS\nYour names"), I18N_NOOP("_: EMAIL OF TRANSLATORS\nYour emails"));
00082 
00083   KCmdLineArgs::init (argc, argv, &aboutData);
00084   KCmdLineArgs::addCmdLineOptions (options);
00085   KateApp::addCmdLineOptions ();
00086   KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
00087 
00088   bool newProcess = false;
00089   bool oldState = false;
00090 
00091   if (args->isSet ("n"))
00092     newProcess = true;
00093 
00094   if (newProcess)
00095   {
00096     KInstance instance (&aboutData);
00097 
00098     KConfig *config = instance.config();
00099     config->setGroup("KDE");
00100     oldState = config->readBoolEntry("MultipleInstances",false);
00101     config->writeEntry("MultipleInstances",true);
00102     config->sync();
00103   }
00104 
00105   KateApp app (newProcess, oldState);
00106   return app.exec();
00107 }
KDE Logo
This file is part of the documentation for kate Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Sep 8 02:43:13 2005 by doxygen 1.3.6 written by Dimitri van Heesch, © 1997-2003