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     { "encoding <argument>",      I18N_NOOP("Set encoding for the file to open"), 0 },
00036     { "line <argument>",      I18N_NOOP("Navigate to this line"), 0 },
00037     { "column <argument>",      I18N_NOOP("Navigate to this column"), 0 },
00038     { "+[URL]",          I18N_NOOP("Document to open"), 0 },
00039     KCmdLineLastOption
00040 };
00041 
00042 extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
00043 {
00044   Kate::Document::setFileChangedDialogsActivated (true);
00045 
00046   KAboutData aboutData ("kate", I18N_NOOP("Kate"), KATE_VERSION,
00047                         I18N_NOOP( "Kate - Advanced Text Editor" ), KAboutData::License_LGPL_V2,
00048                         I18N_NOOP( "(c) 2000-2004 The Kate Authors" ), 0, "http://kate.kde.org");
00049 
00050   aboutData.addAuthor ("Christoph Cullmann", I18N_NOOP("Maintainer"), "cullmann@kde.org", "http://www.babylon2k.de");
00051   aboutData.addAuthor ("Anders Lund", I18N_NOOP("Core Developer"), "anders@alweb.dk", "http://www.alweb.dk");
00052   aboutData.addAuthor ("Joseph Wenninger", I18N_NOOP("Core Developer"), "jowenn@kde.org","http://stud3.tuwien.ac.at/~e9925371");
00053   aboutData.addAuthor ("Hamish Rodda",I18N_NOOP("Core Developer"), "rodda@kde.org");
00054   aboutData.addAuthor ("Waldo Bastian", I18N_NOOP( "The cool buffersystem" ), "bastian@kde.org" );
00055   aboutData.addAuthor ("Charles Samuels", I18N_NOOP("The Editing Commands"), "charles@kde.org");
00056   aboutData.addAuthor ("Matt Newell", I18N_NOOP("Testing, ..."), "newellm@proaxis.com");
00057   aboutData.addAuthor ("Michael Bartl", I18N_NOOP("Former Core Developer"), "michael.bartl1@chello.at");
00058   aboutData.addAuthor ("Michael McCallum", I18N_NOOP("Core Developer"), "gholam@xtra.co.nz");
00059   aboutData.addAuthor ("Jochen Wilhemly", I18N_NOOP( "KWrite Author" ), "digisnap@cs.tu-berlin.de" );
00060   aboutData.addAuthor ("Michael Koch",I18N_NOOP("KWrite port to KParts"), "koch@kde.org");
00061   aboutData.addAuthor ("Christian Gebauer", 0, "gebauer@kde.org" );
00062   aboutData.addAuthor ("Simon Hausmann", 0, "hausmann@kde.org" );
00063   aboutData.addAuthor ("Glen Parker",I18N_NOOP("KWrite Undo History, Kspell integration"), "glenebob@nwlink.com");
00064   aboutData.addAuthor ("Scott Manson",I18N_NOOP("KWrite XML Syntax highlighting support"), "sdmanson@alltel.net");
00065   aboutData.addAuthor ("John Firebaugh",I18N_NOOP("Patches and more"), "jfirebaugh@kde.org");
00066   aboutData.addAuthor ("Dominik Haumann", I18N_NOOP("Developer & Highlight wizard"), "dhdev@gmx.de");
00067 
00068   aboutData.addCredit ("Matteo Merli",I18N_NOOP("Highlighting for RPM Spec-Files, Perl, Diff and more"), "merlim@libero.it");
00069   aboutData.addCredit ("Rocky Scaletta",I18N_NOOP("Highlighting for VHDL"), "rocky@purdue.edu");
00070   aboutData.addCredit ("Yury Lebedev",I18N_NOOP("Highlighting for SQL"),"");
00071   aboutData.addCredit ("Chris Ross",I18N_NOOP("Highlighting for Ferite"),"");
00072   aboutData.addCredit ("Nick Roux",I18N_NOOP("Highlighting for ILERPG"),"");
00073   aboutData.addCredit ("Carsten Niehaus", I18N_NOOP("Highlighting for LaTeX"),"");
00074   aboutData.addCredit ("Per Wigren", I18N_NOOP("Highlighting for Makefiles, Python"),"");
00075   aboutData.addCredit ("Jan Fritz", I18N_NOOP("Highlighting for Python"),"");
00076   aboutData.addCredit ("Daniel Naber","","");
00077   aboutData.addCredit ("Roland Pabel",I18N_NOOP("Highlighting for Scheme"),"");
00078   aboutData.addCredit ("Cristi Dumitrescu",I18N_NOOP("PHP Keyword/Datatype list"),"");
00079   aboutData.addCredit ("Carsten Pfeiffer", I18N_NOOP("Very nice help"), "");
00080   aboutData.addCredit (I18N_NOOP("All people who have contributed and I have forgotten to mention"),"","");
00081 
00082   aboutData.setTranslator(I18N_NOOP("_: NAME OF TRANSLATORS\nYour names"), I18N_NOOP("_: EMAIL OF TRANSLATORS\nYour emails"));
00083 
00084   KCmdLineArgs::init (argc, argv, &aboutData);
00085   KCmdLineArgs::addCmdLineOptions (options);
00086   KateApp::addCmdLineOptions ();
00087   KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
00088 
00089   bool newProcess = false;
00090   bool oldState = false;
00091 
00092   if (args->isSet ("n"))
00093     newProcess = true;
00094 
00095   if (newProcess)
00096   {
00097     KInstance instance (&aboutData);
00098 
00099     KConfig *config = instance.config();
00100     config->setGroup("KDE");
00101     oldState = config->readBoolEntry("MultipleInstances",false);
00102     config->writeEntry("MultipleInstances",true);
00103     config->sync();
00104   }
00105 
00106   KateApp app (newProcess, oldState);
00107   return app.exec();
00108 }
KDE Logo
This file is part of the documentation for kate Library Version 3.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Jun 14 16:46:24 2006 by doxygen 1.4.4 written by Dimitri van Heesch, © 1997-2003