Commit 3395ad32 authored by Christoph Cullmann's avatar Christoph Cullmann

move kate to kdesdk, as said on core-devel

will more plugins into it soon, too

svn path=/trunk/KDE/kdesdk/kate/; revision=635993
parents
Kate/KWrite Team:
- Christoph Cullmann <cullmann@kde.org>
(Maintainer)
- Joseph Wenninger <jowenn@kde.org>
(highlight guy + big bug hunter)
- Anders Lund <anders@alweb.dk>
(very cool split view + much more)
- Waldo Bastian <bastian@kde.org>
(improved buffer handling)
- Michael Bartl <michael.bartl1@chello.at>
(first one who really helped out :)
- Phlip <phlip_cpp@my-deja.com>
(project stuff)
- Matt Newell <newellm@proaxis.com>
- Michael McCallum <gholam@xtra.co.nz>
- John Firebaugh <jfire@uclink.berkeley.edu>
- Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
(original author of kwrite in kde 1.x until kde 2.1)
- Glen Parker <glenebob@nwlink.com>
(undo history, kspell-integration)
- Michael Koch <koch@kde.org>
(port to KParts)
project(kate)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/interfaces)
add_subdirectory( interfaces )
add_subdirectory( app )
add_subdirectory( plugins )
add_subdirectory( data )
add_subdirectory( pics )
This diff is collapsed.
This diff is collapsed.
KateApp
- KatePluginManager
one plugin manager per app
- KateDocManager
one doc manager per app
- KateMainWindow
mutliple mainwindows per app possible
- KateViewManager
one view manager per mainwin
Coding Guidelines: Keep close to what this command gives you
astyle -c -s2 -C -S -N -b --convert-tabs -p <file>
/** @mainpage Kate
*
* Kate is the KDE Advanced Text Editor. This section describes
* the internal classes used to create Kate. It should not be
* used as a public API.
*
* For a public API, see the text editor interface in kdelibs.
*
*/
#! /bin/sh
(cd data && $PREPARETIPS > ../tips.cpp)
$EXTRACTRC ./*/*.rc >> ./rc.cpp || exit 11
$XGETTEXT `find . -name "*.cpp"` -o $podir/kate.pot
rm -f tips.cpp
2003-08-28
Kate uses KMdi ;)
2002-07-19
New Plugin Interfaces finished (hopefully)
2002-01-03
Kate App and Part seperated
2001-11-24
KTextEditor interfaces are near completion ;)
2001-06-11
Little Cullmann got his little Abitur with 1.zero ;)
2001-05-12
juhu, my abi is over ;) (just must type a news item ;)
2001-04-01
Kant -> Kate
2001-03-01
Kant is now official part of KDEBASE ;-)
*** Kate ***
Kate is a fast texteditor for the KDE destop with an Emacs-style document interface.
I hope it works well and improves workspeed on many little textfiles. ;-)
Our new buffer managment will allow it to open 50MB files ++ in less than 5 seconds
(at least on my 400Mhz P2 ;) It is thought as a more powerful replacement for the old
KWrite app, which will still keep alive for the existing userbase and because it is
just a lot smaller and therefor faster on launch than kate.
For Kate Plugins, Kate provides the Kate Interfaces, which allow deeper access
to the Kate app and its features.
*** KWrite ***
The KWrite app is based on the KWrite of KDE 2.0 written by Jochen Wilhelmy
but now it uses the Kate part or any other KTextEditor compatible part.
The most stuff has been rewritten since the old KDE 2.x days.
Homepage: http://kate.kde.org
Licensing:
The Kate app/utils/interfaces and KWrite app are licensed under the LGPL VERSION 2.
########### next target ###############
set(kateinterfaces_LIB_SRCS kateappadaptor.cpp katemainwindowadaptor.cpp
../interfaces/kate/application.cpp
../interfaces/kate/mainwindow.cpp
../interfaces/kate/documentmanager.cpp
../interfaces/kate/pluginmanager.cpp
../interfaces/kate/plugin.cpp
../interfaces/kate/pluginconfigpageinterface.cpp
kateapp.cpp
kateconfigdialog.cpp
kateconfigplugindialogpage.cpp
katedocmanager.cpp
katefilelist.cpp
katemainwindow.cpp
katepluginmanager.cpp
kateviewmanager.cpp
kateviewspace.cpp
katetooltipmenu.cpp
katesavemodifieddialog.cpp
kateviewspacecontainer.cpp
katemwmodonhddialog.cpp
katesession.cpp
katemdi.cpp
katetabwidget.cpp
katedocmanageradaptor.cpp
kateviewdocumentproxymodel.cpp
)
kde4_automoc(${kateinterfaces_LIB_SRCS})
kde4_add_library(kateinterfaces SHARED ${kateinterfaces_LIB_SRCS})
target_link_libraries(kateinterfaces ${KDE4_KDE3SUPPORT_LIBS} ${QT_QTXML_LIBRARY} ktexteditor )
set_target_properties(kateinterfaces PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} )
install(TARGETS kateinterfaces DESTINATION ${LIB_INSTALL_DIR} )
########### next target ###############
set(kate_KDEINIT_SRCS katemain.cpp)
kde4_automoc(${kate_KDEINIT_SRCS})
kde4_add_kdeinit_executable( kate ${kate_KDEINIT_SRCS})
target_link_libraries(kdeinit_kate ${KDE4_KDECORE_LIBS} kateinterfaces )
install(TARGETS kdeinit_kate DESTINATION ${LIB_INSTALL_DIR} )
target_link_libraries( kate kdeinit_kate )
install(TARGETS kate DESTINATION ${BIN_INSTALL_DIR})
This diff is collapsed.
/* This file is part of the KDE project
Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
Copyright (C) 2002 Joseph Wenninger <jowenn@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef __KATE_APP_H__
#define __KATE_APP_H__
#include <kdebase_export.h>
#include "katemain.h"
#include <kate/mainwindow.h>
#include <KApplication>
#include <QList>
class KateSessionManager;
namespace Kate
{
class Application;
}
class KCmdLineArgs;
/**
* Kate Application
* This class represents the core kate application object
*/
class KATEINTERFACES_EXPORT KateApp : public KApplication
{
Q_OBJECT
/**
* constructors & accessor to app object + plugin interface for it
*/
public:
/**
* application constructor
* @param args parsed command line args
*/
KateApp (KCmdLineArgs *args);
/**
* application destructor
*/
~KateApp ();
/**
* static accessor to avoid casting ;)
* @return app instance
*/
static KateApp *self ();
/**
* accessor to the Kate::Application plugin interface
* @return application plugin interface
*/
Kate::Application *application ();
/**
* Returns the current Kate version (X.Y) or (X.Y.Z)
* @param fullVersion should full version be returned?
* @return Kate version
*/
static QString kateVersion (bool fullVersion = true);
/**
* kate init
*/
private:
/**
* get kate inited
*/
void initKate ();
/**
* restore a old kate session
*/
void restoreKate ();
/**
* try to start kate
* @return success, if false, kate should exit
*/
bool startupKate ();
/**
* kate shutdown
*/
public:
/**
* shutdown kate application
* @param win mainwindow which is used for dialogs
*/
void shutdownKate (KateMainWindow *win);
/**
* other accessors for global unique instances
*/
public:
/**
* accessor to plugin manager
* @return plugin manager instance
*/
KatePluginManager *pluginManager();
/**
* accessor to document manager
* @return document manager instance
*/
KateDocManager *documentManager ();
/**
* accessor to session manager
* @return session manager instance
*/
KateSessionManager *sessionManager ();
/**
* window management
*/
public:
/**
* create a new main window, use given config if any for restore
* @param sconfig session config object
* @param sgroup session group for this window
* @return new constructed main window
*/
KateMainWindow *newMainWindow (KConfig *sconfig = 0, const QString &sgroup = "");
/**
* add the mainwindow given
* should be called in mainwindow constructor
* @param mainWindow window to remove
*/
void addMainWindow (KateMainWindow *mainWindow);
/**
* removes the mainwindow given, DOES NOT DELETE IT
* should be called in mainwindow destructor
* @param mainWindow window to remove
*/
void removeMainWindow (KateMainWindow *mainWindow);
/**
* give back current active main window
* can only be 0 at app start or exit
* @return current active main window
*/
KateMainWindow *activeMainWindow ();
/**
* give back number of existing main windows
* @return number of main windows
*/
int mainWindows () const;
/**
* give back the window you want
* @param n window index
* @return requested main window
*/
KateMainWindow *mainWindow (int n);
int mainWindowID(KateMainWindow *window);
/**
* some stuff for the dcop API
*/
public:
/**
* open url with given encoding
* used by kate if --use given
* @param url filename
* @param encoding encoding name
* @return success
*/
bool openUrl (const KUrl &url, const QString &encoding, bool isTempFile);
/**
* position cursor in current active view
* @param line line to set
* @param column column to set
* @return success
*/
bool setCursor (int line, int column);
/**
* helper to handle stdin input
* open a new document/view, fill it with the text given
* @param text text to fill in the new doc/view
* @return success
*/
bool openInput (const QString &text);
bool shouldExit() const
{
return m_shouldExit;
}
/**
* Get a list of all mainwindows interfaces for the plugins.
* @return all mainwindows
* @see activeMainWindow()
*/
const QList<Kate::MainWindow*> &mainWindowsInterfaces () const
{
return m_mainWindowsInterfaces;
}
private:
bool m_shouldExit;
/**
* kate's command line args
*/
KCmdLineArgs *m_args;
/**
* plugin interface
*/
Kate::Application *m_application;
/**
* document manager
*/
KateDocManager *m_docManager;
/**
* plugin manager
*/
KatePluginManager *m_pluginManager;
/**
* session manager
*/
KateSessionManager *m_sessionManager;
/**
* known main windows
*/
QList<KateMainWindow*> m_mainWindows;
QList<Kate::MainWindow*> m_mainWindowsInterfaces;
};
#endif
// kate: space-indent on; indent-width 2; replace-tabs on;
/* This file is part of the KDE project
Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "kateappadaptor.h"
#include "kateapp.h"
#include "katesession.h"
#include "katedocmanager.h"
#include "katemainwindow.h"
#include "kateappadaptor.moc"
KateAppAdaptor::KateAppAdaptor (KateApp *app)
: QDBusAbstractAdaptor( app )
, m_app (app)
{}
QDBusObjectPath KateAppAdaptor::documentManager ()
{
return QDBusObjectPath (m_app->documentManager()->dbusObjectPath ());
}
QDBusObjectPath KateAppAdaptor::activeMainWindow ()
{
KateMainWindow *win = m_app->activeMainWindow();
if (win)
return QDBusObjectPath (win->dbusObjectPath());
return QDBusObjectPath ();
}
uint KateAppAdaptor::activeMainWindowNumber ()
{
KateMainWindow *win = m_app->activeMainWindow();
if (win)
return win->mainWindowNumber ();
return 0;
}
uint KateAppAdaptor::mainWindows ()
{
return m_app->mainWindows ();
}
QDBusObjectPath KateAppAdaptor::mainWindow (uint n)
{
KateMainWindow *win = m_app->mainWindow(n);
if (win)
return QDBusObjectPath (win->dbusObjectPath ());
return QDBusObjectPath ();
}
bool KateAppAdaptor::openUrl (QString url, QString encoding)
{
return m_app->openUrl (url, encoding, false);
}
bool KateAppAdaptor::openUrl (QString url, QString encoding, bool isTempFile)
{
return m_app->openUrl (url, encoding, isTempFile);
}
bool KateAppAdaptor::setCursor (int line, int column)
{
return m_app->setCursor (line, column);
}
bool KateAppAdaptor::openInput (QString text)
{
return m_app->openInput (text);
}
bool KateAppAdaptor::activateSession (QString session)
{
m_app->sessionManager()->activateSession (m_app->sessionManager()->giveSession (session));
return true;
}
// kate: space-indent on; indent-width 2; replace-tabs on;
/* This file is part of the KDE project
Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef _kateapp_adaptor_h_
#define _kateapp_adaptor_h_
#include <QtDBus/QtDBus>
class KateApp;
class KateAppAdaptor : public QDBusAbstractAdaptor
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.kde.kate.App")
public:
KateAppAdaptor (KateApp *app);
public Q_SLOTS:
QDBusObjectPath documentManager ();
QDBusObjectPath activeMainWindow ();
uint activeMainWindowNumber ();
uint mainWindows ();
QDBusObjectPath mainWindow (uint n = 0);
/**
* open a file with given url and encoding
* will get view created
* @param url url of the file
* @param encoding encoding name
* @return success
*/
bool openUrl (QString url, QString encoding);
/**
* Like the above, but adds an option to let the documentManager know
* if the file should be deleted when closed.
* @p isTempFile should be set to true with the --tempfile option set ONLY,
* files opened with this set to true will be deleted when closed.
*/
bool openUrl(QString url, QString encoding, bool isTempFile);
/**
* set cursor of active view in active main window
* @param line line for cursor
* @param column column for cursor
* @return success
*/
bool setCursor (int line, int column);
/**
* helper to handle stdin input
* open a new document/view, fill it with the text given
* @param text text to fill in the new doc/view
* @return success
*/
bool openInput (QString text);
/**
* activate a given session
* @param session session name
* @return success
*/
bool activateSession (QString session);
private:
KateApp *m_app;
};
#endif
// kate: space-indent on; indent-width 2; replace-tabs on;
This diff is collapsed.
/* This file is part of the KDE project
Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
Copyright (C) 2002 Joseph Wenninger <jowenn@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef __kate_configdialog_h__
#define __kate_configdialog_h__
#include "katemain.h"
#include <kate/plugin.h>
#include <kate/pluginconfigpageinterface.h>
#include <KTextEditor/Document>
#include <KTextEditor/EditorChooser>
#include <KPageDialog>
#include <QList>
class QCheckBox;
class QSpinBox;
class Q3ButtonGroup;
struct PluginPageListItem
{
Kate::Plugin *plugin;
Kate::PluginConfigPage *page;
};
class KateConfigDialog : public KPageDialog
{
Q_OBJECT
public:
KateConfigDialog (KateMainWindow *parent, KTextEditor::View *view);
~KateConfigDialog ();
public:
void addPluginPage (Kate::Plugin *plugin, KPageWidgetItem *parent = 0);
void removePluginPage (Kate::Plugin *plugin);
protected Q_SLOTS:
void slotOk();
void slotApply();
void slotChanged();