# HG changeset patch # User Jacob Dawid # Date 1327923914 -3600 # Node ID 04050d082a5d6c295cbbfd76239087339c2dda95 # Parent 8dfa333f1130582f782a0c03aa5fe42cb50183c0 Forgot to remove more terminal source code. See previous commit for more information. diff --git a/gui/src/AbstractTerminalView.cpp b/gui/src/AbstractTerminalView.cpp deleted file mode 100644 --- a/gui/src/AbstractTerminalView.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* OctaveGUI - A graphical user interface for Octave - * Copyright (C) 2011 Michael Goffioul (michael.goffioul@gmail.com) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#include "AbstractTerminalView.h" -#if defined (Q_OS_UNIX) -#include "TerminalView.h" -#elif defined (Q_OS_WIN) -#include "WinTerminalView.h" -#endif - -AbstractTerminalView* AbstractTerminalView::create (QWidget* parent) -{ -#if defined (Q_OS_UNIX) - return new TerminalView (parent); -#elif defined (Q_OS_WIN) - return new WinTerminalView (parent); -#else - qFatal ("No terminal widget available for this platform."); - return 0 -#endif -} diff --git a/gui/src/AbstractTerminalView.h b/gui/src/AbstractTerminalView.h deleted file mode 100644 --- a/gui/src/AbstractTerminalView.h +++ /dev/null @@ -1,42 +0,0 @@ -/* OctaveGUI - A graphical user interface for Octave - * Copyright (C) 2011 Michael Goffioul (michael.goffioul@gmail.com) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#ifndef ABSTRACTTERMINALVIEW_H -#define ABSTRACTTERMINALVIEW_H - -#include - -class QWidget; - -/** - * @class AbstractTerminalView - * Abstract class defining the interface for any terminal view widget. - */ -class AbstractTerminalView -{ -public: - /** Sends text to the terminal. */ - virtual void sendText (const QString&) = 0; - - /** Gets the terminal widget. */ - virtual QWidget* widget (void) = 0; - - /** Creates a terminal view for the current platform. */ - static AbstractTerminalView* create (QWidget* parent = 0); -}; - -#endif // ABSTRACTTERMINALVIEW_H diff --git a/gui/src/TerminalView.cpp b/gui/src/TerminalView.cpp deleted file mode 100644 --- a/gui/src/TerminalView.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* OctaveGUI - A graphical user interface for Octave - * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#include "TerminalHighlighter.h" -#include "TerminalView.h" -#include -#include -#include -#include -#include - -TerminalView::TerminalView (QWidget * parent) - : QPlainTextEdit (parent), Terminal () -{ - setFont (QFont ("Monospace", 10)); - setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding); - m_terminalEmulation = TerminalEmulation::newTerminalEmulation (this); - - TerminalHighlighter *terminalHighlighter = new TerminalHighlighter (); - terminalHighlighter->setDocument (document ()); -} - -TerminalView::~TerminalView () -{ -} - -QTextCursor -TerminalView::textCursor () -{ - return QPlainTextEdit::textCursor(); -} - -void -TerminalView::setTextCursor (const QTextCursor &cursor) -{ - QPlainTextEdit::setTextCursor (cursor); -} - -void -TerminalView::bell () -{ -} - -void -TerminalView::keyPressEvent (QKeyEvent * keyEvent) -{ - if(m_terminalEmulation) - m_terminalEmulation->processKeyEvent (keyEvent); -} - -void -TerminalView::mousePressEvent (QMouseEvent *mouseEvent) -{ - // TODO: Pass mouse events to the terminal emulation. - mouseEvent->accept(); -} - -void -TerminalView::mouseDoubleClickEvent (QMouseEvent *mouseEvent) -{ - // TODO: Pass mouse events to the terminal emulation. - mouseEvent->accept(); -} - -void -TerminalView::wheelEvent (QWheelEvent *wheelEvent) -{ - // TODO: Pass mouse events to the terminal emulation. - wheelEvent->accept(); -} diff --git a/gui/src/TerminalView.h b/gui/src/TerminalView.h deleted file mode 100644 --- a/gui/src/TerminalView.h +++ /dev/null @@ -1,58 +0,0 @@ -/* OctaveGUI - A graphical user interface for Octave - * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#ifndef OCTAVETERMINAL_H -#define OCTAVETERMINAL_H -#include -#include "AbstractTerminalView.h" -#include "TerminalEmulation.h" - -class TerminalView: - public QPlainTextEdit, - public AbstractTerminalView, - Terminal -{ -Q_OBJECT -public: - TerminalView (QWidget * parent = 0); - ~TerminalView (); - - TerminalEmulation *terminalEmulation () - { - return m_terminalEmulation; - } - - // AbstractTerminalView interface - void sendText (const QString& text) - { m_terminalEmulation->transmitText(text); } - QWidget* widget (void) { return this; } - - // Terminal Interface - QTextCursor textCursor(); - void setTextCursor (const QTextCursor &cursor); - void bell (); - -protected: - void keyPressEvent (QKeyEvent *keyEvent); - void mousePressEvent (QMouseEvent *mouseEvent); - void mouseDoubleClickEvent (QMouseEvent *mouseEvent); - void wheelEvent (QWheelEvent *wheelEvent); - -private: - TerminalEmulation *m_terminalEmulation; -}; -#endif // OCTAVETERMINAL_H diff --git a/gui/src/WinTerminalView.cpp b/gui/src/WinTerminalView.cpp deleted file mode 100755 --- a/gui/src/WinTerminalView.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* OctaveGUI - A graphical user interface for Octave - * Copyright (C) 2011 Michael Goffioul (michael.goffioul@gmail.com) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#include "WinTerminalView.h" - -WinTerminalView::WinTerminalView (QWidget* parent) - : QConsole (parent) -{ -} - -WinTerminalView::~WinTerminalView (void) -{ -} - -void WinTerminalView::sendText (const QString& txt) -{ - QConsole::sendText (txt); -} diff --git a/gui/src/WinTerminalView.h b/gui/src/WinTerminalView.h deleted file mode 100644 --- a/gui/src/WinTerminalView.h +++ /dev/null @@ -1,39 +0,0 @@ -/* OctaveGUI - A graphical user interface for Octave - * Copyright (C) 2011 Michael Goffioul (michael.goffioul@gmail.com) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#ifndef WINTERMINALVIEW_H -#define WINTERMINALVIEW_H - -#include "QConsole.h" -#include "AbstractTerminalView.h" - -/** - * @class WinTerminalView - * A Windows terminal widget, based on QConsole. - */ -class WinTerminalView : public QConsole, public AbstractTerminalView -{ -public: - WinTerminalView (QWidget* parent = 0); - ~WinTerminalView (void); - - // AbstractTerminalView interface - void sendText (const QString&); - QWidget* widget (void) { return this; } -}; - -#endif // WINTERMINALVIEW_H