Commit a14e0a69 authored by Robert Knight's avatar Robert Knight

Rename terminal display widget class from TEWidget to TerminalDisplay

svn path=/branches/work/konsole-split-view/; revision=642967
parent d41a3087
......@@ -37,7 +37,7 @@ endif(KONSOLE_GENERATE_LINEFONT)
# konsole.cpp
# schema.cpp
# TESession.cpp
# TEWidget.cpp
# TerminalDisplay.cpp
# TEmuVt102.cpp
# TEScreen.cpp
# TEmulation.cpp
......@@ -73,7 +73,7 @@ set(konsole_KDEINIT_SRCS
TEPty.cpp
TEScreen.cpp
TESession.cpp
TEWidget.cpp
TerminalDisplay.cpp
TEmuVt102.cpp
TEmulation.cpp
TerminalCharacterDecoder.cpp
......@@ -120,7 +120,7 @@ set(konsolepart_PART_SRCS
schema.cpp
TESession.cpp
ZModemDialog.cpp
TEWidget.cpp
TerminalDisplay.cpp
TEmuVt102.cpp
TEScreen.cpp
konsole_wcwidth.cpp
......
......@@ -27,7 +27,7 @@ class TEScreen;
/**
* Provides a window onto a section of a terminal screen.
* This window can then be rendered by a terminal display widget ( TEWidget ).
* This window can then be rendered by a terminal display widget ( TerminalDisplay ).
*
* To use the screen window, create a new ScreenWindow() instance and associated it with
* a terminal screen using setScreen().
......
......@@ -14,7 +14,7 @@
#include "HistorySizeDialog.h"
#include "IncrementalSearchBar.h"
#include "TESession.h"
#include "TEWidget.h"
#include "TerminalDisplay.h"
#include "SessionController.h"
#include "ProcessInfo.h"
......@@ -34,7 +34,7 @@ KIcon SessionController::_activityIcon;
KIcon SessionController::_silenceIcon;
QPointer<SearchHistoryThread> SearchHistoryTask::_thread;
SessionController::SessionController(TESession* session , TEWidget* view, QObject* parent)
SessionController::SessionController(TESession* session , TerminalDisplay* view, QObject* parent)
: ViewProperties(parent)
, KXMLGUIClient()
, _session(session)
......
......@@ -19,7 +19,7 @@ class QAction;
class KToggleAction;
class KUrl;
class TESession;
class TEWidget;
class TerminalDisplay;
class IncrementalSearchBar;
class UrlFilter;
class RegExpFilter;
......@@ -54,7 +54,7 @@ public:
/**
* Constructs a new SessionController which operates on @p session and @p view.
*/
SessionController(TESession* session , TEWidget* view, QObject* parent);
SessionController(TESession* session , TerminalDisplay* view, QObject* parent);
~SessionController();
/** Reimplemented to watch for events happening to the view */
......@@ -63,7 +63,7 @@ public:
/** Returns the session associated with this controller */
TESession* session() { return _session; }
/** Returns the view associated with this controller */
TEWidget* view() { return _view; }
TerminalDisplay* view() { return _view; }
/**
* Sets the widget used for searches through the session's history.
......@@ -130,7 +130,7 @@ private:
private:
TESession* _session;
TEWidget* _view;
TerminalDisplay* _view;
KIcon _sessionIcon;
QString _sessionIconName;
int _previousState;
......
......@@ -235,7 +235,7 @@ public:
* Creates a new session of the specified type, using the settings specified
* using addSetting() and from the configuration file for this session type.
*
* The new session has no views associated with it. A new TEWidget view
* The new session has no views associated with it. A new TerminalDisplay view
* must be created in order to display the output from the terminal session and
* send keyboard or mouse input to it.
*
......
......@@ -19,7 +19,7 @@
*/
/*! \file TECommon.h
\brief Definitions shared between TEScreen and TEWidget.
\brief Definitions shared between TEScreen and TerminalDisplay.
*/
#ifndef TECOMMON_H
......@@ -66,7 +66,7 @@ struct ColorEntry
#define DEFAULT_BACK_COLOR 1
//a standard set of colors using black text on a white background.
//defined in TEWidget.characterpp
//defined in TerminalDisplay.characterpp
static const ColorEntry base_color_table[TABLE_COLORS] =
// The following are almost IBM standard color codes, with some slight
......
......@@ -463,9 +463,9 @@ void TEScreen::setDefaultMargins()
/*
Clarifying rendition here and in TEWidget.
Clarifying rendition here and in TerminalDisplay.
currently, TEWidget's color table is
currently, TerminalDisplay's color table is
0 1 2 .. 9 10 .. 17
dft_fg, dft_bg, dim 0..7, intensive 0..7
......@@ -474,7 +474,7 @@ void TEScreen::setDefaultMargins()
- 1..8 = ansi specified color
re_fg, re_bg contain values 0..17
due to the TEWidget's color table
due to the TerminalDisplay's color table
rendition attributes are
......@@ -507,7 +507,7 @@ void TEScreen::effectiveRendition()
//copy "current rendition" straight into "effective rendition", which is then later copied directly
//into the image[] array which holds the characters and their appearance properties.
//- The old version below filtered out all attributes other than underline and blink at this stage,
//so that they would not be copied into the image[] array and hence would not be visible by TEWidget
//so that they would not be copied into the image[] array and hence would not be visible by TerminalDisplay
//which actually paints the screen using the information from the image[] array.
//I don't know why it did this, but I'm fairly sure it was the wrong thing to do. The net result
//was that bold text wasn't printed in bold by Konsole.
......
......@@ -52,7 +52,7 @@ class TerminalCharacterDecoder;
The terminal emulation ( TEmulation ) receives a serial stream of
characters from the program currently running in the terminal.
From this stream it creates an image of characters which is ultimately
rendered by the display widget ( TEWidget ). Some types of emulation
rendered by the display widget ( TerminalDisplay ). Some types of emulation
may have more than one screen image.
getCookedImage() is used to retrieve the currently visible image
......
......@@ -142,7 +142,7 @@ void TESession::setArguments(const QStringList& arguments)
*/
#if 0
TESession::TESession(TEWidget* _te, const QString &_pgm, const QStringList & _args, const QString &_term, ulong _winId, const QString &_sessionId, const QString &_initial_cwd)
TESession::TESession(TerminalDisplay* _te, const QString &_pgm, const QStringList & _args, const QString &_term, ulong _winId, const QString &_sessionId, const QString &_initial_cwd)
: TESession()
, _program(_pgm)
, _arguments(_args)
......@@ -211,12 +211,12 @@ void TESession::ptyError()
emit done(this);
}
QList<TEWidget*> TESession::views() const
QList<TerminalDisplay*> TESession::views() const
{
return _views;
}
void TESession::addView(TEWidget* widget)
void TESession::addView(TerminalDisplay* widget)
{
Q_ASSERT( !_views.contains(widget) );
......@@ -257,14 +257,14 @@ void TESession::addView(TEWidget* widget)
void TESession::viewDestroyed(QObject* view)
{
TEWidget* display = (TEWidget*)view;
TerminalDisplay* display = (TerminalDisplay*)view;
Q_ASSERT( _views.contains(display) );
removeView(display);
}
void TESession::removeView(TEWidget* widget)
void TESession::removeView(TerminalDisplay* widget)
{
_views.removeAll(widget);
......@@ -283,7 +283,7 @@ void TESession::removeView(TEWidget* widget)
}
}
/*void TESession::changeWidget(TEWidget* w)
/*void TESession::changeWidget(TerminalDisplay* w)
{
Q_ASSERT(0); //Method not updated yet to handle multiple views
}*/
......@@ -436,7 +436,7 @@ void TESession::setUserTitle( int what, const QString &caption )
if (backColor != modifiedBackground) {
modifiedBackground = backColor;
QListIterator<TEWidget*> viewIter(_views);
QListIterator<TerminalDisplay*> viewIter(_views);
while (viewIter.hasNext())
viewIter.next()->setDefaultBackColor(backColor);
}
......@@ -460,7 +460,7 @@ void TESession::setUserTitle( int what, const QString &caption )
if ( _iconName != caption ) {
_iconName = caption;
QListIterator< TEWidget* > viewIter(_views);
QListIterator< TerminalDisplay* > viewIter(_views);
while (viewIter.hasNext())
viewIter.next()->update();
modified = true;
......@@ -544,7 +544,7 @@ void TESession::onContentSizeChange(int /*height*/, int /*width*/)
void TESession::updateTerminalSize()
{
QListIterator<TEWidget*> viewIter(_views);
QListIterator<TerminalDisplay*> viewIter(_views);
int minLines = -1;
int minColumns = -1;
......@@ -552,7 +552,7 @@ void TESession::updateTerminalSize()
//select largest number of lines and columns that will fit in all visible views
while ( viewIter.hasNext() )
{
TEWidget* view = viewIter.next();
TerminalDisplay* view = viewIter.next();
if ( view->isHidden() == false )
{
minLines = (minLines == -1) ? view->Lines() : qMin( minLines , view->Lines() );
......@@ -613,7 +613,7 @@ TESession::~TESession()
delete _shellProcess;
delete zmodemProc;
QListIterator<TEWidget*> viewIter(_views);
QListIterator<TerminalDisplay*> viewIter(_views);
while (viewIter.hasNext())
viewIter.next()->deleteLater();
}
......@@ -1024,7 +1024,7 @@ void TESession::setSchema(ColorSchema* schema)
_colorScheme = schema;
//update color scheme for attached views
QListIterator<TEWidget*> viewIter(_views);
QListIterator<TerminalDisplay*> viewIter(_views);
while (viewIter.hasNext())
{
viewIter.next()->setColorTable(schema->table());
......
......@@ -31,7 +31,7 @@
// Konsole
#include "TEPty.h"
#include "TEWidget.h"
#include "TerminalDisplay.h"
#include "TEmuVt102.h"
......@@ -79,19 +79,19 @@ public:
* When the TESession instance is destroyed, any views which are still attached will also
* be deleted.
*/
void addView(TEWidget* widget);
void addView(TerminalDisplay* widget);
/**
* Removes a view from this session.
*
* @p widget will no longer display output from or send input
* to the terminal
*/
void removeView(TEWidget* widget);
void removeView(TerminalDisplay* widget);
/**
* Returns the views connected to this session
*/
QList<TEWidget*> views() const;
QList<TerminalDisplay*> views() const;
/**
* Returns true if the session has created child processes which have not yet terminated
......@@ -275,7 +275,7 @@ private:
TEPty* _shellProcess;
TEmulation* _emulation;
QList<TEWidget*> _views;
QList<TerminalDisplay*> _views;
bool connected;
bool monitorActivity;
......
......@@ -22,7 +22,7 @@
\brief Actual Emulation for Konsole
\sa TEWidget \sa TEScreen
\sa TerminalDisplay \sa TEScreen
*/
#include "config-konsole.h"
......@@ -96,7 +96,7 @@ TEmuVt102::TEmuVt102() : TEmulation()
}
#if 0
void TEmuVt102::setReceiveViewInput(TEWidget* view , bool enable)
void TEmuVt102::setReceiveViewInput(TerminalDisplay* view , bool enable)
{
if (enable)
{
......@@ -116,13 +116,13 @@ void TEmuVt102::setReceiveViewInput(TEWidget* view , bool enable)
#endif
#if 0
void TEmuVt102::addView(TEWidget* view)
void TEmuVt102::addView(TerminalDisplay* view)
{
TEmulation::addView(view);
setReceiveViewInput(view,true);
}
void TEmuVt102::removeView(TEWidget* view)
void TEmuVt102::removeView(TerminalDisplay* view)
{
TEmulation::removeView(view);
setReceiveViewInput(view,false);
......@@ -1094,7 +1094,7 @@ void TEmuVt102::onKeyPress( QKeyEvent* ev )
in the pipeline. It only applies to tokens, which represent
plain characters.
This conversion it eventually continued in TEWidget.C, since
This conversion it eventually continued in TerminalDisplay.C, since
it might involve VT100 enhanced fonts, which have these
particular glyphs allocated in (0x00-0x1f) in their code page.
*/
......@@ -1290,7 +1290,7 @@ bool TEmuVt102::getMode(int m)
{
TEmulation::setConnect(c);
QListIterator< TEWidget* > viewIter(_views);
QListIterator< TerminalDisplay* > viewIter(_views);
while (viewIter.hasNext())
{
......@@ -1314,7 +1314,7 @@ bool TEmuVt102::getMode(int m)
scrolllock_set_off();
#endif
QListIterator< TEWidget* > viewIter2(_views);
QListIterator< TerminalDisplay* > viewIter2(_views);
while (viewIter2.hasNext())
{
......
......@@ -30,7 +30,7 @@
#include <QTimer>
// Konsole
#include "TEWidget.h"
#include "TerminalDisplay.h"
#include "TEScreen.h"
#include "TEmulation.h"
......@@ -165,7 +165,7 @@ private:
//(including xterm-style mouse input for example)
//
//See also - TEmulation::connectView()
//void setReceiveViewInput( TEWidget* view , bool enable );
//void setReceiveViewInput( TerminalDisplay* view , bool enable );
void resetToken();
#define MAXPBUF 80
......
......@@ -22,21 +22,21 @@
/*! \class TEmulation
\brief Mediator between TEWidget and TEScreen.
\brief Mediator between TerminalDisplay and TEScreen.
This class is responsible to scan the escapes sequences of the terminal
emulation and to map it to their corresponding semantic complements.
Thus this module knows mainly about decoding escapes sequences and
is a stateless device w.rendition.t. the semantics.
It is also responsible to refresh the TEWidget by certain rules.
It is also responsible to refresh the TerminalDisplay by certain rules.
\sa TEWidget \sa TEScreen
\sa TerminalDisplay \sa TEScreen
\par A note on refreshing
Although the modifications to the current screen image could immediately
be propagated via `TEWidget' to the graphical surface, we have chosen
be propagated via `TerminalDisplay' to the graphical surface, we have chosen
another way here.
The reason for doing so is twofold.
......@@ -386,7 +386,7 @@ void TEmulation::setSelection(const bool preserve_line_breaks) {
QString t = currentScreen->selectedText(preserve_line_breaks);
if (!t.isNull())
{
QListIterator< TEWidget* > viewIter(_views);
QListIterator< TerminalDisplay* > viewIter(_views);
while (viewIter.hasNext())
viewIter.next()->setSelection(t);
......@@ -563,7 +563,7 @@ void TEmulation::setListenToKeyPress(bool l)
// ---------------------------------------------------------------------------
/*! triggered by image size change of the TEWidget `gui'.
/*! triggered by image size change of the TerminalDisplay `gui'.
This event is simply propagated to the attached screens
and to the related serial line.
......
......@@ -34,7 +34,7 @@
// Konsole
#include "KeyTrans.h"
#include "TEScreen.h"
#include "TEWidget.h"
#include "TerminalDisplay.h"
class ScreenWindow;
......@@ -45,7 +45,7 @@ enum { NOTIFYNORMAL=0, NOTIFYBELL=1, NOTIFYACTIVITY=2, NOTIFYSILENCE=3 };
*
* The back-end is responsible for decoding the incoming character stream from the terminal
* program and producing an output image of characters which it then sends to connected
* views by calling their TEWidget::setImage() method.
* views by calling their TerminalDisplay::setImage() method.
*
* The emulation also is also responsible for converting input from the connected views such
* as keypresses and mouse activity into a character string which can be sent
......@@ -66,7 +66,7 @@ public:
/**
* Creates a new window onto the output from this emulation. The contents
* of the window are then rendered by views which are set to use this window using the
* TEWidget::setScreenWindow() method.
* TerminalDisplay::setScreenWindow() method.
*/
ScreenWindow* createWindow();
......@@ -125,7 +125,7 @@ public:
*/
virtual bool findTextNext( const QString &str, bool forward, bool caseSensitive, bool regExp );
public Q_SLOTS: // signals incoming from TEWidget
public Q_SLOTS: // signals incoming from TerminalDisplay
/** Change the size of the emulation's image */
virtual void onImageSizeChange(int lines, int columns);
......@@ -163,7 +163,7 @@ public Q_SLOTS: // signals incoming from TEWidget
//virtual void onSelectionBegin(const int x, const int y, const bool columnmode);
/** Extend the current selection to column @p x, row @p y. */
//virtual void onSelectionExtend(const int x, const int y);
/** Calls the TEWidget::setSelection() method of each associated view with the currently selected text */
/** Calls the TerminalDisplay::setSelection() method of each associated view with the currently selected text */
//virtual void setSelection(const bool preserve_line_breaks);
virtual void isBusySelecting(bool busy);
......
......@@ -69,19 +69,19 @@ class ScreenWindow;
* A widget which displays output from a terminal emulation and sends input keypresses and mouse activity
* to the terminal.
*
* TEWidget does not know anything about the terminal emulation whoose output it is displaying.
* TerminalDisplay does not know anything about the terminal emulation whoose output it is displaying.
*
* When the terminal emulation receives new output from the program running in the terminal,
* it will update the display by calling setImage().
*/
class TEWidget : public QFrame
class TerminalDisplay : public QFrame
{
Q_OBJECT
public:
TEWidget(QWidget *parent=0);
virtual ~TEWidget();
TerminalDisplay(QWidget *parent=0);
virtual ~TerminalDisplay();
void setBlendColor(const QRgb color) { blend_color = color; }
......@@ -259,7 +259,7 @@ Q_SIGNALS:
void changedFontMetricSignal(int height, int width);
void changedContentSizeSignal(int height, int width);
void changedHistoryCursor( int value);
void configureRequest( TEWidget*, int state, int x, int y );
void configureRequest( TerminalDisplay*, int state, int x, int y );
void isBusySelecting(bool);
void sendStringToEmu(const char*);
......
......@@ -30,7 +30,7 @@
#include "KonsoleBookmarkHandler.h"
#include "KonsoleMainWindow.h"
#include "TESession.h"
#include "TEWidget.h"
#include "TerminalDisplay.h"
#include "schema.h"
#include "SessionController.h"
#include "SessionManager.h"
......@@ -94,7 +94,7 @@ void ViewManager::detachActiveView()
{
// find the currently active view and remove it from its container
ViewContainer* container = _viewSplitter->activeContainer();
TEWidget* activeView = dynamic_cast<TEWidget*>(container->activeView());
TerminalDisplay* activeView = dynamic_cast<TerminalDisplay*>(container->activeView());
if (!activeView)
return;
......@@ -125,9 +125,9 @@ void ViewManager::detachActiveView()
void ViewManager::sessionFinished( TESession* session )
{
QList<TEWidget*> children = _viewSplitter->findChildren<TEWidget*>();
QList<TerminalDisplay*> children = _viewSplitter->findChildren<TerminalDisplay*>();
foreach ( TEWidget* view , children )
foreach ( TerminalDisplay* view , children )
{
if ( _sessionMap[view] == session )
{
......@@ -230,8 +230,8 @@ void ViewManager::splitView(bool splitView)
while (existingViewIter.hasNext())
{
TESession* session = _sessionMap[(TEWidget*)existingViewIter.next()];
TEWidget* display = createTerminalDisplay();
TESession* session = _sessionMap[(TerminalDisplay*)existingViewIter.next()];
TerminalDisplay* display = createTerminalDisplay();
loadViewSettings(display,session);
ViewProperties* properties = createController(session,display);
......@@ -259,7 +259,7 @@ void ViewManager::splitView(bool splitView)
_viewSplitter->activeContainer()->activeView()->setFocus(Qt::OtherFocusReason);
}
SessionController* ViewManager::createController(TESession* session , TEWidget* view)
SessionController* ViewManager::createController(TESession* session , TerminalDisplay* view)
{
// create a new controller for the session, and ensure that this view manager
// is notified when the view gains the focus
......@@ -290,7 +290,7 @@ void ViewManager::createView(TESession* session)
while ( containerIter.hasNext() )
{
ViewContainer* container = containerIter.next();
TEWidget* display = createTerminalDisplay();
TerminalDisplay* display = createTerminalDisplay();
loadViewSettings(display,session);
ViewProperties* properties = createController(session,display);
......@@ -336,7 +336,7 @@ void ViewManager::viewCloseRequest(QWidget* view)
// 1. detach view from session
// 2. if the session has no views left, close it
TEWidget* display = (TEWidget*)view;
TerminalDisplay* display = (TerminalDisplay*)view;
TESession* session = _sessionMap[ display ];
if ( session )
{
......@@ -368,7 +368,7 @@ void ViewManager::merge(ViewManager* otherManager)
while ( otherViewIter.hasNext() )
{
TEWidget* view = dynamic_cast<TEWidget*>(otherViewIter.next());
TerminalDisplay* view = dynamic_cast<TerminalDisplay*>(otherViewIter.next());
assert(view);
......@@ -378,7 +378,7 @@ void ViewManager::merge(ViewManager* otherManager)
void ViewManager::takeView(ViewManager* otherManager , ViewContainer* otherContainer,
ViewContainer* newContainer, TEWidget* view)
ViewContainer* newContainer, TerminalDisplay* view)
{
// FIXME - the controller associated with the display which is being moved
// may have signals which are connected to otherManager. they need
......@@ -393,9 +393,9 @@ void ViewManager::takeView(ViewManager* otherManager , ViewContainer* otherConta
otherManager->_sessionMap.remove(view);
}
TEWidget* ViewManager::createTerminalDisplay()
TerminalDisplay* ViewManager::createTerminalDisplay()
{
TEWidget* display = new TEWidget(0);
TerminalDisplay* display = new TerminalDisplay(0);
//TODO Temporary settings used here
display->setBellMode(0);
......@@ -404,12 +404,12 @@ TEWidget* ViewManager::createTerminalDisplay()
display->setCutToBeginningOfLine(true);
display->setTerminalSizeStartup(false);
display->setSize(80,40);
display->setScrollbarLocation(TEWidget::SCROLLBAR_RIGHT);
display->setScrollbarLocation(TerminalDisplay::SCROLLBAR_RIGHT);
return display;
}
void ViewManager::loadViewSettings(TEWidget* view , TESession* session)
void ViewManager::loadViewSettings(TerminalDisplay* view , TESession* session)
{
// load colour scheme
view->setColorTable( session->schema()->table() );
......
......@@ -29,7 +29,7 @@ class KToggleAction;
class KonsoleMainWindow;
class TESession;
class TEWidget;
class TerminalDisplay;
class SessionController;
class ViewProperties;
......@@ -114,31 +114,31 @@ private slots:
private:
void setupActions();
void focusActiveView();
void registerView(TEWidget* view);
void unregisterView(TEWidget* view);
void registerView(TerminalDisplay* view);
void unregisterView(TerminalDisplay* view);
// takes a view from a view container owned by a different manager and places it in
// newContainer owned by this manager
void takeView(ViewManager* otherManager , ViewContainer* otherContainer, ViewContainer* newContainer, TEWidget* view);
void takeView(ViewManager* otherManager , ViewContainer* otherContainer, ViewContainer* newContainer, TerminalDisplay* view);
// creates a new container which can hold terminal displays
ViewContainer* createContainer();
// creates a new terminal display
TEWidget* createTerminalDisplay();
TerminalDisplay* createTerminalDisplay();
// applies the view-specific settings such as colour scheme associated
// with 'session' to 'view'
void loadViewSettings(TEWidget* view , TESession* session);
void loadViewSettings(TerminalDisplay* view , TESession* session);
// creates a new controller for a session/display pair which provides the menu
// actions associated with that view, and exposes basic information
// about the session ( such as title and associated icon ) to the display.
SessionController* createController(TESession* session , TEWidget* display);
SessionController* createController(TESession* session , TerminalDisplay* display);
private:
KonsoleMainWindow* _mainWindow;
KToggleAction* _splitViewAction;
ViewSplitter* _viewSplitter;
QPointer<SessionController> _pluggedController;
QHash<TEWidget*,TESession*> _sessionMap;
QHash<TerminalDisplay*,TESession*> _sessionMap;
};
......
......@@ -331,8 +331,8 @@ Konsole::Konsole(const char* name, int histon, bool menubaron, bool tabbaron, bo
if (te) te->setFrameStyle( QFrame::NoFrame );
}
if (!scrollbaron) {
n_scroll = TEWidget::SCRNONE;
if (te) te->setScrollbarLocation(TEWidget::SCRNONE);
n_scroll = TerminalDisplay::SCRNONE;
if (te) te->setScrollbarLocation(TerminalDisplay::SCRNONE);