~larryprice/acolyterm/release-0.1

« back to all changes in this revision

Viewing changes to src/plugin/qmltermwidget/lib/TerminalDisplay.h

  • Committer: Larry Price
  • Date: 2016-06-15 14:47:59 UTC
  • Revision ID: larry.price@canonical.com-20160615144759-6wopn0gxwgta3x1n
Updating QMLTermWidget and removing unnecessary konsole codebase

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
class KONSOLEPRIVATE_EXPORT TerminalDisplay : public QQuickPaintedItem
84
84
{
85
85
   Q_OBJECT
86
 
   Q_ENUMS(DragMode)
87
86
   Q_PROPERTY(KSession* session         READ getSession      WRITE setSession     NOTIFY sessionChanged          )
88
 
   Q_PROPERTY(QFont font                READ getVTFont       WRITE setVTFont                                     )
89
 
   Q_PROPERTY(QString  colorScheme                           WRITE setColorScheme                                )
 
87
   Q_PROPERTY(QFont font                READ getVTFont       WRITE setVTFont      NOTIFY vtFontChanged           )
 
88
   Q_PROPERTY(QString colorScheme       READ colorScheme     WRITE setColorScheme NOTIFY colorSchemeChanged      )
90
89
   Q_PROPERTY(QSize terminalSize        READ getTerminalSize                      NOTIFY changedContentSizeSignal)
91
 
   Q_PROPERTY(int lineSpacing                                WRITE setLineSpacing                                )
 
90
   Q_PROPERTY(int lineSpacing           READ lineSpacing     WRITE setLineSpacing NOTIFY lineSpacingChanged      )
92
91
   Q_PROPERTY(bool terminalUsesMouse    READ getUsesMouse                         NOTIFY usesMouseChanged        )
93
92
   Q_PROPERTY(int lines                 READ lines                                NOTIFY changedContentSizeSignal)
94
93
   Q_PROPERTY(int columns               READ columns                              NOTIFY changedContentSizeSignal)
96
95
   Q_PROPERTY(int scrollbarMaximum      READ getScrollbarMaximum                  NOTIFY scrollbarParamsChanged  )
97
96
   Q_PROPERTY(int scrollbarMinimum      READ getScrollbarMinimum                  NOTIFY scrollbarParamsChanged  )
98
97
   Q_PROPERTY(QSize fontMetrics         READ getFontMetrics                       NOTIFY changedFontMetricSignal )
99
 
   Q_PROPERTY(bool enableBold                                WRITE setBoldIntense                                )
100
 
   Q_PROPERTY(DragMode dragMode         MEMBER _dragMode                          NOTIFY dragModeChanged         )
 
98
 
 
99
   Q_PROPERTY(bool enableBold           READ getBoldIntense   WRITE setBoldIntense NOTIFY boldIntenseChanged )
 
100
   Q_PROPERTY(bool fullCursorHeight     READ fullCursorHeight WRITE setFullCursorHeight NOTIFY fullCursorHeightChanged)
 
101
   Q_PROPERTY(bool antialiasText        READ antialias       WRITE setAntialias)
 
102
   Q_PROPERTY(QStringList availableColorSchemes READ availableColorSchemes NOTIFY availableColorSchemesChanged)
101
103
 
102
104
public:
103
105
    /** Constructs a new terminal display widget with the specified parent. */
122
124
    /** Sets the opacity of the terminal display. */
123
125
    void setOpacity(qreal opacity);
124
126
 
 
127
 
125
128
    /** 
126
129
     * This enum describes the location where the scroll bar is positioned in the display widget.
127
130
     */
196
199
    /** Specifies whether or not text can blink. */
197
200
    void setBlinkingTextEnabled(bool blink);
198
201
 
199
 
    enum DragMode {
200
 
        NoDrag,             // drag disabled
201
 
        CtrlModifierDrag,   // require Ctrl key for drag
202
 
        NoModifierDrag      // no additional key is required
203
 
    };
 
202
    void setCtrlDrag(bool enable) { _ctrlDrag=enable; }
 
203
    bool ctrlDrag() { return _ctrlDrag; }
204
204
 
205
205
    /** 
206
206
     *  This enum describes the methods for selecting text when
399
399
     * Specifies whether characters with intense colors should be rendered
400
400
     * as bold. Defaults to true.
401
401
     */
402
 
    void setBoldIntense(bool value) { _boldIntense = value; }
 
402
    void setBoldIntense(bool value);
403
403
    /**
404
404
     * Returns true if characters with intense colors are rendered in bold.
405
405
     */
487
487
     */
488
488
    void pasteSelection();
489
489
 
490
 
    /** Checks if the clipboard is empty */
491
 
    bool isClipboardEmpty();
492
 
 
493
 
    /** Checks if the selection is empty */
494
 
    bool isSelectionEmpty();
495
 
 
496
490
    /** 
497
491
       * Changes whether the flow control warning box should be shown when the flow control
498
492
       * stop key (Ctrl+S) are pressed.
556
550
 
557
551
    // QMLTermWidget
558
552
    void setColorScheme(const QString &name);
 
553
    QString colorScheme() const;
559
554
    QStringList availableColorSchemes();
560
555
 
561
 
    void simulateKeyPress(int key, int modifiers, bool pressed, quint32 nativeScanCode, QString text);
 
556
    void simulateKeyPress(int key, int modifiers, bool pressed, quint32 nativeScanCode, const QString &text);
562
557
    void simulateWheel(int x, int y, int buttons, int modifiers, QPointF angleDelta);
563
558
    void simulateMouseMove(int x, int y, int button, int buttons, int modifiers);
564
559
    void simulateMousePress(int x, int y, int button, int buttons, int modifiers);
602
597
     */
603
598
    void overrideShortcutCheck(QKeyEvent* keyEvent,bool& override);
604
599
 
605
 
   void isBusySelecting(bool);
 
600
   void isBusySelecting(bool busy);
606
601
   void sendStringToEmu(const char*);
607
602
   
608
603
   // qtermwidget signals
609
 
        void copyAvailable(bool);
 
604
    void copyAvailable(bool available);
610
605
        void termGetFocus();
611
606
        void termLostFocus();
612
607
 
613
 
    void notifyBell(const QString&);
 
608
    void notifyBell(const QString& bell);
614
609
 
615
610
    // QMLTermWidget
616
611
    void sessionChanged();
619
614
    void imagePainted();
620
615
    void scrollbarValueChanged();
621
616
    void scrollbarParamsChanged(int value);
622
 
    void dragModeChanged();
 
617
    void vtFontChanged();
 
618
    void lineSpacingChanged();
 
619
    void availableColorSchemesChanged();
 
620
    void colorSchemeChanged();
 
621
    void fullCursorHeightChanged();
 
622
    void boldIntenseChanged();
623
623
 
624
624
protected:
625
625
    virtual bool event( QEvent * );
827
827
    bool _cursorBlinking;     // hide cursor in paintEvent
828
828
    bool _hasBlinkingCursor;  // has blinking cursor enabled
829
829
    bool _allowBlinkingText;  // allow text to blink
830
 
    DragMode _dragMode;
 
830
    bool _ctrlDrag;           // require Ctrl key for drag
831
831
    TripleClickMode _tripleClickMode;
832
832
    bool _isFixedSize; //Columns / lines are locked.
833
833
    QTimer* _blinkTimer;  // active when hasBlinker
851
851
    QLabel* _outputSuspendedLabel; 
852
852
        
853
853
    uint _lineSpacing;
854
 
 
 
854
    QString _colorScheme;
855
855
    bool _colorsInverted; // true during visual bell
856
856
 
857
857
    QSize _size;
891
891
    QPalette m_palette;
892
892
    QPalette::ColorRole m_color_role;
893
893
    KSession *m_session;
 
894
    bool m_full_cursor_height;
894
895
 
895
896
    QFont font() const { return m_font; }
896
897
 
919
920
 
920
921
    QSize getFontMetrics();
921
922
 
 
923
    void setFullCursorHeight(bool val);
 
924
 
922
925
public:
923
926
    static void setTransparencyEnabled(bool enable)
924
927
    {
925
928
        HAVE_TRANSPARENCY = enable;
926
929
    }
 
930
    bool fullCursorHeight() const;
927
931
};
928
932
 
929
933
class AutoScrollHandler : public QObject