2 -------------------------------------------------------------
3 Code is loosely based on wmppp, wmload, wmtime, wmcp, and asbutton
4 Original Author: Edward H. Flora <ehflora@access1.net>
5 Current Maintainer: Window Maker Developers Team
6 <wmaker-dev@lists.windowmaker.org>
10 wmcalc is a program designed to act as a simple four-function
11 calculator. It is different from other calculator programs, however
12 in that it is designed to take up very little desktop space. As such,
13 it can be left running on the desktop at all times. It is intended to
14 placed in the WindowMaker dock, or in Wharf under Afterstep, though it
15 should run as well under any window manager.
19 This program is released under the GPL license. A copy (in case you
20 don't already have hundreds of them floating around) can be found in
21 this distribution in the file COPYING.
26 Rick Stuart <stuart@xnet.com>
27 Philippe Trbich <philippe.trbich@free.fr>
28 Original Web Page Designs:
29 Jon Bruno <bruno@ksu.edu>
31 Ben Cohen <buddog@aztec.asu.edu>
32 original author of wmcp (et al.)
33 The contributors listed above are not involved with the development of
34 wmcalc. I'm listing them here as thanks for helping out, catching
35 bugs in the code, etc.
45 Optionally, copy the config file:
46 cp wmcalc.conf ~/.wmcalc
51 Grab the appicon and move it to the dock.
52 Change the settings to start with Windowmaker
54 Afterstep Wharf 1.6.??: (I don't use Afterstep anymore, so...)
55 *Wharf wmcalc -Swallow "wmcalc" wmcalc &
58 The appicon only has a two pixel border where you can grab
59 and move it. It is easiest to grab along the bottom edge.
61 If make doesn't work, you may need to fiddle with the settings in
64 Tested on: (Well, it runs, I don't know if 'Tested' is quite right...)
66 X Clients: Red Hat 6.0, Kernel 2.2.8
70 usage: wmcalc [-g geometry] [-d dpy] [-v] [-f configfilename] [-h]
72 -g <geometry> Window Geometry - ie: 64x64+10+10
73 -d <display> Display - ie: 127.0.0.1:0.0
75 -h Help. This message.
76 -f <filename> Full path to configuration file to use.
78 Buttons are defined as:
80 | x00 | where: x = 1 for Left Mouse Button
81 | 0 1 2 3 4 5 6 7 8 9| x = 2 for Middle Mouse Button
82 |--------------------| x = 3 for Right Mouse Button
83 |x01 x02 x03 x04 x05 |
84 |x06 x07 x08 x09 x10 | Note: the numbers 0..9 are the indicators
85 |x11 x12 x13 x14 x15 | for memory cells 0..9 respectively
86 |x16 x17 x18 x19 x20 |
90 100 Reinitialize the calculator, and both Registers
92 200 Clear all the memory registers (0..10)
93 300 Clear the current number being entered only
94 x11 Start a program defined by CalcStart variable in config file
95 1yy Perform function shown on button
96 2yy Recall number from memory location [0-9] to display
98 if yy = 2,3,4, 7,8,9, 12, 13, 14, 17
99 otherwise, can run a user-defined function (not implemented)
100 3yy Store Displayed number in memory location [0-9]
101 if yy = 2,3,4, 7,8,9, 12,13,14, 17
102 otherwise, can run a user-defined function (not implemented)
103 1xx Hopefully the other functions are obvious from their
109 I am sure that there are better ways to do some of the things that are
110 done in wmcalc. In fact, wmcalc is basically a series of hacks, but appears
113 The configuration file (.wmcalc) is written by wmcalc whenever the user
114 requests to store a number to memory. As a part of this process, a file
115 is written to /tmp. If /tmp is not accessible, it tries in the user's home
116 directory, as defined by the environment variable HOME. This file is
117 erased as soon as it is written over the main configuration file.
119 Changes made to the configuration file (other than memory stores) will not
120 take effect until the next time wmcalc is started.
122 Although one can only "Clear" all unlocked memory locations, one may clear the
123 display and then "store" a '0' in the memory location, providing the
124 ability to clear individual cells.
126 The fonts are stored in charmap.xpm. This file may be edited to
127 change colors or fonts, but the app must be recompiled for the changes
128 to take effect. The buttons are located in calcbuttons.xpm. This
129 file may be edited, though the borders should stay where they are
130 unless you want to change the button regions that are hard coded.
131 The background border is defined in backdrop.xpm.
133 "C code. C code run. Run, code, run.
138 These are partially a dream list. I don't know when they'll get done,
139 as I'm pretty busy at work. Anyone want to tackle these??
141 * Re-implement the register/display design to allow full double precision.
143 * Add keyboard support (I've tried to do this, with no luck. Probably a
146 * Add button press animation.
148 * Add a log file, either as a paper tape implementation, or a file
149 that one can intentionally write data to. (This could grow to a pipe to
150 plotting programs, etc, though this is a bit extreme...)
153 I have no intention at this time to add in an RPN format, as I
154 personally do not like it. It should be noted that I have NOT used it
155 extensively, and I've heard that I would like it. But, until then...
159 Remember, they're just undocumented FEATURES!!!
161 * The display can lose the last digit of a three character exponential
164 * Due to an implementation fault, at every step of calculations, precision
165 is lost, as the number is only as accurate at that displayed.
167 * Order of operations: 1 + 2 * 5 = 15, not 11, as it should.
169 * Changing sign when the display is blank results in "-0". Further entry
170 yields "-05...," but this does not affect calculations.
172 * Changes to the configuration file do not take effect until wmcalc is
173 restarted. (Note that file is written whenever a "store memory
174 location" is requested)
176 Probably many more. Send comments (preferably with fixes) to
177 <ehflora@access1.net>
178 I will happily include your name in the documentation for the program
179 if you send me a bug report and the correction. This can be in the
180 form of a patch file, or ASCII text to exchange, or an equivalent.
181 Note, this program is written in C. Not C++. I'm not a computer
182 science person, I don't do objects. Therefore, bug fixes that convert
183 this to C++ don't count, since I would no longer be able to support
184 the program. Of course, you can modify the code and release a new
187 Thanks, and Good Luck.