-rw-r--r-- | noncore/tools/calc2/binary/binaryfactory.cpp | 2 | ||||
-rw-r--r-- | noncore/tools/calc2/binary/binaryfactory.h | 4 | ||||
-rw-r--r-- | noncore/tools/calc2/binary/binaryimpl.cpp | 2 | ||||
-rw-r--r-- | noncore/tools/calc2/binary/binaryimpl.h | 2 | ||||
-rw-r--r-- | noncore/tools/calc2/calc.pro | 12 | ||||
-rw-r--r-- | noncore/tools/calc2/main/main.pro | 2 | ||||
-rw-r--r-- | noncore/tools/calc2/simple/simplefactory.cpp | 2 | ||||
-rw-r--r-- | noncore/tools/calc2/simple/simplefactory.h | 4 | ||||
-rw-r--r-- | noncore/tools/calc2/simple/simpleimpl.cpp | 2 | ||||
-rw-r--r-- | noncore/tools/calc2/simple/simpleimpl.h | 4 |
10 files changed, 12 insertions, 24 deletions
diff --git a/noncore/tools/calc2/binary/binaryfactory.cpp b/noncore/tools/calc2/binary/binaryfactory.cpp index bccc9ca..2489fdd 100644 --- a/noncore/tools/calc2/binary/binaryfactory.cpp +++ b/noncore/tools/calc2/binary/binaryfactory.cpp | |||
@@ -1,51 +1,51 @@ | |||
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 | ** GNU General Public License version 2 as published by the Free Software | 9 | ** GNU General Public License version 2 as published by the Free Software |
10 | ** Foundation and appearing in the file LICENSE.GPL included in the | 10 | ** Foundation and appearing in the file LICENSE.GPL included in the |
11 | ** packaging of this file. | 11 | ** packaging of this file. |
12 | ** | 12 | ** |
13 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 13 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
14 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 14 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
15 | ** | 15 | ** |
16 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 16 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
17 | ** | 17 | ** |
18 | ** Contact info@trolltech.com if any conditions of this licensing are | 18 | ** Contact info@trolltech.com if any conditions of this licensing are |
19 | ** not clear to you. | 19 | ** not clear to you. |
20 | ** | 20 | ** |
21 | **********************************************************************/ | 21 | **********************************************************************/ |
22 | 22 | ||
23 | #include "binaryfactory.h" | 23 | #include "binaryfactory.h" |
24 | #include "binaryimpl.h" | 24 | #include "binaryimpl.h" |
25 | #include "../engine.h" | 25 | #include "engine.h" |
26 | 26 | ||
27 | QWidget *BinaryInterface::getPlugin ( Engine *e, QWidget *parent ) { | 27 | QWidget *BinaryInterface::getPlugin ( Engine *e, QWidget *parent ) { |
28 | if ( !input ) | 28 | if ( !input ) |
29 | input = new FormBinaryImpl ( e, parent ); | 29 | input = new FormBinaryImpl ( e, parent ); |
30 | return input; | 30 | return input; |
31 | } | 31 | } |
32 | 32 | ||
33 | #ifndef QT_NO_COMPONENT | 33 | #ifndef QT_NO_COMPONENT |
34 | QRESULT BinaryInterface::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) | 34 | QRESULT BinaryInterface::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) |
35 | { | 35 | { |
36 | *iface = 0; | 36 | *iface = 0; |
37 | if ( uuid == IID_QUnknown ) | 37 | if ( uuid == IID_QUnknown ) |
38 | *iface = this; | 38 | *iface = this; |
39 | else if ( uuid == IID_Calc ) | 39 | else if ( uuid == IID_Calc ) |
40 | *iface = this; | 40 | *iface = this; |
41 | 41 | ||
42 | if ( *iface ) | 42 | if ( *iface ) |
43 | (*iface)->addRef(); | 43 | (*iface)->addRef(); |
44 | return QS_OK; | 44 | return QS_OK; |
45 | } | 45 | } |
46 | 46 | ||
47 | Q_EXPORT_INTERFACE() | 47 | Q_EXPORT_INTERFACE() |
48 | { | 48 | { |
49 | Q_CREATE_INSTANCE( BinaryInterface ) | 49 | Q_CREATE_INSTANCE( BinaryInterface ) |
50 | } | 50 | } |
51 | #endif | 51 | #endif |
diff --git a/noncore/tools/calc2/binary/binaryfactory.h b/noncore/tools/calc2/binary/binaryfactory.h index 237a926..8bad233 100644 --- a/noncore/tools/calc2/binary/binaryfactory.h +++ b/noncore/tools/calc2/binary/binaryfactory.h | |||
@@ -1,46 +1,46 @@ | |||
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 | #ifndef BINARYIMPL_H | 21 | #ifndef BINARYIMPL_H |
22 | #define BINARYIMPL_H | 22 | #define BINARYIMPL_H |
23 | 23 | ||
24 | #include "binaryimpl.h" | 24 | #include "binaryimpl.h" |
25 | #include "../plugininterface.h" | 25 | #include "plugininterface.h" |
26 | #include "../engine.h" | 26 | #include "engine.h" |
27 | 27 | ||
28 | class BinaryInterface : public CalcInterface | 28 | class BinaryInterface : public CalcInterface |
29 | { | 29 | { |
30 | public: | 30 | public: |
31 | BinaryInterface(){input = 0;}; | 31 | BinaryInterface(){input = 0;}; |
32 | virtual ~BinaryInterface(){}; | 32 | virtual ~BinaryInterface(){}; |
33 | 33 | ||
34 | #ifndef QT_NO_COMPONENT | 34 | #ifndef QT_NO_COMPONENT |
35 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); | 35 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); |
36 | Q_REFCOUNT | 36 | Q_REFCOUNT |
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | QWidget *getPlugin( Engine *, QWidget *parent ); | 39 | QWidget *getPlugin( Engine *, QWidget *parent ); |
40 | 40 | ||
41 | private: | 41 | private: |
42 | FormBinaryImpl *input; | 42 | FormBinaryImpl *input; |
43 | ulong ref; | 43 | ulong ref; |
44 | }; | 44 | }; |
45 | 45 | ||
46 | #endif | 46 | #endif |
diff --git a/noncore/tools/calc2/binary/binaryimpl.cpp b/noncore/tools/calc2/binary/binaryimpl.cpp index ecbf232..2629d07 100644 --- a/noncore/tools/calc2/binary/binaryimpl.cpp +++ b/noncore/tools/calc2/binary/binaryimpl.cpp | |||
@@ -1,110 +1,110 @@ | |||
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 "binaryimpl.h" | 21 | #include "binaryimpl.h" |
22 | #include "../instruction.h" | 22 | #include "instruction.h" |
23 | 23 | ||
24 | class iXOR : public Instruction { | 24 | class iXOR : public Instruction { |
25 | public: | 25 | public: |
26 | iXOR():Instruction(){}; | 26 | iXOR():Instruction(){}; |
27 | ~iXOR(){}; | 27 | ~iXOR(){}; |
28 | Data eval(Data num) { | 28 | Data eval(Data num) { |
29 | Data result; | 29 | Data result; |
30 | result.i = num.i ^ acc.i; | 30 | result.i = num.i ^ acc.i; |
31 | return result; | 31 | return result; |
32 | }; | 32 | }; |
33 | }; | 33 | }; |
34 | class iAND : public Instruction { | 34 | class iAND : public Instruction { |
35 | public: | 35 | public: |
36 | iAND():Instruction(){}; | 36 | iAND():Instruction(){}; |
37 | ~iAND(){}; | 37 | ~iAND(){}; |
38 | Data eval(Data num) { | 38 | Data eval(Data num) { |
39 | Data result; | 39 | Data result; |
40 | result.i = num.i & acc.i; | 40 | result.i = num.i & acc.i; |
41 | return result; | 41 | return result; |
42 | }; | 42 | }; |
43 | }; | 43 | }; |
44 | class iNOT : public Instruction { | 44 | class iNOT : public Instruction { |
45 | public: | 45 | public: |
46 | iNOT():Instruction(){}; | 46 | iNOT():Instruction(){}; |
47 | ~iNOT(){}; | 47 | ~iNOT(){}; |
48 | Data eval(Data num) { | 48 | Data eval(Data num) { |
49 | Data result; | 49 | Data result; |
50 | result.i = ~ num.i; | 50 | result.i = ~ num.i; |
51 | return result; | 51 | return result; |
52 | }; | 52 | }; |
53 | }; | 53 | }; |
54 | class iOR : public Instruction { | 54 | class iOR : public Instruction { |
55 | public: | 55 | public: |
56 | iOR():Instruction(){}; | 56 | iOR():Instruction(){}; |
57 | ~iOR(){}; | 57 | ~iOR(){}; |
58 | Data eval(Data num) { | 58 | Data eval(Data num) { |
59 | Data result; | 59 | Data result; |
60 | result.i = num.i | acc.i; | 60 | result.i = num.i | acc.i; |
61 | return result; | 61 | return result; |
62 | }; | 62 | }; |
63 | }; | 63 | }; |
64 | class iLSH : public Instruction { | 64 | class iLSH : public Instruction { |
65 | public: | 65 | public: |
66 | iLSH():Instruction(){}; | 66 | iLSH():Instruction(){}; |
67 | ~iLSH(){}; | 67 | ~iLSH(){}; |
68 | Data eval(Data num) { | 68 | Data eval(Data num) { |
69 | Data result; | 69 | Data result; |
70 | result.i = num.i << 1; | 70 | result.i = num.i << 1; |
71 | return result; | 71 | return result; |
72 | }; | 72 | }; |
73 | }; | 73 | }; |
74 | class iRSH : public Instruction { | 74 | class iRSH : public Instruction { |
75 | public: | 75 | public: |
76 | iRSH():Instruction(){}; | 76 | iRSH():Instruction(){}; |
77 | ~iRSH(){}; | 77 | ~iRSH(){}; |
78 | Data eval(Data num) { | 78 | Data eval(Data num) { |
79 | Data result; | 79 | Data result; |
80 | result.i = num.i >> 1; | 80 | result.i = num.i >> 1; |
81 | return result; | 81 | return result; |
82 | }; | 82 | }; |
83 | }; | 83 | }; |
84 | 84 | ||
85 | void FormBinaryImpl::val0Clicked() { | 85 | void FormBinaryImpl::val0Clicked() { |
86 | engine->pushValue('0'); | 86 | engine->pushValue('0'); |
87 | } | 87 | } |
88 | 88 | ||
89 | void FormBinaryImpl::val1Clicked() { | 89 | void FormBinaryImpl::val1Clicked() { |
90 | engine->pushValue('1'); | 90 | engine->pushValue('1'); |
91 | } | 91 | } |
92 | 92 | ||
93 | void FormBinaryImpl::XORClicked() { | 93 | void FormBinaryImpl::XORClicked() { |
94 | engine->pushInstruction(new iXOR()); | 94 | engine->pushInstruction(new iXOR()); |
95 | } | 95 | } |
96 | void FormBinaryImpl::ANDClicked() { | 96 | void FormBinaryImpl::ANDClicked() { |
97 | engine->pushInstruction(new iAND()); | 97 | engine->pushInstruction(new iAND()); |
98 | } | 98 | } |
99 | void FormBinaryImpl::NOTClicked() { | 99 | void FormBinaryImpl::NOTClicked() { |
100 | engine->immediateInstruction(new iNOT()); | 100 | engine->immediateInstruction(new iNOT()); |
101 | } | 101 | } |
102 | void FormBinaryImpl::ORClicked() { | 102 | void FormBinaryImpl::ORClicked() { |
103 | engine->pushInstruction(new iOR()); | 103 | engine->pushInstruction(new iOR()); |
104 | } | 104 | } |
105 | void FormBinaryImpl::LSHClicked() { | 105 | void FormBinaryImpl::LSHClicked() { |
106 | engine->immediateInstruction(new iLSH()); | 106 | engine->immediateInstruction(new iLSH()); |
107 | } | 107 | } |
108 | void FormBinaryImpl::RSHClicked() { | 108 | void FormBinaryImpl::RSHClicked() { |
109 | engine->immediateInstruction(new iRSH()); | 109 | engine->immediateInstruction(new iRSH()); |
110 | } | 110 | } |
diff --git a/noncore/tools/calc2/binary/binaryimpl.h b/noncore/tools/calc2/binary/binaryimpl.h index 7bf123a..f36a31e 100644 --- a/noncore/tools/calc2/binary/binaryimpl.h +++ b/noncore/tools/calc2/binary/binaryimpl.h | |||
@@ -1,50 +1,50 @@ | |||
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 | #ifndef FORMBINARYINPUTIMPL | 20 | #ifndef FORMBINARYINPUTIMPL |
21 | #define FORMBINARYINPUTIMPL | 21 | #define FORMBINARYINPUTIMPL |
22 | 22 | ||
23 | #include "binary.h" | 23 | #include "binary.h" |
24 | #include "../engine.h" | 24 | #include "engine.h" |
25 | 25 | ||
26 | class FormBinaryImpl : public FormBinary { | 26 | class FormBinaryImpl : public FormBinary { |
27 | Q_OBJECT | 27 | Q_OBJECT |
28 | public: | 28 | public: |
29 | FormBinaryImpl(Engine *e,QWidget *p) : FormBinary (p,"Binary") { | 29 | FormBinaryImpl(Engine *e,QWidget *p) : FormBinary (p,"Binary") { |
30 | engine = e; | 30 | engine = e; |
31 | engine->setRepresentation(rBin); | 31 | engine->setRepresentation(rBin); |
32 | }; | 32 | }; |
33 | ~FormBinaryImpl(){}; | 33 | ~FormBinaryImpl(){}; |
34 | private: | 34 | private: |
35 | Engine *engine; | 35 | Engine *engine; |
36 | 36 | ||
37 | private slots: | 37 | private slots: |
38 | void val0Clicked(); | 38 | void val0Clicked(); |
39 | void val1Clicked(); | 39 | void val1Clicked(); |
40 | 40 | ||
41 | void XORClicked(); | 41 | void XORClicked(); |
42 | void ANDClicked(); | 42 | void ANDClicked(); |
43 | void NOTClicked(); | 43 | void NOTClicked(); |
44 | void ORClicked(); | 44 | void ORClicked(); |
45 | 45 | ||
46 | void LSHClicked(); | 46 | void LSHClicked(); |
47 | void RSHClicked(); | 47 | void RSHClicked(); |
48 | }; | 48 | }; |
49 | 49 | ||
50 | #endif | 50 | #endif |
diff --git a/noncore/tools/calc2/calc.pro b/noncore/tools/calc2/calc.pro deleted file mode 100644 index 191a4df..0000000 --- a/noncore/tools/calc2/calc.pro +++ b/dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | TEMPLATE = app | ||
2 | CONFIG += qt | ||
3 | # Input | ||
4 | HEADERS += calc.h plugininterface.h instruction.h engine.h stdinstructions.h | ||
5 | SOURCES += calc.cpp main.cpp engine.cpp | ||
6 | INCLUDEPATH += $(OPIEDIR)/include | ||
7 | DEPENDPATH += $(OPIEDIR)/include | ||
8 | LIBS += -lqpe -Wl,-export-dynamic | ||
9 | TARGET = calc | ||
10 | DESTDIR = $(OPIEDIR)/bin | ||
11 | |||
12 | include( $(OPIEDIR)/include.pro ) | ||
diff --git a/noncore/tools/calc2/main/main.pro b/noncore/tools/calc2/main/main.pro index e2eda1f..2ef993d 100644 --- a/noncore/tools/calc2/main/main.pro +++ b/noncore/tools/calc2/main/main.pro | |||
@@ -1,12 +1,12 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | CONFIG += qt | 2 | CONFIG += qt |
3 | # Input | 3 | # Input |
4 | HEADERS += calc.h plugininterface.h instruction.h engine.h stdinstructions.h | 4 | HEADERS += calc.h plugininterface.h instruction.h engine.h stdinstructions.h |
5 | SOURCES += calc.cpp main.cpp engine.cpp | 5 | SOURCES += calc.cpp main.cpp engine.cpp |
6 | INCLUDEPATH += $(OPIEDIR)/include | 6 | INCLUDEPATH += $(OPIEDIR)/include |
7 | DEPENDPATH += $(OPIEDIR)/include | 7 | DEPENDPATH += $(OPIEDIR)/include |
8 | LIBS += -lqpe -Wl,-export-dynamic | 8 | LIBS += -lqpe -Wl,-export-dynamic -lopiecore2 |
9 | TARGET = calc2 | 9 | TARGET = calc2 |
10 | DESTDIR = $(OPIEDIR)/bin | 10 | DESTDIR = $(OPIEDIR)/bin |
11 | 11 | ||
12 | include( $(OPIEDIR)/include.pro ) | 12 | include( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/tools/calc2/simple/simplefactory.cpp b/noncore/tools/calc2/simple/simplefactory.cpp index 52b090b..d594e9c 100644 --- a/noncore/tools/calc2/simple/simplefactory.cpp +++ b/noncore/tools/calc2/simple/simplefactory.cpp | |||
@@ -1,51 +1,51 @@ | |||
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 | ** GNU General Public License version 2 as published by the Free Software | 9 | ** GNU General Public License version 2 as published by the Free Software |
10 | ** Foundation and appearing in the file LICENSE.GPL included in the | 10 | ** Foundation and appearing in the file LICENSE.GPL included in the |
11 | ** packaging of this file. | 11 | ** packaging of this file. |
12 | ** | 12 | ** |
13 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 13 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
14 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 14 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
15 | ** | 15 | ** |
16 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 16 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
17 | ** | 17 | ** |
18 | ** Contact info@trolltech.com if any conditions of this licensing are | 18 | ** Contact info@trolltech.com if any conditions of this licensing are |
19 | ** not clear to you. | 19 | ** not clear to you. |
20 | ** | 20 | ** |
21 | **********************************************************************/ | 21 | **********************************************************************/ |
22 | 22 | ||
23 | #include "simplefactory.h" | 23 | #include "simplefactory.h" |
24 | #include "simpleimpl.h" | 24 | #include "simpleimpl.h" |
25 | #include "../engine.h" | 25 | #include "engine.h" |
26 | 26 | ||
27 | QWidget *SimpleInterface::getPlugin ( Engine *e, QWidget *parent ) { | 27 | QWidget *SimpleInterface::getPlugin ( Engine *e, QWidget *parent ) { |
28 | if ( !input ) | 28 | if ( !input ) |
29 | input = new FormSimpleImpl ( e, parent ); | 29 | input = new FormSimpleImpl ( e, parent ); |
30 | return input; | 30 | return input; |
31 | } | 31 | } |
32 | 32 | ||
33 | #ifndef QT_NO_COMPONENT | 33 | #ifndef QT_NO_COMPONENT |
34 | QRESULT SimpleInterface::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) | 34 | QRESULT SimpleInterface::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) |
35 | { | 35 | { |
36 | *iface = 0; | 36 | *iface = 0; |
37 | if ( uuid == IID_QUnknown ) | 37 | if ( uuid == IID_QUnknown ) |
38 | *iface = this; | 38 | *iface = this; |
39 | else if ( uuid == IID_Calc ) | 39 | else if ( uuid == IID_Calc ) |
40 | *iface = this; | 40 | *iface = this; |
41 | 41 | ||
42 | if ( *iface ) | 42 | if ( *iface ) |
43 | (*iface)->addRef(); | 43 | (*iface)->addRef(); |
44 | return QS_OK; | 44 | return QS_OK; |
45 | } | 45 | } |
46 | 46 | ||
47 | Q_EXPORT_INTERFACE() | 47 | Q_EXPORT_INTERFACE() |
48 | { | 48 | { |
49 | Q_CREATE_INSTANCE( SimpleInterface ) | 49 | Q_CREATE_INSTANCE( SimpleInterface ) |
50 | } | 50 | } |
51 | #endif | 51 | #endif |
diff --git a/noncore/tools/calc2/simple/simplefactory.h b/noncore/tools/calc2/simple/simplefactory.h index 460c2b9..0487158 100644 --- a/noncore/tools/calc2/simple/simplefactory.h +++ b/noncore/tools/calc2/simple/simplefactory.h | |||
@@ -1,46 +1,46 @@ | |||
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 | #ifndef BINARYIMPL_H | 21 | #ifndef BINARYIMPL_H |
22 | #define BINARYIMPL_H | 22 | #define BINARYIMPL_H |
23 | 23 | ||
24 | #include "simpleimpl.h" | 24 | #include "simpleimpl.h" |
25 | #include "../plugininterface.h" | 25 | #include "plugininterface.h" |
26 | #include "../engine.h" | 26 | #include "engine.h" |
27 | 27 | ||
28 | class SimpleInterface : public CalcInterface | 28 | class SimpleInterface : public CalcInterface |
29 | { | 29 | { |
30 | public: | 30 | public: |
31 | SimpleInterface(){input = 0;}; | 31 | SimpleInterface(){input = 0;}; |
32 | virtual ~SimpleInterface(){}; | 32 | virtual ~SimpleInterface(){}; |
33 | 33 | ||
34 | #ifndef QT_NO_COMPONENT | 34 | #ifndef QT_NO_COMPONENT |
35 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); | 35 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); |
36 | Q_REFCOUNT | 36 | Q_REFCOUNT |
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | QWidget *getPlugin( Engine *, QWidget *parent ); | 39 | QWidget *getPlugin( Engine *, QWidget *parent ); |
40 | 40 | ||
41 | private: | 41 | private: |
42 | FormSimpleImpl *input; | 42 | FormSimpleImpl *input; |
43 | ulong ref; | 43 | ulong ref; |
44 | }; | 44 | }; |
45 | 45 | ||
46 | #endif | 46 | #endif |
diff --git a/noncore/tools/calc2/simple/simpleimpl.cpp b/noncore/tools/calc2/simple/simpleimpl.cpp index 447cbdf..3cec4e0 100644 --- a/noncore/tools/calc2/simple/simpleimpl.cpp +++ b/noncore/tools/calc2/simple/simpleimpl.cpp | |||
@@ -1,120 +1,120 @@ | |||
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 <qpushbutton.h> | 21 | #include <qpushbutton.h> |
22 | #include <qlcdnumber.h> | 22 | #include <qlcdnumber.h> |
23 | 23 | ||
24 | #include "simpleimpl.h" | 24 | #include "simpleimpl.h" |
25 | #include "../stdinstructions.h" | 25 | #include "stdinstructions.h" |
26 | 26 | ||
27 | void FormSimpleImpl::CEClicked() { | 27 | void FormSimpleImpl::CEClicked() { |
28 | engine->hardReset(); | 28 | engine->hardReset(); |
29 | } | 29 | } |
30 | 30 | ||
31 | void FormSimpleImpl::MCClicked() { | 31 | void FormSimpleImpl::MCClicked() { |
32 | engine->memClear(); | 32 | engine->memClear(); |
33 | } | 33 | } |
34 | 34 | ||
35 | void FormSimpleImpl::MRClicked() { | 35 | void FormSimpleImpl::MRClicked() { |
36 | engine->memRecall(); | 36 | engine->memRecall(); |
37 | } | 37 | } |
38 | 38 | ||
39 | void FormSimpleImpl::MPlusClicked() { | 39 | void FormSimpleImpl::MPlusClicked() { |
40 | engine->memSave(); | 40 | engine->memSave(); |
41 | } | 41 | } |
42 | 42 | ||
43 | void FormSimpleImpl::evalClicked() { | 43 | void FormSimpleImpl::evalClicked() { |
44 | engine->eval(); | 44 | engine->eval(); |
45 | } | 45 | } |
46 | 46 | ||
47 | void FormSimpleImpl::addClicked () | 47 | void FormSimpleImpl::addClicked () |
48 | { | 48 | { |
49 | engine->pushInstruction (new iAdd ()); | 49 | engine->pushInstruction (new iAdd ()); |
50 | } | 50 | } |
51 | 51 | ||
52 | void FormSimpleImpl::subClicked () | 52 | void FormSimpleImpl::subClicked () |
53 | { | 53 | { |
54 | engine->pushInstruction (new iSub ()); | 54 | engine->pushInstruction (new iSub ()); |
55 | } | 55 | } |
56 | 56 | ||
57 | void FormSimpleImpl::mulClicked () | 57 | void FormSimpleImpl::mulClicked () |
58 | { | 58 | { |
59 | engine->pushInstruction (new iMul ()); | 59 | engine->pushInstruction (new iMul ()); |
60 | } | 60 | } |
61 | 61 | ||
62 | void FormSimpleImpl::divClicked () | 62 | void FormSimpleImpl::divClicked () |
63 | { | 63 | { |
64 | engine->pushInstruction (new iDiv ()); | 64 | engine->pushInstruction (new iDiv ()); |
65 | } | 65 | } |
66 | 66 | ||
67 | void FormSimpleImpl::decimalClicked () | 67 | void FormSimpleImpl::decimalClicked () |
68 | { | 68 | { |
69 | engine->pushValue ('.'); | 69 | engine->pushValue ('.'); |
70 | } | 70 | } |
71 | 71 | ||
72 | void FormSimpleImpl::val1Clicked () | 72 | void FormSimpleImpl::val1Clicked () |
73 | { | 73 | { |
74 | engine->pushValue ('1'); | 74 | engine->pushValue ('1'); |
75 | } | 75 | } |
76 | 76 | ||
77 | void FormSimpleImpl::val2Clicked () | 77 | void FormSimpleImpl::val2Clicked () |
78 | { | 78 | { |
79 | engine->pushValue ('2'); | 79 | engine->pushValue ('2'); |
80 | } | 80 | } |
81 | 81 | ||
82 | void FormSimpleImpl::val3Clicked () | 82 | void FormSimpleImpl::val3Clicked () |
83 | { | 83 | { |
84 | engine->pushValue ('3'); | 84 | engine->pushValue ('3'); |
85 | } | 85 | } |
86 | 86 | ||
87 | void FormSimpleImpl::val4Clicked () | 87 | void FormSimpleImpl::val4Clicked () |
88 | { | 88 | { |
89 | engine->pushValue ('4'); | 89 | engine->pushValue ('4'); |
90 | } | 90 | } |
91 | 91 | ||
92 | void FormSimpleImpl::val5Clicked () | 92 | void FormSimpleImpl::val5Clicked () |
93 | { | 93 | { |
94 | engine->pushValue ('5'); | 94 | engine->pushValue ('5'); |
95 | } | 95 | } |
96 | 96 | ||
97 | void FormSimpleImpl::val6Clicked () | 97 | void FormSimpleImpl::val6Clicked () |
98 | { | 98 | { |
99 | engine->pushValue ('6'); | 99 | engine->pushValue ('6'); |
100 | } | 100 | } |
101 | 101 | ||
102 | void FormSimpleImpl::val7Clicked () | 102 | void FormSimpleImpl::val7Clicked () |
103 | { | 103 | { |
104 | engine->pushValue ('7'); | 104 | engine->pushValue ('7'); |
105 | } | 105 | } |
106 | 106 | ||
107 | void FormSimpleImpl::val8Clicked () | 107 | void FormSimpleImpl::val8Clicked () |
108 | { | 108 | { |
109 | engine->pushValue ('8'); | 109 | engine->pushValue ('8'); |
110 | } | 110 | } |
111 | 111 | ||
112 | void FormSimpleImpl::val9Clicked () | 112 | void FormSimpleImpl::val9Clicked () |
113 | { | 113 | { |
114 | engine->pushValue ('9'); | 114 | engine->pushValue ('9'); |
115 | } | 115 | } |
116 | 116 | ||
117 | void FormSimpleImpl::val0Clicked () | 117 | void FormSimpleImpl::val0Clicked () |
118 | { | 118 | { |
119 | engine->pushValue ('0'); | 119 | engine->pushValue ('0'); |
120 | } | 120 | } |
diff --git a/noncore/tools/calc2/simple/simpleimpl.h b/noncore/tools/calc2/simple/simpleimpl.h index b7b83e2..a2db154 100644 --- a/noncore/tools/calc2/simple/simpleimpl.h +++ b/noncore/tools/calc2/simple/simpleimpl.h | |||
@@ -1,65 +1,65 @@ | |||
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 | #ifndef STANDARDIMPL_H | 21 | #ifndef STANDARDIMPL_H |
22 | #define STANDARDIMPL_H | 22 | #define STANDARDIMPL_H |
23 | 23 | ||
24 | #include <qpe/qmath.h> | 24 | #include <qpe/qmath.h> |
25 | #include <qlcdnumber.h> | 25 | #include <qlcdnumber.h> |
26 | 26 | ||
27 | #include "simple.h" | 27 | #include "simple.h" |
28 | #include "../engine.h" | 28 | #include "engine.h" |
29 | #include "../instruction.h" | 29 | #include "instruction.h" |
30 | 30 | ||
31 | class FormSimpleImpl:public FormSimple { | 31 | class FormSimpleImpl:public FormSimple { |
32 | Q_OBJECT | 32 | Q_OBJECT |
33 | public: | 33 | public: |
34 | FormSimpleImpl (Engine *e, QWidget * parent = 0, const char *name = 0) | 34 | FormSimpleImpl (Engine *e, QWidget * parent = 0, const char *name = 0) |
35 | :FormSimple (parent, name) {engine = e;engine->setRepresentation(rDouble);}; | 35 | :FormSimple (parent, name) {engine = e;engine->setRepresentation(rDouble);}; |
36 | 36 | ||
37 | ~FormSimpleImpl () { }; | 37 | ~FormSimpleImpl () { }; |
38 | 38 | ||
39 | private: | 39 | private: |
40 | Engine *engine; | 40 | Engine *engine; |
41 | 41 | ||
42 | private slots: | 42 | private slots: |
43 | void MPlusClicked(); | 43 | void MPlusClicked(); |
44 | void MCClicked(); | 44 | void MCClicked(); |
45 | void MRClicked(); | 45 | void MRClicked(); |
46 | void CEClicked(); | 46 | void CEClicked(); |
47 | void evalClicked(); | 47 | void evalClicked(); |
48 | void addClicked (); | 48 | void addClicked (); |
49 | void decimalClicked (); | 49 | void decimalClicked (); |
50 | void divClicked (); | 50 | void divClicked (); |
51 | void mulClicked (); | 51 | void mulClicked (); |
52 | void subClicked (); | 52 | void subClicked (); |
53 | void val0Clicked (); | 53 | void val0Clicked (); |
54 | void val1Clicked (); | 54 | void val1Clicked (); |
55 | void val2Clicked (); | 55 | void val2Clicked (); |
56 | void val3Clicked (); | 56 | void val3Clicked (); |
57 | void val4Clicked (); | 57 | void val4Clicked (); |
58 | void val5Clicked (); | 58 | void val5Clicked (); |
59 | void val6Clicked (); | 59 | void val6Clicked (); |
60 | void val7Clicked (); | 60 | void val7Clicked (); |
61 | void val8Clicked (); | 61 | void val8Clicked (); |
62 | void val9Clicked (); | 62 | void val9Clicked (); |
63 | }; | 63 | }; |
64 | 64 | ||
65 | #endif | 65 | #endif |