author | chicken <chicken> | 2004-03-01 16:53:58 (UTC) |
---|---|---|
committer | chicken <chicken> | 2004-03-01 16:53:58 (UTC) |
commit | 8de0eea414192d758746a5f3950b9765e9709bf9 (patch) (unidiff) | |
tree | 75f7c619ba161f395c058691af152226992d20a7 | |
parent | 49615014f281a58bd9bde5543692ffddab052755 (diff) | |
download | opie-8de0eea414192d758746a5f3950b9765e9709bf9.zip opie-8de0eea414192d758746a5f3950b9765e9709bf9.tar.gz opie-8de0eea414192d758746a5f3950b9765e9709bf9.tar.bz2 |
fix includes
-rw-r--r-- | core/apps/embeddedkonsole/MyPty.cpp | 1 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/TEWidget.cpp | 9 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/TEmuVt102.cpp | 5 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/TEmulation.cpp | 3 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/commandeditdialog.cpp | 8 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/commandeditwidget.cpp | 4 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/keytrans.cpp | 3 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/konsole.cpp | 21 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/playlistselection.cpp | 7 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/session.cpp | 1 | ||||
-rw-r--r-- | core/apps/helpbrowser/helpbrowser.cpp | 24 | ||||
-rw-r--r-- | core/apps/helpbrowser/magictextbrowser.cpp | 2 | ||||
-rw-r--r-- | core/apps/oapp/oappplugin.cpp | 3 | ||||
-rw-r--r-- | core/apps/qcop/main.cpp | 2 | ||||
-rw-r--r-- | core/apps/taboapp/main.cpp | 1 | ||||
-rw-r--r-- | core/apps/textedit/filePermissions.cpp | 4 | ||||
-rw-r--r-- | core/apps/textedit/textedit.cpp | 18 |
17 files changed, 2 insertions, 114 deletions
diff --git a/core/apps/embeddedkonsole/MyPty.cpp b/core/apps/embeddedkonsole/MyPty.cpp index 5a8519a..d05e31e 100644 --- a/core/apps/embeddedkonsole/MyPty.cpp +++ b/core/apps/embeddedkonsole/MyPty.cpp | |||
@@ -22,97 +22,96 @@ | |||
22 | 22 | ||
23 | /*! \file | 23 | /*! \file |
24 | */ | 24 | */ |
25 | 25 | ||
26 | /*! \class TEPty | 26 | /*! \class TEPty |
27 | 27 | ||
28 | \brief Ptys provide a pseudo terminal connection to a program. | 28 | \brief Ptys provide a pseudo terminal connection to a program. |
29 | 29 | ||
30 | Although closely related to pipes, these pseudo terminal connections have | 30 | Although closely related to pipes, these pseudo terminal connections have |
31 | some ability, that makes it nessesary to uses them. Most importent, they | 31 | some ability, that makes it nessesary to uses them. Most importent, they |
32 | know about changing screen sizes and UNIX job control. | 32 | know about changing screen sizes and UNIX job control. |
33 | 33 | ||
34 | Within the terminal emulation framework, this class represents the | 34 | Within the terminal emulation framework, this class represents the |
35 | host side of the terminal together with the connecting serial line. | 35 | host side of the terminal together with the connecting serial line. |
36 | 36 | ||
37 | One can create many instances of this class within a program. | 37 | One can create many instances of this class within a program. |
38 | As a side effect of using this class, a signal(2) handler is | 38 | As a side effect of using this class, a signal(2) handler is |
39 | installed on SIGCHLD. | 39 | installed on SIGCHLD. |
40 | 40 | ||
41 | \par FIXME | 41 | \par FIXME |
42 | 42 | ||
43 | [NOTE: much of the technical stuff below will be replaced by forkpty.] | 43 | [NOTE: much of the technical stuff below will be replaced by forkpty.] |
44 | 44 | ||
45 | publish the SIGCHLD signal if not related to an instance. | 45 | publish the SIGCHLD signal if not related to an instance. |
46 | 46 | ||
47 | clearify TEPty::done vs. TEPty::~TEPty semantics. | 47 | clearify TEPty::done vs. TEPty::~TEPty semantics. |
48 | check if pty is restartable via run after done. | 48 | check if pty is restartable via run after done. |
49 | 49 | ||
50 | \par Pseudo terminals | 50 | \par Pseudo terminals |
51 | 51 | ||
52 | Pseudo terminals are a unique feature of UNIX, and always come in form of | 52 | Pseudo terminals are a unique feature of UNIX, and always come in form of |
53 | pairs of devices (/dev/ptyXX and /dev/ttyXX), which are connected to each | 53 | pairs of devices (/dev/ptyXX and /dev/ttyXX), which are connected to each |
54 | other by the operating system. One may think of them as two serial devices | 54 | other by the operating system. One may think of them as two serial devices |
55 | linked by a null-modem cable. Being based on devices the number of | 55 | linked by a null-modem cable. Being based on devices the number of |
56 | simultanous instances of this class is (globally) limited by the number of | 56 | simultanous instances of this class is (globally) limited by the number of |
57 | those device pairs, which is 256. | 57 | those device pairs, which is 256. |
58 | 58 | ||
59 | Another technic are UNIX 98 PTY's. These are supported also, and prefered | 59 | Another technic are UNIX 98 PTY's. These are supported also, and prefered |
60 | over the (obsolete) predecessor. | 60 | over the (obsolete) predecessor. |
61 | 61 | ||
62 | There's a sinister ioctl(2), signal(2) and job control stuff | 62 | There's a sinister ioctl(2), signal(2) and job control stuff |
63 | nessesary to make everything work as it should. | 63 | nessesary to make everything work as it should. |
64 | */ | 64 | */ |
65 | 65 | ||
66 | 66 | ||
67 | #include <qfileinfo.h> | 67 | #include <qfileinfo.h> |
68 | #include <qapplication.h> | 68 | #include <qapplication.h> |
69 | #include <qsocketnotifier.h> | 69 | #include <qsocketnotifier.h> |
70 | #include <qstring.h> | ||
71 | 70 | ||
72 | #include <stdlib.h> | 71 | #include <stdlib.h> |
73 | #include <stdio.h> | 72 | #include <stdio.h> |
74 | #include <signal.h> | 73 | #include <signal.h> |
75 | #include <fcntl.h> | 74 | #include <fcntl.h> |
76 | #include <unistd.h> | 75 | #include <unistd.h> |
77 | #include <termios.h> | 76 | #include <termios.h> |
78 | #include <sys/types.h> | 77 | #include <sys/types.h> |
79 | #include <sys/ioctl.h> | 78 | #include <sys/ioctl.h> |
80 | #include <sys/wait.h> | 79 | #include <sys/wait.h> |
81 | 80 | ||
82 | #ifdef HAVE_OPENPTY | 81 | #ifdef HAVE_OPENPTY |
83 | #include <pty.h> | 82 | #include <pty.h> |
84 | #endif | 83 | #endif |
85 | 84 | ||
86 | #include "MyPty.h" | 85 | #include "MyPty.h" |
87 | 86 | ||
88 | 87 | ||
89 | #undef VERBOSE_DEBUG | 88 | #undef VERBOSE_DEBUG |
90 | 89 | ||
91 | 90 | ||
92 | /* -------------------------------------------------------------------------- */ | 91 | /* -------------------------------------------------------------------------- */ |
93 | 92 | ||
94 | /*! | 93 | /*! |
95 | Informs the client program about the | 94 | Informs the client program about the |
96 | actual size of the window. | 95 | actual size of the window. |
97 | */ | 96 | */ |
98 | 97 | ||
99 | void MyPty::setSize(int lines, int columns) | 98 | void MyPty::setSize(int lines, int columns) |
100 | { | 99 | { |
101 | struct winsize wsize; | 100 | struct winsize wsize; |
102 | wsize.ws_row = (unsigned short)lines; | 101 | wsize.ws_row = (unsigned short)lines; |
103 | wsize.ws_col = (unsigned short)columns; | 102 | wsize.ws_col = (unsigned short)columns; |
104 | if(fd < 0) return; | 103 | if(fd < 0) return; |
105 | ioctl(fd,TIOCSWINSZ,(char *)&wsize); | 104 | ioctl(fd,TIOCSWINSZ,(char *)&wsize); |
106 | } | 105 | } |
107 | 106 | ||
108 | 107 | ||
109 | void MyPty::donePty() | 108 | void MyPty::donePty() |
110 | { | 109 | { |
111 | // This is code from the Qt DumbTerminal example | 110 | // This is code from the Qt DumbTerminal example |
112 | int status = 0; | 111 | int status = 0; |
113 | 112 | ||
114 | ::close(fd); | 113 | ::close(fd); |
115 | 114 | ||
116 | if (cpid) { | 115 | if (cpid) { |
117 | kill(cpid, SIGHUP); | 116 | kill(cpid, SIGHUP); |
118 | waitpid(cpid, &status, 0); | 117 | waitpid(cpid, &status, 0); |
diff --git a/core/apps/embeddedkonsole/TEWidget.cpp b/core/apps/embeddedkonsole/TEWidget.cpp index de5e585..8206e4b 100644 --- a/core/apps/embeddedkonsole/TEWidget.cpp +++ b/core/apps/embeddedkonsole/TEWidget.cpp | |||
@@ -7,111 +7,102 @@ | |||
7 | /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ | 7 | /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ |
8 | /* */ | 8 | /* */ |
9 | /* This file is part of Konsole - an X terminal for KDE */ | 9 | /* This file is part of Konsole - an X terminal for KDE */ |
10 | /* */ | 10 | /* */ |
11 | /* ------------------------------------------------------------------------ */ | 11 | /* ------------------------------------------------------------------------ */ |
12 | /* */ | 12 | /* */ |
13 | /* Ported Konsole to Qt/Embedded */ | 13 | /* Ported Konsole to Qt/Embedded */ |
14 | /* */ | 14 | /* */ |
15 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ | 15 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ |
16 | /* */ | 16 | /* */ |
17 | /* -------------------------------------------------------------------------- */ | 17 | /* -------------------------------------------------------------------------- */ |
18 | /*! \class TEWidget | 18 | /*! \class TEWidget |
19 | 19 | ||
20 | \brief Visible screen contents | 20 | \brief Visible screen contents |
21 | 21 | ||
22 | This class is responsible to map the `image' of a terminal emulation to the | 22 | This class is responsible to map the `image' of a terminal emulation to the |
23 | display. All the dependency of the emulation to a specific GUI or toolkit is | 23 | display. All the dependency of the emulation to a specific GUI or toolkit is |
24 | localized here. Further, this widget has no knowledge about being part of an | 24 | localized here. Further, this widget has no knowledge about being part of an |
25 | emulation, it simply work within the terminal emulation framework by exposing | 25 | emulation, it simply work within the terminal emulation framework by exposing |
26 | size and key events and by being ordered to show a new image. | 26 | size and key events and by being ordered to show a new image. |
27 | 27 | ||
28 | <ul> | 28 | <ul> |
29 | <li> The internal image has the size of the widget (evtl. rounded up) | 29 | <li> The internal image has the size of the widget (evtl. rounded up) |
30 | <li> The external image used in setImage can have any size. | 30 | <li> The external image used in setImage can have any size. |
31 | <li> (internally) the external image is simply copied to the internal | 31 | <li> (internally) the external image is simply copied to the internal |
32 | when a setImage happens. During a resizeEvent no painting is done | 32 | when a setImage happens. During a resizeEvent no painting is done |
33 | a paintEvent is expected to follow anyway. | 33 | a paintEvent is expected to follow anyway. |
34 | </ul> | 34 | </ul> |
35 | 35 | ||
36 | \sa TEScreen \sa Emulation | 36 | \sa TEScreen \sa Emulation |
37 | */ | 37 | */ |
38 | 38 | ||
39 | /* FIXME: | 39 | /* FIXME: |
40 | - 'image' may also be used uninitialized (it isn't in fact) in resizeEvent | 40 | - 'image' may also be used uninitialized (it isn't in fact) in resizeEvent |
41 | - 'font_a' not used in mouse events | 41 | - 'font_a' not used in mouse events |
42 | - add destructor | 42 | - add destructor |
43 | */ | 43 | */ |
44 | 44 | ||
45 | /* TODO | 45 | /* TODO |
46 | - evtl. be sensitive to `paletteChange' while using default colors. | 46 | - evtl. be sensitive to `paletteChange' while using default colors. |
47 | - set different 'rounding' styles? I.e. have a mode to show clipped chars? | 47 | - set different 'rounding' styles? I.e. have a mode to show clipped chars? |
48 | */ | 48 | */ |
49 | 49 | ||
50 | // #include "config.h" | 50 | // #include "config.h" |
51 | #include "TEWidget.h" | 51 | #include "TEWidget.h" |
52 | #include "session.h" | 52 | #include "session.h" |
53 | #include <qpe/config.h> | 53 | #include <qpe/config.h> |
54 | 54 | ||
55 | #include <qpe/resource.h> | ||
56 | #include <qpe/sound.h> | ||
57 | 55 | ||
58 | #if !(QT_NO_COP) | 56 | #if !(QT_NO_COP) |
59 | #include <qpe/qcopenvelope_qws.h> | 57 | #include <qpe/qcopenvelope_qws.h> |
60 | #endif | 58 | #endif |
61 | 59 | ||
62 | #include <qcursor.h> | ||
63 | #include <qregexp.h> | ||
64 | #include <qpainter.h> | ||
65 | #include <qclipboard.h> | 60 | #include <qclipboard.h> |
66 | #include <qstyle.h> | ||
67 | #include <qfile.h> | ||
68 | #include <qdragobject.h> | ||
69 | #include <qnamespace.h> | ||
70 | 61 | ||
71 | #include <stdio.h> | 62 | #include <stdio.h> |
72 | #include <stdlib.h> | 63 | #include <stdlib.h> |
73 | #include <unistd.h> | 64 | #include <unistd.h> |
74 | #include <ctype.h> | 65 | #include <ctype.h> |
75 | #include <sys/stat.h> | 66 | #include <sys/stat.h> |
76 | #include <sys/types.h> | 67 | #include <sys/types.h> |
77 | #include <signal.h> | 68 | #include <signal.h> |
78 | 69 | ||
79 | #include <assert.h> | 70 | #include <assert.h> |
80 | 71 | ||
81 | // #include "TEWidget.moc" | 72 | // #include "TEWidget.moc" |
82 | //#include <kapp.h> | 73 | //#include <kapp.h> |
83 | //#include <kcursor.h> | 74 | //#include <kcursor.h> |
84 | //#include <kurl.h> | 75 | //#include <kurl.h> |
85 | //#include <kdebug.h> | 76 | //#include <kdebug.h> |
86 | //#include <klocale.h> | 77 | //#include <klocale.h> |
87 | 78 | ||
88 | #define HERE printf("%s(%d): %s\n",__FILE__,__LINE__,__FUNCTION__) | 79 | #define HERE printf("%s(%d): %s\n",__FILE__,__LINE__,__FUNCTION__) |
89 | #define HCNT(Name) // { static int cnt = 1; printf("%s(%d): %s %d\n",__FILE__,__LINE__,Name,cnt++); } | 80 | #define HCNT(Name) // { static int cnt = 1; printf("%s(%d): %s %d\n",__FILE__,__LINE__,Name,cnt++); } |
90 | 81 | ||
91 | #define loc(X,Y) ((Y)*columns+(X)) | 82 | #define loc(X,Y) ((Y)*columns+(X)) |
92 | 83 | ||
93 | //FIXME: the rim should normally be 1, 0 only when running in full screen mode. | 84 | //FIXME: the rim should normally be 1, 0 only when running in full screen mode. |
94 | #define rimX 0 // left/right rim width | 85 | #define rimX 0 // left/right rim width |
95 | #define rimY 0 // top/bottom rim high | 86 | #define rimY 0 // top/bottom rim high |
96 | 87 | ||
97 | #define SCRWIDTH 16 // width of the scrollbar | 88 | #define SCRWIDTH 16 // width of the scrollbar |
98 | 89 | ||
99 | #define yMouseScroll 1 | 90 | #define yMouseScroll 1 |
100 | // scroll increment used when dragging selection at top/bottom of window. | 91 | // scroll increment used when dragging selection at top/bottom of window. |
101 | 92 | ||
102 | /* ------------------------------------------------------------------------- */ | 93 | /* ------------------------------------------------------------------------- */ |
103 | /* */ | 94 | /* */ |
104 | /* Colors */ | 95 | /* Colors */ |
105 | /* */ | 96 | /* */ |
106 | /* ------------------------------------------------------------------------- */ | 97 | /* ------------------------------------------------------------------------- */ |
107 | 98 | ||
108 | //FIXME: the default color table is in session.C now. | 99 | //FIXME: the default color table is in session.C now. |
109 | // We need a way to get rid of this one, here. | 100 | // We need a way to get rid of this one, here. |
110 | static const ColorEntry base_color_table[TABLE_COLORS] = | 101 | static const ColorEntry base_color_table[TABLE_COLORS] = |
111 | // The following are almost IBM standard color codes, with some slight | 102 | // The following are almost IBM standard color codes, with some slight |
112 | // gamma correction for the dim colors to compensate for bright X screens. | 103 | // gamma correction for the dim colors to compensate for bright X screens. |
113 | // It contains the 8 ansiterm/xterm colors in 2 intensities. | 104 | // It contains the 8 ansiterm/xterm colors in 2 intensities. |
114 | { | 105 | { |
115 | // Fixme: could add faint colors here, also. | 106 | // Fixme: could add faint colors here, also. |
116 | // normal | 107 | // normal |
117 | ColorEntry(QColor(0x00,0x00,0x00), 0, 0 ), ColorEntry( QColor(0xB2,0xB2,0xB2), 1, 0 ), // Dfore, Dback | 108 | ColorEntry(QColor(0x00,0x00,0x00), 0, 0 ), ColorEntry( QColor(0xB2,0xB2,0xB2), 1, 0 ), // Dfore, Dback |
diff --git a/core/apps/embeddedkonsole/TEmuVt102.cpp b/core/apps/embeddedkonsole/TEmuVt102.cpp index 275c18d..0d6aef5 100644 --- a/core/apps/embeddedkonsole/TEmuVt102.cpp +++ b/core/apps/embeddedkonsole/TEmuVt102.cpp | |||
@@ -1,82 +1,77 @@ | |||
1 | /* ------------------------------------------------------------------------- */ | 1 | /* ------------------------------------------------------------------------- */ |
2 | /* */ | 2 | /* */ |
3 | /* [TEmuVt102.C] VT102 Terminal Emulation */ | 3 | /* [TEmuVt102.C] VT102 Terminal Emulation */ |
4 | /* */ | 4 | /* */ |
5 | /* ------------------------------------------------------------------------- */ | 5 | /* ------------------------------------------------------------------------- */ |
6 | /* */ | 6 | /* */ |
7 | /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ | 7 | /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ |
8 | /* */ | 8 | /* */ |
9 | /* This file is part of Konsole - an X terminal for KDE */ | 9 | /* This file is part of Konsole - an X terminal for KDE */ |
10 | /* */ | 10 | /* */ |
11 | /* ------------------------------------------------------------------------- */ | 11 | /* ------------------------------------------------------------------------- */ |
12 | /* */ | 12 | /* */ |
13 | /* Ported Konsole to Qt/Embedded */ | 13 | /* Ported Konsole to Qt/Embedded */ |
14 | /* */ | 14 | /* */ |
15 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ | 15 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ |
16 | /* */ | 16 | /* */ |
17 | /* -------------------------------------------------------------------------- */ | 17 | /* -------------------------------------------------------------------------- */ |
18 | 18 | ||
19 | /*! \class TEmuVt102 | 19 | /*! \class TEmuVt102 |
20 | 20 | ||
21 | \brief Actual Emulation for Konsole | 21 | \brief Actual Emulation for Konsole |
22 | 22 | ||
23 | \sa TEWidget \sa TEScreen | 23 | \sa TEWidget \sa TEScreen |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include "TEmuVt102.h" | 26 | #include "TEmuVt102.h" |
27 | #include "TEWidget.h" | ||
28 | #include "TEScreen.h" | ||
29 | #include "keytrans.h" | ||
30 | 27 | ||
31 | #include <stdio.h> | 28 | #include <stdio.h> |
32 | #include <unistd.h> | 29 | #include <unistd.h> |
33 | #include <qkeycode.h> | ||
34 | #include <qtextcodec.h> | ||
35 | 30 | ||
36 | 31 | ||
37 | /* VT102 Terminal Emulation | 32 | /* VT102 Terminal Emulation |
38 | 33 | ||
39 | This class puts together the screens, the pty and the widget to a | 34 | This class puts together the screens, the pty and the widget to a |
40 | complete terminal emulation. Beside combining it's componentes, it | 35 | complete terminal emulation. Beside combining it's componentes, it |
41 | handles the emulations's protocol. | 36 | handles the emulations's protocol. |
42 | 37 | ||
43 | This module consists of the following sections: | 38 | This module consists of the following sections: |
44 | 39 | ||
45 | - Constructor/Destructor | 40 | - Constructor/Destructor |
46 | - Incoming Bytes Event pipeline | 41 | - Incoming Bytes Event pipeline |
47 | - Outgoing Bytes | 42 | - Outgoing Bytes |
48 | - Mouse Events | 43 | - Mouse Events |
49 | - Keyboard Events | 44 | - Keyboard Events |
50 | - Modes and Charset State | 45 | - Modes and Charset State |
51 | - Diagnostics | 46 | - Diagnostics |
52 | */ | 47 | */ |
53 | 48 | ||
54 | 49 | ||
55 | /* ------------------------------------------------------------------------- */ | 50 | /* ------------------------------------------------------------------------- */ |
56 | /* */ | 51 | /* */ |
57 | /* Constructor / Destructor */ | 52 | /* Constructor / Destructor */ |
58 | /* */ | 53 | /* */ |
59 | /* ------------------------------------------------------------------------- */ | 54 | /* ------------------------------------------------------------------------- */ |
60 | 55 | ||
61 | /* | 56 | /* |
62 | Nothing really intesting happens here. | 57 | Nothing really intesting happens here. |
63 | */ | 58 | */ |
64 | 59 | ||
65 | /*! | 60 | /*! |
66 | */ | 61 | */ |
67 | 62 | ||
68 | TEmuVt102::TEmuVt102(TEWidget* gui) : TEmulation(gui) | 63 | TEmuVt102::TEmuVt102(TEWidget* gui) : TEmulation(gui) |
69 | { | 64 | { |
70 | QObject::connect(gui,SIGNAL(mouseSignal(int,int,int)), | 65 | QObject::connect(gui,SIGNAL(mouseSignal(int,int,int)), |
71 | this,SLOT(onMouse(int,int,int))); | 66 | this,SLOT(onMouse(int,int,int))); |
72 | initTokenizer(); | 67 | initTokenizer(); |
73 | reset(); | 68 | reset(); |
74 | } | 69 | } |
75 | 70 | ||
76 | /*! | 71 | /*! |
77 | */ | 72 | */ |
78 | 73 | ||
79 | TEmuVt102::~TEmuVt102() | 74 | TEmuVt102::~TEmuVt102() |
80 | { | 75 | { |
81 | } | 76 | } |
82 | 77 | ||
diff --git a/core/apps/embeddedkonsole/TEmulation.cpp b/core/apps/embeddedkonsole/TEmulation.cpp index a539757..54f408e 100644 --- a/core/apps/embeddedkonsole/TEmulation.cpp +++ b/core/apps/embeddedkonsole/TEmulation.cpp | |||
@@ -25,102 +25,99 @@ | |||
25 | Thus this module knows mainly about decoding escapes sequences and | 25 | Thus this module knows mainly about decoding escapes sequences and |
26 | is a stateless device w.r.t. the semantics. | 26 | is a stateless device w.r.t. the semantics. |
27 | 27 | ||
28 | It is also responsible to refresh the TEWidget by certain rules. | 28 | It is also responsible to refresh the TEWidget by certain rules. |
29 | 29 | ||
30 | \sa TEWidget \sa TEScreen | 30 | \sa TEWidget \sa TEScreen |
31 | 31 | ||
32 | \par A note on refreshing | 32 | \par A note on refreshing |
33 | 33 | ||
34 | Although the modifications to the current screen image could immediately | 34 | Although the modifications to the current screen image could immediately |
35 | be propagated via `TEWidget' to the graphical surface, we have chosen | 35 | be propagated via `TEWidget' to the graphical surface, we have chosen |
36 | another way here. | 36 | another way here. |
37 | 37 | ||
38 | The reason for doing so is twofold. | 38 | The reason for doing so is twofold. |
39 | 39 | ||
40 | First, experiments show that directly displaying the operation results | 40 | First, experiments show that directly displaying the operation results |
41 | in slowing down the overall performance of emulations. Displaying | 41 | in slowing down the overall performance of emulations. Displaying |
42 | individual characters using X11 creates a lot of overhead. | 42 | individual characters using X11 creates a lot of overhead. |
43 | 43 | ||
44 | Second, by using the following refreshing method, the screen operations | 44 | Second, by using the following refreshing method, the screen operations |
45 | can be completely separated from the displaying. This greatly simplifies | 45 | can be completely separated from the displaying. This greatly simplifies |
46 | the programmer's task of coding and maintaining the screen operations, | 46 | the programmer's task of coding and maintaining the screen operations, |
47 | since one need not worry about differential modifications on the | 47 | since one need not worry about differential modifications on the |
48 | display affecting the operation of concern. | 48 | display affecting the operation of concern. |
49 | 49 | ||
50 | We use a refreshing algorithm here that has been adoped from rxvt/kvt. | 50 | We use a refreshing algorithm here that has been adoped from rxvt/kvt. |
51 | 51 | ||
52 | By this, refreshing is driven by a timer, which is (re)started whenever | 52 | By this, refreshing is driven by a timer, which is (re)started whenever |
53 | a new bunch of data to be interpreted by the emulation arives at `onRcvBlock'. | 53 | a new bunch of data to be interpreted by the emulation arives at `onRcvBlock'. |
54 | As soon as no more data arrive for `BULK_TIMEOUT' milliseconds, we trigger | 54 | As soon as no more data arrive for `BULK_TIMEOUT' milliseconds, we trigger |
55 | refresh. This rule suits both bulk display operation as done by curses as | 55 | refresh. This rule suits both bulk display operation as done by curses as |
56 | well as individual characters typed. | 56 | well as individual characters typed. |
57 | (BULK_TIMEOUT < 1000 / max characters received from keyboard per second). | 57 | (BULK_TIMEOUT < 1000 / max characters received from keyboard per second). |
58 | 58 | ||
59 | Additionally, we trigger refreshing by newlines comming in to make visual | 59 | Additionally, we trigger refreshing by newlines comming in to make visual |
60 | snapshots of lists as produced by `cat', `ls' and likely programs, thereby | 60 | snapshots of lists as produced by `cat', `ls' and likely programs, thereby |
61 | producing the illusion of a permanent and immediate display operation. | 61 | producing the illusion of a permanent and immediate display operation. |
62 | 62 | ||
63 | As a sort of catch-all needed for cases where none of the above | 63 | As a sort of catch-all needed for cases where none of the above |
64 | conditions catch, the screen refresh is also triggered by a count | 64 | conditions catch, the screen refresh is also triggered by a count |
65 | of incoming bulks (`bulk_incnt'). | 65 | of incoming bulks (`bulk_incnt'). |
66 | */ | 66 | */ |
67 | 67 | ||
68 | /* FIXME | 68 | /* FIXME |
69 | - evtl. the bulk operations could be made more transparent. | 69 | - evtl. the bulk operations could be made more transparent. |
70 | */ | 70 | */ |
71 | 71 | ||
72 | #include "TEmulation.h" | 72 | #include "TEmulation.h" |
73 | #include "TEWidget.h" | ||
74 | #include "TEScreen.h" | ||
75 | #include <stdio.h> | 73 | #include <stdio.h> |
76 | #include <stdlib.h> | 74 | #include <stdlib.h> |
77 | #include <unistd.h> | 75 | #include <unistd.h> |
78 | #include <qkeycode.h> | ||
79 | 76 | ||
80 | 77 | ||
81 | /* ------------------------------------------------------------------------- */ | 78 | /* ------------------------------------------------------------------------- */ |
82 | /* */ | 79 | /* */ |
83 | /* TEmulation */ | 80 | /* TEmulation */ |
84 | /* */ | 81 | /* */ |
85 | /* ------------------------------------------------------------------------- */ | 82 | /* ------------------------------------------------------------------------- */ |
86 | 83 | ||
87 | #define CNTL(c) ((c)-'@') | 84 | #define CNTL(c) ((c)-'@') |
88 | 85 | ||
89 | /*! | 86 | /*! |
90 | */ | 87 | */ |
91 | 88 | ||
92 | TEmulation::TEmulation(TEWidget* gui) | 89 | TEmulation::TEmulation(TEWidget* gui) |
93 | : decoder((QTextDecoder*)NULL) | 90 | : decoder((QTextDecoder*)NULL) |
94 | { | 91 | { |
95 | this->gui = gui; | 92 | this->gui = gui; |
96 | 93 | ||
97 | screen[0] = new TEScreen(gui->Lines(),gui->Columns()); | 94 | screen[0] = new TEScreen(gui->Lines(),gui->Columns()); |
98 | screen[1] = new TEScreen(gui->Lines(),gui->Columns()); | 95 | screen[1] = new TEScreen(gui->Lines(),gui->Columns()); |
99 | scr = screen[0]; | 96 | scr = screen[0]; |
100 | 97 | ||
101 | bulk_nlcnt = 0; // reset bulk newline counter | 98 | bulk_nlcnt = 0; // reset bulk newline counter |
102 | bulk_incnt = 0; // reset bulk counter | 99 | bulk_incnt = 0; // reset bulk counter |
103 | connected = FALSE; | 100 | connected = FALSE; |
104 | 101 | ||
105 | QObject::connect(&bulk_timer, SIGNAL(timeout()), this, SLOT(showBulk()) ); | 102 | QObject::connect(&bulk_timer, SIGNAL(timeout()), this, SLOT(showBulk()) ); |
106 | 103 | ||
107 | QObject::connect(gui,SIGNAL(changedImageSizeSignal(int,int)), | 104 | QObject::connect(gui,SIGNAL(changedImageSizeSignal(int,int)), |
108 | this,SLOT(onImageSizeChange(int,int))); | 105 | this,SLOT(onImageSizeChange(int,int))); |
109 | 106 | ||
110 | QObject::connect(gui,SIGNAL(changedHistoryCursor(int)), | 107 | QObject::connect(gui,SIGNAL(changedHistoryCursor(int)), |
111 | this,SLOT(onHistoryCursorChange(int))); | 108 | this,SLOT(onHistoryCursorChange(int))); |
112 | 109 | ||
113 | QObject::connect(gui,SIGNAL(changedHorzCursor(int)), | 110 | QObject::connect(gui,SIGNAL(changedHorzCursor(int)), |
114 | this,SLOT(onHorzCursorChange(int))); | 111 | this,SLOT(onHorzCursorChange(int))); |
115 | 112 | ||
116 | QObject::connect(gui,SIGNAL(keyPressedSignal(QKeyEvent*)), | 113 | QObject::connect(gui,SIGNAL(keyPressedSignal(QKeyEvent*)), |
117 | this,SLOT(onKeyPress(QKeyEvent*))); | 114 | this,SLOT(onKeyPress(QKeyEvent*))); |
118 | 115 | ||
119 | QObject::connect(gui,SIGNAL(beginSelectionSignal(const int,const int)), | 116 | QObject::connect(gui,SIGNAL(beginSelectionSignal(const int,const int)), |
120 | this,SLOT(onSelectionBegin(const int,const int)) ); | 117 | this,SLOT(onSelectionBegin(const int,const int)) ); |
121 | 118 | ||
122 | QObject::connect(gui,SIGNAL(extendSelectionSignal(const int,const int)), | 119 | QObject::connect(gui,SIGNAL(extendSelectionSignal(const int,const int)), |
123 | this,SLOT(onSelectionExtend(const int,const int)) ); | 120 | this,SLOT(onSelectionExtend(const int,const int)) ); |
124 | 121 | ||
125 | QObject::connect(gui,SIGNAL(endSelectionSignal(const BOOL)), | 122 | QObject::connect(gui,SIGNAL(endSelectionSignal(const BOOL)), |
126 | this,SLOT(setSelection(const BOOL)) ); | 123 | this,SLOT(setSelection(const BOOL)) ); |
diff --git a/core/apps/embeddedkonsole/commandeditdialog.cpp b/core/apps/embeddedkonsole/commandeditdialog.cpp index e4255f3..c0066d8 100644 --- a/core/apps/embeddedkonsole/commandeditdialog.cpp +++ b/core/apps/embeddedkonsole/commandeditdialog.cpp | |||
@@ -1,66 +1,58 @@ | |||
1 | //comandeditdialog.cpp | 1 | //comandeditdialog.cpp |
2 | 2 | ||
3 | #include "commandeditdialog.h" | 3 | #include "commandeditdialog.h" |
4 | #include "playlistselection.h" | 4 | #include "playlistselection.h" |
5 | #include <qstring.h> | ||
6 | #include <qpe/config.h> | 5 | #include <qpe/config.h> |
7 | #include <qtoolbar.h> | ||
8 | #include <qwidget.h> | ||
9 | #include <qmenubar.h> | ||
10 | #include <qpe/resource.h> | 6 | #include <qpe/resource.h> |
11 | #include <qlist.h> | ||
12 | #include <qtoolbutton.h> | 7 | #include <qtoolbutton.h> |
13 | #include <qvbox.h> | ||
14 | #include <qlistview.h> | ||
15 | #include <qlineedit.h> | 8 | #include <qlineedit.h> |
16 | #include <qheader.h> | 9 | #include <qheader.h> |
17 | #include <qlabel.h> | 10 | #include <qlabel.h> |
18 | #include <qmessagebox.h> | ||
19 | #include "smallcommandeditdialogbase.h" | 11 | #include "smallcommandeditdialogbase.h" |
20 | 12 | ||
21 | CommandEditDialog::CommandEditDialog(QWidget *parent, const char* name, WFlags fl ) | 13 | CommandEditDialog::CommandEditDialog(QWidget *parent, const char* name, WFlags fl ) |
22 | : CommandEditDialogBase(parent, name, TRUE, fl) | 14 | : CommandEditDialogBase(parent, name, TRUE, fl) |
23 | 15 | ||
24 | { | 16 | { |
25 | m_SuggestedCommandList->addColumn( tr("Command Selection") ); | 17 | m_SuggestedCommandList->addColumn( tr("Command Selection") ); |
26 | m_SuggestedCommandList->header()->hide(); | 18 | m_SuggestedCommandList->header()->hide(); |
27 | m_SuggestedCommandList->setSorting(-1,FALSE); | 19 | m_SuggestedCommandList->setSorting(-1,FALSE); |
28 | m_SuggestedCommandList->clearSelection(); | 20 | m_SuggestedCommandList->clearSelection(); |
29 | m_SuggestedCommandList->setSorting(0,TRUE); | 21 | m_SuggestedCommandList->setSorting(0,TRUE); |
30 | QListViewItem *item; | 22 | QListViewItem *item; |
31 | item = new QListViewItem( m_SuggestedCommandList,"export "); | 23 | item = new QListViewItem( m_SuggestedCommandList,"export "); |
32 | item = new QListViewItem( m_SuggestedCommandList,"ifconfig "); | 24 | item = new QListViewItem( m_SuggestedCommandList,"ifconfig "); |
33 | item = new QListViewItem( m_SuggestedCommandList,"ipkg "); | 25 | item = new QListViewItem( m_SuggestedCommandList,"ipkg "); |
34 | item = new QListViewItem( m_SuggestedCommandList,"gzip "); | 26 | item = new QListViewItem( m_SuggestedCommandList,"gzip "); |
35 | item = new QListViewItem( m_SuggestedCommandList,"gunzip "); | 27 | item = new QListViewItem( m_SuggestedCommandList,"gunzip "); |
36 | item = new QListViewItem( m_SuggestedCommandList,"chgrp "); | 28 | item = new QListViewItem( m_SuggestedCommandList,"chgrp "); |
37 | item = new QListViewItem( m_SuggestedCommandList,"chown "); | 29 | item = new QListViewItem( m_SuggestedCommandList,"chown "); |
38 | item = new QListViewItem( m_SuggestedCommandList,"date "); | 30 | item = new QListViewItem( m_SuggestedCommandList,"date "); |
39 | item = new QListViewItem( m_SuggestedCommandList,"dd "); | 31 | item = new QListViewItem( m_SuggestedCommandList,"dd "); |
40 | item = new QListViewItem( m_SuggestedCommandList,"dmesg "); | 32 | item = new QListViewItem( m_SuggestedCommandList,"dmesg "); |
41 | item = new QListViewItem( m_SuggestedCommandList,"fuser "); | 33 | item = new QListViewItem( m_SuggestedCommandList,"fuser "); |
42 | item = new QListViewItem( m_SuggestedCommandList,"hostname "); | 34 | item = new QListViewItem( m_SuggestedCommandList,"hostname "); |
43 | item = new QListViewItem( m_SuggestedCommandList,"kill "); | 35 | item = new QListViewItem( m_SuggestedCommandList,"kill "); |
44 | item = new QListViewItem( m_SuggestedCommandList,"killall "); | 36 | item = new QListViewItem( m_SuggestedCommandList,"killall "); |
45 | item = new QListViewItem( m_SuggestedCommandList,"ln "); | 37 | item = new QListViewItem( m_SuggestedCommandList,"ln "); |
46 | item = new QListViewItem( m_SuggestedCommandList,"ln -s "); | 38 | item = new QListViewItem( m_SuggestedCommandList,"ln -s "); |
47 | item = new QListViewItem( m_SuggestedCommandList,"lsmod"); | 39 | item = new QListViewItem( m_SuggestedCommandList,"lsmod"); |
48 | item = new QListViewItem( m_SuggestedCommandList,"depmod -a"); | 40 | item = new QListViewItem( m_SuggestedCommandList,"depmod -a"); |
49 | item = new QListViewItem( m_SuggestedCommandList,"modprobe "); | 41 | item = new QListViewItem( m_SuggestedCommandList,"modprobe "); |
50 | item = new QListViewItem( m_SuggestedCommandList,"mount "); | 42 | item = new QListViewItem( m_SuggestedCommandList,"mount "); |
51 | item = new QListViewItem( m_SuggestedCommandList,"more "); | 43 | item = new QListViewItem( m_SuggestedCommandList,"more "); |
52 | item = new QListViewItem( m_SuggestedCommandList,"sort "); | 44 | item = new QListViewItem( m_SuggestedCommandList,"sort "); |
53 | item = new QListViewItem( m_SuggestedCommandList,"touch "); | 45 | item = new QListViewItem( m_SuggestedCommandList,"touch "); |
54 | item = new QListViewItem( m_SuggestedCommandList,"umount "); | 46 | item = new QListViewItem( m_SuggestedCommandList,"umount "); |
55 | item = new QListViewItem( m_SuggestedCommandList,"mknod "); | 47 | item = new QListViewItem( m_SuggestedCommandList,"mknod "); |
56 | item = new QListViewItem( m_SuggestedCommandList,"netstat "); | 48 | item = new QListViewItem( m_SuggestedCommandList,"netstat "); |
57 | item = new QListViewItem( m_SuggestedCommandList,"route "); | 49 | item = new QListViewItem( m_SuggestedCommandList,"route "); |
58 | item = new QListViewItem( m_SuggestedCommandList,"cardctl eject "); | 50 | item = new QListViewItem( m_SuggestedCommandList,"cardctl eject "); |
59 | m_SuggestedCommandList->setSelected(m_SuggestedCommandList->firstChild(),TRUE); | 51 | m_SuggestedCommandList->setSelected(m_SuggestedCommandList->firstChild(),TRUE); |
60 | m_SuggestedCommandList->sort(); | 52 | m_SuggestedCommandList->sort(); |
61 | 53 | ||
62 | connect( m_SuggestedCommandList, SIGNAL( clicked( QListViewItem * ) ), m_PlayListSelection, SLOT( addToSelection( QListViewItem *) ) ); | 54 | connect( m_SuggestedCommandList, SIGNAL( clicked( QListViewItem * ) ), m_PlayListSelection, SLOT( addToSelection( QListViewItem *) ) ); |
63 | 55 | ||
64 | 56 | ||
65 | 57 | ||
66 | ToolButton1->setTextLabel("new"); | 58 | ToolButton1->setTextLabel("new"); |
diff --git a/core/apps/embeddedkonsole/commandeditwidget.cpp b/core/apps/embeddedkonsole/commandeditwidget.cpp index 6a2c482..ed8dade 100644 --- a/core/apps/embeddedkonsole/commandeditwidget.cpp +++ b/core/apps/embeddedkonsole/commandeditwidget.cpp | |||
@@ -1,64 +1,60 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (c) 2002 L. Potter <ljp@llornkcor.com> | 3 | Copyright (c) 2002 L. Potter <ljp@llornkcor.com> |
4 | =. | 4 | =. |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | 28 | ||
29 | */ | 29 | */ |
30 | #include "commandeditwidget.h" | 30 | #include "commandeditwidget.h" |
31 | 31 | ||
32 | #include <qpushbutton.h> | ||
33 | #include "playlistselection.h" | 32 | #include "playlistselection.h" |
34 | #include <qlayout.h> | 33 | #include <qlayout.h> |
35 | #include <qvariant.h> | ||
36 | #include <qtooltip.h> | ||
37 | #include <qwhatsthis.h> | ||
38 | 34 | ||
39 | /* | 35 | /* |
40 | * Constructs a Form1 which is a child of 'parent', with the | 36 | * Constructs a Form1 which is a child of 'parent', with the |
41 | * name 'name' and widget flags set to 'f' | 37 | * name 'name' and widget flags set to 'f' |
42 | */ | 38 | */ |
43 | Form1::Form1( QWidget* parent, const char* name, WFlags fl ) | 39 | Form1::Form1( QWidget* parent, const char* name, WFlags fl ) |
44 | : QWidget( parent, name, fl ) | 40 | : QWidget( parent, name, fl ) |
45 | { | 41 | { |
46 | if ( !name ) | 42 | if ( !name ) |
47 | resize( 596, 480 ); | 43 | resize( 596, 480 ); |
48 | Form1Layout = new QGridLayout( this ); | 44 | Form1Layout = new QGridLayout( this ); |
49 | Form1Layout->setSpacing( 6 ); | 45 | Form1Layout->setSpacing( 6 ); |
50 | Form1Layout->setMargin( 11 ); | 46 | Form1Layout->setMargin( 11 ); |
51 | 47 | ||
52 | MyCustomWidget1 = new PlayListSelection( this, "MyCustomWidget1" ); | 48 | MyCustomWidget1 = new PlayListSelection( this, "MyCustomWidget1" ); |
53 | 49 | ||
54 | Form1Layout->addWidget( MyCustomWidget1, 0, 0 ); | 50 | Form1Layout->addWidget( MyCustomWidget1, 0, 0 ); |
55 | } | 51 | } |
56 | 52 | ||
57 | /* | 53 | /* |
58 | * Destroys the object and frees any allocated resources | 54 | * Destroys the object and frees any allocated resources |
59 | */ | 55 | */ |
60 | Form1::~Form1() | 56 | Form1::~Form1() |
61 | { | 57 | { |
62 | // no need to delete child widgets, Qt does it all for us | 58 | // no need to delete child widgets, Qt does it all for us |
63 | } | 59 | } |
64 | 60 | ||
diff --git a/core/apps/embeddedkonsole/keytrans.cpp b/core/apps/embeddedkonsole/keytrans.cpp index d569ae0..45a7960 100644 --- a/core/apps/embeddedkonsole/keytrans.cpp +++ b/core/apps/embeddedkonsole/keytrans.cpp | |||
@@ -368,97 +368,97 @@ Loop: | |||
368 | assertSyntax(sym == SYMOpr && !strcmp(res.latin1(),":"), "':' expected") | 368 | assertSyntax(sym == SYMOpr && !strcmp(res.latin1(),":"), "':' expected") |
369 | getSymbol(); | 369 | getSymbol(); |
370 | // string or command | 370 | // string or command |
371 | assertSyntax(sym == SYMName || sym == SYMString,"Command or string expected") | 371 | assertSyntax(sym == SYMName || sym == SYMString,"Command or string expected") |
372 | int cmd = 0; | 372 | int cmd = 0; |
373 | if (sym == SYMName) | 373 | if (sym == SYMName) |
374 | { | 374 | { |
375 | assertSyntax(syms->oprsyms[res], "Unknown operator name") | 375 | assertSyntax(syms->oprsyms[res], "Unknown operator name") |
376 | cmd = (int)syms->oprsyms[res]-1; | 376 | cmd = (int)syms->oprsyms[res]-1; |
377 | //printf(": do %s(%d)",res.latin1(),(int)syms->oprsyms[res]-1); | 377 | //printf(": do %s(%d)",res.latin1(),(int)syms->oprsyms[res]-1); |
378 | } | 378 | } |
379 | if (sym == SYMString) | 379 | if (sym == SYMString) |
380 | { | 380 | { |
381 | cmd = CMD_send; | 381 | cmd = CMD_send; |
382 | //printf(": send"); | 382 | //printf(": send"); |
383 | //for (unsigned i = 0; i < res.length(); i++) | 383 | //for (unsigned i = 0; i < res.length(); i++) |
384 | //printf(" %02x(%c)",res.latin1()[i],res.latin1()[i]>=' '?res.latin1()[i]:'?'); | 384 | //printf(" %02x(%c)",res.latin1()[i],res.latin1()[i]>=' '?res.latin1()[i]:'?'); |
385 | } | 385 | } |
386 | //printf(". summary %04x,%02x,%02x,%d\n",key,mode,mask,cmd); | 386 | //printf(". summary %04x,%02x,%02x,%d\n",key,mode,mask,cmd); |
387 | KeyTrans::KeyEntry* ke = kt->addEntry(slinno,key,mode,mask,cmd,res); | 387 | KeyTrans::KeyEntry* ke = kt->addEntry(slinno,key,mode,mask,cmd,res); |
388 | if (ke) | 388 | if (ke) |
389 | { | 389 | { |
390 | fprintf(stderr,"%s(%d): keystroke already assigned in line %d.\n",path.ascii(),slinno,ke->ref); | 390 | fprintf(stderr,"%s(%d): keystroke already assigned in line %d.\n",path.ascii(),slinno,ke->ref); |
391 | } | 391 | } |
392 | getSymbol(); | 392 | getSymbol(); |
393 | assertSyntax(sym == SYMEol, "Unexpected text") | 393 | assertSyntax(sym == SYMEol, "Unexpected text") |
394 | goto Loop; | 394 | goto Loop; |
395 | } | 395 | } |
396 | if (sym == SYMEol) | 396 | if (sym == SYMEol) |
397 | { | 397 | { |
398 | getSymbol(); | 398 | getSymbol(); |
399 | goto Loop; | 399 | goto Loop; |
400 | } | 400 | } |
401 | 401 | ||
402 | assertSyntax(sym == SYMEof, "Undecodable Line") | 402 | assertSyntax(sym == SYMEof, "Undecodable Line") |
403 | 403 | ||
404 | buf->close(); | 404 | buf->close(); |
405 | return; | 405 | return; |
406 | 406 | ||
407 | ERROR: | 407 | ERROR: |
408 | while (sym != SYMEol && sym != SYMEof) getSymbol(); // eoln | 408 | while (sym != SYMEol && sym != SYMEof) getSymbol(); // eoln |
409 | goto Loop; | 409 | goto Loop; |
410 | } | 410 | } |
411 | 411 | ||
412 | 412 | ||
413 | KeyTrans* KeyTrans::defaultKeyTrans() | 413 | KeyTrans* KeyTrans::defaultKeyTrans() |
414 | { | 414 | { |
415 | QCString txt = | 415 | QCString txt = |
416 | #include "default.keytab.h" | 416 | #include "default.keytab.h" |
417 | ; | 417 | ; |
418 | QBuffer buf(txt); | 418 | QBuffer buf(txt); |
419 | return fromDevice("[buildin]",buf); | 419 | return fromDevice("[buildin]",buf); |
420 | } | 420 | } |
421 | 421 | ||
422 | KeyTrans* KeyTrans::fromFile(const char* path) | 422 | KeyTrans* KeyTrans::fromFile(const char* path) |
423 | { | 423 | { |
424 | QFile file(path); | 424 | QFile file(path); |
425 | return fromDevice(path,file); | 425 | return fromDevice(path,file); |
426 | } | 426 | } |
427 | 427 | ||
428 | // local symbol tables --------------------------------------------------------------------- | 428 | // local symbol tables --------------------------------------------------------------------- |
429 | // material needed for parsing the config file. | 429 | // material needed for parsing the config file. |
430 | // This is incomplete work. | 430 | // This is incomplete work. |
431 | 431 | ||
432 | void KeyTransSymbols::defKeySym(const char* key, int val) | 432 | void KeyTransSymbols::defKeySym(const char* key, int val) |
433 | { | 433 | { |
434 | keysyms.insert(key,(QObject*)(val+1)); | 434 | keysyms.insert(key,(QObject*)(val+1)); |
435 | } | 435 | } |
436 | 436 | ||
437 | void KeyTransSymbols::defOprSym(const char* key, int val) | 437 | void KeyTransSymbols::defOprSym(const char* key, int val) |
438 | { | 438 | { |
439 | oprsyms.insert(key,(QObject*)(val+1)); | 439 | oprsyms.insert(key,(QObject*)(val+1)); |
440 | } | 440 | } |
441 | 441 | ||
442 | void KeyTransSymbols::defModSym(const char* key, int val) | 442 | void KeyTransSymbols::defModSym(const char* key, int val) |
443 | { | 443 | { |
444 | modsyms.insert(key,(QObject*)(val+1)); | 444 | modsyms.insert(key,(QObject*)(val+1)); |
445 | } | 445 | } |
446 | 446 | ||
447 | void KeyTransSymbols::defOprSyms() | 447 | void KeyTransSymbols::defOprSyms() |
448 | { | 448 | { |
449 | // Modifier | 449 | // Modifier |
450 | defOprSym("scrollLineUp", CMD_scrollLineUp ); | 450 | defOprSym("scrollLineUp", CMD_scrollLineUp ); |
451 | defOprSym("scrollLineDown",CMD_scrollLineDown); | 451 | defOprSym("scrollLineDown",CMD_scrollLineDown); |
452 | defOprSym("scrollPageUp", CMD_scrollPageUp ); | 452 | defOprSym("scrollPageUp", CMD_scrollPageUp ); |
453 | defOprSym("scrollPageDown",CMD_scrollPageDown); | 453 | defOprSym("scrollPageDown",CMD_scrollPageDown); |
454 | defOprSym("emitSelection", CMD_emitSelection ); | 454 | defOprSym("emitSelection", CMD_emitSelection ); |
455 | defOprSym("prevSession", CMD_prevSession ); | 455 | defOprSym("prevSession", CMD_prevSession ); |
456 | defOprSym("nextSession", CMD_nextSession ); | 456 | defOprSym("nextSession", CMD_nextSession ); |
457 | } | 457 | } |
458 | 458 | ||
459 | void KeyTransSymbols::defModSyms() | 459 | void KeyTransSymbols::defModSyms() |
460 | { | 460 | { |
461 | // Modifier | 461 | // Modifier |
462 | defModSym("Shift", BITS_Shift ); | 462 | defModSym("Shift", BITS_Shift ); |
463 | defModSym("Control", BITS_Control ); | 463 | defModSym("Control", BITS_Control ); |
464 | defModSym("Alt", BITS_Alt ); | 464 | defModSym("Alt", BITS_Alt ); |
@@ -652,55 +652,54 @@ void KeyTrans::addKeyTrans() | |||
652 | void KeyTrans::loadAll() | 652 | void KeyTrans::loadAll() |
653 | { | 653 | { |
654 | if (!numb2keymap) | 654 | if (!numb2keymap) |
655 | numb2keymap = new QIntDict<KeyTrans>; | 655 | numb2keymap = new QIntDict<KeyTrans>; |
656 | if (!path2keymap) | 656 | if (!path2keymap) |
657 | path2keymap = new QDict<KeyTrans>; | 657 | path2keymap = new QDict<KeyTrans>; |
658 | if (!syms) | 658 | if (!syms) |
659 | syms = new KeyTransSymbols; | 659 | syms = new KeyTransSymbols; |
660 | 660 | ||
661 | defaultKeyTrans()->addKeyTrans(); | 661 | defaultKeyTrans()->addKeyTrans(); |
662 | 662 | ||
663 | 663 | ||
664 | QString path = QPEApplication::qpeDir() + "etc/keytabs"; | 664 | QString path = QPEApplication::qpeDir() + "etc/keytabs"; |
665 | QDir dir(path); | 665 | QDir dir(path); |
666 | QStringList lst = dir.entryList("*.keytab"); | 666 | QStringList lst = dir.entryList("*.keytab"); |
667 | 667 | ||
668 | for(QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { | 668 | for(QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { |
669 | QFile file(path + "/" + *it); | 669 | QFile file(path + "/" + *it); |
670 | KeyTrans* sc = KeyTrans::fromDevice(*it, file); | 670 | KeyTrans* sc = KeyTrans::fromDevice(*it, file); |
671 | if (sc) { | 671 | if (sc) { |
672 | sc->addKeyTrans(); | 672 | sc->addKeyTrans(); |
673 | } | 673 | } |
674 | } | 674 | } |
675 | 675 | ||
676 | } | 676 | } |
677 | 677 | ||
678 | // Debugging material ----------------------------------------------------------- | 678 | // Debugging material ----------------------------------------------------------- |
679 | /* | 679 | /* |
680 | void TestTokenizer(QBuffer &buf) | 680 | void TestTokenizer(QBuffer &buf) |
681 | { | 681 | { |
682 | // opening sequence | 682 | // opening sequence |
683 | 683 | ||
684 | buf.open(IO_ReadOnly); | 684 | buf.open(IO_ReadOnly); |
685 | cc = buf.getch(); | 685 | cc = buf.getch(); |
686 | lineno = 1; | 686 | lineno = 1; |
687 | 687 | ||
688 | // Test tokenizer | 688 | // Test tokenizer |
689 | 689 | ||
690 | while (getSymbol(buf)) ReportToken(); | 690 | while (getSymbol(buf)) ReportToken(); |
691 | 691 | ||
692 | buf.close(); | 692 | buf.close(); |
693 | } | 693 | } |
694 | 694 | ||
695 | void test() | 695 | void test() |
696 | { | 696 | { |
697 | // Opening sequence | 697 | // Opening sequence |
698 | 698 | ||
699 | QCString txt = | 699 | QCString txt = |
700 | #include "default.keytab.h" | ||
701 | ; | 700 | ; |
702 | QBuffer buf(txt); | 701 | QBuffer buf(txt); |
703 | if (0) TestTokenizer(buf); | 702 | if (0) TestTokenizer(buf); |
704 | if (1) { KeyTrans kt; kt.scanTable(buf); } | 703 | if (1) { KeyTrans kt; kt.scanTable(buf); } |
705 | } | 704 | } |
706 | */ | 705 | */ |
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp index 084c39d..281835e 100644 --- a/core/apps/embeddedkonsole/konsole.cpp +++ b/core/apps/embeddedkonsole/konsole.cpp | |||
@@ -1,118 +1,97 @@ | |||
1 | 1 | ||
2 | /* ---------------------------------------------------------------------- */ | 2 | /* ---------------------------------------------------------------------- */ |
3 | /* */ | 3 | /* */ |
4 | /* [main.C] Konsole */ | 4 | /* [main.C] Konsole */ |
5 | /* */ | 5 | /* */ |
6 | /* ---------------------------------------------------------------------- */ | 6 | /* ---------------------------------------------------------------------- */ |
7 | /* */ | 7 | /* */ |
8 | /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ | 8 | /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ |
9 | /* */ | 9 | /* */ |
10 | /* This file is part of Konsole, an X terminal. */ | 10 | /* This file is part of Konsole, an X terminal. */ |
11 | /* */ | 11 | /* */ |
12 | /* The material contained in here more or less directly orginates from */ | 12 | /* The material contained in here more or less directly orginates from */ |
13 | /* kvt, which is copyright (c) 1996 by Matthias Ettrich <ettrich@kde.org> */ | 13 | /* kvt, which is copyright (c) 1996 by Matthias Ettrich <ettrich@kde.org> */ |
14 | /* */ | 14 | /* */ |
15 | /* ---------------------------------------------------------------------- */ | 15 | /* ---------------------------------------------------------------------- */ |
16 | /* */ | 16 | /* */ |
17 | /* Ported Konsole to Qt/Embedded */ | 17 | /* Ported Konsole to Qt/Embedded */ |
18 | /* */ | 18 | /* */ |
19 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ | 19 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ |
20 | /* */ | 20 | /* */ |
21 | /* -------------------------------------------------------------------------- */ | 21 | /* -------------------------------------------------------------------------- */ |
22 | // enhancements added by L.J. Potter <ljp@llornkcor.com> | 22 | // enhancements added by L.J. Potter <ljp@llornkcor.com> |
23 | // enhancements added by Phillip Kuhn | 23 | // enhancements added by Phillip Kuhn |
24 | 24 | ||
25 | #include <stdlib.h> | 25 | #include <stdlib.h> |
26 | #include <sys/types.h> | 26 | #include <sys/types.h> |
27 | #include <pwd.h> | 27 | #include <pwd.h> |
28 | #include <unistd.h> | 28 | #include <unistd.h> |
29 | 29 | ||
30 | #ifdef QT_QWS_OPIE | 30 | #ifdef QT_QWS_OPIE |
31 | #include <opie2/ocolorpopupmenu.h> | 31 | #include <opie2/ocolorpopupmenu.h> |
32 | #endif | 32 | #endif |
33 | 33 | ||
34 | #include <qpe/resource.h> | 34 | #include <qpe/resource.h> |
35 | 35 | ||
36 | #include <qdir.h> | ||
37 | #include <qevent.h> | ||
38 | #include <qdragobject.h> | ||
39 | #include <qobjectlist.h> | ||
40 | #include <qtoolbutton.h> | ||
41 | #include <qtoolbar.h> | ||
42 | #include <qpushbutton.h> | ||
43 | #include <qfontdialog.h> | ||
44 | #include <qglobal.h> | ||
45 | #include <qpainter.h> | ||
46 | #include <qmenubar.h> | 36 | #include <qmenubar.h> |
47 | #include <qmessagebox.h> | ||
48 | #include <qaction.h> | ||
49 | #include <qapplication.h> | ||
50 | #include <qfontmetrics.h> | ||
51 | #include <qcombobox.h> | ||
52 | #include <qevent.h> | ||
53 | #include <qtabwidget.h> | ||
54 | #include <qtabbar.h> | 37 | #include <qtabbar.h> |
55 | #include <qpe/config.h> | 38 | #include <qpe/config.h> |
56 | #include <qstringlist.h> | ||
57 | #include <qpalette.h> | ||
58 | #include <qfontdatabase.h> | 39 | #include <qfontdatabase.h> |
59 | #include <qfile.h> | 40 | #include <qfile.h> |
60 | #include <qspinbox.h> | 41 | #include <qspinbox.h> |
61 | #include <qlayout.h> | 42 | #include <qlayout.h> |
62 | #include <qvbox.h> | ||
63 | 43 | ||
64 | #include <sys/wait.h> | 44 | #include <sys/wait.h> |
65 | #include <stdio.h> | 45 | #include <stdio.h> |
66 | #include <stdlib.h> | 46 | #include <stdlib.h> |
67 | #include <assert.h> | 47 | #include <assert.h> |
68 | 48 | ||
69 | #include "konsole.h" | 49 | #include "konsole.h" |
70 | #include "keytrans.h" | ||
71 | #include "commandeditdialog.h" | 50 | #include "commandeditdialog.h" |
72 | 51 | ||
73 | class EKNumTabBar : public QTabBar | 52 | class EKNumTabBar : public QTabBar |
74 | { | 53 | { |
75 | public: | 54 | public: |
76 | EKNumTabBar(QWidget *parent = 0, const char *name = 0) : | 55 | EKNumTabBar(QWidget *parent = 0, const char *name = 0) : |
77 | QTabBar(parent, name) | 56 | QTabBar(parent, name) |
78 | {} | 57 | {} |
79 | 58 | ||
80 | // QList<QTab> *getTabList() { return(tabList()); } | 59 | // QList<QTab> *getTabList() { return(tabList()); } |
81 | 60 | ||
82 | void numberTabs() | 61 | void numberTabs() |
83 | { | 62 | { |
84 | // Yes, it really is this messy. QTabWidget needs functions | 63 | // Yes, it really is this messy. QTabWidget needs functions |
85 | // that provide acces to tabs in a sequential way. | 64 | // that provide acces to tabs in a sequential way. |
86 | int m=INT_MIN; | 65 | int m=INT_MIN; |
87 | for (int i=0; i<count(); i++) | 66 | for (int i=0; i<count(); i++) |
88 | { | 67 | { |
89 | QTab* left=0; | 68 | QTab* left=0; |
90 | QListIterator<QTab> it(*tabList()); | 69 | QListIterator<QTab> it(*tabList()); |
91 | int x=INT_MAX; | 70 | int x=INT_MAX; |
92 | for( QTab* t; (t=it.current()); ++it ) | 71 | for( QTab* t; (t=it.current()); ++it ) |
93 | { | 72 | { |
94 | int tx = t->rect().x(); | 73 | int tx = t->rect().x(); |
95 | if ( tx<x && tx>m ) | 74 | if ( tx<x && tx>m ) |
96 | { | 75 | { |
97 | x = tx; | 76 | x = tx; |
98 | left = t; | 77 | left = t; |
99 | } | 78 | } |
100 | } | 79 | } |
101 | if ( left ) | 80 | if ( left ) |
102 | { | 81 | { |
103 | left->setText(QString::number(i+1)); | 82 | left->setText(QString::number(i+1)); |
104 | m = left->rect().x(); | 83 | m = left->rect().x(); |
105 | } | 84 | } |
106 | } | 85 | } |
107 | } | 86 | } |
108 | 87 | ||
109 | virtual QSize sizeHint() const | 88 | virtual QSize sizeHint() const |
110 | { | 89 | { |
111 | if (isHidden()) | 90 | if (isHidden()) |
112 | { | 91 | { |
113 | return(QSize(0,0)); | 92 | return(QSize(0,0)); |
114 | } | 93 | } |
115 | else | 94 | else |
116 | { | 95 | { |
117 | QSize size = QTabBar::sizeHint(); | 96 | QSize size = QTabBar::sizeHint(); |
118 | int shrink = 5; | 97 | int shrink = 5; |
diff --git a/core/apps/embeddedkonsole/playlistselection.cpp b/core/apps/embeddedkonsole/playlistselection.cpp index 4dd3126..fc5330f 100644 --- a/core/apps/embeddedkonsole/playlistselection.cpp +++ b/core/apps/embeddedkonsole/playlistselection.cpp | |||
@@ -1,75 +1,68 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <qpe/applnk.h> | ||
21 | #include <qpe/resource.h> | ||
22 | #include <qpainter.h> | ||
23 | #include <qimage.h> | ||
24 | #include <qheader.h> | 20 | #include <qheader.h> |
25 | #include <qlistview.h> | ||
26 | #include <qlist.h> | ||
27 | #include <qpixmap.h> | ||
28 | 21 | ||
29 | #include "playlistselection.h" | 22 | #include "playlistselection.h" |
30 | 23 | ||
31 | #include <stdlib.h> | 24 | #include <stdlib.h> |
32 | 25 | ||
33 | 26 | ||
34 | 27 | ||
35 | 28 | ||
36 | 29 | ||
37 | PlayListSelection::PlayListSelection( QWidget *parent, const char *name ) | 30 | PlayListSelection::PlayListSelection( QWidget *parent, const char *name ) |
38 | : QListView( parent, name ) | 31 | : QListView( parent, name ) |
39 | { | 32 | { |
40 | setAllColumnsShowFocus( TRUE ); | 33 | setAllColumnsShowFocus( TRUE ); |
41 | addColumn( tr( "Command Selection" ) ); | 34 | addColumn( tr( "Command Selection" ) ); |
42 | header()->hide(); | 35 | header()->hide(); |
43 | setSorting( -1, FALSE ); | 36 | setSorting( -1, FALSE ); |
44 | } | 37 | } |
45 | 38 | ||
46 | 39 | ||
47 | PlayListSelection::~PlayListSelection() { | 40 | PlayListSelection::~PlayListSelection() { |
48 | } | 41 | } |
49 | 42 | ||
50 | 43 | ||
51 | 44 | ||
52 | void PlayListSelection::contentsMouseMoveEvent( QMouseEvent *event ) { | 45 | void PlayListSelection::contentsMouseMoveEvent( QMouseEvent *event ) { |
53 | if ( event->state() == QMouseEvent::LeftButton ) { | 46 | if ( event->state() == QMouseEvent::LeftButton ) { |
54 | QListViewItem *currentItem = selectedItem(); | 47 | QListViewItem *currentItem = selectedItem(); |
55 | QListViewItem *itemUnder = itemAt( QPoint( event->pos().x(), event->pos().y() - contentsY() ) ); | 48 | QListViewItem *itemUnder = itemAt( QPoint( event->pos().x(), event->pos().y() - contentsY() ) ); |
56 | if ( currentItem && currentItem->itemAbove() == itemUnder ) | 49 | if ( currentItem && currentItem->itemAbove() == itemUnder ) |
57 | moveSelectedUp(); | 50 | moveSelectedUp(); |
58 | else if ( currentItem && currentItem->itemBelow() == itemUnder ) | 51 | else if ( currentItem && currentItem->itemBelow() == itemUnder ) |
59 | moveSelectedDown(); | 52 | moveSelectedDown(); |
60 | } | 53 | } |
61 | } | 54 | } |
62 | 55 | ||
63 | 56 | ||
64 | const QString *PlayListSelection::current() { | 57 | const QString *PlayListSelection::current() { |
65 | PlayListSelectionItem *item = (PlayListSelectionItem *)selectedItem(); | 58 | PlayListSelectionItem *item = (PlayListSelectionItem *)selectedItem(); |
66 | if ( item ) | 59 | if ( item ) |
67 | return item->file(); | 60 | return item->file(); |
68 | return NULL; | 61 | return NULL; |
69 | } | 62 | } |
70 | 63 | ||
71 | 64 | ||
72 | void PlayListSelection::addToSelection( QListViewItem *lnk ) { | 65 | void PlayListSelection::addToSelection( QListViewItem *lnk ) { |
73 | PlayListSelectionItem *item = new PlayListSelectionItem( this, new QString( lnk->text(0) ) ); | 66 | PlayListSelectionItem *item = new PlayListSelectionItem( this, new QString( lnk->text(0) ) ); |
74 | QListViewItem *current = selectedItem(); | 67 | QListViewItem *current = selectedItem(); |
75 | if ( current ) | 68 | if ( current ) |
diff --git a/core/apps/embeddedkonsole/session.cpp b/core/apps/embeddedkonsole/session.cpp index 17acb8c..043b8db 100644 --- a/core/apps/embeddedkonsole/session.cpp +++ b/core/apps/embeddedkonsole/session.cpp | |||
@@ -1,57 +1,56 @@ | |||
1 | /* -------------------------------------------------------------------------- */ | 1 | /* -------------------------------------------------------------------------- */ |
2 | /* */ | 2 | /* */ |
3 | /* Ported Konsole to Qt/Embedded */ | 3 | /* Ported Konsole to Qt/Embedded */ |
4 | /* */ | 4 | /* */ |
5 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ | 5 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ |
6 | /* */ | 6 | /* */ |
7 | /* -------------------------------------------------------------------------- */ | 7 | /* -------------------------------------------------------------------------- */ |
8 | #include "session.h" | 8 | #include "session.h" |
9 | #include <qpushbutton.h> | ||
10 | // #include <kdebug.h> | 9 | // #include <kdebug.h> |
11 | 10 | ||
12 | #include <stdlib.h> | 11 | #include <stdlib.h> |
13 | 12 | ||
14 | #define HERE fprintf(stderr,"%s(%d): here\n",__FILE__,__LINE__) | 13 | #define HERE fprintf(stderr,"%s(%d): here\n",__FILE__,__LINE__) |
15 | 14 | ||
16 | /*! \class TESession | 15 | /*! \class TESession |
17 | 16 | ||
18 | Sessions are combinations of TEPTy and Emulations. | 17 | Sessions are combinations of TEPTy and Emulations. |
19 | 18 | ||
20 | The stuff in here does not belong to the terminal emulation framework, | 19 | The stuff in here does not belong to the terminal emulation framework, |
21 | but to main.C. It serves it's duty by providing a single reference | 20 | but to main.C. It serves it's duty by providing a single reference |
22 | to TEPTy/Emulation pairs. In fact, it is only there to demonstrate one | 21 | to TEPTy/Emulation pairs. In fact, it is only there to demonstrate one |
23 | of the abilities of the framework - multible sessions. | 22 | of the abilities of the framework - multible sessions. |
24 | */ | 23 | */ |
25 | 24 | ||
26 | TESession::TESession(QMainWindow* main, TEWidget* _te, const char* _pgm, QStrList & _args, const char *_term) : schema_no(0), font_no(3), pgm(_pgm), args(_args) | 25 | TESession::TESession(QMainWindow* main, TEWidget* _te, const char* _pgm, QStrList & _args, const char *_term) : schema_no(0), font_no(3), pgm(_pgm), args(_args) |
27 | { | 26 | { |
28 | te = _te; | 27 | te = _te; |
29 | term = _term; | 28 | term = _term; |
30 | 29 | ||
31 | // sh = new TEPty(); | 30 | // sh = new TEPty(); |
32 | sh = new MyPty(); | 31 | sh = new MyPty(); |
33 | em = new TEmuVt102(te); | 32 | em = new TEmuVt102(te); |
34 | 33 | ||
35 | sh->setSize(te->Lines(),te->Columns()); // not absolutely nessesary | 34 | sh->setSize(te->Lines(),te->Columns()); // not absolutely nessesary |
36 | QObject::connect( sh,SIGNAL(block_in(const char*,int)), | 35 | QObject::connect( sh,SIGNAL(block_in(const char*,int)), |
37 | em,SLOT(onRcvBlock(const char*,int)) ); | 36 | em,SLOT(onRcvBlock(const char*,int)) ); |
38 | QObject::connect( em,SIGNAL(ImageSizeChanged(int,int)), | 37 | QObject::connect( em,SIGNAL(ImageSizeChanged(int,int)), |
39 | sh,SLOT(setSize(int,int))); | 38 | sh,SLOT(setSize(int,int))); |
40 | 39 | ||
41 | // 'main' should do those connects itself, somehow. | 40 | // 'main' should do those connects itself, somehow. |
42 | // These aren't KTMW's slots, but konsole's.(David) | 41 | // These aren't KTMW's slots, but konsole's.(David) |
43 | 42 | ||
44 | /* | 43 | /* |
45 | QObject::connect( em,SIGNAL(ImageSizeChanged(int,int)), | 44 | QObject::connect( em,SIGNAL(ImageSizeChanged(int,int)), |
46 | main,SLOT(notifySize(int,int))); | 45 | main,SLOT(notifySize(int,int))); |
47 | */ | 46 | */ |
48 | QObject::connect( em,SIGNAL(sndBlock(const char*,int)), | 47 | QObject::connect( em,SIGNAL(sndBlock(const char*,int)), |
49 | sh,SLOT(send_bytes(const char*,int)) ); | 48 | sh,SLOT(send_bytes(const char*,int)) ); |
50 | QObject::connect( em,SIGNAL(changeColumns(int)), | 49 | QObject::connect( em,SIGNAL(changeColumns(int)), |
51 | main,SLOT(changeColumns(int)) ); | 50 | main,SLOT(changeColumns(int)) ); |
52 | 51 | ||
53 | 52 | ||
54 | 53 | ||
55 | QObject::connect( em,SIGNAL(changeTitle(int, const QString&)), | 54 | QObject::connect( em,SIGNAL(changeTitle(int, const QString&)), |
56 | this,SLOT(changeTitle(int, const QString&)) ); | 55 | this,SLOT(changeTitle(int, const QString&)) ); |
57 | 56 | ||
diff --git a/core/apps/helpbrowser/helpbrowser.cpp b/core/apps/helpbrowser/helpbrowser.cpp index 6f84ae2..8fb0161 100644 --- a/core/apps/helpbrowser/helpbrowser.cpp +++ b/core/apps/helpbrowser/helpbrowser.cpp | |||
@@ -1,101 +1,79 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #define QTOPIA_INTERNAL_LANGLIST | 21 | #define QTOPIA_INTERNAL_LANGLIST |
22 | 22 | ||
23 | #include "helpbrowser.h" | 23 | #include "helpbrowser.h" |
24 | 24 | ||
25 | #include <qpe/qpeapplication.h> | 25 | #include <qpe/qpeapplication.h> |
26 | #include <qpe/resource.h> | 26 | #include <qpe/resource.h> |
27 | #include <qpe/mimetype.h> | 27 | |
28 | #include <qpe/applnk.h> | ||
29 | #include <qpe/global.h> | ||
30 | |||
31 | #include <qstatusbar.h> | ||
32 | #include <qdragobject.h> | ||
33 | #include <qpixmap.h> | ||
34 | #include <qpopupmenu.h> | ||
35 | #include <qmenubar.h> | 28 | #include <qmenubar.h> |
36 | #include <qtoolbar.h> | 29 | #include <qtoolbar.h> |
37 | #include <qpe/qcopenvelope_qws.h> | 30 | #include <qpe/qcopenvelope_qws.h> |
38 | #include <qtoolbutton.h> | ||
39 | #include <qiconset.h> | ||
40 | #include <qfile.h> | ||
41 | #include <qtextstream.h> | ||
42 | #include <qstylesheet.h> | ||
43 | #include <qmessagebox.h> | ||
44 | #include <qfiledialog.h> | ||
45 | #include <qevent.h> | ||
46 | #include <qlineedit.h> | ||
47 | #include <qobjectlist.h> | ||
48 | #include <qfileinfo.h> | 31 | #include <qfileinfo.h> |
49 | #include <qfile.h> | ||
50 | #include <qdatastream.h> | ||
51 | #include <qprinter.h> | ||
52 | #include <qsimplerichtext.h> | ||
53 | #include <qpaintdevicemetrics.h> | ||
54 | #include <qaction.h> | 32 | #include <qaction.h> |
55 | 33 | ||
56 | #include <cctype> | 34 | #include <cctype> |
57 | 35 | ||
58 | #include "magictextbrowser.h" | 36 | #include "magictextbrowser.h" |
59 | 37 | ||
60 | HelpBrowser::HelpBrowser( QWidget* parent, const char *name, WFlags f ) | 38 | HelpBrowser::HelpBrowser( QWidget* parent, const char *name, WFlags f ) |
61 | : QMainWindow( parent, name, f ), | 39 | : QMainWindow( parent, name, f ), |
62 | selectedURL() | 40 | selectedURL() |
63 | { | 41 | { |
64 | init( "index.html" ); | 42 | init( "index.html" ); |
65 | } | 43 | } |
66 | 44 | ||
67 | 45 | ||
68 | 46 | ||
69 | void HelpBrowser::init( const QString& _home ) | 47 | void HelpBrowser::init( const QString& _home ) |
70 | { | 48 | { |
71 | setIcon( Resource::loadPixmap( "HelpBrowser" ) ); | 49 | setIcon( Resource::loadPixmap( "HelpBrowser" ) ); |
72 | setBackgroundMode( PaletteButton ); | 50 | setBackgroundMode( PaletteButton ); |
73 | 51 | ||
74 | browser = new MagicTextBrowser( this ); | 52 | browser = new MagicTextBrowser( this ); |
75 | browser->setFrameStyle( QFrame::Panel | QFrame::Sunken ); | 53 | browser->setFrameStyle( QFrame::Panel | QFrame::Sunken ); |
76 | connect( browser, SIGNAL( textChanged() ), | 54 | connect( browser, SIGNAL( textChanged() ), |
77 | this, SLOT( textChanged() ) ); | 55 | this, SLOT( textChanged() ) ); |
78 | 56 | ||
79 | setCentralWidget( browser ); | 57 | setCentralWidget( browser ); |
80 | setToolBarsMovable( FALSE ); | 58 | setToolBarsMovable( FALSE ); |
81 | 59 | ||
82 | if ( !_home.isEmpty() ) | 60 | if ( !_home.isEmpty() ) |
83 | browser->setSource( _home ); | 61 | browser->setSource( _home ); |
84 | 62 | ||
85 | QToolBar* toolbar = new QToolBar( this ); | 63 | QToolBar* toolbar = new QToolBar( this ); |
86 | toolbar->setHorizontalStretchable( TRUE ); | 64 | toolbar->setHorizontalStretchable( TRUE ); |
87 | QMenuBar *menu = new QMenuBar( toolbar ); | 65 | QMenuBar *menu = new QMenuBar( toolbar ); |
88 | 66 | ||
89 | toolbar = new QToolBar( this ); | 67 | toolbar = new QToolBar( this ); |
90 | // addToolBar( toolbar, "Toolbar"); | 68 | // addToolBar( toolbar, "Toolbar"); |
91 | 69 | ||
92 | QPopupMenu* go = new QPopupMenu( this ); | 70 | QPopupMenu* go = new QPopupMenu( this ); |
93 | backAction = new QAction( tr( "Backward" ), Resource::loadIconSet( "back" ), QString::null, 0, this, 0 ); | 71 | backAction = new QAction( tr( "Backward" ), Resource::loadIconSet( "back" ), QString::null, 0, this, 0 ); |
94 | connect( backAction, SIGNAL( activated() ), browser, SLOT( backward() ) ); | 72 | connect( backAction, SIGNAL( activated() ), browser, SLOT( backward() ) ); |
95 | connect( browser, SIGNAL( backwardAvailable( bool ) ), | 73 | connect( browser, SIGNAL( backwardAvailable( bool ) ), |
96 | backAction, SLOT( setEnabled( bool ) ) ); | 74 | backAction, SLOT( setEnabled( bool ) ) ); |
97 | backAction->addTo( go ); | 75 | backAction->addTo( go ); |
98 | backAction->addTo( toolbar ); | 76 | backAction->addTo( toolbar ); |
99 | backAction->setEnabled( FALSE ); | 77 | backAction->setEnabled( FALSE ); |
100 | 78 | ||
101 | forwardAction = new QAction( tr( "Forward" ), Resource::loadIconSet( "forward" ), QString::null, 0, this, 0 ); | 79 | forwardAction = new QAction( tr( "Forward" ), Resource::loadIconSet( "forward" ), QString::null, 0, this, 0 ); |
diff --git a/core/apps/helpbrowser/magictextbrowser.cpp b/core/apps/helpbrowser/magictextbrowser.cpp index 8ce0325..80495c9 100644 --- a/core/apps/helpbrowser/magictextbrowser.cpp +++ b/core/apps/helpbrowser/magictextbrowser.cpp | |||
@@ -1,52 +1,50 @@ | |||
1 | #include <qfile.h> | 1 | #include <qfile.h> |
2 | #include <qstring.h> | ||
3 | #include <qdragobject.h> | 2 | #include <qdragobject.h> |
4 | #include <qregexp.h> | ||
5 | 3 | ||
6 | /* need to get Global::helpPath() */ | 4 | /* need to get Global::helpPath() */ |
7 | #define QTOPIA_INTERNAL_LANGLIST | 5 | #define QTOPIA_INTERNAL_LANGLIST |
8 | 6 | ||
9 | #include <qtopia/global.h> | 7 | #include <qtopia/global.h> |
10 | #include <qtopia/mimetype.h> | 8 | #include <qtopia/mimetype.h> |
11 | #include <qtopia/applnk.h> | 9 | #include <qtopia/applnk.h> |
12 | 10 | ||
13 | #include "magictextbrowser.h" | 11 | #include "magictextbrowser.h" |
14 | 12 | ||
15 | 13 | ||
16 | 14 | ||
17 | MagicTextBrowser::MagicTextBrowser(QWidget* parent) : | 15 | MagicTextBrowser::MagicTextBrowser(QWidget* parent) : |
18 | QTextBrowser(parent){ | 16 | QTextBrowser(parent){ |
19 | } | 17 | } |
20 | 18 | ||
21 | void MagicTextBrowser::setSource( const QString& source ) { | 19 | void MagicTextBrowser::setSource( const QString& source ) { |
22 | QTextBrowser::setSource(source); | 20 | QTextBrowser::setSource(source); |
23 | if ( magicQpe(source,"applications") || magicQpe(source,"games") || magicQpe(source,"settings") || magicQpe(source, "1Pim") ) // No tr | 21 | if ( magicQpe(source,"applications") || magicQpe(source,"games") || magicQpe(source,"settings") || magicQpe(source, "1Pim") ) // No tr |
24 | return; | 22 | return; |
25 | if ( magicOpe(source, "applets") || magicOpe(source, "input") ) | 23 | if ( magicOpe(source, "applets") || magicOpe(source, "input") ) |
26 | return; | 24 | return; |
27 | // Just those are magic (for now). Could do CGI here, | 25 | // Just those are magic (for now). Could do CGI here, |
28 | // or in Qtopia's mime source factory. | 26 | // or in Qtopia's mime source factory. |
29 | } | 27 | } |
30 | 28 | ||
31 | bool MagicTextBrowser::magicQpe(const QString& source, const QString& name) { | 29 | bool MagicTextBrowser::magicQpe(const QString& source, const QString& name) { |
32 | if ( name+".html" == source || "help/"+name+".html" == source) { | 30 | if ( name+".html" == source || "help/"+name+".html" == source) { |
33 | QString fn = mimeSourceFactory()->makeAbsolute( source, context() ); | 31 | QString fn = mimeSourceFactory()->makeAbsolute( source, context() ); |
34 | const QMimeSource* m = mimeSourceFactory()->data( fn, context() ); | 32 | const QMimeSource* m = mimeSourceFactory()->data( fn, context() ); |
35 | if ( m ) { | 33 | if ( m ) { |
36 | QString txt; | 34 | QString txt; |
37 | if ( QTextDrag::decode(m,txt) ) { | 35 | if ( QTextDrag::decode(m,txt) ) { |
38 | QRegExp re("<qtopia-"+name+">.*</qtopia-"+name+">"); | 36 | QRegExp re("<qtopia-"+name+">.*</qtopia-"+name+">"); |
39 | int start,len; | 37 | int start,len; |
40 | if ( (start=re.match(txt,0,&len))>=0 ) { | 38 | if ( (start=re.match(txt,0,&len))>=0 ) { |
41 | QString generated = generateQpe(name); | 39 | QString generated = generateQpe(name); |
42 | txt.replace(start,len,generated); | 40 | txt.replace(start,len,generated); |
43 | setText(txt); | 41 | setText(txt); |
44 | return true; | 42 | return true; |
45 | } | 43 | } |
46 | } | 44 | } |
47 | } | 45 | } |
48 | } | 46 | } |
49 | return false; | 47 | return false; |
50 | } | 48 | } |
51 | bool MagicTextBrowser::magicOpe( const QString& source, const QString& name ) { | 49 | bool MagicTextBrowser::magicOpe( const QString& source, const QString& name ) { |
52 | if ( name+".html" != source && "help/"+name+".html" != source) return false; | 50 | if ( name+".html" != source && "help/"+name+".html" != source) return false; |
diff --git a/core/apps/oapp/oappplugin.cpp b/core/apps/oapp/oappplugin.cpp index 934594f..82cc59b 100644 --- a/core/apps/oapp/oappplugin.cpp +++ b/core/apps/oapp/oappplugin.cpp | |||
@@ -1,43 +1,40 @@ | |||
1 | #include "oappinterface.h" | ||
2 | #include "oappplugin.h" | 1 | #include "oappplugin.h" |
3 | #include <qlist.h> | ||
4 | #include <qwidget.h> | 2 | #include <qwidget.h> |
5 | #include <qpe/quuid.h> | ||
6 | 3 | ||
7 | OAppPlugin::OAppPlugin(OAppPos pos) | 4 | OAppPlugin::OAppPlugin(OAppPos pos) |
8 | { | 5 | { |
9 | m_position = pos; | 6 | m_position = pos; |
10 | }; | 7 | }; |
11 | 8 | ||
12 | OAppPlugin::OAppPlugin(QWidget *widget, OAppPos pos) | 9 | OAppPlugin::OAppPlugin(QWidget *widget, OAppPos pos) |
13 | { | 10 | { |
14 | m_widgets.append( widget ); | 11 | m_widgets.append( widget ); |
15 | m_position = pos; | 12 | m_position = pos; |
16 | }; | 13 | }; |
17 | 14 | ||
18 | OAppPlugin::~OAppPlugin() | 15 | OAppPlugin::~OAppPlugin() |
19 | { | 16 | { |
20 | }; | 17 | }; |
21 | 18 | ||
22 | QList<QWidget> OAppPlugin::widgets() | 19 | QList<QWidget> OAppPlugin::widgets() |
23 | { | 20 | { |
24 | return m_widgets; | 21 | return m_widgets; |
25 | }; | 22 | }; |
26 | 23 | ||
27 | OAppPos OAppPlugin::position() const | 24 | OAppPos OAppPlugin::position() const |
28 | { | 25 | { |
29 | return m_position; | 26 | return m_position; |
30 | } | 27 | } |
31 | 28 | ||
32 | QRESULT OAppPlugin::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) | 29 | QRESULT OAppPlugin::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) |
33 | { | 30 | { |
34 | *iface = 0; | 31 | *iface = 0; |
35 | if ( uuid == IID_QUnknown ) | 32 | if ( uuid == IID_QUnknown ) |
36 | *iface = this; | 33 | *iface = this; |
37 | else if ( uuid == IID_OAppInterface ) | 34 | else if ( uuid == IID_OAppInterface ) |
38 | *iface = this; | 35 | *iface = this; |
39 | 36 | ||
40 | if ( *iface ) | 37 | if ( *iface ) |
41 | (*iface)->addRef(); | 38 | (*iface)->addRef(); |
42 | return QS_OK; | 39 | return QS_OK; |
43 | } | 40 | } |
diff --git a/core/apps/qcop/main.cpp b/core/apps/qcop/main.cpp index 73db0f6..9306cbf 100644 --- a/core/apps/qcop/main.cpp +++ b/core/apps/qcop/main.cpp | |||
@@ -1,73 +1,71 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include <qpe/qcopenvelope_qws.h> | 21 | #include <qpe/qcopenvelope_qws.h> |
22 | 22 | ||
23 | #include <qapplication.h> | 23 | #include <qapplication.h> |
24 | #include <qstringlist.h> | ||
25 | #include <qdatastream.h> | ||
26 | #include <qtimer.h> | 24 | #include <qtimer.h> |
27 | 25 | ||
28 | #include <stdlib.h> | 26 | #include <stdlib.h> |
29 | #include <stdio.h> | 27 | #include <stdio.h> |
30 | 28 | ||
31 | static void usage() | 29 | static void usage() |
32 | { | 30 | { |
33 | fprintf( stderr, "Usage: qcop channel command [parameters]\n" ); | 31 | fprintf( stderr, "Usage: qcop channel command [parameters]\n" ); |
34 | } | 32 | } |
35 | 33 | ||
36 | static void syntax( const QString &where, const QString &what ) | 34 | static void syntax( const QString &where, const QString &what ) |
37 | { | 35 | { |
38 | fprintf( stderr, "Syntax error in %s: %s\n", where.latin1(), what.latin1() ); | 36 | fprintf( stderr, "Syntax error in %s: %s\n", where.latin1(), what.latin1() ); |
39 | exit(1); | 37 | exit(1); |
40 | } | 38 | } |
41 | 39 | ||
42 | int main( int argc, char *argv[] ) | 40 | int main( int argc, char *argv[] ) |
43 | { | 41 | { |
44 | QApplication app( argc, argv ); | 42 | QApplication app( argc, argv ); |
45 | 43 | ||
46 | if ( argc < 3 ) { | 44 | if ( argc < 3 ) { |
47 | usage(); | 45 | usage(); |
48 | exit(1); | 46 | exit(1); |
49 | } | 47 | } |
50 | 48 | ||
51 | QString channel = argv[1]; | 49 | QString channel = argv[1]; |
52 | QString command = argv[2]; | 50 | QString command = argv[2]; |
53 | command.stripWhiteSpace(); | 51 | command.stripWhiteSpace(); |
54 | 52 | ||
55 | int paren = command.find( "(" ); | 53 | int paren = command.find( "(" ); |
56 | if ( paren <= 0 ) | 54 | if ( paren <= 0 ) |
57 | syntax( "command", command ); | 55 | syntax( "command", command ); |
58 | 56 | ||
59 | QString params = command.mid( paren + 1 ); | 57 | QString params = command.mid( paren + 1 ); |
60 | if ( params[params.length()-1] != ')' ) | 58 | if ( params[params.length()-1] != ')' ) |
61 | syntax( "command", command ); | 59 | syntax( "command", command ); |
62 | 60 | ||
63 | params.truncate( params.length()-1 ); | 61 | params.truncate( params.length()-1 ); |
64 | QCopEnvelope env(channel.latin1(), command.latin1()); | 62 | QCopEnvelope env(channel.latin1(), command.latin1()); |
65 | 63 | ||
66 | int argIdx = 3; | 64 | int argIdx = 3; |
67 | 65 | ||
68 | QStringList paramList = QStringList::split( ",", params ); | 66 | QStringList paramList = QStringList::split( ",", params ); |
69 | QStringList::Iterator it; | 67 | QStringList::Iterator it; |
70 | for ( it = paramList.begin(); it != paramList.end(); ++it ) { | 68 | for ( it = paramList.begin(); it != paramList.end(); ++it ) { |
71 | QString arg = argv[argIdx]; | 69 | QString arg = argv[argIdx]; |
72 | if ( *it == "QString" ) { | 70 | if ( *it == "QString" ) { |
73 | env << arg; | 71 | env << arg; |
diff --git a/core/apps/taboapp/main.cpp b/core/apps/taboapp/main.cpp index 4b9451e..b2703ff 100644 --- a/core/apps/taboapp/main.cpp +++ b/core/apps/taboapp/main.cpp | |||
@@ -1,51 +1,50 @@ | |||
1 | #include <qdir.h> | 1 | #include <qdir.h> |
2 | 2 | ||
3 | #include <qpe/global.h> | ||
4 | #include <qpe/qpeapplication.h> | 3 | #include <qpe/qpeapplication.h> |
5 | #include <qpe/qlibrary.h> | 4 | #include <qpe/qlibrary.h> |
6 | #include <oappinterface.h> | 5 | #include <oappinterface.h> |
7 | #include <oappplugin.h> | 6 | #include <oappplugin.h> |
8 | 7 | ||
9 | #include <opie2/otabwidget.h> | 8 | #include <opie2/otabwidget.h> |
10 | 9 | ||
11 | int main( int argc, char **argv ) | 10 | int main( int argc, char **argv ) |
12 | { | 11 | { |
13 | QPEApplication a( argc, argv ); | 12 | QPEApplication a( argc, argv ); |
14 | 13 | ||
15 | OTabWidget *tabwidget = new OTabWidget(0, "tab widget"); | 14 | OTabWidget *tabwidget = new OTabWidget(0, "tab widget"); |
16 | 15 | ||
17 | QString path = QPEApplication::qpeDir() + "/plugins/app"; | 16 | QString path = QPEApplication::qpeDir() + "/plugins/app"; |
18 | QDir dir( path, "lib*.so" ); | 17 | QDir dir( path, "lib*.so" ); |
19 | 18 | ||
20 | QStringList list = dir.entryList(); | 19 | QStringList list = dir.entryList(); |
21 | QStringList::Iterator it; | 20 | QStringList::Iterator it; |
22 | 21 | ||
23 | QInterfacePtr<OAppInterface> iface; | 22 | QInterfacePtr<OAppInterface> iface; |
24 | for ( it = list.begin(); it != list.end(); ++it ) { | 23 | for ( it = list.begin(); it != list.end(); ++it ) { |
25 | QLibrary *lib = new QLibrary( path + "/" + *it ); | 24 | QLibrary *lib = new QLibrary( path + "/" + *it ); |
26 | 25 | ||
27 | qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); | 26 | qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); |
28 | if ( lib->queryInterface( IID_OAppInterface, (QUnknownInterface**)&iface ) == QS_OK ) { | 27 | if ( lib->queryInterface( IID_OAppInterface, (QUnknownInterface**)&iface ) == QS_OK ) { |
29 | qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() ); | 28 | qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() ); |
30 | 29 | ||
31 | QList<QWidget> list = iface->widgets(); | 30 | QList<QWidget> list = iface->widgets(); |
32 | QWidget *widget; | 31 | QWidget *widget; |
33 | for ( widget = list.first(); widget != 0; widget = list.next() ) | 32 | for ( widget = list.first(); widget != 0; widget = list.next() ) |
34 | tabwidget->addTab(widget, QString(*it), QString(*it)); | 33 | tabwidget->addTab(widget, QString(*it), QString(*it)); |
35 | 34 | ||
36 | QString lang = getenv( "LANG" ); | 35 | QString lang = getenv( "LANG" ); |
37 | if (lang.isNull()) | 36 | if (lang.isNull()) |
38 | lang = "en"; | 37 | lang = "en"; |
39 | QTranslator *trans = new QTranslator(qApp); | 38 | QTranslator *trans = new QTranslator(qApp); |
40 | QString type = (*it).left( (*it).find(".") ); | 39 | QString type = (*it).left( (*it).find(".") ); |
41 | if (type.left(3) == "lib") | 40 | if (type.left(3) == "lib") |
42 | type = type.mid(3); | 41 | type = type.mid(3); |
43 | type = type.right( type.find("lib") ); | 42 | type = type.right( type.find("lib") ); |
44 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; | 43 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; |
45 | if ( trans->load( tfn )) | 44 | if ( trans->load( tfn )) |
46 | qApp->installTranslator( trans ); | 45 | qApp->installTranslator( trans ); |
47 | else | 46 | else |
48 | delete trans; | 47 | delete trans; |
49 | } | 48 | } |
50 | } | 49 | } |
51 | 50 | ||
diff --git a/core/apps/textedit/filePermissions.cpp b/core/apps/textedit/filePermissions.cpp index f1c78a1..db353a9 100644 --- a/core/apps/textedit/filePermissions.cpp +++ b/core/apps/textedit/filePermissions.cpp | |||
@@ -1,72 +1,68 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** copyright 2002 ljp ljp@llornkcor.com | 2 | ** copyright 2002 ljp ljp@llornkcor.com |
3 | ** Created: Sat Feb 23 19:44:40 2002 L.J. Potter | 3 | ** Created: Sat Feb 23 19:44:40 2002 L.J. Potter |
4 | ** | 4 | ** |
5 | ** This file may be distributed and/or modified under the terms of the | 5 | ** This file may be distributed and/or modified under the terms of the |
6 | ** GNU General Public License version 2 as published by the Free Software | 6 | ** GNU General Public License version 2 as published by the Free Software |
7 | ** Foundation and appearing in the file LICENSE.GPL included in the | 7 | ** Foundation and appearing in the file LICENSE.GPL included in the |
8 | ** packaging of this file. | 8 | ** packaging of this file. |
9 | ** | 9 | ** |
10 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 10 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
11 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 11 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
12 | ** | 12 | ** |
13 | ****************************************************************************/ | 13 | ****************************************************************************/ |
14 | #include "filePermissions.h" | 14 | #include "filePermissions.h" |
15 | 15 | ||
16 | #include <qfile.h> | ||
17 | #include <qfileinfo.h> | 16 | #include <qfileinfo.h> |
18 | 17 | ||
19 | #include <qcheckbox.h> | 18 | #include <qcheckbox.h> |
20 | #include <qlabel.h> | 19 | #include <qlabel.h> |
21 | #include <qlineedit.h> | 20 | #include <qlineedit.h> |
22 | #include <qlayout.h> | ||
23 | #include <qvariant.h> | ||
24 | #include <qtooltip.h> | ||
25 | #include <qmessagebox.h> | 21 | #include <qmessagebox.h> |
26 | 22 | ||
27 | #include <unistd.h> | 23 | #include <unistd.h> |
28 | #include <sys/stat.h> | 24 | #include <sys/stat.h> |
29 | #include <stdlib.h> | 25 | #include <stdlib.h> |
30 | #include <sys/types.h> | 26 | #include <sys/types.h> |
31 | #include <pwd.h> | 27 | #include <pwd.h> |
32 | #include <grp.h> | 28 | #include <grp.h> |
33 | 29 | ||
34 | filePermissions::filePermissions( QWidget* parent, const char* name, bool modal, WFlags fl, const QString &fileName ) | 30 | filePermissions::filePermissions( QWidget* parent, const char* name, bool modal, WFlags fl, const QString &fileName ) |
35 | : QDialog( parent, name, modal, fl ) | 31 | : QDialog( parent, name, modal, fl ) |
36 | { | 32 | { |
37 | if ( !name ) | 33 | if ( !name ) |
38 | setName( tr("File Permissions") ); | 34 | setName( tr("File Permissions") ); |
39 | // qDebug("FilePermissions "+fileName); | 35 | // qDebug("FilePermissions "+fileName); |
40 | resize( 236, 210 ); | 36 | resize( 236, 210 ); |
41 | setMaximumSize( QSize( 236, 210 ) ); | 37 | setMaximumSize( QSize( 236, 210 ) ); |
42 | setCaption( tr( "Set File Permissions" ) ); | 38 | setCaption( tr( "Set File Permissions" ) ); |
43 | 39 | ||
44 | TextLabel1 = new QLabel( this, "TextLabel1" ); | 40 | TextLabel1 = new QLabel( this, "TextLabel1" ); |
45 | TextLabel1->setGeometry( QRect( 25, 5, 175, 20 ) ); | 41 | TextLabel1->setGeometry( QRect( 25, 5, 175, 20 ) ); |
46 | TextLabel1->setText( tr( "Set file permissions for:" ) ); | 42 | TextLabel1->setText( tr( "Set file permissions for:" ) ); |
47 | 43 | ||
48 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); | 44 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); |
49 | LineEdit1->setGeometry( QRect( 10, 25, 218, 22 ) ); | 45 | LineEdit1->setGeometry( QRect( 10, 25, 218, 22 ) ); |
50 | LineEdit1->setReadOnly(true); | 46 | LineEdit1->setReadOnly(true); |
51 | 47 | ||
52 | TextLabel4 = new QLabel( this, "TextLabel4" ); | 48 | TextLabel4 = new QLabel( this, "TextLabel4" ); |
53 | TextLabel4->setGeometry( QRect( 5, 85, 50, 15 ) ); | 49 | TextLabel4->setGeometry( QRect( 5, 85, 50, 15 ) ); |
54 | TextLabel4->setText( tr( "owner" ) ); | 50 | TextLabel4->setText( tr( "owner" ) ); |
55 | 51 | ||
56 | TextLabel4_2 = new QLabel( this, "TextLabel4_2" ); | 52 | TextLabel4_2 = new QLabel( this, "TextLabel4_2" ); |
57 | TextLabel4_2->setGeometry( QRect( 5, 105, 50, 15 ) ); | 53 | TextLabel4_2->setGeometry( QRect( 5, 105, 50, 15 ) ); |
58 | TextLabel4_2->setText( tr( "group" ) ); | 54 | TextLabel4_2->setText( tr( "group" ) ); |
59 | 55 | ||
60 | TextLabel4_3 = new QLabel( this, "TextLabel4_3" ); | 56 | TextLabel4_3 = new QLabel( this, "TextLabel4_3" ); |
61 | TextLabel4_3->setGeometry( QRect( 5, 125, 50, 15 ) ); | 57 | TextLabel4_3->setGeometry( QRect( 5, 125, 50, 15 ) ); |
62 | TextLabel4_3->setText( tr( "others" ) ); | 58 | TextLabel4_3->setText( tr( "others" ) ); |
63 | 59 | ||
64 | CheckBox1 = new QCheckBox( this, "CheckBox1" ); | 60 | CheckBox1 = new QCheckBox( this, "CheckBox1" ); |
65 | CheckBox1->setGeometry( QRect( 75, 85, 20, 16 ) ); | 61 | CheckBox1->setGeometry( QRect( 75, 85, 20, 16 ) ); |
66 | connect(CheckBox1, SIGNAL(released()),this,SLOT(ownReadCheck())); | 62 | connect(CheckBox1, SIGNAL(released()),this,SLOT(ownReadCheck())); |
67 | 63 | ||
68 | CheckBox1_2 = new QCheckBox( this, "CheckBox1_2" ); | 64 | CheckBox1_2 = new QCheckBox( this, "CheckBox1_2" ); |
69 | CheckBox1_2->setGeometry( QRect( 135, 85, 20, 16 ) ); | 65 | CheckBox1_2->setGeometry( QRect( 135, 85, 20, 16 ) ); |
70 | connect(CheckBox1_2, SIGNAL(released()),this,SLOT(ownWriteCheck())); | 66 | connect(CheckBox1_2, SIGNAL(released()),this,SLOT(ownWriteCheck())); |
71 | 67 | ||
72 | CheckBox1_3 = new QCheckBox( this, "CheckBox1_3" ); | 68 | CheckBox1_3 = new QCheckBox( this, "CheckBox1_3" ); |
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index 8e106bf..55725cc 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp | |||
@@ -1,99 +1,81 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | // textedit.cpp | 2 | // textedit.cpp |
3 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 3 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
4 | ** | 4 | ** |
5 | ** This file is part of Opie Environment. | 5 | ** This file is part of Opie Environment. |
6 | ** | 6 | ** |
7 | ** This file may be distributed and/or modified under the terms of the | 7 | ** This file may be distributed and/or modified under the terms of the |
8 | ** GNU General Public License version 2 as published by the Free Software | 8 | ** GNU General Public License version 2 as published by the Free Software |
9 | ** Foundation and appearing in the file LICENSE.GPL included in the | 9 | ** Foundation and appearing in the file LICENSE.GPL included in the |
10 | ** packaging of this file. | 10 | ** packaging of this file. |
11 | ** | 11 | ** |
12 | **********************************************************************/ | 12 | **********************************************************************/ |
13 | // changes added by L. J. Potter Sun 02-17-2002 21:31:31 | 13 | // changes added by L. J. Potter Sun 02-17-2002 21:31:31 |
14 | #include "textedit.h" | 14 | #include "textedit.h" |
15 | #include "filePermissions.h" | 15 | #include "filePermissions.h" |
16 | 16 | ||
17 | 17 | ||
18 | #include <opie2/ofileselector.h> | 18 | #include <opie2/ofileselector.h> |
19 | #include <opie2/ofiledialog.h> | 19 | #include <opie2/ofiledialog.h> |
20 | #include <opie2/ofontselector.h> | 20 | #include <opie2/ofontselector.h> |
21 | 21 | ||
22 | #include <qpe/fontdatabase.h> | ||
23 | #include <qpe/global.h> | ||
24 | #include <qpe/fileselector.h> | ||
25 | #include <qpe/applnk.h> | ||
26 | #include <qpe/resource.h> | 22 | #include <qpe/resource.h> |
27 | #include <qpe/config.h> | 23 | #include <qpe/config.h> |
28 | #include <qpe/qpeapplication.h> | 24 | #include <qpe/qpeapplication.h> |
29 | #include <qmenubar.h> | 25 | #include <qmenubar.h> |
30 | #include <qtoolbar.h> | 26 | #include <qtoolbar.h> |
31 | #include <qpe/qcopenvelope_qws.h> | ||
32 | 27 | ||
33 | #include <qpoint.h> | ||
34 | #include <qtextstream.h> | 28 | #include <qtextstream.h> |
35 | #include <qdatetime.h> | ||
36 | #include <qclipboard.h> | 29 | #include <qclipboard.h> |
37 | #include <qstringlist.h> | ||
38 | #include <qaction.h> | 30 | #include <qaction.h> |
39 | #include <qcolordialog.h> | ||
40 | #include <qfileinfo.h> | ||
41 | #include <qlineedit.h> | 31 | #include <qlineedit.h> |
42 | #include <qmessagebox.h> | 32 | #include <qmessagebox.h> |
43 | #include <qobjectlist.h> | ||
44 | #include <qpopupmenu.h> | ||
45 | #include <qspinbox.h> | ||
46 | #include <qtoolbutton.h> | ||
47 | #include <qwidgetstack.h> | ||
48 | #include <qcheckbox.h> | ||
49 | #include <qcombo.h> | ||
50 | #include <qlayout.h> | 33 | #include <qlayout.h> |
51 | #include <qapplication.h> | ||
52 | #include <qtimer.h> | 34 | #include <qtimer.h> |
53 | #include <qdir.h> | 35 | #include <qdir.h> |
54 | #include <unistd.h> | 36 | #include <unistd.h> |
55 | #include <sys/stat.h> | 37 | #include <sys/stat.h> |
56 | #include <stdlib.h> //getenv | 38 | #include <stdlib.h> //getenv |
57 | 39 | ||
58 | using Opie::OFileDialog; | 40 | using Opie::OFileDialog; |
59 | using Opie::OFileSelector; | 41 | using Opie::OFileSelector; |
60 | using Opie::OFontSelector; | 42 | using Opie::OFontSelector; |
61 | 43 | ||
62 | #if QT_VERSION < 300 | 44 | #if QT_VERSION < 300 |
63 | 45 | ||
64 | class QpeEditor : public QMultiLineEdit | 46 | class QpeEditor : public QMultiLineEdit |
65 | { | 47 | { |
66 | 48 | ||
67 | public: | 49 | public: |
68 | QpeEditor( QWidget *parent, const char * name = 0 ) | 50 | QpeEditor( QWidget *parent, const char * name = 0 ) |
69 | : QMultiLineEdit( parent, name ) { | 51 | : QMultiLineEdit( parent, name ) { |
70 | clearTableFlags(); | 52 | clearTableFlags(); |
71 | setTableFlags( Tbl_vScrollBar | Tbl_autoHScrollBar ); | 53 | setTableFlags( Tbl_vScrollBar | Tbl_autoHScrollBar ); |
72 | } | 54 | } |
73 | 55 | ||
74 | void find( const QString &txt, bool caseSensitive, | 56 | void find( const QString &txt, bool caseSensitive, |
75 | bool backwards ); | 57 | bool backwards ); |
76 | protected: | 58 | protected: |
77 | bool markIt; | 59 | bool markIt; |
78 | int line1, line2, col1, col2; | 60 | int line1, line2, col1, col2; |
79 | void mousePressEvent( QMouseEvent * ); | 61 | void mousePressEvent( QMouseEvent * ); |
80 | void mouseReleaseEvent( QMouseEvent * ); | 62 | void mouseReleaseEvent( QMouseEvent * ); |
81 | 63 | ||
82 | //public slots: | 64 | //public slots: |
83 | /* | 65 | /* |
84 | signals: | 66 | signals: |
85 | void notFound(); | 67 | void notFound(); |
86 | void searchWrapped(); | 68 | void searchWrapped(); |
87 | */ | 69 | */ |
88 | 70 | ||
89 | private: | 71 | private: |
90 | 72 | ||
91 | }; | 73 | }; |
92 | 74 | ||
93 | void QpeEditor::mousePressEvent( QMouseEvent *e ) { | 75 | void QpeEditor::mousePressEvent( QMouseEvent *e ) { |
94 | switch(e->button()) { | 76 | switch(e->button()) { |
95 | case RightButton: | 77 | case RightButton: |
96 | { //rediculous workaround for qt popup menu | 78 | { //rediculous workaround for qt popup menu |
97 | //and the hold right click mechanism | 79 | //and the hold right click mechanism |
98 | this->setSelection( line1, col1, line2, col2); | 80 | this->setSelection( line1, col1, line2, col2); |
99 | QMultiLineEdit::mousePressEvent( e ); | 81 | QMultiLineEdit::mousePressEvent( e ); |