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@googlegroups.com>
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.
46 Optionally, copy the config file:
47 cp wmcalc.conf ~/.wmcalc
52 Grab the appicon and move it to the dock.
53 Change the settings to start with Windowmaker
55 Afterstep Wharf 1.6.??: (I don't use Afterstep anymore, so...)
56 *Wharf wmcalc -Swallow "wmcalc" wmcalc &
59 The appicon only has a two pixel border where you can grab
60 and move it. It is easiest to grab along the bottom edge.
62 If make doesn't work, you may need to fiddle with the settings in
65 Tested on: (Well, it runs, I don't know if 'Tested' is quite right...)
67 X Clients: Red Hat 6.0, Kernel 2.2.8
71 usage: wmcalc [-g geometry] [-d dpy] [-v] [-f configfilename] [-h]
73 -g <geometry> Window Geometry - ie: 64x64+10+10
74 -d <display> Display - ie: 127.0.0.1:0.0
76 -h Help. This message.
77 -f <filename> Full path to configuration file to use.
79 Buttons are defined as:
81 | x00 | where: x = 1 for Left Mouse Button
82 | 0 1 2 3 4 5 6 7 8 9| x = 2 for Middle Mouse Button
83 |--------------------| x = 3 for Right Mouse Button
84 |x01 x02 x03 x04 x05 |
85 |x06 x07 x08 x09 x10 | Note: the numbers 0..9 are the indicators
86 |x11 x12 x13 x14 x15 | for memory cells 0..9 respectively
87 |x16 x17 x18 x19 x20 |
91 100 Reinitialize the calculator, and both Registers
93 200 Clear all the memory registers (0..10)
94 300 Clear the current number being entered only
95 x11 Start a program defined by CalcStart variable in config file
96 1yy Perform function shown on button
97 2yy Recall number from memory location [0-9] to display
99 if yy = 2,3,4, 7,8,9, 12, 13, 14, 17
100 otherwise, can run a user-defined function (not implemented)
101 3yy Store Displayed number in memory location [0-9]
102 if yy = 2,3,4, 7,8,9, 12,13,14, 17
103 otherwise, can run a user-defined function (not implemented)
104 1xx Hopefully the other functions are obvious from their
110 I am sure that there are better ways to do some of the things that are
111 done in wmcalc. In fact, wmcalc is basically a series of hacks, but appears
114 The configuration file (.wmcalc) is written by wmcalc whenever the user
115 requests to store a number to memory. As a part of this process, a file
116 is written to /tmp. If /tmp is not accessible, it tries in the user's home
117 directory, as defined by the environment variable HOME. This file is
118 erased as soon as it is written over the main configuration file.
120 Changes made to the configuration file (other than memory stores) will not
121 take effect until the next time wmcalc is started.
123 Although one can only "Clear" all unlocked memory locations, one may clear the
124 display and then "store" a '0' in the memory location, providing the
125 ability to clear individual cells.
127 The fonts are stored in charmap.xpm. This file may be edited to
128 change colors or fonts, but the app must be recompiled for the changes
129 to take effect. The buttons are located in calcbuttons.xpm. This
130 file may be edited, though the borders should stay where they are
131 unless you want to change the button regions that are hard coded.
132 The background border is defined in backdrop.xpm.
134 "C code. C code run. Run, code, run.
139 These are partially a dream list. I don't know when they'll get done,
140 as I'm pretty busy at work. Anyone want to tackle these??
142 * Re-implement the register/display design to allow full double precision.
144 * Add keyboard support (I've tried to do this, with no luck. Probably a
147 * Add button press animation.
149 * Add a log file, either as a paper tape implementation, or a file
150 that one can intentionally write data to. (This could grow to a pipe to
151 plotting programs, etc, though this is a bit extreme...)
154 I have no intention at this time to add in an RPN format, as I
155 personally do not like it. It should be noted that I have NOT used it
156 extensively, and I've heard that I would like it. But, until then...
160 Remember, they're just undocumented FEATURES!!!
162 * The display can lose the last digit of a three character exponential
165 * Due to an implementation fault, at every step of calculations, precision
166 is lost, as the number is only as accurate at that displayed.
168 * Order of operations: 1 + 2 * 5 = 15, not 11, as it should.
170 * Changing sign when the display is blank results in "-0". Further entry
171 yields "-05...," but this does not affect calculations.
173 * Changes to the configuration file do not take effect until wmcalc is
174 restarted. (Note that file is written whenever a "store memory
175 location" is requested)
177 Probably many more. Send comments (preferably with fixes) to
178 <ehflora@access1.net>
179 I will happily include your name in the documentation for the program
180 if you send me a bug report and the correction. This can be in the
181 form of a patch file, or ASCII text to exchange, or an equivalent.
182 Note, this program is written in C. Not C++. I'm not a computer
183 science person, I don't do objects. Therefore, bug fixes that convert
184 this to C++ don't count, since I would no longer be able to support
185 the program. Of course, you can modify the code and release a new
188 Thanks, and Good Luck.