[Pkg-wmaker-commits] [wmsun] 19/73: wmsun: Add version 1.03 to repository.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Fri Aug 28 12:04:43 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch master
in repository wmsun.
commit 056ee6900277dab8e2a6a462ff4d3d5792de95f9
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date: Sun Jun 14 17:04:34 2015 -0500
wmsun: Add version 1.03 to repository.
Obtained from [1].
[1] http://snapshot.debian.org/archive/debian/20091106T012259Z/pool/main/w/wmsun/wmsun_1.03%2B1.orig.tar.gz
---
BUGS | 1 +
COPYING | 339 ++++++++++++++++++++++++++++++++++++++++++++
TODO | 22 +++
wmSun/Makefile | 43 ++++++
wmSun/README | 7 +
wmSun/SunRise.c | 236 +++++++++++++++++++++++++++++++
wmSun/wmSun.1 | 42 ++++++
wmSun/wmSun.c | 376 +++++++++++++++++++++++++++++++++++++++++++++++++
wmSun/wmSun_mask.xbm | 38 +++++
wmSun/wmSun_master.xpm | 354 ++++++++++++++++++++++++++++++++++++++++++++++
wmgeneral/wmgeneral.c | 366 +++++++++++++++++++++++++++++++++++++++++++++++
wmgeneral/wmgeneral.h | 50 +++++++
12 files changed, 1874 insertions(+)
diff --git a/BUGS b/BUGS
new file mode 100644
index 0000000..32f5c37
--- /dev/null
+++ b/BUGS
@@ -0,0 +1 @@
+Please send bug reports to mghenderson at lanl.gov
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..a43ea21
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..19ccafe
--- /dev/null
+++ b/TODO
@@ -0,0 +1,22 @@
+Just some brainstorming:
+
+
+ + Add multiple "pages" like wmMoonClock?
+
+ + Eclipse info?
+
+ + Twilight Calcs. Civil, Astro, Nautical....
+
+ + Transit time?
+
+ + Graphical Annalemma or plot of Eq of Time...
+
+ + Add user definable twiddle factor to account for local
+ terrain etc.. Could even go way overbaord and download
+ USGS topo info? (Man! that is going overboard!).
+
+ + etc..
+
+
+
+
diff --git a/wmSun/Makefile b/wmSun/Makefile
new file mode 100644
index 0000000..907b2b4
--- /dev/null
+++ b/wmSun/Makefile
@@ -0,0 +1,43 @@
+CC = gcc
+CFLAGS = -O2 -Wall
+INCDIR = -I/usr/X11R6/include/X11
+DESTDIR= /usr/X11R6
+LIBDIR = -L/usr/X11R6/lib
+
+
+
+# If you need to compile on a Linux, dont change anything. If
+# compiling for Solaris, swap the LIBS below...
+#
+# For Linux (and other?) Machines...
+#
+LIBS = -lXpm -lX11 -lXext
+#
+# For Sun Solaris Machines (I know it compiles on 2.6)...
+#
+# LIBS = -lXpm -lX11 -lXext -lsocket
+
+
+OBJS = wmSun.o SunRise.o ../wmgeneral/wmgeneral.o
+
+
+.c.o:
+ $(CC) $(COPTS) -D$(shell echo `uname -s`) -c $< -o $*.o $(INCDIR)
+
+
+all: wmSun.o wmSun
+
+wmSun.o: wmSun_master.xpm wmSun_mask.xbm
+wmSun: $(OBJS)
+ $(CC) $(COPTS) $(SYSTEM) -lm -o wmSun $^ $(INCDIR) $(LIBDIR) $(LIBS)
+
+clean:
+ for i in $(OBJS) ; do \
+ rm -f $$i; \
+ done
+ rm -f wmSun
+
+install:: wmSun
+ install -s -m 0755 wmSun $(DESTDIR)/bin
+ install -m 0644 wmSun.1 $(DESTDIR)/man/man1
+
diff --git a/wmSun/README b/wmSun/README
new file mode 100644
index 0000000..29b0eb7
--- /dev/null
+++ b/wmSun/README
@@ -0,0 +1,7 @@
+Kona lat/lon;
+
+Long = 155d 55m = 155.92
+Lat = 19d 35m = 19.58
+
+
+Add ability to adjust date...
diff --git a/wmSun/SunRise.c b/wmSun/SunRise.c
new file mode 100644
index 0000000..1126667
--- /dev/null
+++ b/wmSun/SunRise.c
@@ -0,0 +1,236 @@
+#include <stdio.h>
+#include <math.h>
+
+#define DegPerRad 57.29577951308232087680
+#define RadPerDeg 0.01745329251994329576
+
+extern double Glon, SinGlat, CosGlat, TimeZone;
+
+double cosEPS = 0.91748;
+double sinEPS = 0.39778;
+double P2 = 6.283185307;
+
+
+SunRise(int year, int month, int day, double LocalHour, double *UTRise, double *UTSet){
+
+ double UT, ym, y0, yp, SinH0;
+ double xe, ye, z1, z2, SinH(), hour24();
+ int Rise, Set, nz;
+
+ SinH0 = sin( -50.0/60.0 * RadPerDeg );
+
+
+ UT = 1.0+TimeZone;
+ *UTRise = -999.0;
+ *UTSet = -999.0;
+ Rise = Set = 0;
+ ym = SinH(year, month, day, UT-1.0) - SinH0;
+
+ while ( (UT <= 24.0+TimeZone) ) {
+
+ y0 = SinH(year, month, day, UT) - SinH0;
+ yp = SinH(year, month, day, UT+1.0) - SinH0;
+
+ Interp(ym, y0, yp, &xe, &ye, &z1, &z2, &nz);
+
+ switch(nz){
+
+ case 0:
+ break;
+ case 1:
+ if (ym < 0.0){
+ *UTRise = UT + z1;
+ Rise = 1;
+ } else {
+ *UTSet = UT + z1;
+ Set = 1;
+ }
+ break;
+ case 2:
+ if (ye < 0.0){
+ *UTRise = UT + z2;
+ *UTSet = UT + z1;
+ } else {
+ *UTRise = UT + z1;
+ *UTSet = UT + z2;
+ }
+ Rise = 1;
+ Set = 1;
+ break;
+ }
+ ym = yp;
+ UT += 2.0;
+
+ }
+
+ if (Rise){
+ *UTRise -= TimeZone;
+ *UTRise = hour24(*UTRise);
+ } else {
+ *UTRise = -999.0;
+ }
+
+ if (Set){
+ *UTSet -= TimeZone;
+ *UTSet = hour24(*UTSet);
+ } else {
+ *UTSet = -999.0;
+ }
+
+}
+
+
+UTTohhmm(double UT, int *h, int *m){
+
+
+ if (UT < 0.0) {
+ *h = -1.0;
+ *m = -1.0;
+ } else {
+ *h = (int)UT;
+ *m = (int)((UT-(double)(*h))*60.0+0.5);
+ }
+
+}
+
+
+
+
+
+
+Interp(double ym, double y0, double yp, double *xe, double *ye, double *z1, double *z2, int *nz){
+
+ double a, b, c, d, dx;
+
+ *nz = 0;
+ a = 0.5*(ym+yp)-y0;
+ b = 0.5*(yp-ym);
+ c = y0;
+ *xe = -b/(2.0*a);
+ *ye = (a*(*xe) + b) * (*xe) + c;
+ d = b*b - 4.0*a*c;
+
+ if (d >= 0){
+ dx = 0.5*sqrt(d)/fabs(a);
+ *z1 = *xe - dx;
+ *z2 = *xe+dx;
+ if (fabs(*z1) <= 1.0) *nz += 1;
+ if (fabs(*z2) <= 1.0) *nz += 1;
+ if (*z1 < -1.0) *z1 = *z2;
+ }
+
+ return(0);
+
+
+}
+
+
+
+
+double SinH(int year, int month, int day, double UT){
+
+ double TU0, TU, TU2, TU3, LambdaMoon, BetaMoon, R, AGE, frac(), jd();
+ double RA_Sun, DEC_Sun, T0, gmst, lmst, Tau, epsilon;
+ double M, DL, L, SL, X, Y, Z, RHO;
+
+
+ TU0 = (jd(year, month, day, 0.0) - 2451545.0)/36525.0;
+
+ TU = (jd(year, month, day, UT+62.0/3600.0) - 2451545.0)/36525.0;
+ TU2 = TU*TU;
+ TU3 = TU2*TU;
+
+ M = P2*frac(0.993133 + 99.997361*TU);
+ DL = 6893.0*sin(M) + 72.0*sin(2.0*M);
+ L = P2*frac(0.7859453 + M/P2 + (6191.2*TU+DL)/1296e3);
+ SL = sin(L);
+ X = cos(L); Y = cosEPS*SL; Z = sinEPS*SL; RHO = sqrt(1.0-Z*Z);
+ DEC_Sun = atan2(Z, RHO);
+ RA_Sun = (48.0/P2)*atan(Y/(X+RHO));
+ if (RA_Sun < 0) RA_Sun += 24.0;
+
+ RA_Sun = RA_Sun*15.0*RadPerDeg;
+
+ /*
+ * Compute Greenwich Mean Sidereal Time (gmst)
+ */
+ UT = 24.0*frac( UT/24.0 );
+/*
+ gmst = 6.697374558 + 1.0027379093*UT + (8640184.812866*TU0 +(0.093104-6.2e-6*TU)*TU2)/3600.0;
+*/
+ gmst = 6.697374558 + 1.0*UT + (8640184.812866+(0.093104-6.2e-6*TU)*TU)*TU/3600.0;
+ lmst = 24.0*frac( (gmst-Glon/15.0) / 24.0 );
+
+ Tau = 15.0*lmst*RadPerDeg - RA_Sun;
+ return( SinGlat*sin(DEC_Sun) + CosGlat*cos(DEC_Sun)*cos(Tau) );
+
+
+}
+
+
+/*
+ * Compute the Julian Day number for the given date.
+ * Julian Date is the number of days since noon of Jan 1 4713 B.C.
+ */
+double jd(ny, nm, nd, UT)
+int ny, nm, nd;
+double UT;
+{
+ double A, B, C, D, JD, MJD, day;
+
+ day = nd + UT/24.0;
+
+
+ if ((nm == 1) || (nm == 2)){
+ ny = ny - 1;
+ nm = nm + 12;
+ }
+
+ if (((double)ny+nm/12.0+day/365.25)>=(1582.0+10.0/12.0+15.0/365.25)){
+ A = ((int)(ny / 100.0));
+ B = 2.0 - A + (int)(A/4.0);
+ }
+ else{
+ B = 0.0;
+ }
+
+ if (ny < 0.0){
+ C = (int)((365.25*(double)ny) - 0.75);
+ }
+ else{
+ C = (int)(365.25*(double)ny);
+ }
+
+ D = (int)(30.6001*(double)(nm+1));
+
+
+ JD = B + C + D + day + 1720994.5;
+ return(JD);
+
+}
+
+double hour24(hour)
+double hour;
+{
+ int n;
+
+ if (hour < 0.0){
+ n = (int)(hour/24.0) - 1;
+ return(hour-n*24.0);
+ }
+ else if (hour > 24.0){
+ n = (int)(hour/24.0);
+ return(hour-n*24.0);
+ }
+ else{
+ return(hour);
+ }
+}
+
+double frac(double x){
+
+ x -= (int)x;
+ return( (x<0) ? x+1.0 : x );
+
+}
+
diff --git a/wmSun/wmSun.1 b/wmSun/wmSun.1
new file mode 100644
index 0000000..4dad26a
--- /dev/null
+++ b/wmSun/wmSun.1
@@ -0,0 +1,42 @@
+.TH WMSUN 1 "5 January 1999"
+.SH NAME
+WMSUN \- Dockable WindowMaker SunRise/SunSet App
+.SH SYNOPSIS
+.B wmSun
+[-h] [-display <Display>] [-lat <Latitude>] [-lon <Longitude>] [-td <TimeDiff>] [-date <yyyymmdd>]
+.SH DESCRIPTION
+.PP
+wmSun displays the current day's Sun Rise and Set Times. You must enter your
+LAtitude and Longitude correctly for it to work.
+.SH OPTIONS
+.TP
+.B \-h
+Display list of command-line options.
+.TP
+.B \-display <display>
+Use an alternate X Display.
+.TP
+.B \-lat <Latitude>
+Set latitude of observer.
+.TP
+.B \-lon <Longitude>
+Set longitude of observer.
+.TP
+.B \-td <UT - LT>
+Set the difference beteeen UT and LT. Useful when you want to show the
+Sunrise/Sunset at a remote lat/lon without resetting your clock.
+.TP
+.B \-date <yyyymmdd>
+Set the date to show sunrise/sunset for.
+.SH EXAMPLES
+.TP
+.B wmSun -lon 106.3 -lat 35.9
+this would display rise/set times at Los Alamos in local time.
+.TP
+.B wmSun -lat 19.58 -lon 155.92 -td 10
+this would display rise/set times in Kona, Hawaii in local time (in winter -- you need to
+take into account daylight savings at other times of the year).
+.SH BUGS
+Who knows? (Let me know if you find any).
+.SH AUTHOR
+Michael G. Henderson <mghenderson at lanl.gov>
diff --git a/wmSun/wmSun.c b/wmSun/wmSun.c
new file mode 100644
index 0000000..d2e33ce
--- /dev/null
+++ b/wmSun/wmSun.c
@@ -0,0 +1,376 @@
+/*
+ *
+ * wmSun-1.03 (C) 1999 Mike Henderson (mghenderson at lanl.gov)
+ *
+ * - Shows Sun Rise/Set Times....
+ *
+ *
+ *
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program (see the file COPYING); if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA
+ *
+ * Things TODO:
+ * - clean up code!
+ * - support for 8-bit displays.
+ * - more detailed documentation.
+ * - eclipses?
+ * - add buttons to play will date and lat lon...
+ * Could be something like this;
+ * First click brings up buttons to change date.
+ * Second click brings up buttons to change lat/lon.
+ * Third goes back to display
+ * Set time delay to go back to display if user doesnt do it...
+ *
+ *
+ *
+ *
+ *
+ * Changes:
+ *
+ * Version 1.03 - released February 4, 1999.
+ * cosmetic for AfterStep users. removed spurious black line at RHS edge an mask.
+ *
+ *
+ * Version 1.02 - released January 12, 1999.
+ * Added support for User-specified date and Time difference so that
+ * you can have the display be correct in local time even for remote
+ * lat/lons. (I am in Hawaii right now. I dont want to reset the time on
+ * my laptop, so with these new options I can still get the correct
+ * local times of rise/set. Sunset is awesome here in Kona!!! And the calcs
+ * seem to be quite good -- it's a good test here because the Sun sets over
+ * the Pacific (no mountains are in the way)).
+ *
+ * Version 1.01 - released January 6, 1999.
+ * Fixed stupid bug in Date change montior.
+ *
+ * Version 1.0 - released January 5, 1999.
+ *
+ *
+ */
+
+
+
+
+
+/*
+ * Includes
+ */
+#include <stdio.h>
+#include <math.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <X11/X.h>
+#include <X11/xpm.h>
+#include "../wmgeneral/wmgeneral.h"
+#include "wmSun_master.xpm"
+#include "wmSun_mask.xbm"
+
+
+
+/*
+ * Delay between refreshes (in microseconds)
+ */
+#define DELAY 10000L
+#define WMSUN_VERSION "1.03"
+
+#define DegPerRad 57.29577951308232087680
+#define RadPerDeg 0.01745329251994329576
+
+
+
+
+
+void ParseCMDLine(int argc, char *argv[]);
+void pressEvent(XButtonEvent *xev);
+
+
+int ToggleWindow = 0;
+int nMAX = 1;
+int Flag = 1;
+int UseUserTimeDiff = 0;
+int UseUserDate = 0;
+long UserDate;
+double Glat, Glon, SinGlat, CosGlat, TimeZone, UserTimeDiff;
+
+
+int xDigit[11] = {8, 18, 27, 37, 46, 55, 64, 74, 83, 92, 102};
+
+
+
+
+/*
+ * main
+ */
+int main(int argc, char *argv[]) {
+
+
+
+
+
+ struct tm *GMTTime, *LocalTime;
+ XEvent event;
+ int i, n, k, j, ImageNumber;
+ int Year, Month, DayOfWeek, OldLocalDayOfMonth;
+ int LocalDayOfMonth, DayOfMonth;
+ int Hours, Mins, Secs, OldSecs, digit, xoff, xsize;
+ long CurrentLocalTime, CurrentGMTTime, date;
+ double UT, val, RA, DEC, LTRise, LTSet, LocalHour, hour24();
+ int D, H, M, S, sgn, A, B, q;
+ char str[10];
+
+
+
+
+
+
+ /*
+ * Parse any command line arguments.
+ */
+ Glat = Glon = 0.0;
+ ParseCMDLine(argc, argv);
+ Glat *= RadPerDeg; SinGlat = sin( Glat ); CosGlat = cos( Glat );
+
+
+
+ openXwindow(argc, argv, wmSun_master, wmSun_mask_bits, wmSun_mask_width, wmSun_mask_height);
+
+
+
+
+
+ /*
+ * Loop until we die
+ */
+ n = 32000;
+ OldLocalDayOfMonth = -999;
+ while(1) {
+
+
+ if (Flag) {
+ n = 32000;
+ Flag = 0;
+ }
+
+
+
+
+ /*
+ * The Moon Ephemeris calculations are somewhat costly (the Moon is one of the most
+ * difficult objects to compute position for). So only process every nMAXth cycle of this
+ * loop. We run outer loop it faster to catch expose events, button presses, etc...
+ *
+ */
+ if (n>nMAX){
+
+ n = 0;
+ nMAX = 1000;
+
+
+ CurrentGMTTime = time(CurrentTime); GMTTime = gmtime(&CurrentGMTTime);
+ DayOfMonth = GMTTime->tm_mday;
+
+ UT = GMTTime->tm_hour + GMTTime->tm_min/60.0 + GMTTime->tm_sec/3600.0;
+ Year = GMTTime->tm_year+1900;
+ Month = GMTTime->tm_mon+1;
+
+
+ CurrentLocalTime = CurrentGMTTime; LocalTime = localtime(&CurrentLocalTime);
+ LocalDayOfMonth = LocalTime->tm_mday;
+
+ if ((OldLocalDayOfMonth != LocalDayOfMonth)||(Flag)){
+
+ Flag = 0;
+
+ if (UseUserDate){
+ date = UserDate;
+ Year = date/10000;
+ date -= Year*10000;
+ Month = date/100;
+ date -= Month*100;
+ DayOfMonth = date;
+ date = UserDate;
+ } else {
+ date = Year*10000 + Month*100 + DayOfMonth;
+ }
+ LocalHour = LocalTime->tm_hour + LocalTime->tm_min/60.0 + LocalTime->tm_sec/3600.0;
+ TimeZone = (UseUserTimeDiff) ? UserTimeDiff : UT - LocalHour;
+
+ /*
+ * Clear Plotting area
+ */
+ copyXPMArea(65, 5, 54, 54, 5, 5);
+
+
+
+ /*
+ * Compute Sun Rise/Set Times in Local Time
+ */
+ SunRise(Year, Month, DayOfMonth, LocalHour, <Rise, <Set);
+
+ if (LTRise > 0.0){
+ val = LTRise;
+ H = (int)val; val = (val-H)*60.0;
+ M = (int)val;
+ copyXPMArea(xDigit[H/10], 73, 7, 9, 17, 13);
+ copyXPMArea(xDigit[H%10], 73, 7, 9, 17+7, 13);
+ copyXPMArea(xDigit[10], 75, 3, 6, 17+15, 15);
+ copyXPMArea(xDigit[M/10], 73, 7, 9, 17+19, 13);
+ copyXPMArea(xDigit[M%10], 73, 7, 9, 17+26, 13);
+ } else {
+ copyXPMArea(10, 84, 28, 7, 19, 15);
+ }
+
+
+ if (LTSet > 0.0){
+ val = LTSet;
+ H = (int)val; val = (val-H)*60.0;
+ M = (int)val;
+ copyXPMArea(xDigit[H/10], 73, 7, 9, 17, 40);
+ copyXPMArea(xDigit[H%10], 73, 7, 9, 17+7, 40);
+ copyXPMArea(xDigit[10], 75, 3, 6, 17+15, 42);
+ copyXPMArea(xDigit[M/10], 73, 7, 9, 17+19, 40);
+ copyXPMArea(xDigit[M%10], 73, 7, 9, 17+26, 40);
+ } else {
+ copyXPMArea(10, 84, 28, 7, 19, 40);
+ }
+
+ }
+
+ OldLocalDayOfMonth = LocalDayOfMonth;
+
+
+ } else {
+
+ /*
+ * Update the counter.
+ */
+ ++n;
+
+ }
+
+
+
+
+
+
+
+
+ /*
+ * Process any pending X events.
+ */
+ while(XPending(display)){
+ XNextEvent(display, &event);
+ switch(event.type){
+ case Expose:
+ RedrawWindow();
+ break;
+ case ButtonPress:
+ pressEvent(&event.xbutton);
+ break;
+ case ButtonRelease:
+ break;
+ }
+ }
+
+
+
+
+
+
+ /*
+ * Redraw and wait for next update
+ */
+ RedrawWindow();
+ usleep(DELAY);
+
+
+ }
+
+
+
+}
+
+
+
+
+
+
+
+
+/*
+ * ParseCMDLine()
+ */
+void ParseCMDLine(int argc, char *argv[]) {
+
+ int i;
+
+ for (i = 1; i < argc; i++) {
+
+ if (!strcmp(argv[i], "-display")){
+
+ ++i;
+
+ } else if (!strcmp(argv[i], "-lat")){
+
+ Glat = atof(argv[++i]);
+
+ } else if (!strcmp(argv[i], "-lon")){
+
+ Glon = atof(argv[++i]);
+
+ } else if (!strcmp(argv[i], "-td")){
+
+ UseUserTimeDiff = 1;
+ UserTimeDiff = atof(argv[++i]);
+
+ } else if (!strcmp(argv[i], "-date")){
+
+ UseUserDate = 1;
+ UserDate = atoi(argv[++i]);
+
+ } else {
+ printf("\nwmSun version: %s\n", WMSUN_VERSION);
+ printf("\nusage: wmSun [-display <Display>] [-lat <Latitude>] [-lon <Longitude>] [-h]\n\n");
+ printf("\t-display <Display>\tUse alternate X display.\n");
+ printf("\t-lat <Latitude>\t\tObservers Latitude. Positive to the west.\n");
+ printf("\t-lon <Longitude>\tObservers Longitude.\n");
+ printf("\t-td <Delta Time>\tUser defined difference between UT an LT (hours).\n");
+ printf("\t-h\t\t\tDisplay help screen.\n\n");
+ exit(1);
+ }
+ }
+
+}
+
+
+/*
+ * This routine handles button presses. Clicking in the window
+ * toggles the display.
+ *
+ */
+void pressEvent(XButtonEvent *xev){
+
+ ++ToggleWindow;
+ if (ToggleWindow > 4) ToggleWindow = 0;
+ Flag = 1;
+
+ return;
+
+}
+
diff --git a/wmSun/wmSun_mask.xbm b/wmSun/wmSun_mask.xbm
new file mode 100644
index 0000000..f334241
--- /dev/null
+++ b/wmSun/wmSun_mask.xbm
@@ -0,0 +1,38 @@
+#define wmSun_mask_width 64
+#define wmSun_mask_height 64
+static char wmSun_mask_bits[] = {
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,
+ 0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,
+ 0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,
+ 0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00};
diff --git a/wmSun/wmSun_master.xpm b/wmSun/wmSun_master.xpm
new file mode 100644
index 0000000..57cecc1
--- /dev/null
+++ b/wmSun/wmSun_master.xpm
@@ -0,0 +1,354 @@
+/* XPM */
+static char *wmSun_master[] = {
+/* width height num_colors chars_per_pixel */
+" 119 91 256 2",
+/* colors */
+".. c #000000",
+".# c #040204",
+".a c #02023a",
+".b c #2b2c35",
+".c c #020247",
+".d c #02025e",
+".e c #1a1a5c",
+".f c #06066c",
+".g c #0e0e61",
+".h c #020273",
+".i c #0a0a72",
+".j c #0e0e74",
+".k c #121274",
+".l c #1a1a7c",
+".m c #323442",
+".n c #303840",
+".o c #3a3a4a",
+".p c #2a2a7c",
+".q c #36367c",
+".r c #3a3a7c",
+".s c #384048",
+".t c #43414b",
+".u c #404350",
+".v c #464952",
+".w c #484a58",
+".x c #485058",
+".y c #505260",
+".z c #020284",
+".A c #020686",
+".B c #020a8c",
+".C c #020e8d",
+".D c #0a0a84",
+".E c #0a128c",
+".F c #021292",
+".G c #021694",
+".H c #021a96",
+".I c #021e9c",
+".J c #0e1a94",
+".K c #121284",
+".L c #161687",
+".M c #02229c",
+".N c #122a9c",
+".O c #0226a3",
+".P c #022aa4",
+".Q c #022eab",
+".R c #0e2ea4",
+".S c #0232ac",
+".T c #0236af",
+".U c #023ab4",
+".V c #023eb4",
+".W c #1a2ea4",
+".X c #1232a4",
+".Y c #1a39a8",
+".Z c #22228c",
+".0 c #28329c",
+".1 c #3e3e8c",
+".2 c #32349c",
+".3 c #3a3a94",
+".4 c #303ca4",
+".5 c #0242b4",
+".6 c #0246bc",
+".7 c #1a4eb8",
+".8 c #2a4ab4",
+".9 c #2652bc",
+"#. c #324aac",
+"## c #3946ac",
+"#a c #325abc",
+"#b c #3a5ab8",
+"#c c #024ac2",
+"#d c #024ec4",
+"#e c #0252c6",
+"#f c #0256cb",
+"#g c #025acc",
+"#h c #025ed2",
+"#i c #0262d4",
+"#j c #0266d7",
+"#k c #026adc",
+"#l c #026edd",
+"#m c #1a62cc",
+"#n c #127adc",
+"#o c #1a76dc",
+"#p c #0272e4",
+"#q c #0276e5",
+"#r c #0676e5",
+"#s c #027ae9",
+"#t c #027eec",
+"#u c #0a76e4",
+"#v c #1a7ee4",
+"#w c #2678d8",
+"#x c #2c76d4",
+"#y c #326acc",
+"#z c #3a6ecc",
+"#A c #3676d4",
+"#B c #42428c",
+"#C c #4e4e90",
+"#D c #4a4a98",
+"#E c #5e5e8c",
+"#F c #565697",
+"#G c #52529c",
+"#H c #5a5a94",
+"#I c #4646a0",
+"#J c #5252a8",
+"#K c #5656aa",
+"#L c #5a5aac",
+"#M c #545cb4",
+"#N c #5666bc",
+"#O c #6c6c9c",
+"#P c #6262a0",
+"#Q c #6666a4",
+"#R c #6e6eaf",
+"#S c #6262b0",
+"#T c #686ab0",
+"#U c #6a74bc",
+"#V c #7676a8",
+"#W c #7a7aac",
+"#X c #7272b4",
+"#Y c #7676b4",
+"#Z c #7e7eb0",
+"#0 c #7a7abc",
+"#1 c #4266c4",
+"#2 c #426ac4",
+"#3 c #4a6ec4",
+"#4 c #547acc",
+"#5 c #647ac4",
+"#6 c #0282f0",
+"#7 c #0286f4",
+"#8 c #028af6",
+"#9 c #028efa",
+"a. c #0c8ef4",
+"a# c #0292fc",
+"aa c #0396fc",
+"ab c #059afc",
+"ac c #069efc",
+"ad c #0b96fc",
+"ae c #0e92fc",
+"af c #0a9afc",
+"ag c #0a9efc",
+"ah c #1e8aec",
+"ai c #1692f4",
+"aj c #109afc",
+"ak c #119efc",
+"al c #169efc",
+"am c #1b97fa",
+"an c #10a2fc",
+"ao c #12a6fc",
+"ap c #18a2fc",
+"aq c #18a6fc",
+"ar c #1fa6fc",
+"as c #19aafc",
+"at c #2182d3",
+"au c #3c8fc1",
+"av c #269af7",
+"aw c #2e9af4",
+"ax c #2c9ef4",
+"ay c #26a6fc",
+"az c #24aafc",
+"aA c #25aefc",
+"aB c #2aaafc",
+"aC c #2aaefc",
+"aD c #2ab2fc",
+"aE c #32a8fc",
+"aF c #30aefc",
+"aG c #36aefc",
+"aH c #3ea6f4",
+"aI c #30b2fc",
+"aJ c #37b2fc",
+"aK c #34b6fc",
+"aL c #3eb6fc",
+"aM c #599dae",
+"aN c #74aa9c",
+"aO c #4e86dc",
+"aP c #5280d4",
+"aQ c #568edc",
+"aR c #5886d4",
+"aS c #428ee4",
+"aT c #46aaf4",
+"aU c #4aa2f4",
+"aV c #4ea6f4",
+"aW c #44b4fc",
+"aX c #40bafc",
+"aY c #46befc",
+"aZ c #4abafc",
+"a0 c #4dbefc",
+"a1 c #5ea8f0",
+"a2 c #52b2fc",
+"a3 c #52b6fc",
+"a4 c #52bafc",
+"a5 c #52befc",
+"a6 c #5ab6fc",
+"a7 c #5abafc",
+"a8 c #5abefc",
+"a9 c #6e86cc",
+"b. c #6c8acc",
+"b# c #7282c4",
+"ba c #768acc",
+"bb c #7a82c4",
+"bc c #7e92cc",
+"bd c #7892d4",
+"be c #7a9ad4",
+"bf c #7e9edc",
+"bg c #60befc",
+"bh c #67befc",
+"bi c #72a2e4",
+"bj c #74b5f2",
+"bk c #56c2fc",
+"bl c #60c2fc",
+"bm c #62c6fc",
+"bn c #6ac6fc",
+"bo c #78c8fc",
+"bp c #7acefc",
+"bq c #7ecafc",
+"br c #acc478",
+"bs c #c7d166",
+"bt c #e2de54",
+"bu c #ffec42",
+"bv c #8282be",
+"bw c #8686bc",
+"bx c #8e8ebc",
+"by c #8fb78a",
+"bz c #98a0a8",
+"bA c #a0a4b0",
+"bB c #828ecc",
+"bC c #8a9cd4",
+"bD c #9292c4",
+"bE c #9496c8",
+"bF c #969acc",
+"bG c #96aedc",
+"bH c #82aae4",
+"bI c #82aeec",
+"bJ c #82baf4",
+"bK c #92b2e4",
+"bL c #88caf8",
+"bM c #88cafc",
+"bN c #8acefc",
+"bO c #94d2fc",
+"bP c #9ad6fc",
+"bQ c #aadefc",
+"bR c #aee2fc",
+"bS c #b2e2fc",
+"bT c #c8ccd8",
+"bU c #c8d0d8",
+"bV c #d0d0d0",
+"bW c #d0d0d8",
+"bX c #d0d0e0",
+"bY c #d0d4e0",
+"bZ c #d1d8e0",
+"b0 c #d8d8e8",
+"b1 c #d8dce8",
+"b2 c #d8e0e8",
+"b3 c #e0e0f0",
+"b4 c #e0e4f0",
+"b5 c #e0e8f0",
+"b6 c #e8e8f8",
+"b7 c #e8ecf8",
+"b8 c #e8f0f8",
+"b9 c #f0f1f8",
+/* pixels */
+"b9b9b9b9b9b8b8b8b7b7b7b7b7b7b7b6b6b5b5b5b5b4b4b4b4b4b4b3b3b2b2b2b2b1b1b1b1b1b1b1b0bZbZbZbZbZbYbYbYbYbYbYbXbWbUbUbUbUbUbTbTbTbA................................................................................................................",
+"b9b9b9b9b8b8b8b7b7b7b7b7b7b7b6b6b5b5b5b5b4b4b4b4b4b4b3b3b2b2b2b2b1b1b1b1b1b1b1b0bZbZbZbZbZbYbYbYbYbYbYbXbWbUbUbUbUbUbTbTbTbT.y................................................................................................................",
+"b9b9bzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbz.y................................................................................................................",
+"b9b9bzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbz.y................................................................................................................",
+"b9b8bzbz................................................................................................................bzbz.y................................................................................................................",
+"b8b8bzbz...a.a.c.a.c.c.d.c.c.d.d.d.h.d.h.h.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z...d.d.d.d.d.d.h.d.d.h.d.h.d.h.h.h.h.h.h.z.z.B.B.H.O.H.C.G.P.P.O.H.B.A.h.h.z.h.h.d.h.d.d.c.d.c.c.c.a.a.a.a.a.abVbzbz.b.....d.d.d.d.d.d.h.d.d.h.d.h.d.h.h.h.h.h.h.z.z.B.B.H.O.H.C.G.P.P.O.H.B.A.h.h.z.h.h.d.h.d.d.c.d.c.c.c.a.a.a.a.a.a",
+"bTbTbzbzbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbVbzbz.b................................................................................................................",
+"bTbTbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbz.b................................................................................................................",
+"bTbTbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbz.b................................................................................................................",
+"bA.y.y.y.y.y.y.y.y.x.x.x.w.w.w.w.w.w.w.w.w.v.u.u.u.u.u.u.u.u.u.u.u.t.s.s.s.o.o.o.o.o.o.o.o.o.n.n.n.n.m.m.m.m.m.m.m.m.b.b.b.b.b................................................................................................................",
+"..............................................................................................................................................................................................................................................",
+".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#..............................................................................................................",
+"..............................................................................................................................................................................................................................................",
+"..............................................................................................................................................................................................................................................",
+"..............................................................................................................................................................................................................................................",
+"..............................................................................................................................................................................................................................................",
+"..............................................................................................................................................................................................................................................",
+"..........#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r................",
+"..........#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r................",
+"..........#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r................",
+"..........#r#r#r#r#rataMat#r#r#r#r#r#r#rauaMat#r#r#r#r#r#raMaMat#r#r#r#r#r#raMaMau#r#r#r#r#r#r#rauaMaMat#r#r#r#rauaMaMaMau#r#r#r#r#r#rataMat#r#r#r#raMaMaMaMaMau#r#r#r#r#rauaMat#r#r#r#r#r#rataMat#r#r#r#r#r#r#r#r#r#r#r#r#r#r................",
+"..........#r#r#r#raMbububuaM#r#r#r#raMbtbubuaM#r#r#r#raMbubububuaM#r#r#r#rbtbubububy#r#r#r#r#ratbububuaM#r#r#r#rbsbubububr#r#r#r#r#rbrbubuaM#r#r#r#rbubububububr#r#r#r#rbsbububuau#r#r#r#raNbububuaM#r#r#r#r#r#r#r#r#r#r#r#r#r................",
+"..........#r#r#r#rbtbuaMbubu#r#r#r#raNbtbtbuaM#r#r#r#raNbsaMbybubu#r#r#r#rbyaNaNbubu#r#r#r#r#rbybubsbuaM#r#r#r#rbubyaMaMau#r#r#r#rbybubsaMat#r#r#r#raMaMaMbtbuaN#r#r#raMbubsbybubr#r#r#ratbubtaMbtbuat#r#r#ratau#r#r#r#r#r#r#r................",
+"..........#r#r#raMbubr#rbrbuaM#r#r#rat#rbrbuaM#r#r#r#rat#r#r#rbubt#r#r#r#r#raMaNbubs#r#r#r#raububybrbuaM#r#r#r#rbubsbraM#r#r#r#ratbubtbybrau#r#r#r#r#r#raububt#r#r#r#raububtbrbuaN#r#r#raMbubr#rbrbuaM#r#r#rbtbuau#r#r#r#r#r#r................",
+"..........#r#r#raMbubr#rbrbuaM#r#r#r#r#rbrbuaM#r#r#r#r#r#r#raNbuaM#r#r#r#r#rbububtau#r#r#r#rbsbuatbrbuaM#r#r#raMbububububy#r#r#raMbububububtat#r#r#r#r#rbsbuaN#r#r#r#r#rbybububsat#r#r#raubububrbubuaM#r#r#rbrbtat#r#r#r#r#r#r................",
+"..........#r#r#raMbubr#rbrbuaM#r#r#r#r#rbrbuaM#r#r#r#r#r#raMbuaM#r#r#r#r#r#raMaNbtbuat#r#raububububububuaM#r#r#r#r#raNbubu#r#r#raMbubs#rbsbuaM#r#r#r#raububuat#r#r#r#raMbubrbybubs#r#r#r#rbybubtbtbuau#r#r#r#r#r#r#r#r#r#r#r#r................",
+"..........#r#r#ratbubt#rbtbuat#r#r#r#r#rbrbuaM#r#r#r#r#rbrbuaM#r#r#r#r#r#raN#r#rbsbuaM#r#raubrbrbrbtbubsau#r#ratat#raububt#r#r#raububs#rbsbuaM#r#r#r#rbrbuby#r#r#r#r#rbrbuaNatbubu#r#r#r#r#r#raNbubs#r#r#r#raMby#r#r#r#r#r#r#r................",
+"..........#r#r#r#rbrbubububr#r#r#r#r#r#rbrbuaM#r#r#r#rbybububububu#r#r#raubububububt#r#r#r#r#r#r#rbrbuaM#r#r#raNbubububuaM#r#r#r#rbrbubububt#r#r#r#ratbubuat#r#r#r#r#raMbububububr#r#r#r#rbrbububtat#r#r#r#rbubuaM#r#r#r#r#r#r................",
+"..........#r#r#r#r#raNbraN#r#r#r#r#r#r#raNbrau#r#r#r#raNbrbrbrbrbr#r#r#r#raNbrbraNat#r#r#r#r#r#r#raNbrau#r#r#raubrbrbrau#r#r#r#r#r#raNbrbyat#r#r#r#raMbraN#r#r#r#r#r#r#raubrbraN#r#r#r#r#raNbraNat#r#r#r#r#raMby#r#r#r#r#r#r#r................",
+"..........#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r................",
+"..........#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r................",
+"..........#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#raM#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r................",
+"..........#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#rbybuby#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r................",
+"..........#r#r#r#r#rauaMaMau#r#rataMaMaM#r#r#raMbuaM#r#rauaMaMau#r#rataMaMaM#r#r#r#r#r........................................................................................................................................................",
+"..........#r#r#r#r#rbrbububr#r#raMbububu#r#r#r#r#r#r#r#rbrbububr#r#raMbububu#r#r#r#r#r........................................................................................................................................................",
+"..........#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#ratbrat#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r........................................................................................................................................................",
+"..........#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#rbrbubr#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r........................................................................................................................................................",
+"..........#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#ratbrat#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r........................................................................................................................................................"
+};
diff --git a/wmgeneral/wmgeneral.c b/wmgeneral/wmgeneral.c
new file mode 100644
index 0000000..a4f13c1
--- /dev/null
+++ b/wmgeneral/wmgeneral.c
@@ -0,0 +1,366 @@
+/*
+ Best viewed with vim5, using ts=4
+
+ wmgeneral was taken from wmppp.
+
+ It has a lot of routines which most of the wm* programs use.
+
+ ------------------------------------------------------------
+
+ Author: Martijn Pieterse (pieterse at xs4all.nl)
+
+ ---
+ CHANGES:
+ ---
+ 02/05/1998 (Martijn Pieterse, pieterse at xs4all.nl)
+ * changed the read_rc_file to parse_rcfile, as suggester by Marcelo E. Magallon
+ * debugged the parse_rc file.
+ 30/04/1998 (Martijn Pieterse, pieterse at xs4all.nl)
+ * Ripped similar code from all the wm* programs,
+ and put them in a single file.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <stdarg.h>
+
+#include <X11/Xlib.h>
+#include <X11/xpm.h>
+#include <X11/extensions/shape.h>
+
+#include "wmgeneral.h"
+
+ /*****************/
+ /* X11 Variables */
+/*****************/
+
+Window Root;
+int screen;
+int x_fd;
+int d_depth;
+XSizeHints mysizehints;
+XWMHints mywmhints;
+Pixel back_pix, fore_pix;
+char *Geometry = "";
+Window iconwin, win;
+GC NormalGC;
+XpmIcon wmgen;
+Pixmap pixmask;
+
+ /*****************/
+ /* Mouse Regions */
+/*****************/
+
+typedef struct {
+ int enable;
+ int top;
+ int bottom;
+ int left;
+ int right;
+} MOUSE_REGION;
+
+#define MAX_MOUSE_REGION (8)
+MOUSE_REGION mouse_region[MAX_MOUSE_REGION];
+
+ /***********************/
+ /* Function Prototypes */
+/***********************/
+
+static void GetXPM(XpmIcon *, char **);
+static Pixel GetColor(char *);
+void RedrawWindow(void);
+void AddMouseRegion(int, int, int, int, int);
+int CheckMouseRegion(int, int);
+
+/*******************************************************************************\
+|* read_rc_file *|
+\*******************************************************************************/
+
+void parse_rcfile(const char *filename, rckeys *keys) {
+
+ char *p;
+ char temp[128];
+ char *tokens = " :\t\n";
+ FILE *fp;
+ int i,key;
+
+ fp = fopen(filename, "r");
+ if (fp) {
+ while (fgets(temp, 128, fp)) {
+ key = 0;
+ while (key >= 0 && keys[key].label) {
+ if ((p = strstr(temp, keys[key].label))) {
+ p += strlen(keys[key].label);
+ p += strspn(p, tokens);
+ if ((i = strcspn(p, "#\n"))) p[i] = 0;
+ free(*keys[key].var);
+ *keys[key].var = strdup(p);
+ key = -1;
+ } else key++;
+ }
+ }
+ fclose(fp);
+ }
+}
+
+
+/*******************************************************************************\
+|* GetXPM *|
+\*******************************************************************************/
+
+static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) {
+
+ XWindowAttributes attributes;
+ int err;
+
+ /* For the colormap */
+ XGetWindowAttributes(display, Root, &attributes);
+
+ wmgen->attributes.valuemask |= (XpmReturnPixels | XpmReturnExtensions);
+
+ err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap),
+ &(wmgen->mask), &(wmgen->attributes));
+
+ if (err != XpmSuccess) {
+ fprintf(stderr, "Not enough free colorcells.\n");
+ exit(1);
+ }
+}
+
+/*******************************************************************************\
+|* GetColor *|
+\*******************************************************************************/
+
+static Pixel GetColor(char *name) {
+
+ XColor color;
+ XWindowAttributes attributes;
+
+ XGetWindowAttributes(display, Root, &attributes);
+
+ color.pixel = 0;
+ if (!XParseColor(display, attributes.colormap, name, &color)) {
+ fprintf(stderr, "wm.app: can't parse %s.\n", name);
+ } else if (!XAllocColor(display, attributes.colormap, &color)) {
+ fprintf(stderr, "wm.app: can't allocate %s.\n", name);
+ }
+ return color.pixel;
+}
+
+/*******************************************************************************\
+|* flush_expose *|
+\*******************************************************************************/
+
+static int flush_expose(Window w) {
+
+ XEvent dummy;
+ int i=0;
+
+ while (XCheckTypedWindowEvent(display, w, Expose, &dummy))
+ i++;
+
+ return i;
+}
+
+/*******************************************************************************\
+|* RedrawWindow *|
+\*******************************************************************************/
+
+void RedrawWindow(void) {
+
+ flush_expose(iconwin);
+ XCopyArea(display, wmgen.pixmap, iconwin, NormalGC,
+ 0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0);
+ flush_expose(win);
+ XCopyArea(display, wmgen.pixmap, win, NormalGC,
+ 0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0);
+}
+
+/*******************************************************************************\
+|* RedrawWindowXY *|
+\*******************************************************************************/
+
+void RedrawWindowXY(int x, int y) {
+
+ flush_expose(iconwin);
+ XCopyArea(display, wmgen.pixmap, iconwin, NormalGC,
+ x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0);
+ flush_expose(win);
+ XCopyArea(display, wmgen.pixmap, win, NormalGC,
+ x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0);
+}
+
+/*******************************************************************************\
+|* AddMouseRegion *|
+\*******************************************************************************/
+
+void AddMouseRegion(int index, int left, int top, int right, int bottom) {
+
+ if (index < MAX_MOUSE_REGION) {
+ mouse_region[index].enable = 1;
+ mouse_region[index].top = top;
+ mouse_region[index].left = left;
+ mouse_region[index].bottom = bottom;
+ mouse_region[index].right = right;
+ }
+}
+
+/*******************************************************************************\
+|* CheckMouseRegion *|
+\*******************************************************************************/
+
+int CheckMouseRegion(int x, int y) {
+
+ int i;
+ int found;
+
+ found = 0;
+
+ for (i=0; i<MAX_MOUSE_REGION && !found; i++) {
+ if (mouse_region[i].enable &&
+ x <= mouse_region[i].right &&
+ x >= mouse_region[i].left &&
+ y <= mouse_region[i].bottom &&
+ y >= mouse_region[i].top)
+ found = 1;
+ }
+ if (!found) return -1;
+ return (i-1);
+}
+
+/*******************************************************************************\
+|* copyXPMArea *|
+\*******************************************************************************/
+
+void copyXPMArea(int x, int y, int sx, int sy, int dx, int dy) {
+
+ XCopyArea(display, wmgen.pixmap, wmgen.pixmap, NormalGC, x, y, sx, sy, dx, dy);
+
+}
+
+/*******************************************************************************\
+|* copyXBMArea *|
+\*******************************************************************************/
+
+void copyXBMArea(int x, int y, int sx, int sy, int dx, int dy) {
+
+ XCopyArea(display, wmgen.mask, wmgen.pixmap, NormalGC, x, y, sx, sy, dx, dy);
+}
+
+
+/*******************************************************************************\
+|* setMaskXY *|
+\*******************************************************************************/
+
+void setMaskXY(int x, int y) {
+
+ XShapeCombineMask(display, win, ShapeBounding, x, y, pixmask, ShapeSet);
+ XShapeCombineMask(display, iconwin, ShapeBounding, x, y, pixmask, ShapeSet);
+}
+
+/*******************************************************************************\
+|* openXwindow *|
+\*******************************************************************************/
+void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, int pixmask_width, int pixmask_height) {
+
+ unsigned int borderwidth = 1;
+ XClassHint classHint;
+ char *display_name = NULL;
+ char *wname = argv[0];
+ XTextProperty name;
+
+ XGCValues gcv;
+ unsigned long gcm;
+
+
+ int dummy=0;
+ int i;
+
+ for (i=1; argv[i]; i++) {
+ if (!strcmp(argv[i], "-display"))
+ display_name = argv[i+1];
+ }
+
+ if (!(display = XOpenDisplay(display_name))) {
+ fprintf(stderr, "%s: can't open display %s\n",
+ wname, XDisplayName(display_name));
+ exit(1);
+ }
+ screen = DefaultScreen(display);
+ Root = RootWindow(display, screen);
+ d_depth = DefaultDepth(display, screen);
+ x_fd = XConnectionNumber(display);
+
+ /* Convert XPM to XImage */
+ GetXPM(&wmgen, pixmap_bytes);
+
+ /* Create a window to hold the stuff */
+ mysizehints.flags = USSize | USPosition;
+ mysizehints.x = 0;
+ mysizehints.y = 0;
+
+ back_pix = GetColor("white");
+ fore_pix = GetColor("black");
+
+ XWMGeometry(display, screen, Geometry, NULL, borderwidth, &mysizehints,
+ &mysizehints.x, &mysizehints.y,&mysizehints.width,&mysizehints.height, &dummy);
+
+ mysizehints.width = 64;
+ mysizehints.height = 64;
+
+ win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y,
+ mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
+
+ iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y,
+ mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
+
+ /* Activate hints */
+ XSetWMNormalHints(display, win, &mysizehints);
+ classHint.res_name = wname;
+ classHint.res_class = wname;
+ XSetClassHint(display, win, &classHint);
+
+ XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask);
+ XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask);
+
+ if (XStringListToTextProperty(&wname, 1, &name) == 0) {
+ fprintf(stderr, "%s: can't allocate window name\n", wname);
+ exit(1);
+ }
+
+ XSetWMName(display, win, &name);
+
+ /* Create GC for drawing */
+
+ gcm = GCForeground | GCBackground | GCGraphicsExposures;
+ gcv.foreground = fore_pix;
+ gcv.background = back_pix;
+ gcv.graphics_exposures = 0;
+ NormalGC = XCreateGC(display, Root, gcm, &gcv);
+
+ /* ONLYSHAPE ON */
+
+ pixmask = XCreateBitmapFromData(display, win, pixmask_bits, pixmask_width, pixmask_height);
+
+ XShapeCombineMask(display, win, ShapeBounding, 0, 0, pixmask, ShapeSet);
+ XShapeCombineMask(display, iconwin, ShapeBounding, 0, 0, pixmask, ShapeSet);
+
+ /* ONLYSHAPE OFF */
+
+ mywmhints.initial_state = WithdrawnState;
+ mywmhints.icon_window = iconwin;
+ mywmhints.icon_x = mysizehints.x;
+ mywmhints.icon_y = mysizehints.y;
+ mywmhints.window_group = win;
+ mywmhints.flags = StateHint | IconWindowHint | IconPositionHint | WindowGroupHint;
+
+ XSetWMHints(display, win, &mywmhints);
+
+ XSetCommand(display, win, argv, argc);
+ XMapWindow(display, win);
+
+}
diff --git a/wmgeneral/wmgeneral.h b/wmgeneral/wmgeneral.h
new file mode 100644
index 0000000..55b37dd
--- /dev/null
+++ b/wmgeneral/wmgeneral.h
@@ -0,0 +1,50 @@
+#ifndef WMGENERAL_H_INCLUDED
+#define WMGENERAL_H_INCLUDED
+
+ /***********/
+ /* Defines */
+/***********/
+
+#define MAX_MOUSE_REGION (8)
+
+ /************/
+ /* Typedefs */
+/************/
+
+typedef struct _rckeys rckeys;
+
+struct _rckeys {
+ const char *label;
+ char **var;
+};
+
+typedef struct {
+ Pixmap pixmap;
+ Pixmap mask;
+ XpmAttributes attributes;
+} XpmIcon;
+
+ /*******************/
+ /* Global variable */
+/*******************/
+
+Display *display;
+
+ /***********************/
+ /* Function Prototypes */
+/***********************/
+
+void AddMouseRegion(int index, int left, int top, int right, int bottom);
+int CheckMouseRegion(int x, int y);
+
+void openXwindow(int argc, char *argv[], char **, char *, int, int);
+void RedrawWindow(void);
+void RedrawWindowXY(int x, int y);
+
+void copyXPMArea(int, int, int, int, int, int);
+void copyXBMArea(int, int, int, int, int, int);
+void setMaskXY(int, int);
+
+void parse_rcfile(const char *, rckeys *);
+
+#endif
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmsun.git
More information about the Pkg-wmaker-commits
mailing list