changeset 14284:04050d082a5d gui

Forgot to remove more terminal source code. See previous commit for more information.
author Jacob Dawid <jacob.dawid@googlemail.com>
date Mon, 30 Jan 2012 12:45:14 +0100
parents 8dfa333f1130
children 728c8929385f
files gui/src/AbstractTerminalView.cpp gui/src/AbstractTerminalView.h gui/src/TerminalView.cpp gui/src/TerminalView.h gui/src/WinTerminalView.cpp gui/src/WinTerminalView.h
diffstat 6 files changed, 0 insertions(+), 290 deletions(-) [+]
line wrap: on
line diff
--- a/gui/src/AbstractTerminalView.cpp	Mon Jan 30 12:38:34 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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 <http://www.gnu.org/licenses/>.
- */
-
-#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
-}
--- a/gui/src/AbstractTerminalView.h	Mon Jan 30 12:38:34 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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 <http://www.gnu.org/licenses/>.
- */
-
-#ifndef ABSTRACTTERMINALVIEW_H
-#define ABSTRACTTERMINALVIEW_H
-
-#include <QString>
-
-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
--- a/gui/src/TerminalView.cpp	Mon Jan 30 12:38:34 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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 <http://www.gnu.org/licenses/>.
- */
-
-#include "TerminalHighlighter.h"
-#include "TerminalView.h"
-#include <QHBoxLayout>
-#include <QVBoxLayout>
-#include <QStringListModel>
-#include <QStringList>
-#include <QScrollBar>
-
-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();
-}
--- a/gui/src/TerminalView.h	Mon Jan 30 12:38:34 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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 <http://www.gnu.org/licenses/>.
- */
-
-#ifndef OCTAVETERMINAL_H
-#define OCTAVETERMINAL_H
-#include <QPlainTextEdit>
-#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
--- a/gui/src/WinTerminalView.cpp	Mon Jan 30 12:38:34 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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 <http://www.gnu.org/licenses/>.
- */
-
-#include "WinTerminalView.h"
-
-WinTerminalView::WinTerminalView (QWidget* parent)
-    : QConsole (parent)
-{
-}
-
-WinTerminalView::~WinTerminalView (void)
-{
-}
-
-void WinTerminalView::sendText (const QString& txt)
-{
-  QConsole::sendText (txt);
-}
--- a/gui/src/WinTerminalView.h	Mon Jan 30 12:38:34 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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 <http://www.gnu.org/licenses/>.
- */
-
-#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