-rw-r--r-- | noncore/tools/calc2/simple/README | 1 | ||||
-rw-r--r-- | noncore/tools/calc2/simple/simple.pro | 14 | ||||
-rw-r--r-- | noncore/tools/calc2/simple/simple.ui | 704 | ||||
-rw-r--r-- | noncore/tools/calc2/simple/simplefactory.cpp | 51 | ||||
-rw-r--r-- | noncore/tools/calc2/simple/simplefactory.h | 46 | ||||
-rw-r--r-- | noncore/tools/calc2/simple/simpleimpl.cpp | 120 | ||||
-rw-r--r-- | noncore/tools/calc2/simple/simpleimpl.h | 65 |
7 files changed, 1001 insertions, 0 deletions
diff --git a/noncore/tools/calc2/simple/README b/noncore/tools/calc2/simple/README new file mode 100644 index 0000000..37acb64 --- a/dev/null +++ b/noncore/tools/calc2/simple/README | |||
@@ -0,0 +1 @@ | |||
A simple interface with no operator precedence. | |||
diff --git a/noncore/tools/calc2/simple/simple.pro b/noncore/tools/calc2/simple/simple.pro new file mode 100644 index 0000000..92378a6 --- a/dev/null +++ b/noncore/tools/calc2/simple/simple.pro | |||
@@ -0,0 +1,14 @@ | |||
1 | TEMPLATE = lib | ||
2 | CONFIG -= moc | ||
3 | CONFIG += qt release | ||
4 | |||
5 | # Input | ||
6 | INTERFACES += simple.ui | ||
7 | HEADERS = simpleimpl.h simplefactory.h stdinstructions.h | ||
8 | SOURCES = simpleimpl.cpp simplefactory.cpp | ||
9 | |||
10 | INCLUDEPATH += $(QPEDIR)/include \ | ||
11 | $(QPEDIR)/calc2 | ||
12 | DEPENDPATH += $(QPEDIR)/include | ||
13 | |||
14 | DESTDIR = $(QPEDIR)/plugins/calculator | ||
diff --git a/noncore/tools/calc2/simple/simple.ui b/noncore/tools/calc2/simple/simple.ui new file mode 100644 index 0000000..af12905 --- a/dev/null +++ b/noncore/tools/calc2/simple/simple.ui | |||
@@ -0,0 +1,704 @@ | |||
1 | <!DOCTYPE UI><UI> | ||
2 | <class>FormSimple</class> | ||
3 | <widget> | ||
4 | <class>QWidget</class> | ||
5 | <property stdset="1"> | ||
6 | <name>name</name> | ||
7 | <cstring>FormSimple</cstring> | ||
8 | </property> | ||
9 | <property stdset="1"> | ||
10 | <name>geometry</name> | ||
11 | <rect> | ||
12 | <x>73</x> | ||
13 | <y>0</y> | ||
14 | <width>240</width> | ||
15 | <height>320</height> | ||
16 | </rect> | ||
17 | </property> | ||
18 | <property stdset="1"> | ||
19 | <name>sizePolicy</name> | ||
20 | <sizepolicy> | ||
21 | <hsizetype>4</hsizetype> | ||
22 | <vsizetype>4</vsizetype> | ||
23 | </sizepolicy> | ||
24 | </property> | ||
25 | <property stdset="1"> | ||
26 | <name>maximumSize</name> | ||
27 | <size> | ||
28 | <width>240</width> | ||
29 | <height>320</height> | ||
30 | </size> | ||
31 | </property> | ||
32 | <property stdset="1"> | ||
33 | <name>baseSize</name> | ||
34 | <size> | ||
35 | <width>240</width> | ||
36 | <height>240</height> | ||
37 | </size> | ||
38 | </property> | ||
39 | <property stdset="1"> | ||
40 | <name>caption</name> | ||
41 | <string>Simple</string> | ||
42 | </property> | ||
43 | <grid> | ||
44 | <property stdset="1"> | ||
45 | <name>margin</name> | ||
46 | <number>0</number> | ||
47 | </property> | ||
48 | <property stdset="1"> | ||
49 | <name>spacing</name> | ||
50 | <number>0</number> | ||
51 | </property> | ||
52 | <widget row="4" column="2" > | ||
53 | <class>QPushButton</class> | ||
54 | <property stdset="1"> | ||
55 | <name>name</name> | ||
56 | <cstring>PBEval</cstring> | ||
57 | </property> | ||
58 | <property stdset="1"> | ||
59 | <name>sizePolicy</name> | ||
60 | <sizepolicy> | ||
61 | <hsizetype>4</hsizetype> | ||
62 | <vsizetype>4</vsizetype> | ||
63 | </sizepolicy> | ||
64 | </property> | ||
65 | <property stdset="1"> | ||
66 | <name>maximumSize</name> | ||
67 | <size> | ||
68 | <width>160</width> | ||
69 | <height>80</height> | ||
70 | </size> | ||
71 | </property> | ||
72 | <property stdset="1"> | ||
73 | <name>text</name> | ||
74 | <string>=</string> | ||
75 | </property> | ||
76 | </widget> | ||
77 | <widget row="2" column="1" > | ||
78 | <class>QPushButton</class> | ||
79 | <property stdset="1"> | ||
80 | <name>name</name> | ||
81 | <cstring>PB5</cstring> | ||
82 | </property> | ||
83 | <property stdset="1"> | ||
84 | <name>sizePolicy</name> | ||
85 | <sizepolicy> | ||
86 | <hsizetype>4</hsizetype> | ||
87 | <vsizetype>4</vsizetype> | ||
88 | </sizepolicy> | ||
89 | </property> | ||
90 | <property stdset="1"> | ||
91 | <name>maximumSize</name> | ||
92 | <size> | ||
93 | <width>80</width> | ||
94 | <height>80</height> | ||
95 | </size> | ||
96 | </property> | ||
97 | <property stdset="1"> | ||
98 | <name>text</name> | ||
99 | <string>5</string> | ||
100 | </property> | ||
101 | </widget> | ||
102 | <widget row="4" column="0" > | ||
103 | <class>QPushButton</class> | ||
104 | <property stdset="1"> | ||
105 | <name>name</name> | ||
106 | <cstring>PBDecimal</cstring> | ||
107 | </property> | ||
108 | <property stdset="1"> | ||
109 | <name>sizePolicy</name> | ||
110 | <sizepolicy> | ||
111 | <hsizetype>4</hsizetype> | ||
112 | <vsizetype>4</vsizetype> | ||
113 | </sizepolicy> | ||
114 | </property> | ||
115 | <property stdset="1"> | ||
116 | <name>maximumSize</name> | ||
117 | <size> | ||
118 | <width>80</width> | ||
119 | <height>80</height> | ||
120 | </size> | ||
121 | </property> | ||
122 | <property stdset="1"> | ||
123 | <name>text</name> | ||
124 | <string>.</string> | ||
125 | </property> | ||
126 | </widget> | ||
127 | <widget row="3" column="2" > | ||
128 | <class>QPushButton</class> | ||
129 | <property stdset="1"> | ||
130 | <name>name</name> | ||
131 | <cstring>PB3</cstring> | ||
132 | </property> | ||
133 | <property stdset="1"> | ||
134 | <name>sizePolicy</name> | ||
135 | <sizepolicy> | ||
136 | <hsizetype>4</hsizetype> | ||
137 | <vsizetype>4</vsizetype> | ||
138 | </sizepolicy> | ||
139 | </property> | ||
140 | <property stdset="1"> | ||
141 | <name>maximumSize</name> | ||
142 | <size> | ||
143 | <width>80</width> | ||
144 | <height>80</height> | ||
145 | </size> | ||
146 | </property> | ||
147 | <property stdset="1"> | ||
148 | <name>text</name> | ||
149 | <string>3</string> | ||
150 | </property> | ||
151 | </widget> | ||
152 | <widget row="3" column="1" > | ||
153 | <class>QPushButton</class> | ||
154 | <property stdset="1"> | ||
155 | <name>name</name> | ||
156 | <cstring>PB2</cstring> | ||
157 | </property> | ||
158 | <property stdset="1"> | ||
159 | <name>sizePolicy</name> | ||
160 | <sizepolicy> | ||
161 | <hsizetype>4</hsizetype> | ||
162 | <vsizetype>4</vsizetype> | ||
163 | </sizepolicy> | ||
164 | </property> | ||
165 | <property stdset="1"> | ||
166 | <name>maximumSize</name> | ||
167 | <size> | ||
168 | <width>80</width> | ||
169 | <height>80</height> | ||
170 | </size> | ||
171 | </property> | ||
172 | <property stdset="1"> | ||
173 | <name>text</name> | ||
174 | <string>2</string> | ||
175 | </property> | ||
176 | </widget> | ||
177 | <widget row="2" column="0" > | ||
178 | <class>QPushButton</class> | ||
179 | <property stdset="1"> | ||
180 | <name>name</name> | ||
181 | <cstring>PB4</cstring> | ||
182 | </property> | ||
183 | <property stdset="1"> | ||
184 | <name>sizePolicy</name> | ||
185 | <sizepolicy> | ||
186 | <hsizetype>4</hsizetype> | ||
187 | <vsizetype>4</vsizetype> | ||
188 | </sizepolicy> | ||
189 | </property> | ||
190 | <property stdset="1"> | ||
191 | <name>maximumSize</name> | ||
192 | <size> | ||
193 | <width>80</width> | ||
194 | <height>80</height> | ||
195 | </size> | ||
196 | </property> | ||
197 | <property stdset="1"> | ||
198 | <name>text</name> | ||
199 | <string>4</string> | ||
200 | </property> | ||
201 | </widget> | ||
202 | <widget row="2" column="2" > | ||
203 | <class>QPushButton</class> | ||
204 | <property stdset="1"> | ||
205 | <name>name</name> | ||
206 | <cstring>PB6</cstring> | ||
207 | </property> | ||
208 | <property stdset="1"> | ||
209 | <name>sizePolicy</name> | ||
210 | <sizepolicy> | ||
211 | <hsizetype>4</hsizetype> | ||
212 | <vsizetype>4</vsizetype> | ||
213 | </sizepolicy> | ||
214 | </property> | ||
215 | <property stdset="1"> | ||
216 | <name>maximumSize</name> | ||
217 | <size> | ||
218 | <width>80</width> | ||
219 | <height>80</height> | ||
220 | </size> | ||
221 | </property> | ||
222 | <property stdset="1"> | ||
223 | <name>text</name> | ||
224 | <string>6</string> | ||
225 | </property> | ||
226 | </widget> | ||
227 | <widget row="3" column="3" > | ||
228 | <class>QPushButton</class> | ||
229 | <property stdset="1"> | ||
230 | <name>name</name> | ||
231 | <cstring>PBMul</cstring> | ||
232 | </property> | ||
233 | <property stdset="1"> | ||
234 | <name>sizePolicy</name> | ||
235 | <sizepolicy> | ||
236 | <hsizetype>4</hsizetype> | ||
237 | <vsizetype>4</vsizetype> | ||
238 | </sizepolicy> | ||
239 | </property> | ||
240 | <property stdset="1"> | ||
241 | <name>maximumSize</name> | ||
242 | <size> | ||
243 | <width>80</width> | ||
244 | <height>80</height> | ||
245 | </size> | ||
246 | </property> | ||
247 | <property stdset="1"> | ||
248 | <name>text</name> | ||
249 | <string>*</string> | ||
250 | </property> | ||
251 | </widget> | ||
252 | <widget row="2" column="3" > | ||
253 | <class>QPushButton</class> | ||
254 | <property stdset="1"> | ||
255 | <name>name</name> | ||
256 | <cstring>PBSub</cstring> | ||
257 | </property> | ||
258 | <property stdset="1"> | ||
259 | <name>sizePolicy</name> | ||
260 | <sizepolicy> | ||
261 | <hsizetype>4</hsizetype> | ||
262 | <vsizetype>4</vsizetype> | ||
263 | </sizepolicy> | ||
264 | </property> | ||
265 | <property stdset="1"> | ||
266 | <name>maximumSize</name> | ||
267 | <size> | ||
268 | <width>80</width> | ||
269 | <height>80</height> | ||
270 | </size> | ||
271 | </property> | ||
272 | <property stdset="1"> | ||
273 | <name>text</name> | ||
274 | <string>-</string> | ||
275 | </property> | ||
276 | </widget> | ||
277 | <widget row="1" column="3" > | ||
278 | <class>QPushButton</class> | ||
279 | <property stdset="1"> | ||
280 | <name>name</name> | ||
281 | <cstring>PBAdd</cstring> | ||
282 | </property> | ||
283 | <property stdset="1"> | ||
284 | <name>sizePolicy</name> | ||
285 | <sizepolicy> | ||
286 | <hsizetype>4</hsizetype> | ||
287 | <vsizetype>4</vsizetype> | ||
288 | </sizepolicy> | ||
289 | </property> | ||
290 | <property stdset="1"> | ||
291 | <name>maximumSize</name> | ||
292 | <size> | ||
293 | <width>80</width> | ||
294 | <height>80</height> | ||
295 | </size> | ||
296 | </property> | ||
297 | <property stdset="1"> | ||
298 | <name>text</name> | ||
299 | <string>+</string> | ||
300 | </property> | ||
301 | </widget> | ||
302 | <widget row="1" column="2" > | ||
303 | <class>QPushButton</class> | ||
304 | <property stdset="1"> | ||
305 | <name>name</name> | ||
306 | <cstring>PB9</cstring> | ||
307 | </property> | ||
308 | <property stdset="1"> | ||
309 | <name>sizePolicy</name> | ||
310 | <sizepolicy> | ||
311 | <hsizetype>4</hsizetype> | ||
312 | <vsizetype>4</vsizetype> | ||
313 | </sizepolicy> | ||
314 | </property> | ||
315 | <property stdset="1"> | ||
316 | <name>maximumSize</name> | ||
317 | <size> | ||
318 | <width>80</width> | ||
319 | <height>80</height> | ||
320 | </size> | ||
321 | </property> | ||
322 | <property stdset="1"> | ||
323 | <name>text</name> | ||
324 | <string>9</string> | ||
325 | </property> | ||
326 | </widget> | ||
327 | <widget row="1" column="0" > | ||
328 | <class>QPushButton</class> | ||
329 | <property stdset="1"> | ||
330 | <name>name</name> | ||
331 | <cstring>PB7</cstring> | ||
332 | </property> | ||
333 | <property stdset="1"> | ||
334 | <name>enabled</name> | ||
335 | <bool>true</bool> | ||
336 | </property> | ||
337 | <property stdset="1"> | ||
338 | <name>sizePolicy</name> | ||
339 | <sizepolicy> | ||
340 | <hsizetype>4</hsizetype> | ||
341 | <vsizetype>4</vsizetype> | ||
342 | </sizepolicy> | ||
343 | </property> | ||
344 | <property stdset="1"> | ||
345 | <name>maximumSize</name> | ||
346 | <size> | ||
347 | <width>80</width> | ||
348 | <height>80</height> | ||
349 | </size> | ||
350 | </property> | ||
351 | <property stdset="1"> | ||
352 | <name>text</name> | ||
353 | <string>7</string> | ||
354 | </property> | ||
355 | </widget> | ||
356 | <widget row="3" column="0" > | ||
357 | <class>QPushButton</class> | ||
358 | <property stdset="1"> | ||
359 | <name>name</name> | ||
360 | <cstring>PB1</cstring> | ||
361 | </property> | ||
362 | <property stdset="1"> | ||
363 | <name>sizePolicy</name> | ||
364 | <sizepolicy> | ||
365 | <hsizetype>4</hsizetype> | ||
366 | <vsizetype>4</vsizetype> | ||
367 | </sizepolicy> | ||
368 | </property> | ||
369 | <property stdset="1"> | ||
370 | <name>maximumSize</name> | ||
371 | <size> | ||
372 | <width>80</width> | ||
373 | <height>80</height> | ||
374 | </size> | ||
375 | </property> | ||
376 | <property stdset="1"> | ||
377 | <name>text</name> | ||
378 | <string>1</string> | ||
379 | </property> | ||
380 | </widget> | ||
381 | <widget row="4" column="1" > | ||
382 | <class>QPushButton</class> | ||
383 | <property stdset="1"> | ||
384 | <name>name</name> | ||
385 | <cstring>PB0</cstring> | ||
386 | </property> | ||
387 | <property stdset="1"> | ||
388 | <name>sizePolicy</name> | ||
389 | <sizepolicy> | ||
390 | <hsizetype>4</hsizetype> | ||
391 | <vsizetype>4</vsizetype> | ||
392 | </sizepolicy> | ||
393 | </property> | ||
394 | <property stdset="1"> | ||
395 | <name>maximumSize</name> | ||
396 | <size> | ||
397 | <width>160</width> | ||
398 | <height>80</height> | ||
399 | </size> | ||
400 | </property> | ||
401 | <property stdset="1"> | ||
402 | <name>text</name> | ||
403 | <string>0</string> | ||
404 | </property> | ||
405 | </widget> | ||
406 | <widget row="4" column="3" > | ||
407 | <class>QPushButton</class> | ||
408 | <property stdset="1"> | ||
409 | <name>name</name> | ||
410 | <cstring>PBDiv</cstring> | ||
411 | </property> | ||
412 | <property stdset="1"> | ||
413 | <name>sizePolicy</name> | ||
414 | <sizepolicy> | ||
415 | <hsizetype>4</hsizetype> | ||
416 | <vsizetype>4</vsizetype> | ||
417 | </sizepolicy> | ||
418 | </property> | ||
419 | <property stdset="1"> | ||
420 | <name>maximumSize</name> | ||
421 | <size> | ||
422 | <width>80</width> | ||
423 | <height>80</height> | ||
424 | </size> | ||
425 | </property> | ||
426 | <property stdset="1"> | ||
427 | <name>text</name> | ||
428 | <string>/</string> | ||
429 | </property> | ||
430 | <property stdset="1"> | ||
431 | <name>autoRepeat</name> | ||
432 | <bool>true</bool> | ||
433 | </property> | ||
434 | </widget> | ||
435 | <widget row="1" column="1" > | ||
436 | <class>QPushButton</class> | ||
437 | <property stdset="1"> | ||
438 | <name>name</name> | ||
439 | <cstring>PB8</cstring> | ||
440 | </property> | ||
441 | <property stdset="1"> | ||
442 | <name>sizePolicy</name> | ||
443 | <sizepolicy> | ||
444 | <hsizetype>4</hsizetype> | ||
445 | <vsizetype>4</vsizetype> | ||
446 | </sizepolicy> | ||
447 | </property> | ||
448 | <property stdset="1"> | ||
449 | <name>maximumSize</name> | ||
450 | <size> | ||
451 | <width>80</width> | ||
452 | <height>80</height> | ||
453 | </size> | ||
454 | </property> | ||
455 | <property stdset="1"> | ||
456 | <name>text</name> | ||
457 | <string>8</string> | ||
458 | </property> | ||
459 | </widget> | ||
460 | <widget row="0" column="0" > | ||
461 | <class>QPushButton</class> | ||
462 | <property stdset="1"> | ||
463 | <name>name</name> | ||
464 | <cstring>PBMPlus</cstring> | ||
465 | </property> | ||
466 | <property stdset="1"> | ||
467 | <name>sizePolicy</name> | ||
468 | <sizepolicy> | ||
469 | <hsizetype>4</hsizetype> | ||
470 | <vsizetype>4</vsizetype> | ||
471 | </sizepolicy> | ||
472 | </property> | ||
473 | <property stdset="1"> | ||
474 | <name>maximumSize</name> | ||
475 | <size> | ||
476 | <width>80</width> | ||
477 | <height>80</height> | ||
478 | </size> | ||
479 | </property> | ||
480 | <property stdset="1"> | ||
481 | <name>text</name> | ||
482 | <string>M+</string> | ||
483 | </property> | ||
484 | </widget> | ||
485 | <widget row="0" column="3" > | ||
486 | <class>QPushButton</class> | ||
487 | <property stdset="1"> | ||
488 | <name>name</name> | ||
489 | <cstring>PBCE</cstring> | ||
490 | </property> | ||
491 | <property stdset="1"> | ||
492 | <name>sizePolicy</name> | ||
493 | <sizepolicy> | ||
494 | <hsizetype>4</hsizetype> | ||
495 | <vsizetype>4</vsizetype> | ||
496 | </sizepolicy> | ||
497 | </property> | ||
498 | <property stdset="1"> | ||
499 | <name>maximumSize</name> | ||
500 | <size> | ||
501 | <width>80</width> | ||
502 | <height>80</height> | ||
503 | </size> | ||
504 | </property> | ||
505 | <property stdset="1"> | ||
506 | <name>text</name> | ||
507 | <string>CE</string> | ||
508 | </property> | ||
509 | </widget> | ||
510 | <widget row="0" column="2" > | ||
511 | <class>QPushButton</class> | ||
512 | <property stdset="1"> | ||
513 | <name>name</name> | ||
514 | <cstring>PBMC</cstring> | ||
515 | </property> | ||
516 | <property stdset="1"> | ||
517 | <name>sizePolicy</name> | ||
518 | <sizepolicy> | ||
519 | <hsizetype>4</hsizetype> | ||
520 | <vsizetype>4</vsizetype> | ||
521 | </sizepolicy> | ||
522 | </property> | ||
523 | <property stdset="1"> | ||
524 | <name>maximumSize</name> | ||
525 | <size> | ||
526 | <width>80</width> | ||
527 | <height>80</height> | ||
528 | </size> | ||
529 | </property> | ||
530 | <property stdset="1"> | ||
531 | <name>text</name> | ||
532 | <string>MC</string> | ||
533 | </property> | ||
534 | </widget> | ||
535 | <widget row="0" column="1" > | ||
536 | <class>QPushButton</class> | ||
537 | <property stdset="1"> | ||
538 | <name>name</name> | ||
539 | <cstring>PBMR</cstring> | ||
540 | </property> | ||
541 | <property stdset="1"> | ||
542 | <name>sizePolicy</name> | ||
543 | <sizepolicy> | ||
544 | <hsizetype>4</hsizetype> | ||
545 | <vsizetype>4</vsizetype> | ||
546 | </sizepolicy> | ||
547 | </property> | ||
548 | <property stdset="1"> | ||
549 | <name>maximumSize</name> | ||
550 | <size> | ||
551 | <width>80</width> | ||
552 | <height>80</height> | ||
553 | </size> | ||
554 | </property> | ||
555 | <property stdset="1"> | ||
556 | <name>text</name> | ||
557 | <string>MR</string> | ||
558 | </property> | ||
559 | </widget> | ||
560 | </grid> | ||
561 | </widget> | ||
562 | <connections> | ||
563 | <connection> | ||
564 | <sender>PB0</sender> | ||
565 | <signal>clicked()</signal> | ||
566 | <receiver>FormSimple</receiver> | ||
567 | <slot>val0Clicked()</slot> | ||
568 | </connection> | ||
569 | <connection> | ||
570 | <sender>PB1</sender> | ||
571 | <signal>clicked()</signal> | ||
572 | <receiver>FormSimple</receiver> | ||
573 | <slot>val1Clicked()</slot> | ||
574 | </connection> | ||
575 | <connection> | ||
576 | <sender>PB2</sender> | ||
577 | <signal>clicked()</signal> | ||
578 | <receiver>FormSimple</receiver> | ||
579 | <slot>val2Clicked()</slot> | ||
580 | </connection> | ||
581 | <connection> | ||
582 | <sender>PB3</sender> | ||
583 | <signal>clicked()</signal> | ||
584 | <receiver>FormSimple</receiver> | ||
585 | <slot>val3Clicked()</slot> | ||
586 | </connection> | ||
587 | <connection> | ||
588 | <sender>PB4</sender> | ||
589 | <signal>clicked()</signal> | ||
590 | <receiver>FormSimple</receiver> | ||
591 | <slot>val4Clicked()</slot> | ||
592 | </connection> | ||
593 | <connection> | ||
594 | <sender>PB5</sender> | ||
595 | <signal>clicked()</signal> | ||
596 | <receiver>FormSimple</receiver> | ||
597 | <slot>val5Clicked()</slot> | ||
598 | </connection> | ||
599 | <connection> | ||
600 | <sender>PB6</sender> | ||
601 | <signal>clicked()</signal> | ||
602 | <receiver>FormSimple</receiver> | ||
603 | <slot>val6Clicked()</slot> | ||
604 | </connection> | ||
605 | <connection> | ||
606 | <sender>PB7</sender> | ||
607 | <signal>clicked()</signal> | ||
608 | <receiver>FormSimple</receiver> | ||
609 | <slot>val7Clicked()</slot> | ||
610 | </connection> | ||
611 | <connection> | ||
612 | <sender>PB8</sender> | ||
613 | <signal>clicked()</signal> | ||
614 | <receiver>FormSimple</receiver> | ||
615 | <slot>val8Clicked()</slot> | ||
616 | </connection> | ||
617 | <connection> | ||
618 | <sender>PB9</sender> | ||
619 | <signal>clicked()</signal> | ||
620 | <receiver>FormSimple</receiver> | ||
621 | <slot>val9Clicked()</slot> | ||
622 | </connection> | ||
623 | <connection> | ||
624 | <sender>PBSub</sender> | ||
625 | <signal>clicked()</signal> | ||
626 | <receiver>FormSimple</receiver> | ||
627 | <slot>subClicked()</slot> | ||
628 | </connection> | ||
629 | <connection> | ||
630 | <sender>PBMul</sender> | ||
631 | <signal>clicked()</signal> | ||
632 | <receiver>FormSimple</receiver> | ||
633 | <slot>mulClicked()</slot> | ||
634 | </connection> | ||
635 | <connection> | ||
636 | <sender>PBDiv</sender> | ||
637 | <signal>clicked()</signal> | ||
638 | <receiver>FormSimple</receiver> | ||
639 | <slot>divClicked()</slot> | ||
640 | </connection> | ||
641 | <connection> | ||
642 | <sender>PBDecimal</sender> | ||
643 | <signal>clicked()</signal> | ||
644 | <receiver>FormSimple</receiver> | ||
645 | <slot>decimalClicked()</slot> | ||
646 | </connection> | ||
647 | <connection> | ||
648 | <sender>PBEval</sender> | ||
649 | <signal>clicked()</signal> | ||
650 | <receiver>FormSimple</receiver> | ||
651 | <slot>evalClicked()</slot> | ||
652 | </connection> | ||
653 | <connection> | ||
654 | <sender>PBMC</sender> | ||
655 | <signal>clicked()</signal> | ||
656 | <receiver>FormSimple</receiver> | ||
657 | <slot>MCClicked()</slot> | ||
658 | </connection> | ||
659 | <connection> | ||
660 | <sender>PBMPlus</sender> | ||
661 | <signal>clicked()</signal> | ||
662 | <receiver>FormSimple</receiver> | ||
663 | <slot>MPlusClicked()</slot> | ||
664 | </connection> | ||
665 | <connection> | ||
666 | <sender>PBMR</sender> | ||
667 | <signal>clicked()</signal> | ||
668 | <receiver>FormSimple</receiver> | ||
669 | <slot>MRClicked()</slot> | ||
670 | </connection> | ||
671 | <connection> | ||
672 | <sender>PBAdd</sender> | ||
673 | <signal>clicked()</signal> | ||
674 | <receiver>FormSimple</receiver> | ||
675 | <slot>addClicked()</slot> | ||
676 | </connection> | ||
677 | <connection> | ||
678 | <sender>PBCE</sender> | ||
679 | <signal>clicked()</signal> | ||
680 | <receiver>FormSimple</receiver> | ||
681 | <slot>CEClicked()</slot> | ||
682 | </connection> | ||
683 | <slot access="public">CEClicked()</slot> | ||
684 | <slot access="public">MCClicked()</slot> | ||
685 | <slot access="public">MPlusClicked()</slot> | ||
686 | <slot access="public">MRClicked()</slot> | ||
687 | <slot access="public">addClicked()</slot> | ||
688 | <slot access="public">decimalClicked()</slot> | ||
689 | <slot access="public">divClicked()</slot> | ||
690 | <slot access="public">evalClicked()</slot> | ||
691 | <slot access="public">mulClicked()</slot> | ||
692 | <slot access="public">subClicked()</slot> | ||
693 | <slot access="public">val0Clicked()</slot> | ||
694 | <slot access="public">val1Clicked()</slot> | ||
695 | <slot access="public">val2Clicked()</slot> | ||
696 | <slot access="public">val3Clicked()</slot> | ||
697 | <slot access="public">val4Clicked()</slot> | ||
698 | <slot access="public">val5Clicked()</slot> | ||
699 | <slot access="public">val6Clicked()</slot> | ||
700 | <slot access="public">val7Clicked()</slot> | ||
701 | <slot access="public">val8Clicked()</slot> | ||
702 | <slot access="public">val9Clicked()</slot> | ||
703 | </connections> | ||
704 | </UI> | ||
diff --git a/noncore/tools/calc2/simple/simplefactory.cpp b/noncore/tools/calc2/simple/simplefactory.cpp new file mode 100644 index 0000000..515418f --- a/dev/null +++ b/noncore/tools/calc2/simple/simplefactory.cpp | |||
@@ -0,0 +1,51 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
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 | ||
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 | ||
10 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
11 | ** packaging of this file. | ||
12 | ** | ||
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. | ||
15 | ** | ||
16 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
17 | ** | ||
18 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
19 | ** not clear to you. | ||
20 | ** | ||
21 | **********************************************************************/ | ||
22 | |||
23 | #include "simplefactory.h" | ||
24 | #include "simpleimpl.h" | ||
25 | #include <engine.h> | ||
26 | |||
27 | QWidget *SimpleInterface::getPlugin ( Engine *e, QWidget *parent ) { | ||
28 | if ( !input ) | ||
29 | input = new FormSimpleImpl ( e, parent ); | ||
30 | return input; | ||
31 | } | ||
32 | |||
33 | #ifndef QT_NO_COMPONENT | ||
34 | QRESULT SimpleInterface::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) | ||
35 | { | ||
36 | *iface = 0; | ||
37 | if ( uuid == IID_QUnknown ) | ||
38 | *iface = this; | ||
39 | else if ( uuid == IID_Calc ) | ||
40 | *iface = this; | ||
41 | |||
42 | if ( *iface ) | ||
43 | (*iface)->addRef(); | ||
44 | return QS_OK; | ||
45 | } | ||
46 | |||
47 | Q_EXPORT_INTERFACE() | ||
48 | { | ||
49 | Q_CREATE_INSTANCE( SimpleInterface ) | ||
50 | } | ||
51 | #endif | ||
diff --git a/noncore/tools/calc2/simple/simplefactory.h b/noncore/tools/calc2/simple/simplefactory.h new file mode 100644 index 0000000..e1022fd --- a/dev/null +++ b/noncore/tools/calc2/simple/simplefactory.h | |||
@@ -0,0 +1,46 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
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 | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
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. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | |||
21 | #ifndef BINARYIMPL_H | ||
22 | #define BINARYIMPL_H | ||
23 | |||
24 | #include "simpleimpl.h" | ||
25 | #include <plugininterface.h> | ||
26 | #include <engine.h> | ||
27 | |||
28 | class SimpleInterface : public CalcInterface | ||
29 | { | ||
30 | public: | ||
31 | SimpleInterface(){input = 0;}; | ||
32 | virtual ~SimpleInterface(){}; | ||
33 | |||
34 | #ifndef QT_NO_COMPONENT | ||
35 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); | ||
36 | Q_REFCOUNT | ||
37 | #endif | ||
38 | |||
39 | QWidget *getPlugin( Engine *, QWidget *parent ); | ||
40 | |||
41 | private: | ||
42 | FormSimpleImpl *input; | ||
43 | ulong ref; | ||
44 | }; | ||
45 | |||
46 | #endif | ||
diff --git a/noncore/tools/calc2/simple/simpleimpl.cpp b/noncore/tools/calc2/simple/simpleimpl.cpp new file mode 100644 index 0000000..f71f000 --- a/dev/null +++ b/noncore/tools/calc2/simple/simpleimpl.cpp | |||
@@ -0,0 +1,120 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
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 | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
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. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | |||
21 | #include <qpushbutton.h> | ||
22 | #include <qlcdnumber.h> | ||
23 | |||
24 | #include "simpleimpl.h" | ||
25 | #include <stdinstructions.h> | ||
26 | |||
27 | void FormSimpleImpl::CEClicked() { | ||
28 | engine->hardReset(); | ||
29 | } | ||
30 | |||
31 | void FormSimpleImpl::MCClicked() { | ||
32 | engine->memClear(); | ||
33 | } | ||
34 | |||
35 | void FormSimpleImpl::MRClicked() { | ||
36 | engine->memRecall(); | ||
37 | } | ||
38 | |||
39 | void FormSimpleImpl::MPlusClicked() { | ||
40 | engine->memSave(); | ||
41 | } | ||
42 | |||
43 | void FormSimpleImpl::evalClicked() { | ||
44 | engine->eval(); | ||
45 | } | ||
46 | |||
47 | void FormSimpleImpl::addClicked () | ||
48 | { | ||
49 | engine->pushInstruction (new iAdd ()); | ||
50 | } | ||
51 | |||
52 | void FormSimpleImpl::subClicked () | ||
53 | { | ||
54 | engine->pushInstruction (new iSub ()); | ||
55 | } | ||
56 | |||
57 | void FormSimpleImpl::mulClicked () | ||
58 | { | ||
59 | engine->pushInstruction (new iMul ()); | ||
60 | } | ||
61 | |||
62 | void FormSimpleImpl::divClicked () | ||
63 | { | ||
64 | engine->pushInstruction (new iDiv ()); | ||
65 | } | ||
66 | |||
67 | void FormSimpleImpl::decimalClicked () | ||
68 | { | ||
69 | engine->pushValue ('.'); | ||
70 | } | ||
71 | |||
72 | void FormSimpleImpl::val1Clicked () | ||
73 | { | ||
74 | engine->pushValue ('1'); | ||
75 | } | ||
76 | |||
77 | void FormSimpleImpl::val2Clicked () | ||
78 | { | ||
79 | engine->pushValue ('2'); | ||
80 | } | ||
81 | |||
82 | void FormSimpleImpl::val3Clicked () | ||
83 | { | ||
84 | engine->pushValue ('3'); | ||
85 | } | ||
86 | |||
87 | void FormSimpleImpl::val4Clicked () | ||
88 | { | ||
89 | engine->pushValue ('4'); | ||
90 | } | ||
91 | |||
92 | void FormSimpleImpl::val5Clicked () | ||
93 | { | ||
94 | engine->pushValue ('5'); | ||
95 | } | ||
96 | |||
97 | void FormSimpleImpl::val6Clicked () | ||
98 | { | ||
99 | engine->pushValue ('6'); | ||
100 | } | ||
101 | |||
102 | void FormSimpleImpl::val7Clicked () | ||
103 | { | ||
104 | engine->pushValue ('7'); | ||
105 | } | ||
106 | |||
107 | void FormSimpleImpl::val8Clicked () | ||
108 | { | ||
109 | engine->pushValue ('8'); | ||
110 | } | ||
111 | |||
112 | void FormSimpleImpl::val9Clicked () | ||
113 | { | ||
114 | engine->pushValue ('9'); | ||
115 | } | ||
116 | |||
117 | void FormSimpleImpl::val0Clicked () | ||
118 | { | ||
119 | engine->pushValue ('0'); | ||
120 | } | ||
diff --git a/noncore/tools/calc2/simple/simpleimpl.h b/noncore/tools/calc2/simple/simpleimpl.h new file mode 100644 index 0000000..a2db154 --- a/dev/null +++ b/noncore/tools/calc2/simple/simpleimpl.h | |||
@@ -0,0 +1,65 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
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 | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
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. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | |||
21 | #ifndef STANDARDIMPL_H | ||
22 | #define STANDARDIMPL_H | ||
23 | |||
24 | #include <qpe/qmath.h> | ||
25 | #include <qlcdnumber.h> | ||
26 | |||
27 | #include "simple.h" | ||
28 | #include "engine.h" | ||
29 | #include "instruction.h" | ||
30 | |||
31 | class FormSimpleImpl:public FormSimple { | ||
32 | Q_OBJECT | ||
33 | public: | ||
34 | FormSimpleImpl (Engine *e, QWidget * parent = 0, const char *name = 0) | ||
35 | :FormSimple (parent, name) {engine = e;engine->setRepresentation(rDouble);}; | ||
36 | |||
37 | ~FormSimpleImpl () { }; | ||
38 | |||
39 | private: | ||
40 | Engine *engine; | ||
41 | |||
42 | private slots: | ||
43 | void MPlusClicked(); | ||
44 | void MCClicked(); | ||
45 | void MRClicked(); | ||
46 | void CEClicked(); | ||
47 | void evalClicked(); | ||
48 | void addClicked (); | ||
49 | void decimalClicked (); | ||
50 | void divClicked (); | ||
51 | void mulClicked (); | ||
52 | void subClicked (); | ||
53 | void val0Clicked (); | ||
54 | void val1Clicked (); | ||
55 | void val2Clicked (); | ||
56 | void val3Clicked (); | ||
57 | void val4Clicked (); | ||
58 | void val5Clicked (); | ||
59 | void val6Clicked (); | ||
60 | void val7Clicked (); | ||
61 | void val8Clicked (); | ||
62 | void val9Clicked (); | ||
63 | }; | ||
64 | |||
65 | #endif | ||