Remove trailing whitespace.

This commit is contained in:
Doug Torrance 2017-02-20 19:16:01 -05:00 committed by Carlos R. Mafra
parent a011e83b28
commit 7e78639bb6
83 changed files with 873 additions and 874 deletions

View file

@ -2,7 +2,7 @@ cnslock 1.02 (27th October 2002)
* Added feature to allow applet to be run in window managers such as * Added feature to allow applet to be run in window managers such as
enlightenment, fvwm, etc. enlightenment, fvwm, etc.
cnslock 1.01 (11th October 2002) cnslock 1.01 (11th October 2002)
* First public release. * First public release.

View file

@ -10,7 +10,7 @@ as I have a wireless keyboard with no leds on it.
Bugs Bugs
------------------------------------------------------------ ------------------------------------------------------------
If you discover any bug in this software, please send a If you discover any bug in this software, please send a
bugreport to lists@sprig.dyn.dhs.org and describe the bugreport to lists@sprig.dyn.dhs.org and describe the
problem with as many details as possible. problem with as many details as possible.

View file

@ -78,6 +78,6 @@ void make_new_cnslock_dockapp(int manager_style)
if(posx!=-1 && posy!=-1) if(posx!=-1 && posy!=-1)
gdk_window_move(ad.win, posx, posy); gdk_window_move(ad.win, posx, posy);
#undef MASK #undef MASK
} }

View file

@ -151,7 +151,7 @@ int main(int argc, char **argv)
if (manager_style==0) if (manager_style==0)
gdk_draw_rgb_image(ad.iconwin, ad.gc, XMIN, YMIN, XMAX, YMAX, GDK_RGB_DITHER_NONE, ad.rgb, XMAX * 3); gdk_draw_rgb_image(ad.iconwin, ad.gc, XMIN, YMIN, XMAX, YMAX, GDK_RGB_DITHER_NONE, ad.rgb, XMAX * 3);
else else
gdk_draw_rgb_image(ad.win, ad.gc, XMIN, YMIN, XMAX, YMAX, GDK_RGB_DITHER_NONE, ad.rgb, XMAX * 3); gdk_draw_rgb_image(ad.win, ad.gc, XMIN, YMIN, XMAX, YMAX, GDK_RGB_DITHER_NONE, ad.rgb, XMAX * 3);
} }
return 0; return 0;
@ -188,7 +188,7 @@ void cnslock_update(void)
void prepare_backbuffer(int solid) void prepare_backbuffer(int solid)
{ {
make_rgb_buffer256(ad.rgb,none_data,none_width,none_height,1, *none_cmap); make_rgb_buffer256(ad.rgb,none_data,none_width,none_height,1, *none_cmap);
/* copy it to the "frequent use" buffer */ /* copy it to the "frequent use" buffer */
memcpy(&ad.bgr, &ad.rgb, RGBSIZE); memcpy(&ad.bgr, &ad.rgb, RGBSIZE);
@ -238,7 +238,7 @@ void parse_options(int argc, char *argv[])
manager_style = 1; manager_style = 1;
break; break;
} }
} }
} }
void do_version(void) void do_version(void)

View file

@ -259,7 +259,7 @@ char none_cmap[256][3] = {
{255,255,255}, {255,255,255},
{255,255,255} {255,255,255}
}; };
char none_data[] = { char none_data[] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,

View file

@ -2,7 +2,7 @@
#define DEFINES_H #define DEFINES_H
/* Below this line, there are only defines that users don't have to /* Below this line, there are only defines that users don't have to
care about normally. care about normally.
-----------------------------------------------------------------------------*/ -----------------------------------------------------------------------------*/
/* perform clipping outside this range, also this is the size of the /* perform clipping outside this range, also this is the size of the

View file

@ -1,5 +1,5 @@
/* /*
This code is based upon some lines(actually two lines :-) This code is based upon some lines(actually two lines :-)
in E-Leds by Mathias Meisfjordskar<mathiasm@ifi.uio.no> in E-Leds by Mathias Meisfjordskar<mathiasm@ifi.uio.no>
Released under GPL. Released under GPL.
*/ */

View file

@ -32,10 +32,10 @@ Version 1.23 - released March 20, 1999.
Version 1.22 - released February 24, 1999. Version 1.22 - released February 24, 1999.
Added double click detection and -e command-line option. Added double click detection and -e command-line option.
Version 1.21 - released February 4, 1999. Version 1.21 - released February 4, 1999.
cosmetic for AfterStep users. removed spurious black line at RHS edge an mask. cosmetic for AfterStep users. removed spurious black line at RHS edge an mask.
Version 1.2 - released January 14, 1999. Version 1.2 - released January 14, 1999.
Changed support for LowColor Pixmap. Now, check for Depth Changed support for LowColor Pixmap. Now, check for Depth
automatically. If its <= 8, then use LowColor. automatically. If its <= 8, then use LowColor.

View file

@ -21,14 +21,14 @@ usage: wmCalClock [-b <Volume>] [-tc <Color>] [-bc <Color>] [-e "Command"] [-S]
-S Do not show seconds. -S Do not show seconds.
-24 Show 24-hour time. Default is 12 hour AM/PM Time. -24 Show 24-hour time. Default is 12 hour AM/PM Time.
-g Show Greenwich time. -g Show Greenwich time.
-s Show Greenwich Mean Sidereal Time (GMST) in 24-hour format. -s Show Greenwich Mean Sidereal Time (GMST) in 24-hour format.
-L <Longitude> Show Local Sidereal Time (LST) in 24-hour format. -L <Longitude> Show Local Sidereal Time (LST) in 24-hour format.
Longitude is in degrees (- for West + for East). Longitude is in degrees (- for West + for East).
-l Use a low-color pixmap to conserve colors. On 8-bit displays the -l Use a low-color pixmap to conserve colors. On 8-bit displays the
low color pixmap will always be used. low color pixmap will always be used.
-h Display help screen. -h Display help screen.
Example: wmCalClock -b 100 -tc #001100 -bc #7e9e69 Example: wmCalClock -b 100 -tc #001100 -bc #7e9e69
WindowMaker. WindowMaker.
@ -38,12 +38,12 @@ In WindowMaker simply drag and drop the wmCalClock App on the WindowMaker Dock o
Afterstep. Afterstep.
--------- ---------
Afterstep users put the following in their .steprc "Wharf wmCalClock - MaxSwallow Afterstep users put the following in their .steprc "Wharf wmCalClock - MaxSwallow
"wmCalClock" wmCalClock &". Dont use Afterstep so I have no idea if it works... "wmCalClock" wmCalClock &". Dont use Afterstep so I have no idea if it works...
Note: AfterStep's Wharf supposedly has a problem with pixmaps that are larger Note: AfterStep's Wharf supposedly has a problem with pixmaps that are larger
than 60x60 pixels. Please tell the AfterStep authors to fix this, this is not than 60x60 pixels. Please tell the AfterStep authors to fix this, this is not
our fault, but a Wharf problem! our fault, but a Wharf problem!
Other window managers. Other window managers.
---------------------- ----------------------

View file

@ -10,8 +10,8 @@ Installation
1) gunzip wmCalClock-x.xx.tar.gz 1) gunzip wmCalClock-x.xx.tar.gz
1) tar -xvf wmCalClock-x.xx.tar 1) tar -xvf wmCalClock-x.xx.tar
2) cd wmCalClock-x.xx/Src/ 2) cd wmCalClock-x.xx/Src/
3) make 3) make
4) make install (must be root) 4) make install (must be root)
5) wmCalClock & (or 'wmCalClock -h' for help, or 'man wmCalClock' for the man page) 5) wmCalClock & (or 'wmCalClock -h' for help, or 'man wmCalClock' for the man page)

View file

@ -1,8 +1,8 @@
wmCalClock-1.24 release wmCalClock-1.24 release
----------------------- -----------------------
Author....: Michael G. Henderson <mghenderson@lanl.gov> Author....: Michael G. Henderson <mghenderson@lanl.gov>
Description Description
----------- -----------
wmCalClock is a simple Calendar Clock that uses anti-aliased characters and wmCalClock is a simple Calendar Clock that uses anti-aliased characters and
@ -18,7 +18,7 @@ BUGS Bug reports
CHANGES Change history. CHANGES Change history.
COPYING GNU General Public License Version 2. COPYING GNU General Public License Version 2.
TODO Wish list. TODO Wish list.
Bugs Bugs
----- -----

View file

@ -1,7 +1,7 @@
TODO List TODO List
--------- ---------
- Add in a few more fonts... Graphite would be nice! Or EagleFeather - Add in a few more fonts... Graphite would be nice! Or EagleFeather
(its a Frank Lloyd Wright inspired font)? (its a Frank Lloyd Wright inspired font)?
- Allow fonts to be added externally via some sort of config file... - Allow fonts to be added externally via some sort of config file...
@ -9,17 +9,17 @@ TODO List
- Add alarm clock mode? - Add alarm clock mode?
- graphical Moon-Phase Icon in Calendar section. - graphical Moon-Phase Icon in Calendar section.
- Day numbers in Calendar section. This is something that I would really like myself! - Day numbers in Calendar section. This is something that I would really like myself!
- Allow Changing of fonts/colors for the main Calendar section. - Allow Changing of fonts/colors for the main Calendar section.
- Foreign language support... - Foreign language support...
- Add indicators for Greenwich, sidereal, local sideareal time displays (right now - Add indicators for Greenwich, sidereal, local sideareal time displays (right now
you dont really know what it is displaying just by looking at it)... you dont really know what it is displaying just by looking at it)...

View file

@ -22,7 +22,7 @@ OBJS = wmCalClock.o \
all: wmCalClock.o wmCalClockKbd all: wmCalClock.o wmCalClockKbd
wmCalClock.o: wmCalClock_master.xpm wmCalClock_mask.xbm wmCalClock.o: wmCalClock_master.xpm wmCalClock_mask.xbm
wmCalClockKbd: $(OBJS) wmCalClockKbd: $(OBJS)
$(CC) $(COPTS) $(SYSTEM) -o wmCalClockKbd $^ $(INCDIR) $(LIBDIR) $(LIBS) $(CC) $(COPTS) $(SYSTEM) -o wmCalClockKbd $^ $(INCDIR) $(LIBDIR) $(LIBS)
clean: clean:
@ -33,5 +33,5 @@ clean:
install: wmCalClockKbd install: wmCalClockKbd
install -c -s -m 0755 wmCalClockKbd $(DESTDIR)/bin install -c -s -m 0755 wmCalClockKbd $(DESTDIR)/bin
install -c -m 0644 wmCalClockKbd.1 $(DESTDIR)/share/man/man1 install -c -m 0644 wmCalClockKbd.1 $(DESTDIR)/share/man/man1

View file

