Commit abaa7ef5 authored by Robert Knight's avatar Robert Knight

Use union for clarity in Character class. Added menu item for Send Input to All.

svn path=/branches/work/konsole-split-view/; revision=658405
parent c1b2c4e9
......@@ -9,6 +9,7 @@
<Menu name="edit"><text>Edit</text>
<Action name="copy" group="session-edit-operations" />
<Action name="paste" group="session-edit-operations" />
<Action name="rename-session" group="session-edit-operations" />
<Separator group="session-edit-operations"/>
<Action name="send-input-to-all" group="session-edit-operations"/>
<Separator group="session-edit-operations"/>
......
......@@ -125,7 +125,7 @@ void TerminalImageFilterChain::addImage(const Character* const image , int lines
for (int i=0 ; i < lines ; i++)
{
decoder.decodeLine(image + i*columns,columns,0,&lineStream);
decoder.decodeLine(image + i*columns,columns,LINE_DEFAULT,&lineStream);
addLine(line);
line.clear();
}
......
......@@ -21,6 +21,7 @@
#include <QStringList>
// KDE
#include <KMenuBar>
#include <KXMLGUIFactory>
// Konsole
......@@ -31,6 +32,7 @@
#include "SessionController.h"
#include "SessionManager.h"
#include "ViewManager.h"
#include "MainWindow.h"
extern "C"
{
......@@ -66,6 +68,10 @@ Part::Part(QObject* parent)
// create window and session for part
_viewManager = new ViewManager(this,actionCollection());
//MainWindow* window = new MainWindow();
//window->menuBar()->setVisible(false);
// _viewManager = window->viewManager();
connect( _viewManager , SIGNAL(activeViewChanged(SessionController*)) , this ,
SLOT(activeViewChanged(SessionController*)) );
createSession( QString() );
......
......@@ -87,7 +87,7 @@ Screen::Screen(int l, int c)
lineProperties.resize(lines+1);
for (int i=0;i<lines+1;i++)
lineProperties[i]=0;
lineProperties[i]=LINE_DEFAULT;
initTabStops();
clearSelection();
......@@ -432,7 +432,7 @@ void Screen::resizeImage(int new_lines, int new_columns)
lineProperties.resize(new_lines+1);
for (int i=lines;(i > 0) && (i<new_lines+1);i++)
lineProperties[i] = 0;
lineProperties[i] = LINE_DEFAULT;
clearSelection();
......@@ -627,7 +627,7 @@ QVector<LineProperty> Screen::getCookedLineProperties( int startLine )
if (hist->isWrappedLine(y+viewHistoryCursor))
{
result[y] = result[y] | LINE_WRAPPED;
result[y] = (LineProperty)(result[y] | LINE_WRAPPED);
}
}
......@@ -773,7 +773,7 @@ void Screen::ShowCharacter(unsigned short c)
if (cuX+w > columns) {
if (getMode(MODE_Wrap)) {
lineProperties[cuY] |= LINE_WRAPPED;
lineProperties[cuY] = (LineProperty)(lineProperties[cuY] | LINE_WRAPPED);
NextLine();
}
else
......@@ -1471,7 +1471,7 @@ void Screen::copyLineToStream(int line , int start, int count,
break;
//decode line and write to text stream
decoder->decodeLine( (Character*) characterBuffer , count, 0 , stream);
decoder->decodeLine( (Character*) characterBuffer , count, LINE_DEFAULT , stream);
}
// Method below has been removed because of its reliance on 'histCursor'
......@@ -1587,10 +1587,10 @@ void Screen::setLineProperty(LineProperty property , bool enable)
{
if ( enable )
{
lineProperties[cuY] |= property;
lineProperties[cuY] = (LineProperty)(lineProperties[cuY] | property);
}
else
{
lineProperties[cuY] &= ~property;
lineProperties[cuY] = (LineProperty)(lineProperties[cuY] & ~property);
}
}
......@@ -271,7 +271,7 @@ void SessionController::setupActions()
// Send to All
toggleAction = new KToggleAction(i18n("Send Input to All"),this);
action = collection->addAction("send-input-to-all",toggleAction);
connect( action , SIGNAL(triggered()) , this , SLOT(sendInputToAll()) );
connect( action , SIGNAL(toggled(bool)) , this , SIGNAL(sendInputToAll(bool)) );
// Clear and Clear+Reset
action = collection->addAction("clear");
......@@ -608,10 +608,6 @@ void SessionController::decreaseTextSize()
//TODO - Save this setting as a session default
}
void SessionController::sendInputToAll()
{
Q_ASSERT(0); // Not implemented yet
}
void SessionController::monitorActivity(bool monitor)
{
_session->setMonitorActivity(monitor);
......
......@@ -92,6 +92,12 @@ signals:
*/
void focused( SessionController* controller );
/**
* Emitted when the user enables the "Send Input to All" menu
* item associated with this session.
*/
void sendInputToAll(bool sendToAll);
public slots:
/**
* Issues a command to the session to navigate to the specified URL.
......@@ -125,7 +131,6 @@ private slots:
void decreaseTextSize();
void renameSession();
void saveSession();
void sendInputToAll();
// other
void showDisplayContextMenu(TerminalDisplay* display , int state , int x , int y);
......
......@@ -281,7 +281,13 @@ public:
UINT8 _r = DEFAULT_RENDITION)
: character(_c), rendition(_r), foregroundColor(_f), backgroundColor(_b) {}
public:
UINT16 character; // character
union
{
UINT16 character; // a single unicode character
UINT16 charSequence; // index into a table of unicode character sequences
};
UINT8 rendition; // rendition
CharacterColor foregroundColor; // foreground color
CharacterColor backgroundColor; // background color
......
......@@ -1465,11 +1465,13 @@ void TerminalDisplay::paintContents(QPainter &paint, const QRect &rect)
int len = 1;
int p = 0;
// is this a single character or a sequence of characters ?
if ( _image[loc(x,y)].rendition & RE_EXTENDED_CHAR )
{
ushort extendedCharLength;
// sequence of characters
ushort extendedCharLength = 0;
ushort* chars = ExtendedCharTable::instance
.lookupExtendedChar(_image[loc(x,y)].character,extendedCharLength);
.lookupExtendedChar(_image[loc(x,y)].charSequence,extendedCharLength);
for ( int index = 0 ; index < extendedCharLength ; index++ )
{
Q_ASSERT( p < bufferSize );
......@@ -1478,6 +1480,7 @@ void TerminalDisplay::paintContents(QPainter &paint, const QRect &rect)
}
else
{
// single character
c = _image[loc(x,y)].character;
if (c)
{
......
......@@ -184,7 +184,6 @@ void ViewManager::previousView()
container->activatePreviousView();
}
void ViewManager::detachActiveView()
{
// find the currently active view and remove it from its container
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment