30 #include <QApplication>
34 #include <QtCore/QEvent>
35 #include <QtCore/QTime>
36 #include <QtCore/QFile>
37 #include <QGridLayout>
56 #define loc(X,Y) ((Y)*_columns+(X))
59 #define yMouseScroll 1
61 #define REPCHAR "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \
62 "abcdefgjijklmnopqrstuvwxyz" \
117 QPalette
p = palette();
122 _scrollBar->setPalette( QApplication::palette() );
145 static inline bool isLineChar(quint16
c) {
return ((c & 0xFF80) == 0x2500);}
156 0x0020, 0x25C6, 0x2592, 0x2409, 0x240c, 0x240d, 0x240a, 0x00b0,
157 0x00b1, 0x2424, 0x240b, 0x2518, 0x2510, 0x250c, 0x2514, 0x253c,
158 0xF800, 0xF801, 0x2500, 0xF803, 0xF804, 0x251c, 0x2524, 0x2534,
159 0x252c, 0x2502, 0x2264, 0x2265, 0x03C0, 0x2260, 0x00A3, 0x00b7
164 QFontMetrics fm(font());
202 QFontMetrics metrics(font);
204 if ( metrics.height() < height() && metrics.maxWidth() < width() )
209 font.setStyleStrategy( QFont::NoAntialias );
216 QFont::StyleStrategy strategy = font.styleStrategy();
217 #if defined (HAVE_QFONT_FORCE_INTEGER_METRICS)
218 strategy |= QFont::ForceIntegerMetrics;
220 font.setStyleStrategy(QFont::StyleStrategy(strategy));
222 QWidget::setFont(font);
255 ,_terminalSizeHint(
false)
256 ,_terminalSizeStartup(true)
258 ,_wordSelectionMode(
false)
259 ,_lineSelectionMode(
false)
260 ,_preserveLineBreaks(
false)
261 ,_columnSelectionMode(
false)
262 ,_scrollbarLocation(NoScrollBar)
263 ,_wordCharacters(
":@-./_~")
264 ,_bellMode(SystemBeepBell)
266 ,_cursorBlinking(
false)
267 ,_hasBlinkingCursor(
false)
269 ,_tripleClickMode(SelectWholeLine)
271 ,_possibleTripleClick(
false)
274 ,_outputSuspendedLabel(0)
276 ,_colorsInverted(
false)
277 ,_blendColor(qRgba(0,0,0,0xff))
279 ,_cursorShape(BlockCursor)
284 setLayoutDirection(Qt::LeftToRight);
297 connect(
_scrollBar, SIGNAL(valueChanged(
int)),
this,
310 setMouseTracking(
true);
313 setAcceptDrops(
true);
316 setFocusPolicy( Qt::WheelFocus );
319 setAttribute(Qt::WA_InputMethodEnabled,
true);
323 setAttribute(Qt::WA_OpaquePaintEvent);
331 parent->parent (), SLOT (set_global_shortcuts (
bool)));
333 parent, SLOT (set_global_shortcuts (
bool)));
339 qApp->removeEventFilter(
this );
416 paint.drawLine(cx-1, y, cx-1, cy-2);
418 paint.drawLine(cx, y, cx, cy-2);
420 paint.drawLine(cx+1, y, cx+1, cy-2);
424 paint.drawLine(cx-1, cy+2, cx-1, ey);
426 paint.drawLine(cx, cy+2, cx, ey);
428 paint.drawLine(cx+1, cy+2, cx+1, ey);
432 paint.drawLine(x, cy-1, cx-2, cy-1);
434 paint.drawLine(x, cy, cx-2, cy);
436 paint.drawLine(x, cy+1, cx-2, cy+1);
440 paint.drawLine(cx+2, cy-1, ex, cy-1);
442 paint.drawLine(cx+2, cy, ex, cy);
444 paint.drawLine(cx+2, cy+1, ex, cy+1);
448 paint.drawPoint(cx-1, cy-1);
450 paint.drawPoint(cx, cy-1);
452 paint.drawPoint(cx+1, cy-1);
455 paint.drawPoint(cx-1, cy);
457 paint.drawPoint(cx, cy);
459 paint.drawPoint(cx+1, cy);
462 paint.drawPoint(cx-1, cy+1);
464 paint.drawPoint(cx, cy+1);
466 paint.drawPoint(cx+1, cy+1);
473 const QPen& currentPen = painter.pen();
477 QPen boldPen(currentPen);
479 painter.setPen( boldPen );
482 for (
int i=0 ;
i < str.length();
i++)
484 uchar
code = str[
i].cell();
489 painter.setPen( currentPen );
502 if (useForegroundColor)
526 QRect scrollBarArea =
_scrollBar->isVisible() ?
530 QRegion contentsRegion = QRegion(rect).subtracted(scrollBarArea);
531 QRect contentsRect = contentsRegion.boundingRect();
533 painter.fillRect(contentsRect, backgroundColor);
534 painter.fillRect(scrollBarArea,
_scrollBar->palette().background());
539 const QColor& foregroundColor,
541 bool& invertCharacterColor)
543 QRect cursorRect = rect;
551 painter.setPen(foregroundColor);
558 int penWidth = qMax(1,painter.pen().width());
560 painter.drawRect(cursorRect.adjusted(penWidth/2,
562 - penWidth/2 - penWidth%2,
563 - penWidth/2 - penWidth%2));
572 invertCharacterColor =
true;
577 painter.drawLine(cursorRect.left(),
580 cursorRect.bottom());
582 painter.drawLine(cursorRect.left(),
585 cursorRect.bottom());
594 bool invertCharacterColor)
604 QFont font = painter.font();
605 if ( font.bold() != useBold
606 || font.underline() != useUnderline )
608 font.setBold(useBold);
609 font.setUnderline(useUnderline);
610 painter.setFont(font);
616 QPen pen = painter.pen();
617 if ( pen.color() != color )
620 painter.setPen(color);
633 painter.drawText(rect,0,text);
649 if ( backgroundColor != palette().background().color() )
654 bool invertCharacterColor =
false;
657 drawCursor(painter,rect,foregroundColor,backgroundColor,invertCharacterColor);
671 void TerminalDisplay::setCursorPos(
const int curx,
const int cury)
673 QPoint tL = contentsRect().topLeft();
678 ypos = _topMargin + tLy + _fontHeight*(cury-1) + _fontAscent;
679 xpos = _leftMargin + tLx + _fontWidth*curx;
713 QRect region = screenWindowRegion;
714 region.setBottom( qMin(region.bottom(),this->
_lines-2) );
719 || (region.top() +
abs(lines)) >= region.bottom()
720 || this->
_lines <= region.height() )
return;
728 int linesToMove = region.height() -
abs(lines);
729 int bytesToMove = linesToMove *
733 Q_ASSERT( linesToMove > 0 );
734 Q_ASSERT( bytesToMove > 0 );
740 Q_ASSERT( (
char*)lastCharPos + bytesToMove <
743 Q_ASSERT( (lines*this->_columns) <
_imageSize );
746 memmove( firstCharPos , lastCharPos , bytesToMove );
757 Q_ASSERT( (
char*)firstCharPos + bytesToMove <
761 memmove( lastCharPos , firstCharPos , bytesToMove );
767 scrollRect = QRect( topPoint ,
769 linesToMove * _fontHeight ));
785 rect.setBottom(hotSpot->
endLine());
812 update( preUpdateHotSpots | postUpdateHotSpots );
837 Q_ASSERT( this->_usedLines <= this->
_lines );
838 Q_ASSERT( this->_usedColumns <= this->
_columns );
842 QPoint tL = contentsRect().topLeft();
852 const int linesToUpdate = qMin(this->_lines, qMax(0,lines ));
853 const int columnsToUpdate = qMin(this->_columns,qMax(0,columns));
855 QChar *disstrU =
new QChar[columnsToUpdate];
856 char *dirtyMask =
new char[columnsToUpdate+2];
862 int dirtyLineCount = 0;
864 for (y = 0; y < linesToUpdate; y++)
869 bool updateLine =
false;
874 memset(dirtyMask, 0, columnsToUpdate+2);
876 for( x = 0 ; x < columnsToUpdate ; x++)
878 if ( newLine[x] != currentLine[x] )
885 for (x = 0; x < columnsToUpdate; x++)
900 bool doubleWidth = (x+1 == columnsToUpdate) ?
false : (newLine[x+1].
character == 0);
904 int lln = columnsToUpdate -
x;
905 for (len = 1; len < lln; len++)
912 bool nextIsDoubleWidth = (x+len+1 == columnsToUpdate) ?
false : (newLine[x+len+1].
character == 0);
919 nextIsDoubleWidth != doubleWidth )
925 QString unistr(disstrU, p);
961 dirtyRegion |= dirtyRect;
966 memcpy((
void*)currentLine,(
const void*)newLine,columnsToUpdate*
sizeof(
Character));
1016 _resizeWidget->setStyleSheet(
"background-color:palette(window);border-style:solid;border-width:1px;border-color:palette(dark)");
1057 QPainter paint(
this);
1060 foreach (QRect rect, (pe->region() & contentsRect()).rects())
1081 QWidget::focusInEvent(focusEvent);
1092 QWidget::focusOutEvent(focusEvent);
1107 if ( preeditLength == 0 )
1123 bool invertColors =
false;
1129 drawCursor(painter,rect,foreground,background,invertColors);
1146 QPoint cursorPos = mapFromGlobal(QCursor::pos());
1158 QListIterator<Filter::HotSpot*> iter(spots);
1159 while (iter.hasNext())
1165 int startColumn = 0;
1199 QFontMetrics metrics(font());
1203 int baseline = r.bottom() - metrics.descent();
1205 int underlinePos = baseline + metrics.underlinePos();
1207 if ( r.contains( mapFromGlobal(QCursor::pos()) ) )
1208 painter.drawLine( r.left() , underlinePos ,
1209 r.right() , underlinePos );
1216 painter.fillRect(r,QBrush(QColor(255,0,0,120)));
1225 QPoint topLeft = contentsRect().topLeft();
1227 int topLeftY = topLeft.y();
1241 QChar *disstrU =
new QChar[bufferSize];
1242 for (
int y = leftUpperY;
y <= rightLowerY;
y++)
1248 for (; x <= rightLowerX; x++)
1257 ushort extendedCharLength = 0;
1260 for (
int index = 0 ; index < extendedCharLength ; index++ )
1262 Q_ASSERT( p < bufferSize );
1263 disstrU[p++] = chars[index];
1272 Q_ASSERT( p < bufferSize );
1283 while (x+len <= rightLowerX &&
1284 _image[
loc(x+len,
y)].foregroundColor == currentForeground &&
1285 _image[
loc(x+len,
y)].backgroundColor == currentBackground &&
1286 _image[
loc(x+len,
y)].rendition == currentRendition &&
1304 QString unistr(disstrU,p);
1329 QMatrix inverted = paint.matrix().inverted();
1330 textArea.moveCenter( inverted.map(textArea.center()) );
1343 paint.resetMatrix();
1377 result.setWidth(
_fontWidth * imageArea.width() );
1378 result.setHeight(
_fontHeight * imageArea.height() );
1412 parentWidget()->adjustSize();
1413 parentWidget()->setFixedSize(parentWidget()->
sizeHint());
1440 (
void*)&oldimg[oldcol*line],columns*
sizeof(
Character));
1455 #if defined (SIGWINCH)
1551 if ( !contentsRect().contains(ev->pos()) )
return;
1558 QPoint pos = QPoint(charColumn,charLine);
1560 if ( ev->button() == Qt::LeftButton)
1567 bool selected =
false;
1575 if ((!
_ctrlDrag || ev->modifiers() & Qt::ControlModifier) && selected ) {
1584 _preserveLineBreaks = !( ( ev->modifiers() & Qt::ControlModifier ) && !(ev->modifiers() & Qt::AltModifier) );
1585 _columnSelectionMode = (ev->modifiers() & Qt::AltModifier) && (ev->modifiers() & Qt::ControlModifier);
1587 if (
_mouseMarks || (ev->modifiers() & Qt::ShiftModifier))
1603 else if ( ev->button() == Qt::MidButton )
1610 else if ( ev->button() == Qt::RightButton )
1612 if (
_mouseMarks || (ev->modifiers() & Qt::ShiftModifier))
1615 ev->modifiers() & (Qt::ShiftModifier|Qt::ControlModifier),
1623 QWidget::mousePressEvent (ev);
1628 int charLine, charColumn;
1651 qMax(spot->startColumn() , spot->endColumn()) *
_fontHeight,
1656 const QString& tooltip = spot->tooltip();
1657 if ( !tooltip.isEmpty() )
1672 if (ev->buttons() == Qt::NoButton )
return;
1677 if (!
_mouseMarks && !(ev->modifiers() & Qt::ShiftModifier))
1680 if (ev->buttons() & Qt::LeftButton)
1682 if (ev->buttons() & Qt::MidButton)
1684 if (ev->buttons() & Qt::RightButton)
1723 if (ev->buttons() & Qt::MidButton)
return;
1729 void TerminalDisplay::setSelectionEnd()
1731 extendSelection( _configureRequestPoint );
1736 QPoint pos = position;
1742 QPoint tL = contentsRect().topLeft();
1776 QPoint here = QPoint(charColumn, charLine);
1782 bool swapping =
false;
1789 bool left_not_right = (here.y() < _iPntSelCorr.y() ||
1790 (here.y() == _iPntSelCorr.y() && here.x() < _iPntSelCorr.x()));
1791 bool old_left_not_right = (_pntSelCorr.y() < _iPntSelCorr.y() ||
1792 (_pntSelCorr.y() == _iPntSelCorr.y() && _pntSelCorr.x() < _iPntSelCorr.x()));
1793 swapping = left_not_right != old_left_not_right;
1796 QPoint
left = left_not_right ? here : _iPntSelCorr;
1797 i =
loc(left.x(), left.y());
1813 QPoint
right = left_not_right ? _iPntSelCorr : here;
1814 i =
loc(right.x(), right.y());
1830 if (left_not_right) {
1842 bool above_not_below = (here.y() < _iPntSelCorr.y());
1844 QPoint
above = above_not_below ? here : _iPntSelCorr;
1845 QPoint below = above_not_below ? _iPntSelCorr : here;
1858 if (above_not_below) {
1866 QPoint newSelBegin = QPoint(ohere.x(), ohere.y());
1878 bool left_not_right = (here.y() < _iPntSelCorr.y() ||
1879 (here.y() == _iPntSelCorr.y() && here.x() < _iPntSelCorr.x()));
1880 bool old_left_not_right = (_pntSelCorr.y() < _iPntSelCorr.y() ||
1881 (_pntSelCorr.y() == _iPntSelCorr.y() && _pntSelCorr.x() < _iPntSelCorr.x()));
1882 swapping = left_not_right != old_left_not_right;
1885 QPoint
left = left_not_right ? here : _iPntSelCorr;
1888 QPoint
right = left_not_right ? _iPntSelCorr : here;
1890 i =
loc(right.x(), right.y());
1893 if (selClass ==
' ') {
1900 right = left_not_right ? _iPntSelCorr : here;
1909 if (left_not_right) {
1920 if ((here == _pntSelCorr) && (scroll ==
_scrollBar->value())) {
1924 if (here == ohere) {
1928 if (
_actSel < 2 || swapping) {
1930 _screenWindow->setSelectionStart(ohere.x(), ohere.y(),
true);
1932 _screenWindow->setSelectionStart(ohere.x() - 1 - offset , ohere.y(),
false);
1944 _screenWindow->setSelectionEnd(here.x() + offset, here.y());
1957 if ( ev->button() == Qt::LeftButton)
1979 if (!
_mouseMarks && !(ev->modifiers() & Qt::ShiftModifier))
1989 ((ev->button() == Qt::RightButton && !(ev->modifiers() & Qt::ShiftModifier))
1990 || ev->button() == Qt::MidButton) )
1998 QWidget::mouseReleaseEvent(ev);
2034 if ( ev->button() != Qt::LeftButton)
return;
2042 QPoint pos(charColumn,charLine);
2045 if (!
_mouseMarks && !(ev->modifiers() & Qt::ShiftModifier))
2057 QPoint bgnSel = pos;
2058 QPoint endSel = pos;
2059 int i =
loc(bgnSel.x(),bgnSel.y());
2087 i =
loc( endSel.x(), endSel.y() );
2105 if ( ( QChar(
_image[i].character ) ==
'@' ) && ( ( endSel.x() - bgnSel.x() ) > 0 ) )
2106 endSel.setX( x - 1 );
2118 QTimer::singleShot(QApplication::doubleClickInterval(),
this,
2124 if (ev->orientation() != Qt::Vertical)
2154 _iPntSel = QPoint(charColumn,charLine);
2169 int i =
loc(_iPntSel.x(),_iPntSel.y());
2171 int x = _iPntSel.x();
2214 return QWidget::focusNextPrevChild( next );
2220 QChar qch=QChar(ch);
2221 if ( qch.isSpace() )
return ' ';
2223 if ( qch.isLetterOrNumber() ||
_wordCharacters.contains(qch, Qt::CaseInsensitive ) )
2238 setCursor(
_mouseMarks ? Qt::IBeamCursor : Qt::ArrowCursor );
2259 QString
text = QApplication::clipboard()->
text(useXselection ? QClipboard::Selection :
2260 QClipboard::Clipboard);
2263 if ( ! text.isEmpty() )
2265 text.replace(
"\n",
"\r");
2266 QKeyEvent
e(QEvent::KeyPress, 0, Qt::NoModifier, text);
2275 QApplication::clipboard()->setText(t, QClipboard::Selection);
2285 if (text.isEmpty ())
2287 if (! extra_interrupt)
2291 QApplication::clipboard()->setText(text);
2332 bool emitKeyPressSignal =
true;
2335 if ( event->modifiers() == Qt::ShiftModifier )
2339 if ( event->key() == Qt::Key_PageUp )
2344 else if ( event->key() == Qt::Key_PageDown )
2349 else if ( event->key() == Qt::Key_Up )
2354 else if ( event->key() == Qt::Key_Down )
2372 emitKeyPressSignal =
false;
2403 QKeyEvent keyEvent(QEvent::KeyPress,0,Qt::NoModifier,event->commitString());
2416 case Qt::ImMicroFocus:
2417 return imageToWidget(QRect(cursorPos.x(),cursorPos.y(),1,1));
2422 case Qt::ImCursorPosition:
2424 return cursorPos.x();
2426 case Qt::ImSurroundingText:
2430 QTextStream stream(&lineText);
2432 decoder.
begin(&stream);
2438 case Qt::ImCurrentSelection:
2483 _scrollBar->resize(QApplication::style()->pixelMetric(QStyle::PM_ScrollBarExtent),
2484 contentsRect().height());
2545 QSize newSize = QSize( columns *
_fontWidth ,
2548 if ( newSize !=
size() )
2571 QWidget::setFixedSize(
_size);
2588 if (event->mimeData()->hasFormat(
"text/plain"))
2589 event->acceptProposedAction();
2598 if (event->mimeData ()->hasUrls ())
2600 foreach (QUrl
url, event->mimeData ()->urls ())
2602 if(dropText.length () > 0)
2604 dropText += url.toLocalFile ();
2635 if(event->mimeData()->hasFormat(
"text/plain"))
2645 QMimeData *mimeData =
new QMimeData;
2646 mimeData->setText(QApplication::clipboard()->
text(QClipboard::Selection));
2663 "<a href=\"http://en.wikipedia.org/wiki/XON\">suspended</a>"
2664 " by pressing Ctrl+S."
2665 " Press <b>Ctrl+Q</b> to resume.</qt>"),
2670 palette.setColor(QPalette::Normal, QPalette::WindowText, QColor(Qt::white));
2671 palette.setColor(QPalette::Normal, QPalette::Window, QColor(Qt::black));
2682 Qt::LinksAccessibleByKeyboard);
2687 _gridLayout->addItem(
new QSpacerItem(0,0,QSizePolicy::Expanding,
2688 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.
OCTAVE_EXPORT octave_value_list column
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()
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE const F77_DBLE * f
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.
Return the CPU time used by your Octave session The first output is the total time spent executing your process and is equal to the sum of second and third which are the number of CPU seconds spent executing in user mode and the number of CPU seconds spent executing in system mode
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)
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function t
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.
in this the arguments are accumulated from left to right
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)
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 *)
OCTAVE_EXPORT octave_value_list at
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)
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...
the sparsity preserving column transformation such that that defines the pivoting threshold can be given in which case it defines the c
nd example oindent which uses the element by element dot form for all operators or discontinuities in any of its inside the integration interval For the example above
T::size_type strlen(const typename T::value_type *str)
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.
With real return the complex result
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.
OCTAVE_EXPORT octave_value_list the first data row corresponds to an index of zero The a spreadsheet style form such as the file is read until end of file is reached The such as text
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)
=val(i)}if ode{val(i)}occurs in table i
void setSelection(const QString &t)
OCTAVE_EXPORT octave_value_list return the value of the option it must match the dimension of the state and the relative tolerance must also be a vector of the same length tem it must match the dimension of the state and the absolute tolerance must also be a vector of the same length The local error test applied at each integration step is xample roup abs(local error in x(i))<
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.
issues an error eealso double
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)
the element is set to zero In other the statement xample y
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
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE * x
QColor keyboardCursorColor() const
Returns the color of the keyboard cursor, or an invalid color if the keyboard cursor color is set to ...
virtual void mouseDoubleClickEvent(QMouseEvent *ev)
void updateImage()
Causes the terminal display to fetch the latest character image from the associated terminal screen (...
nd example oindent assigns the value of the alert character(control-g, ASCII code 7) to the string variable ode
#define DEFAULT_BACK_COLOR