summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Hadaway <raker@gentoo.org>2002-10-24 17:56:41 +0000
committerNick Hadaway <raker@gentoo.org>2002-10-24 17:56:41 +0000
commit0529692ab14a7c3ab9584953e0a14c10e3a76d16 (patch)
tree4bb49fb761dc53108735eeaec27cdf143cf11924 /x11-plugins/wmcalc/files
parentinitial ebuild, thanks to Simon Keimer for submission (diff)
downloadgentoo-2-0529692ab14a7c3ab9584953e0a14c10e3a76d16.tar.gz
gentoo-2-0529692ab14a7c3ab9584953e0a14c10e3a76d16.tar.bz2
gentoo-2-0529692ab14a7c3ab9584953e0a14c10e3a76d16.zip
New ebuild of wmcalc. See bug #5252
Diffstat (limited to 'x11-plugins/wmcalc/files')
-rw-r--r--x11-plugins/wmcalc/files/digest-wmcalc-0.31
-rw-r--r--x11-plugins/wmcalc/files/wmcalc-0.3-gentoo.diff107
-rw-r--r--x11-plugins/wmcalc/files/wmcalc.man117
3 files changed, 225 insertions, 0 deletions
diff --git a/x11-plugins/wmcalc/files/digest-wmcalc-0.3 b/x11-plugins/wmcalc/files/digest-wmcalc-0.3
new file mode 100644
index 000000000000..e52c63b01102
--- /dev/null
+++ b/x11-plugins/wmcalc/files/digest-wmcalc-0.3
@@ -0,0 +1 @@
+MD5 9c7fdb47983258a7eae5fffdac6305a8 wmcalc_0.3.orig.tar.gz 56944
diff --git a/x11-plugins/wmcalc/files/wmcalc-0.3-gentoo.diff b/x11-plugins/wmcalc/files/wmcalc-0.3-gentoo.diff
new file mode 100644
index 000000000000..04f03b54ab51
--- /dev/null
+++ b/x11-plugins/wmcalc/files/wmcalc-0.3-gentoo.diff
@@ -0,0 +1,107 @@
+diff -u wmcalc-0.3.orig/.wmcalc wmcalc-0.3/.wmcalc
+--- wmcalc-0.3.orig/.wmcalc Tue Nov 14 21:18:08 2000
++++ wmcalc-0.3/.wmcalc Fri Jul 19 11:48:35 2002
+@@ -31,5 +31,5 @@
+ # The ImagChar variable allows the user to choose between 'i' and 'j' to
+ # represent the sqrt(-1). (Electrical Engineers (such as myself) use 'j'
+ # rather than 'i.')
+-#ImagChar i
+-ImagChar j
++ImagChar i
++#ImagChar j
+diff -u wmcalc-0.3.orig/Makefile wmcalc-0.3/Makefile
+--- wmcalc-0.3.orig/Makefile Sun Dec 10 23:51:48 2000
++++ wmcalc-0.3/Makefile Fri Jul 19 11:47:22 2002
+@@ -1,4 +1,4 @@
+-INCLUDES =-I/usr/X11R6/include/X11 -I/usr/local/include
++INCLUDES =-I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/local/include
+ LIBINC =-L/usr/X11R6/lib
+ LIBS = -lX11 -lXpm -lXext -lm
+
+diff -u wmcalc-0.3.orig/wmcalc.c wmcalc-0.3/wmcalc.c
+--- wmcalc-0.3.orig/wmcalc.c Thu Jan 18 01:18:25 2001
++++ wmcalc-0.3/wmcalc.c Fri Jul 19 11:57:35 2002
+@@ -90,6 +90,7 @@
+ 01/17/01 Updated to use XLookupString to get KeySym
+ 11/09/00 Added Events for focus and keyboard work.
+ 11/01/00 File Header Added
++ 21/09/01 Added global configfile by Gordon Fraser
+ ****************************************************************/
+ int main( int argc, char **argv ) {
+ XEvent report;
+@@ -428,7 +429,7 @@
+ flush_expose( iconwin );
+ XCopyArea(display, visible.pixmap, iconwin, gc, 0, 0,
+ visible.attributes.width, visible.attributes.height, 0, 0 );
+- if ( Verbose ) printf("In Redraw()\n");
++ // if ( Verbose ) printf("In Redraw()\n");
+ displaystr();
+ } /***** End of function redraw() ********************************/
+
+@@ -471,7 +472,6 @@
+ ****************************************************************/
+ int whichKey (KeySym keysym) {
+ extern int Verbose;
+- extern Display *display;
+ int func = NO_BUTTON;
+
+ if (Verbose) printf("KeySym 0x%x received, decoding...\n", (int) keysym);
+diff -u wmcalc-0.3.orig/wmcalc_c.h wmcalc-0.3/wmcalc_c.h
+--- wmcalc-0.3.orig/wmcalc_c.h Thu Jan 18 01:16:14 2001
++++ wmcalc-0.3/wmcalc_c.h Fri Jul 19 11:46:52 2002
+@@ -17,6 +17,7 @@
+ #define CALC_CMD_SIZE 128
+ #define CONFFILENAME "/.wmcalc"
+ #define CONFTEMPFILE "/tmp/wmcalc.tmp"
++#define CONFIGGLOBAL "/etc/wmcalc.conf"
+ #define VER 0
+ #define REL 3
+
+diff -u wmcalc-0.3.orig/wmcalcswitch.c wmcalc-0.3/wmcalcswitch.c
+--- wmcalc-0.3.orig/wmcalcswitch.c Thu Nov 9 20:05:00 2000
++++ wmcalc-0.3/wmcalcswitch.c Fri Jul 19 12:01:16 2002
+@@ -399,10 +399,16 @@
+
+ /* Open current Config file */
+ if ((fp = fopen(configfile, "r")) == NULL) { // Can't find config file
+- printf("%s: Configuration File not found\n", configfile);
++ printf("%s: Cannot create configuration file\n", configfile);
+ return(ERR_FILE_NOT_FOUND);
+ }
+
++ /* We cannot write to the global config-file... */
++ if(!strcmp(configfile, CONFIGGLOBAL)) {
++ strcpy(configfile, getenv("HOME")); // Added to wmbutton by Gordon Fraser, 9/21/01
++ strcat(configfile, CONFFILENAME);
++ }
++
+ /* Open Temporary File */
+ if ((fptmp = fopen(tempfile, "w")) == NULL) { // Can't open file in /tmp
+ fprintf(stderr, "%s: Temporary File Open Failed\n", tempfile);
+@@ -479,9 +485,14 @@
+
+ sepstr = &sep_ch;
+
+- if ((fp = fopen(configfile, "r")) == NULL) { // Can't find config file
+- fprintf(stderr, "%s: Configuration File not found\n", configfile);
+- return(ERR_FILE_NOT_FOUND);
++ if ((fp = fopen(configfile, "r")) == NULL) { // Can't find config file
++ strcpy(configfile, CONFIGGLOBAL); // ...so try to open global config
++ if ((fp = fopen(configfile, "r")) == NULL) { // Can't find global config file
++ fprintf(stderr, "%s: Configuration File not found\n", configfile);
++ return(ERR_FILE_NOT_FOUND);
++ } else {
++ write_config(); // if global config opened, save in homedir
++ }
+ }
+ else {
+ if (Verbose) printf("%s: Found Configuration File\n", configfile);
+@@ -498,7 +509,7 @@
+ understood */
+ i = 0;
+ /* Loop while we haven't found the variable */
+- while (((strncmp(line, CfgVarList[i], strlen(CfgVarList[i]))) != NULL)
++ while (((strncmp(line, CfgVarList[i], strlen(CfgVarList[i]))) != 0)
+ && (i < MAX_LABEL)) {
+ i++;
+ }
diff --git a/x11-plugins/wmcalc/files/wmcalc.man b/x11-plugins/wmcalc/files/wmcalc.man
new file mode 100644
index 000000000000..4485d57c3fcf
--- /dev/null
+++ b/x11-plugins/wmcalc/files/wmcalc.man
@@ -0,0 +1,117 @@
+.\" Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH WMCALC 1 "September 20, 2001"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+wmcalc \- dockable calculator application
+.SH SYNOPSIS
+.B wmcalc
+[-g \fIgeometry\fP] [-d \fIdisplay\fP] [-v] [-f \fIconfigfile\fP] [-h]
+
+.SH DESCRIPTION
+This manual page documents briefly the
+.B wmcalc
+command.
+This manual page was written for the Gentoo Linux distribution
+because the original program does not have a manual page.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
+.\" respectively.
+\fBwmcalc\fP is a program designed to act as a simple calculator offering basic operations like addition, subtraction, multiplication, division, square and squareroot. It is different from other calculator programs, however in that it is designed to take up very little desktop space. As such, it can be left running on the desktop at all times. It is intended to placed in the WindowMaker dock, or in Wharf under Afterstep, though it should run as well under any window manager.
+
+
+Buttons are defined as:
+.nf
+ ____________________
+| x00 | x = 1 for Left Mouse Button
+| 0 1 2 3 4 5 6 7 8 9| x = 2 for Middle Mouse Button
+|--------------------| x = 3 for Right Mouse Button
+|x01 x02 x03 x04 x05 |
+|x06 x07 x08 x09 x10 | Note: the numbers 0..9 are the
+|x11 x12 x13 x14 x15 | indicators for memory cells
+|x16 x17 x18 x19 x20 | 0..9 respectively
+ --------------------
+.fi
+.TP
+Button Functions:
+.TP
+.B 100
+Reinitialize the calculator. (100 = Left Mouse Button on Display)
+.TP
+.B 200
+Clear all the memory registers (0..10)
+.TP
+.B 300
+Clear the current number being entered only
+.TP
+.B x11
+Start a program defined by CalcStart variable in config file
+.TP
+.B 1yy
+Perform function shown on button
+.TP
+.B 2yy
+Recall number from memory location [0-9] to display for calculation if yy = 2,3,4, 7,8,9, 12, 13, 14, 17 otherwise, can run a user-defined function (not implemented)
+.TP
+.B 3yy
+Store Displayed number in memory location [0-9] if yy = 2,3,4, 7,8,9, 12,13,14, 17 otherwise, can run a user-defined function (not implemented)
+.TP
+.B 1xx
+Hopefully the other functions are obvious from their button graphics.
+
+
+.SH OPTIONS
+.TP
+.B \-g <geometry>
+Window Geometry - ie: 64x64+10+10
+.TP
+.B \-d <display>
+Display - ie: 127.0.0.1:0.0
+.TP
+.B \-f <filename>
+Full path to configuration file.
+.TP
+.B \-v
+Verbose Mode.
+.TP
+.B \-h
+Help.
+.SH FILES
+.TP
+.I /etc/wmbutton.conf
+system wide wmbutton configuration file which will be used for all users who start wmcalc the first time.
+.TP
+.I ~/.wmcalc
+The configuration file (.wmcalc) is written by wmcalc whenever the user requests to store a number to memory. This file is automatically created the first time a user launches wmcalc with /etc/wmcalc.conf as template. As a part of this process, a file is written to /tmp. If /tmp is not accessible, it tries in the user's home directory, as defined by the environment variable HOME. This file is erased as soon as it is written over the main configuration file.
+.SH CONFIGURATION
+.TP
+The configuration file is case sensitive. A # starts a comment, and lines consisting entirely of whitespace are ignored. The syntax is simply:
+.TP
+.B <variable> <content>
+Where <variable> and <content> need to be seperated by a Tab \\t and \fBnot\fP spaces.
+.TP
+\fBmem0 - mem9\fP Calculator Memory Locations. These must all exist, though they may be in any order.
+.TP
+\fBCalcStart\fP The CalcStart variable is intended to allow the user to start a larger calculator for more complicated needs. Everything after the tab '\\t' character is sent unmodified in a system() call, so anything you can type at the command prompt may be put here.
+.TP
+\fBImagChar\fP The ImagChar variable allows the user to choose between 'i' and 'j' to represent the sqrt(-1).
+
+.SH AUTHOR
+wmcalc was written by Edward H. Flora <ehflora@access1.net>, and is licensed under the terms of the GNU General Public License.
+.TP
+This manual page was written by Gordon Fraser <gordon@freakzone.net>, for the Debian GNU/Linux system (but may be used by others).
+