summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/widget_layer.cpp8
-rw-r--r--noncore/apps/opie-console/widget_layer.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/noncore/apps/opie-console/widget_layer.cpp b/noncore/apps/opie-console/widget_layer.cpp
index 6682708..e4b0ede 100644
--- a/noncore/apps/opie-console/widget_layer.cpp
+++ b/noncore/apps/opie-console/widget_layer.cpp
@@ -47,55 +47,55 @@ WidgetLayer::WidgetLayer( const Profile &config, QWidget *parent, const char *na
47 47
48 48
49WidgetLayer::~WidgetLayer() 49WidgetLayer::~WidgetLayer()
50{ 50{
51 // clean up 51 // clean up
52 delete m_image; 52 delete m_image;
53} 53}
54 54
55 55
56/* --------------------------------- audio ---------------------------------- */ 56/* --------------------------------- audio ---------------------------------- */
57 57
58void WidgetLayer::bell() 58void WidgetLayer::bell()
59{ 59{
60 QApplication::beep(); 60 QApplication::beep();
61} 61}
62 62
63bool WidgetLayer::eventFilter( QObject *obj, QEvent *e ) 63bool WidgetLayer::eventFilter( QObject *obj, QEvent *e )
64{ 64{
65 if ( (e->type() == QEvent::Accel || 65 if ( (e->type() == QEvent::Accel ||
66 e->type() == QEvent::AccelAvailable ) && qApp->focusWidget() == this ) { 66 e->type() == QEvent::AccelAvailable ) && qApp->focusWidget() == this ) {
67 static_cast<QKeyEvent *>( e )->ignore(); 67 static_cast<QKeyEvent *>( e )->ignore();
68 return true; 68 return true;
69 } 69 }
70 if ( obj != this /* when embedded */ && obj != parent() /* when standalone */ ) 70 if ( obj != this /* when embedded */ && obj != parent() /* when standalone */ )
71 return FALSE; // not us 71 return false; // not us
72 72
73#ifdef FAKE_CTRL_AND_ALT 73#ifdef FAKE_CTRL_AND_ALT
74 static bool control = FALSE; 74 static bool control = false;
75 static bool alt = FALSE; 75 static bool alt = false;
76// qDebug(" Has a keyboard with no CTRL and ALT keys, but we fake it:"); 76// qDebug(" Has a keyboard with no CTRL and ALT keys, but we fake it:");
77 bool dele=FALSE; 77 bool dele = false;
78 if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) { 78 if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) {
79 QKeyEvent* ke = (QKeyEvent*)e; 79 QKeyEvent* ke = (QKeyEvent*)e;
80 bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat(); 80 bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat();
81 switch (ke->key()) { 81 switch (ke->key()) {
82 case Key_F9: // let this be "Control" 82 case Key_F9: // let this be "Control"
83 control = keydown; 83 control = keydown;
84 e = new QKeyEvent(QEvent::KeyPress, Key_Control, 0, ke->state()); 84 e = new QKeyEvent(QEvent::KeyPress, Key_Control, 0, ke->state());
85 dele=TRUE; 85 dele=TRUE;
86 break; 86 break;
87 case Key_F13: // let this be "Alt" 87 case Key_F13: // let this be "Alt"
88 alt = keydown; 88 alt = keydown;
89 e = new QKeyEvent(QEvent::KeyPress, Key_Alt, 0, ke->state()); 89 e = new QKeyEvent(QEvent::KeyPress, Key_Alt, 0, ke->state());
90 dele=TRUE; 90 dele=TRUE;
91 break; 91 break;
92 default: 92 default:
93 if ( control ) { 93 if ( control ) {
94 int a = toupper(ke->ascii())-64; 94 int a = toupper(ke->ascii())-64;
95 if ( a >= 0 && a < ' ' ) { 95 if ( a >= 0 && a < ' ' ) {
96 e = new QKeyEvent(e->type(), ke->key(), 96 e = new QKeyEvent(e->type(), ke->key(),
97 a, ke->state()|ControlButton, 97 a, ke->state()|ControlButton,
98QChar(a,0)); 98QChar(a,0));
99 dele=TRUE; 99 dele=TRUE;
100 } 100 }
101 } 101 }
diff --git a/noncore/apps/opie-console/widget_layer.h b/noncore/apps/opie-console/widget_layer.h
index 1d96bf4..0c290f3 100644
--- a/noncore/apps/opie-console/widget_layer.h
+++ b/noncore/apps/opie-console/widget_layer.h
@@ -99,49 +99,49 @@ public:
99 99
100 /** 100 /**
101 * paste content of clipboard 101 * paste content of clipboard
102 */ 102 */
103 void pasteClipboard(); 103 void pasteClipboard();
104 104
105 105
106 /** 106 /**
107 * reload configuration 107 * reload configuration
108 * @param const Profile& config, the config to be used (may be the same as in constructor) 108 * @param const Profile& config, the config to be used (may be the same as in constructor)
109 */ 109 */
110 virtual void reloadConfig( const Profile& config ) = 0; 110 virtual void reloadConfig( const Profile& config ) = 0;
111 111
112 112
113 /** 113 /**
114 * sets the scrollbar (if implemented by successor of this class) 114 * sets the scrollbar (if implemented by successor of this class)
115 */ 115 */
116 virtual void setScroll( int cursor, int slines ) = 0; 116 virtual void setScroll( int cursor, int slines ) = 0;
117 117
118 /** 118 /**
119 * scrolls (if implemented, by successor of this class) 119 * scrolls (if implemented, by successor of this class)
120 * @param int value, how much the widget should scroll up (positive value) or down (negative value) 120 * @param int value, how much the widget should scroll up (positive value) or down (negative value)
121 */ 121 */
122 virtual void scroll( int value ) = 0; 122 virtual void scroll( int value ) = 0;
123 123
124 124
125 virtual bool eventFilter( QObject *obj, QEvent *event ); 125 virtual bool eventFilter( QObject *obj, QEvent *event );
126signals: 126signals:
127 127
128 /** 128 /**
129 * key was pressed 129 * key was pressed
130 */ 130 */
131 void keyPressed( QKeyEvent *e ); 131 void keyPressed( QKeyEvent *e );
132 132
133 /** 133 /**
134 * whenever Mouse selects something 134 * whenever Mouse selects something
135 * @param int button, the button that us pressed : 135 * @param int button, the button that us pressed :
136 * 0left Button 136 * 0left Button
137 * 3Button released 137 * 3Button released
138 * @param int x, x position 138 * @param int x, x position
139 * @param int y, y position 139 * @param int y, y position
140 * 140 *
141 * // numbering due to layout in old TEWidget 141 * // numbering due to layout in old TEWidget
142 */ 142 */
143 void mousePressed( int button, int x, int y ); 143 void mousePressed( int button, int x, int y );
144 144
145 /** 145 /**
146 * size of image changed 146 * size of image changed
147 * @param int lines, line count of new size 147 * @param int lines, line count of new size