@ -1,11 +1,11 @@
/* /*
* *
* wmCalClock-1.25 (C) 1998, 1999 Mike Henderson (mghenderson@lanl.gov) * wmCalClock-1.25 (C) 1998, 1999 Mike Henderson (mghenderson@lanl.gov)
* *
* - Its a Calendar Clock.... * - Its a Calendar Clock....
* *
* *
* *
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -19,7 +19,7 @@
* *
* You should have received a copy of the GNU General Public License * 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 * along with this program (see the file COPYING); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA * Boston, MA 02111-1307, USA
* *
* *
@ -31,10 +31,10 @@
* *
* Version 1.24 - released March 27, 1999. * Version 1.24 - released March 27, 1999.
* Added support for additional fonts for time field; * Added support for additional fonts for time field;
* *
* -tekton for Tekton * -tekton for Tekton
* -arial for Arial (Helvetica) (this is the same font as usual) * -arial for Arial (Helvetica) (this is the same font as usual)
* -luggerbug for LuggerBug * -luggerbug for LuggerBug
* -comicsans for ComicSans * -comicsans for ComicSans
* -jazz for JazzPoster * -jazz for JazzPoster
* *
@ -66,7 +66,7 @@
* *
* Version 1.10 - released January 7, 1999. * Version 1.10 - released January 7, 1999.
* Added support for LowColor Pixmap. (21 colors may still be a * Added support for LowColor Pixmap. (21 colors may still be a
* bit high, but the poor saps with 8-bit displays can at least run * bit high, but the poor saps with 8-bit displays can at least run
* it now.) * it now.)
* *
* Version 1.02 - released January 7, 1999. * Version 1.02 - released January 7, 1999.
@ -84,8 +84,8 @@
/* /*
* Includes * Includes
*/ */
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
@ -102,8 +102,8 @@
/* /*
* Delay between refreshes (in microseconds) * Delay between refreshes (in microseconds)
*/ */
#define DELAY 10000L #define DELAY 10000L
#define WMCALCLOCK_VERSION "1.25" #define WMCALCLOCK_VERSION "1.25"
@ -122,13 +122,13 @@ void print_usage();
int xsMonth[12] = { 150, 170, 190, 212, 233, 256, 276, 294, 317, 337, 357, 380 }; int xsMonth[12] = { 150, 170, 190, 212, 233, 256, 276, 294, 317, 337, 357, 380 };
int xeMonth[12] = { 168, 188, 210, 231, 254, 275, 292, 314, 335, 355, 377, 398 }; int xeMonth[12] = { 168, 188, 210, 231, 254, 275, 292, 314, 335, 355, 377, 398 };
int xdMonth[12]; int xdMonth[12];
int yMonth = 80; int yMonth = 80;
int ydMonth = 13; int ydMonth = 13;
int xsDayOfWeek[7] = { 293, 150, 177, 201, 228, 253, 271 }; int xsDayOfWeek[7] = { 293, 150, 177, 201, 228, 253, 271 };
int xeDayOfWeek[7] = { 314, 175, 199, 226, 250, 269, 290 }; int xeDayOfWeek[7] = { 314, 175, 199, 226, 250, 269, 290 };
int xdDayOfWeek[7]; int xdDayOfWeek[7];
int yDayOfWeek = 95; int yDayOfWeek = 95;
int ydDayOfWeek = 13; int ydDayOfWeek = 13;
/* /*
@ -164,7 +164,7 @@ int ydDayOfMonth = 23;
/* /*
* Luggerbug Font Narrow - 13 pixels high. * Luggerbug Font Narrow - 13 pixels high.
*/ */
int xsDigits_Luggerbug13n[11] = { 75, 84, 92, 101, 110, 119, 127, 136, 143, 151, 159 }; int xsDigits_Luggerbug13n[11] = { 75, 84, 92, 101, 110, 119, 127, 136, 143, 151, 159 };
@ -173,7 +173,7 @@ int xdDigits_Luggerbug13n[11];
int yDigits_Luggerbug13n = 150; int yDigits_Luggerbug13n = 150;
int ydDigits_Luggerbug13n = 13; int ydDigits_Luggerbug13n = 13;
/* /*
* Luggerbug Font - 13 pixels high. * Luggerbug Font - 13 pixels high.
*/ */
int xsDigits_Luggerbug13[11] = { 75, 89, 103, 117, 131, 146, 159, 172, 184, 197, 208 }; int xsDigits_Luggerbug13[11] = { 75, 89, 103, 117, 131, 146, 159, 172, 184, 197, 208 };
@ -182,7 +182,7 @@ int xdDigits_Luggerbug13[11];
int yDigits_Luggerbug13 = 136; int yDigits_Luggerbug13 = 136;
int ydDigits_Luggerbug13 = 13; int ydDigits_Luggerbug13 = 13;
/* /*
* ComicSans Font - 12 pixels high. * ComicSans Font - 12 pixels high.
*/ */
int xsDigits_ComicSans12n[11] = { 338, 349, 359, 370, 380, 390, 401, 411, 422, 432, 444 }; int xsDigits_ComicSans12n[11] = { 338, 349, 359, 370, 380, 390, 401, 411, 422, 432, 444 };
@ -191,7 +191,7 @@ int xdDigits_ComicSans12n[11];
int yDigits_ComicSans12n = 123; int yDigits_ComicSans12n = 123;
int ydDigits_ComicSans12n = 12; int ydDigits_ComicSans12n = 12;
/* /*
* ComicSans Font - 11 pixels high. * ComicSans Font - 11 pixels high.
*/ */
int xsDigits_ComicSans11[11] = { 338, 353, 366, 380, 392, 407, 420, 434, 448, 461, 471 }; int xsDigits_ComicSans11[11] = { 338, 353, 366, 380, 392, 407, 420, 434, 448, 461, 471 };
@ -200,7 +200,7 @@ int xdDigits_ComicSans11[11];
int yDigits_ComicSans11 = 111; int yDigits_ComicSans11 = 111;
int ydDigits_ComicSans11 = 11; int ydDigits_ComicSans11 = 11;
/* /*
* JazzPoster Font Narrow - 12 pixels high. * JazzPoster Font Narrow - 12 pixels high.
*/ */
int xsDigits_JazzPoster12n[11] = { 211, 220, 226, 233, 241, 249, 256, 263, 271, 278, 286 }; int xsDigits_JazzPoster12n[11] = { 211, 220, 226, 233, 241, 249, 256, 263, 271, 278, 286 };
@ -209,7 +209,7 @@ int xdDigits_JazzPoster12n[11];
int yDigits_JazzPoster12n = 122; int yDigits_JazzPoster12n = 122;
int ydDigits_JazzPoster12n = 12; int ydDigits_JazzPoster12n = 12;
/* /*
* JazzPoster Font - 12 pixels high. * JazzPoster Font - 12 pixels high.
*/ */
int xsDigits_JazzPoster12[11] = { 211, 225, 234, 246, 258, 271, 282, 293, 305, 317, 328 }; int xsDigits_JazzPoster12[11] = { 211, 225, 234, 246, 258, 271, 282, 293, 305, 317, 328 };
@ -219,7 +219,7 @@ int yDigits_JazzPoster12 = 109;
int ydDigits_JazzPoster12 = 12; int ydDigits_JazzPoster12 = 12;
/* /*
* Tekton Font - 12 pixels high Narrow (13 pixels high actually). * Tekton Font - 12 pixels high Narrow (13 pixels high actually).
*/ */
int xsDigits_Tekton12n[11] = { 75, 84, 90, 97, 105, 114, 122, 131, 138, 147, 156 }; int xsDigits_Tekton12n[11] = { 75, 84, 90, 97, 105, 114, 122, 131, 138, 147, 156 };
@ -228,7 +228,7 @@ int xdDigits_Tekton12n[11];
int yDigits_Tekton12n = 122; int yDigits_Tekton12n = 122;
int ydDigits_Tekton12n = 13; int ydDigits_Tekton12n = 13;
/* /*
* Tekton Font - 12 pixels high. * Tekton Font - 12 pixels high.
*/ */
int xsDigits_Tekton12[11] = { 75, 89, 98, 111, 124, 137, 150, 164, 176, 191, 205 }; int xsDigits_Tekton12[11] = { 75, 89, 98, 111, 124, 137, 150, 164, 176, 191, 205 };
@ -299,8 +299,8 @@ int LoadLayoutInfo(void);
/* /*
* main * main
*/ */
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
@ -433,12 +433,12 @@ int main(int argc, char *argv[]) {
initXwindow(argc, argv); initXwindow(argc, argv);
if (DisplayDepth <= 8) UseLowColorPixmap = 1; if (DisplayDepth <= 8) UseLowColorPixmap = 1;
@ -480,7 +480,7 @@ int main(int argc, char *argv[]) {
/* /*
* Loop until we die * Loop until we die
*/ */
@ -491,7 +491,7 @@ int main(int argc, char *argv[]) {
/* /*
* Only process every 10th cycle of this loop. We run it faster * Only process every 10th cycle of this loop. We run it faster
* to catch expose events, etc... * to catch expose events, etc...
* *
*/ */
@ -562,7 +562,7 @@ int main(int argc, char *argv[]) {
Flag = (Hours >= 12) ? 1 : 0; Flag = (Hours >= 12) ? 1 : 0;
if (Hours == 0) if (Hours == 0)
Hours = 12; Hours = 12;
else else
Hours = (Hours > 12) ? Hours-12 : Hours; Hours = (Hours > 12) ? Hours-12 : Hours;
} }
@ -592,10 +592,10 @@ int main(int argc, char *argv[]) {
copyXPMArea(5, 110, 54, 15, 5, 5); copyXPMArea(5, 110, 54, 15, 5, 5);
/* /*
* Draw Hours * Draw Hours
*/ */
/* dont show leading zeros */ /* dont show leading zeros */
if (D[0] > -1){ if (D[0] > -1){
digit = D[0]; digit = D[0];
@ -607,14 +607,14 @@ int main(int argc, char *argv[]) {
copyXPMArea(xsDigits[digit], yDigits, xdDigits[digit], ydDigits, xoff+extradx, 7+extrady); copyXPMArea(xsDigits[digit], yDigits, xdDigits[digit], ydDigits, xoff+extradx, 7+extrady);
xoff += (xdDigits[digit]+1); xoff += (xdDigits[digit]+1);
/* /*
* Draw Colon * Draw Colon
*/ */
digit = 10; digit = 10;
copyXPMArea(xsDigits[digit], yDigits, xdDigits[digit], ydDigits, xoff+extradx, 7+extrady); copyXPMArea(xsDigits[digit], yDigits, xdDigits[digit], ydDigits, xoff+extradx, 7+extrady);
xoff += (xdDigits[digit]+1); xoff += (xdDigits[digit]+1);
/* /*
* Draw Minutes * Draw Minutes
*/ */
digit = D[3]; digit = D[3];
@ -627,14 +627,14 @@ int main(int argc, char *argv[]) {
if (ShowSeconds){ if (ShowSeconds){
/* /*
* Draw Colon * Draw Colon
*/ */
digit = 10; digit = 10;
copyXPMArea(xsDigits[digit], yDigits, xdDigits[digit], ydDigits, xoff+extradx, 7+extrady); copyXPMArea(xsDigits[digit], yDigits, xdDigits[digit], ydDigits, xoff+extradx, 7+extrady);
xoff += (xdDigits[digit]+1); xoff += (xdDigits[digit]+1);
/* /*
* Draw Seconds * Draw Seconds
*/ */
digit = D[6]; digit = D[6];
@ -665,7 +665,7 @@ int main(int argc, char *argv[]) {
if (Beep){ if (Beep){
if ((Mins == 0)&&(Secs == 0)&&(OldSecs != Secs)) XBell(display, Volume); if ((Mins == 0)&&(Secs == 0)&&(OldSecs != Secs)) XBell(display, Volume);
OldSecs = Secs; OldSecs = Secs;
} }
@ -682,18 +682,18 @@ int main(int argc, char *argv[]) {
copyXPMArea(5, 70, 54, 35, 5, 24); copyXPMArea(5, 70, 54, 35, 5, 24);
/* /*
* Draw Day of Week and Month * Draw Day of Week and Month
*/ */
wid = xdDayOfWeek[DayOfWeek] + xdMonth[Month] + 1; wid = xdDayOfWeek[DayOfWeek] + xdMonth[Month] + 1;
copyXPMArea(xsDayOfWeek[DayOfWeek], yDayOfWeek, xdDayOfWeek[DayOfWeek], copyXPMArea(xsDayOfWeek[DayOfWeek], yDayOfWeek, xdDayOfWeek[DayOfWeek],
ydMonth, 33-wid/2, 64-24-4-12); ydMonth, 33-wid/2, 64-24-4-12);
copyXPMArea(xsMonth[Month], yMonth, xdMonth[Month], copyXPMArea(xsMonth[Month], yMonth, xdMonth[Month],
ydMonth, 33-wid/2+xdDayOfWeek[DayOfWeek]+1, 64-24-4-12); ydMonth, 33-wid/2+xdDayOfWeek[DayOfWeek]+1, 64-24-4-12);
/* /*
* Draw Day of Month * Draw Day of Month
*/ */
copyXPMArea(xsDayOfMonth[DayOfMonth], yDayOfMonth[DayOfMonth], xdDayOfMonth[DayOfMonth], ydDayOfMonth, 32-xdDayOfMonth2[DayOfMonth]/2, 36); copyXPMArea(xsDayOfMonth[DayOfMonth], yDayOfMonth[DayOfMonth], xdDayOfMonth[DayOfMonth], ydDayOfMonth, 32-xdDayOfMonth2[DayOfMonth]/2, 36);
@ -715,7 +715,7 @@ int main(int argc, char *argv[]) {
} else { } else {
/* /*
* Update the counter. * Update the counter.
*/ */
++n; ++n;
@ -745,7 +745,7 @@ int main(int argc, char *argv[]) {
/* /*
* Process any pending X events. * Process any pending X events.
*/ */
while(XPending(display)) { while(XPending(display)) {
@ -782,9 +782,9 @@ int main(int argc, char *argv[]) {
/* /*
* Redraw and wait for next update * Redraw and wait for next update
*/ */
RedrawWindow(); RedrawWindow();
if( HasExecute == 1) { if( HasExecute == 1) {
@ -809,13 +809,13 @@ int main(int argc, char *argv[]) {
/* /*
* ParseCMDLine() * ParseCMDLine()
*/ */
void ParseCMDLine(int argc, char *argv[]) { void ParseCMDLine(int argc, char *argv[]) {
int i; int i;
for (i = 1; i < argc; i++) { for (i = 1; i < argc; i++) {
if (!strcmp(argv[i], "-display")){ if (!strcmp(argv[i], "-display")){
@ -942,8 +942,8 @@ int i;
} }
} }
if (!ShowSeconds && !UseArial && !UseJazzPoster if (!ShowSeconds && !UseArial && !UseJazzPoster
&& !UseComicSans && !UseLuggerbug) UseTekton = 1; && !UseComicSans && !UseLuggerbug) UseTekton = 1;
@ -1132,7 +1132,7 @@ int LoadLayoutInfo(void) {
return (-1); return (-1);
} }
groups = kb_desc->ctrls->num_groups; groups = kb_desc->ctrls->num_groups;
/* printf("You have configured %u keyboard groups.\n", groups); /* printf("You have configured %u keyboard groups.\n", groups);
printf("Your keyboard have following groups:\n"); printf("Your keyboard have following groups:\n");

View file

@ -1,4 +1,4 @@
.TH WMCALCLOCK 1 "12 September 2003" .TH WMCALCLOCK 1 "12 September 2003"
.SH NAME .SH NAME
WMCALCLOCK \- Dockable Calendar Clock Keyboard Indicator WMCALCLOCK \- Dockable Calendar Clock Keyboard Indicator
.SH SYNOPSIS .SH SYNOPSIS
@ -6,7 +6,7 @@ WMCALCLOCK \- Dockable Calendar Clock Keyboard Indicator
[-h] [-display <Display>] [-b <Volume>] [-e <Command>] [-24] [-s] [-S] [-L <Longitude>] [-l] [-tc <color>] [-bc <color>] [-tekton] [-comicsans] [-arial] [-luggerbug] [-jazz] [-kb <Images>] [-kbt <0.0-1.0>] [-h] [-display <Display>] [-b <Volume>] [-e <Command>] [-24] [-s] [-S] [-L <Longitude>] [-l] [-tc <color>] [-bc <color>] [-tekton] [-comicsans] [-arial] [-luggerbug] [-jazz] [-kb <Images>] [-kbt <0.0-1.0>]
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
wmCalClock is a simple Calendar Clock with anti-aliased text and drop-shadows, which can also indicate your keyboard group wmCalClock is a simple Calendar Clock with anti-aliased text and drop-shadows, which can also indicate your keyboard group
.SH OPTIONS .SH OPTIONS
.TP .TP
.B \-h .B \-h
@ -19,31 +19,31 @@ Use an alternate X Display.
Beep on the hour with specified volume (between -100 and 100). Beep on the hour with specified volume (between -100 and 100).
.TP .TP
.B \-e <Command> .B \-e <Command>
Command to execute via double click of mouse button 1. (Use quotes if your command Command to execute via double click of mouse button 1. (Use quotes if your command
has white space in it). has white space in it).
.TP .TP
.B \-24 .B \-24
Show time in 24-hour format instead of default 12-hour AM/PM format. Show time in 24-hour format instead of default 12-hour AM/PM format.
.TP .TP
.B \-s .B \-s
Show Greenwich Mean Sidereal Time (GMST) in 24-hour format. Show Greenwich Mean Sidereal Time (GMST) in 24-hour format.
.TP .TP
.B \-S .B \-S
Dont show seconds. Dont show seconds.
.TP .TP
.B \-L <Longitude> .B \-L <Longitude>
Show Local Sidereal Time (LST) in 24-hour format. Longitude is in degrees Show Local Sidereal Time (LST) in 24-hour format. Longitude is in degrees
(- for West + for East). (- for West + for East).
.TP .TP
.B \-l .B \-l
Force use of lower color pixmap to conserve colors. On displays with <= 8 bits, Force use of lower color pixmap to conserve colors. On displays with <= 8 bits,
the low color Pixmap will always be used. the low color Pixmap will always be used.
.TP .TP
.B \-tc <color> .B \-tc <color>
Change color of time-field digits. Change color of time-field digits.
.TP .TP
.B \-bc <color> .B \-bc <color>
Change color of time-field background. Change color of time-field background.
.TP .TP
.B \-tekton .B \-tekton
Use the Tekton font for time field. Use the Tekton font for time field.

View file

@ -7,8 +7,8 @@
int DblClkDelay; int DblClkDelay;
- int HasExecute = 0; /* controls perf optimization */ - int HasExecute = 0; /* controls perf optimization */
char ExecuteCommand[1024]; char ExecuteCommand[1024];
--- 272,277 ---- --- 272,277 ----
*************** ***************
*** 451,457 **** *** 451,457 ****
@ -16,20 +16,20 @@
* *
*/ */
! if ( HasExecute == 0 || n>10){ ! if ( HasExecute == 0 || n>10){
n = 0; n = 0;
--- 450,456 ---- --- 450,456 ----
* to catch expose events, etc... * to catch expose events, etc...
* *
*/ */
! if (n>10){ ! if (n>10){
n = 0; n = 0;
*************** ***************
*** 722,734 **** *** 722,734 ****
* Redraw and wait for next update * Redraw and wait for next update
*/ */
RedrawWindow(); RedrawWindow();
! if( HasExecute == 1) { ! if( HasExecute == 1) {
@ -39,16 +39,16 @@
! } else { ! } else {
! usleep( 500000L); ! usleep( 500000L);
! } ! }
} }
--- 721,727 ---- --- 721,727 ----
* Redraw and wait for next update * Redraw and wait for next update
*/ */
RedrawWindow(); RedrawWindow();
! usleep(DELAY); ! usleep(DELAY);
} }
*************** ***************
*** 817,823 **** *** 817,823 ****
@ -56,15 +56,15 @@
} }
strcpy(ExecuteCommand, argv[++i]); strcpy(ExecuteCommand, argv[++i]);
- HasExecute = 1; - HasExecute = 1;
} else if (!strcmp(argv[i], "-g")){ } else if (!strcmp(argv[i], "-g")){
--- 810,815 ---- --- 810,815 ----
*************** ***************
*** 975,981 **** *** 975,981 ****
char Command[512]; char Command[512];
- if( HasExecute == 0) return; /* no command specified. Ignore clicks. */ - if( HasExecute == 0) return; /* no command specified. Ignore clicks. */
DblClkDelay = 0; DblClkDelay = 0;
if ((xev->button == Button1) && (xev->type == ButtonPress)){ if ((xev->button == Button1) && (xev->type == ButtonPress)){

View file

@ -1,10 +1,10 @@
/* /*
* xutils.c - A collection of X-windows utilties for creating WindowMAker * xutils.c - A collection of X-windows utilties for creating WindowMAker
* DockApps. * DockApps.
* *
* This file contains alot of the lower-level X windows routines. Origins with wmppp * This file contains alot of the lower-level X windows routines. Origins with wmppp
* (by Martijn Pieterse (pieterse@xs4all.nl)), but its been hacked up quite a bit * (by Martijn Pieterse (pieterse@xs4all.nl)), but its been hacked up quite a bit
* and passed on from one new DockApp to the next. * and passed on from one new DockApp to the next.
* *
* *
* *
@ -27,7 +27,7 @@
* *
* *
* *
*/ */
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -43,7 +43,7 @@
/* /*
* X11 Variables * X11 Variables
*/ */
int x_fd; int x_fd;
XSizeHints mysizehints; XSizeHints mysizehints;
@ -105,7 +105,7 @@ static int flush_expose(Window w) {
* RedrawWindowXY * RedrawWindowXY
*/ */
void RedrawWindow(void) { void RedrawWindow(void) {
flush_expose(iconwin); flush_expose(iconwin);
XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, 0,0, wmgen.attributes.width, wmgen.attributes.height, 0, 0); XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, 0,0, wmgen.attributes.width, wmgen.attributes.height, 0, 0);
@ -115,7 +115,7 @@ void RedrawWindow(void) {
} }
void RedrawWindowXY(int x, int y) { void RedrawWindowXY(int x, int y) {
flush_expose(iconwin); flush_expose(iconwin);
XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, x,y, wmgen.attributes.width, wmgen.attributes.height, 0, 0); XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, x,y, wmgen.attributes.width, wmgen.attributes.height, 0, 0);
@ -179,7 +179,7 @@ void initXwindow(int argc, char *argv[]){
/* /*
* openXwindow * openXwindow
*/ */
void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits,
int pixmask_width, int pixmask_height) { int pixmask_width, int pixmask_height) {
unsigned int borderwidth = 1; unsigned int borderwidth = 1;
@ -201,9 +201,9 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
{"Color9", NULL, 0}}; {"Color9", NULL, 0}};
/*
/*
* Create Pixmap * Create Pixmap
*/ */
cols[0].pixel = getColor(BackgroundColor, 1.0000, &red, &grn, &blu); cols[0].pixel = getColor(BackgroundColor, 1.0000, &red, &grn, &blu);
@ -221,9 +221,9 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
wmgen.attributes.colorsymbols = cols; wmgen.attributes.colorsymbols = cols;
wmgen.attributes.exactColors = False; wmgen.attributes.exactColors = False;
wmgen.attributes.closeness = 40000; wmgen.attributes.closeness = 40000;
wmgen.attributes.valuemask = XpmReturnPixels | XpmReturnExtensions | XpmColorSymbols wmgen.attributes.valuemask = XpmReturnPixels | XpmReturnExtensions | XpmColorSymbols
| XpmExactColors | XpmCloseness | XpmSize; | XpmExactColors | XpmCloseness | XpmSize;
if (XpmCreatePixmapFromData(display, Root, pixmap_bytes, if (XpmCreatePixmapFromData(display, Root, pixmap_bytes,
&(wmgen.pixmap), &(wmgen.mask), &(wmgen.attributes)) != XpmSuccess){ &(wmgen.pixmap), &(wmgen.mask), &(wmgen.attributes)) != XpmSuccess){
fprintf(stderr, "Not enough free colorcells.\n"); fprintf(stderr, "Not enough free colorcells.\n");
exit(1); exit(1);
@ -232,8 +232,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
/* /*
* Create a window * Create a window
*/ */
mysizehints.flags = USSize | USPosition; mysizehints.flags = USSize | USPosition;
mysizehints.x = 0; mysizehints.x = 0;
@ -247,19 +247,19 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
mysizehints.width = 64; mysizehints.width = 64;
mysizehints.height = 64; mysizehints.height = 64;
win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y, win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y,
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix); mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y, iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y,
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix); mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
/* /*
* Activate hints * Activate hints
*/ */
XSetWMNormalHints(display, win, &mysizehints); XSetWMNormalHints(display, win, &mysizehints);
classHint.res_name = wname; classHint.res_name = wname;
@ -274,11 +274,11 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
* effect. I.e. for some you will need to Grab the focus and then return * effect. I.e. for some you will need to Grab the focus and then return
* it after you are done... * it after you are done...
*/ */
XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask
| PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask
| KeyPressMask | KeyReleaseMask); | KeyPressMask | KeyReleaseMask);
XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask
| PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask
| KeyPressMask | KeyReleaseMask); | KeyPressMask | KeyReleaseMask);
@ -290,8 +290,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
XSetWMName(display, win, &name); XSetWMName(display, win, &name);
/* /*
* Create Graphics Context (GC) for drawing * Create Graphics Context (GC) for drawing
*/ */
gcm = GCForeground | GCBackground | GCGraphicsExposures; gcm = GCForeground | GCBackground | GCGraphicsExposures;
gcv.foreground = fore_pix; gcv.foreground = fore_pix;
@ -337,7 +337,7 @@ unsigned long getColor(char *ColorName, float fac, int *red, int *grn, int *blu)
Color.flags = DoRed | DoGreen | DoBlue; Color.flags = DoRed | DoGreen | DoBlue;
XAllocColor(display, Attributes.colormap, &Color); XAllocColor(display, Attributes.colormap, &Color);
*red = Color.red; *red = Color.red;
*grn = Color.green; *grn = Color.green;
*blu = Color.blue; *blu = Color.blue;
@ -407,7 +407,7 @@ int LoadKbImg(char *names)
break; break;
} }
point = strtok(NULL, ","); point = strtok(NULL, ",");
} }
return ((i > KB_MAX_GROUPS) ? KB_MAX_GROUPS : i); return ((i > KB_MAX_GROUPS) ? KB_MAX_GROUPS : i);
@ -442,7 +442,7 @@ void CreateKbTranImgs(void)
} }
} }
} }
XDestroyImage(image); XDestroyImage(image);
} }

View file

@ -4,7 +4,7 @@
/* /*
* Typedefs * Typedefs
*/ */
typedef struct { typedef struct {
Pixmap pixmap; Pixmap pixmap;
@ -21,7 +21,7 @@ typedef struct {
Display *display; Display *display;
Window Root; Window Root;
Window iconwin, win; Window iconwin, win;
int screen; int screen;
int DisplayDepth; int DisplayDepth;
@ -43,7 +43,7 @@ void setMaskXY(int, int);
unsigned long getColor(char *, float, int *, int *, int *); unsigned long getColor(char *, float, int *, int *, int *);
unsigned long getBlendedColor(char *, float, int, int, int); unsigned long getBlendedColor(char *, float, int, int, int);
void RedrawWindow(void); void RedrawWindow(void);
int LoadKbImg(char *names); int LoadKbImg(char *names);
void CreateKbTranImgs(void); void CreateKbTranImgs(void);
void ShowGroupImage(int group); void ShowGroupImage(int group);

View file

@ -18,7 +18,7 @@ scalpel:
make clean make clean
make ${TARGET} make ${TARGET}
gv: gv:
if [ -e buttons.xpm ]; then rm buttons.xpm; fi if [ -e buttons.xpm ]; then rm buttons.xpm; fi
if [ -e pushed_buttons.xpm ]; then rm pushed_buttons.xpm; fi if [ -e pushed_buttons.xpm ]; then rm pushed_buttons.xpm; fi
if [ -e backdrop.xpm ]; then rm backdrop.xpm; fi if [ -e backdrop.xpm ]; then rm backdrop.xpm; fi
@ -37,5 +37,5 @@ ${TARGET}: ${OBJECTS}
gcc -g -o ${TARGET} ${OBJECTS} ${LIBINC} ${LIBS} gcc -g -o ${TARGET} ${OBJECTS} ${LIBINC} ${LIBS}
clean:: clean::
for i in ${OBJECTS}; do if [ -e $$i ] ; then rm $$i; fi; done for i in ${OBJECTS}; do if [ -e $$i ] ; then rm $$i; fi; done
if [ -e ${TARGET} ] ; then rm ${TARGET}; fi if [ -e ${TARGET} ] ; then rm ${TARGET}; fi

View file

@ -4,7 +4,7 @@ wmcp ( Window Maker Crappy Pager )
Version 1.2.8 Version 1.2.8
Origional Author: Origional Author:
Ben Cohen <buddog@aztec.asu.edu> Ben Cohen <buddog@aztec.asu.edu>
Contributors: ( ** Thanks alot to them !! ** ) Contributors: ( ** Thanks alot to them !! ** )
@ -31,13 +31,13 @@ INSTALL:
make gv -- make wmcp using the ghostview style button colors make gv -- make wmcp using the ghostview style button colors
copy wmcp to some directory in your $PATH. copy wmcp to some directory in your $PATH.
( ie: cp wmcp /usr/local/bin ) ( ie: cp wmcp /usr/local/bin )
type wmcp type wmcp
Grab the appicon and move it to the dock. Grab the appicon and move it to the dock.
If make doesn't work, you may need to fiddle with the settings in If make doesn't work, you may need to fiddle with the settings in
the Makefile. the Makefile.
Tested on: Tested on:
@ -51,8 +51,8 @@ INSTALL:
USAGE: USAGE:
------ ------
usage: wmcp [-g geometry] [-d dpy] [-n workspaces] [-a alt key] [-v] usage: wmcp [-g geometry] [-d dpy] [-n workspaces] [-a alt key] [-v]
[-c] [-w i/n/w] [-s y/n] [-x #] [-y #] [-h] [-c] [-w i/n/w] [-s y/n] [-x #] [-y #] [-h]
-g geometry: ie: 64x64+10+10 -g geometry: ie: 64x64+10+10
-d dpy: Display. ie: 127.0.0.1:0.0 -d dpy: Display. ie: 127.0.0.1:0.0
@ -61,7 +61,7 @@ usage: wmcp [-g geometry] [-d dpy] [-n workspaces] [-a alt key] [-v]
-w i/n/w: Window State: Iconic, Normal, Withdrawn (default Withdrawn) -w i/n/w: Window State: Iconic, Normal, Withdrawn (default Withdrawn)
-s y/n: Shaped window: yes or no (default y) -s y/n: Shaped window: yes or no (default y)
-c Sends CTRL + ALT + Key (default only sends ALT + key) -c Sends CTRL + ALT + Key (default only sends ALT + key)
-v Verbose. 0=off, 1=on (default 0) -v Verbose. 0=off, 1=on (default 0)
-x # Number of buttons on the x-direction (1,2,3 or 4) -x # Number of buttons on the x-direction (1,2,3 or 4)
-y # Number of buttons in the y-direction (1,2,3 or 4) -y # Number of buttons in the y-direction (1,2,3 or 4)
-h Help. This screen. -h Help. This screen.
@ -87,12 +87,12 @@ EXAMPLES:
2x3 button grid: 2x3 button grid:
wmdl -x 2 -y 3 wmdl -x 2 -y 3
NOTES: NOTES:
------ ------
This pager works by sending synthetic ALT + number key press events to the This pager works by sending synthetic ALT + number key press events to the
root window. The "-c" command line switch makes the application send root window. The "-c" command line switch makes the application send
a CNTRL + ALT + number key which might be of use in another window manager. a CNTRL + ALT + number key which might be of use in another window manager.
@ -105,7 +105,7 @@ I don't know of any Window Maker hooks for determining things like how
may workspaces are actually in use. If any one know about this stuff, please may workspaces are actually in use. If any one know about this stuff, please
let me know. let me know.
It is very easy to change the look of wmcp by editing the colors in the It is very easy to change the look of wmcp by editing the colors in the
pixmap files. Someday we'll add an official 'skins' ability but for now pixmap files. Someday we'll add an official 'skins' ability but for now
just edit the xpm files to change the colors etc. just edit the xpm files to change the colors etc.
@ -122,7 +122,7 @@ CHANGE LOG:
1.2.8 May 25, 1999 -- Gert Beumer 1.2.8 May 25, 1999 -- Gert Beumer
Added -x and -y functionality to configure the amount of buttons. Added -x and -y functionality to configure the amount of buttons.
Changed the rendering of the buttons from the pixmap Changed the rendering of the buttons from the pixmap
(to suport multiple button startup) (to suport multiple button startup)
1.2.6 Feb 11, 1999 1.2.6 Feb 11, 1999
@ -133,7 +133,7 @@ CHANGE LOG:
1.2.5 Jan 25, 1999 1.2.5 Jan 25, 1999
Made buttons flat style ala Ghostview 3.5.8 Made buttons flat style ala Ghostview 3.5.8
1.2 Jan 24, 1999 1.2 Jan 24, 1999
Pushed button images added by Thomas Nemeth <tnemeth@multimania.com> Pushed button images added by Thomas Nemeth <tnemeth@multimania.com>
@ -143,7 +143,7 @@ CHANGE LOG:
TODO: TODO:
----- -----
Add a simple method for changing 'skins' other than just editing the XPM Add a simple method for changing 'skins' other than just editing the XPM
files by hand. files by hand.
Add catching Window Maker's events to know how to refresh the pager when Add catching Window Maker's events to know how to refresh the pager when

View file

@ -63,13 +63,13 @@ static char *backdrop_xpm[] = {
"aaaaaaaaiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii########", "aaaaaaaaiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii########",
"aaaaaaaaiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii########", "aaaaaaaaiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii########",
"aaaaaaaaiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii########", "aaaaaaaaiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii########",
"########iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii########", "########iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii########",
"################################################################", "################################################################",
"################################################################", "################################################################",
"################################################################",
"################################################################",
"################################################################",
"################################################################",
"################################################################", "################################################################",
"################################################################",
"################################################################",
"################################################################",
"################################################################",
}; };

View file

@ -63,13 +63,12 @@ static char *backdrop_xpm[] = {
"aaaaaaaaiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii########", "aaaaaaaaiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii########",
"aaaaaaaaiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii########", "aaaaaaaaiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii########",
"aaaaaaaaiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii########", "aaaaaaaaiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii########",
"########iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii########", "########iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii########",
"################################################################", "################################################################",
"################################################################", "################################################################",
"################################################################",
"################################################################",
"################################################################",
"################################################################",
"################################################################", "################################################################",
"################################################################",
"################################################################",
"################################################################",
"################################################################",
}; };

View file

@ -50,7 +50,7 @@ static char *buttons_xpm[] = {
"aa#c #ca", "aa#c #ca",
"aa#c #ca", "aa#c #ca",
"aa#c #ca", "aa#c #ca",
"aa#c #ca", "aa#c #ca",
"aa#c #ca", "aa#c #ca",
"aa#c #ca", "aa#c #ca",
"aa#c #ca", "aa#c #ca",

View file

@ -50,7 +50,7 @@ static char *buttons_xpm[] = {
"a#c c#a", "a#c c#a",
"a#c c#a", "a#c c#a",
"a#c c#a", "a#c c#a",
"a#c c#a", "a#c c#a",
"a#c c#a", "a#c c#a",
"a#c c#a", "a#c c#a",
"a#c c#a", "a#c c#a",

View file

@ -11,10 +11,10 @@ static char mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,

View file

@ -50,7 +50,7 @@ static char *pushed_buttons_xpm[] = {
"aa#c #ca", "aa#c #ca",
"aa#c #ca", "aa#c #ca",
"aa#c #ca", "aa#c #ca",
"aa#c #ca", "aa#c #ca",
"aa#c #ca", "aa#c #ca",
"aa#c #ca", "aa#c #ca",
"aa#c #ca", "aa#c #ca",

View file

@ -50,7 +50,7 @@ static char *pushed_buttons_xpm[] = {
"a#c c#a", "a#c c#a",
"a#c c#a", "a#c c#a",
"a#c c#a", "a#c c#a",
"a#c c#a", "a#c c#a",
"a#c c#a", "a#c c#a",
"a#c c#a", "a#c c#a",
"a#c c#a", "a#c c#a",

View file

@ -1,22 +1,22 @@
/*********************************************************************** /***********************************************************************
* Code is stol^H^H^H^Hbased on wmppp, wmload, and wmtme * Code is stol^H^H^H^Hbased on wmppp, wmload, and wmtme
* *
* Author: Ben Cohen <buddog@aztec.asu.edu> * Author: Ben Cohen <buddog@aztec.asu.edu>
* *
* Contributors: * Contributors:
* Thomas Nemeth <tnemeth@multimania.com> -- Pushed button highlighting * Thomas Nemeth <tnemeth@multimania.com> -- Pushed button highlighting
* Craig Maloney <craig@ic.net> -- CTRL + ALT + key option * Craig Maloney <craig@ic.net> -- CTRL + ALT + key option
* *
* *
* This program is distributed under the GPL license. * This program is distributed under the GPL license.
* *
* *
* Best viewed with tab = 4 ( in vi set ts=4 ) * Best viewed with tab = 4 ( in vi set ts=4 )
* *
***********************************************************************/ ***********************************************************************/
#define VERSION "Ver 1.2.8 -- May 25, 1999" #define VERSION "Ver 1.2.8 -- May 25, 1999"
@ -29,7 +29,7 @@
#include <math.h> #include <math.h>
#include "backdrop.xpm" #include "backdrop.xpm"
#include "buttons.xpm" #include "buttons.xpm"
#include "pushed_buttons.xpm" #include "pushed_buttons.xpm"
#include "mask.xbm" #include "mask.xbm"
@ -74,7 +74,7 @@ ButtonArea button_region[16];
XpmIcon template, visible, buttons, pbuttons; XpmIcon template, visible, buttons, pbuttons;
unsigned int control = 0; unsigned int control = 0;
int numb_of_workspaces = 16; /* Number of buttons to display. int numb_of_workspaces = 16; /* Number of buttons to display.
Initially set high. Changed by Initially set high. Changed by
@ -82,7 +82,7 @@ int numb_of_workspaces = 16; /* Number of buttons to display.
int N = 1; /* Button number pressed to goto WS */ int N = 1; /* Button number pressed to goto WS */
int B = 1; /* Button number pressed to number WS's */ int B = 1; /* Button number pressed to number WS's */
int alt_key_type = 1; int alt_key_type = 1;
int border = 5; int border = 5;
int Verbose = 0; int Verbose = 0;
@ -113,7 +113,7 @@ void show_usage();
int main( int argc, char ** argv ) int main( int argc, char ** argv )
{ {
XEvent report; XEvent report;
XGCValues xgcValues; XGCValues xgcValues;
XTextProperty app_name_atom; XTextProperty app_name_atom;
@ -150,7 +150,7 @@ int main( int argc, char ** argv )
case 'n': case 'n':
if ( ++i >= argc ) show_usage(); if ( ++i >= argc ) show_usage();
sscanf(argv[i], "%d", &numb_of_workspaces); sscanf(argv[i], "%d", &numb_of_workspaces);
if ( Verbose ) if ( Verbose )
printf("Numb of Workspaces: %d\n", numb_of_workspaces); printf("Numb of Workspaces: %d\n", numb_of_workspaces);
break; break;
case 's': case 's':
@ -178,14 +178,14 @@ int main( int argc, char ** argv )
case 'x': case 'x':
if ( ++i >= argc ) show_usage(); if ( ++i >= argc ) show_usage();
sscanf(argv[i], "%d", &xbut); sscanf(argv[i], "%d", &xbut);
if ( xbut < 1 || xbut > MAX_X_BUT ) xbut = 3; if ( xbut < 1 || xbut > MAX_X_BUT ) xbut = 3;
if ( Verbose ) printf("Num X buttons=%d\n", xbut); if ( Verbose ) printf("Num X buttons=%d\n", xbut);
break; break;
case 'y': case 'y':
if ( ++i >= argc ) show_usage(); if ( ++i >= argc ) show_usage();
sscanf(argv[i], "%d", &ybut); sscanf(argv[i], "%d", &ybut);
if ( ybut < 1 || ybut > MAX_Y_BUT ) ybut = 3; if ( ybut < 1 || ybut > MAX_Y_BUT ) ybut = 3;
if ( Verbose ) printf("Num Y buttons=%d\n", ybut); if ( Verbose ) printf("Num Y buttons=%d\n", ybut);
break; break;
case 'a': case 'a':
if ( ++i >= argc ) show_usage(); if ( ++i >= argc ) show_usage();
@ -210,7 +210,7 @@ int main( int argc, char ** argv )
if ( (display = XOpenDisplay(Display_str)) == NULL ) { if ( (display = XOpenDisplay(Display_str)) == NULL ) {
fprintf(stderr,"Fail: XOpenDisplay for %s\n", Display_str); fprintf(stderr,"Fail: XOpenDisplay for %s\n", Display_str);
exit(-1); exit(-1);
} }
@ -219,8 +219,8 @@ int main( int argc, char ** argv )
rootwin = RootWindow(display,screen); rootwin = RootWindow(display,screen);
depth = DefaultDepth(display, screen); depth = DefaultDepth(display, screen);
bg_pixel = WhitePixel(display, screen ); bg_pixel = WhitePixel(display, screen );
fg_pixel = BlackPixel(display, screen ); fg_pixel = BlackPixel(display, screen );
@ -231,19 +231,19 @@ int main( int argc, char ** argv )
/* Parse Geometry string and fill in sizehints fields */ /* Parse Geometry string and fill in sizehints fields */
XWMGeometry(display, screen, XWMGeometry(display, screen,
Geometry_str, Geometry_str,
NULL, NULL,
border, border,
&xsizehints, &xsizehints,
&xsizehints.x, &xsizehints.x,
&xsizehints.y, &xsizehints.y,
&xsizehints.width, &xsizehints.width,
&xsizehints.height, &xsizehints.height,
&dummy); &dummy);
if ( (win = XCreateSimpleWindow( if ( (win = XCreateSimpleWindow(
display, display,
rootwin, rootwin,
xsizehints.x, xsizehints.x,
@ -252,11 +252,11 @@ int main( int argc, char ** argv )
xsizehints.height, xsizehints.height,
border, border,
fg_pixel, bg_pixel) ) == 0 ) { fg_pixel, bg_pixel) ) == 0 ) {
fprintf(stderr,"Fail: XCreateSimpleWindow\n"); fprintf(stderr,"Fail: XCreateSimpleWindow\n");
exit(-1); exit(-1);
} }
if ( (iconwin = XCreateSimpleWindow( if ( (iconwin = XCreateSimpleWindow(
display, display,
win, win,
xsizehints.x, xsizehints.x,
@ -265,7 +265,7 @@ int main( int argc, char ** argv )
xsizehints.height, xsizehints.height,
border, border,
fg_pixel, bg_pixel) ) == 0 ) { fg_pixel, bg_pixel) ) == 0 ) {
fprintf(stderr,"Fail: XCreateSimpleWindow\n"); fprintf(stderr,"Fail: XCreateSimpleWindow\n");
exit(-1); exit(-1);
} }
@ -290,21 +290,21 @@ int main( int argc, char ** argv )
/* Convert in pixmaps from .xpm includes. */ /* Convert in pixmaps from .xpm includes. */
getPixmaps(); getPixmaps();
/* Interclient Communication stuff */ /* Interclient Communication stuff */
/* Appicons don't work with out this stuff */ /* Appicons don't work with out this stuff */
xwmhints = XAllocWMHints(); xwmhints = XAllocWMHints();
xwmhints->flags = WindowGroupHint | IconWindowHint | StateHint; xwmhints->flags = WindowGroupHint | IconWindowHint | StateHint;
xwmhints->icon_window = iconwin; xwmhints->icon_window = iconwin;
xwmhints->window_group = win; xwmhints->window_group = win;
xwmhints->initial_state = window_state; xwmhints->initial_state = window_state;
XSetWMHints( display, win, xwmhints ); XSetWMHints( display, win, xwmhints );
xclasshint.res_name = "wmcp"; xclasshint.res_name = "wmcp";
xclasshint.res_class = "WMcp"; xclasshint.res_class = "WMcp";
XSetClassHint( display, win, &xclasshint ); XSetClassHint( display, win, &xclasshint );
@ -323,17 +323,17 @@ int main( int argc, char ** argv )
exit(-1); exit(-1);
} }
XSetWMName( display, win, &app_name_atom ); XSetWMName( display, win, &app_name_atom );
/* Create Graphic Context */ /* Create Graphic Context */
if ( (gc = XCreateGC( if ( (gc = XCreateGC(
display, display,
win, win,
(GCForeground | GCBackground), (GCForeground | GCBackground),
&xgcValues)) == NULL ) { &xgcValues)) == NULL ) {
fprintf(stderr,"Fail: XCreateGC\n"); fprintf(stderr,"Fail: XCreateGC\n");
exit(-1); exit(-1);
} }
@ -346,16 +346,16 @@ int main( int argc, char ** argv )
XSelectInput( XSelectInput(
display, display,
win, win,
ExposureMask | ExposureMask |
ButtonPressMask | ButtonPressMask |
PointerMotionMask | PointerMotionMask |
StructureNotifyMask ); StructureNotifyMask );
XSelectInput( XSelectInput(
display, display,
iconwin, iconwin,
ExposureMask | ExposureMask |
ButtonPressMask | ButtonPressMask |
PointerMotionMask | PointerMotionMask |
StructureNotifyMask ); StructureNotifyMask );
@ -363,7 +363,7 @@ int main( int argc, char ** argv )
/* Store the 'state' of the application for restarting */ /* Store the 'state' of the application for restarting */
XSetCommand( display, win, argv, argc ); XSetCommand( display, win, argv, argc );
/* Window won't ever show up until it is mapped.. then drawn after a */ /* Window won't ever show up until it is mapped.. then drawn after a */
@ -381,22 +381,22 @@ int main( int argc, char ** argv )
case Expose: case Expose:
if (report.xexpose.count != 0) { if (report.xexpose.count != 0) {
break; break;
} }
if ( Verbose ) fprintf(stdout,"Event: Expose\n"); if ( Verbose ) fprintf(stdout,"Event: Expose\n");
redraw( xbut, ybut ); redraw( xbut, ybut );
break; break;
case ConfigureNotify: case ConfigureNotify:
if ( Verbose ) fprintf(stdout,"Event: ConfigureNotify\n"); if ( Verbose ) fprintf(stdout,"Event: ConfigureNotify\n");
redraw( xbut, ybut ); redraw( xbut, ybut );
break; break;
case ButtonPress: case ButtonPress:
if ( Verbose ) if ( Verbose )
printf ("numb_of_workspaces=%d\n", numb_of_workspaces); printf ("numb_of_workspaces=%d\n", numb_of_workspaces);
switch (report.xbutton.button) { switch (report.xbutton.button) {
case Button1: case Button1:
@ -405,9 +405,9 @@ int main( int argc, char ** argv )
switchToWorkspaceN( N ); switchToWorkspaceN( N );
redraw(xbut, ybut); redraw(xbut, ybut);
} }
if ( Verbose ) if ( Verbose )
fprintf(stdout,"Button 1:x=%d y=%d N=%d\n", fprintf(stdout,"Button 1:x=%d y=%d N=%d\n",
report.xbutton.x, report.xbutton.y, N); report.xbutton.x, report.xbutton.y, N);
break; break;
case Button2: case Button2:
@ -417,9 +417,9 @@ int main( int argc, char ** argv )
numb_of_workspaces = B; numb_of_workspaces = B;
redraw(xbut, ybut); redraw(xbut, ybut);
} }
if ( Verbose ) if ( Verbose )
fprintf(stdout,"Button 2or3:x=%d y=%d B=%d\n", fprintf(stdout,"Button 2or3:x=%d y=%d B=%d\n",
report.xbutton.x, report.xbutton.y, B); report.xbutton.x, report.xbutton.y, B);
break; break;
} }
@ -427,13 +427,13 @@ int main( int argc, char ** argv )
case DestroyNotify: case DestroyNotify:
if ( Verbose ) if ( Verbose )
fprintf(stdout, "Bye\n"); fprintf(stdout, "Bye\n");
XFreeGC(display, gc); XFreeGC(display, gc);
XDestroyWindow(display,win); XDestroyWindow(display,win);
XDestroyWindow(display,iconwin); XDestroyWindow(display,iconwin);
XCloseDisplay(display); XCloseDisplay(display);
if ( Verbose ) if ( Verbose )
fprintf(stdout, "Bye\n"); fprintf(stdout, "Bye\n");
exit(0); exit(0);
break; break;
@ -452,7 +452,7 @@ return (0);
* *
* Map the button region coordinates. * Map the button region coordinates.
* *
* Draw the appropriate number of buttons on the 'visible' Pixmap * Draw the appropriate number of buttons on the 'visible' Pixmap
* using data from the 'buttons' pixmap. * using data from the 'buttons' pixmap.
* *
* Then, copy the 'visible' pixmap to the two windows ( the withdrawn * Then, copy the 'visible' pixmap to the two windows ( the withdrawn
@ -477,15 +477,15 @@ void redraw( int xbut, int ybut )
ybut_size = 48 / ybut; ybut_size = 48 / ybut;
XCopyArea( display, XCopyArea( display,
template.pixmap, visible.pixmap, template.pixmap, visible.pixmap,
gc, gc,
0, 0, 0, 0,
template.attributes.width, template.attributes.width,
template.attributes.height, template.attributes.height,
0, 0 ); 0, 0 );
for ( j=0; j < ybut; j++ ) { for ( j=0; j < ybut; j++ ) {
for ( i=0; i < xbut; i++ ) { for ( i=0; i < xbut; i++ ) {
n = i + j * xbut; n = i + j * xbut;
@ -500,7 +500,7 @@ void redraw( int xbut, int ybut )
button_region[n].x = dest_x; button_region[n].x = dest_x;
button_region[n].y = dest_y; button_region[n].y = dest_y;
button_region[n].i = dest_x + xbut_size - 1; button_region[n].i = dest_x + xbut_size - 1;
button_region[n].j = dest_y + ybut_size - 1; button_region[n].j = dest_y + ybut_size - 1;
/* Copy button images for valid workspaces */ /* Copy button images for valid workspaces */
@ -510,56 +510,56 @@ void redraw( int xbut, int ybut )
/* Draw normal button */ /* Draw normal button */
/* Edited by Gert Beumer */ /* Edited by Gert Beumer */
if ( (n + 1) != N ) { if ( (n + 1) != N ) {
/* upper left */ /* upper left */
XCopyArea( display, XCopyArea( display,
buttons.pixmap, buttons.pixmap,
visible.pixmap, visible.pixmap,
gc, gc,
0,0, 0,0,
step_x, step_y, step_x, step_y,
dest_x, dest_x,
dest_y); dest_y);
/* lowwer left */ /* lowwer left */
XCopyArea( display, XCopyArea( display,
buttons.pixmap, buttons.pixmap,
visible.pixmap, visible.pixmap,
gc, gc,
0,48 - step_y, 0,48 - step_y,
step_x, step_y, step_x, step_y,
dest_x, dest_x,
dest_y + step_y); dest_y + step_y);
/* lowwer right */ /* lowwer right */
XCopyArea( display, XCopyArea( display,
buttons.pixmap, buttons.pixmap,
visible.pixmap, visible.pixmap,
gc, gc,
48 - step_x,48 - step_y, 48 - step_x,48 - step_y,
step_x, step_y, step_x, step_y,
dest_x + step_x, dest_x + step_x,
dest_y + step_y); dest_y + step_y);
/* upper right */ /* upper right */
XCopyArea( display, XCopyArea( display,
buttons.pixmap, buttons.pixmap,
visible.pixmap, visible.pixmap,
gc, gc,
48 - step_x,0, 48 - step_x,0,
step_x, step_y, step_x, step_y,
dest_x + step_x, dest_x + step_x,
dest_y); dest_y);
/* Draw the numbers */ /* Draw the numbers */
XCopyArea( display, XCopyArea( display,
buttons.pixmap, buttons.pixmap,
visible.pixmap, visible.pixmap,
gc, gc,
n * 5, n * 5,
48, 48,
5,5, 5,5,
dest_x + (48 - xbut * 5) / (2 * xbut), dest_x + (48 - xbut * 5) / (2 * xbut),
dest_y + (48 - ybut * 5) / (2 * ybut)); dest_y + (48 - ybut * 5) / (2 * ybut));
} }
/* Draw pushed button */ /* Draw pushed button */
/* Added by Thomas Nemeth, Edited by Gert Beumer */ /* Added by Thomas Nemeth, Edited by Gert Beumer */
if ( (n + 1) == N ) { if ( (n + 1) == N ) {
@ -567,46 +567,46 @@ void redraw( int xbut, int ybut )
/* upper left */ /* upper left */
XCopyArea( display, XCopyArea( display,
pbuttons.pixmap, pbuttons.pixmap,
visible.pixmap, visible.pixmap,
gc, gc,
0,0, 0,0,
step_x, step_y, step_x, step_y,
dest_x, dest_x,
dest_y); dest_y);
/* lowwer left */ /* lowwer left */
XCopyArea( display, XCopyArea( display,
pbuttons.pixmap, pbuttons.pixmap,
visible.pixmap, visible.pixmap,
gc, gc,
0,48 - step_y, 0,48 - step_y,
step_x, step_y, step_x, step_y,
dest_x, dest_x,
dest_y + step_y); dest_y + step_y);
/* lowwer right */ /* lowwer right */
XCopyArea( display, XCopyArea( display,
pbuttons.pixmap, pbuttons.pixmap,
visible.pixmap, visible.pixmap,
gc, gc,
48 - step_x,48 - step_y, 48 - step_x,48 - step_y,
step_x, step_y, step_x, step_y,
dest_x + step_x, dest_x + step_x,
dest_y + step_y); dest_y + step_y);
/* upper right */ /* upper right */
XCopyArea( display, XCopyArea( display,
pbuttons.pixmap, pbuttons.pixmap,
visible.pixmap, visible.pixmap,
gc, gc,
48 - step_x,0, 48 - step_x,0,
step_x, step_y, step_x, step_y,
dest_x + step_x, dest_x + step_x,
dest_y); dest_y);
/* Draw the numbers */ /* Draw the numbers */
XCopyArea( display, XCopyArea( display,
pbuttons.pixmap, pbuttons.pixmap,
visible.pixmap, visible.pixmap,
gc, gc,
n * 5, n * 5,
48, 48,
5,5, 5,5,
@ -619,25 +619,25 @@ void redraw( int xbut, int ybut )
} }
} }
flush_expose( win ); flush_expose( win );
XCopyArea( display, XCopyArea( display,
visible.pixmap, win, gc, visible.pixmap, win, gc,
0, 0, 0, 0,
visible.attributes.width, visible.attributes.width,
visible.attributes.height, visible.attributes.height,
0, 0 ); 0, 0 );
flush_expose( iconwin ); flush_expose( iconwin );
XCopyArea( display, XCopyArea( display,
visible.pixmap, iconwin, gc, visible.pixmap, iconwin, gc,
0, 0, 0, 0,
visible.attributes.width, visible.attributes.width,
visible.attributes.height, visible.attributes.height,
0, 0 ); 0, 0 );
if ( Verbose ) if ( Verbose )
fprintf(stdout,"In Redraw()\n"); fprintf(stdout,"In Redraw()\n");
} }
@ -651,7 +651,7 @@ void redraw( int xbut, int ybut )
* be visible ( drawn ). Return -1 if no button match. * be visible ( drawn ). Return -1 if no button match.
* *
***********************************************************************/ ***********************************************************************/
int whichButton( int x, int y, int xbut, int ybut ) int whichButton( int x, int y, int xbut, int ybut )
{ {
int index; int index;
@ -674,7 +674,7 @@ int whichButton( int x, int y, int xbut, int ybut )
/*********************************************************************** /***********************************************************************
* switchToWorkspaceN() * switchToWorkspaceN()
* *
* Send the Synthetic Key Press event with the appropriate * Send the Synthetic Key Press event with the appropriate
* [ meta key + 1-4 key ] combo. Alt seems to usualy be Mod1Mask. * [ meta key + 1-4 key ] combo. Alt seems to usualy be Mod1Mask.
* *
***********************************************************************/ ***********************************************************************/
@ -685,7 +685,7 @@ void switchToWorkspaceN( int workspace ) {
sendEvent.xkey.type = KeyPress; sendEvent.xkey.type = KeyPress;
sendEvent.xkey.window = rootwin; sendEvent.xkey.window = rootwin;
sendEvent.xkey.root = rootwin; sendEvent.xkey.root = rootwin;
sendEvent.xkey.subwindow = 0x0; sendEvent.xkey.subwindow = 0x0;
switch ( alt_key_type ) { switch ( alt_key_type ) {
case 1: case 1:
@ -712,9 +712,9 @@ void switchToWorkspaceN( int workspace ) {
/*********************************************************************** /***********************************************************************
* getPixmaps * getPixmaps
* *
* Load XPM data into X Pixmaps. * Load XPM data into X Pixmaps.
* *
* Pixmap template contains the untouched window backdrop image. * Pixmap template contains the untouched window backdrop image.
* Pixmap visible is the template pixmap with buttons drawn on it. * Pixmap visible is the template pixmap with buttons drawn on it.
* -- what is seen by the user. * -- what is seen by the user.
@ -736,40 +736,40 @@ void getPixmaps()
rootwin, rootwin,
backdrop_xpm, backdrop_xpm,
&template.pixmap, &template.pixmap,
&template.mask, &template.mask,
&template.attributes) != XpmSuccess ) { &template.attributes) != XpmSuccess ) {
fprintf(stderr, "Can't Create 'template' Pixmap"); fprintf(stderr, "Can't Create 'template' Pixmap");
exit(1); exit(1);
} }
/* Visible Pixmap. Copied from template Pixmap and then drawn to. */ /* Visible Pixmap. Copied from template Pixmap and then drawn to. */
if ( XpmCreatePixmapFromData( display, if ( XpmCreatePixmapFromData( display,
rootwin, rootwin,
backdrop_xpm, backdrop_xpm,
&visible.pixmap, &visible.pixmap,
&visible.mask, &visible.mask,
&visible.attributes) != XpmSuccess ) { &visible.attributes) != XpmSuccess ) {
fprintf(stderr, "Can't Create 'visible' Pixmap"); fprintf(stderr, "Can't Create 'visible' Pixmap");
exit(1); exit(1);
} }
/* Buttons Pixmap. */ /* Buttons Pixmap. */
if ( XpmCreatePixmapFromData( display, if ( XpmCreatePixmapFromData( display,
rootwin, rootwin,
buttons_xpm, buttons_xpm,
&buttons.pixmap, &buttons.pixmap,
&buttons.mask, &buttons.mask,
&buttons.attributes) != XpmSuccess ) { &buttons.attributes) != XpmSuccess ) {
fprintf(stderr, "Can't Create 'buttons' Pixmap"); fprintf(stderr, "Can't Create 'buttons' Pixmap");
exit(1); exit(1);
} }
/* Pushed Buttons Pixmap. */ /* Pushed Buttons Pixmap. */
if ( XpmCreatePixmapFromData( display, if ( XpmCreatePixmapFromData( display,
rootwin, rootwin,
pushed_buttons_xpm, pushed_buttons_xpm,
&pbuttons.pixmap, &pbuttons.pixmap,
&pbuttons.mask, &pbuttons.mask,
&pbuttons.attributes) != XpmSuccess ) { &pbuttons.attributes) != XpmSuccess ) {
fprintf(stderr, "Can't Create 'pbuttons' Pixmap"); fprintf(stderr, "Can't Create 'pbuttons' Pixmap");
exit(1); exit(1);

View file

@ -1,7 +1,7 @@
wmdonkeymon-0.9 wmdonkeymon-0.9
-------------------------------------------------------------- --------------------------------------------------------------
Authors...: Marcelo Morgade (marcelomorgade@ig.com.br) Authors...: Marcelo Morgade (marcelomorgade@ig.com.br)
Description Description
-------------------------------------------------------------- --------------------------------------------------------------
@ -11,7 +11,7 @@ Click on a file name to show details.
Click again to return to list. Click again to return to list.
Plz, don't hack uploads ... Plz, don't hack uploads ...
wmisdnmon is being developped on a machine running wmisdnmon is being developped on a machine running
Conectiva Linux 7.0 (Brazilian RedHat like distro) Conectiva Linux 7.0 (Brazilian RedHat like distro)
Files Files
@ -21,19 +21,19 @@ INSTALL Installation instructions.
BUGS Things you don't want to know ;-) BUGS Things you don't want to know ;-)
COPYING GNU General Public License Version 2. COPYING GNU General Public License Version 2.
TODO FFF (Features For the Future). TODO FFF (Features For the Future).
Bugs Bugs
-------------------------------------------------------------- --------------------------------------------------------------
If you discover any bugs in this software, please send a If you discover any bugs in this software, please send a
bugreport to marcelomorgade@ig.com.br and describe bugreport to marcelomorgade@ig.com.br and describe
the problem as detailed as you can. the problem as detailed as you can.
Copyright Copyright
-------------------------------------------------------------- --------------------------------------------------------------
wmdonkeymon is copyright (c) 2002 by Marcelo Morgade and wmdonkeymon is copyright (c) 2002 by Marcelo Morgade and
licensed through the GNU General Public License. licensed through the GNU General Public License.
Read the COPYING file for the complete GNU license. Read the COPYING file for the complete GNU license.

View file

@ -2,10 +2,10 @@
/* /*
* *
* wmdonkeymon 0.9 (C) 2002 Marcelo Burgos Morgade Cortizo (marcelomorgade@ig.com.br) * wmdonkeymon 0.9 (C) 2002 Marcelo Burgos Morgade Cortizo (marcelomorgade@ig.com.br)
* *
* - Show status of edonkey downloads based on '*.part.met' files * - Show status of edonkey downloads based on '*.part.met' files
* *
* *
* *
*/ */
@ -23,7 +23,7 @@
#include "../wmgeneral/wmgeneral.h" #include "../wmgeneral/wmgeneral.h"
#include "wmdonkeymon_master.xpm" #include "wmdonkeymon_master.xpm"
#include "wmdonkeymon_mask.xbm" #include "wmdonkeymon_mask.xbm"
#define SLOT_SIZE 52 #define SLOT_SIZE 52
#define REF_RATE 5 #define REF_RATE 5
@ -138,13 +138,13 @@ int main(int argc, char *argv[])
} }
} }
if (!tmpdir) { usage(); exit(-1);} if (!tmpdir) { usage(); exit(-1);}
openXwindow(argc, argv, wmdonkeymon_master_xpm, wmdonkeymon_mask_bits, wmdonkeymon_mask_width, wmdonkeymon_mask_height); openXwindow(argc, argv, wmdonkeymon_master_xpm, wmdonkeymon_mask_bits, wmdonkeymon_mask_width, wmdonkeymon_mask_height);
copyXPMArea(5,60,52,54,5,3); copyXPMArea(5,60,52,54,5,3);
RedrawWindow(); RedrawWindow();
splash(); splash();
r = 0; r = 0;
while (1) { while (1) {
if (!r) { if (!r) {
@ -155,7 +155,7 @@ int main(int argc, char *argv[])
long int fileSize=0, num =0; long int fileSize=0, num =0;
char nvalue[516],value[516]; char nvalue[516],value[516];
j =0; j =0;
metnum=0; metnum=0;
// Search for files in temp directory // Search for files in temp directory
ls = scandir(tmpdir, &namelist, 0, alphasort); ls = scandir(tmpdir, &namelist, 0, alphasort);
if (ls < 0){ if (ls < 0){
@ -182,37 +182,37 @@ int main(int argc, char *argv[])
if(debug)printf("opening %s\n",buf); if(debug)printf("opening %s\n",buf);
if ( (met = fopen(buf,"rb")) != NULL) {} if ( (met = fopen(buf,"rb")) != NULL) {}
else {printf("Nada\n");}; else {printf("Nada\n");};
// Version // Version
i += fread(buf,1,1,met); i += fread(buf,1,1,met);
if(debug){ printf("Version: %x\n",buf[0]); } if(debug){ printf("Version: %x\n",buf[0]); }
// Date ?? // Date ??
i += fread(buf,1,4,met); i += fread(buf,1,4,met);
if(debug) { printf("Date: %x %x %x %x \n",buf[0],buf[1],buf[2],buf[3]); } if(debug) { printf("Date: %x %x %x %x \n",buf[0],buf[1],buf[2],buf[3]); }
// Hash // Hash
i += fread(buf,1,16,met); i += fread(buf,1,16,met);
if(debug){ printf("Hash: "); for (j=0;j<16;j++) printf("%x ",buf[j]); printf("\n"); } if(debug){ printf("Hash: "); for (j=0;j<16;j++) printf("%x ",buf[j]); printf("\n"); }
// Partial Hashes // Partial Hashes
i += fread(buf,1,2,met); i += fread(buf,1,2,met);
memcpy(&j,buf,2); memcpy(&j,buf,2);
if(debug) printf("Num of Hashes: %d\n",j); if(debug) printf("Num of Hashes: %d\n",j);
// Hashes // Hashes
for (i=0;i<j;i++){ for (i=0;i<j;i++){
fread(buf,1,16,met); fread(buf,1,16,met);
if(debug){printf("Hash %d: ",i+1); for (x=0;x<16;x++) printf("%x ",buf[x]); printf("\n");} if(debug){printf("Hash %d: ",i+1); for (x=0;x<16;x++) printf("%x ",buf[x]); printf("\n");}
} }
// Num of Meta Tags // Num of Meta Tags
i = fread(buf,1,4,met); i = fread(buf,1,4,met);
memcpy(&num,buf,4); memcpy(&num,buf,4);
if(debug){printf("Num of Meta Tags: %ld\n",num);} if(debug){printf("Num of Meta Tags: %ld\n",num);}
x = 0; x = 0;
// Meta Tags // Meta Tags
for (i=0;i<num;i++){ for (i=0;i<num;i++){
fread(&type,1,1,met); fread(&type,1,1,met);
@ -240,9 +240,9 @@ int main(int argc, char *argv[])
case 18: case 18:
if(debug){printf("Temp file: %s\n",value);} if(debug){printf("Temp file: %s\n",value);}
break; break;
} }
} else if (debug)printf("Unknow String Tag %d: %s",nvalue[0],value); } else if (debug)printf("Unknow String Tag %d: %s",nvalue[0],value);
}else if (type==3){ }else if (type==3){
fread(&fsize,1,4,met); fread(&fsize,1,4,met);
@ -287,15 +287,15 @@ int main(int argc, char *argv[])
if(debug)printf(" to %10d = %10d Size(%d) Gaprel: %d-%d\n",fsize,miss,9728000,files[metnum].gappos[x][0],files[metnum].gappos[x][1]); if(debug)printf(" to %10d = %10d Size(%d) Gaprel: %d-%d\n",fsize,miss,9728000,files[metnum].gappos[x][0],files[metnum].gappos[x][1]);
} }
} }
} }
} }
files[metnum].gapnum = x; files[metnum].gapnum = x;
files[metnum].firstgap = firstgap; files[metnum].firstgap = firstgap;
files[metnum].lastsize = files[metnum].copied; files[metnum].lastsize = files[metnum].copied;
files[metnum].size = fileSize; files[metnum].size = fileSize;
// sort gaps // sort gaps
/* don'n needed /* don'n needed
* for (i=0; i<x; i++) * for (i=0; i<x; i++)
@ -311,11 +311,11 @@ int main(int argc, char *argv[])
} }
if(debug)for (i=0; i<x; i++){ printf("[%d-%d]",files[0].gappos[i][0],files[0].gappos[i][1]); } if(debug)for (i=0; i<x; i++){ printf("[%d-%d]",files[0].gappos[i][0],files[0].gappos[i][1]); }
*/ */
if(debug)printf("%d bytes = %.2f mb missing\n", files[metnum].t_miss, (double)files[metnum].t_miss/(1024*1024)); if(debug)printf("%d bytes = %.2f mb missing\n", files[metnum].t_miss, (double)files[metnum].t_miss/(1024*1024));
if(debug)if (firstgap < 0x7fffffff) printf("first gap starts at %d (%d blocks are complete)\n", firstgap, firstgap/(9500*1024)); if(debug)if (firstgap < 0x7fffffff) printf("first gap starts at %d (%d blocks are complete)\n", firstgap, firstgap/(9500*1024));
fclose(met); fclose(met);
} }
} }
@ -340,7 +340,7 @@ int main(int argc, char *argv[])
break; break;
} }
} }
for (j=0;j<15;j++) DelMouseRegion(j); for (j=0;j<15;j++) DelMouseRegion(j);
if (metnum==0){ if (metnum==0){
@ -356,35 +356,35 @@ int main(int argc, char *argv[])
copyXPMArea(5,60,52,54,5,3); copyXPMArea(5,60,52,54,5,3);
AddMouseRegion(0,5,5,54,54); AddMouseRegion(0,5,5,54,54);
showString(files[selected].name,1); showString(files[selected].name,1);
s=files[selected].size; s=files[selected].size;
while (s>1024){s/=1024;sk++;} while (s>1024){s/=1024;sk++;}
c=files[selected].copied; c=files[selected].copied;
while (c>1024){c/=1024;ck++;} while (c>1024){c/=1024;ck++;}
sprintf(out,"%ld%c/%ld%c",c,unit[ck],s,unit[sk]); sprintf(out,"%ld%c/%ld%c",c,unit[ck],s,unit[sk]);
showString(out,4); showString(out,4);
sprintf(out,"%s",files[selected].type); sprintf(out,"%s",files[selected].type);
showString(out,5); showString(out,5);
// ************** // **************
// Donwload Rate // Donwload Rate
// Don't work unless edonkey update met files more frequently // Don't work unless edonkey update met files more frequently
// //
// s = (files[selected].copied) - (files[selected].lastsize); // s = (files[selected].copied) - (files[selected].lastsize);
// sprintf(out,"%ld B/S",(s/REF_RATE)); // sprintf(out,"%ld B/S",(s/REF_RATE));
// showString(out,8); // showString(out,8);
//************************ //************************
//STATUS //STATUS
//status tag is always "Looking..." :( //status tag is always "Looking..." :(
// //
//getStatus(files[selected].status,out); //getStatus(files[selected].status,out);
//showString(out,9); //showString(out,9);
sprintf(out,"%.3f%%", (( 1.0 * files[selected].copied / files[selected].size))*100); sprintf(out,"%.3f%%", (( 1.0 * files[selected].copied / files[selected].size))*100);
showString(out,8); showString(out,8);
copyXPMArea(66,colord,52,5,5,11); copyXPMArea(66,colord,52,5,5,11);
for (i=0; i < files[selected].gapnum ; i++) { for (i=0; i < files[selected].gapnum ; i++) {
copyXPMArea(66,colorg,files[selected].gappos[i][1]-files[selected].gappos[i][0],5,files[selected].gappos[i][0]+5 ,11); copyXPMArea(66,colorg,files[selected].gappos[i][1]-files[selected].gappos[i][0],5,files[selected].gappos[i][0]+5 ,11);
@ -406,7 +406,7 @@ int main(int argc, char *argv[])
sleep(1); sleep(1);
r++; r++;
if (r==REF_RATE) r=0; if (r==REF_RATE) r=0;
} }
} }
@ -444,15 +444,15 @@ void strcaseup(char * str){
} }
void showString(char * buf, int row){ void showString(char * buf, int row){
int i; int i;
strcaseup(buf); strcaseup(buf);
for (i=0; buf[i] && i<10;i++){ for (i=0; buf[i] && i<10;i++){
if (buf[i]>='0' && buf[i]<='9') copyXPMArea(xpos[buf[i]-18],ypos[buf[i]-18],5,5,(i+1)*5,(row*5)); if (buf[i]>='0' && buf[i]<='9') copyXPMArea(xpos[buf[i]-18],ypos[buf[i]-18],5,5,(i+1)*5,(row*5));
else if((buf[i]>='A' && buf[i]<='Z')) copyXPMArea(xpos[buf[i]-65],ypos[buf[i]-65],5,5,(i+1)*5,(row*5)); else if((buf[i]>='A' && buf[i]<='Z')) copyXPMArea(xpos[buf[i]-65],ypos[buf[i]-65],5,5,(i+1)*5,(row*5));
else if((buf[i]==' ')) copyXPMArea(66,44,5,5,(i+1)*5,(row*5)); else if((buf[i]==' ')) copyXPMArea(66,44,5,5,(i+1)*5,(row*5));
else if((buf[i]=='/')) copyXPMArea(76,24,5,5,(i+1)*5,(row*5)); else if((buf[i]=='/')) copyXPMArea(76,24,5,5,(i+1)*5,(row*5));
else if((buf[i]=='.')) copyXPMArea(91,24,5,5,(i+1)*5,(row*5)); else if((buf[i]=='.')) copyXPMArea(91,24,5,5,(i+1)*5,(row*5));
else if((buf[i]=='%')) copyXPMArea(106,24,5,5,(i+1)*5,(row*5)); else if((buf[i]=='%')) copyXPMArea(106,24,5,5,(i+1)*5,(row*5));
else copyXPMArea(xpos[28],ypos[28],5,5,(i+1)*5,(row*5)); else copyXPMArea(xpos[28],ypos[28],5,5,(i+1)*5,(row*5));
} }
} }
@ -469,11 +469,11 @@ void splash(){
char * s= ".WMDONKEY."; char * s= ".WMDONKEY.";
while (i<4){ while (i<4){
RedrawWindow(); RedrawWindow();
showString(s,1); showString(s,1);
copyXPMArea(70,47,47,19,9,20); copyXPMArea(70,47,47,19,9,20);
RedrawWindow(); RedrawWindow();
sleep(1); sleep(1);
i++; i++;
} }
} }

