From 114a878c64ce6f8223cfd22d76a20eb16d177e5e Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- languages/csharp/Makefile.am | 25 ++ languages/csharp/README.dox | 46 ++++ languages/csharp/app_templates/Makefile.am | 3 + languages/csharp/app_templates/csharp.appwizard | 2 + languages/csharp/csharpconfigwidget.cpp | 38 +++ languages/csharp/csharpconfigwidget.h | 34 +++ languages/csharp/csharpconfigwidgetbase.ui | 101 ++++++++ languages/csharp/csharpdoc.cpp | 133 ++++++++++ languages/csharp/csharpdoc.h | 25 ++ languages/csharp/csharpdoc.protocol | 9 + languages/csharp/csharpsupportpart.cpp | 331 ++++++++++++++++++++++++ languages/csharp/csharpsupportpart.h | 59 +++++ languages/csharp/doc/Makefile.am | 6 + languages/csharp/file_templates/Makefile.am | 4 + languages/csharp/kdevcsharpsupport.desktop | 57 ++++ languages/csharp/kdevcsharpsupport.rc | 14 + 16 files changed, 887 insertions(+) create mode 100644 languages/csharp/Makefile.am create mode 100644 languages/csharp/README.dox create mode 100644 languages/csharp/app_templates/Makefile.am create mode 100644 languages/csharp/app_templates/csharp.appwizard create mode 100644 languages/csharp/csharpconfigwidget.cpp create mode 100644 languages/csharp/csharpconfigwidget.h create mode 100644 languages/csharp/csharpconfigwidgetbase.ui create mode 100644 languages/csharp/csharpdoc.cpp create mode 100644 languages/csharp/csharpdoc.h create mode 100644 languages/csharp/csharpdoc.protocol create mode 100644 languages/csharp/csharpsupportpart.cpp create mode 100644 languages/csharp/csharpsupportpart.h create mode 100644 languages/csharp/doc/Makefile.am create mode 100644 languages/csharp/file_templates/Makefile.am create mode 100644 languages/csharp/kdevcsharpsupport.desktop create mode 100644 languages/csharp/kdevcsharpsupport.rc (limited to 'languages/csharp') diff --git a/languages/csharp/Makefile.am b/languages/csharp/Makefile.am new file mode 100644 index 00000000..51d0c110 --- /dev/null +++ b/languages/csharp/Makefile.am @@ -0,0 +1,25 @@ +# Here resides the CSharp support part. + +INCLUDES = -I$(top_srcdir)/lib/interfaces \ + -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util \ + $(all_includes) +SUBDIRS = app_templates file_templates doc + + +kde_module_LTLIBRARIES = libkdevcsharpsupport.la kio_csharpdoc.la +libkdevcsharpsupport_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) +libkdevcsharpsupport_la_LIBADD = $(top_builddir)/lib/libkdevelop.la + +libkdevcsharpsupport_la_SOURCES = csharpsupportpart.cpp csharpconfigwidget.cpp csharpconfigwidgetbase.ui + +kio_csharpdoc_la_SOURCES = csharpdoc.cpp +kio_csharpdoc_la_LIBADD = $(LIB_KIO) +kio_csharpdoc_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) + +METASOURCES = AUTO + +servicedir = $(kde_servicesdir) +service_DATA = kdevcsharpsupport.desktop csharpdoc.protocol + +rcdir = $(kde_datadir)/kdevcsharpsupport +rc_DATA = kdevcsharpsupport.rc diff --git a/languages/csharp/README.dox b/languages/csharp/README.dox new file mode 100644 index 00000000..6d256b08 --- /dev/null +++ b/languages/csharp/README.dox @@ -0,0 +1,46 @@ +/** \class CSharpSupportPart +This is csharp language support plugin. + +Put a more detailed description of your part in these lines. It can span +over several lines. You can even use some html commands in these lines like: +This is code, html links link text, +and images. + +\authors Bernd Gehrmann +\authors Luc Willems + +\maintainer Luc Willems + +\feature csharp programming language support +\feature Consult \ref LangSupportStatus for a up to date features/status of this programming language support part. + +\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet. +.. +\bug Describe a the nth bug that you know of, but probably hasn't been reported yet. + +\requirement Describe a the 1st requirement of your part. +\requirement Describe a the 2nd requirement of your part. +... +\requirement Describe a the nth requirement of your part. + +\todo Describe a the 1st TODO of your part. +\todo Describe a the 2nd TODO of your part. +... +\todo Describe a the nth TODO of your part. + +\faq First frequenly asked question about your part ? Answer. +\faq Second frequenly asked question about your part ? Answer. +... +\faq Last frequenly asked question about your part ? Answer. + +\note First note text. +\note Second note text. +... +\note Last note text. + +\warning First warning text. +\warning Second warning text. +... +\warning Last warning text. + +*/ diff --git a/languages/csharp/app_templates/Makefile.am b/languages/csharp/app_templates/Makefile.am new file mode 100644 index 00000000..14608ada --- /dev/null +++ b/languages/csharp/app_templates/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = +profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/ScriptingLanguageIDE/CSharpIDE +profiles_DATA = csharp.appwizard diff --git a/languages/csharp/app_templates/csharp.appwizard b/languages/csharp/app_templates/csharp.appwizard new file mode 100644 index 00000000..44c9faf9 --- /dev/null +++ b/languages/csharp/app_templates/csharp.appwizard @@ -0,0 +1,2 @@ +[General] +List=perlhello diff --git a/languages/csharp/csharpconfigwidget.cpp b/languages/csharp/csharpconfigwidget.cpp new file mode 100644 index 00000000..b18d3e69 --- /dev/null +++ b/languages/csharp/csharpconfigwidget.cpp @@ -0,0 +1,38 @@ +/*************************************************************************** + * Copyright (C) 2002 by Bernd Gehrmann * + * bernd@kdevelop.org * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "csharpconfigwidget.h" + +#include +#include +#include "domutil.h" + + +CSharpConfigWidget::CSharpConfigWidget(QDomDocument &projectDom, + QWidget *parent, const char *name) + : CSharpConfigWidgetBase(parent, name), dom(projectDom) +{ + interpreter_edit->setText(DomUtil::readEntry(dom, "/kdevcsharpsupport/run/interpreter")); + terminal_box->setChecked(DomUtil::readBoolEntry(dom, "/kdevcsharpsupport/run/terminal")); +} + + +CSharpConfigWidget::~CSharpConfigWidget() +{} + + +void CSharpConfigWidget::accept() +{ + DomUtil::writeEntry(dom, "/kdevcsharpsupport/run/interpreter", interpreter_edit->text()); + DomUtil::writeBoolEntry(dom, "/kdevcsharpsupport/run/terminal", terminal_box->isChecked()); +} + +#include "csharpconfigwidget.moc" diff --git a/languages/csharp/csharpconfigwidget.h b/languages/csharp/csharpconfigwidget.h new file mode 100644 index 00000000..bf1b063e --- /dev/null +++ b/languages/csharp/csharpconfigwidget.h @@ -0,0 +1,34 @@ +/*************************************************************************** + * Copyright (C) 2002 by Bernd Gehrmann * + * bernd@kdevelop.org * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef _CSHARPCONFIGWIDGET_H_ +#define _CSHARPCONFIGWIDGET_H_ + +#include "csharpconfigwidgetbase.h" +#include + + +class CSharpConfigWidget : public CSharpConfigWidgetBase +{ + Q_OBJECT + +public: + CSharpConfigWidget( QDomDocument &projectDom, QWidget *parent=0, const char *name=0 ); + ~CSharpConfigWidget(); + +public slots: + void accept(); + +private: + QDomDocument &dom; +}; + +#endif diff --git a/languages/csharp/csharpconfigwidgetbase.ui b/languages/csharp/csharpconfigwidgetbase.ui new file mode 100644 index 00000000..dbf4d3ae --- /dev/null +++ b/languages/csharp/csharpconfigwidgetbase.ui @@ -0,0 +1,101 @@ + +CSharpConfigWidgetBase + + + csharp_config_widget + + + + 0 + 0 + 600 + 480 + + + + CSharp + + + + unnamed + + + + + interpreter_label + + + CSharp &interpreter: + + + interpreter_edit + + + + + Layout1 + + + + unnamed + + + 0 + + + + + interpreter_edit + + + + + Spacer1 + + + Horizontal + + + Expanding + + + + + + + Spacer3 + + + Vertical + + + Minimum + + + + + terminal_box + + + &Execute programs in a terminal + + + + + Spacer2 + + + Vertical + + + Expanding + + + + + + kdialog.h + + + + diff --git a/languages/csharp/csharpdoc.cpp b/languages/csharp/csharpdoc.cpp new file mode 100644 index 00000000..8755be2b --- /dev/null +++ b/languages/csharp/csharpdoc.cpp @@ -0,0 +1,133 @@ +#include "csharpdoc.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace KIO; + + +CSharpdocProtocol::CSharpdocProtocol(const QCString &pool, const QCString &app) + : SlaveBase("csharpdoc", pool, app) +{} + + +CSharpdocProtocol::~CSharpdocProtocol() +{} + + +void CSharpdocProtocol::get(const KURL& url) +{ + QStringList l = QStringList::split('/', url.path()); + + mimeType("text/html"); + + bool plain = false; + QString cmd = "csharpdoc "; + if (l[0] == "functions") { + plain = true; + cmd += "-t -f "; + cmd += KProcess::quote(l[1]); + } else if (l[0] == "faq") { + cmd += "-u -q "; + cmd += KProcess::quote(l[1]); + cmd += " | pod2html"; + } else { + QCString errstr(i18n("The only existing directories are functions and faq.").local8Bit()); + data(errstr); + finished(); + return; + } + + kdDebug() << "Command: " << cmd << endl; + + if (plain) + data(QCString("
")); + + FILE *fd = popen(cmd.local8Bit().data(), "r"); + char buffer[4090]; + QByteArray array; + + while (!feof(fd)) { + int n = fread(buffer, 1, 2048, fd); + if (n == -1) { + pclose(fd); + return; + } + array.setRawData(buffer, n); + data(array); + array.resetRawData(buffer, n); + } + + pclose(fd); + + if (plain) + data(QCString("
")); + + finished(); +} + + +void CSharpdocProtocol::mimetype(const KURL &url) +{ + QStringList l = QStringList::split('/', url.path()); + mimeType((l[0] == "faq")? "text/html" : "text/plain"); + finished(); +} + + +QCString CSharpdocProtocol::errorMessage() +{ + return QCString( "" + i18n("Error in csharpdoc").local8Bit() + "" ); +} + + +void CSharpdocProtocol::stat(const KURL &/*url*/) +{ + UDSAtom uds_atom; + uds_atom.m_uds = KIO::UDS_FILE_TYPE; + uds_atom.m_long = S_IFREG | S_IRWXU | S_IRWXG | S_IRWXO; + + UDSEntry uds_entry; + uds_entry.append(uds_atom); + + statEntry(uds_entry); + finished(); +} + + +void CSharpdocProtocol::listDir(const KURL &url) +{ + error( KIO::ERR_CANNOT_ENTER_DIRECTORY, url.path() ); +} + + +extern "C" { + + int kdemain(int argc, char **argv) + { + KInstance instance( "kio_csharpdoc" ); + KGlobal::locale()->setMainCatalogue("kdevelop"); + + if (argc != 4) { + fprintf(stderr, "Usage: kio_csharpdoc protocol domain-socket1 domain-socket2\n"); + exit(-1); + } + + CSharpdocProtocol slave(argv[2], argv[3]); + slave.dispatchLoop(); + + return 0; + } + +} diff --git a/languages/csharp/csharpdoc.h b/languages/csharp/csharpdoc.h new file mode 100644 index 00000000..85fa8cf5 --- /dev/null +++ b/languages/csharp/csharpdoc.h @@ -0,0 +1,25 @@ +#ifndef _CSHARPDOC_H_ +#define _CSHARPDOC_H_ + +#include +#include + + +class CSharpdocProtocol : public KIO::SlaveBase +{ +public: + CSharpdocProtocol(const QCString &pool, const QCString &app); + virtual ~CSharpdocProtocol(); + + virtual void get(const KURL& url); + virtual void stat(const KURL& url); + virtual void mimetype(const KURL& url); + virtual void listDir(const KURL& url); + +protected: + void decodeURL(const KURL &url); + void decodePath(QString path); + QCString errorMessage(); +}; + +#endif diff --git a/languages/csharp/csharpdoc.protocol b/languages/csharp/csharpdoc.protocol new file mode 100644 index 00000000..9b813b02 --- /dev/null +++ b/languages/csharp/csharpdoc.protocol @@ -0,0 +1,9 @@ +[Protocol] +exec=kio_csharpdoc +protocol=csharpdoc +input=none +output=filesystem +reading=true +listing=Name +determineMimetypeFromExtension=false +Icon=help diff --git a/languages/csharp/csharpsupportpart.cpp b/languages/csharp/csharpsupportpart.cpp new file mode 100644 index 00000000..01a21ffb --- /dev/null +++ b/languages/csharp/csharpsupportpart.cpp @@ -0,0 +1,331 @@ +/*************************************************************************** + * Copyright (C) 2001-2002 by Bernd Gehrmann * + * bernd@kdevelop.org * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "csharpsupportpart.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "kdevmainwindow.h" + +#include +#include +#include + +#include "kdevcore.h" +#include "kdevproject.h" +#include "kdevpartcontroller.h" +#include "kdevplugininfo.h" +#include "kdevappfrontend.h" +//#include "classstore.h" +//#include "parsedclass.h" +//#include "parsedmethod.h" +//#include "parsedscript.h" +#include "domutil.h" +//#include "programmingbycontract.h" + +typedef KDevGenericFactory CSharpSupportFactory; +static const KDevPluginInfo data("kdevcsharpsupport"); +K_EXPORT_COMPONENT_FACTORY( libkdevcsharpsupport, CSharpSupportFactory( data ) ) + +CSharpSupportPart::CSharpSupportPart(QObject *parent, const char *name, const QStringList &) + : KDevLanguageSupport(&data, parent, name ? name : "CSharpSupportPart") +{ + setInstance(CSharpSupportFactory::instance()); + + setXMLFile("kdevcsharpsupport.rc"); + + connect( core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()) ); + connect( core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()) ); + connect( partController(), SIGNAL(savedFile(const KURL&)), + this, SLOT(savedFile(const KURL&)) ); + + KAction *action; + + action = new KAction( i18n("Execute Main Program"), "exec", 0, + this, SLOT(slotExecute()), + actionCollection(), "build_exec" ); + action->setToolTip( i18n("Runs the CSharp program") ); + + action = new KAction( i18n("Execute String..."), "exec", 0, + this, SLOT(slotExecuteString()), + actionCollection(), "build_execstring" ); + action->setToolTip( i18n("Executes a string as CSharp code") ); + + action = new KAction( i18n("Start CSharp Interpreter"), "exec", 0, + this, SLOT(slotStartInterpreter()), + actionCollection(), "build_runinterpreter" ); + action->setToolTip( i18n("Starts the CSharp interpreter without a program") ); + + action = new KAction( i18n("Find CSharp Function Documentation..."), 0, + this, SLOT(slotCSharpdocFunction()), + actionCollection(), "help_csharpdocfunction" ); + action->setToolTip( i18n("Show the documentation page of a CSharp function") ); + + action = new KAction( i18n("Find CSharp FAQ Entry..."), 0, + this, SLOT(slotCSharpdocFAQ()), + actionCollection(), "help_csharpdocfaq" ); + action->setToolTip( i18n("Show the FAQ entry for a keyword") ); + + //csharp parser for codemodel + // m_parser = new csharpparser(core(),codeModel(),interpreter()); +} + + +CSharpSupportPart::~CSharpSupportPart() +{ + if (project()) + projectClosed(); + + // delete m_parser; + // m_parser=0; +} + + +void CSharpSupportPart::projectOpened() +{ + kdDebug(9007) << "projectOpened()" << endl; + + connect( project(), SIGNAL(addedFilesToProject(const QStringList &)), + this, SLOT(addedFilesToProject(const QStringList &)) ); + connect( project(), SIGNAL(removedFilesFromProject(const QStringList &)), + this, SLOT(removedFilesFromProject(const QStringList &)) ); + + // We want to parse only after all components have been + // procsharpy initialized + QTimer::singleShot(0, this, SLOT(initialParse())); +} + + +void CSharpSupportPart::projectClosed() +{ +} + +void CSharpSupportPart::maybeParse(const QString fileName) +{ + QFileInfo fi(fileName); + QString path = fi.filePath(); + QString extension = fi.extension(); + if (extension == "cs") { + kdDebug(9016) << "maybe " << fileName << endl; + removeWithReference(fileName); + // m_parser->parse(fileName); + emit addedSourceInfo( fileName); + } +} + +void CSharpSupportPart::addedFilesToProject(const QStringList &fileList) +{ + kdDebug(9016) << "addedFilesToProject()" << endl; + + QStringList::ConstIterator it; + + for ( it = fileList.begin(); it != fileList.end(); ++it ) + { + maybeParse(project()->projectDirectory() + "/" + ( *it )); + } +} + + +void CSharpSupportPart::removedFilesFromProject(const QStringList &fileList) +{ + kdDebug(9016) << "removedFilesFromProject()" << endl; + QStringList::ConstIterator it; + for ( it = fileList.begin(); it != fileList.end(); ++it ) + { + QString fileName = project()->projectDirectory() + "/" + ( *it ); + removeWithReference(fileName); + } + emit updatedSourceInfo(); +} + + +void CSharpSupportPart::savedFile(const KURL &fileName) +{ + Q_UNUSED( fileName.path() ); +#if 0 // not needed anymore + kdDebug(9016) << "savedFile()" << endl; + + if (project()->allFiles().contains(fileName.mid ( project()->projectDirectory().length() + 1 ))) { + maybeParse(fileName); + emit updatedSourceInfo(); + } +#endif +} + + +KDevLanguageSupport::Features CSharpSupportPart::features() +{ + return KDevLanguageSupport::Features(Classes | Functions | Variables | Namespaces | /*Scripts | */NewClass | AddMethod | AddAttribute /*| NewScript*/); +// return Functions; +} + +QString CSharpSupportPart::interpreter() +{ + QString prog = DomUtil::readEntry(*projectDom(), "/kdevcsharpsupport/run/interpreter"); + if (prog.isEmpty()) + prog = "csharp"; + + return prog; +} + + +void CSharpSupportPart::startApplication(const QString &program) +{ + bool inTerminal = DomUtil::readBoolEntry(*projectDom(), "/kdevcsharpsupport/run/terminal"); + if (KDevAppFrontend *appFrontend = extension("KDevelop/AppFrontend")) + appFrontend->startAppCommand(QString::QString(), program, inTerminal); +} + + +void CSharpSupportPart::slotExecute() +{ + QString program = project()->mainProgram(); + QString cmd = interpreter() + " " + program; + startApplication(cmd); +} + + +void CSharpSupportPart::slotStartInterpreter() +{ + startApplication(interpreter()); +} + + +void CSharpSupportPart::slotExecuteString() +{ + bool ok; + QString cmd = KInputDialog::getText(i18n("String to Execute"), i18n("String to execute:"), QString::null, &ok, 0); + if (ok) { + cmd.prepend("'"); + cmd.append("'"); + startApplication(cmd); + } +} + + +void CSharpSupportPart::slotCSharpdocFunction() +{ + bool ok; + QString key = KInputDialog::getText(i18n("Show CSharp Documentation"), i18n("Show CSharp documentation for function:"), "", &ok, 0); + if (ok && !key.isEmpty()) { + QString url = "csharpdoc:functions/"; + url += key; + partController()->showDocument(KURL(url)); + } +} + + +void CSharpSupportPart::slotCSharpdocFAQ() +{ + bool ok; + QString key = KInputDialog::getText(i18n("Show FAQ Entry"), i18n("Show FAQ entry for keyword:"), "", &ok, 0); + if (ok && !key.isEmpty()) { + QString url = "csharpdoc:faq/"; + url += key; + partController()->showDocument(KURL(url)); + } +} +KMimeType::List CSharpSupportPart::mimeTypes( ) +{ + KMimeType::List list; + KMimeType::Ptr mime = KMimeType::mimeType( "application/x-csharp" ); + if( mime ) + list << mime; + return list; +} + +void CSharpSupportPart::initialParse() +{ + kdDebug(9016) << "initialParse()" << endl; + + if (project()) { + //copy from cpp support : give user some feedback + mainWindow()->statusBar()->message( i18n("Updating...") ); + kapp->processEvents( ); + + kapp->setOverrideCursor(waitCursor); + QStringList files = project()->allFiles(); + // m_parser->initialParse(); + + //progress bar + QProgressBar* bar = new QProgressBar( files.count( ), mainWindow( )->statusBar( ) ); + bar->setMinimumWidth( 120 ); + bar->setCenterIndicator( true ); + mainWindow( )->statusBar( )->addWidget( bar ); + bar->show( ); + int n = 0; + for (QStringList::Iterator it = files.begin(); it != files.end() ;++it) { +// kdDebug(9016) << "maybe parse " << project()->projectDirectory() + "/" + (*it) << endl; + maybeParse(project()->projectDirectory() + "/" + *it); + //update progress bar + bar->setProgress( n++ ); + if( (n%5) == 0 ) + kapp->processEvents(); + } + parseUseFiles(); + emit updatedSourceInfo(); + + //remove progressbar + mainWindow( )->statusBar( )->removeWidget( bar ); + delete bar; + kapp->restoreOverrideCursor(); + mainWindow()->statusBar()->message( i18n("Done") ); + + } else { + kdDebug(9016) << "No project" << endl; + } +} + +void CSharpSupportPart::removeWithReference( const QString & fileName ) +{ + kdDebug(9016) << "remove with references: " << fileName << endl; + //m_timestamp.remove( fileName ); + if( !codeModel()->hasFile(fileName) ) + return; + + emit aboutToRemoveSourceInfo( fileName ); + codeModel()->removeFile( codeModel()->fileByName(fileName) ); +} + +void CSharpSupportPart::parseUseFiles() +{ + kdDebug(9016) << "parse addional libs" << endl; + return; + QString filename; + QStringList m_usefiles; + // QStringList m_usefiles = m_parser->UseFiles(); + + //parse addional use files + for (QStringList::Iterator it = m_usefiles.begin(); it != m_usefiles.end() ;++it) + { + // filename = m_parser->findLib(*it); + //if something found , parse it + if (!filename.isEmpty()) { + //kdDebug(9016) << "found " << filename << endl; + maybeParse(filename); + } + } +} + +#include "csharpsupportpart.moc" diff --git a/languages/csharp/csharpsupportpart.h b/languages/csharp/csharpsupportpart.h new file mode 100644 index 00000000..166285a6 --- /dev/null +++ b/languages/csharp/csharpsupportpart.h @@ -0,0 +1,59 @@ +/*************************************************************************** + * Copyright (C) 2001-2002 by Bernd Gehrmann * + * bernd@kdevelop.org * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef _CSHARPSUPPORTPART_H_ +#define _CSHARPSUPPORTPART_H_ + +#include "kdevlanguagesupport.h" +#include +// #include "csharpparser.h" + +class CSharpSupportPart : public KDevLanguageSupport +{ + Q_OBJECT + +public: + CSharpSupportPart( QObject *parent, const char *name, const QStringList & ); + ~CSharpSupportPart(); + +protected: + virtual Features features(); + virtual KMimeType::List mimeTypes(); + +private slots: + void projectOpened(); + void projectClosed(); + void savedFile(const KURL &fileName); + void addedFilesToProject(const QStringList &fileList); + void removedFilesFromProject(const QStringList &fileList); + void slotExecute(); + void slotExecuteString(); + void slotStartInterpreter(); + + // Internal + void initialParse(); + void slotCSharpdocFunction(); + void slotCSharpdocFAQ(); + +private: + QString interpreter(); + void startApplication(const QString &program); + void maybeParse(const QString fileName); + void parse(const QString &fileName); + void parseLines(QStringList* lines,const QString& fileName); + void removeWithReference( const QString & fileName ); + void parseUseFiles(); + //CSharp Parser +// csharpparser* m_parser; + +}; + +#endif diff --git a/languages/csharp/doc/Makefile.am b/languages/csharp/doc/Makefile.am new file mode 100644 index 00000000..e0dfb9eb --- /dev/null +++ b/languages/csharp/doc/Makefile.am @@ -0,0 +1,6 @@ +tocdir = ${kde_datadir}/kdevdocumentation/tocs +toc_DATA = + +#indexdir = ${kde_datadir}/devdoctreeview/indices +#index_DATA = + diff --git a/languages/csharp/file_templates/Makefile.am b/languages/csharp/file_templates/Makefile.am new file mode 100644 index 00000000..b4f0a30c --- /dev/null +++ b/languages/csharp/file_templates/Makefile.am @@ -0,0 +1,4 @@ +templatedir = $(kde_datadir)/kdevfilecreate/file-templates +template_DATA = + + diff --git a/languages/csharp/kdevcsharpsupport.desktop b/languages/csharp/kdevcsharpsupport.desktop new file mode 100644 index 00000000..dbd9492b --- /dev/null +++ b/languages/csharp/kdevcsharpsupport.desktop @@ -0,0 +1,57 @@ +[Desktop Entry] +Type=Service +Exec=blubb +Comment=CSharp Support +Comment[ca]=Suport per a CSharp +Comment[da]=Csharp understøttelse +Comment[de]=CSharp-Unterstützung für KDevelop +Comment[el]=Υποστήριξη CSharp +Comment[es]=Soporte para CSharp +Comment[et]=CSharp'i toetus +Comment[fr]=Prise en charge du langage CSharp +Comment[hu]=CSharp-támogatás +Comment[it]=Supporto per CSharp +Comment[ja]=CSharp サポート +Comment[nds]=Ünnerstütten för CSharp +Comment[nl]=Ondersteuning voor CSharp +Comment[pl]=Obsługa CSharp +Comment[pt]=Suporte a C# +Comment[pt_BR]=Suporte a C# +Comment[ru]=Поддержка CSharp +Comment[sk]=CSharp podpora +Comment[sr]=Подршка за CSharp +Comment[sr@Latn]=Podrška za CSharp +Comment[sv]=C#-stöd +Comment[zh_TW]=C# 支援 +Name=KDevCSharpSupport +Name[de]=Unterstützung für CSharp (KDevelop) +Name[nds]=CSharp-Ünnerstütten för KDevelop +Name[sv]=KDevelop C#-stöd +Name[zh_TW]=KDevelop C# 支援 +GenericName=CSharp Support +GenericName[ca]=Suport per a CSharp +GenericName[da]=CSharp understøttelse +GenericName[de]=Unterstützung für CSharp +GenericName[el]=Υποστήριξη CSharp +GenericName[es]=Soporte para CSharp +GenericName[et]=CSharp'i toetus +GenericName[fr]=Prise en charge du langage CSharp +GenericName[hu]=CSharp-támogatás +GenericName[it]=Supporto CSharp +GenericName[ja]=CSharp サポート +GenericName[nds]=Ünnerstütten för CSharp +GenericName[nl]=Ondersteuning voor CSharp +GenericName[pl]=Obsługa CSharp +GenericName[pt]=Suporte a C# +GenericName[pt_BR]=Suporte a C# +GenericName[ru]=Поддержка CSharp +GenericName[sk]=CSharp podpora +GenericName[sr]=Подршка за CSharp +GenericName[sr@Latn]=Podrška za CSharp +GenericName[sv]=C#-stöd +GenericName[zh_TW]=C# 支援 +ServiceTypes=KDevelop/LanguageSupport +X-KDE-Library=libkdevcsharpsupport +X-KDevelop-Version=5 +X-KDevelop-Language=CSharp + diff --git a/languages/csharp/kdevcsharpsupport.rc b/languages/csharp/kdevcsharpsupport.rc new file mode 100644 index 00000000..b5f735e2 --- /dev/null +++ b/languages/csharp/kdevcsharpsupport.rc @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + -- cgit v1.2.3