~ubuntu-branches/ubuntu/precise/konsole/precise-proposed

« back to all changes in this revision

Viewing changes to src/Vt102Emulation.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2011-12-16 13:14:43 UTC
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: package-import@ubuntu.com-20111216131443-rhdplbmmuxntat3k
Tags: upstream-4.7.90
ImportĀ upstreamĀ versionĀ 4.7.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
    This file is part of Konsole, an X terminal.
3
 
    
 
3
 
4
4
    Copyright 2007-2008 by Robert Knight <robertknight@gmail.com>
5
5
    Copyright 1997,1998 by Lars Doelle <lars.doelle@on-line.de>
6
6
 
23
23
#ifndef VT102EMULATION_H
24
24
#define VT102EMULATION_H
25
25
 
26
 
// Standard Library
27
 
#include <stdio.h>
28
 
 
29
 
// Qt 
 
26
// Qt
30
27
#include <QtGui/QKeyEvent>
31
28
#include <QtCore/QHash>
32
29
#include <QtCore/QTimer>
50
47
namespace Konsole
51
48
{
52
49
 
 
50
extern unsigned short vt100_graphics[32];
 
51
 
53
52
struct CharCodes
54
53
{
55
54
  // coding info
64
63
/**
65
64
 * Provides an xterm compatible terminal emulation based on the DEC VT102 terminal.
66
65
 * A full description of this terminal can be found at http://vt100.net/docs/vt102-ug/
67
 
 * 
68
 
 * In addition, various additional xterm escape sequences are supported to provide 
 
66
 *
 
67
 * In addition, various additional xterm escape sequences are supported to provide
69
68
 * features such as mouse input handling.
70
69
 * See http://rtfm.etla.org/xterm/ctlseq.html for a description of xterm's escape
71
 
 * sequences. 
 
70
 * sequences.
72
71
 *
73
72
 */
74
73
class Vt102Emulation : public Emulation
75
 
 
74
{
76
75
Q_OBJECT
77
76
 
78
77
public:
79
78
  /** Constructs a new emulation */
80
79
  Vt102Emulation();
81
80
  ~Vt102Emulation();
82
 
  
 
81
 
83
82
  // reimplemented from Emulation
84
83
  virtual void clearEntireScreen();
85
84
  virtual void reset();
86
85
  virtual char eraseChar() const;
87
 
  
 
86
 
88
87
public slots: 
89
 
  // reimplemented from Emulation 
 
88
  // reimplemented from Emulation
90
89
  virtual void sendString(const char*,int length = -1);
91
90
  virtual void sendText(const QString& text);
92
91
  virtual void sendKeyEvent(QKeyEvent*);
93
92
  virtual void sendMouseEvent(int buttons, int column, int line, int eventType);
94
 
  
 
93
 
95
94
protected:
96
95
  // reimplemented from Emulation
97
96
  virtual void setMode(int mode);
98
97
  virtual void resetMode(int mode);
99
98
  virtual void receiveChar(int cc);
100
 
  
 
99
 
101
100
private slots:
102
101
  //causes changeTitle() to be emitted for each (int,QString) pair in pendingTitleUpdates
103
102
  //used to buffer multiple title updates
120
119
  bool getMode    (int mode);
121
120
  // saves the current boolean value of 'mode'
122
121
  void saveMode   (int mode);
123
 
  // restores the boolean value of 'mode' 
 
122
  // restores the boolean value of 'mode'
124
123
  void restoreMode(int mode);
125
124
  // resets all modes
126
125
  // (except MODE_Allow132Columns)
177
176
  TerminalState _currentModes;
178
177
  TerminalState _savedModes;
179
178
 
180
 
  //hash table and timer for buffering calls to the session instance 
 
179
  //hash table and timer for buffering calls to the session instance
181
180
  //to update the name of the session
182
181
  //or window title.
183
 
  //these calls occur when certain escape sequences are seen in the 
 
182
  //these calls occur when certain escape sequences are seen in the
184
183
  //output from the terminal
185
184
  QHash<int,QString> _pendingTitleUpdates;
186
185
  QTimer* _titleUpdateTimer;