View file

@ -1,11 +1,11 @@
/* Generic single linked list to keep various information /* Generic single linked list to keep various information
Copyright (C) 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1993, 1994 Free Software Foundation, Inc.
Author: Kresten Krab Thorup Author: Kresten Krab Thorup
Many modifications by Alfredo K. Kojima Many modifications by Alfredo K. Kojima
This file is part of GNU CC. This file is part of GNU CC.
@ -38,7 +38,7 @@ Boston, MA 02111-1307, USA. */
/* Return a cons cell produced from (head . tail) */ /* Return a cons cell produced from (head . tail) */
INLINE LinkedList* INLINE LinkedList*
list_cons(void* head, LinkedList* tail) list_cons(void* head, LinkedList* tail)
{ {
LinkedList* cell; LinkedList* cell;
@ -63,7 +63,7 @@ list_length(LinkedList* list)
return i; return i;
} }
/* Return the Nth element of LIST, where N count from zero. If N /* Return the Nth element of LIST, where N count from zero. If N
larger than the list length, NULL is returned */ larger than the list length, NULL is returned */
INLINE void* INLINE void*
@ -84,7 +84,7 @@ list_nth(int index, LinkedList* list)
INLINE void INLINE void
list_remove_head(LinkedList** list) list_remove_head(LinkedList** list)
{ {
if (!*list) return; if (!*list) return;
if ((*list)->tail) if ((*list)->tail)
{ {
LinkedList* tail = (*list)->tail; /* fetch next */ LinkedList* tail = (*list)->tail; /* fetch next */
@ -116,7 +116,7 @@ INLINE LinkedList *
list_remove_elem(LinkedList* list, void* elem) list_remove_elem(LinkedList* list, void* elem)
{ {
LinkedList *tmp; LinkedList *tmp;
if (list) { if (list) {
if (list->head == elem) { if (list->head == elem) {
tmp = list->tail; tmp = list->tail;

View file

@ -1,4 +1,4 @@
/* Generic single linked list to keep various information /* Generic single linked list to keep various information
Copyright (C) 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1993, 1994 Free Software Foundation, Inc.
Author: Kresten Krab Thorup Author: Kresten Krab Thorup

View file

@ -1,9 +1,9 @@
/* dock.c- built-in Dock module for WindowMaker /* dock.c- built-in Dock module for WindowMaker
* *
* WindowMaker window manager * WindowMaker window manager
* *
* Copyright (c) 1997 Alfredo K. Kojima * Copyright (c) 1997 Alfredo K. Kojima
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
@ -28,7 +28,7 @@
*---------------------------------------------------------------------- *----------------------------------------------------------------------
* parse_command-- * parse_command--
* Divides a command line into a argv/argc pair. * Divides a command line into a argv/argc pair.
*---------------------------------------------------------------------- *----------------------------------------------------------------------
*/ */
#define PRC_ALPHA 0 #define PRC_ALPHA 0
#define PRC_BLANK 1 #define PRC_BLANK 1
@ -64,11 +64,11 @@ next_token(char *word, char **next)
t = ret = malloc(strlen(word)+1); t = ret = malloc(strlen(word)+1);
ptr = word; ptr = word;
state = 0; state = 0;
*t = 0; *t = 0;
while (1) { while (1) {
if (*ptr==0) if (*ptr==0)
ctype = PRC_EOS; ctype = PRC_EOS;
else if (*ptr=='\\') else if (*ptr=='\\')
ctype = PRC_ESCAPE; ctype = PRC_ESCAPE;
@ -98,12 +98,12 @@ next_token(char *word, char **next)
t = strdup(ret); t = strdup(ret);
free(ret); free(ret);
if (ctype==PRC_EOS) if (ctype==PRC_EOS)
*next = NULL; *next = NULL;
else else
*next = ptr; *next = ptr;
return t; return t;
} }
@ -118,7 +118,7 @@ parse_command(char *command, char ***argv, int *argc)
line = command; line = command;
do { do {
token = next_token(line, &line); token = next_token(line, &line);
if (token) { if (token) {
list = list_cons(token, list); list = list_cons(token, list);
} }
} while (token!=NULL && line!=NULL); } while (token!=NULL && line!=NULL);
@ -141,15 +141,15 @@ execCommand(char *command)
int argc; int argc;
parse_command(command, &argv, &argc); parse_command(command, &argv, &argc);
if (argv==NULL) { if (argv==NULL) {
return 0; return 0;
} }
if ((pid=fork())==0) { if ((pid=fork())==0) {
char **args; char **args;
int i; int i;
args = malloc(sizeof(char*)*(argc+1)); args = malloc(sizeof(char*)*(argc+1));
if (!args) if (!args)
exit(10); exit(10);

View file

@ -126,7 +126,7 @@ static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) {
err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap), err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap),
&(wmgen->mask), &(wmgen->attributes)); &(wmgen->mask), &(wmgen->attributes));
if (err != XpmSuccess) { if (err != XpmSuccess) {
fprintf(stderr, "Not enough free colorcells.\n"); fprintf(stderr, "Not enough free colorcells.\n");
exit(1); exit(1);
@ -173,9 +173,9 @@ static int flush_expose(Window w) {
\*******************************************************************************/ \*******************************************************************************/
void RedrawWindow(void) { void RedrawWindow(void) {
flush_expose(iconwin); flush_expose(iconwin);
XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, XCopyArea(display, wmgen.pixmap, iconwin, NormalGC,
0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0); 0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0);
flush_expose(win); flush_expose(win);
XCopyArea(display, wmgen.pixmap, win, NormalGC, XCopyArea(display, wmgen.pixmap, win, NormalGC,
@ -187,9 +187,9 @@ void RedrawWindow(void) {
\*******************************************************************************/ \*******************************************************************************/
void RedrawWindowXY(int x, int y) { void RedrawWindowXY(int x, int y) {
flush_expose(iconwin); flush_expose(iconwin);
XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, XCopyArea(display, wmgen.pixmap, iconwin, NormalGC,
x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0); x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0);
flush_expose(win); flush_expose(win);
XCopyArea(display, wmgen.pixmap, win, NormalGC, XCopyArea(display, wmgen.pixmap, win, NormalGC,
@ -294,12 +294,12 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
int i; int i;
for (i=1; argv[i]; i++) { for (i=1; argv[i]; i++) {
if (!strcmp(argv[i], "-display")) if (!strcmp(argv[i], "-display"))
display_name = argv[i+1]; display_name = argv[i+1];
} }
if (!(display = XOpenDisplay(display_name))) { if (!(display = XOpenDisplay(display_name))) {
fprintf(stderr, "%s: can't open display %s\n", fprintf(stderr, "%s: can't open display %s\n",
wname, XDisplayName(display_name)); wname, XDisplayName(display_name));
exit(1); exit(1);
} }
@ -324,10 +324,10 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
mysizehints.width = 64; mysizehints.width = 64;
mysizehints.height = 64; mysizehints.height = 64;
win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y, win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y,
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix); mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y, iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y,
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix); mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
@ -348,7 +348,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
XSetWMName(display, win, &name); XSetWMName(display, win, &name);
/* Create GC for drawing */ /* Create GC for drawing */
gcm = GCForeground | GCBackground | GCGraphicsExposures; gcm = GCForeground | GCBackground | GCGraphicsExposures;
gcv.foreground = fore_pix; gcv.foreground = fore_pix;
gcv.background = back_pix; gcv.background = back_pix;

View file

@ -1,6 +1,6 @@
LIBDIR = -L/usr/X11R6/lib LIBDIR = -L/usr/X11R6/lib
LIBS = -lXpm -lXext -lX11 LIBS = -lXpm -lXext -lX11
OBJS = wmdots.o ../wmgeneral/wmgeneral.o OBJS = wmdots.o ../wmgeneral/wmgeneral.o
.c.o: .c.o:
cc -c -g -O2 -Wall $< -o $*.o cc -c -g -O2 -Wall $< -o $*.o
@ -17,7 +17,7 @@ clean::
rm wmdots rm wmdots
install:: install::
cp -f wmdots /usr/local/bin/ cp -f wmdots /usr/local/bin/
chmod 755 /usr/local/bin/wmdots chmod 755 /usr/local/bin/wmdots
chown root:root /usr/local/bin/wmdots chown root:root /usr/local/bin/wmdots

View file

@ -21,9 +21,9 @@ short sin_tab[]=
0x3fb1, 0x3fc3, 0x3fd3, 0x3fe1, 0x3fec, 0x3ff4, 0x3ffb, 0x3ffe, 0x3fb1, 0x3fc3, 0x3fd3, 0x3fe1, 0x3fec, 0x3ff4, 0x3ffb, 0x3ffe,
0x3fff, 0x3ffe, 0x3ffb, 0x3ff4, 0x3fec, 0x3fe1, 0x3fd3, 0x3fc3, 0x3fff, 0x3ffe, 0x3ffb, 0x3ff4, 0x3fec, 0x3fe1, 0x3fd3, 0x3fc3,
0x3fb1, 0x3f9c, 0x3f84, 0x3f6a, 0x3f4e, 0x3f2f, 0x3f0e, 0x3eeb, 0x3fb1, 0x3f9c, 0x3f84, 0x3f6a, 0x3f4e, 0x3f2f, 0x3f0e, 0x3eeb,
0x3ec5, 0x3e9c, 0x3e71, 0x3e44, 0x3e14, 0x3de2, 0x3dae, 0x3d77, 0x3ec5, 0x3e9c, 0x3e71, 0x3e44, 0x3e14, 0x3de2, 0x3dae, 0x3d77,
0x3d3e, 0x3d02, 0x3cc5, 0x3c84, 0x3c42, 0x3bfd, 0x3bb6, 0x3b6c, 0x3d3e, 0x3d02, 0x3cc5, 0x3c84, 0x3c42, 0x3bfd, 0x3bb6, 0x3b6c,
0x3b20, 0x3ad2, 0x3a82, 0x3a2f, 0x39da, 0x3983, 0x392a, 0x38cf, 0x3b20, 0x3ad2, 0x3a82, 0x3a2f, 0x39da, 0x3983, 0x392a, 0x38cf,
0x3871, 0x3811, 0x37af, 0x374b, 0x36e5, 0x367c, 0x3612, 0x35a5, 0x3871, 0x3811, 0x37af, 0x374b, 0x36e5, 0x367c, 0x3612, 0x35a5,
0x3536, 0x34c6, 0x3453, 0x33de, 0x3367, 0x32ee, 0x3274, 0x31f7, 0x3536, 0x34c6, 0x3453, 0x33de, 0x3367, 0x32ee, 0x3274, 0x31f7,

View file

@ -195,24 +195,24 @@ xyz square[]=
xyz cross[]= xyz cross[]=
{ {
{0x00,0x00,0x19}, {0x00,0x05,0x19}, {0x00,0x14,0x01}, {0x00,0x32,0x00}, {0x00,0x00,0x19}, {0x00,0x05,0x19}, {0x00,0x14,0x01}, {0x00,0x32,0x00},
{0x00,0x7D,0x00}, {0x00,0xC9,0x00}, {0x01,0x5F,0x01}, {0x01,0xAB,0x01}, {0x00,0x7D,0x00}, {0x00,0xC9,0x00}, {0x01,0x5F,0x01}, {0x01,0xAB,0x01},
{0x01,0xF6,0x01}, {0x02,0x41,0x02}, {0x02,0x8D,0x02}, {0x02,0xD8,0x02}, {0x01,0xF6,0x01}, {0x02,0x41,0x02}, {0x02,0x8D,0x02}, {0x02,0xD8,0x02},
{0x03,0x23,0x03}, {0x03,0x05,0x04}, {0x03,0x6F,0x03}, {0x03,0xBA,0x03}, {0x03,0x23,0x03}, {0x03,0x05,0x04}, {0x03,0x6F,0x03}, {0x03,0xBA,0x03},
{0x04,0x51,0x04}, {0x04,0x9C,0x04}, {0x04,0xE7,0x04}, {0x05,0x13,0x06}, {0x04,0x51,0x04}, {0x04,0x9C,0x04}, {0x04,0xE7,0x04}, {0x05,0x13,0x06},
{0x05,0x32,0x05}, {0x05,0x7D,0x05}, {0x05,0xC8,0x05}, {0x06,0x5E,0x06}, {0x05,0x32,0x05}, {0x05,0x7D,0x05}, {0x05,0xC8,0x05}, {0x06,0x5E,0x06},
{0x06,0xA9,0x06}, {0x06,0xF4,0x06}, {0x07,0x3F,0x07}, {0x07,0x8A,0x07}, {0x06,0xA9,0x06}, {0x06,0xF4,0x06}, {0x07,0x3F,0x07}, {0x07,0x8A,0x07},
{0x07,0xD5,0x07}, {0x08,0x00,0x09}, {0x08,0x20,0x08}, {0x08,0x6B,0x08}, {0x07,0xD5,0x07}, {0x08,0x00,0x09}, {0x08,0x20,0x08}, {0x08,0x6B,0x08},
{0x08,0xB5,0x08}, {0x09,0x4B,0x09}, {0x09,0x95,0x09}, {0x09,0xE0,0x09}, {0x08,0xB5,0x08}, {0x09,0x4B,0x09}, {0x09,0x95,0x09}, {0x09,0xE0,0x09},
{0x0A,0x09,0x0B}, {0x0A,0x2A,0x0A}, {0x0A,0x75,0x0A}, {0x0A,0xBF,0x0A}, {0x0A,0x09,0x0B}, {0x0A,0x2A,0x0A}, {0x0A,0x75,0x0A}, {0x0A,0xBF,0x0A},
{0x0B,0x54,0x0B}, {0x0D,0x07,0x26}, {0x0F,0x02,0x28}, {0x19,0x09,0x32}, {0x0B,0x54,0x0B}, {0x0D,0x07,0x26}, {0x0F,0x02,0x28}, {0x19,0x09,0x32},
{0x1E,0x04,0x37}, {0x22,0x0B,0x3B}, {0x2C,0x06,0x45}, {0x2D,0x01,0x46}, {0x1E,0x04,0x37}, {0x22,0x0B,0x3B}, {0x2C,0x06,0x45}, {0x2D,0x01,0x46},
{0x39,0x08,0x52}, {0x3D,0x03,0x56}, {0x43,0x0A,0x5C}, {0x4B,0x00,0x64}, {0x39,0x08,0x52}, {0x3D,0x03,0x56}, {0x43,0x0A,0x5C}, {0x4B,0x00,0x64},
{0x4B,0x05,0x64}, {0x58,0x07,0x71}, {0x5B,0x02,0x74}, {0x64,0x09,0x7C}, {0x4B,0x05,0x64}, {0x58,0x07,0x71}, {0x5B,0x02,0x74}, {0x64,0x09,0x7C},
{0x84,0x08,0x9C}, {0x88,0x03,0xA1}, {0x8D,0x0A,0xA6}, {0x96,0x00,0xAF}, {0x84,0x08,0x9C}, {0x88,0x03,0xA1}, {0x8D,0x0A,0xA6}, {0x96,0x00,0xAF},
{0x96,0x05,0xAF}, {0xA3,0x07,0xBC}, {0xA6,0x02,0xBF}, {0xAE,0x09,0xC7}, {0x96,0x05,0xAF}, {0xA3,0x07,0xBC}, {0xA6,0x02,0xBF}, {0xAE,0x09,0xC7},
{0xB5,0x04,0xCE}, {0xC2,0x06,0xDB}, {0xC4,0x01,0xDD}, {0xCE,0x08,0xE7}, {0xB5,0x04,0xCE}, {0xC2,0x06,0xDB}, {0xC4,0x01,0xDD}, {0xCE,0x08,0xE7},
{0xD3,0x03,0xEC}, {0xD8,0x0A,0xF1}, {0xE1,0x05,0xFA}, {0xE2,0x00,0xFB}, {0xD3,0x03,0xEC}, {0xD8,0x0A,0xF1}, {0xE1,0x05,0xFA}, {0xE2,0x00,0xFB},
{0xEE,0x07,0x07}, {0xF1,0x02,0x0A}, {0xF9,0x09,0x11} {0xEE,0x07,0x07}, {0xF1,0x02,0x0A}, {0xF9,0x09,0x11}
}; };

View file

@ -1,11 +1,11 @@
/* Generic single linked list to keep various information /* Generic single linked list to keep various information
Copyright (C) 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1993, 1994 Free Software Foundation, Inc.
Author: Kresten Krab Thorup Author: Kresten Krab Thorup
Many modifications by Alfredo K. Kojima Many modifications by Alfredo K. Kojima
This file is part of GNU CC. This file is part of GNU CC.
@ -38,7 +38,7 @@ Boston, MA 02111-1307, USA. */
/* Return a cons cell produced from (head . tail) */ /* Return a cons cell produced from (head . tail) */
INLINE LinkedList* INLINE LinkedList*
list_cons(void* head, LinkedList* tail) list_cons(void* head, LinkedList* tail)
{ {
LinkedList* cell; LinkedList* cell;
@ -63,7 +63,7 @@ list_length(LinkedList* list)
return i; return i;
} }
/* Return the Nth element of LIST, where N count from zero. If N /* Return the Nth element of LIST, where N count from zero. If N
larger than the list length, NULL is returned */ larger than the list length, NULL is returned */
INLINE void* INLINE void*
@ -84,7 +84,7 @@ list_nth(int index, LinkedList* list)
INLINE void INLINE void
list_remove_head(LinkedList** list) list_remove_head(LinkedList** list)
{ {
if (!*list) return; if (!*list) return;
if ((*list)->tail) if ((*list)->tail)
{ {
LinkedList* tail = (*list)->tail; /* fetch next */ LinkedList* tail = (*list)->tail; /* fetch next */
@ -116,7 +116,7 @@ INLINE LinkedList *
list_remove_elem(LinkedList* list, void* elem) list_remove_elem(LinkedList* list, void* elem)
{ {
LinkedList *tmp; LinkedList *tmp;
if (list) { if (list) {
if (list->head == elem) { if (list->head == elem) {
tmp = list->tail; tmp = list->tail;

View file

@ -1,4 +1,4 @@
/* Generic single linked list to keep various information /* Generic single linked list to keep various information
Copyright (C) 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1993, 1994 Free Software Foundation, Inc.
Author: Kresten Krab Thorup Author: Kresten Krab Thorup

View file

@ -1,9 +1,9 @@
/* dock.c- built-in Dock module for WindowMaker /* dock.c- built-in Dock module for WindowMaker
* *
* WindowMaker window manager * WindowMaker window manager
* *
* Copyright (c) 1997 Alfredo K. Kojima * Copyright (c) 1997 Alfredo K. Kojima
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
@ -28,7 +28,7 @@
*---------------------------------------------------------------------- *----------------------------------------------------------------------
* parse_command-- * parse_command--
* Divides a command line into a argv/argc pair. * Divides a command line into a argv/argc pair.
*---------------------------------------------------------------------- *----------------------------------------------------------------------
*/ */
#define PRC_ALPHA 0 #define PRC_ALPHA 0
#define PRC_BLANK 1 #define PRC_BLANK 1
@ -64,11 +64,11 @@ next_token(char *word, char **next)
t = ret = malloc(strlen(word)+1); t = ret = malloc(strlen(word)+1);
ptr = word; ptr = word;
state = 0; state = 0;
*t = 0; *t = 0;
while (1) { while (1) {
if (*ptr==0) if (*ptr==0)
ctype = PRC_EOS; ctype = PRC_EOS;
else if (*ptr=='\\') else if (*ptr=='\\')
ctype = PRC_ESCAPE; ctype = PRC_ESCAPE;
@ -98,12 +98,12 @@ next_token(char *word, char **next)
t = strdup(ret); t = strdup(ret);
free(ret); free(ret);
if (ctype==PRC_EOS) if (ctype==PRC_EOS)
*next = NULL; *next = NULL;
else else
*next = ptr; *next = ptr;
return t; return t;
} }
@ -118,7 +118,7 @@ parse_command(char *command, char ***argv, int *argc)
line = command; line = command;
do { do {
token = next_token(line, &line); token = next_token(line, &line);
if (token) { if (token) {
list = list_cons(token, list); list = list_cons(token, list);
} }
} while (token!=NULL && line!=NULL); } while (token!=NULL && line!=NULL);
@ -141,15 +141,15 @@ execCommand(char *command)
int argc; int argc;
parse_command(command, &argv, &argc); parse_command(command, &argv, &argc);
if (argv==NULL) { if (argv==NULL) {
return 0; return 0;
} }
if ((pid=fork())==0) { if ((pid=fork())==0) {
char **args; char **args;
int i; int i;
args = malloc(sizeof(char*)*(argc+1)); args = malloc(sizeof(char*)*(argc+1));
if (!args) if (!args)
exit(10); exit(10);

View file

@ -17,7 +17,7 @@
* Now supports >256 colors * Now supports >256 colors
11/09/1998 (Martijn Pieterse, pieterse@xs4all.nl) 11/09/1998 (Martijn Pieterse, pieterse@xs4all.nl)
* Removed a bug from parse_rcfile. You could * Removed a bug from parse_rcfile. You could
not use "start" in a command if a label was not use "start" in a command if a label was
also start. also start.
* Changed the needed geometry string. * Changed the needed geometry string.
We don't use window size, and don't support We don't use window size, and don't support
@ -175,7 +175,7 @@ static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) {
err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap), err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap),
&(wmgen->mask), &(wmgen->attributes)); &(wmgen->mask), &(wmgen->attributes));
if (err != XpmSuccess) { if (err != XpmSuccess) {
fprintf(stderr, "Not enough free colorcells.\n"); fprintf(stderr, "Not enough free colorcells.\n");
exit(1); exit(1);
@ -222,9 +222,9 @@ static int flush_expose(Window w) {
\*******************************************************************************/ \*******************************************************************************/
void RedrawWindow(void) { void RedrawWindow(void) {
flush_expose(iconwin); flush_expose(iconwin);
XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, XCopyArea(display, wmgen.pixmap, iconwin, NormalGC,
0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0); 0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0);
flush_expose(win); flush_expose(win);
XCopyArea(display, wmgen.pixmap, win, NormalGC, XCopyArea(display, wmgen.pixmap, win, NormalGC,
@ -236,9 +236,9 @@ void RedrawWindow(void) {
\*******************************************************************************/ \*******************************************************************************/
void RedrawWindowXY(int x, int y) { void RedrawWindowXY(int x, int y) {
flush_expose(iconwin); flush_expose(iconwin);
XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, XCopyArea(display, wmgen.pixmap, iconwin, NormalGC,
x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0); x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0);
flush_expose(win); flush_expose(win);
XCopyArea(display, wmgen.pixmap, win, NormalGC, XCopyArea(display, wmgen.pixmap, win, NormalGC,
@ -294,7 +294,7 @@ void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) {
unsigned char bwrite; unsigned char bwrite;
int bcount; int bcount;
int curpixel; int curpixel;
sscanf(*xpm, "%d %d %d %d", &width, &height, &numcol, &depth); sscanf(*xpm, "%d %d %d %d", &width, &height, &numcol, &depth);
@ -303,7 +303,7 @@ void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) {
zero <<=8; zero <<=8;
zero |= xpm[1][k]; zero |= xpm[1][k];
} }
for (i=numcol+1; i < numcol+sy+1; i++) { for (i=numcol+1; i < numcol+sy+1; i++) {
bcount = 0; bcount = 0;
bwrite = 0; bwrite = 0;
@ -316,7 +316,7 @@ void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) {
curpixel <<=8; curpixel <<=8;
curpixel |= xpm[i][j+k]; curpixel |= xpm[i][j+k];
} }
if ( curpixel != zero ) { if ( curpixel != zero ) {
bwrite += 128; bwrite += 128;
} }
@ -392,7 +392,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
} }
if (!(display = XOpenDisplay(display_name))) { if (!(display = XOpenDisplay(display_name))) {
fprintf(stderr, "%s: can't open display %s\n", fprintf(stderr, "%s: can't open display %s\n",
wname, XDisplayName(display_name)); wname, XDisplayName(display_name));
exit(1); exit(1);
} }
@ -417,10 +417,10 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
mysizehints.width = 64; mysizehints.width = 64;
mysizehints.height = 64; mysizehints.height = 64;
win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y, win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y,
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix); mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y, iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y,
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix); mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
@ -441,7 +441,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
XSetWMName(display, win, &name); XSetWMName(display, win, &name);
/* Create GC for drawing */ /* Create GC for drawing */
gcm = GCForeground | GCBackground | GCGraphicsExposures; gcm = GCForeground | GCBackground | GCGraphicsExposures;
gcv.foreground = fore_pix; gcv.foreground = fore_pix;
gcv.background = back_pix; gcv.background = back_pix;

View file

@ -11,7 +11,7 @@ VMGlobe
- option selection through parameters screens (right button) - option selection through parameters screens (right button)
- approximation of date & time of view point - approximation of date & time of view point
- new default map (bigger, better) - new default map (bigger, better)
- display of time uses setlocale() - display of time uses setlocale()
- option -dawn value : enhance dawn borderline - option -dawn value : enhance dawn borderline
- option -time : change date displayed - option -time : change date displayed
- option -nonimap - option -nonimap
@ -20,7 +20,7 @@ VMGlobe
- modify comportment of -rand option when zooming - modify comportment of -rand option when zooming
- change left button comportment : only change longitude - change left button comportment : only change longitude
- shift+left button : change longitude & latitude - shift+left button : change longitude & latitude
- man page - man page
0.3.1 released 5/02/99 0.3.1 released 5/02/99
- option -austral - option -austral
@ -39,7 +39,7 @@ VMGlobe
left click = change longitude left click = change longitude
middle click = zoom in / zoom out middle click = zoom in / zoom out
right click = change latitude right click = change latitude
- a few hints for compile on *BSD - a few hints for compile on *BSD
0.1 released 31/12/98 0.1 released 31/12/98

View file

@ -2,7 +2,7 @@ INC = -I/usr/X11R6/include
LIBS = -lXext -lX11 -lm -L/usr/X11R6/lib \ LIBS = -lXext -lX11 -lm -L/usr/X11R6/lib \
-ltiff -lXpm -lpng -lz -ljpeg -lungif -lwraster -ltiff -lXpm -lpng -lz -ljpeg -lungif -lwraster
OBJS = src/wmglobe.o src/rend.o src/wmgutil.o \ OBJS = src/wmglobe.o src/rend.o src/wmgutil.o \
src/sunpos.o src/myconvert.o src/mycontext.o src/sunpos.o src/myconvert.o src/mycontext.o
.c.o : .c.o :
@ -12,11 +12,11 @@ all: wmglobe
clean: clean:
rm -f src/*.o wmglobe rm -f src/*.o wmglobe
wmglobe : $(OBJS) wmglobe : $(OBJS)
gcc -O2 -Wall $(OBJS) -o wmglobe $(LIBS) gcc -O2 -Wall $(OBJS) -o wmglobe $(LIBS)
strip wmglobe strip wmglobe
install : install :
install wmglobe /usr/local/bin install wmglobe /usr/local/bin
install wmglobe.1 /usr/local/man/man1 install wmglobe.1 /usr/local/man/man1

View file

@ -17,20 +17,20 @@ It's still a beta version...
Installation Installation
---------------------------------------- ----------------------------------------
You need WindowMaker to build WMGlobe. WMGlobe needs libwraster to compile, You need WindowMaker to build WMGlobe. WMGlobe needs libwraster to compile,
this lib is built by WindowMaker. No more need at run time if statically this lib is built by WindowMaker. No more need at run time if statically
linked, but then, you need WindowMaker to get the full magic :-) linked, but then, you need WindowMaker to get the full magic :-)
tar -xvzf wmglobe-0.5.tar.gz tar -xvzf wmglobe-0.5.tar.gz
cd wmglobe-0.5 cd wmglobe-0.5
make make
then move wmglobe in /usr/local/bin and man page somewhere or do then move wmglobe in /usr/local/bin and man page somewhere or do
(as root) : (as root) :
make install make install
If it doesn't work, look for the graphic libraries. If it doesn't work, look for the graphic libraries.
The Makefile is quite crude... The Makefile is quite crude...
@ -38,13 +38,13 @@ WMGlobe is developped on Linux (WMaker 0.51.0 and linux 2.0.36/ix86).
If you are successful on other platforms, please tell me so. If you are successful on other platforms, please tell me so.
platforms with successfull built reported : platforms with successfull built reported :
NetBSD 1.3.2 / SPARC (wmaker 0.20.3) , with Makefile adaptations for libs NetBSD 1.3.2 / SPARC (wmaker 0.20.3) , with Makefile adaptations for libs
Linux 2.0.36 / RedHat 5.1 Linux 2.0.36 / RedHat 5.1
Linux 2.0.36 / SuSE 5.3 (wmaker 0.20.3) , -lungif -> -lgif Linux 2.0.36 / SuSE 5.3 (wmaker 0.20.3) , -lungif -> -lgif
Linux 2.2.0-pre4 / Debian :-) Linux 2.2.0-pre4 / Debian :-)
FreeBSD-3.0 with -ltiff -> -ltiff34 and -lungif -> -lgif FreeBSD-3.0 with -ltiff -> -ltiff34 and -lungif -> -lgif
Solaris 2.6 / Sun Sparc (wmaker 0.20.3) , with Makefile adaptations for libs Solaris 2.6 / Sun Sparc (wmaker 0.20.3) , with Makefile adaptations for libs
AIX 4.2.1 / IBM RS/6000-250 (wmaker 0.50.2) AIX 4.2.1 / IBM RS/6000-250 (wmaker 0.50.2)
@ -54,46 +54,46 @@ RPM & DEBIAN linux packages coming soon. Or you can directly use the binary.
compile time problems : compile time problems :
Xlib.h, Xpm.h ... : Xlib.h, Xpm.h ... :
If you compile wmglobe on a computer installed with packages (.rpm), you may If you compile wmglobe on a computer installed with packages (.rpm), you may
lack of these header files. Just install the "xxx-dev.rpm" packages for XFree86 lack of these header files. Just install the "xxx-dev.rpm" packages for XFree86
and graphics libs, or install a rpm version of wmglobe. and graphics libs, or install a rpm version of wmglobe.
libwraster : libwraster :
WindowMaker 0.20.3 uses a libwraster.a , so if you use it, you can execute WindowMaker 0.20.3 uses a libwraster.a , so if you use it, you can execute
the binary on a computer without WindowMaker on it, and displaying on a the binary on a computer without WindowMaker on it, and displaying on a
remote computer (this one using WindowMaker). WM 0.51.0 creates a dynamic remote computer (this one using WindowMaker). WM 0.51.0 creates a dynamic
libwraster.so, so it's necessary to have it on the computer running wmglobe libwraster.so, so it's necessary to have it on the computer running wmglobe
if you buit WMGlobe with this one. Both versions of WMGlobe run on WM 0.20.3 if you buit WMGlobe with this one. Both versions of WMGlobe run on WM 0.20.3
and 0.51.0 and 0.51.0
graphic libs : graphic libs :
you can use libgif or libungif. If your version of WindowMaker is built you can use libgif or libungif. If your version of WindowMaker is built
without support for some graphic type, you don't need it (just remove it without support for some graphic type, you don't need it (just remove it
from the makefile). from the makefile).
This problem may happen with RedHat 5.2, if you get this kind of message, This problem may happen with RedHat 5.2, if you get this kind of message,
just add a libtiff to your system : just add a libtiff to your system :
/usr/local/lib/libwraster.so: undefined reference to `TIFFReadDirectory' /usr/local/lib/libwraster.so: undefined reference to `TIFFReadDirectory'
... ...
make: *** [wmglobe] Error 1 make: *** [wmglobe] Error 1
compile time options : compile time options :
You can modify the file wmgoption.h where many options are set up in defines : You can modify the file wmgoption.h where many options are set up in defines :
To disable the builtin default map, just comment out the line in wmgoptions.h : To disable the builtin default map, just comment out the line in wmgoptions.h :
#define DEFMAPOK #define DEFMAPOK
to supprim the shift+left/left method of rotate earth, uncomment the lines to supprim the shift+left/left method of rotate earth, uncomment the lines
#define MOUSE_LAT_FULL #define MOUSE_LAT_FULL
you can also suppress some options screen in wmgoption.h you can also suppress some options screen in wmgoption.h
Maps Maps
---------------------------------------- ----------------------------------------
Like XGlobe, WMGlobe needs a longitude/latitude map to work. By default, Like XGlobe, WMGlobe needs a longitude/latitude map to work. By default,
it uses a low quality built-in map of earth. But you will probably want it uses a low quality built-in map of earth. But you will probably want
to use better ones. to use better ones.
You can get maps usable with WMGlobe on the net. See the LINKS chapter. You can get maps usable with WMGlobe on the net. See the LINKS chapter.
@ -112,37 +112,37 @@ Configuration options
---------------------------------------- ----------------------------------------
Configuration is done through command line options. Configuration is done through command line options.
-v version -v version
-h short help -h short help
-zoom zoom_value Value > 1 to magnify the view, value < 1 to lower. -zoom zoom_value Value > 1 to magnify the view, value < 1 to lower.
Default : 1.0 Default : 1.0
-pos latitude long. Initial viewing fixed at this position, don't follow -pos latitude long. Initial viewing fixed at this position, don't follow
the sun rotation. Accepted values in the form the sun rotation. Accepted values in the form
45°12'36 or 45.21 or 45:12:36 45°12'36 or 45.21 or 45:12:36
Default : the initial position is "under" the sun, and Default : the initial position is "under" the sun, and
the point of view follows the sun the point of view follows the sun
-rand New random position at every refresh of screen -rand New random position at every refresh of screen
-map map_file Map used for the rendering. Can be JPEG, GIG, XPM -map map_file Map used for the rendering. Can be JPEG, GIG, XPM
PNM, TIFF but none BMP PNM, TIFF but none BMP
Default : use internal map of earth. Default : use internal map of earth.
-nimap night_file Map used for the dark side of the earth. Must be of -nimap night_file Map used for the dark side of the earth. Must be of
the same width x height as the day side map. the same width x height as the day side map.
Default : if the default internal day map is used, use Default : if the default internal day map is used, use
a default internal night file (see -nonimap option). a default internal night file (see -nonimap option).
If a custom day map is provided, and no night map, the If a custom day map is provided, and no night map, the
dark side is computed via the -light option. dark side is computed via the -light option.
-nonimap Don't use the default night map.
-delay seconds Time in seconds between each calculation of a new -nonimap Don't use the default night map.
-delay seconds Time in seconds between each calculation of a new
position. Limited to 0.04 at compile time (25 frames position. Limited to 0.04 at compile time (25 frames
per second should be enough). The sun position move per second should be enough). The sun position move
only once per minute, so if you use wmglobe without only once per minute, so if you use wmglobe without
-dlong or -accel option, the CPU cost of WMGlobe is -dlong or -accel option, the CPU cost of WMGlobe is
*very* low. The use of very low value for -delay plus *very* low. The use of very low value for -delay plus
@ -150,29 +150,29 @@ Configuration is done through command line options.
Default : 1.0 sec. Default : 1.0 sec.
-dlat delta_latitude Move the point of view by delta_lat degrees per second, -dlat delta_latitude Move the point of view by delta_lat degrees per second,
with a value of 6 the earth make a full rotation in with a value of 6 the earth make a full rotation in
one minute. The value can be formated as -pos option. one minute. The value can be formated as -pos option.
Default : 0°0'0 Default : 0°0'0
-dlong delta_long Move the point of view by delta_long degrees per -dlong delta_long Move the point of view by delta_long degrees per
second. With a value of -0°0'15" the earth make a full second. With a value of -0°0'15" the earth make a full
rotation in 24 hours toward the west. By default, rotation in 24 hours toward the west. By default,
-dlong and -dlat are null. If they are used, the view -dlong and -dlat are null. If they are used, the view
follow their values. Going back to "follow sun" mode follow their values. Going back to "follow sun" mode
in parameters screen put -dlat and -dlong to zero. in parameters screen put -dlat and -dlong to zero.
-light light_value Level of light of the dark side when there is no -light light_value Level of light of the dark side when there is no
night map, from 0 to 1. night map, from 0 to 1.
Default : 0.25 Default : 0.25
-dawn dawn_value Level of continuity for dawn limit, from 0 to 1. With -dawn dawn_value Level of continuity for dawn limit, from 0 to 1. With
a value of 1, the border line between night and day is a value of 1, the border line between night and day is
at maximum contrast. at maximum contrast.
Default : 0.2 Default : 0.2
-bord border_num 0 1 or 2. There are 3 different borders for the icon. -bord border_num 0 1 or 2. There are 3 different borders for the icon.
Default : 0 Default : 0
-accel time_multi Time warp factor. With -accel 24, the sun make a full -accel time_multi Time warp factor. With -accel 24, the sun make a full
rotation in one hour (or the earth, I'm not sure). rotation in one hour (or the earth, I'm not sure).
Default : 1.0 Default : 1.0
@ -186,11 +186,11 @@ Configuration is done through command line options.
-fun dx dy Move the earth image by dx dy pixels in the icon. See -fun dx dy Move the earth image by dx dy pixels in the icon. See
puzzle.sh to understand why. puzzle.sh to understand why.
-oz Start in "austral" mode (for "down under" people) -oz Start in "austral" mode (for "down under" people)
-d display Select another display -d display Select another display
-w -shape Useless, since it is set by default (WMaker dockable -w -shape Useless, since it is set by default (WMaker dockable
application) application)
mouse : mouse :
@ -203,13 +203,13 @@ right button Displays 7 screens of parameters. On every screen, just
clic with left or right button on the figures to change clic with left or right button on the figures to change
their value. The TIME screen shows an approximation their value. The TIME screen shows an approximation
of date and time of the earth zone currently displayed, of date and time of the earth zone currently displayed,
using GMT time + longitude offset, it's close to the using GMT time + longitude offset, it's close to the
real local time by one or two hours. Others options real local time by one or two hours. Others options
don't need more help. Intuitive they said... don't need more help. Intuitive they said...
Links : Some sites dealing with WindowMaker
Links : Some sites dealing with WindowMaker
------------------------------------------- -------------------------------------------
Official Window Maker Website : Official Window Maker Website :
@ -254,7 +254,7 @@ Livingearth Inc. has some nice (day and night) images on their web pages.
With these you can test the -nightmap option of XEarth. Unfortunately With these you can test the -nightmap option of XEarth. Unfortunately
they are pretty low-res (400x200). they are pretty low-res (400x200).
You can find a higher-resolution (but heavily compressed) version of this You can find a higher-resolution (but heavily compressed) version of this
day map at the "Earth View" page: day map at the "Earth View" page:
http://www.fourmilab.ch/cgi-bin/uncgi/Earth http://www.fourmilab.ch/cgi-bin/uncgi/Earth
@ -288,7 +288,7 @@ Bugs
- if you use the --enable-single-icon compile time option of WindowMaker, - if you use the --enable-single-icon compile time option of WindowMaker,
you can not display more than one WMGlobe. you can not display more than one WMGlobe.
- WMGlobe hopes that an overflow of a long integer dont generate an error - WMGlobe hopes that an overflow of a long integer dont generate an error
and that LONG_MAX +1 = LONG_MIN . This happens with high values of -accel and that LONG_MAX +1 = LONG_MIN . This happens with high values of -accel
when the date go over year 2038. The expected result is wmglobe when the date go over year 2038. The expected result is wmglobe
continuing smoothly from 1901. continuing smoothly from 1901.
@ -296,8 +296,8 @@ Bugs
License License
---------------------------------------- ----------------------------------------
WMGlobe is Copyright (C) 1998,99 by Jerome Dumonteil and licensed through WMGlobe is Copyright (C) 1998,99 by Jerome Dumonteil and licensed through
the GNU General Public License. the GNU General Public License.
Read the COPYING file for the complete GNU license. Read the COPYING file for the complete GNU license.
@ -335,14 +335,14 @@ The code in 'sunpos.cpp' is taken from Xearth by Kirk Lauritz Johnson.
The rendering engine is taken from XGlobe by Thorsten Scheuermann The rendering engine is taken from XGlobe by Thorsten Scheuermann
XGlobe Homepage: http://www.uni-karlsruhe.de/~uddn/xglobe XGlobe Homepage: http://www.uni-karlsruhe.de/~uddn/xglobe
Raster graphics library by Alfredo K. Kojima, & stuff of Window Maker Raster graphics library by Alfredo K. Kojima, & stuff of Window Maker
<http://windowmaker.org> by A. K. Kojima, Dan Pascu, Matthew Hawkins & team <http://windowmaker.org> by A. K. Kojima, Dan Pascu, Matthew Hawkins & team
Feedback Feedback
---------------------------------------- ----------------------------------------
For your questions, bugs, remarks, please contact our representative on For your questions, bugs, remarks, please contact our representative on
planet Earth : jerome dumonteil <jerome.dumonteil@capway.com> planet Earth : jerome dumonteil <jerome.dumonteil@capway.com>

View file

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
#just for the fun, solve the puzzle and put it on the clip :) #just for the fun, solve the puzzle and put it on the clip :)
if [ -x ./wmglobe ] if [ -x ./wmglobe ]
then then
WMG="nice ./wmglobe" WMG="nice ./wmglobe"
else else

View file

@ -4,19 +4,19 @@
*/ */
/* context.c - X context management /* context.c - X context management
* Raster graphics library * Raster graphics library
* *
* Copyright (c) 1997 Alfredo K. Kojima * Copyright (c) 1997 Alfredo K. Kojima
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version. * version 2 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details. * Library General Public License for more details.
* *
* You should have received a copy of the GNU Library General Public * You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free * License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
@ -31,14 +31,14 @@
* #include <X11/Xlib.h> * #include <X11/Xlib.h>
* #include <X11/Xutil.h> * #include <X11/Xutil.h>
* #include <X11/Xatom.h> * #include <X11/Xatom.h>
* *
* #include <stdio.h> * #include <stdio.h>
* #include <stdlib.h> * #include <stdlib.h>
* #include <string.h> * #include <string.h>
* #include <assert.h> * #include <assert.h>
* *
* #include <math.h> * #include <math.h>
* *
* #include "wraster.h" * #include "wraster.h"
*/ */
@ -135,7 +135,7 @@ static XColor *
colors[i].flags = DoRed | DoGreen | DoBlue; colors[i].flags = DoRed | DoGreen | DoBlue;
} }
} }
/* try to allocate close values for the colors that couldn't /* try to allocate close values for the colors that couldn't
* be allocated before */ * be allocated before */
avncolors = (1 << ctx->depth > 256 ? 256 : 1 << ctx->depth); avncolors = (1 << ctx->depth > 256 ? 256 : 1 << ctx->depth);
for (i = 0; i < avncolors; i++) for (i = 0; i < avncolors; i++)
@ -237,7 +237,7 @@ static XColor *
#endif #endif
} }
} }
/* try to allocate close values for the colors that couldn't /* try to allocate close values for the colors that couldn't
* be allocated before */ * be allocated before */
avncolors = (1 << ctx->depth > 256 ? 256 : 1 << ctx->depth); avncolors = (1 << ctx->depth > 256 ? 256 : 1 << ctx->depth);
for (i = 0; i < avncolors; i++) for (i = 0; i < avncolors; i++)

View file

@ -6,18 +6,18 @@
/* convert.c - convert RImage to Pixmap /* convert.c - convert RImage to Pixmap
* Raster graphics library * Raster graphics library
* *
* Copyright (c) 1997 Alfredo K. Kojima * Copyright (c) 1997 Alfredo K. Kojima
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version. * version 2 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details. * Library General Public License for more details.
* *
* You should have received a copy of the GNU Library General Public * You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free * License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

View file

@ -1,16 +1,16 @@
/* WMGlobe 0.5 - All the Earth on a WMaker Icon /* WMGlobe 0.5 - All the Earth on a WMaker Icon
* copyright (C) 1998,99 Jerome Dumonteil <jerome.dumonteil@capway.com> * copyright (C) 1998,99 Jerome Dumonteil <jerome.dumonteil@capway.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
@ -220,7 +220,7 @@ void renderFrame()
RClearImage(small, &noir); RClearImage(small, &noir);
/* /*
* rotation matrix * rotation matrix
*/ */
m11 = cos(v_long); m11 = cos(v_long);
@ -293,7 +293,7 @@ void renderFrame()
wurzel = sqrt(radikand); wurzel = sqrt(radikand);
s1 = (-b_coef + wurzel) / (2. * a); s1 = (-b_coef + wurzel) / (2. * a);
s2 = (-b_coef - wurzel) / (2. * a); s2 = (-b_coef - wurzel) / (2. * a);
s = (s1 < s2) ? s1 : s2; /* smaller solution belongs to nearer s = (s1 < s2) ? s1 : s2; /* smaller solution belongs to nearer
* intersection */ * intersection */
@ -381,7 +381,7 @@ void renderFrame()
wurzel = sqrt(soluce[px][py][0]); wurzel = sqrt(soluce[px][py][0]);
s1 = (-b_coef + wurzel) / (2. * a); s1 = (-b_coef + wurzel) / (2. * a);
s2 = (-b_coef - wurzel) / (2. * a); s2 = (-b_coef - wurzel) / (2. * a);
s = (s1 < s2) ? s1 : s2; /* smaller solution belongs to nearer s = (s1 < s2) ? s1 : s2; /* smaller solution belongs to nearer
* intersection */ * intersection */
soluce[px][py][1] = s * dir_x; /* sp = camera pos + s*dir */ soluce[px][py][1] = s * dir_x; /* sp = camera pos + s*dir */

View file

@ -160,10 +160,10 @@ static double sun_ecliptic_longitude(time_t ssue)
*/ */
static void ecliptic_to_equatorial(double lambda, double beta, double *alpha, double *delta) static void ecliptic_to_equatorial(double lambda, double beta, double *alpha, double *delta)
/* /*
* double lambda; ecliptic longitude * double lambda; ecliptic longitude
* double beta; ecliptic latitude * double beta; ecliptic latitude
* double *alpha; (return) right ascension * double *alpha; (return) right ascension
* double *delta; (return) declination * double *delta; (return) declination
*/ */
{ {
double sin_e, cos_e; double sin_e, cos_e;
@ -183,9 +183,9 @@ static void ecliptic_to_equatorial(double lambda, double beta, double *alpha, do
*/ */
static double julian_date(int y, int m, int d) static double julian_date(int y, int m, int d)
/* /*
* int y; year (e.g. 19xx) * int y; year (e.g. 19xx)
* int m; month (jan=1, feb=2, ...) * int m; month (jan=1, feb=2, ...)
* int d; day of month * int d; day of month
*/ */
{ {
int A, B, C, D; int A, B, C, D;

View file

@ -1,27 +1,27 @@
/* WMGlobe 0.5 - All the Earth on a WMaker Icon /* WMGlobe 0.5 - All the Earth on a WMaker Icon
* copyright (C) 1998,99 Jerome Dumonteil <jerome.dumonteil@capway.com> * copyright (C) 1998,99 Jerome Dumonteil <jerome.dumonteil@capway.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
***************************************************************************/ ***************************************************************************/
/* /*
* I used many functions of wmgeneral.c ("openXwindow") * I used many functions of wmgeneral.c ("openXwindow")
* for the main function of wmglobe.c * for the main function of wmglobe.c
* wmgeneral.c was taken from wmaker applet wmtune-1.0 : * wmgeneral.c was taken from wmaker applet wmtune-1.0 :
* Author: Martijn Pieterse (pieterse@xs4all.nl) * Author: Martijn Pieterse (pieterse@xs4all.nl)
* *
* wmglobe.c uses functions of : Xglobe, Xearth, wmgeneral, wmaker/wrlib * wmglobe.c uses functions of : Xglobe, Xearth, wmgeneral, wmaker/wrlib
***************************************************************************/ ***************************************************************************/
#include "wmglobe.h" #include "wmglobe.h"
@ -125,7 +125,7 @@ int main(int argc, char *argv[])
/* /*
* loading maps ............. * loading maps .............
* *
*/ */
if (dayfile != NULL) { if (dayfile != NULL) {

View file

@ -1,21 +1,21 @@
/* WMGlobe 0.5 - All the Earth on a WMaker Icon /* WMGlobe 0.5 - All the Earth on a WMaker Icon
* copyright (C) 1998,99 Jerome Dumonteil <jerome.dumonteil@capway.com> * copyright (C) 1998,99 Jerome Dumonteil <jerome.dumonteil@capway.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
***************************************************************************/ ***************************************************************************/
/* it uses some functions of : Xglobe, Xearth, wmgeneral, wmaker/wrlib /* it uses some functions of : Xglobe, Xearth, wmgeneral, wmaker/wrlib
***************************************************************************/ ***************************************************************************/
@ -125,7 +125,7 @@ double delay, time_multi;
/* /*
* struct timeval delta_tim, last_tim, next_tim, render_tim, base_tim, * struct timeval delta_tim, last_tim, next_tim, render_tim, base_tim,
* vec_tim; * vec_tim;
* *
* time_t beg_time, ini_time,t1901; * time_t beg_time, ini_time,t1901;
*/ */
struct timeval tlast, tnext, trend, tdelay, tini, tbase; struct timeval tlast, tnext, trend, tdelay, tini, tbase;

View file

@ -1,16 +1,16 @@
/* WMGlobe 0.5 - All the Earth on a WMaker Icon /* WMGlobe 0.5 - All the Earth on a WMaker Icon
* copyright (C) 1998,99 Jerome Dumonteil <jerome.dumonteil@capway.com> * copyright (C) 1998,99 Jerome Dumonteil <jerome.dumonteil@capway.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
@ -82,6 +82,6 @@
#define DEFAULT_DAWN 0.9 #define DEFAULT_DAWN 0.9
/* change this if not 64x64 icons (not deep tested) you will need to change /* change this if not 64x64 icons (not deep tested) you will need to change
the cadrex.xbm too and a few other things for the parameters menus the cadrex.xbm too and a few other things for the parameters menus
--- DIAMETRE must be a multiple of 2 --- */ --- DIAMETRE must be a multiple of 2 --- */
#define DIAMETRE 64 #define DIAMETRE 64

View file

@ -1,27 +1,27 @@
/* WMGlobe 0.5 - All the Earth on a WMaker Icon /* WMGlobe 0.5 - All the Earth on a WMaker Icon
* copyright (C) 1998,99 Jerome Dumonteil <jerome.dumonteil@capway.com> * copyright (C) 1998,99 Jerome Dumonteil <jerome.dumonteil@capway.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
***************************************************************************/ ***************************************************************************/
/* /*
* I used many functions of wmgeneral.c ("openXwindow") * I used many functions of wmgeneral.c ("openXwindow")
* for the main function of wmglobe.c * for the main function of wmglobe.c
* wmgeneral.c was taken from wmaker applet wmtune-1.0 : * wmgeneral.c was taken from wmaker applet wmtune-1.0 :
* Author: Martijn Pieterse (pieterse@xs4all.nl) * Author: Martijn Pieterse (pieterse@xs4all.nl)
* *
* wmglobe.c uses functions of : Xglobe, Xearth, wmgeneral, wmaker/wrlib * wmglobe.c uses functions of : Xglobe, Xearth, wmgeneral, wmaker/wrlib
***************************************************************************/ ***************************************************************************/
#include "wmglobe.h" #include "wmglobe.h"
@ -64,7 +64,7 @@ static void move_dlat(int factor);
static void move_dlong(int factor); static void move_dlong(int factor);
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
/* /*
* TIME FUNCTIONS * TIME FUNCTIONS
*/ */
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
struct timeval diftimev(struct timeval t1, struct timeval t2) struct timeval diftimev(struct timeval t1, struct timeval t2)
@ -98,7 +98,7 @@ struct timeval getimev()
return tv; return tv;
} }
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
/* /*
* INIT FUNCTIONS * INIT FUNCTIONS
* *
* defaults, commandline * defaults, commandline
@ -534,7 +534,7 @@ void cmdline(int argc, char *argv[])
/**************************************************************************** /****************************************************************************
* X functions, mouse selection * X functions, mouse selection
* *
*/ */
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
@ -591,7 +591,7 @@ int CheckMouseRegion(int x, int y)
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
/* /*
* GRAPHIC : pixmap writing of letters & numbers * GRAPHIC : pixmap writing of letters & numbers
* *
*/ */
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
static void chiffre(int ch, int xx, int yy) static void chiffre(int ch, int xx, int yy)
@ -1013,7 +1013,7 @@ static void display_pos(double la, double lo)
void rotation_terre(int x, int y, int lat_flag) void rotation_terre(int x, int y, int lat_flag)
{ {
/* /*
* earth rotate after (while) a clic * earth rotate after (while) a clic
*/ */
double mx, my; double mx, my;
mx = (double) ((double) x - DIAMETRE / 2 + 0.5) / zoom * cos(v_lat) * sens; mx = (double) ((double) x - DIAMETRE / 2 + 0.5) / zoom * cos(v_lat) * sens;

View file

@ -1,19 +1,19 @@
/* /*
* Raster graphics library * Raster graphics library
* *
* Copyright (c) 1997, 1998 Alfredo K. Kojima * Copyright (c) 1997, 1998 Alfredo K. Kojima
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version. * version 2 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details. * Library General Public License for more details.
* *
* You should have received a copy of the GNU Library General Public * You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free * License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
@ -21,15 +21,15 @@
/* /*
* Environment variables: * Environment variables:
* *
* WRASTER_GAMMA <rgamma>/<ggamma>/<bgamma> * WRASTER_GAMMA <rgamma>/<ggamma>/<bgamma>
* gamma correction value. Must be greater than 0 * gamma correction value. Must be greater than 0
* Only for PseudoColor visuals. * Only for PseudoColor visuals.
* *
* Default: * Default:
* WRASTER_GAMMA 1/1/1 * WRASTER_GAMMA 1/1/1
* *
* *
* If you want a specific value for a screen, append the screen number * If you want a specific value for a screen, append the screen number
* preceded by a hash to the variable name as in * preceded by a hash to the variable name as in
* WRASTER_GAMMA#1 * WRASTER_GAMMA#1

View file

@ -1,16 +1,16 @@
/* WMGlobe 0.5.pre1 - All the Earth on a WMaker Icon /* WMGlobe 0.5.pre1 - All the Earth on a WMaker Icon
* copyright (C) 1998,99 Jerome Dumonteil <jerome.dumonteil@capway.com> * copyright (C) 1998,99 Jerome Dumonteil <jerome.dumonteil@capway.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

View file

@ -1,6 +1,6 @@
.TH WMGlobe 1 "fevrier 1999" .TH WMGlobe 1 "fevrier 1999"
.SH NAME .SH NAME
WMGlobe - The Whole Earth spinning on you desktop... WMGlobe - The Whole Earth spinning on you desktop...
as a dockable app for WindowMaker as a dockable app for WindowMaker
.SH SYNOPSIS .SH SYNOPSIS
.B wmglobe .B wmglobe
@ -23,9 +23,9 @@ short help
Value > 1 to magnify the view, value < 1 to lower. Default: 1.0 Value > 1 to magnify the view, value < 1 to lower. Default: 1.0
.TP .TP
.B \-pos \fI latitude longitude\fP .B \-pos \fI latitude longitude\fP
Initial viewing fixed at this position, don't follow Initial viewing fixed at this position, don't follow
the sun rotation. Accepted values in the form 45°12'36 or 45.21 or 45:12:36 . the sun rotation. Accepted values in the form 45°12'36 or 45.21 or 45:12:36 .
Default: the initial position is "under" the sun, and Default: the initial position is "under" the sun, and
the point of view follows the sun. the point of view follows the sun.
.TP .TP
.B \-rand .B \-rand
@ -33,48 +33,48 @@ New random position at every refresh of screen.
.TP .TP
.B \-map \fI map_file\fP .B \-map \fI map_file\fP
Map used for the rendering. Can be JPEG, GIG, XPM Map used for the rendering. Can be JPEG, GIG, XPM
PNM, TIFF but none BMP. PNM, TIFF but none BMP.
Default: use internal map of earth. Default: use internal map of earth.
.TP .TP
.B \-nimap \fI night_file\fP .B \-nimap \fI night_file\fP
Map used for the dark side of the earth. Must be of Map used for the dark side of the earth. Must be of
the same width x height as the day side map. the same width x height as the day side map.
Default: if the default internal day map is used, use Default: if the default internal day map is used, use
a default internal night file (see -nonimap option). a default internal night file (see -nonimap option).
If a custom day map is provided, and no night map, the If a custom day map is provided, and no night map, the
dark side is computed via the -light option. dark side is computed via the -light option.
.TP .TP
.B \-nonimap .B \-nonimap
Don't use the default night map. Don't use the default night map.
.TP .TP
.B \-delay \fI seconds\fP .B \-delay \fI seconds\fP
Time in seconds between each calculation of a new Time in seconds between each calculation of a new
position. Limited to 0.04 at compile time (25 frames position. Limited to 0.04 at compile time (25 frames
per second should be enough). The sun position move per second should be enough). The sun position move
only once per minute, so if you use wmglobe without only once per minute, so if you use wmglobe without
-dlong or -accel option, the CPU cost of WMGlobe is -dlong or -accel option, the CPU cost of WMGlobe is
*very* low. The use of very low value for -delay plus *very* low. The use of very low value for -delay plus
-dlong and -accel can be CPU costly (but very nice...). -dlong and -accel can be CPU costly (but very nice...).
Default: 1.0 sec. Default: 1.0 sec.
.TP .TP
.B \-dlat \fI delta_latitude\fP .B \-dlat \fI delta_latitude\fP
Move the point of view by delta_lat degrees per second, Move the point of view by delta_lat degrees per second,
with a value of 6 the earth make a full rotation in with a value of 6 the earth make a full rotation in
one minute. The value can be formated as -pos option. one minute. The value can be formated as -pos option.
Default: 0°0'0 Default: 0°0'0
.TP .TP
.B \-dlong \fI delta_long\fP .B \-dlong \fI delta_long\fP
Move the point of view by delta_long degrees per Move the point of view by delta_long degrees per
second. With a value of -0°0'15" the earth make a full second. With a value of -0°0'15" the earth make a full
rotation in 24 hours toward the west. By default, rotation in 24 hours toward the west. By default,
-dlong and -dlat are null. If they are used, the view -dlong and -dlat are null. If they are used, the view
follow their values. Going back to "follow sun" mode follow their values. Going back to "follow sun" mode
in parameters screen put -dlat and -dlong to zero. in parameters screen put -dlat and -dlong to zero.
.TP .TP
.B \-light \fI light_value\fP .B \-light \fI light_value\fP
Level of light of the dark side when there is no Level of light of the dark side when there is no
night map, from 0 to 1. night map, from 0 to 1.
Default: 0.25 Default: 0.25
.TP .TP
.B \-dawn \fI dawn_value\fP .B \-dawn \fI dawn_value\fP
Level of continuity for dawn limit, from 0 to 1. With Level of continuity for dawn limit, from 0 to 1. With
@ -83,9 +83,9 @@ at maximum contrast.
Default: 0.2 Default: 0.2
.TP .TP
.B \-bord \fI border_num\fP .B \-bord \fI border_num\fP
0 1 or 2. There are 3 different borders for the icon. 0 1 or 2. There are 3 different borders for the icon.
Default: 0 Default: 0
.TP .TP
.B \-accel \fI time_multi\fP .B \-accel \fI time_multi\fP
Time warp factor. With -accel 24, the sun make a full Time warp factor. With -accel 24, the sun make a full
rotation in one hour (or the earth, I'm not sure). Default: 1.0 rotation in one hour (or the earth, I'm not sure). Default: 1.0
@ -102,13 +102,13 @@ Move the earth image by dx dy pixels in the icon. See
puzzle.sh to understand why. puzzle.sh to understand why.
.TP .TP
.B \-oz .B \-oz
Start in "austral" mode (for "down under" people) Start in "austral" mode (for "down under" people)
.TP .TP
.B \-d \fI display\fP .B \-d \fI display\fP
Select another display Select another display
.TP .TP
.B \-w \-shape .B \-w \-shape
Useless, since it is set by default (WMaker dockable Useless, since it is set by default (WMaker dockable
application) application)
.SH "MOUSE OPTIONS" .SH "MOUSE OPTIONS"
.TP .TP
@ -124,27 +124,27 @@ Displays 7 screens of parameters. On every screen, just
clic with left or right button on the figures to change clic with left or right button on the figures to change
their value. The TIME screen shows an approximation their value. The TIME screen shows an approximation
of date and time of the earth zone currently displayed, of date and time of the earth zone currently displayed,
using GMT time + longitude offset, it's close to the using GMT time + longitude offset, it's close to the
real local time by one or two hours. Others options real local time by one or two hours. Others options
don't need more help. Intuitive they said... don't need more help. Intuitive they said...
.SH "FILES" .SH "FILES"
.TP .TP
.B MAPS .B MAPS
Like XGlobe, WMGlobe needs a longitude/latitude map to work. By default, Like XGlobe, WMGlobe needs a longitude/latitude map to work. By default,
it uses a low quality built-in map of earth. But you will probably want it uses a low quality built-in map of earth. But you will probably want
to use better ones. to use better ones.
You can get maps usable with WMGlobe on the net. See the links below. You can get maps usable with WMGlobe on the net. See the links below.
using custom maps: using custom maps:
For the image to be mapped correctly, position 0°North 0°West must be in For the image to be mapped correctly, position 0°North 0°West must be in
the center of the image and the latitude must be linear from 90°N to 90°S. the center of the image and the latitude must be linear from 90°N to 90°S.
When using a night map, make sure that day and night map have the same When using a night map, make sure that day and night map have the same
dimensions. dimensions.
.TP .TP
.B Links: Where to find maps and similar softs .B Links: Where to find maps and similar softs
where to find the sources of wmglobe: where to find the sources of wmglobe:
the web page of WMGlobe (made by Sylvestre Taburet): the web page of WMGlobe (made by Sylvestre Taburet):
<http://www.capway.com/dumonte1/wm/wmg.html> <http://www.capway.com/dumonte1/wm/wmg.html>
@ -163,7 +163,7 @@ XGlobe Homepage: (many links to map of earth)
<http://www.uni-karlsruhe.de/~uddn/xglobe> <http://www.uni-karlsruhe.de/~uddn/xglobe>
Xearth Homepage: Xearth Homepage:
<http://www.cs.colorado.edu/~tuna/xearth/> <http://www.cs.colorado.edu/~tuna/xearth/>
@ -181,16 +181,16 @@ The Window Maker User Guide
The Window Maker FAQ The Window Maker FAQ
.SH "AUTHOR" .SH "AUTHOR"
jerome dumonteil <jerome.dumonteil@capway.com> jerome dumonteil <jerome.dumonteil@capway.com>
Patches, bug reports, and suggestions are welcome. Patches, bug reports, and suggestions are welcome.
.SH "CREDITS" .SH "CREDITS"
WMGlobe is Copyright (C) 1998,99 by Jerome Dumonteil and licensed through WMGlobe is Copyright (C) 1998,99 by Jerome Dumonteil and licensed through
the GNU General Public License. the GNU General Public License.
Read the COPYING file for the complete GNU license. Read the COPYING file for the complete GNU license.
Original idea, tests, logos: Original idea, tests, logos:
Sylvestre Taburet <staburet@consort.fr> Sylvestre Taburet <staburet@consort.fr>
@ -224,7 +224,7 @@ documentation.
The rendering engine is taken from XGlobe by Thorsten Scheuermann The rendering engine is taken from XGlobe by Thorsten Scheuermann
XGlobe Homepage: http://www.uni-karlsruhe.de/~uddn/xglobe XGlobe Homepage: http://www.uni-karlsruhe.de/~uddn/xglobe
Raster graphics library by Alfredo K. Kojima, & stuff of Window Maker Raster graphics library by Alfredo K. Kojima, & stuff of Window Maker
<http://windowmaker.org> by A. K. Kojima, Dan Pascu, Matthew Hawkins & team <http://windowmaker.org> by A. K. Kojima, Dan Pascu, Matthew Hawkins & team
@ -234,7 +234,7 @@ If you use the --enable-single-icon compile time option of WindowMaker,
you can not display more than one WMGlobe. you can not display more than one WMGlobe.
WMGlobe hopes that an overflow of a long integer dont generate an error WMGlobe hopes that an overflow of a long integer dont generate an error
and that LONG_MAX +1 = LONG_MIN . This happens with high values of -accel and that LONG_MAX +1 = LONG_MIN . This happens with high values of -accel
when the date go over year 2038. The expected result is wmglobe when the date go over year 2038. The expected result is wmglobe
continuing smoothly from 1901. continuing smoothly from 1901.

View file

@ -1,7 +1,7 @@
------------------------------------------------------------------------- -------------------------------------------------------------------------
You may distribute this program under the terms of the Artistic You may distribute this program under the terms of the Artistic
License. License.
This program is distributed in the hope that it will be useful, but This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Artistic MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Artistic
@ -9,8 +9,8 @@ License for more details.
------------------------------------------------------------------------- -------------------------------------------------------------------------
wmgtemp is a dock app intended for use with WindowMaker. wmgtemp is a dock app intended for use with WindowMaker.
It displays the CPU and SYS temperatures (both in numerically and It displays the CPU and SYS temperatures (both in numerically and
graphically) of motherboards that use the VIA686A chipset. Currently graphically) of motherboards that use the VIA686A chipset. Currently
this is the only chipset that is supported but I have the intention of this is the only chipset that is supported but I have the intention of
adding support for other chipsets in the future. adding support for other chipsets in the future.

View file

@ -6,9 +6,9 @@ o Put proper installation together.
o Add support for more chipsets o Add support for more chipsets
o Add abitily to change graph types by clicking on graph area. - DONE o Add abitily to change graph types by clicking on graph area. - DONE
o Add max reached temps, eg click CPU and temp is displayed in a different o Add max reached temps, eg click CPU and temp is displayed in a different
colour and displays the maximum temp.(possibly draws a horizontal line in colour and displays the maximum temp.(possibly draws a horizontal line in
the graph too to indcate where that lies on current graph) - DONE: the graph too to indcate where that lies on current graph) - DONE:
Simply changes the colour of the temperature value to red. Simply changes the colour of the temperature value to red.
Independant clicking of CPU and SYS temps. Independant clicking of CPU and SYS temps.
o Add ability to exec a program when a given temp is reached. - DONE o Add ability to exec a program when a given temp is reached. - DONE

View file

@ -135,11 +135,11 @@ int main(int argc, char **argv) {
if(!process_config(argc, argv)) { if(!process_config(argc, argv)) {
exit(-1); exit(-1);
} }
if(!init_sensors()) { if(!init_sensors()) {
exit(-1); exit(-1);
} }
/* Get the chip name */ /* Get the chip name */
name = sensors_get_detected_chips(NULL, &chip_nr); name = sensors_get_detected_chips(NULL, &chip_nr);
while(name != NULL && chip_found == -1) { while(name != NULL && chip_found == -1) {
@ -173,7 +173,7 @@ int main(int argc, char **argv) {
/* output the name of the sensor if found. */ /* output the name of the sensor if found. */
if(quiet == 0) if(quiet == 0)
printf("wmgtemp: Primary Sensor - %s on %s\n", name->prefix, sensors_get_adapter_name(&name->bus)); printf("wmgtemp: Primary Sensor - %s on %s\n", name->prefix, sensors_get_adapter_name(&name->bus));
if(swap_types) { if(swap_types) {
if(quiet == 0) if(quiet == 0)
printf("wmgtemp: swapping temps\n"); printf("wmgtemp: swapping temps\n");
@ -205,7 +205,7 @@ int main(int argc, char **argv) {
AddMouseRegion(4, 10, SYS_YPOS, 28, SYS_YPOS + 7); /* SYS label area */ AddMouseRegion(4, 10, SYS_YPOS, 28, SYS_YPOS + 7); /* SYS label area */
AddMouseRegion(5, 55, CPU_YPOS, 60, CPU_YPOS + 7); /* CPU C/K/F scale indicator */ AddMouseRegion(5, 55, CPU_YPOS, 60, CPU_YPOS + 7); /* CPU C/K/F scale indicator */
AddMouseRegion(6, 55, SYS_YPOS, 60, SYS_YPOS + 7); /* SYS C/K/F scale indicator */ AddMouseRegion(6, 55, SYS_YPOS, 60, SYS_YPOS + 7); /* SYS C/K/F scale indicator */
// Add blanking of SYS and CPU for chip type. // Add blanking of SYS and CPU for chip type.
// <<==--- // <<==---
if(!IsOn(SENSOR_DISP, CPU)) { if(!IsOn(SENSOR_DISP, CPU)) {
@ -225,9 +225,9 @@ int main(int argc, char **argv) {
do_sensors(0); do_sensors(0);
RedrawWindow(); RedrawWindow();
process_xevents(); process_xevents();
return 0; return 0;
} }
@ -272,7 +272,7 @@ void process_xevents() {
XEvent Event; XEvent Event;
Status ret; Status ret;
time_t lastupdate = 0; time_t lastupdate = 0;
ret = XInternalConnectionNumbers(display, &xfds, &fdcount); ret = XInternalConnectionNumbers(display, &xfds, &fdcount);
if(!ret) { if(!ret) {
fdcount = 0; fdcount = 0;
@ -281,34 +281,34 @@ void process_xevents() {
} }
xfds = NULL; xfds = NULL;
} }
int i; int i;
pfds = (struct pollfd*)malloc((fdcount+1)*sizeof(struct pollfd)); pfds = (struct pollfd*)malloc((fdcount+1)*sizeof(struct pollfd));
if(!pfds) { if(!pfds) {
perror("malloc"); perror("malloc");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
for(i=0; i < fdcount; ++i) { for(i=0; i < fdcount; ++i) {
pfds[i].fd = xfds[i]; pfds[i].fd = xfds[i];
pfds[i].events = POLLIN | POLLPRI; pfds[i].events = POLLIN | POLLPRI;
} }
if(xfds) { if(xfds) {
XFree(xfds); XFree(xfds);
} }
pfds[fdcount].fd = ConnectionNumber(display); pfds[fdcount].fd = ConnectionNumber(display);
pfds[fdcount].events = POLLIN | POLLPRI; pfds[fdcount].events = POLLIN | POLLPRI;
while(1) { while(1) {
poll(pfds, fdcount + 1, delay * 1000); poll(pfds, fdcount + 1, delay * 1000);
if(time(NULL) - lastupdate >= delay) { if(time(NULL) - lastupdate >= delay) {
lastupdate = time(NULL); lastupdate = time(NULL);
do_sensors(0); do_sensors(0);
} }
while(XPending(display)) { while(XPending(display)) {
XNextEvent(display, &Event); XNextEvent(display, &Event);
switch(Event.type) { switch(Event.type) {
@ -338,7 +338,7 @@ void process_xevents() {
if(IsOn(SENSOR_DISP, HIGH_CPU)) { if(IsOn(SENSOR_DISP, HIGH_CPU)) {
BitOff(SENSOR_DISP, HIGH_CPU); BitOff(SENSOR_DISP, HIGH_CPU);
blank_max(CPU); blank_max(CPU);
} }
else { else {
BitOn(SENSOR_DISP, HIGH_CPU); BitOn(SENSOR_DISP, HIGH_CPU);
draw_max(CPU); draw_max(CPU);
@ -350,7 +350,7 @@ void process_xevents() {
if(IsOn(SENSOR_DISP, HIGH_SYS)) { if(IsOn(SENSOR_DISP, HIGH_SYS)) {
BitOff(SENSOR_DISP, HIGH_SYS); BitOff(SENSOR_DISP, HIGH_SYS);
blank_max(SYS); blank_max(SYS);
} }
else { else {
BitOn(SENSOR_DISP, HIGH_SYS); BitOn(SENSOR_DISP, HIGH_SYS);
draw_max(SYS); draw_max(SYS);
@ -361,7 +361,7 @@ void process_xevents() {
case 3: case 3:
if(SUBFEAT_NUM_CPU) { if(SUBFEAT_NUM_CPU) {
if(IsOn(SENSOR_DISP, CPU)) { if(IsOn(SENSOR_DISP, CPU)) {
BitOff(SENSOR_DISP, CPU); BitOff(SENSOR_DISP, CPU);
blank_type(CPU); blank_type(CPU);
} }
else { else {
@ -378,7 +378,7 @@ void process_xevents() {
if(IsOn(SENSOR_DISP, SYS)) { if(IsOn(SENSOR_DISP, SYS)) {
BitOff(SENSOR_DISP, SYS); BitOff(SENSOR_DISP, SYS);
blank_type(SYS); blank_type(SYS);
} }
else { else {
BitOn(SENSOR_DISP, SYS); BitOn(SENSOR_DISP, SYS);
draw_type(SYS); draw_type(SYS);
@ -407,7 +407,7 @@ void do_sensors(int val) {
update_sensor_data(); update_sensor_data();
update_display(); update_display();
RedrawWindow(); RedrawWindow();
if(execat != 0 && cpu_history[58] >= execat && !execed) { if(execat != 0 && cpu_history[58] >= execat && !execed) {
execed = 1; execed = 1;
execCommand(exec_app); execCommand(exec_app);
@ -428,7 +428,7 @@ void update_sensor_data() {
cpu_history[i] = cpu_history[i + 1]; cpu_history[i] = cpu_history[i + 1];
sys_history[i] = sys_history[i + 1]; sys_history[i] = sys_history[i + 1];
} }
// Read the new values from the sensors into the temperature arrays. // Read the new values from the sensors into the temperature arrays.
if(IsOn(SENSOR_DISP, SYS)) sensors_get_value(name, SUBFEAT_NUM_SYS, &sys_history[58]); if(IsOn(SENSOR_DISP, SYS)) sensors_get_value(name, SUBFEAT_NUM_SYS, &sys_history[58]);
if(IsOn(SENSOR_DISP, CPU)) sensors_get_value(name, SUBFEAT_NUM_CPU, &cpu_history[58]); if(IsOn(SENSOR_DISP, CPU)) sensors_get_value(name, SUBFEAT_NUM_CPU, &cpu_history[58]);
@ -451,7 +451,7 @@ void update_display() {
// Display warning. // Display warning.
draw_warning_lights(cpu_history[58]); draw_warning_lights(cpu_history[58]);
// ReDraw temperature numbers // ReDraw temperature numbers
if(IsOn(SENSOR_DISP, CPU)) { if(IsOn(SENSOR_DISP, CPU)) {
copyXPMArea(78, 65, 5, 7, 34, CPU_YPOS); copyXPMArea(78, 65, 5, 7, 34, CPU_YPOS);
@ -471,7 +471,7 @@ void update_display() {
for(j = 0; j < 59; j++) { for(j = 0; j < 59; j++) {
// Clear a line // Clear a line
copyXPMArea(65, 0, 1, 39, j + 2, 12); copyXPMArea(65, 0, 1, 39, j + 2, 12);
if(sys_history[j] < cpu_history[j]) { if(sys_history[j] < cpu_history[j]) {
// Draw the temperatures on the graph. // Draw the temperatures on the graph.
if(IsOn(SENSOR_DISP, CPU)) { if(IsOn(SENSOR_DISP, CPU)) {
@ -490,7 +490,7 @@ void update_display() {
} }
} }
} }
// Draw range lines if needed // Draw range lines if needed
if(range_upper > display_max) { if(range_upper > display_max) {
draw_range_line(display_max, range_upper - range_lower, D_MAX); draw_range_line(display_max, range_upper - range_lower, D_MAX);
@ -503,65 +503,65 @@ void update_display() {
int recompute_range(double cpu_high, double cpu_low, double sys_high, double sys_low) int recompute_range(double cpu_high, double cpu_low, double sys_high, double sys_low)
{ {
short modified = 0; short modified = 0;
if(IsOn(SENSOR_DISP, CPU)) { if(IsOn(SENSOR_DISP, CPU)) {
if(cpu_high > range_upper) { if(cpu_high > range_upper) {
range_upper += range_step; range_upper += range_step;
modified = 1; modified = 1;
} }
if(cpu_low < range_lower) { if(cpu_low < range_lower) {
range_lower -= range_step; range_lower -= range_step;
modified = 1; modified = 1;
} }
} }
if(IsOn(SENSOR_DISP, SYS)) { if(IsOn(SENSOR_DISP, SYS)) {
if(sys_high > range_upper) { if(sys_high > range_upper) {
range_upper += range_step; range_upper += range_step;
modified = 1; modified = 1;
} }
if(sys_low < range_lower) { if(sys_low < range_lower) {
range_lower -= range_step; range_lower -= range_step;
modified = 1; modified = 1;
} }
} }
// -------- // --------
if(IsOn(SENSOR_DISP, CPU) && IsOn(SENSOR_DISP, SYS)) { if(IsOn(SENSOR_DISP, CPU) && IsOn(SENSOR_DISP, SYS)) {
if((cpu_high < (range_upper - range_step) && if((cpu_high < (range_upper - range_step) &&
sys_high < (range_upper - range_step)) && sys_high < (range_upper - range_step)) &&
(range_upper - range_step) >= display_max) { (range_upper - range_step) >= display_max) {
range_upper -= range_step; range_upper -= range_step;
modified = 1; modified = 1;
} }
if((cpu_low > (range_lower + range_step) && if((cpu_low > (range_lower + range_step) &&
sys_low > (range_lower + range_step)) && sys_low > (range_lower + range_step)) &&
(range_lower + range_step) <= display_min ) { (range_lower + range_step) <= display_min ) {
range_lower += range_step; range_lower += range_step;
modified = 1; modified = 1;
} }
} }
else if(IsOn(SENSOR_DISP, CPU) && !IsOn(SENSOR_DISP, SYS)) { else if(IsOn(SENSOR_DISP, CPU) && !IsOn(SENSOR_DISP, SYS)) {
if(cpu_high < (range_upper - range_step) && if(cpu_high < (range_upper - range_step) &&
(range_upper - range_step) >= display_max) { (range_upper - range_step) >= display_max) {
range_upper -= range_step; range_upper -= range_step;
modified = 1; modified = 1;
} }
if(cpu_low > (range_lower + range_step) && if(cpu_low > (range_lower + range_step) &&
(range_lower + range_step) <= display_min) { (range_lower + range_step) <= display_min) {
range_lower += range_step; range_lower += range_step;
modified = 1; modified = 1;
} }
} }
else if(!IsOn(SENSOR_DISP, CPU) && IsOn(SENSOR_DISP, SYS)) { else if(!IsOn(SENSOR_DISP, CPU) && IsOn(SENSOR_DISP, SYS)) {
if(sys_high < (range_upper - range_step) && if(sys_high < (range_upper - range_step) &&
(range_upper - range_step) >= display_max) { (range_upper - range_step) >= display_max) {
range_upper -= range_step; range_upper -= range_step;
modified = 1; modified = 1;
} }
if(sys_low > (range_lower + range_step) && if(sys_low > (range_lower + range_step) &&
(range_lower + range_step) <= display_min) { (range_lower + range_step) <= display_min) {
range_lower += range_step; range_lower += range_step;
modified = 1; modified = 1;
} }
} }
@ -630,7 +630,7 @@ void draw_temp(short value, int type) {
copyXPMArea((digit * 6) + 1, 65, 5, 7, 34, type == CPU ? CPU_YPOS : SYS_YPOS); copyXPMArea((digit * 6) + 1, 65, 5, 7, 34, type == CPU ? CPU_YPOS : SYS_YPOS);
} }
} }
} }
} }
@ -852,7 +852,7 @@ int process_config(int argc, char **argv) {
{ "sensorconf", &rc_config }, { "sensorconf", &rc_config },
{ NULL, NULL } { NULL, NULL }
}; };
static struct option long_options[] = { static struct option long_options[] = {
{"graph", required_argument, 0, 'g'}, {"graph", required_argument, 0, 'g'},
{"scale", required_argument, 0, 's'}, {"scale", required_argument, 0, 's'},
@ -872,7 +872,7 @@ int process_config(int argc, char **argv) {
{"help", no_argument, 0, 'h'}, {"help", no_argument, 0, 'h'},
{0, 0, 0, 0} {0, 0, 0, 0}
}; };
p = getenv("HOME"); p = getenv("HOME");
strcpy(temp, p); strcpy(temp, p);
strcat(temp, "/.wmgtemprc"); strcat(temp, "/.wmgtemprc");

View file

@ -24,7 +24,7 @@ How I install it?
License? License?
======== ========
wmomikuzi is based on libdock and other GPL'ed software. wmomikuzi is based on libdock and other GPL'ed software.
This program is distributed under the GPL license. This program is distributed under the GPL license.
@ -62,7 +62,7 @@ How do I read the messages?
@ @
@@@@@@@@@ SUE afterwards @@@@@@@@@ SUE afterwards
@ @
@@@@@@@ @@@@@@@
@@@ @@@
@ @ @ @ @ @
@ -71,7 +71,7 @@ How do I read the messages?
@ @
@@@@@@@ KICHI good luck @@@@@@@ KICHI good luck
@ @
@@@@@ @@@@@
@@@@@ @@@@@

View file

@ -91,9 +91,9 @@ main(int argc, char **argv)
sizeof(options)/sizeof(DAProgramOption), sizeof(options)/sizeof(DAProgramOption),
"dockapp that predict your luck", "wmomikuzi 0.122"); "dockapp that predict your luck", "wmomikuzi 0.122");
DAInitialize(displayName, "wmomikuzi", 64, 64, argc, argv); DAInitialize(displayName, "wmomikuzi", 64, 64, argc, argv);
pixmap = DAMakePixmap(); pixmap = DAMakePixmap();
/* making pixmaps for the panel */ /* making pixmaps for the panel */
DAMakePixmapFromData(back_xpm, &back_pixmap, &back_mask, &w, &h); DAMakePixmapFromData(back_xpm, &back_pixmap, &back_mask, &w, &h);
DAMakePixmapFromData(button_pressed_xpm, &button_pressed_pixmap, NULL, &w, &h); DAMakePixmapFromData(button_pressed_xpm, &button_pressed_pixmap, NULL, &w, &h);
@ -118,7 +118,7 @@ main(int argc, char **argv)
srand(time(0L) * (getpid())); srand(time(0L) * (getpid()));
i = 0; i = 0;
j = rand() / (RAND_MAX / 6 + 1) + 18; j = rand() / (RAND_MAX / 6 + 1) + 18;
/* draws the button part */ /* draws the button part */
XCopyArea(DADisplay, back_pixmap, pixmap, gc, 0, 44, 64, 64, 0, 44); XCopyArea(DADisplay, back_pixmap, pixmap, gc, 0, 44, 64, 64, 0, 44);
@ -142,7 +142,7 @@ main(int argc, char **argv)
XCopyArea(DADisplay, daikyou_pixmap, pixmap, gc, 0, 0, 64, 39, 5, 5); XCopyArea(DADisplay, daikyou_pixmap, pixmap, gc, 0, 0, 64, 39, 5, 5);
} }
DASetPixmap(pixmap); DASetPixmap(pixmap);
usleep(USLEEP); usleep(USLEEP);
/* j is the destination number */ /* j is the destination number */

View file

@ -2,7 +2,7 @@
Time-stamp: <00/05/15 23:33:49 friedel> Time-stamp: <00/05/15 23:33:49 friedel>
(Note: don't get confused, the dates in this file are in german-locale (de_DE), (Note: don't get confused, the dates in this file are in german-locale (de_DE),
because i was too lazy to use something else than because i was too lazy to use something else than
ctrl-u meta-! date... but the timestamp is in C locale...) ctrl-u meta-! date... but the timestamp is in C locale...)
0.6.1: <Mon Mai 15 23:15:29 CEST 2000> 0.6.1: <Mon Mai 15 23:15:29 CEST 2000>

View file

@ -45,13 +45,13 @@ INSTALLATION:
and in case you want to delete the Sourcetree, you might want to copy the and in case you want to delete the Sourcetree, you might want to copy the
README to /usr/doc/wmswallow README to /usr/doc/wmswallow
Now try Now try
wmswallow -h wmswallow -h
to get a basic idea how it works. to get a basic idea how it works.
USE: USE:
++++ ++++
Then some things you might try out are: Then some things you might try out are:
(i.e. lots of) (i.e. lots of)
EXAMPLES: EXAMPLES:
========= =========
@ -93,7 +93,7 @@ USE:
little annoying, so wmload is a better choice) little annoying, so wmload is a better choice)
------- wmswallow -focus XTerm ------- wmswallow -focus XTerm
(Weeelll... (Weeelll...
1. wmswallow can swallow apps without starting them 1. wmswallow can swallow apps without starting them
2. it takes the first it gets 2. it takes the first it gets
3. swallowed apps can take keyboard focus now! (Is that useful? I doubt 3. swallowed apps can take keyboard focus now! (Is that useful? I doubt

View file

@ -58,7 +58,7 @@ TODO:
click works only on the surface of the swallowed window: click works only on the surface of the swallowed window:
(Obviously, because the rest of the area belongs to the (Obviously, because the rest of the area belongs to the
dock... Or can that be redeemed?) dock... Or can that be redeemed?)
=============================================================================== ===============================================================================
@ -79,7 +79,7 @@ DONE:
Somehow handle shaped windows (Like xeyes) Somehow handle shaped windows (Like xeyes)
-> Ok, even resizing works -> Ok, even resizing works
Option: -updateshape (or similar) for apps that change their shape Option: -updateshape (or similar) for apps that change their shape
(like oclock -transparent) (like oclock -transparent)
-> is done by default behaviour! :-) -> is done by default behaviour! :-)
@ -89,8 +89,8 @@ DONE:
Better command-line switch handling. Following commandline-switches: Better command-line switch handling. Following commandline-switches:
-noshape/-shape : Switch shape functionality on or off -noshape/-shape : Switch shape functionality on or off
-getclick: Define commandline to exec when window is clicked -getclick: Define commandline to exec when window is clicked
-geometry: Define geometry of swallowed application! -geometry: Define geometry of swallowed application!
(Size is useful, position as well, to adjust asclock) (Size is useful, position as well, to adjust asclock)
-id: Give Window-id to swallow -id: Give Window-id to swallow
@ -103,7 +103,7 @@ DONE:
2 lines...) :-) 2 lines...) :-)
The currently focused window flickers, when the shape gets updated. The currently focused window flickers, when the shape gets updated.
This is especially strong with This is especially strong with
wmswallow xdaliclock xdaliclock -24 -transparent -cycle \ wmswallow xdaliclock xdaliclock -24 -transparent -cycle \
-geometry 61x61 -fn fixed -oink-oink -geometry 61x61 -fn fixed -oink-oink
This also interferes with focus, and it can be seen that the shape This also interferes with focus, and it can be seen that the shape

View file

@ -1,7 +1,7 @@
/* wmswallow.c */ /* wmswallow.c */
/* #define DEBUG 1 */ /* #define DEBUG 1 */
/* Sometimes i want to get quick access to this flag :-)*/ /* Sometimes i want to get quick access to this flag :-)*/
/* Time-stamp: <00/05/15 23:13:43 friedel> */ /* Time-stamp: <00/05/15 23:13:43 friedel> */
@ -38,7 +38,7 @@ typedef unsigned long Pixel; /* Index into colormap */
/* Now we got rid of that stupid libXpm dependency :-) */ /* Now we got rid of that stupid libXpm dependency :-) */
#define WIDTH 55 #define WIDTH 55
#define HEIGHT 57 #define HEIGHT 57
/* 55x57 seems to be the default size for a WindowMaker dockapp */ /* 55x57 seems to be the default size for a WindowMaker dockapp */
/* settable by "-geometry" switch */ /* settable by "-geometry" switch */
@ -83,7 +83,7 @@ int shape=TRUE;
int focus=FALSE; int focus=FALSE;
int unmanaged=FALSE; int unmanaged=FALSE;
int winid=0; int winid=0;
char *display_name=NULL; char *display_name=NULL;
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
@ -110,11 +110,11 @@ int main(int argc,char *argv[])
fflush(stderr); fflush(stderr);
#endif #endif
if (!(dpy = XOpenDisplay(display_name))) { if (!(dpy = XOpenDisplay(display_name))) {
fprintf(stderr,"wmswallow: can't open display %s\n", fprintf(stderr,"wmswallow: can't open display %s\n",
XDisplayName(display_name)); XDisplayName(display_name));
exit (1); exit (1);
} }
screen=DefaultScreen(dpy); screen=DefaultScreen(dpy);
Root=RootWindow(dpy, screen); Root=RootWindow(dpy, screen);
@ -122,7 +122,7 @@ int main(int argc,char *argv[])
if (remainargc>1) { if (remainargc>1) {
winid=startandfind(remainargc-1, argv+remainarg+1, argv[remainarg]); winid=startandfind(remainargc-1, argv+remainarg+1, argv[remainarg]);
if (winid==0) { if (winid==0) {
perror("wmswallow: startandfind failed"); perror("wmswallow: startandfind failed");
/* Real error handling in execstuff()*/ /* Real error handling in execstuff()*/
exit (1); exit (1);
} }
@ -137,7 +137,7 @@ int main(int argc,char *argv[])
fore_pix=GetColor("black"); fore_pix=GetColor("black");
XWMGeometry(dpy, screen, geometry, NULL, (borderwidth =1), XWMGeometry(dpy, screen, geometry, NULL, (borderwidth =1),
&mysizehints, &mysizehints.x, &mysizehints.y, &mysizehints, &mysizehints.x, &mysizehints.y,
&mysizehints.width, &mysizehints.height, &i); &mysizehints.width, &mysizehints.height, &i);
mysizehints.width=WIDTH; mysizehints.width=WIDTH;
mysizehints.height=HEIGHT; mysizehints.height=HEIGHT;
if (geometry!=NULL) { if (geometry!=NULL) {
@ -145,10 +145,10 @@ int main(int argc,char *argv[])
fprintf(stderr,"Setting geometry to: %s\n",geometry); fprintf(stderr,"Setting geometry to: %s\n",geometry);
fflush(stderr); fflush(stderr);
#endif #endif
XParseGeometry(geometry, &mysizehints.x, &mysizehints.y, XParseGeometry(geometry, &mysizehints.x, &mysizehints.y,
&mysizehints.width, &mysizehints.height); &mysizehints.width, &mysizehints.height);
} }
win=XCreateSimpleWindow(dpy, Root, mysizehints.x, mysizehints.y, win=XCreateSimpleWindow(dpy, Root, mysizehints.x, mysizehints.y,
mysizehints.width, mysizehints.height, borderwidth, mysizehints.width, mysizehints.height, borderwidth,
fore_pix, back_pix); fore_pix, back_pix);
@ -174,21 +174,21 @@ int main(int argc,char *argv[])
mywmhints.window_group = win; mywmhints.window_group = win;
mywmhints.flags = StateHint | IconWindowHint | mywmhints.flags = StateHint | IconWindowHint |
IconPositionHint | WindowGroupHint; IconPositionHint | WindowGroupHint;
XSetWMHints(dpy, win, &mywmhints); XSetWMHints(dpy, win, &mywmhints);
XSetCommand(dpy, win, argv, argc); XSetCommand(dpy, win, argv, argc);
if (winid==0) { if (winid==0) {
swallowed=findnamedwindow(argv[remainarg]); /* Find which window to swallowed=findnamedwindow(argv[remainarg]); /* Find which window to
swallow*/ swallow*/
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr,"%s has Window-id 0x%lx\n", argv[remainarg], swallowed); fprintf(stderr,"%s has Window-id 0x%lx\n", argv[remainarg], swallowed);
fflush(stderr); fflush(stderr);
#endif #endif
} }
else else
swallowed=winid; swallowed=winid;
/* "Swallow" it */ /* "Swallow" it */
XReparentWindow(dpy, swallowed, iconwin, 0, 0); XReparentWindow(dpy, swallowed, iconwin, 0, 0);
if (getclick) { if (getclick) {
@ -246,7 +246,7 @@ int main(int argc,char *argv[])
FlushWindow(); FlushWindow();
XMapRaised(dpy,swallowed); XMapRaised(dpy,swallowed);
/* the following Produces "focus-flicker" */ /* the following Produces "focus-flicker" */
/* XMapSubwindows(dpy,win); */ /* XMapSubwindows(dpy,win); */
/* XMapWindow(dpy,win); */ /* XMapWindow(dpy,win); */
} }
break; break;
@ -263,13 +263,13 @@ int main(int argc,char *argv[])
case DestroyNotify: case DestroyNotify:
XCloseDisplay(dpy); XCloseDisplay(dpy);
exit(0); exit(0);
default: default:
#ifdef DEBUG #ifdef DEBUG
/* fprintf (stderr, "wmswallow: Got Some Other Event\n"); /* fprintf (stderr, "wmswallow: Got Some Other Event\n");
fflush(stderr); */ fflush(stderr); */
#endif #endif
break; break;
} }
} }
XFlush(dpy); XFlush(dpy);
@ -284,7 +284,7 @@ int main(int argc,char *argv[])
/* attributes.override_redirect=FALSE; */ /* attributes.override_redirect=FALSE; */
/* attributes.event_mask=SW_EVENTS|MW_EVENTS; */ /* attributes.event_mask=SW_EVENTS|MW_EVENTS; */
/* attributes.do_not_propagate_mask=0; */ /* attributes.do_not_propagate_mask=0; */
/* XChangeWindowAttributes(dpy, w, */ /* XChangeWindowAttributes(dpy, w, */
/* CWOverrideRedirect|CWEventMask|CWDontPropagate, */ /* CWOverrideRedirect|CWEventMask|CWDontPropagate, */
/* &attributes); */ /* &attributes); */
@ -316,11 +316,11 @@ int sendexpose (Window w) {
} }
void stealshape(Window w) { void stealshape(Window w) {
XShapeCombineShape (dpy, iconwin, ShapeBounding, 0, 0, w, XShapeCombineShape (dpy, iconwin, ShapeBounding, 0, 0, w,
ShapeBounding, ShapeSet); ShapeBounding, ShapeSet);
/* XShapeCombineShape (dpy, win, ShapeBounding, 0, 0, w, */ /* XShapeCombineShape (dpy, win, ShapeBounding, 0, 0, w, */
/* ShapeBounding, ShapeSet); */ /* ShapeBounding, ShapeSet); */
/*Re-read specs! */ /*Re-read specs! */
/* XShapeCombineShape (dpy, win, ShapeClip, 0, 0, w, */ /* XShapeCombineShape (dpy, win, ShapeClip, 0, 0, w, */
/* ShapeClip, ShapeSet); */ /* ShapeClip, ShapeSet); */
/* XShapeCombineShape (dpy, iconwin, ShapeClip, 0, 0, w, */ /* XShapeCombineShape (dpy, iconwin, ShapeClip, 0, 0, w, */
@ -355,9 +355,9 @@ Pixel GetColor(char *name)
XWindowAttributes attributes; XWindowAttributes attributes;
XGetWindowAttributes(dpy,Root,&attributes); XGetWindowAttributes(dpy,Root,&attributes);
color.pixel=0; color.pixel=0;
if (!XParseColor(dpy,attributes.colormap,name,&color)) if (!XParseColor(dpy,attributes.colormap,name,&color))
nocolor("parse",name); nocolor("parse",name);
else if(!XAllocColor (dpy,attributes.colormap,&color)) else if(!XAllocColor (dpy,attributes.colormap,&color))
nocolor("alloc",name); nocolor("alloc",name);
return color.pixel; return color.pixel;
} }
@ -382,9 +382,9 @@ void usage(char *progname){
" -focus: Window should take focus\n" " -focus: Window should take focus\n"
" -nofocus: Window shouldn't take focus(default)\n" " -nofocus: Window shouldn't take focus(default)\n"
" -managed: Assume window is managed by the\n" " -managed: Assume window is managed by the\n"
" windowmanager (default)\n" " windowmanager (default)\n"
" -unmanaged: Assume window is not managed by the\n" " -unmanaged: Assume window is not managed by the\n"
" windowmanager\n" " windowmanager\n"
" -getclick <string>: on mouseclick, execute <string>\n" " -getclick <string>: on mouseclick, execute <string>\n"
" instead of passing the Event to the\n" " instead of passing the Event to the\n"
" swallowed window.\n" " swallowed window.\n"
@ -407,7 +407,7 @@ int parseargs(int argc, char *argv[]){
!strncmp(argv[argnum],"--",2)) { !strncmp(argv[argnum],"--",2)) {
usage(argv[0]); usage(argv[0]);
exit(0); exit(0);
} else if (!strcmp(argv[argnum],"-geometry")|| } else if (!strcmp(argv[argnum],"-geometry")||
!strcmp(argv[argnum],"-geom")) !strcmp(argv[argnum],"-geom"))
geometry=argv[++argnum]; geometry=argv[++argnum];
else if (!strcmp(argv[argnum],"-display")) else if (!strcmp(argv[argnum],"-display"))
@ -524,13 +524,13 @@ Window startandfind (int argc, char *oldargv[], char* class) {
"0x%lx\n", wintmp); "0x%lx\n", wintmp);
fflush(stderr); fflush(stderr);
#endif #endif
waitformap(winreturn); waitformap(winreturn);
/* Ok, the window has been created, Reparented by WindowMaker and mapped */ /* Ok, the window has been created, Reparented by WindowMaker and mapped */
/* What else can we do to make sure the window was created? */ /* What else can we do to make sure the window was created? */
sleep(1); /* doze just a sec, should be more than enough in any case */ sleep(1); /* doze just a sec, should be more than enough in any case */
return winreturn; return winreturn;
} }
@ -540,12 +540,12 @@ int execstuff (int argc, char *oldargv[]) {
int i, success, forked; int i, success, forked;
argv=(char **)malloc((argc+1)*sizeof(char *)); argv=(char **)malloc((argc+1)*sizeof(char *));
for (i=0; i<argc; i++) { for (i=0; i<argc; i++) {
argv[i]=oldargv[i]; argv[i]=oldargv[i];
} }
argv[i]=NULL; argv[i]=NULL;
forked=fork(); forked=fork();
if (forked==-1) { if (forked==-1) {
perror("Could not fork"); perror("Could not fork");
@ -561,7 +561,7 @@ int execstuff (int argc, char *oldargv[]) {
printlist(stderr, "Could not execute:", argv); printlist(stderr, "Could not execute:", argv);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
exit(1); exit(1);
} }
} /* Removed the sleep, since it keeps us from getting the Create Event */ } /* Removed the sleep, since it keeps us from getting the Create Event */
free(argv); free(argv);
return(TRUE); return(TRUE);
@ -617,7 +617,7 @@ Window findnamedwindowacc (char *class, Window window) {
if (checkwindow(window, class)) if (checkwindow(window, class))
return window; return window;
if (XQueryTree (dpy, window, &root_return, &parent_return, if (XQueryTree (dpy, window, &root_return, &parent_return,
&children_return, &nchildren_return)&&nchildren_return>0) { &children_return, &nchildren_return)&&nchildren_return>0) {
for for
@ -638,9 +638,9 @@ Window findnamedwindowacc (char *class, Window window) {
int checkwindow (Window window, char *class) { int checkwindow (Window window, char *class) {
XClassHint class_hints; XClassHint class_hints;
XTextProperty prop; XTextProperty prop;
int found=0; int found=0;
class_hints.res_name = class_hints.res_class = prop.value =(char *) NULL; class_hints.res_name = class_hints.res_class = prop.value =(char *) NULL;
/* Check WM_CLASS properties name and class */ /* Check WM_CLASS properties name and class */
@ -666,7 +666,7 @@ int checkwindow (Window window, char *class) {
prop.value); prop.value);
fflush(stderr); fflush(stderr);
#endif #endif
/* Clean up */ /* Clean up */
if (prop.value) if (prop.value)
XFree(prop.value); XFree(prop.value);

View file

@ -18,17 +18,17 @@ BuildRoot: /var/tmp/%{name}-root
#Patch: %{name}-%{ver}.patch #Patch: %{name}-%{ver}.patch
%description %description
- wmswallow was mainly created to swallow coolmail in the WindowMaker dock, but it can - wmswallow was mainly created to swallow coolmail in the WindowMaker dock, but it can
swallow about any X-window you conceive. swallow about any X-window you conceive.
- The window may receive mouseclicks, - The window may receive mouseclicks,
- for windows that do not get mouseclicks (like xload or xeyes), you can specify a - for windows that do not get mouseclicks (like xload or xeyes), you can specify a
shell-command to execute on a click. shell-command to execute on a click.
- The geometry for the swallowed app can be specified. Only HEIGHTxWIDTH are used, - The geometry for the swallowed app can be specified. Only HEIGHTxWIDTH are used,
however. however.
- Applications can be started on wmswallows commandline. An already running window - Applications can be started on wmswallows commandline. An already running window
can be swallowed, either by name, class or directly by window-id can be swallowed, either by name, class or directly by window-id
- The window may receive keyboard-focus, if you specify the "-focus" switch. - The window may receive keyboard-focus, if you specify the "-focus" switch.
- Even windows (like xteddy or wine) that hide from the windowmanager can be - Even windows (like xteddy or wine) that hide from the windowmanager can be
swallowed with the -unmanaged switch swallowed with the -unmanaged switch
%changelog %changelog
%prep %prep

View file

@ -16,7 +16,7 @@ property".
WMTETRIS IS PROVIDED "AS IS", AND COMES WITH NO WARRANTY WHATSOEVER, WMTETRIS IS PROVIDED "AS IS", AND COMES WITH NO WARRANTY WHATSOEVER,
INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTEES OF NOT MAKING YOU INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTEES OF NOT MAKING YOU
FEEL LIKE A JERK FOR DOWNLOADING CRAPPY SOFTWARE, AND OF NOT CAUSING A FEEL LIKE A JERK FOR DOWNLOADING CRAPPY SOFTWARE, AND OF NOT CAUSING A
CULT FOLLOWING TO DEVELOP ;-). CULT FOLLOWING TO DEVELOP ;-).
Comments, questions, and psychiatric referrals to srs25@cornell.edu. Comments, questions, and psychiatric referrals to srs25@cornell.edu.

View file

@ -221,7 +221,7 @@ int main(int argc, char *argv[]) {
int which_button(int x, int y) { int which_button(int x, int y) {
int i; int i;
for (i = BUTTONC - 1; i >= 0; i--) { for (i = BUTTONC - 1; i >= 0; i--) {
if ((buttons[i][0] <= x && x < buttons[i][2]) && if ((buttons[i][0] <= x && x < buttons[i][2]) &&
(buttons[i][1] <= y && y < buttons[i][3])) (buttons[i][1] <= y && y < buttons[i][3]))
@ -282,8 +282,8 @@ void full_refresh() {
copyXPMArea(0, 64 + BLOCK_SIZE * (board[x][y] - 1), BLOCK_SIZE, BLOCK_SIZE, copyXPMArea(0, 64 + BLOCK_SIZE * (board[x][y] - 1), BLOCK_SIZE, BLOCK_SIZE,
BOARD_POS_X + BLOCK_SIZE * x, BOARD_POS_Y + BLOCK_SIZE * y); BOARD_POS_X + BLOCK_SIZE * x, BOARD_POS_Y + BLOCK_SIZE * y);
else else
copyXPMArea(64 + BOARD_POS_X + BLOCK_SIZE * x, BOARD_POS_Y + BLOCK_SIZE * y, copyXPMArea(64 + BOARD_POS_X + BLOCK_SIZE * x, BOARD_POS_Y + BLOCK_SIZE * y,
BLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE,
BOARD_POS_X + BLOCK_SIZE * x, BOARD_POS_Y + BLOCK_SIZE * y); BOARD_POS_X + BLOCK_SIZE * x, BOARD_POS_Y + BLOCK_SIZE * y);
} }

View file

@ -208,7 +208,7 @@ config.h: stamp-h1
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1 @rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: $(am__configure_deps) $(srcdir)/config.h.in: $(am__configure_deps)
cd $(top_srcdir) && $(AUTOHEADER) cd $(top_srcdir) && $(AUTOHEADER)
rm -f stamp-h1 rm -f stamp-h1
touch $@ touch $@

View file

@ -195,7 +195,7 @@ uninstall-binPROGRAMS:
clean-binPROGRAMS: clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
wmThemeCh$(EXEEXT): $(wmThemeCh_OBJECTS) $(wmThemeCh_DEPENDENCIES) wmThemeCh$(EXEEXT): $(wmThemeCh_OBJECTS) $(wmThemeCh_DEPENDENCIES)
@rm -f wmThemeCh$(EXEEXT) @rm -f wmThemeCh$(EXEEXT)
$(LINK) $(wmThemeCh_LDFLAGS) $(wmThemeCh_OBJECTS) $(wmThemeCh_LDADD) $(LIBS) $(LINK) $(wmThemeCh_LDFLAGS) $(wmThemeCh_OBJECTS) $(wmThemeCh_LDADD) $(LIBS)

View file

@ -21,7 +21,7 @@ create_list ()
list->item = malloc (BASE_SIZE * sizeof (int) ); list->item = malloc (BASE_SIZE * sizeof (int) );
list->size = BASE_SIZE; list->size = BASE_SIZE;
list->used = 0; list->used = 0;
return list; return list;
} }

View file

@ -22,8 +22,8 @@
/* /*
* Delay between refreshes (in microseconds) * Delay between refreshes (in microseconds)
*/ */
#define DELAY 10000L #define DELAY 10000L
@ -311,7 +311,7 @@ theme_specific_cat (char * path, LIST * cat_list)
} }
/* Read "categories" file in path. /* Read "categories" file in path.
* Themes in path and its subdirs are belonging to categories listed * Themes in path and its subdirs are belonging to categories listed
* in that file if these categories are defined by user profile. * in that file if these categories are defined by user profile.
* Updates cat_list accordingly. * Updates cat_list accordingly.
*/ */
@ -487,7 +487,7 @@ BuildDatabase ()
for (dir_idx=0; dir_idx < 4; dir_idx++) { for (dir_idx=0; dir_idx < 4; dir_idx++) {
get_themes ( themes_dir[dir_idx], NULL); get_themes ( themes_dir[dir_idx], NULL);
get_wallpapers (wallpapers_dir[dir_idx], NULL); get_wallpapers (wallpapers_dir[dir_idx], NULL);
} }
return 0; return 0;
@ -546,11 +546,11 @@ DrawPixmap (char * XpmFileName)
copyXPMArea(4, 4, 56, 56, 4, 4); /* Clear window */ copyXPMArea(4, 4, 56, 56, 4, 4); /* Clear window */
if (havePixmap) { if (havePixmap) {
/* /*
* free up the colors, if we alloc'd some before * free up the colors, if we alloc'd some before
*/ */
if (Attributes.nalloc_pixels > 0) if (Attributes.nalloc_pixels > 0)
XFreeColors(display, cmap, Attributes.alloc_pixels, XFreeColors(display, cmap, Attributes.alloc_pixels,
Attributes.nalloc_pixels, 0); Attributes.nalloc_pixels, 0);
/* /*
* Free last pixmap -- we dont need it anymore... * Free last pixmap -- we dont need it anymore...
@ -653,7 +653,7 @@ ChangeTheme ()
case 1 : val = 0; break; case 1 : val = 0; break;
default : default :
fd = open ("/dev/random", O_RDONLY); fd = open ("/dev/random", O_RDONLY);
/* We're disallowing "changing" to the same */ /* We're disallowing "changing" to the same */
read (fd, &val, sizeof (int) ); read (fd, &val, sizeof (int) );
val = val % (i - 1); val = val % (i - 1);
@ -664,7 +664,7 @@ ChangeTheme ()
} }
switch ( ( (struct theme *) get_item (cur_cat->themes, val) ) -> type) { switch ( ( (struct theme *) get_item (cur_cat->themes, val) ) -> type) {
case THEME : case THEME :
sprintf (Command, "setstyle \"%s\"", ( (struct theme *) sprintf (Command, "setstyle \"%s\"", ( (struct theme *)
get_item (cur_cat->themes, val) ) -> path); get_item (cur_cat->themes, val) ) -> path);
break; break;
@ -805,7 +805,7 @@ main (int argc, char *argv[])
} }
/* TODO : use sigsuspend */ /* TODO : use sigsuspend */
while (1) { while (1) {
ProcessXEvents (); ProcessXEvents ();
delay_timer += DELAY; delay_timer += DELAY;

View file

@ -123,7 +123,7 @@ static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) {
err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap), err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap),
&(wmgen->mask), &(wmgen->attributes)); &(wmgen->mask), &(wmgen->attributes));
if (err != XpmSuccess) { if (err != XpmSuccess) {
fprintf(stderr, "Not enough free colorcells.\n"); fprintf(stderr, "Not enough free colorcells.\n");
exit(1); exit(1);
@ -170,9 +170,9 @@ static int flush_expose(Window w) {
\*******************************************************************************/ \*******************************************************************************/
void RedrawWindow(void) { void RedrawWindow(void) {
flush_expose(iconwin); flush_expose(iconwin);
XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, XCopyArea(display, wmgen.pixmap, iconwin, NormalGC,
0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0); 0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0);
flush_expose(win); flush_expose(win);
XCopyArea(display, wmgen.pixmap, win, NormalGC, XCopyArea(display, wmgen.pixmap, win, NormalGC,
@ -184,9 +184,9 @@ void RedrawWindow(void) {
\*******************************************************************************/ \*******************************************************************************/
void RedrawWindowXY(int x, int y) { void RedrawWindowXY(int x, int y) {
flush_expose(iconwin); flush_expose(iconwin);
XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, XCopyArea(display, wmgen.pixmap, iconwin, NormalGC,
x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0); x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0);
flush_expose(win); flush_expose(win);
XCopyArea(display, wmgen.pixmap, win, NormalGC, XCopyArea(display, wmgen.pixmap, win, NormalGC,
@ -280,12 +280,12 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
int i; int i;
for (i=1; argv[i]; i++) { for (i=1; argv[i]; i++) {
if (!strcmp(argv[i], "-display")) if (!strcmp(argv[i], "-display"))
display_name = argv[i+1]; display_name = argv[i+1];
} }
if (!(display = XOpenDisplay(display_name))) { if (!(display = XOpenDisplay(display_name))) {
fprintf(stderr, "%s: can't open display %s\n", fprintf(stderr, "%s: can't open display %s\n",
wname, XDisplayName(display_name)); wname, XDisplayName(display_name));
exit(1); exit(1);
} }
@ -310,10 +310,10 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
mysizehints.width = 64; mysizehints.width = 64;
mysizehints.height = 64; mysizehints.height = 64;
win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y, win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y,
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix); mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y, iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y,
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix); mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
@ -334,7 +334,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
XSetWMName(display, win, &name); XSetWMName(display, win, &name);
/* Create GC for drawing */ /* Create GC for drawing */
gcm = GCForeground | GCBackground | GCGraphicsExposures; gcm = GCForeground | GCBackground | GCGraphicsExposures;
gcv.foreground = fore_pix; gcv.foreground = fore_pix;
gcv.background = back_pix; gcv.background = back_pix;

View file

@ -1,5 +1,5 @@
Author: Author:
Tomasz Maka <pasp@ll.pl> Tomasz Maka <pasp@ll.pl>
Borrowed code: Borrowed code:

View file

@ -1,7 +1,7 @@
0.1.2 (25-06-2003) 0.1.2 (25-06-2003)
* command line options was replaced by a config file * command line options was replaced by a config file
* now, we can run up to 3 programs on double-click * now, we can run up to 3 programs on double-click
(based on patch by Alan Jurgensen) (based on patch by Alan Jurgensen)
0.1.1 (14-04-2002) 0.1.1 (14-04-2002)

View file

@ -1,5 +1,5 @@
WMTUNLO WMTUNLO
======== ========
It is one of the useless dockapp ever made, so use it or not.... It is one of the useless dockapp ever made, so use it or not....
@ -7,7 +7,7 @@ It is one of the useless dockapp ever made, so use it or not....
The configuration file is stored in $HOME/.clay/ directory. The configuration file is stored in $HOME/.clay/ directory.
There are 8 examples named 'wmtunlorc.example1' thru 'wmtunlorc.example8'. There are 8 examples named 'wmtunlorc.example1' thru 'wmtunlorc.example8'.
To test these examples rename selected file to 'wmtunlorc' and put it into To test these examples rename selected file to 'wmtunlorc' and put it into
$HOME/.clay/ directory, then run wmtunlo. $HOME/.clay/ directory, then run wmtunlo.
You can assign three programs to run when double-click is performed (look at You can assign three programs to run when double-click is performed (look at

View file

@ -3,7 +3,7 @@
/* made from scratch */ /* made from scratch */
/*--------------------------------*/ /*--------------------------------*/
/* /*
functions were written by following People: functions were written by following People:
--- linked list --- linked list
@ -37,7 +37,7 @@
/* Return a cons cell produced from (head . tail) */ /* Return a cons cell produced from (head . tail) */
INLINE LinkedList* INLINE LinkedList*
list_cons(void* head, LinkedList* tail) list_cons(void* head, LinkedList* tail)
{ {
LinkedList* cell; LinkedList* cell;
@ -62,7 +62,7 @@ list_length(LinkedList* list)
return i; return i;
} }
/* Return the Nth element of LIST, where N count from zero. If N /* Return the Nth element of LIST, where N count from zero. If N
larger than the list length, NULL is returned */ larger than the list length, NULL is returned */
INLINE void* INLINE void*
@ -83,7 +83,7 @@ list_nth(int index, LinkedList* list)
INLINE void INLINE void
list_remove_head(LinkedList** list) list_remove_head(LinkedList** list)
{ {
if (!*list) return; if (!*list) return;
if ((*list)->tail) if ((*list)->tail)
{ {
LinkedList* tail = (*list)->tail; /* fetch next */ LinkedList* tail = (*list)->tail; /* fetch next */
@ -101,7 +101,7 @@ INLINE LinkedList *
list_remove_elem(LinkedList* list, void* elem) list_remove_elem(LinkedList* list, void* elem)
{ {
LinkedList *tmp; LinkedList *tmp;
if (list) { if (list) {
if (list->head == elem) { if (list->head == elem) {
tmp = list->tail; tmp = list->tail;
@ -158,7 +158,7 @@ list_mapcar(LinkedList* list, void(*function)(void*))
*---------------------------------------------------------------------- *----------------------------------------------------------------------
* parse_command-- * parse_command--
* Divides a command line into a argv/argc pair. * Divides a command line into a argv/argc pair.
*---------------------------------------------------------------------- *----------------------------------------------------------------------
*/ */
#define PRC_ALPHA 0 #define PRC_ALPHA 0
#define PRC_BLANK 1 #define PRC_BLANK 1
@ -194,11 +194,11 @@ next_token(char *word, char **next)
t = ret = malloc(strlen(word)+1); t = ret = malloc(strlen(word)+1);
ptr = word; ptr = word;
state = 0; state = 0;
*t = 0; *t = 0;
while (1) { while (1) {
if (*ptr==0) if (*ptr==0)
ctype = PRC_EOS; ctype = PRC_EOS;
else if (*ptr=='\\') else if (*ptr=='\\')
ctype = PRC_ESCAPE; ctype = PRC_ESCAPE;
@ -228,12 +228,12 @@ next_token(char *word, char **next)
t = strdup(ret); t = strdup(ret);
free(ret); free(ret);
if (ctype==PRC_EOS) if (ctype==PRC_EOS)
*next = NULL; *next = NULL;
else else
*next = ptr; *next = ptr;
return t; return t;
} }
@ -248,7 +248,7 @@ parse_command(char *command, char ***argv, int *argc)
line = command; line = command;
do { do {
token = next_token(line, &line); token = next_token(line, &line);
if (token) { if (token) {
list = list_cons(token, list); list = list_cons(token, list);
} }
} while (token!=NULL && line!=NULL); } while (token!=NULL && line!=NULL);
@ -271,15 +271,15 @@ execCommand(char *command)
int argc; int argc;
parse_command(command, &argv, &argc); parse_command(command, &argv, &argc);
if (argv==NULL) { if (argv==NULL) {
return 0; return 0;
} }
if ((pid=fork())==0) { if ((pid=fork())==0) {
char **args; char **args;
int i; int i;
args = malloc(sizeof(char*)*(argc+1)); args = malloc(sizeof(char*)*(argc+1));
if (!args) if (!args)
exit(10); exit(10);
@ -385,7 +385,7 @@ static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) {
err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap), err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap),
&(wmgen->mask), &(wmgen->attributes)); &(wmgen->mask), &(wmgen->attributes));
if (err != XpmSuccess) { if (err != XpmSuccess) {
fprintf(stderr, "Not enough free colorcells.\n"); fprintf(stderr, "Not enough free colorcells.\n");
exit(1); exit(1);
@ -432,9 +432,9 @@ static int flush_expose(Window w) {
\*******************************************************************************/ \*******************************************************************************/
void RedrawWindow(void) { void RedrawWindow(void) {
flush_expose(iconwin); flush_expose(iconwin);
XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, XCopyArea(display, wmgen.pixmap, iconwin, NormalGC,
0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0); 0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0);
flush_expose(win); flush_expose(win);
XCopyArea(display, wmgen.pixmap, win, NormalGC, XCopyArea(display, wmgen.pixmap, win, NormalGC,
@ -446,9 +446,9 @@ void RedrawWindow(void) {
\*******************************************************************************/ \*******************************************************************************/
void RedrawWindowXY(int x, int y) { void RedrawWindowXY(int x, int y) {
flush_expose(iconwin); flush_expose(iconwin);
XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, XCopyArea(display, wmgen.pixmap, iconwin, NormalGC,
x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0); x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0);
flush_expose(win); flush_expose(win);
XCopyArea(display, wmgen.pixmap, win, NormalGC, XCopyArea(display, wmgen.pixmap, win, NormalGC,
@ -542,12 +542,12 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
int i; int i;
for (i=1; argv[i]; i++) { for (i=1; argv[i]; i++) {
if (!strcmp(argv[i], "-display")) if (!strcmp(argv[i], "-display"))
display_name = argv[i+1]; display_name = argv[i+1];
} }
if (!(display = XOpenDisplay(display_name))) { if (!(display = XOpenDisplay(display_name))) {
fprintf(stderr, "%s: can't open display %s\n", fprintf(stderr, "%s: can't open display %s\n",
wname, XDisplayName(display_name)); wname, XDisplayName(display_name));
exit(1); exit(1);
} }
@ -572,10 +572,10 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
mysizehints.width = 64; mysizehints.width = 64;
mysizehints.height = 64; mysizehints.height = 64;
win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y, win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y,
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix); mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y, iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y,
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix); mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
@ -596,7 +596,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
XSetWMName(display, win, &name); XSetWMName(display, win, &name);
/* Create GC for drawing */ /* Create GC for drawing */
gcm = GCForeground | GCBackground | GCGraphicsExposures; gcm = GCForeground | GCBackground | GCGraphicsExposures;
gcv.foreground = fore_pix; gcv.foreground = fore_pix;
gcv.background = back_pix; gcv.background = back_pix;
@ -671,7 +671,7 @@ void* p_prefs_openfile (char *filename, int openmode)
prefs_filehandle = fopen (filename, "rb"); prefs_filehandle = fopen (filename, "rb");
else if (openmode == P_WRITE) else if (openmode == P_WRITE)
prefs_filehandle = fopen (filename, "wb"); prefs_filehandle = fopen (filename, "wb");
return prefs_filehandle; return prefs_filehandle;
} }
@ -724,20 +724,20 @@ static char prfline[MAX_LINE_LEN];
int i; int i;
char c; char c;
fseek (prefs_filehandle, 0, SEEK_SET); fseek (prefs_filehandle, 0, SEEK_SET);
while (!feof (prefs_filehandle)) { while (!feof (prefs_filehandle)) {
i = 0; i = 0;
while (((c = fgetc (prefs_filehandle)) != crlf_char) && c!= EOF && i < MAX_LINE_LEN) while (((c = fgetc (prefs_filehandle)) != crlf_char) && c!= EOF && i < MAX_LINE_LEN)
prfline[i++] = c; prfline[i++] = c;
prfline[i] = null_char; prfline[i] = null_char;
if (prfline[0] != '#') if (prfline[0] != '#')
if (!strncmp (tagname, prfline, strlen (tagname))) break; if (!strncmp (tagname, prfline, strlen (tagname))) break;
} }
return prfline; return prfline;
} }
@ -753,7 +753,7 @@ int i;
if ((valpos = strchr (p_prefs_get_line_with_tag (tagname), '='))) { if ((valpos = strchr (p_prefs_get_line_with_tag (tagname), '='))) {
while((c = valpos[i+1]) != null_char && i < MAX_VALUE_LEN) valuestr[i++] = c; while((c = valpos[i+1]) != null_char && i < MAX_VALUE_LEN) valuestr[i++] = c;
} }
valuestr[i] = null_char; valuestr[i] = null_char;
return valuestr; return valuestr;
} }
@ -802,7 +802,7 @@ int len;
(int)(len-maxlength), src); (int)(len-maxlength), src);
len = maxlength; len = maxlength;
} }
memcpy(dest, src, len); memcpy(dest, src, len);
dest[len] = 0; dest[len] = 0;
return dest; return dest;
@ -831,7 +831,7 @@ int src_len, dest_len;
(int)(src_len + dest_len - maxlength), src); (int)(src_len + dest_len - maxlength), src);
src_len = maxlength - dest_len; src_len = maxlength - dest_len;
} }
memcpy(&dest[dest_len], src, src_len); memcpy(&dest[dest_len], src, src_len);
dest[dest_len + src_len] = 0; dest[dest_len + src_len] = 0;
return dest; return dest;

View file

@ -3,7 +3,7 @@
/* made from scratch */ /* made from scratch */
/*--------------------------------*/ /*--------------------------------*/
/* /*
functions were written by following People: functions were written by following People:
--- linked list --- linked list

View file

@ -88,7 +88,7 @@ unsigned char *Image, *Texture, *Tunnel_map;
/* Read preferences */ /* Read preferences */
wmtunlo_read_prefs(); wmtunlo_read_prefs();
/* Open window */ /* Open window */
openXwindow(argc, argv, dock_master, dock_mask_bits, dock_mask_width, dock_mask_height); openXwindow(argc, argv, dock_master, dock_mask_bits, dock_mask_width, dock_mask_height);
@ -175,7 +175,7 @@ unsigned char *Image, *Texture, *Tunnel_map;
px = atan2(yz,xz) * 128.0 / M_PI; px = atan2(yz,xz) * 128.0 / M_PI;
result = (int)py * 256 + (int)px; result = (int)py * 256 + (int)px;
Tunnel_map[k++]= result&0xff; Tunnel_map[k++]= result&0xff;
Tunnel_map[k++]= result>>8; Tunnel_map[k++]= result>>8;
Tunnel_map[k++]= shade&0xff; Tunnel_map[k++]= shade&0xff;
} }
@ -184,13 +184,13 @@ unsigned char *Image, *Texture, *Tunnel_map;
Texture = (unsigned char *)malloc(sizeof(unsigned char)*256*256); Texture = (unsigned char *)malloc(sizeof(unsigned char)*256*256);
for(i=0,q=1;i<256;i+=tex_block_h, q*=-1) for(i=0,q=1;i<256;i+=tex_block_h, q*=-1)
for(j=0,p=q;j<256;j+=tex_block_w, p*=-1) for(j=0,p=q;j<256;j+=tex_block_w, p*=-1)
for(l=0;l<tex_block_h;l++) for(l=0;l<tex_block_h;l++)
for(k=0;k<tex_block_w;k++) for(k=0;k<tex_block_w;k++)
if((j+k < 256) && (i+l < 256)) { if((j+k < 256) && (i+l < 256)) {
if(p>0) if(p>0)
Texture[(i+l)*256+j+k] = t_color_1; Texture[(i+l)*256+j+k] = t_color_1;
else else
Texture[(i+l)*256+j+k] = t_color_2; Texture[(i+l)*256+j+k] = t_color_2;
} }
@ -331,7 +331,7 @@ void ButtonPressEvent(XButtonEvent *xev){
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
/* Write preferences */ /* Write preferences */
void wmtunlo_write_prefs(void) void wmtunlo_write_prefs(void)
{ {
if (p_prefs_openfile (p_getfilename_config (".clay", "wmtunlorc"), P_WRITE)) { if (p_prefs_openfile (p_getfilename_config (".clay", "wmtunlorc"), P_WRITE)) {
@ -362,14 +362,14 @@ void wmtunlo_write_prefs(void)
p_prefs_put_string("command3", ClickCommand3); p_prefs_put_string("command3", ClickCommand3);
} }
p_prefs_closefile (); p_prefs_closefile ();
} }
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
/* Read preferences */ /* Read preferences */
void wmtunlo_read_prefs(void) void wmtunlo_read_prefs(void)
{ {
if (p_prefs_openfile (p_getfilename_config(".clay", "wmtunlorc"), P_READ)) { if (p_prefs_openfile (p_getfilename_config(".clay", "wmtunlorc"), P_READ)) {
@ -398,9 +398,9 @@ void wmtunlo_read_prefs(void)
strcpy(ClickCommand1, p_prefs_get_string ("command1")); strcpy(ClickCommand1, p_prefs_get_string ("command1"));
strcpy(ClickCommand2, p_prefs_get_string ("command2")); strcpy(ClickCommand2, p_prefs_get_string ("command2"));
strcpy(ClickCommand3, p_prefs_get_string ("command3")); strcpy(ClickCommand3, p_prefs_get_string ("command3"));
p_prefs_closefile (); p_prefs_closefile ();
} else { } else {
shade_switch = 1; shade_switch = 1;

View file

@ -1,6 +1,6 @@
CC = gcc CC = gcc
CFLAGS = -O2 -Wall -I/usr/X11R6/include -DVIDEO_DEV=\"/dev/video\" CFLAGS = -O2 -Wall -I/usr/X11R6/include -DVIDEO_DEV=\"/dev/video\"
LDFLAGS = LDFLAGS =
LIBS = -L/usr/X11R6/lib -lX11 -lXext -lm -ljpeg LIBS = -L/usr/X11R6/lib -lX11 -lXext -lm -ljpeg
OBJS = minirgb.o wmwebcam.o OBJS = minirgb.o wmwebcam.o

View file

@ -159,7 +159,7 @@ void minirgb_draw(Window drawable, GC gc, int x, int y, int width,
} }
#ifdef VERBOSE #ifdef VERBOSE
printf("minirgb: image %p %dx%d (bpp: %d, bpl: %d)\n", image, width, height, bpp, image->bytes_per_line); printf("minirgb: image %p %dx%d (bpp: %d, bpl: %d)\n", image, width, height, bpp, image->bytes_per_line);
#endif #endif
image->data = malloc(image->bytes_per_line * height); image->data = malloc(image->bytes_per_line * height);
if (!image->data) { if (!image->data) {
fprintf(stderr, "minirgb: allocation error\n"); fprintf(stderr, "minirgb: allocation error\n");

View file

@ -1,89 +1,89 @@
#define wmwebcam_mask_width 128 #define wmwebcam_mask_width 128
#define wmwebcam_mask_height 64 #define wmwebcam_mask_height 64
static char wmwebcam_mask_bits[] = { static char wmwebcam_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, 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, 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,
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, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 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,
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, 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, 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,
0x00, 0x00, 0x00, 0x00, }; 0x00, 0x00, 0x00, 0x00, };

View file

@ -203,11 +203,11 @@ get_image (int dev, int width, int height,int *size)
void void
put_image_jpeg (char *image, int width, int height, int quality) put_image_jpeg (char *image, int width, int height, int quality)
{ {
FILE *output; FILE *output;
int y, x, line_width; int y, x, line_width;
JSAMPROW row_ptr[1]; JSAMPROW row_ptr[1];
struct jpeg_compress_struct cjpeg; struct jpeg_compress_struct cjpeg;
struct jpeg_error_mgr jerr; struct jpeg_error_mgr jerr;
char *line; char *line;