-rw-r--r-- | noncore/apps/opie-console/emulation_widget.cpp | 3 | ||||
-rw-r--r-- | noncore/apps/opie-console/widget_layer.h | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/emulation_widget.cpp b/noncore/apps/opie-console/emulation_widget.cpp index 5c3b2d2..318d7bb 100644 --- a/noncore/apps/opie-console/emulation_widget.cpp +++ b/noncore/apps/opie-console/emulation_widget.cpp | |||
@@ -5,48 +5,51 @@ | |||
5 | #include "profile.h" | 5 | #include "profile.h" |
6 | 6 | ||
7 | // qt includes | 7 | // qt includes |
8 | #include <qwidget.h> | 8 | #include <qwidget.h> |
9 | #include <qarray.h> | 9 | #include <qarray.h> |
10 | #include <qstring.h> | 10 | #include <qstring.h> |
11 | #include <qpainter.h> | 11 | #include <qpainter.h> |
12 | #include <qrect.h> | 12 | #include <qrect.h> |
13 | #include <qscrollbar.h> | 13 | #include <qscrollbar.h> |
14 | 14 | ||
15 | #define rimX 0 // left/right rim width | 15 | #define rimX 0 // left/right rim width |
16 | #define rimY 0 // top/bottom rim high | 16 | #define rimY 0 // top/bottom rim high |
17 | 17 | ||
18 | #define SCRWIDTH 16 // width of scrollbar | 18 | #define SCRWIDTH 16 // width of scrollbar |
19 | 19 | ||
20 | EmulationWidget::EmulationWidget( const Profile& config, QWidget *parent, const char* name ) : WidgetLayer( config, parent, name ) | 20 | EmulationWidget::EmulationWidget( const Profile& config, QWidget *parent, const char* name ) : WidgetLayer( config, parent, name ) |
21 | { | 21 | { |
22 | 22 | ||
23 | // initialize font attributes | 23 | // initialize font attributes |
24 | QFontMetrics fm( font() ); | 24 | QFontMetrics fm( font() ); |
25 | f_height = fm.height(); | 25 | f_height = fm.height(); |
26 | f_width = fm.maxWidth(); | 26 | f_width = fm.maxWidth(); |
27 | f_ascent = fm.ascent(); | 27 | f_ascent = fm.ascent(); |
28 | 28 | ||
29 | // give reasonable defaults to m_columns, m_lines | ||
30 | calcGeometry(); | ||
31 | |||
29 | // initialize scrollbar related vars | 32 | // initialize scrollbar related vars |
30 | m_scrollbar = new QScrollBar( this ); | 33 | m_scrollbar = new QScrollBar( this ); |
31 | m_scrollbar->setCursor( arrowCursor ); | 34 | m_scrollbar->setCursor( arrowCursor ); |
32 | 35 | ||
33 | // load config | 36 | // load config |
34 | reloadConfig( config ); | 37 | reloadConfig( config ); |
35 | 38 | ||
36 | m_resizing = false; | 39 | m_resizing = false; |
37 | } | 40 | } |
38 | 41 | ||
39 | void EmulationWidget::reloadConfig( const Profile& config ) | 42 | void EmulationWidget::reloadConfig( const Profile& config ) |
40 | { | 43 | { |
41 | 44 | ||
42 | // nothing yet | 45 | // nothing yet |
43 | } | 46 | } |
44 | 47 | ||
45 | EmulationWidget::~EmulationWidget() | 48 | EmulationWidget::~EmulationWidget() |
46 | { | 49 | { |
47 | //clean up | 50 | //clean up |
48 | } | 51 | } |
49 | 52 | ||
50 | static QChar vt100extended(QChar c) | 53 | static QChar vt100extended(QChar c) |
51 | { | 54 | { |
52 | switch (c.unicode()) | 55 | switch (c.unicode()) |
diff --git a/noncore/apps/opie-console/widget_layer.h b/noncore/apps/opie-console/widget_layer.h index bc8fe36..067f3da 100644 --- a/noncore/apps/opie-console/widget_layer.h +++ b/noncore/apps/opie-console/widget_layer.h | |||
@@ -5,48 +5,50 @@ | |||
5 | /* -------------------------------------------------------------------------- */ | 5 | /* -------------------------------------------------------------------------- */ |
6 | 6 | ||
7 | // proposal of a widget Layer in opie-console | 7 | // proposal of a widget Layer in opie-console |
8 | // | 8 | // |
9 | // fellow devels: | 9 | // fellow devels: |
10 | // just mail me (ibotty@web.de), what you additionally need from the main widget | 10 | // just mail me (ibotty@web.de), what you additionally need from the main widget |
11 | // (or say in chat) | 11 | // (or say in chat) |
12 | 12 | ||
13 | #ifndef WIDGET_LAYER_H | 13 | #ifndef WIDGET_LAYER_H |
14 | #define WIDGET_LAYER_H | 14 | #define WIDGET_LAYER_H |
15 | 15 | ||
16 | // qt includes | 16 | // qt includes |
17 | #include <qapplication.h> | 17 | #include <qapplication.h> |
18 | #include <qframe.h> | 18 | #include <qframe.h> |
19 | #include <qarray.h> | 19 | #include <qarray.h> |
20 | #include <qtimer.h> | 20 | #include <qtimer.h> |
21 | #include <qkeycode.h> | 21 | #include <qkeycode.h> |
22 | #include <qclipboard.h> | 22 | #include <qclipboard.h> |
23 | 23 | ||
24 | 24 | ||
25 | // opie-console includes | 25 | // opie-console includes |
26 | #include "session.h" | 26 | #include "session.h" |
27 | #include "common.h" | 27 | #include "common.h" |
28 | #include "profile.h" | 28 | #include "profile.h" |
29 | |||
30 | |||
29 | /* | 31 | /* |
30 | * given a pseudo location ( column, line ), | 32 | * given a pseudo location ( column, line ), |
31 | * returns the actual index, in the QArray<Character> | 33 | * returns the actual index, in the QArray<Character> |
32 | */ | 34 | */ |
33 | #define loc(X,Y) ((Y)*m_columns+(X)) | 35 | #define loc(X,Y) ((Y)*m_columns+(X)) |
34 | 36 | ||
35 | 37 | ||
36 | 38 | ||
37 | extern unsigned short vt100_graphics[32]; | 39 | extern unsigned short vt100_graphics[32]; |
38 | 40 | ||
39 | class WidgetLayer : public QFrame | 41 | class WidgetLayer : public QFrame |
40 | { Q_OBJECT | 42 | { Q_OBJECT |
41 | 43 | ||
42 | public: | 44 | public: |
43 | 45 | ||
44 | /** | 46 | /** |
45 | * constructor | 47 | * constructor |
46 | * @param const Profile &config, the configuration for this widget | 48 | * @param const Profile &config, the configuration for this widget |
47 | * @param QWidget *parent, the parent widget | 49 | * @param QWidget *parent, the parent widget |
48 | * @param const char *name, the name of the widget, defaults to "" | 50 | * @param const char *name, the name of the widget, defaults to "" |
49 | */ | 51 | */ |
50 | WidgetLayer( const Profile& config, QWidget *parent=0, const char *name=0 ); | 52 | WidgetLayer( const Profile& config, QWidget *parent=0, const char *name=0 ); |
51 | 53 | ||
52 | /** | 54 | /** |