30 #include <QApplication>
34 #include <QtCore/QEvent>
35 #include <QtCore/QTime>
36 #include <QtCore/QFile>
37 #include <QGridLayout>
55 #define loc(X,Y) ((Y)*_columns+(X))
58 #define yMouseScroll 1
60 #define REPCHAR "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \
61 "abcdefgjijklmnopqrstuvwxyz" \
116 QPalette p = palette();
121 _scrollBar->setPalette( QApplication::palette() );
144 static inline bool isLineChar(quint16 c) {
return ((c & 0xFF80) == 0x2500);}
155 0x0020, 0x25C6, 0x2592, 0x2409, 0x240c, 0x240d, 0x240a, 0x00b0,
156 0x00b1, 0x2424, 0x240b, 0x2518, 0x2510, 0x250c, 0x2514, 0x253c,
157 0xF800, 0xF801, 0x2500, 0xF803, 0xF804, 0x251c, 0x2524, 0x2534,
158 0x252c, 0x2502, 0x2264, 0x2265, 0x03C0, 0x2260, 0x00A3, 0x00b7
163 QFontMetrics fm(font());
176 for(
unsigned int i=1; i< strlen(
REPCHAR); i++)
178 if (fw != fm.width(
REPCHAR[i]))
201 QFontMetrics metrics(font);
203 if ( metrics.height() < height() && metrics.maxWidth() < width() )
208 font.setStyleStrategy( QFont::NoAntialias );
215 QFont::StyleStrategy strategy = font.styleStrategy();
216 #if defined (HAVE_QFONT_FORCE_INTEGER_METRICS)
217 strategy |= QFont::ForceIntegerMetrics;
219 font.setStyleStrategy(QFont::StyleStrategy(strategy));
221 QWidget::setFont(font);
254 ,_terminalSizeHint(false)
255 ,_terminalSizeStartup(true)
257 ,_wordSelectionMode(false)
258 ,_lineSelectionMode(false)
259 ,_preserveLineBreaks(false)
260 ,_columnSelectionMode(false)
261 ,_scrollbarLocation(NoScrollBar)
262 ,_wordCharacters(
":@-./_~")
263 ,_bellMode(SystemBeepBell)
265 ,_cursorBlinking(false)
266 ,_hasBlinkingCursor(false)
268 ,_tripleClickMode(SelectWholeLine)
270 ,_possibleTripleClick(false)
273 ,_outputSuspendedLabel(0)
275 ,_colorsInverted(false)
276 ,_blendColor(qRgba(0,0,0,0xff))
278 ,_cursorShape(BlockCursor)
283 setLayoutDirection(Qt::LeftToRight);
296 connect(
_scrollBar, SIGNAL(valueChanged(
int)),
this,
309 setMouseTracking(
true);
312 setAcceptDrops(
true);
315 setFocusPolicy( Qt::WheelFocus );
318 setAttribute(Qt::WA_InputMethodEnabled,
true);
322 setAttribute(Qt::WA_OpaquePaintEvent);
330 parent->parent (), SLOT (set_global_shortcuts (
bool)));
332 parent, SLOT (set_global_shortcuts (
bool)));
338 qApp->removeEventFilter(
this );
403 static void drawLineChar(QPainter& paint,
int x,
int y,
int w,
int h, uchar code)
415 paint.drawLine(cx-1, y, cx-1, cy-2);
417 paint.drawLine(cx, y, cx, cy-2);
419 paint.drawLine(cx+1, y, cx+1, cy-2);
423 paint.drawLine(cx-1, cy+2, cx-1, ey);
425 paint.drawLine(cx, cy+2, cx, ey);
427 paint.drawLine(cx+1, cy+2, cx+1, ey);
431 paint.drawLine(x, cy-1, cx-2, cy-1);
433 paint.drawLine(x, cy, cx-2, cy);
435 paint.drawLine(x, cy+1, cx-2, cy+1);
439 paint.drawLine(cx+2, cy-1, ex, cy-1);
441 paint.drawLine(cx+2, cy, ex, cy);
443 paint.drawLine(cx+2, cy+1, ex, cy+1);
447 paint.drawPoint(cx-1, cy-1);
449 paint.drawPoint(cx, cy-1);
451 paint.drawPoint(cx+1, cy-1);
454 paint.drawPoint(cx-1, cy);
456 paint.drawPoint(cx, cy);
458 paint.drawPoint(cx+1, cy);
461 paint.drawPoint(cx-1, cy+1);
463 paint.drawPoint(cx, cy+1);
465 paint.drawPoint(cx+1, cy+1);
472 const QPen& currentPen = painter.pen();
476 QPen boldPen(currentPen);
478 painter.setPen( boldPen );
481 for (
int i=0 ; i < str.length(); i++)
483 uchar code = str[i].cell();
488 painter.setPen( currentPen );
501 if (useForegroundColor)
525 QRect scrollBarArea =
_scrollBar->isVisible() ?
529 QRegion contentsRegion = QRegion(rect).subtracted(scrollBarArea);
530 QRect contentsRect = contentsRegion.boundingRect();
532 painter.fillRect(contentsRect, backgroundColor);
533 painter.fillRect(scrollBarArea,
_scrollBar->palette().background());
538 const QColor& foregroundColor,
540 bool& invertCharacterColor)
542 QRect cursorRect = rect;
550 painter.setPen(foregroundColor);
557 int penWidth = qMax(1,painter.pen().width());
559 painter.drawRect(cursorRect.adjusted(penWidth/2,
561 - penWidth/2 - penWidth%2,
562 - penWidth/2 - penWidth%2));
571 invertCharacterColor =
true;
576 painter.drawLine(cursorRect.left(),
579 cursorRect.bottom());
581 painter.drawLine(cursorRect.left(),
584 cursorRect.bottom());
593 bool invertCharacterColor)
603 QFont font = painter.font();
604 if ( font.bold() != useBold
605 || font.underline() != useUnderline )
607 font.setBold(useBold);
608 font.setUnderline(useUnderline);
609 painter.setFont(font);
615 QPen pen = painter.pen();
616 if ( pen.color() != color )
619 painter.setPen(color);
632 painter.drawText(rect,0,text);
648 if ( backgroundColor != palette().background().color() )
653 bool invertCharacterColor =
false;
656 drawCursor(painter,rect,foregroundColor,backgroundColor,invertCharacterColor);
670 void TerminalDisplay::setCursorPos(
const int curx,
const int cury)
672 QPoint tL = contentsRect().topLeft();
677 ypos = _topMargin + tLy + _fontHeight*(cury-1) + _fontAscent;
678 xpos = _leftMargin + tLx + _fontWidth*curx;
712 QRect region = screenWindowRegion;
713 region.setBottom( qMin(region.bottom(),this->
_lines-2) );
718 || (region.top() +
abs(lines)) >= region.bottom()
719 || this->
_lines <= region.height() )
return;
727 int linesToMove = region.height() -
abs(lines);
728 int bytesToMove = linesToMove *
732 Q_ASSERT( linesToMove > 0 );
733 Q_ASSERT( bytesToMove > 0 );
739 Q_ASSERT( (
char*)lastCharPos + bytesToMove <
742 Q_ASSERT( (lines*this->_columns) <
_imageSize );
745 memmove( firstCharPos , lastCharPos , bytesToMove );
756 Q_ASSERT( (
char*)firstCharPos + bytesToMove <
760 memmove( lastCharPos , firstCharPos , bytesToMove );
766 scrollRect = QRect( topPoint ,
768 linesToMove * _fontHeight ));
784 rect.setBottom(hotSpot->
endLine());
811 update( preUpdateHotSpots | postUpdateHotSpots );
836 Q_ASSERT( this->_usedLines <= this->
_lines );
837 Q_ASSERT( this->_usedColumns <= this->
_columns );
841 QPoint tL = contentsRect().topLeft();
851 const int linesToUpdate = qMin(this->_lines, qMax(0,lines ));
852 const int columnsToUpdate = qMin(this->_columns,qMax(0,columns));
854 QChar *disstrU =
new QChar[columnsToUpdate];
855 char *dirtyMask =
new char[columnsToUpdate+2];
861 int dirtyLineCount = 0;
863 for (y = 0; y < linesToUpdate; y++)
868 bool updateLine =
false;
873 memset(dirtyMask, 0, columnsToUpdate+2);
875 for( x = 0 ; x < columnsToUpdate ; x++)
877 if ( newLine[x] != currentLine[x] )
884 for (x = 0; x < columnsToUpdate; x++)
899 bool doubleWidth = (x+1 == columnsToUpdate) ?
false : (newLine[x+1].character == 0);
903 int lln = columnsToUpdate -
x;
904 for (len = 1; len < lln; len++)
911 bool nextIsDoubleWidth = (x+len+1 == columnsToUpdate) ?
false : (newLine[x+len+1].character == 0);
918 nextIsDoubleWidth != doubleWidth )
924 QString unistr(disstrU, p);
960 dirtyRegion |= dirtyRect;
965 memcpy((
void*)currentLine,(
const void*)newLine,columnsToUpdate*
sizeof(
Character));
1015 _resizeWidget->setStyleSheet(
"background-color:palette(window);border-style:solid;border-width:1px;border-color:palette(dark)");
1056 QPainter paint(
this);
1059 foreach (QRect rect, (pe->region() & contentsRect()).rects())
1080 QWidget::focusInEvent(focusEvent);
1091 QWidget::focusOutEvent(focusEvent);
1106 if ( preeditLength == 0 )
1122 bool invertColors =
false;
1128 drawCursor(painter,rect,foreground,background,invertColors);
1145 QPoint cursorPos = mapFromGlobal(QCursor::pos());
1157 QListIterator<Filter::HotSpot*> iter(spots);
1158 while (iter.hasNext())
1164 int startColumn = 0;
1170 while ( QChar(
_image[
loc(endColumn,
line)].character).isSpace() && endColumn > 0 )
1198 QFontMetrics metrics(font());
1202 int baseline = r.bottom() - metrics.descent();
1204 int underlinePos = baseline + metrics.underlinePos();
1206 if ( r.contains( mapFromGlobal(QCursor::pos()) ) )
1207 painter.drawLine( r.left() , underlinePos ,
1208 r.right() , underlinePos );
1215 painter.fillRect(r,QBrush(QColor(255,0,0,120)));
1224 QPoint topLeft = contentsRect().topLeft();
1226 int topLeftY = topLeft.y();
1240 QChar *disstrU =
new QChar[bufferSize];
1241 for (
int y = leftUpperY; y <= rightLowerY; y++)
1247 for (; x <= rightLowerX; x++)
1256 ushort extendedCharLength = 0;
1259 for (
int index = 0 ; index < extendedCharLength ; index++ )
1261 Q_ASSERT( p < bufferSize );
1262 disstrU[p++] = chars[index];
1271 Q_ASSERT( p < bufferSize );
1282 while (x+len <= rightLowerX &&
1283 _image[
loc(x+len,y)].foregroundColor == currentForeground &&
1284 _image[
loc(x+len,y)].backgroundColor == currentBackground &&
1285 _image[
loc(x+len,y)].rendition == currentRendition &&
1303 QString unistr(disstrU,p);
1328 QMatrix inverted = paint.matrix().inverted();
1329 textArea.moveCenter( inverted.map(textArea.center()) );
1342 paint.resetMatrix();
1376 result.setWidth(
_fontWidth * imageArea.width() );
1377 result.setHeight(
_fontHeight * imageArea.height() );
1411 parentWidget()->adjustSize();
1412 parentWidget()->setFixedSize(parentWidget()->
sizeHint());
1439 (
void*)&oldimg[oldcol*line],columns*
sizeof(
Character));
1454 #if defined (SIGWINCH)
1550 if ( !contentsRect().contains(ev->pos()) )
return;
1557 QPoint pos = QPoint(charColumn,charLine);
1559 if ( ev->button() == Qt::LeftButton)
1566 bool selected =
false;
1574 if ((!
_ctrlDrag || ev->modifiers() & Qt::ControlModifier) && selected ) {
1583 _preserveLineBreaks = !( ( ev->modifiers() & Qt::ControlModifier ) && !(ev->modifiers() & Qt::AltModifier) );
1584 _columnSelectionMode = (ev->modifiers() & Qt::AltModifier) && (ev->modifiers() & Qt::ControlModifier);
1586 if (
_mouseMarks || (ev->modifiers() & Qt::ShiftModifier))
1602 else if ( ev->button() == Qt::MidButton )
1609 else if ( ev->button() == Qt::RightButton )
1611 if (
_mouseMarks || (ev->modifiers() & Qt::ShiftModifier))
1614 ev->modifiers() & (Qt::ShiftModifier|Qt::ControlModifier),
1622 QWidget::mousePressEvent (ev);
1627 int charLine, charColumn;
1650 qMax(spot->startColumn() , spot->endColumn()) *
_fontHeight,
1655 const QString& tooltip = spot->tooltip();
1656 if ( !tooltip.isEmpty() )
1671 if (ev->buttons() == Qt::NoButton )
return;
1676 if (!
_mouseMarks && !(ev->modifiers() & Qt::ShiftModifier))
1679 if (ev->buttons() & Qt::LeftButton)
1681 if (ev->buttons() & Qt::MidButton)
1683 if (ev->buttons() & Qt::RightButton)
1722 if (ev->buttons() & Qt::MidButton)
return;
1728 void TerminalDisplay::setSelectionEnd()
1730 extendSelection( _configureRequestPoint );
1735 QPoint pos = position;
1741 QPoint tL = contentsRect().topLeft();
1775 QPoint here = QPoint(charColumn, charLine);
1781 bool swapping =
false;
1788 bool left_not_right = (here.y() < _iPntSelCorr.y() ||
1789 (here.y() == _iPntSelCorr.y() && here.x() < _iPntSelCorr.x()));
1790 bool old_left_not_right = (_pntSelCorr.y() < _iPntSelCorr.y() ||
1791 (_pntSelCorr.y() == _iPntSelCorr.y() && _pntSelCorr.x() < _iPntSelCorr.x()));
1792 swapping = left_not_right != old_left_not_right;
1795 QPoint
left = left_not_right ? here : _iPntSelCorr;
1796 i =
loc(left.x(), left.y());
1812 QPoint right = left_not_right ? _iPntSelCorr : here;
1813 i =
loc(right.x(), right.y());
1829 if (left_not_right) {
1841 bool above_not_below = (here.y() < _iPntSelCorr.y());
1843 QPoint above = above_not_below ? here : _iPntSelCorr;
1844 QPoint below = above_not_below ? _iPntSelCorr : here;
1857 if (above_not_below) {
1865 QPoint newSelBegin = QPoint(ohere.x(), ohere.y());
1877 bool left_not_right = (here.y() < _iPntSelCorr.y() ||
1878 (here.y() == _iPntSelCorr.y() && here.x() < _iPntSelCorr.x()));
1879 bool old_left_not_right = (_pntSelCorr.y() < _iPntSelCorr.y() ||
1880 (_pntSelCorr.y() == _iPntSelCorr.y() && _pntSelCorr.x() < _iPntSelCorr.x()));
1881 swapping = left_not_right != old_left_not_right;
1884 QPoint
left = left_not_right ? here : _iPntSelCorr;
1887 QPoint right = left_not_right ? _iPntSelCorr : here;
1889 i =
loc(right.x(), right.y());
1892 if (selClass ==
' ') {
1899 right = left_not_right ? _iPntSelCorr : here;
1908 if (left_not_right) {
1919 if ((here == _pntSelCorr) && (scroll ==
_scrollBar->value())) {
1923 if (here == ohere) {
1927 if (
_actSel < 2 || swapping) {
1929 _screenWindow->setSelectionStart(ohere.x(), ohere.y(),
true);
1931 _screenWindow->setSelectionStart(ohere.x() - 1 - offset , ohere.y(),
false);
1943 _screenWindow->setSelectionEnd(here.x() + offset, here.y());
1956 if ( ev->button() == Qt::LeftButton)
1978 if (!
_mouseMarks && !(ev->modifiers() & Qt::ShiftModifier))
1988 ((ev->button() == Qt::RightButton && !(ev->modifiers() & Qt::ShiftModifier))
1989 || ev->button() == Qt::MidButton) )
1997 QWidget::mouseReleaseEvent(ev);
2033 if ( ev->button() != Qt::LeftButton)
return;
2041 QPoint pos(charColumn,charLine);
2044 if (!
_mouseMarks && !(ev->modifiers() & Qt::ShiftModifier))
2056 QPoint bgnSel = pos;
2057 QPoint endSel = pos;
2058 int i =
loc(bgnSel.x(),bgnSel.y());
2083 _screenWindow->setSelectionStart( bgnSel.x() , bgnSel.y() , false );
2086 i =
loc( endSel.x(), endSel.y() );
2104 if ( ( QChar(
_image[i].character ) ==
'@' ) && ( ( endSel.x() - bgnSel.x() ) > 0 ) )
2105 endSel.setX( x - 1 );
2117 QTimer::singleShot(QApplication::doubleClickInterval(),
this,
2123 if (ev->orientation() != Qt::Vertical)
2153 _iPntSel = QPoint(charColumn,charLine);
2168 int i =
loc(_iPntSel.x(),_iPntSel.y());
2170 int x = _iPntSel.x();
2187 _screenWindow->setSelectionStart( x , _iPntSel.y() , false );
2191 _screenWindow->setSelectionStart( 0 , _iPntSel.y() , false );
2213 return QWidget::focusNextPrevChild( next );
2219 QChar qch=QChar(ch);
2220 if ( qch.isSpace() )
return ' ';
2222 if ( qch.isLetterOrNumber() ||
_wordCharacters.contains(qch, Qt::CaseInsensitive ) )
2237 setCursor(
_mouseMarks ? Qt::IBeamCursor : Qt::ArrowCursor );
2258 QString
text = QApplication::clipboard()->
text(useXselection ? QClipboard::Selection :
2259 QClipboard::Clipboard);
2262 if ( ! text.isEmpty() )
2264 text.replace(
"\n",
"\r");
2265 QKeyEvent e(QEvent::KeyPress, 0, Qt::NoModifier, text);
2274 QApplication::clipboard()->setText(t, QClipboard::Selection);
2284 if (text.isEmpty ())
2286 if (! extra_interrupt)
2290 QApplication::clipboard()->setText(text);
2331 bool emitKeyPressSignal =
true;
2334 if ( event->modifiers() == Qt::ShiftModifier )
2338 if ( event->key() == Qt::Key_PageUp )
2343 else if ( event->key() == Qt::Key_PageDown )
2348 else if ( event->key() == Qt::Key_Up )
2353 else if ( event->key() == Qt::Key_Down )
2371 emitKeyPressSignal =
false;
2402 QKeyEvent keyEvent(QEvent::KeyPress,0,Qt::NoModifier,event->commitString());
2415 case Qt::ImMicroFocus:
2416 return imageToWidget(QRect(cursorPos.x(),cursorPos.y(),1,1));
2421 case Qt::ImCursorPosition:
2423 return cursorPos.x();
2425 case Qt::ImSurroundingText:
2429 QTextStream stream(&lineText);
2431 decoder.
begin(&stream);
2437 case Qt::ImCurrentSelection:
2482 _scrollBar->resize(QApplication::style()->pixelMetric(QStyle::PM_ScrollBarExtent),
2483 contentsRect().height());
2544 QSize newSize = QSize( columns *
_fontWidth ,
2547 if ( newSize !=
size() )
2570 QWidget::setFixedSize(
_size);
2587 if (event->mimeData()->hasFormat(
"text/plain"))
2588 event->acceptProposedAction();
2597 if (event->mimeData ()->hasUrls ())
2599 foreach (QUrl url, event->mimeData ()->urls ())
2601 if(dropText.length () > 0)
2603 dropText += url.toLocalFile ();
2634 if(event->mimeData()->hasFormat(
"text/plain"))
2644 QMimeData *mimeData =
new QMimeData;
2645 mimeData->setText(QApplication::clipboard()->
text(QClipboard::Selection));
2662 "<a href=\"http://en.wikipedia.org/wiki/XON\">suspended</a>"
2663 " by pressing Ctrl+S."
2664 " Press <b>Ctrl+Q</b> to resume.</qt>"),
2669 palette.setColor(QPalette::Normal, QPalette::WindowText, QColor(Qt::white));
2670 palette.setColor(QPalette::Normal, QPalette::Window, QColor(Qt::black));
2681 Qt::LinksAccessibleByKeyboard);
2686 _gridLayout->addItem(
new QSpacerItem(0,0,QSizePolicy::Expanding,
2687 QSizePolicy::Expanding),
bool _columnSelectionMode
An entry in a terminal display's color palette.
virtual QList< QAction * > actions()
Returns a list of actions associated with the hotspot which can be used in a menu or toolbar...
int startColumn() const
Returns the column on startLine() where the hotspot area starts.
virtual void wheelEvent(QWheelEvent *)
int endLine() const
Returns the line where the hotspot area ends.
virtual void mouseMoveEvent(QMouseEvent *)
void setFixedSize(int cols, int lins)
KeyboardCursorShape _cursorShape
Provides a window onto a section of a terminal screen.
QRegion hotSpotRegion() const
void setScreenWindow(ScreenWindow *window)
Sets the terminal screen section which is displayed in this widget.
static bool isLineCharString(const QString &string)
virtual void mousePressEvent(QMouseEvent *)
void setScrollBarPosition(ScrollBarPosition position)
Specifies whether the terminal display has a vertical scroll bar, and if so whether it is shown on th...
void setLineSpacing(uint)
bool usesMouse() const
See setUsesMouse()
static const int LINE_DOUBLEWIDTH
ScrollBarPosition
This enum describes the location where the scroll bar is positioned in the display widget...
void setKeyboardCursorShape(KeyboardCursorShape shape)
Sets the shape of the keyboard cursor.
static const ColorEntry base_color_table[(2 *(2+8))]
static bool isLineChar(quint16 c)
void setWindowLines(int lines)
Sets the number of lines in the window.
ColorEntry _colorTable[TABLE_COLORS]
#define DEFAULT_FORE_COLOR
#define DEFAULT_RENDITION
A single character in the terminal which consists of a unicode character value, foreground and backgr...
A filter chain which processes character images from terminal displays.
void showResizeNotification()
int columns()
Returns the number of characters of text which can be displayed on each line in the widget...
void pasteSelection()
Pastes the content of the selection into the display.
void setColorTable(const ColorEntry table[])
Sets the terminal color palette used by the display.
void processFilters()
Updates the filters in the display's filter chain.
virtual void inputMethodEvent(QInputMethodEvent *event)
void keyPressedSignal(QKeyEvent *e)
Emitted when the user presses a key whilst the terminal widget has focus.
Show the scroll bar on the left side of the display.
void mouseSignal(int button, int column, int line, int eventType)
A mouse event occurred.
#define COLOR_SPACE_DEFAULT
Describes the color of a single character in the terminal.
QRect _mouseOverHotspotArea
Represents an area of text which matched the pattern a particular filter has been looking for...
virtual void extendSelection(const QPoint &pos)
Filter::HotSpot * hotSpotAt(int line, int column) const
Returns the first hotspot which occurs at line, column or 0 if no hotspot was found.
Do not show the scroll bar.
Select the whole line underneath the cursor.
static const quint32 LineChars[]
bool isBold(const ColorEntry *base) const
Returns true if this character should always be drawn in bold when it is drawn with the specified pal...
virtual void showEvent(QShowEvent *)
QVector< LineProperty > _lineProperties
static const int DEFAULT_LEFT_MARGIN
quint8 rendition
A combination of RENDITION flags which specify options for drawing the character. ...
QRect preeditRect() const
static bool _antialiasText
int lines()
Returns the number of lines of text which can be displayed in the widget.
void setSize(int cols, int lins)
QColor color
The color value of this entry for display.
ScreenWindow * screenWindow() const
Returns the terminal screen section which is displayed in this widget.
int startLine() const
Returns the line when the hotspot area starts.
void process()
Processes each filter in the chain.
void tripleClickTimeout()
virtual void resizeEvent(QResizeEvent *)
QList< QAction * > filterActions(const QPoint &position)
Returns a list of menu actions created by the filters for the content at the given position...
void changedContentSizeSignal(int height, int width)
QList< Filter::HotSpot * > hotSpots() const
Returns a list of all the hotspots in all the chain's filters.
Show the scroll bar on the right side of the display.
virtual void dropEvent(QDropEvent *event)
An cursor shaped like the capital letter 'I', similar to the IBeam cursor used in Qt/KDE text editors...
bool _terminalSizeStartup
A rectangular block which covers the entire area of the cursor character.
unsigned short vt100_graphics[32]
static const int LINE_WRAPPED
QLabel * _outputSuspendedLabel
QTimer * _blinkCursorTimer
A terminal character decoder which produces plain text, ignoring colours and other appearance-related...
void paintFilters(QPainter &painter)
void focusOutEvent(QFocusEvent *focusEvent)
void selectAll()
selects all content
int string_width(const QString &txt)
F77_RET_T const double const double * f
void changedFontMetricSignal(int height, int width)
void focusInEvent(QFocusEvent *focusEvent)
virtual void dragEnterEvent(QDragEnterEvent *event)
QPoint cursorPosition() const
text(const graphics_handle &mh, const graphics_handle &p)
static void drawLineChar(QPainter &paint, int x, int y, int w, int h, uchar code)
LineEncode
A table for emulating the simple (single width) unicode drawing chars.
QRect imageToWidget(const QRect &imageArea) const
std::complex< double > w(std::complex< double > z, double relerr=0)
void interrupt_signal(void)
void outputSuspended(bool suspended)
Causes the widget to display or hide a message informing the user that terminal output has been suspe...
ScrollBarPosition _scrollbarLocation
void drawBackground(QPainter &painter, const QRect &rect, const QColor &color)
virtual int charClass(quint16) const
bool _possibleTripleClick
void emitSelection(bool useXselection, bool appendReturn)
CharacterColor backgroundColor
The color used to draw this character's background.
FilterChain * filterChain() const
Returns the display's filter chain.
A chain which allows a group of filters to be processed as one.
InputMethodData _inputMethodData
TerminalImageFilterChain * _filterChain
virtual void hideEvent(QHideEvent *)
void set_global_shortcuts_signal(bool)
Emitted when focus changes.
void scrollImage(int lines, const QRect ®ion)
void setRandomSeed(uint seed)
Sets the seed used to generate random colors for the display (in color schemes that support them)...
void setBellMode(int mode)
Sets the type of effect used to alert the user when a 'bell' occurs in the terminal session...
void drawInputMethodPreeditString(QPainter &painter, const QRect &rect)
size_t size(T const (&)[z])
void pasteClipboard()
Pastes the content of the clipboard into the display.
ushort * lookupExtendedChar(ushort hash, ushort &length) const
Looks up and returns a pointer to a sequence of unicode characters which was added to the table using...
virtual void decodeLine(const Character *const characters, int count, LineProperty properties)
Converts a line of terminal characters with associated properties into a text string and writes the s...
void drawContents(QPainter &paint, const QRect &rect)
void setBlinkingCursor(bool blink)
Specifies whether or not the cursor blinks.
CharacterColor foregroundColor
The foreground color used to draw this character.
QColor color(const ColorEntry *palette) const
Returns the color within the specified color .
void setKeyboardCursorColor(bool useForegroundColor, const QColor &color)
Sets the color used to draw the keyboard cursor.
void updateLineProperties()
Causes the terminal display to fetch the latest line status flags from the associated terminal screen...
void tripleClicked(const QString &text)
void drawTextFragment(QPainter &painter, const QRect &rect, const QString &text, const Character *style)
KeyboardCursorShape keyboardCursorShape() const
Returns the shape of the keyboard cursor.
struct TerminalView::_dragInfo dragInfo
virtual void fontChange(const QFont &font)
TripleClickMode _tripleClickMode
TerminalView(QWidget *parent=0)
Constructs a new terminal display widget with the specified parent.
void copyClipboard(bool extra_interrupt)
Copies the selected text to the clipboard.
Select from the current cursor position to the end of the line.
uint randomSeed() const
Returns the seed used to generate random colors for the display (in color schemes that support them)...
void drawCursor(QPainter &painter, const QRect &rect, const QColor &foregroundColor, const QColor &backgroundColor, bool &invertColors)
void setSelection(const QString &t)
void setImage(const Character *const image, int lines, int columns, const QVector< LineProperty > &lineProperties)
Set the current terminal image to image.
virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const
void setScroll(int cursor, int lines)
Sets the current position and range of the display's scroll bar.
static ExtendedCharTable instance
The global ExtendedCharTable instance.
virtual void setFont(const QFont &)
Reimplemented.
quint16 character
The unicode character value for this character.
void setUsesMouse(bool usesMouse)
Sets whether the program whoose output is being displayed in the view is interested in mouse events...
void isBusySelecting(bool)
void getCharacterPosition(const QPoint &widgetPoint, int &line, int &column) const
virtual void paintEvent(QPaintEvent *)
void setBlinkingCursorState(bool blink)
A single flat line which occupies the space at the bottom of the cursor character's area...
int endColumn() const
Returns the column on endLine() where the hotspot area ends.
void drawLineCharString(QPainter &painter, int x, int y, const QString &str, const Character *attributes)
void mouseTripleClickEvent(QMouseEvent *ev)
QPointer< ScreenWindow > _screenWindow
virtual void end()
End decoding.
void drawCharacters(QPainter &painter, const QRect &rect, const QString &text, const Character *style, bool invertCharacterColor)
void sendStringToEmu(const char *)
virtual void keyPressEvent(QKeyEvent *event)
Type type() const
Returns the type of the hotspot.
static const int BLINK_DELAY
static const int DEFAULT_TOP_MARGIN
void scrollBarPositionChanged(int value)
virtual void mouseReleaseEvent(QMouseEvent *)
KeyboardCursorShape
This enum describes the available shapes for the keyboard cursor.
static const int LINE_DOUBLEHEIGHT
const ColorEntry * colorTable() const
Returns the terminal color palette used by the display.
void configureRequest(TerminalView *, int state, const QPoint &position)
Emitted when the user right clicks on the display, or right-clicks with the Shift key held down if us...
void setWordCharacters(const QString &wc)
Sets which characters, in addition to letters and numbers, are regarded as being part of a word for t...
virtual bool focusNextPrevChild(bool next)
void setVTFont(const QFont &font)
Sets the font used to draw the display.
virtual void begin(QTextStream *output)
Begin decoding characters.
QGridLayout * _gridLayout
QColor keyboardCursorColor() const
Returns the color of the keyboard cursor, or an invalid color if the keyboard cursor color is set to ...
F77_RET_T const double * x
virtual void mouseDoubleClickEvent(QMouseEvent *ev)
void updateImage()
Causes the terminal display to fetch the latest character image from the associated terminal screen (...
#define DEFAULT_BACK_COLOR