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);
240 ,_screenWindow(nullptr)
242 ,_gridLayout(nullptr)
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)
272 ,_resizeWidget(nullptr)
273 ,_resizeTimer(nullptr)
274 ,_outputSuspendedLabel(nullptr)
276 ,_colorsInverted(
false)
277 ,_blendColor(qRgba(0,0,0,0xff))
279 ,_cursorShape(BlockCursor)
284 setLayoutDirection(Qt::LeftToRight);
297 connect(
_scrollBar, SIGNAL(valueChanged(
int)),
this,
316 setMouseTracking(
true);
319 setAcceptDrops(
true);
322 setFocusPolicy( Qt::WheelFocus );
325 setAttribute(Qt::WA_InputMethodEnabled,
true);
329 setAttribute(Qt::WA_OpaquePaintEvent);
337 parent->parent (), SLOT (set_global_shortcuts (
bool)));
339 parent, SLOT (set_global_shortcuts (
bool)));
345 qApp->removeEventFilter(
this );
422 paint.drawLine(cx-1,
y, cx-1, cy-2);
424 paint.drawLine(cx,
y, cx, cy-2);
426 paint.drawLine(cx+1,
y, cx+1, cy-2);
430 paint.drawLine(cx-1, cy+2, cx-1, ey);
432 paint.drawLine(cx, cy+2, cx, ey);
434 paint.drawLine(cx+1, cy+2, cx+1, ey);
438 paint.drawLine(
x, cy-1, cx-2, cy-1);
440 paint.drawLine(
x, cy, cx-2, cy);
442 paint.drawLine(
x, cy+1, cx-2, cy+1);
446 paint.drawLine(cx+2, cy-1, ex, cy-1);
448 paint.drawLine(cx+2, cy, ex, cy);
450 paint.drawLine(cx+2, cy+1, ex, cy+1);
454 paint.drawPoint(cx-1, cy-1);
456 paint.drawPoint(cx, cy-1);
458 paint.drawPoint(cx+1, cy-1);
461 paint.drawPoint(cx-1, cy);
463 paint.drawPoint(cx, cy);
465 paint.drawPoint(cx+1, cy);
468 paint.drawPoint(cx-1, cy+1);
470 paint.drawPoint(cx, cy+1);
472 paint.drawPoint(cx+1, cy+1);
479 const QPen& currentPen = painter.pen();
483 QPen boldPen(currentPen);
485 painter.setPen( boldPen );
488 for (
int i=0 ;
i <
str.length();
i++)
495 painter.setPen( currentPen );
508 if (useForegroundColor)
532 QRect scrollBarArea =
_scrollBar->isVisible() ?
536 QRegion contentsRegion = QRegion(rect).subtracted(scrollBarArea);
537 QRect contentsRect = contentsRegion.boundingRect();
539 painter.fillRect(contentsRect, backgroundColor);
540 painter.fillRect(scrollBarArea,
_scrollBar->palette().background());
545 const QColor& foregroundColor,
547 bool& invertCharacterColor)
549 QRect cursorRect = rect;
557 painter.setPen(foregroundColor);
564 int penWidth = qMax(1,painter.pen().width());
566 painter.drawRect(cursorRect.adjusted(penWidth/2,
568 - penWidth/2 - penWidth%2,
569 - penWidth/2 - penWidth%2));
578 invertCharacterColor =
true;
583 painter.drawLine(cursorRect.left(),
586 cursorRect.bottom());
588 painter.drawLine(cursorRect.left(),
591 cursorRect.bottom());
600 bool invertCharacterColor)
610 QFont font = painter.font();
611 if ( font.bold() != useBold
612 || font.underline() != useUnderline )
614 font.setBold(useBold);
615 font.setUnderline(useUnderline);
616 painter.setFont(font);
622 QPen pen = painter.pen();
623 if ( pen.color() != color )
626 painter.setPen(color);
639 painter.drawText(rect,0,
text);
655 if ( backgroundColor != palette().background().color() )
660 bool invertCharacterColor =
false;
663 drawCursor(painter,rect,foregroundColor,backgroundColor,invertCharacterColor);
677 void TerminalDisplay::setCursorPos(
const int curx,
const int cury)
679 QPoint tL = contentsRect().topLeft();
684 ypos = _topMargin + tLy + _fontHeight*(cury-1) + _fontAscent;
685 xpos = _leftMargin + tLx + _fontWidth*curx;
719 QRect region = screenWindowRegion;
720 region.setBottom( qMin(region.bottom(),this->
_lines-2) );
725 || (region.top() +
abs(
lines)) >= region.bottom()
726 || this->
_lines <= region.height() )
735 int linesToMove = region.height() -
abs(
lines);
736 int bytesToMove = linesToMove *
740 Q_ASSERT( linesToMove > 0 );
741 Q_ASSERT( bytesToMove > 0 );
747 Q_ASSERT( (
char*)lastCharPos + bytesToMove <
753 memmove( firstCharPos , lastCharPos , bytesToMove );
764 Q_ASSERT( (
char*)firstCharPos + bytesToMove <
768 memmove( lastCharPos , firstCharPos , bytesToMove );
774 scrollRect = QRect( topPoint ,
792 rect.setBottom(hotSpot->
endLine());
819 update( preUpdateHotSpots | postUpdateHotSpots );
844 Q_ASSERT( this->_usedLines <= this->
_lines );
845 Q_ASSERT( this->_usedColumns <= this->
_columns );
849 QPoint tL = contentsRect().topLeft();
859 const int linesToUpdate = qMin(this->_lines, qMax(0,
lines ));
860 const int columnsToUpdate = qMin(this->_columns,qMax(0,
columns));
862 QChar *disstrU =
new QChar[columnsToUpdate];
863 char *dirtyMask =
new char[columnsToUpdate+2];
869 int dirtyLineCount = 0;
871 for (
y = 0;
y < linesToUpdate;
y++)
876 bool updateLine =
false;
881 memset(dirtyMask, 0, columnsToUpdate+2);
883 for(
x = 0 ;
x < columnsToUpdate ;
x++)
885 if ( newLine[
x] != currentLine[
x] )
892 for (
x = 0;
x < columnsToUpdate;
x++)
907 bool doubleWidth = (
x+1 == columnsToUpdate) ?
false : (newLine[
x+1].
character == 0);
911 int lln = columnsToUpdate -
x;
912 for (len = 1; len < lln; len++)
919 bool nextIsDoubleWidth = (
x+len+1 == columnsToUpdate) ?
false : (newLine[
x+len+1].
character == 0);
926 nextIsDoubleWidth != doubleWidth )
932 QString unistr(disstrU,
p);
968 dirtyRegion |= dirtyRect;
973 memcpy((
void*)currentLine,(
const void*)newLine,columnsToUpdate*
sizeof(
Character));
1023 _resizeWidget->setStyleSheet(
"background-color:palette(window);border-style:solid;border-width:1px;border-color:palette(dark)");
1064 QPainter paint(
this);
1067 foreach (QRect rect, (pe->region() & contentsRect()).rects())
1088 QWidget::focusInEvent(focusEvent);
1099 QWidget::focusOutEvent(focusEvent);
1114 if ( preeditLength == 0 )
1130 bool invertColors =
false;
1136 drawCursor(painter,rect,foreground,background,invertColors);
1153 QPoint cursorPos = mapFromGlobal(QCursor::pos());
1165 QListIterator<Filter::HotSpot*> iter(spots);
1166 while (iter.hasNext())
1172 int startColumn = 0;
1207 QFontMetrics metrics(font());
1211 int baseline = r.bottom() + 1;
1213 int underlinePos = baseline + metrics.underlinePos();
1215 if (r.contains (mapFromGlobal(QCursor::pos())))
1218 painter.setPen (QColor (255,0,0));
1219 painter.drawLine (r.left(), underlinePos,
1220 r.right() + 2, underlinePos);
1228 painter.fillRect(r,QBrush(QColor(255,0,0,120)));
1238 QPoint topLeft = contentsRect().topLeft();
1240 int topLeftY = topLeft.y();
1254 QChar *disstrU =
new QChar[bufferSize];
1255 for (
int y = leftUpperY;
y <= rightLowerY;
y++)
1261 for (;
x <= rightLowerX;
x++)
1270 ushort extendedCharLength = 0;
1273 for (
int index = 0 ; index < extendedCharLength ; index++ )
1275 Q_ASSERT(
p < bufferSize );
1276 disstrU[
p++] = chars[index];
1285 Q_ASSERT(
p < bufferSize );
1296 while (
x+len <= rightLowerX &&
1297 _image[
loc(
x+len,
y)].foregroundColor == currentForeground &&
1298 _image[
loc(
x+len,
y)].backgroundColor == currentBackground &&
1299 _image[
loc(
x+len,
y)].rendition == currentRendition &&
1317 QString unistr(disstrU,
p);
1342 QMatrix inverted = paint.matrix().inverted();
1343 textArea.moveCenter( inverted.map(textArea.center()) );
1356 paint.resetMatrix();
1425 parentWidget()->adjustSize();
1426 parentWidget()->setFixedSize(parentWidget()->
sizeHint());
1468 #if defined (SIGWINCH) 1564 if ( !contentsRect().contains(ev->pos()) )
return;
1571 QPoint pos = QPoint(charColumn,charLine);
1573 if ( ev->button() == Qt::LeftButton)
1581 if (actions.length ())
1582 actions.at (0)->activate (QAction::Trigger);
1591 bool selected =
false;
1599 if ((!
_ctrlDrag || ev->modifiers() & Qt::ControlModifier) && selected ) {
1608 _preserveLineBreaks = !( ( ev->modifiers() & Qt::ControlModifier ) && !(ev->modifiers() & Qt::AltModifier) );
1609 _columnSelectionMode = (ev->modifiers() & Qt::AltModifier) && (ev->modifiers() & Qt::ControlModifier);
1611 if (
_mouseMarks || (ev->modifiers() & Qt::ShiftModifier))
1627 else if ( ev->button() == Qt::MidButton )
1634 else if ( ev->button() == Qt::RightButton )
1636 if (
_mouseMarks || (ev->modifiers() & Qt::ShiftModifier))
1639 ev->modifiers() & (Qt::ShiftModifier|Qt::ControlModifier),
1647 QWidget::mousePressEvent (ev);
1652 int charLine, charColumn;
1675 setCursor (Qt::PointingHandCursor);
1680 qMax(spot->startColumn() , spot->endColumn()) *
_fontHeight,
1685 const QString& tooltip = spot->tooltip();
1686 if ( !tooltip.isEmpty() )
1702 if (ev->buttons() == Qt::NoButton )
return;
1707 if (!
_mouseMarks && !(ev->modifiers() & Qt::ShiftModifier))
1710 if (ev->buttons() & Qt::LeftButton)
1712 if (ev->buttons() & Qt::MidButton)
1714 if (ev->buttons() & Qt::RightButton)
1753 if (ev->buttons() & Qt::MidButton)
return;
1759 void TerminalDisplay::setSelectionEnd()
1761 extendSelection( _configureRequestPoint );
1766 QPoint pos = position;
1772 QPoint tL = contentsRect().topLeft();
1806 QPoint here = QPoint(charColumn, charLine);
1812 bool swapping =
false;
1819 bool left_not_right = (here.y() < _iPntSelCorr.y() ||
1820 (here.y() == _iPntSelCorr.y() && here.x() < _iPntSelCorr.x()));
1821 bool old_left_not_right = (_pntSelCorr.y() < _iPntSelCorr.y() ||
1822 (_pntSelCorr.y() == _iPntSelCorr.y() && _pntSelCorr.x() < _iPntSelCorr.x()));
1823 swapping = left_not_right != old_left_not_right;
1826 QPoint
left = left_not_right ? here : _iPntSelCorr;
1843 QPoint
right = left_not_right ? _iPntSelCorr : here;
1860 if (left_not_right) {
1872 bool above_not_below = (here.y() < _iPntSelCorr.y());
1874 QPoint
above = above_not_below ? here : _iPntSelCorr;
1875 QPoint below = above_not_below ? _iPntSelCorr : here;
1888 if (above_not_below) {
1896 QPoint newSelBegin = QPoint(ohere.x(), ohere.y());
1908 bool left_not_right = (here.y() < _iPntSelCorr.y() ||
1909 (here.y() == _iPntSelCorr.y() && here.x() < _iPntSelCorr.x()));
1910 bool old_left_not_right = (_pntSelCorr.y() < _iPntSelCorr.y() ||
1911 (_pntSelCorr.y() == _iPntSelCorr.y() && _pntSelCorr.x() < _iPntSelCorr.x()));
1912 swapping = left_not_right != old_left_not_right;
1915 QPoint
left = left_not_right ? here : _iPntSelCorr;
1918 QPoint
right = left_not_right ? _iPntSelCorr : here;
1923 if (selClass ==
' ') {
1930 right = left_not_right ? _iPntSelCorr : here;
1939 if (left_not_right) {
1950 if ((here == _pntSelCorr) && (scroll ==
_scrollBar->value())) {
1954 if (here == ohere) {
1958 if (
_actSel < 2 || swapping) {
1960 _screenWindow->setSelectionStart(ohere.x(), ohere.y(),
true);
1962 _screenWindow->setSelectionStart(ohere.x() - 1 - offset , ohere.y(),
false);
1974 _screenWindow->setSelectionEnd(here.x() + offset, here.y());
1987 if ( ev->button() == Qt::LeftButton)
2009 if (!
_mouseMarks && !(ev->modifiers() & Qt::ShiftModifier))
2019 ((ev->button() == Qt::RightButton && !(ev->modifiers() & Qt::ShiftModifier))
2020 || ev->button() == Qt::MidButton) )
2028 QWidget::mouseReleaseEvent(ev);
2064 if ( ev->button() != Qt::LeftButton)
return;
2072 QPoint pos(charColumn,charLine);
2075 if (!
_mouseMarks && !(ev->modifiers() & Qt::ShiftModifier))
2087 QPoint bgnSel = pos;
2088 QPoint endSel = pos;
2089 int i =
loc(bgnSel.x(),bgnSel.y());
2117 i =
loc( endSel.x(), endSel.y() );
2135 if ( ( QChar(
_image[
i].
character ) ==
'@' ) && ( ( endSel.x() - bgnSel.x() ) > 0 ) )
2136 endSel.setX(
x - 1 );
2148 QTimer::singleShot(QApplication::doubleClickInterval(),
this,
2154 if (ev->orientation() != Qt::Vertical)
2184 _iPntSel = QPoint(charColumn,charLine);
2244 return QWidget::focusNextPrevChild(
next );
2250 QChar qch=QChar(ch);
2251 if ( qch.isSpace() )
return ' ';
2253 if ( qch.isLetterOrNumber() ||
_wordCharacters.contains(qch, Qt::CaseInsensitive ) )
2268 setCursor(
_mouseMarks ? Qt::IBeamCursor : Qt::ArrowCursor );
2289 QString
text = QApplication::clipboard()->
text(useXselection ? QClipboard::Selection :
2290 QClipboard::Clipboard);
2293 if ( !
text.isEmpty() )
2295 text.replace(
"\n",
"\r");
2296 QKeyEvent
e(QEvent::KeyPress, 0, Qt::NoModifier,
text);
2305 QApplication::clipboard()->setText(
t, QClipboard::Selection);
2315 if (
text.isEmpty ())
2317 if (! extra_interrupt)
2321 QApplication::clipboard()->setText(
text);
2362 bool emitKeyPressSignal =
true;
2365 if ( event->modifiers() == Qt::ShiftModifier )
2369 if ( event->key() == Qt::Key_PageUp )
2374 else if ( event->key() == Qt::Key_PageDown )
2379 else if ( event->key() == Qt::Key_Up )
2384 else if ( event->key() == Qt::Key_Down )
2402 emitKeyPressSignal =
false;
2433 QKeyEvent keyEvent(QEvent::KeyPress,0,Qt::NoModifier,event->commitString());
2446 case Qt::ImMicroFocus:
2447 return imageToWidget(QRect(cursorPos.x(),cursorPos.y(),1,1));
2452 case Qt::ImCursorPosition:
2454 return cursorPos.x();
2456 case Qt::ImSurroundingText:
2460 QTextStream stream(&lineText);
2462 decoder.
begin(&stream);
2468 case Qt::ImCurrentSelection:
2513 _scrollBar->resize(QApplication::style()->pixelMetric(QStyle::PM_ScrollBarExtent),
2514 contentsRect().height());
2578 if ( newSize != size() )
2601 QWidget::setFixedSize(
_size);
2618 if (event->mimeData()->hasFormat(
"text/plain"))
2619 event->acceptProposedAction();
2628 if (event->mimeData ()->hasUrls ())
2630 foreach (QUrl
url, event->mimeData ()->urls ())
2632 if(dropText.length () > 0)
2634 dropText +=
url.toLocalFile ();
2665 if(event->mimeData()->hasFormat(
"text/plain"))
2675 QMimeData *mimeData =
new QMimeData;
2676 mimeData->setText(QApplication::clipboard()->
text(QClipboard::Selection));
2693 "<a href=\"http://en.wikipedia.org/wiki/XON\">suspended</a>" 2694 " by pressing Ctrl+S." 2695 " Press <b>Ctrl+Q</b> to resume.</qt>"),
2700 palette.setColor(QPalette::Normal, QPalette::WindowText, QColor(Qt::white));
2701 palette.setColor(QPalette::Normal, QPalette::Window, QColor(Qt::black));
2712 Qt::LinksAccessibleByKeyboard);
2717 _gridLayout->addItem(
new QSpacerItem(0,0,QSizePolicy::Expanding,
2718 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...
virtual void wheelEvent(QWheelEvent *)
virtual void mouseMoveEvent(QMouseEvent *)
void setFixedSize(int cols, int lins)
KeyboardCursorShape _cursorShape
Provides a window onto a section of a terminal screen.
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)
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.
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...
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 const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &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.
int endLine() const
Returns the line where the hotspot area ends.
void processFilters()
Updates the filters in the display's filter chain.
QColor keyboardCursorColor() const
Returns the color of the keyboard cursor, or an invalid color if the keyboard cursor color is set to ...
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
void visibility_changed(bool visible)
Is called, when the terminal's visibility has changed in order to stop orstart timers etc...
Describes the color of a single character in the terminal.
QRect _mouseOverHotspotArea
virtual void extendSelection(const QPoint &pos)
Do not show the scroll bar.
ScreenWindow * screenWindow() const
Returns the terminal screen section which is displayed in this widget.
Select the whole line underneath the cursor.
static const quint32 LineChars[]
FilterChain * filterChain() const
Returns the display's filter chain.
QRect imageToWidget(const QRect &imageArea) const
virtual void showEvent(QShowEvent *)
KeyboardCursorShape keyboardCursorShape() const
Returns the shape of the keyboard cursor.
QVector< LineProperty > _lineProperties
static const int DEFAULT_LEFT_MARGIN
quint8 rendition
A combination of RENDITION flags which specify options for drawing the character. ...
int startColumn() const
Returns the column on startLine() where the hotspot area starts.
static bool _antialiasText
int lines()
Returns the number of lines of text which can be displayed in the widget.
Type type() const
Returns the type of the hotspot.
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.
nd example oindent opens the file binary numeric values will be read assuming they are stored in IEEE format with the least significant bit and then converted to the native representation Opening a file that is already open simply opens it again and returns a separate file id It is not an error to open a file several though writing to the same file through several different file ids may produce unexpected results The possible values of text mode reading and writing automatically converts linefeeds to the appropriate line end character for the you may append a you must also open the file in binary mode The parameter conversions are currently only supported for and permissions will be set to and then everything is written in a single operation This is very efficient and improves performance c
void process()
Processes each filter in the chain.
in this the arguments are accumulated from left to right
void tripleClickTimeout()
virtual void resizeEvent(QResizeEvent *)
uint randomSeed() const
Returns the seed used to generate random colors for the display (in color schemes that support them)...
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)
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
QPoint cursorPosition() const
QLabel * _outputSuspendedLabel
const ColorEntry * colorTable() const
Returns the terminal color palette used by the display.
QTimer * _blinkCursorTimer
A terminal character decoder which produces plain text, ignoring colours and other appearance-related...
contains a list of points where the integrand has known or discontinuities in any of its inside the integration interval For the example above
void paintFilters(QPainter &painter)
QRect preeditRect() const
void focusOutEvent(QFocusEvent *focusEvent)
void selectAll()
selects all content
int string_width(const QString &txt)
QTimer * _process_filter_timer
void changedFontMetricSignal(int height, int width)
void focusInEvent(QFocusEvent *focusEvent)
virtual void dragEnterEvent(QDragEnterEvent *event)
virtual int charClass(quint16) const
QColor color(const ColorEntry *palette) const
Returns the color within the specified color .
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.
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)
bool _possibleTripleClick
void emitSelection(bool useXselection, bool appendReturn)
CharacterColor backgroundColor
The color used to draw this character's background.
virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const
A chain which allows a group of filters to be processed as one.
InputMethodData _inputMethodData
TerminalImageFilterChain * _filterChain
virtual void hideEvent(QHideEvent *)
Filter::HotSpot * hotSpotAt(int line, int column) const
Returns the first hotspot which occurs at line, column or 0 if no hotspot was found.
OCTAVE_EXPORT octave_value_list at
void set_global_shortcuts_signal(bool)
Emitted when focus changes.
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...
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.
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
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)
bool usesMouse() const
See setUsesMouse()
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
void copyClipboard(bool extra_interrupt)
Copies the selected text to the clipboard.
Select from the current cursor position to the end of the line.
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.
void setScroll(int cursor, int lines)
Sets the current position and range of the display's scroll bar.
QRegion hotSpotRegion() const
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
virtual void paintEvent(QPaintEvent *)
void setBlinkingCursorState(bool blink)
TerminalView(QWidget *parent=nullptr)
Constructs a new terminal display widget with the specified parent.
void getCharacterPosition(const QPoint &widgetPoint, int &line, int &column) const
A single flat line which occupies the space at the bottom of the cursor character's area...
void drawLineCharString(QPainter &painter, int x, int y, const QString &str, const Character *attributes)
void mouseTripleClickEvent(QMouseEvent *ev)
QPointer< ScreenWindow > _screenWindow
int startLine() const
Returns the line when the hotspot area starts.
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)
static const int BLINK_DELAY
int endColumn() const
Returns the column on endLine() where the hotspot area ends.
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
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
QList< Filter::HotSpot * > hotSpots() const
Returns a list of all the hotspots in all the chain's filters.
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 const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE * x
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